File indexing completed on 2025-08-03 08:20:59
0001 #ifndef CEMC_CEMCMON_H
0002 #define CEMC_CEMCMON_H
0003
0004 #include <onlmon/OnlMon.h>
0005
0006 #include <vector>
0007
0008 class CaloWaveformFitting;
0009 class TowerInfoContainer;
0010 class Event;
0011 class TH1;
0012 class TH2;
0013 class TH2D;
0014 class TProfile;
0015 class TProfile2D;
0016 class Packet;
0017 class runningMean;
0018 class eventReceiverClient;
0019 class CDBTTree;
0020
0021 class CemcMon : public OnlMon
0022 {
0023 public:
0024 explicit CemcMon(const std::string& name);
0025 virtual ~CemcMon();
0026
0027 int process_event(Event* evt);
0028 int Init();
0029 int BeginRun(const int runno);
0030 int Reset();
0031 void set_anaGL1(bool state)
0032 {
0033 anaGL1 = state;
0034 return;
0035 }
0036
0037 protected:
0038 std::vector<float> getSignal(Packet* p, const int channel);
0039 std::vector<float> anaWaveformFast(Packet* p, const int channel);
0040 std::vector<float> anaWaveformTemp(Packet* p, const int channel);
0041
0042 int idummy = 0;
0043 TH1* h1_cemc_adc = nullptr;
0044
0045 static const int Nsector = 64;
0046 const int Ntower = 64 * 2 * 192;
0047 const int packetlow = 6001;
0048 const int packethigh = 6128;
0049 const int m_nChannels = 192;
0050 const int templateDepth = 10000;
0051 const int nPhiIndex = 256;
0052 const int nEtaIndex = 96;
0053 int eventCounter = 0;
0054 CDBTTree* cdbttree{nullptr};
0055 TH2D* h2_template_hit = {nullptr};
0056 TH2* h2_cemc_hits_trig[64] = {nullptr};
0057 TH1* h1_cemc_trig{nullptr};
0058 TH1* h1_packet_event{nullptr};
0059 TH2* h2_caloPack_gl1_clock_diff{nullptr};
0060 TProfile* h_evtRec{nullptr};
0061 TProfile2D* p2_zsFrac_etaphi{nullptr};
0062 TProfile2D* p2_zsFrac_etaphi_all{nullptr};
0063
0064 TH1* h1_packet_chans{nullptr};
0065 TH1* h1_packet_length{nullptr};
0066 TH1* h1_packet_number{nullptr};
0067 TH1* h1_cemc_fitting_sigDiff{nullptr};
0068 TH1* h1_cemc_fitting_pedDiff{nullptr};
0069 TH1* h1_cemc_fitting_timeDiff{nullptr};
0070 TH2* h2_cemc_hits{nullptr};
0071 TH2* h2_waveform_twrAvg{nullptr};
0072 TH1* h1_waveform_time{nullptr};
0073 TH1* h1_waveform_pedestal{nullptr};
0074 TH2* h2_cemc_rm{nullptr};
0075 TH2* h2_cemc_rmhits_alltrig{nullptr};
0076 TH2* h2_cemc_rmhits{nullptr};
0077 TH2* h2_cemc_mean{nullptr};
0078 TH1* h1_sectorAvg_total{nullptr};
0079 TH1* h1_event{nullptr};
0080 TH1* h1_rm_sectorAvg[100] = {nullptr};
0081 TProfile2D* p2_bad_chi2{nullptr};
0082 TProfile2D* p2_pre_post{nullptr};
0083
0084 std::vector<runningMean*> rm_vector_twr;
0085 std::vector<runningMean*> rm_vector_twrhits;
0086 std::vector<runningMean*> rm_vector_twrhits_alltrig;
0087
0088 std::string runtypestr = "Unknown";
0089
0090 eventReceiverClient* erc = {nullptr};
0091 bool anaGL1 = true;
0092 bool usembdtrig = true;
0093
0094 CaloWaveformFitting* WaveformProcessingFast = nullptr;
0095 CaloWaveformFitting* WaveformProcessingTemp = nullptr;
0096
0097 bool isHottower(int pid, int channelid)
0098 {
0099 if (pid == 6014 && channelid == 158) return true;
0100 if (pid == 6030 && channelid == 158) return true;
0101 if (pid == 6076 && channelid == 92) return true;
0102 if (pid == 6127 && channelid == 28) return true;
0103 return false;
0104 }
0105 };
0106
0107 #endif