File indexing completed on 2025-08-03 08:20:58
0001 #ifndef BBC_BBCMON_H
0002 #define BBC_BBCMON_H
0003
0004 #include <onlmon/OnlMon.h>
0005 #include "BbcMonDefs.h"
0006 #include <onlmon/triggerEnum.h>
0007
0008 #include <string>
0009 #include <ctime>
0010
0011 class Event;
0012 class TH1;
0013 class TH2;
0014 class TF1;
0015 class TH2Poly;
0016 class MbdEvent;
0017 class MbdGeom;
0018 class MbdOut;
0019 class MbdPmtContainer;
0020
0021 class eventReceiverClient;
0022 class RunDBodbc;
0023
0024
0025 class BbcMon : public OnlMon
0026 {
0027 public:
0028 explicit BbcMon(const std::string &name = "BBCMON");
0029 virtual ~BbcMon();
0030
0031 int process_event(Event *evt) override;
0032 int Init() override;
0033 int BeginRun(const int runno) override;
0034 int EndRun(const int runno) override;
0035 int Reset() override;
0036
0037 void set_GL1(const int g) { useGL1 = g; }
0038 void set_skipto(const int s) { skipto = s; }
0039
0040 protected:
0041 int DBVarInit();
0042
0043 MbdEvent *bevt{nullptr};
0044
0045 int useGL1{1};
0046 uint64_t triggervec{0};
0047 uint64_t triginput{0};
0048 uint64_t trigraw{0};
0049 uint64_t triglive{0};
0050 uint64_t trigscaled{0};
0051
0052 uint64_t trigmask{0};
0053 uint64_t mbdtrig{0};
0054 uint64_t mbdwidebest{0};
0055 uint64_t mbdbest{0};
0056 uint64_t mbdns{0};
0057 uint64_t mbdnsvtx10{0};
0058 uint64_t mbdnsvtx30{0};
0059 uint64_t mbdnsvtx150{0};
0060 uint64_t zdcns{0};
0061 uint64_t emcal{0};
0062 uint64_t hcal{0};
0063 uint64_t emcalmbd{0};
0064 uint64_t hcalmbd{0};
0065 uint64_t orig_trigmask{0};
0066 eventReceiverClient *erc{nullptr};
0067 int skipto{0};
0068
0069 RunDBodbc *rdb{nullptr};
0070
0071 uint64_t GetMinBiasTrigBit(uint64_t trigs_enabled);
0072 uint64_t GetMinBiasWideTrigBit(uint64_t trigs_enabled);
0073
0074 int evtcnt{0};
0075
0076
0077 MbdGeom *_mbdgeom{nullptr};
0078 MbdOut *m_mbdout{nullptr};
0079 MbdPmtContainer *m_mbdpmts{nullptr};
0080
0081
0082 int fillnumber{0};
0083 int sendflag{0};
0084 std::string sendflagfname;
0085 int GetFillNumber();
0086 int GetSendFlag();
0087 int UpdateSendFlag(const int flag);
0088 std::time_t prev_send_time{0};
0089 std::time_t tstart{0};
0090
0091
0092 int zresetflag{0};
0093 std::string zresetflagfname;
0094 int GetZResetFlag();
0095 int UpdateZResetFlag(const int flag);
0096
0097
0098 int gl1badflag{0};
0099 std::string gl1badflagfname;
0100 int GetGL1BadFlag();
0101 int UpdateGL1BadFlag(const int flag);
0102
0103 TH1 *bbc_trigs{nullptr};
0104 TH2 *bbc_adc{nullptr};
0105 TH2 *bbc_tdc{nullptr};
0106 TH2 *bbc_tdc_overflow{nullptr};
0107 TH1 *bbc_tdc_overflow_each[128] = {};
0108 TH1 *bbc_south_nhit{nullptr};
0109 TH1 *bbc_north_nhit{nullptr};
0110 TH1 *bbc_nhit_emcal[2]{nullptr,nullptr};
0111 TH1 *bbc_nhit_hcal[2]{nullptr,nullptr};
0112 TH1 *bbc_nhit_emcalmbd[2]{nullptr,nullptr};
0113 TH1 *bbc_nhit_hcalmbd[2]{nullptr,nullptr};
0114
0115 TH1 * bbc_zvertex_autoupdate[TriggerEnum::NUM_MBD_TRIGGERS]{nullptr};
0116 unsigned int bbc_last_update_ticker[TriggerEnum::NUM_MBD_TRIGGERS]{0};
0117
0118 TH2 *bbc_tdc_armhittime{nullptr};
0119 TH1 *bbc_nevent_counter{nullptr};
0120
0121 TH1 *bbc_zvertex{nullptr};
0122 TH1 *bbc_zvertex_alltrigger{nullptr};
0123 TH1 *bbc_zvertex_short{nullptr};
0124 TH1 *bbc_zvertex_prime_short{nullptr};
0125 TH1 *bbc_zvertex_ns{nullptr};
0126 TH1 *bbc_zvertex_10{nullptr};
0127 TH1 *bbc_zvertex_30{nullptr};
0128 TH1 *bbc_zvertex_60{nullptr};
0129 TH1 *bbc_zvertex_ns_chk{nullptr};
0130 TH1 *bbc_zvertex_10_chk{nullptr};
0131 TH1 *bbc_zvertex_30_chk{nullptr};
0132 TH1 *bbc_zvertex_60_chk{nullptr};
0133 TH1 *bbc_zvertex_zdcns{nullptr};
0134 TH1 *bbc_zvertex_emcal{nullptr};
0135 TH1 *bbc_zvertex_hcal{nullptr};
0136 TH1 *bbc_zvertex_emcalmbd{nullptr};
0137 TH1 *bbc_zvertex_hcalmbd{nullptr};
0138 TF1 *f_zvtx{nullptr};
0139
0140
0141
0142 TH2 *bbc_tzero_zvtx{nullptr};
0143 TH1 *bbc_avr_hittime{nullptr};
0144 TH1 *bbc_south_hittime{nullptr};
0145 TH1 *bbc_north_hittime{nullptr};
0146 TH1 *bbc_south_chargesum{nullptr};
0147 TH1 *bbc_north_chargesum{nullptr};
0148 TH1 *bbc_prescale_hist{nullptr};
0149
0150 TH1 *bbc_runvtx{nullptr};
0151 TH1 *bbc_runvtxerr{nullptr};
0152 TH1 *bbc_runvtxtime{nullptr};
0153
0154
0155 TH2 *bbc_time_wave{nullptr};
0156 TH2 *bbc_charge_wave{nullptr};
0157
0158
0159 TH2Poly *bbc_south_hitmap{nullptr};
0160 TH2Poly *bbc_north_hitmap{nullptr};
0161 const unsigned int zvtx_autoupdate_ticker = 1000;
0162
0163 };
0164
0165 #endif