BmnRoot
Loading...
Searching...
No Matches
BmnQaMonitor.h
Go to the documentation of this file.
1#include <TFile.h>
2#include <TNamed.h>
3#include <TGraph.h>
4#include <TObjString.h>
5#include <THttpServer.h>
6#include <TCanvas.h>
7#include <TObjArray.h>
8#include <TObjString.h>
9
10#include <BmnCoordinateDetQa.h>
11#include <BmnTimeDetQa.h>
12#include <BmnCalorimeterDetQa.h>
13#include <BmnTrigDetQa.h>
14#include <BmnDstQa.h>
15
16#include <BmnOfflineQaSteering.h>
17#include <BmnRunInfo.h>
18#include <UniRun.h>
19#include <TLatex.h>
20
21#ifndef BMNQAMONITOR_H
22#define BMNQAMONITOR_H 1
23
24class AllHistos : public TNamed {
25public:
26
28
29 }
30
31 virtual ~AllHistos() {
32
33 }
34
35 vector <TH1F*> Get1D() {
36 return _h1d;
37 }
38
39 vector <TH2F*> Get2D() {
40 return _h2d;
41 }
42
43 void Set1D(TH1F* h) {
44 _h1d.push_back(h);
45 }
46
47 void Set2D(TH2F* h) {
48 _h2d.push_back(h);
49 }
50
51private:
52 vector <TH1F*> _h1d;
53 vector <TH2F*> _h2d;
54
55 ClassDef(AllHistos, 1)
56};
57
58class BmnQaMonitor : public TNamed {
59public:
60
62 BmnQaMonitor(TString);
63 virtual ~BmnQaMonitor();
64
65 void ShowCurrentHistos(Int_t);
67
68 void SetRelease(Int_t iRel) {
69 fRelease = iRel;
70 }
71
72 void SetPeriod(Int_t period) {
73 fPeriod = period;
74 }
75
76 void SetSetup(Int_t iSetup) {
77 fSetup = iSetup;
78 }
79
81
82 void SetHistoDir(TString path) {
83 fHistoDir = path;
84 }
85
86private:
87 THttpServer* fServer;
88
89 void CreateInfoLists();
90 void InitServer();
91 void RegisterCanvases();
92 void DivideCanvases();
93 void RegisterUserCommands();
94 void DrawInfoC();
95
96 AllHistos* GetRun(UInt_t);
97
98 AllHistos* GetCurrentRun(UInt_t run) {
99 return GetRun(run);
100 }
101
102 AllHistos* GetReferenceRun(UInt_t run) {
103 return GetRun(run);
104 }
105
106 template <class T> void GetHistoNames(T* man) {
107 TObjArray* tx = man->GetManager()->GetListOfHistos().Tokenize("\n");
108 for (Int_t i = 0; i < tx->GetEntries(); i++) {
109 TString name = ((TObjString*) (tx->UncheckedAt(i)))->String();
110
111 if (name.Contains("BmnHistManager"))
112 continue;
113
114 fHistoNames.push_back(name);
115 }
116 }
117
118 template <class T> void GetHistosToBeRegistered(T* man) {
119 BmnQaHistoManager* histoMan = man->GetManager();
120
121 for (auto it : fHistoNames) {
122 if (!histoMan->Exists(it))
123 continue;
124
125 fHisto.push_back(histoMan->H1(it));
126 }
127 }
128
129 BmnCoordinateDetQa*** gem;
130 BmnCoordinateDetQa*** silicon;
131 BmnCoordinateDetQa*** csc;
132
133 BmnTimeDetQa*** tof400;
134 BmnTimeDetQa*** tof700;
135 BmnTimeDetQa*** dch;
136 BmnTimeDetQa*** mwpc;
137
138 BmnCalorimeterDetQa*** ecal;
139 BmnCalorimeterDetQa*** zdc;
140
141 BmnDstQa*** dst;
142
143 BmnTrigDetQa*** triggers;
144
145 vector <TString> fHistoNames; // Histo names to get by corresponding getter
146 vector <TH1*> fHisto; // Histos to be registered via server
147
148 Int_t fCurrentRun;
149
150 Int_t nReleases;
151 Int_t* runs;
152 Int_t nSetups;
153 TString* setups;
154 Int_t nCanvases;
155 Int_t nDims;
156
157 Int_t fPeriod;
158 Int_t fRelease;
159 Int_t fSetup;
160
161 vector <TString>* fRefHistosNames;
162 Bool_t isOneRefDrawn;
163
164 TCanvas*** fCanvases;
165
166 BmnOfflineQaSteering* fSteering;
167
168 TString fHistoDir;
169 AllHistos* fHistos;
170
171// TObjArray**** fRefList;
172 TList* fRefList;
173
174 TCanvas *infoCanvas;
175
176 BmnRunInfo* fCurRunInfo;
177 BmnRunInfo* fRefRunInfo;
178
179 ClassDef(BmnQaMonitor, 1)
180};
181
182#endif
int i
Definition P4_F32vec4.h:22
vector< TH1F * > Get1D()
void Set1D(TH1F *h)
void Set2D(TH2F *h)
vector< TH2F * > Get2D()
virtual ~AllHistos()
Bool_t Exists(const TString &name) const
Check existence of histogram in manager.
TH1 * H1(const TString &name) const
Return pointer to TH1 histogram.
void ShowReferenceHistos(Int_t)
virtual ~BmnQaMonitor()
void SetSetup(Int_t iSetup)
void SetHistoDir(TString path)
void ShowCurrentHistos(Int_t)
void ClearCanvases()
void SetPeriod(Int_t period)
void SetRelease(Int_t iRel)
BmnQaMonitor(TString)
-clang-format
name
Definition setup.py:7