|
1 | 1 | #ifndef _CaloIERCDQMHistoContainer_h_ |
2 | 2 | #define _CaloIERCDQMHistoContainer_h_ |
3 | 3 |
|
| 4 | +#include <TH1F.h> |
| 5 | +#include <string> |
4 | 6 | #include "art/Framework/Services/Registry/ServiceHandle.h" |
5 | 7 | #include "art_root_io/TFileDirectory.h" |
6 | 8 | #include "art_root_io/TFileService.h" |
7 | 9 | #include "otsdaq/Macros/CoutMacros.h" |
8 | 10 | #include "otsdaq/NetworkUtilities/TCPPublishServer.h" |
9 | | -#include <TH1F.h> |
10 | | -#include <string> |
11 | 11 |
|
12 | 12 | #include "TRACE/tracemf.h" |
13 | 13 | #define TRACE_NAME "CaloIERCDQM" |
14 | 14 |
|
15 | | -namespace ots { |
| 15 | +namespace ots |
| 16 | +{ |
16 | 17 |
|
17 | | -class CaloIERCDQMHistoContainer { |
18 | | -public: |
19 | | - CaloIERCDQMHistoContainer(){}; |
20 | | - virtual ~CaloIERCDQMHistoContainer(void){}; |
21 | | - struct InfoHist_ { |
22 | | - TH1F *_Hist; |
23 | | - InfoHist_() { _Hist = NULL; } |
24 | | - }; |
25 | | - struct InfoGraph_ { |
26 | | - TGraph *_Graph; |
27 | | - InfoGraph_() { _Graph = NULL; } |
28 | | - }; |
| 18 | +class CaloIERCDQMHistoContainer |
| 19 | +{ |
| 20 | + public: |
| 21 | + CaloIERCDQMHistoContainer(){}; |
| 22 | + virtual ~CaloIERCDQMHistoContainer(void){}; |
| 23 | + struct InfoHist_ |
| 24 | + { |
| 25 | + TH1F* _Hist; |
| 26 | + InfoHist_() { _Hist = NULL; } |
| 27 | + }; |
| 28 | + struct InfoGraph_ |
| 29 | + { |
| 30 | + TGraph* _Graph; |
| 31 | + InfoGraph_() { _Graph = NULL; } |
| 32 | + }; |
29 | 33 |
|
30 | | - std::map<int, InfoHist_> map_h1_dt_singlechan; |
31 | | - std::map<int, InfoGraph_> map_g_dtevt_singlechan; |
| 34 | + std::map<int, InfoHist_> map_h1_dt_singlechan; |
| 35 | + std::map<int, InfoGraph_> map_g_dtevt_singlechan; |
32 | 36 |
|
33 | | - std::map<int, InfoHist_> map_h1_dt_sameboard; |
34 | | - std::map<int, InfoGraph_> map_g_dtevt_sameboard; |
| 37 | + std::map<int, InfoHist_> map_h1_dt_sameboard; |
| 38 | + std::map<int, InfoGraph_> map_g_dtevt_sameboard; |
35 | 39 |
|
36 | | - std::map<int, InfoHist_> map_h1_dt_diffboard; |
37 | | - std::map<int, InfoGraph_> map_g_dtevt_diffboard; |
| 40 | + std::map<int, InfoHist_> map_h1_dt_diffboard; |
| 41 | + std::map<int, InfoGraph_> map_g_dtevt_diffboard; |
38 | 42 |
|
39 | | - void BookSingleChannel(art::ServiceHandle<art::TFileService> tfs, int mapID, |
40 | | - std::string Name, std::string Title, int nBins, |
41 | | - float min, float max) { |
42 | | - TLOG(TLVL_DEBUG) << "Booking single channel hist for sipmID " << mapID; |
43 | | - map_h1_dt_singlechan[mapID] = InfoHist_(); |
44 | | - art::TFileDirectory testDir = tfs->mkdir("SingleChannel"); |
45 | | - this->map_h1_dt_singlechan[mapID]._Hist = |
46 | | - testDir.make<TH1F>(Name.c_str(), Title.c_str(), nBins, min, max); |
47 | | - this->map_h1_dt_singlechan[mapID]._Hist->GetXaxis()->SetTitle("dt [ns]"); |
48 | | - } |
49 | | - void BookSingleChannelG(art::ServiceHandle<art::TFileService> tfs, int mapID, |
50 | | - std::string Name, std::string Title) { |
51 | | - TLOG(TLVL_DEBUG) << "Booking single channel graph for sipmID " << mapID; |
52 | | - map_g_dtevt_singlechan[mapID] = InfoGraph_(); |
53 | | - art::TFileDirectory testDir = tfs->mkdir("SingleChannel"); |
54 | | - this->map_g_dtevt_singlechan[mapID]._Graph = |
55 | | - testDir.makeAndRegister<TGraph>(Name.c_str(), Title.c_str()); |
56 | | - this->map_g_dtevt_singlechan[mapID]._Graph->GetXaxis()->SetTitle( |
57 | | - "Event number"); |
58 | | - this->map_g_dtevt_singlechan[mapID]._Graph->GetYaxis()->SetTitle("dt [ns]"); |
59 | | - this->map_g_dtevt_singlechan[mapID]._Graph->SetMarkerStyle(20); |
60 | | - } |
61 | | - void BookSameBoard(art::ServiceHandle<art::TFileService> tfs, int mapID, |
62 | | - std::string Name, std::string Title, int nBins, float min, |
63 | | - float max) { |
64 | | - TLOG(TLVL_DEBUG) << "Booking single board hist for sipmID " << mapID; |
65 | | - map_h1_dt_sameboard[mapID] = InfoHist_(); |
66 | | - art::TFileDirectory testDir = tfs->mkdir("SameBoard"); |
67 | | - this->map_h1_dt_sameboard[mapID]._Hist = |
68 | | - testDir.make<TH1F>(Name.c_str(), Title.c_str(), nBins, min, max); |
69 | | - this->map_h1_dt_sameboard[mapID]._Hist->GetXaxis()->SetTitle("dt [ns]"); |
70 | | - } |
71 | | - void BookSameBoardG(art::ServiceHandle<art::TFileService> tfs, int mapID, |
72 | | - std::string Name, std::string Title) { |
73 | | - TLOG(TLVL_DEBUG) << "Booking single board graph for sipmID " << mapID; |
74 | | - map_g_dtevt_sameboard[mapID] = InfoGraph_(); |
75 | | - art::TFileDirectory testDir = tfs->mkdir("SameBoard"); |
76 | | - this->map_g_dtevt_sameboard[mapID]._Graph = |
77 | | - testDir.makeAndRegister<TGraph>(Name.c_str(), Title.c_str()); |
78 | | - this->map_g_dtevt_sameboard[mapID]._Graph->GetXaxis()->SetTitle( |
79 | | - "Event number"); |
80 | | - this->map_g_dtevt_sameboard[mapID]._Graph->GetYaxis()->SetTitle("dt [ns]"); |
81 | | - this->map_g_dtevt_sameboard[mapID]._Graph->SetMarkerStyle(20); |
82 | | - } |
83 | | - void BookDiffBoard(art::ServiceHandle<art::TFileService> tfs, int mapID, |
84 | | - std::string Name, std::string Title, int nBins, float min, |
85 | | - float max) { |
86 | | - TLOG(TLVL_DEBUG) << "Booking diff board hist for sipmID " << mapID; |
87 | | - map_h1_dt_diffboard[mapID] = InfoHist_(); |
88 | | - art::TFileDirectory testDir = tfs->mkdir("DiffBoard"); |
89 | | - this->map_h1_dt_diffboard[mapID]._Hist = |
90 | | - testDir.make<TH1F>(Name.c_str(), Title.c_str(), nBins, min, max); |
91 | | - this->map_h1_dt_diffboard[mapID]._Hist->GetXaxis()->SetTitle("dt [ns]"); |
92 | | - } |
93 | | - void BookDiffBoardG(art::ServiceHandle<art::TFileService> tfs, int mapID, |
94 | | - std::string Name, std::string Title) { |
95 | | - TLOG(TLVL_DEBUG) << "Booking diff board graph for sipmID " << mapID; |
96 | | - map_g_dtevt_diffboard[mapID] = InfoGraph_(); |
97 | | - art::TFileDirectory testDir = tfs->mkdir("DiffBoard"); |
98 | | - this->map_g_dtevt_diffboard[mapID]._Graph = |
99 | | - testDir.makeAndRegister<TGraph>(Name.c_str(), Title.c_str()); |
100 | | - this->map_g_dtevt_diffboard[mapID]._Graph->GetXaxis()->SetTitle( |
101 | | - "Event number"); |
102 | | - this->map_g_dtevt_diffboard[mapID]._Graph->GetYaxis()->SetTitle("dt [ns]"); |
103 | | - this->map_g_dtevt_diffboard[mapID]._Graph->SetMarkerStyle(20); |
104 | | - } |
| 43 | + void BookSingleChannel(art::ServiceHandle<art::TFileService> tfs, |
| 44 | + int mapID, |
| 45 | + std::string Name, |
| 46 | + std::string Title, |
| 47 | + int nBins, |
| 48 | + float min, |
| 49 | + float max) |
| 50 | + { |
| 51 | + TLOG(TLVL_DEBUG) << "Booking single channel hist for sipmID " << mapID; |
| 52 | + map_h1_dt_singlechan[mapID] = InfoHist_(); |
| 53 | + art::TFileDirectory testDir = tfs->mkdir("SingleChannel"); |
| 54 | + this->map_h1_dt_singlechan[mapID]._Hist = |
| 55 | + testDir.make<TH1F>(Name.c_str(), Title.c_str(), nBins, min, max); |
| 56 | + this->map_h1_dt_singlechan[mapID]._Hist->GetXaxis()->SetTitle("dt [ns]"); |
| 57 | + } |
| 58 | + void BookSingleChannelG(art::ServiceHandle<art::TFileService> tfs, |
| 59 | + int mapID, |
| 60 | + std::string Name, |
| 61 | + std::string Title) |
| 62 | + { |
| 63 | + TLOG(TLVL_DEBUG) << "Booking single channel graph for sipmID " << mapID; |
| 64 | + map_g_dtevt_singlechan[mapID] = InfoGraph_(); |
| 65 | + art::TFileDirectory testDir = tfs->mkdir("SingleChannel"); |
| 66 | + this->map_g_dtevt_singlechan[mapID]._Graph = |
| 67 | + testDir.makeAndRegister<TGraph>(Name.c_str(), Title.c_str()); |
| 68 | + this->map_g_dtevt_singlechan[mapID]._Graph->GetXaxis()->SetTitle("Event number"); |
| 69 | + this->map_g_dtevt_singlechan[mapID]._Graph->GetYaxis()->SetTitle("dt [ns]"); |
| 70 | + this->map_g_dtevt_singlechan[mapID]._Graph->SetMarkerStyle(20); |
| 71 | + } |
| 72 | + void BookSameBoard(art::ServiceHandle<art::TFileService> tfs, |
| 73 | + int mapID, |
| 74 | + std::string Name, |
| 75 | + std::string Title, |
| 76 | + int nBins, |
| 77 | + float min, |
| 78 | + float max) |
| 79 | + { |
| 80 | + TLOG(TLVL_DEBUG) << "Booking single board hist for sipmID " << mapID; |
| 81 | + map_h1_dt_sameboard[mapID] = InfoHist_(); |
| 82 | + art::TFileDirectory testDir = tfs->mkdir("SameBoard"); |
| 83 | + this->map_h1_dt_sameboard[mapID]._Hist = |
| 84 | + testDir.make<TH1F>(Name.c_str(), Title.c_str(), nBins, min, max); |
| 85 | + this->map_h1_dt_sameboard[mapID]._Hist->GetXaxis()->SetTitle("dt [ns]"); |
| 86 | + } |
| 87 | + void BookSameBoardG(art::ServiceHandle<art::TFileService> tfs, |
| 88 | + int mapID, |
| 89 | + std::string Name, |
| 90 | + std::string Title) |
| 91 | + { |
| 92 | + TLOG(TLVL_DEBUG) << "Booking single board graph for sipmID " << mapID; |
| 93 | + map_g_dtevt_sameboard[mapID] = InfoGraph_(); |
| 94 | + art::TFileDirectory testDir = tfs->mkdir("SameBoard"); |
| 95 | + this->map_g_dtevt_sameboard[mapID]._Graph = |
| 96 | + testDir.makeAndRegister<TGraph>(Name.c_str(), Title.c_str()); |
| 97 | + this->map_g_dtevt_sameboard[mapID]._Graph->GetXaxis()->SetTitle("Event number"); |
| 98 | + this->map_g_dtevt_sameboard[mapID]._Graph->GetYaxis()->SetTitle("dt [ns]"); |
| 99 | + this->map_g_dtevt_sameboard[mapID]._Graph->SetMarkerStyle(20); |
| 100 | + } |
| 101 | + void BookDiffBoard(art::ServiceHandle<art::TFileService> tfs, |
| 102 | + int mapID, |
| 103 | + std::string Name, |
| 104 | + std::string Title, |
| 105 | + int nBins, |
| 106 | + float min, |
| 107 | + float max) |
| 108 | + { |
| 109 | + TLOG(TLVL_DEBUG) << "Booking diff board hist for sipmID " << mapID; |
| 110 | + map_h1_dt_diffboard[mapID] = InfoHist_(); |
| 111 | + art::TFileDirectory testDir = tfs->mkdir("DiffBoard"); |
| 112 | + this->map_h1_dt_diffboard[mapID]._Hist = |
| 113 | + testDir.make<TH1F>(Name.c_str(), Title.c_str(), nBins, min, max); |
| 114 | + this->map_h1_dt_diffboard[mapID]._Hist->GetXaxis()->SetTitle("dt [ns]"); |
| 115 | + } |
| 116 | + void BookDiffBoardG(art::ServiceHandle<art::TFileService> tfs, |
| 117 | + int mapID, |
| 118 | + std::string Name, |
| 119 | + std::string Title) |
| 120 | + { |
| 121 | + TLOG(TLVL_DEBUG) << "Booking diff board graph for sipmID " << mapID; |
| 122 | + map_g_dtevt_diffboard[mapID] = InfoGraph_(); |
| 123 | + art::TFileDirectory testDir = tfs->mkdir("DiffBoard"); |
| 124 | + this->map_g_dtevt_diffboard[mapID]._Graph = |
| 125 | + testDir.makeAndRegister<TGraph>(Name.c_str(), Title.c_str()); |
| 126 | + this->map_g_dtevt_diffboard[mapID]._Graph->GetXaxis()->SetTitle("Event number"); |
| 127 | + this->map_g_dtevt_diffboard[mapID]._Graph->GetYaxis()->SetTitle("dt [ns]"); |
| 128 | + this->map_g_dtevt_diffboard[mapID]._Graph->SetMarkerStyle(20); |
| 129 | + } |
105 | 130 | }; |
106 | 131 |
|
107 | | -} // namespace ots |
| 132 | +} // namespace ots |
108 | 133 |
|
109 | 134 | #endif |
0 commit comments