BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnQaMonitor.h
Go to the documentation of this file.
3#include <BmnDstQa.h>
5#include <BmnRunInfo.h>
6#include <BmnTimeDetQa.h>
7#include <BmnTrigDetQa.h>
8#include <TCanvas.h>
9#include <TFile.h>
10#include <TGraph.h>
11#include <THttpServer.h>
12#include <TLatex.h>
13#include <TNamed.h>
14#include <TObjArray.h>
15#include <TObjString.h>
16#include <UniRun.h>
17
18#ifndef BMNQAMONITOR_H
19#define BMNQAMONITOR_H 1
20
21class AllHistos : public TNamed
22{
23 public:
25
26 virtual ~AllHistos() {}
27
28 vector<TH1F*> Get1D() { return _h1d; }
29
30 vector<TH2F*> Get2D() { return _h2d; }
31
32 void Set1D(TH1F* h) { _h1d.push_back(h); }
33
34 void Set2D(TH2F* h) { _h2d.push_back(h); }
35
36 private:
37 vector<TH1F*> _h1d;
38 vector<TH2F*> _h2d;
39
41};
42
43class BmnQaMonitor : public TNamed
44{
45 public:
48 virtual ~BmnQaMonitor();
49
52
53 void SetRelease(Int_t iRel) { fRelease = iRel; }
54
55 void SetPeriod(Int_t period) { fPeriod = period; }
56
57 void SetSetup(Int_t iSetup) { fSetup = iSetup; }
58
59 void ClearCanvases();
60
61 void SetHistoDir(TString path) { fHistoDir = path; }
62
63 private:
65
66 void CreateInfoLists();
67 void InitServer();
68 void RegisterCanvases();
69 void DivideCanvases();
71 void DrawInfoC();
72
73 AllHistos* GetRun(UInt_t);
74
75 AllHistos* GetCurrentRun(UInt_t run) { return GetRun(run); }
76
77 AllHistos* GetReferenceRun(UInt_t run) { return GetRun(run); }
78
79 template<class T>
80 void GetHistoNames(T* man)
81 {
82 TObjArray* tx = man->GetManager()->GetListOfHistos().Tokenize("\n");
83 for (Int_t i = 0; i < tx->GetEntries(); i++) {
84 TString name = ((TObjString*)(tx->UncheckedAt(i)))->String();
85
86 if (name.Contains("BmnHistManager"))
87 continue;
88
89 fHistoNames.push_back(name);
90 }
91 }
92
93 template<class T>
95 {
96 BmnQaHistoManager* histoMan = man->GetManager();
97
98 for (auto it : fHistoNames) {
99 if (!histoMan->Exists(it))
100 continue;
101
102 fHisto.push_back(histoMan->H1(it));
103 }
104 }
105
109
114
117
119
121
122 vector<TString> fHistoNames; // Histo names to get by corresponding getter
123 vector<TH1*> fHisto; // Histos to be registered via server
124
126
133
137
138 vector<TString>* fRefHistosNames;
140
142
144
147
148 // TObjArray**** fRefList;
150
152
155
157};
158
159#endif
int i
Definition P4_F32vec4.h:22
bool Bool_t
int Int_t
#define ClassDef(name, id)
vector< TH1F * > Get1D()
vector< TH2F * > _h2d
void Set1D(TH1F *h)
void Set2D(TH2F *h)
vector< TH2F * > Get2D()
vector< TH1F * > _h1d
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.
BmnRunInfo * fCurRunInfo
AllHistos * GetReferenceRun(UInt_t run)
void ShowReferenceHistos(Int_t)
BmnCalorimeterDetQa *** zdc
AllHistos * fHistos
BmnTimeDetQa *** tof400
BmnTimeDetQa *** mwpc
vector< TString > fHistoNames
void GetHistoNames(T *man)
vector< TString > * fRefHistosNames
BmnCoordinateDetQa *** silicon
BmnRunInfo * fRefRunInfo
TString * setups
void CreateInfoLists()
TCanvas * infoCanvas
BmnTimeDetQa *** tof700
void SetSetup(Int_t iSetup)
TString fHistoDir
void RegisterCanvases()
BmnCalorimeterDetQa *** ecal
TCanvas *** fCanvases
AllHistos * GetCurrentRun(UInt_t run)
void RegisterUserCommands()
void SetHistoDir(TString path)
void ShowCurrentHistos(Int_t)
void GetHistosToBeRegistered(T *man)
Bool_t isOneRefDrawn
void SetPeriod(Int_t period)
TList * fRefList
void DivideCanvases()
BmnCoordinateDetQa *** gem
THttpServer * fServer
BmnTimeDetQa *** dch
vector< TH1 * > fHisto
BmnDstQa *** dst
void SetRelease(Int_t iRel)
BmnOfflineQaSteering * fSteering
BmnTrigDetQa *** triggers
BmnCoordinateDetQa *** csc
AllHistos * GetRun(UInt_t)
virtual ~BmnQaMonitor()
Int_t GetEntries() const override
TObject * UncheckedAt(Int_t i) const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const