Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:21: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 DrawServerStats();
0045   int FindHotTower(TPad* warn, TH2*, bool usetemplate = true, float cold_threshold=0.75, float hot_threshold=1.5, float dead_threshold=0.01);
0046   int FindGainMode(TPad *warn, TH2 *);
0047   void DrawTowerAvg();
0048   void DrawHitMap();
0049   void DrawAvgTime();
0050   
0051   void MakeZSPalette()
0052   {
0053     if(ZSPalette[0] > 0) return;
0054     Double_t red[9] {1.0, 0.0592, 0.0780, 0.0232, 0.1802, 0.5301, 0.8186, 0.9956, 0.9764};
0055     Double_t green[9] {0.0, 0.3599, 0.5041, 0.6419, 0.7178, 0.7492, 0.7328, 0.7862, 0.9832};
0056     Double_t blue[9] {0.0, 0.8684, 0.8385, 0.7914, 0.6425, 0.4662, 0.3499, 0.1968, 0.0539};
0057     Double_t stops[9] {0.0, 0.04, 0.12, 0.15, 0.2, 0.25, 0.3, 0.35, 1.0000};
0058     Int_t nb {255};
0059     Int_t FI = TColor::CreateGradientColorTable(9, stops, red, green, blue, nb, 1.);
0060 
0061     for (int i = 0; i < nb; i++)
0062     {
0063       ZSPalette[i] = FI + i;
0064     }
0065 
0066   }
0067 
0068   // int DrawDeadServer(TPad *transparent);
0069   std::string prefix {"HCALMON"};
0070   TCanvas* TC[100] {nullptr};
0071   TPad* transparent[19] {nullptr};
0072   TPad* Pad[29] {nullptr};
0073   TPad* warning[28] {nullptr};
0074   TH2* h2_mean_template {nullptr};
0075   TH2* h2_mean_template_cosmic {nullptr};
0076   TH2 *h2_noiserms{nullptr};
0077   TProfile2D *p2_noiserms{nullptr};
0078   TH1* h1_zs {nullptr};
0079   TH1* h1_zs_low {nullptr};
0080   TH1* h1_zs_high {nullptr};
0081   
0082   Int_t ZSPalette[255] {0};
0083 
0084   //  TGraphErrors* gr[2] {nullptr};
0085   TStyle* hcalStyle {nullptr};
0086   std::string hcalmon[2];
0087 };
0088 
0089 #endif /* HCAL_HCALMONDRAW_H */