Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:21:01

0001 #ifndef INTT_MON_H
0002 #define INTT_MON_H
0003 
0004 #include <onlmon/OnlMon.h>
0005 
0006 #include <chrono>
0007 #include <set>
0008 #include <string>
0009 
0010 class Packet;
0011 class TH1;
0012 
0013 class InttMon : public OnlMon
0014 {
0015  public:
0016   InttMon(const std::string& name);
0017   virtual ~InttMon();
0018 
0019   int Init();
0020   int BeginRun(const int);
0021   int process_event(Event*);
0022   int Reset();
0023 
0024   int MiscDebug();
0025 
0026  private:
0027   static constexpr int NCHIPS = 26;
0028   static constexpr int NFEES = 14;
0029   static constexpr int NBCOS = 128;
0030 
0031   // int static const m_MAX_BCO_DIFF = 1000;
0032 
0033   int static const m_LOG_DURATION = 3600; // seconds
0034   int static const m_LOG_INTERVAL = 30;   // seconds
0035 
0036   Packet** plist{nullptr};
0037   TH1* EvtHist{nullptr};
0038   TH1* HitHist{nullptr};
0039   TH1* BcoHist{nullptr};
0040   TH1* LogHist{nullptr};
0041 
0042   struct bco_comparator_s
0043   {
0044       unsigned long long static const MAX = (unsigned long long){1} << 40;
0045       bool operator()(unsigned long long const&, unsigned long long const&) const;
0046   } const m_bco_less{};
0047   std::set<unsigned long long, bco_comparator_s> m_unique_bcos;
0048   unsigned long long m_most_recent_bco = 0;
0049   unsigned long long m_last_flushed_bco = 0; 
0050 
0051   int m_unique_bco_count = {};
0052   int m_log_bin = 0;
0053   int m_logged_bcos = 0;
0054   int m_evt_per_cout = 50000;
0055 
0056   std::chrono::time_point<std::chrono::system_clock> m_start_time{};
0057 };
0058 
0059 #endif