Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InttMonDraw.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file InttMonDraw.h
1 #ifndef INTT_MON_DRAW_H
2 #define INTT_MON_DRAW_H
3 
4 #include "InttMonConstants.h"
5 #include "InttFelixMap.h"
6 #include "InttMon.h"
7 
8 #include <onlmon/OnlMonDraw.h>
9 #include <onlmon/OnlMonClient.h>
10 #include <onlmon/OnlMonDB.h>
11 
12 #include <TStyle.h>
13 #include <TCanvas.h>
14 #include <TPad.h>
15 #include <TSystem.h>
16 #include <TROOT.h>
17 
18 #include <TLine.h>
19 #include <TText.h>
20 
21 #include <TH2D.h>
22 #include <TH1D.h>
23 
24 #include <cctype>
25 #include <cmath>
26 #include <ctime>
27 
28 #include <fstream>
29 #include <iostream>
30 #include <sstream>
31 #include <string>
32 #include <vector>
33 
34 class InttMonDraw : public OnlMonDraw
35 {
36 public:
37  InttMonDraw(std::string const&);
38  ~InttMonDraw() override;
39 
40  int Init() override;
41  int Draw(std::string const& = "ALL") override;
42  int MakeHtml(std::string const& = "ALL") override;
43  int SavePlot(std::string const& = "ALL", std::string const& = "png") override;
44 
45  typedef void(*HeadFunc_t)(std::string const&);
46  typedef void(*GlobalHistsPrepFunc_t)(std::string const&, TH2D**);
47  typedef void(*LocalHistPrepFunc_t)(std::string const&, TH2D**, struct INTT::Indexes_s&);
48  struct Option_s
49  {
50  HeadFunc_t head = nullptr;
53  };
54  typedef std::map<std::string, struct Option_s> Options_t;
56 
57  //GlobalChip-Channel idiom
58  static void GlobalChipLocalChannelHead(std::string const&);
59  static void DrawGlobalChipMap(std::string const&);
60  static void InttGlobalChipExec(const std::string&, int);
61  static void DrawLocalChannelMap(std::string const&, struct INTT::Indexes_s);
62  static void InttLocalChannelExec(const std::string&, int, int, int, int);
63 
64  //GlobalLadder-Chip idiom
65  static void GlobalLadderLocalChipHead(std::string const&);
66  static void DrawGlobalLadderMap(std::string const&);
67  static void InttGlobalLadderExec(const std::string&, int);
68  static void DrawLocalChipMap(std::string const&, struct INTT::Indexes_s);
69  static void InttLocalChipExec(const std::string&, int, int, int);
70 
71  //GlobalChip-Channel methods
72  static void PrepGlobalChipHists_Hitmap(std::string const&, TH2D**);
73  static void PrepLocalChannelHists_Hitmap(std::string const&, TH2D**, struct INTT::Indexes_s&);
74  static void PrepGlobalChipHists_NLL(std::string const&, TH2D**);
75 
76  //GlobalLadder-Chip methods
77  static void PrepGlobalLadderHists_Interface(std::string const&, TH2D**);
78  static void PrepLocalChipHists_Hitmap(std::string const&, TH2D**, struct INTT::Indexes_s&);
79 
80 private:
81  OnlMonDB *dbvars = nullptr;
82 
83  //=== Constants for Drawing ===//
84  static constexpr double NUM_SIG = 2.0;
85 
86  static constexpr int CNVS_WIDTH = 1280;
87  static constexpr int CNVS_HEIGHT = 720;
88 
89  static constexpr double T_MARGIN = 0.01;
90  static constexpr double B_MARGIN = 0.01;
91  static constexpr double L_MARGIN = 0.01;
92  static constexpr double R_MARGIN = 0.08;
93 
94  static constexpr double TOP_FRAC = 0.05;
95  static constexpr double DISP_FRAC = 0.1;
96  static constexpr double DISP_TEXT_SIZE = 0.20;
97 
98  static constexpr double KEY_FRAC = 0.0;
99  static constexpr double Y_LABEL_FRAC = 0.05;
100  static constexpr double X_LABEL_FRAC = 0.15;
101  static constexpr double Y_LABEL_TEXT_SIZE = 0.5;
102  static constexpr double X_LABEL_TEXT_SIZE = 0.5;
103  //=== ~Constants for Drawing ===//
104 
105  //=== Drawing Methods ===//
106  static void DrawPad(TPad*, TPad*);
107  //=== ~Drawing Methods ===//
108 };
109 
110 #endif