Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef HCAL_HCALMONDRAW_H
0002 #define HCAL_HCALMONDRAW_H
0003 
0004 #include <onlmon/OnlMonDraw.h>
0005 
0006 #include <Rtypes.h>
0007 #include <TColor.h>
0008 
0009 #include <string>  // for allocator, string
0010 
0011 class TCanvas;
0012 class TGraphErrors;
0013 class TH1;
0014 class TH2;
0015 class TPad;
0016 class TStyle;
0017 class TProfile;
0018 class TProfile2D;
0019 
0020 class HcalMonDraw : public OnlMonDraw
0021 {
0022  public:
0023   explicit HcalMonDraw(const std::string& name);
0024 
0025   ~HcalMonDraw() override {}
0026 
0027   int Init() override;
0028   int Draw(const std::string& what = "ALL") override;
0029   int MakeHtml(const std::string& what = "ALL") override;
0030   int SavePlot(const std::string& what = "ALL", const std::string& type = "png") override;
0031   void HandleEvent(int, int, int, TObject*);
0032 
0033  private:
0034   int MakeCanvas(const std::string& name);
0035   int DrawFirst(const std::string& what = "ALL");
0036   int DrawAllTrigHits(const std::string& what = "ALL");
0037   int DrawSecond(const std::string& what = "ALL");
0038   int DrawThird(const std::string& what = "ALL");
0039   int DrawFourth(const std::string& what = "ALL");
0040   int DrawFifth(const std::string& what = "ALL");
0041   int DrawSixth(const std::string& what = "ALL");
0042   int DrawSeventh(const std::string& what = "ALL");
0043   int DrawNoiseRMS(const std::string &what = "ALL");
0044   int DrawEighth(const std::string &what ="ALL");
0045   int DrawServerStats();
0046   int FindHotTower(TPad* warn, TH2*, bool usetemplate = true, float cold_threshold=0.75, float hot_threshold=1.5, float dead_threshold=0.01);
0047   int FindGainMode(TPad *warn, TH2 *);
0048   void DrawTowerAvg();
0049   void DrawHitMap();
0050   void DrawAvgTime();
0051   bool is_uninstrumented(int ieta, int iphi);
0052   
0053   void MakeZSPalette()
0054   {
0055     if(ZSPalette[0] > 0) return;
0056     Double_t red[9] {1.0, 0.0592, 0.0780, 0.0232, 0.1802, 0.5301, 0.8186, 0.9956, 0.9764};
0057     Double_t green[9] {0.0, 0.3599, 0.5041, 0.6419, 0.7178, 0.7492, 0.7328, 0.7862, 0.9832};
0058     Double_t blue[9] {0.0, 0.8684, 0.8385, 0.7914, 0.6425, 0.4662, 0.3499, 0.1968, 0.0539};
0059     Double_t stops[9] {0.0, 0.04, 0.12, 0.15, 0.2, 0.25, 0.3, 0.35, 1.0000};
0060     Int_t nb {255};
0061     Int_t FI = TColor::CreateGradientColorTable(9, stops, red, green, blue, nb, 1.);
0062 
0063     for (int i = 0; i < nb; i++)
0064     {
0065       ZSPalette[i] = FI + i;
0066     }
0067 
0068   }
0069 
0070   // int DrawDeadServer(TPad *transparent);
0071   std::string prefix {"HCALMON"};
0072   TCanvas* TC[100] {nullptr};
0073   TPad* transparent[19] {nullptr};
0074   TPad* Pad[30] {nullptr};
0075   TPad* warning[28] {nullptr};
0076   TH2* h2_mean_template {nullptr};
0077   TH2* h2_mean_template_early {nullptr};
0078   TH2* h2_mean_template_cosmic {nullptr};
0079   TH2 *h2_noiserms{nullptr};
0080   TProfile2D *p2_noiserms{nullptr};
0081   TH1* h1_zs {nullptr};
0082   TH1* h1_zs_low {nullptr};
0083   TH1* h1_zs_high {nullptr};
0084   const int nPacketStatus{6};
0085   
0086   Int_t ZSPalette[255] {0};
0087 
0088   //  TGraphErrors* gr[2] {nullptr};
0089   TStyle* hcalStyle {nullptr};
0090   std::string hcalmon[2];
0091 };
0092 
0093 #endif /* HCAL_HCALMONDRAW_H */