Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef SEPD_SEPDMON_H
0002 #define SEPD_SEPDMON_H
0003 
0004 #include <onlmon/OnlMon.h>
0005 #include <cmath>
0006 #include <vector>
0007 
0008 class CaloWaveformFitting;
0009 class TowerInfoContainer;
0010 class Event;
0011 class TH1;
0012 class TH2;
0013 class Packet;
0014 class TProfile;
0015 class TProfile2D;
0016 class runningMean;
0017 class eventReceiverClient;
0018 
0019 class SepdMon : public OnlMon
0020 {
0021  public:
0022   SepdMon(const std::string &name);
0023   virtual ~SepdMon();
0024 
0025   int process_event(Event *evt);
0026   int Init();
0027   int BeginRun(const int runno);
0028   int Reset();
0029 
0030  protected:
0031   std::vector<float> getSignal(Packet *p, const int channel);
0032   std::vector<float> anaWaveformFast(Packet *p, const int channel);
0033   std::vector<float> anaWaveformTemp(Packet *p, const int channel);
0034   int evtcnt = 0;
0035   int idummy = 0;
0036   static const int nPacketStatus = 6;
0037 
0038   // --- copied straight from the MBD
0039   uint64_t mbdtrig{0};        // main mbd trigger
0040   uint64_t mbdns{0};          // mbdns n>=1 or 2 bit
0041   uint64_t mbdnsvtx10{0};     // mbdns vtx<10 bit
0042   uint64_t mbdnsvtx30{0};     // mbdns vtx<30 bit
0043   uint64_t mbdnsvtx150{0};     // mbdns vtx<150 bit
0044 
0045   const int Nsector = 24;
0046   const int Nchannel = 192 * 4;
0047   const int packetlow = 9001;
0048   const int packethigh = 9006;
0049   const int m_nChannels = 192;
0050 
0051   const int packet_depth = 1000;
0052   const float hit_threshold = 10;
0053   const int n_samples_show = 31;
0054 
0055   const int nChannels = 744;
0056   int nPhi0 = 12;
0057   int nPhi = 24;
0058   int nRad = 24;
0059   double axislimit = M_PI;
0060 
0061   TH2 *h_ADC_corr = nullptr;
0062   TH2 *h_hits_corr = nullptr;
0063 
0064   TH1 *h1_waveform_twrAvg = nullptr;
0065   TH1 *h1_waveform_time = nullptr;
0066   TH1 *h1_waveform_pedestal = nullptr;
0067   TH1 *h_event = nullptr;
0068   TH2 *h2_sepd_waveform = nullptr;
0069 
0070   TH1 *h1_sepd_fitting_sigDiff = nullptr;
0071   TH1 *h1_sepd_fitting_pedDiff = nullptr;
0072   TH1 *h1_sepd_fitting_timeDiff = nullptr;
0073 
0074   TH1 *h1_packet_chans = nullptr;
0075   TH1 *h1_packet_length = nullptr;
0076   TH1 *h1_packet_number = nullptr;
0077   TH1 *h1_packet_event = nullptr;
0078 
0079   TProfile *p_noiserms_all_channel{nullptr};
0080   TH1 *h_hits_all_channel = nullptr;
0081   TH1 *h_ADC_all_channel = nullptr;
0082   TH1 *h_ADC_channel[768] = {nullptr};
0083   TH1 *h1_packet_status[nPacketStatus];
0084   //TH1 *h_ADC_channel[744] = {nullptr};
0085 
0086   std::string runtypestr = "Unknown";
0087   std::string id_string;
0088 
0089   CaloWaveformFitting *WaveformProcessingFast = nullptr;
0090   CaloWaveformFitting *WaveformProcessingTemp = nullptr;
0091   eventReceiverClient *erc = nullptr;
0092 
0093   std::vector<runningMean *> rm_packet_number;
0094   std::vector<runningMean *> rm_packet_length;
0095   std::vector<runningMean *> rm_packet_chans;
0096   std::vector<runningMean *> rm_packet_event;
0097 };
0098 
0099 #endif /* SEPD_SEPDMON_H */