Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-04-04 08:16:08

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   static const int nPacketStatus{6};
0044   TH1* h1_cemc_adc = nullptr;
0045 
0046   static const int Nsector = 64;
0047   const int Ntower = 64 * 2 * 192;
0048   const int packetlow = 6001;
0049   const int packethigh = 6128;
0050   const int m_nChannels = 192;
0051   const int templateDepth = 10000;
0052   const int nPhiIndex = 256;
0053   const int nEtaIndex = 96;
0054   int eventCounter = 0;
0055   CDBTTree* cdbttree{nullptr};
0056   TH2D* h2_template_hit = {nullptr};
0057   TH2* h2_cemc_hits_trig[64] = {nullptr};
0058   TH1* h1_cemc_trig{nullptr};
0059   TH1* h1_packet_event{nullptr};
0060   TH2* h2_caloPack_gl1_clock_diff{nullptr};
0061   TProfile* h_evtRec{nullptr};
0062   TProfile2D* p2_zsFrac_etaphi{nullptr};
0063   TProfile2D* p2_zsFrac_etaphi_all{nullptr};
0064 
0065   TH1* h1_packet_chans{nullptr};
0066   TH1* h1_packet_length{nullptr};
0067   TH1* h1_packet_number{nullptr};
0068   TH1* h1_cemc_fitting_sigDiff{nullptr};
0069   TH1* h1_cemc_fitting_pedDiff{nullptr};
0070   TH1* h1_cemc_fitting_timeDiff{nullptr};
0071   TH2* h2_cemc_hits{nullptr};
0072   TH2* h2_waveform_twrAvg{nullptr};
0073   TH1* h1_waveform_time{nullptr};
0074   TH1* h1_waveform_pedestal{nullptr};
0075   TH2* h2_cemc_rm{nullptr};
0076   TH2* h2_cemc_rmhits_alltrig{nullptr};
0077   TH2* h2_cemc_rmhits{nullptr};
0078   TH2* h2_cemc_mean{nullptr};
0079   TH1* h1_sectorAvg_total{nullptr};
0080   TH1* h1_event{nullptr};
0081   TH1* h1_rm_sectorAvg[100] = {nullptr};
0082   TH1* h1_packet_status[nPacketStatus] = {nullptr};
0083 
0084 
0085   TProfile2D* p2_bad_chi2{nullptr};
0086   TProfile2D* p2_pre_post{nullptr};
0087   // TProfile*** h2_waveform= {nullptr};
0088   std::vector<runningMean*> rm_vector_twr;
0089   std::vector<runningMean*> rm_vector_twrhits;
0090   std::vector<runningMean*> rm_vector_twrhits_alltrig;
0091 
0092   std::string runtypestr = "Unknown";
0093 
0094   eventReceiverClient* erc = {nullptr};
0095   bool anaGL1 = true;
0096   bool usembdtrig = true;
0097 
0098   CaloWaveformFitting* WaveformProcessingFast = nullptr;
0099   CaloWaveformFitting* WaveformProcessingTemp = nullptr;
0100 
0101   bool isHottower(int pid, int channelid)
0102   {
0103     if (pid == 6014 && channelid == 158) return true;
0104     if (pid == 6021 && channelid == 1) return true;
0105     if (pid == 6030 && channelid == 158) return true;
0106     if (pid == 6076 && channelid == 92) return true;
0107     if (pid == 6127 && channelid == 28) return true;
0108     if (pid == 6080 && channelid == 62) return true;
0109     if (pid == 6080 && channelid == 60) return true;
0110     if (pid == 6080 && channelid == 63) return true;
0111     if (pid == 6080 && channelid == 61) return true;
0112     if (pid == 6080 && channelid == 59) return true;
0113     if (pid == 6080 && channelid == 57) return true;
0114 
0115     return false;
0116   }
0117 };
0118 
0119 #endif /* CEMC_CEMCMON_H */