Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef INTT_MON_DRAW_H
0002 #define INTT_MON_DRAW_H
0003 
0004 #include <onlmon/OnlMonClient.h>
0005 #include <onlmon/OnlMonDB.h>
0006 #include <onlmon/OnlMonDraw.h>
0007 
0008 #include <TCanvas.h>
0009 #include <TPad.h>
0010 #include <TROOT.h>
0011 #include <TStyle.h>
0012 #include <TSystem.h>
0013 
0014 #include <TLine.h>
0015 #include <TPolyLine.h>
0016 #include <TText.h>
0017 
0018 #include <TH1D.h>
0019 #include <TH2D.h>
0020 
0021 #include <cctype>
0022 #include <cmath>
0023 #include <ctime>
0024 #include <fstream>
0025 #include <iostream>
0026 #include <limits>
0027 #include <sstream>
0028 #include <string>
0029 #include <vector>
0030 
0031 class InttMonDraw : public OnlMonDraw
0032 {
0033  public:
0034   // InttMonDraw.cc
0035   InttMonDraw(std::string const&);
0036   ~InttMonDraw() override;
0037 
0038   int Init() override;
0039   int Draw(std::string const& = "ALL") override;
0040   int MakeHtml(std::string const& = "ALL") override;
0041   int SavePlot(std::string const& = "ALL", std::string const& = "png") override;
0042 
0043   void set_cold_threshold ( double const& lower ) { m_lower = lower; }
0044   void set_hot_threshold ( double const& upper ) { m_upper = upper; }
0045 
0046  private:
0047   static constexpr int NCHIPS = 26;
0048   static constexpr int NFEES = 14;
0049   static constexpr int NBCOS = 128;
0050 
0051   int MakeCanvas(const std::string& name);
0052   int DrawServerStats();
0053 
0054   int MakeDispPad(int icnvs, double lgnd_frac = std::numeric_limits<double>::quiet_NaN());
0055   int DrawDispPad_Generic(int icnvs, const std::string& title);
0056 
0057   int Draw_FelixBcoFphxBco();
0058   int DrawHistPad_FelixBcoFphxBco(int i, int icnvs);
0059 
0060   int Draw_JustFphxBco();
0061   int DrawHistPad_JustFphxBco(int i, int icnvs);
0062 
0063   int Draw_ZoomedFphxBco();
0064   int DrawHistPad_ZoomedFphxBco(int i, int icnvs);
0065 
0066   Color_t static GetFeeColor(int const&);
0067   int static GetFeeStyle(int const&);
0068 
0069   int Draw_HitMap();
0070   int DrawLgndPad_HitMap();
0071   int DrawHistPad_HitMap(int i, int icnvs);
0072 
0073   int Draw_HitRates();
0074   int DrawHistPad_HitRates(int i, int icnvs);
0075 
0076   // int Draw_Peaks();
0077   // int DrawHistPad_Peaks(int);
0078   // int DrawPeaks_GetFeePeakAndWidth(int, double*, double*, double*);
0079   // TMultiGraph* m_hist_hitrates[8] = {nullptr};
0080   // ...
0081 
0082   int Draw_History();
0083   int Draw_TimingOkay();
0084 
0085   enum
0086   {
0087     k_server_stats = 0,  // Reserved for Chris
0088     // I don't use it, it just offsets the enum
0089 
0090     k_felixbcofphxbco,
0091     k_justfphxbco,
0092     k_zoomedfphxbco,
0093     k_hitmap,
0094     k_hitrates,
0095     k_peaks,
0096     k_history,
0097     k_timing_okay,
0098 
0099     k_end
0100   };
0101 
0102   // Member Variables
0103   TStyle* m_style{nullptr};  // delete
0104 
0105   TCanvas* TC[k_end]{nullptr};
0106   TPad* transparent[k_end]{nullptr};
0107 
0108   TPad* m_disp_pad[k_end]{nullptr};
0109   TPad* m_lgnd_pad[k_end]{nullptr};
0110   TPad* m_hist_pad[k_end][8]{{nullptr}};
0111   TPad* m_left_hist_pad[k_end][8]{{nullptr}};
0112   TPad* m_right_hist_pad[k_end][8]{{nullptr}};
0113   TPad* m_transparent_pad[k_end][8]{{nullptr}};
0114   TPad* m_single_hist_pad[k_end]{nullptr};
0115   TPad* m_timing_okay_pad[k_end]{nullptr};
0116   TPad* m_single_transparent_pad[k_end]{nullptr};
0117 
0118   TH1* m_hist_felixbcofphxbco[8][14]{{nullptr}};
0119   TH1* m_hist_justfphxbco[8][14]{{nullptr}};
0120   TH1* m_left_hist_zoomedfphxbco[8][14]{{nullptr}};
0121   TH1* m_right_hist_zoomedfphxbco[8][14]{{nullptr}};
0122   TH1* m_hist_hitrates[8]{nullptr};
0123   TH2* m_hist_hitmap[8]{nullptr};
0124   TH1* m_hist_history[8]{nullptr};
0125 
0126   // Some things are universal
0127   int m_cnvs_width = 1280;
0128   int m_cnvs_height = 720;
0129 
0130   double constexpr static m_disp_frac = 0.15;
0131   double constexpr static m_disp_text_size = 0.2;
0132   double constexpr static m_warn_text_size = 0.15;
0133   double constexpr static m_min_events = 50000;
0134 
0135   // pp defaults
0136   double m_lower = 0.015;
0137   double m_upper = 0.650;
0138 
0139   // AuAu defaults
0140   // double m_lower = 0.400;
0141   // // double m_upper = 2.500; // For DAC0 = 30
0142   // double m_upper = 8.000; // For DAC0 = 25, some channels become hotter but it is not something the shift crew should worry about
0143 };
0144 
0145 #endif