Belle II Software  release-05-01-25
TRGGRLDQMModule.cc
1 //---------------------------------------------------------------
2 // $Id$
3 //---------------------------------------------------------------
4 // Filename : TRGGRLDQMModule.cc
5 // Section : TRG GRL
6 // Owner : Yun-Tsung Lai
7 // Email : ytlai@post.kek.jp
8 //---------------------------------------------------------------
9 // Description : DQM module for TRGGRL
10 //---------------------------------------------------------------
11 // 1.00 : 2019/06/14 : First version
12 //---------------------------------------------------------------
13 #include <trg/grl/modules/TRGGRLDQM/TRGGRLDQMModule.h>
14 
15 #include <framework/datastore/StoreObjPtr.h>
16 
17 #include "trg/grl/dataobjects/TRGGRLUnpackerStore.h"
18 
19 #include <TDirectory.h>
20 #include <iostream>
21 
22 
23 using namespace std;
24 using namespace Belle2;
25 
26 REG_MODULE(TRGGRLDQM);
27 
28 TRGGRLDQMModule::TRGGRLDQMModule() : HistoModule()
29 {
30 
31  setDescription("DQM for GRL Trigger system");
33 
34 }
35 
37 {
38  oldDir = gDirectory;
39  dirDQM = NULL;
40  dirDQM = oldDir->mkdir("TRGGRL");
41  dirDQM->cd();
42 
43  h_N_track = new TH1I("h_N_track", "CDCTRG 2D N_track", 8, 0, 8);
44  h_N_track->GetXaxis()->SetTitle("CDCTRG 2D N_track");
45 
46  h_phi_i = new TH1F("h_phi_i", "phi_i CDCTRG 2D [10 degrees]", 36, 0, 360);
47  h_phi_i->GetXaxis()->SetTitle("#phi_{i} CDCTRG 2D [10 degrees]");
48  h_phi_CDC = new TH1F("h_phi_CDC", "phi_CDC CDCTRG 2D [10 degrees]", 36, 0, 360);
49  h_phi_CDC->GetXaxis()->SetTitle("#phi_{CDC} CDCTRG 2D [10 degrees]");
50  h_sector_CDC = new TH1F("h_sector_CDC", "Sector_CDC CDCTRG 2D [45 degrees]", 8, -22.5, 337.5);
51  h_sector_CDC->GetXaxis()->SetTitle("Sector_{CDC} CDCTRG 2D [45 degrees]");
52  h_sector_KLM = new TH1F("h_sector_KLM", "Sector_KLM [45 degrees]", 8, -22.5, 337.5);
53  h_sector_KLM->GetXaxis()->SetTitle("Sector_{KLM} [45 degrees]");
54  h_slot_CDC = new TH1F("h_slot_CDC", "Slot_CDC CDCTRG 2D [22.5 degrees]", 16, 0, 360);
55  h_slot_CDC->GetXaxis()->SetTitle("Slot_{CDC} CDCTRG 2D [22.5 degrees]");
56  h_slot_TOP = new TH1F("h_slot_TOP", "Slot_TOP [22.5 degrees]", 16, 0, 360);
57  h_slot_TOP->GetXaxis()->SetTitle("Slot_{TOP} [22.5 degrees]");
58 
59  h_E_ECL = new TH1F("h_E_ECL", "ECL cluster energy [5 MeV]", 2048, 0, 10.24);
60  h_E_ECL->GetXaxis()->SetTitle("ECL cluster energy [5 MeV]");
61  h_theta_ECL = new TH1F("h_theta_ECL", "ECL cluster theta [1.4 degrees]", 128, 0, 180);
62  h_theta_ECL->GetXaxis()->SetTitle("ECL cluster #theta [1.4 degrees]");
63  h_phi_ECL = new TH1F("h_phi_ECL", "ECL cluster phi [1.4 degrees]", 256, 0, 360);
64  h_phi_ECL->GetXaxis()->SetTitle("ECL cluster #phi [1.4 degrees]");
65 
66  h_CDCL1 = new TH1F("h_CDCL1", "CDCTRG 2D -> L1 trg [ns]", 320, -320 * 7.8, 0);
67  h_CDCL1->GetXaxis()->SetTitle("CDCTRG 2D -> L1 trg [ns]");
68  h_ECLL1 = new TH1F("h_ECLL1", "ECLTRG -> L1 trg [ns]", 320, -320 * 7.8, 0);
69  h_ECLL1->GetXaxis()->SetTitle("ECLTRG -> L1 trg [ns]");
70  h_TOPL1 = new TH1F("h_TOPL1", "TOPTRG -> L1 trg [ns]", 320, -320 * 7.8, 0);
71  h_TOPL1->GetXaxis()->SetTitle("TOPTRG -> L1 trg [ns]");
72  h_KLML1 = new TH1F("h_KLML1", "KLMTRG -> L1 trg [ns]", 320, -320 * 7.8, 0);
73  h_KLML1->GetXaxis()->SetTitle("KLMTRG -> L1 trg [ns]");
74  h_ECLL1_2nd = new TH1F("h_ECLL1_2nd", "ECLTRG 2nd input-> L1 trg [ns]", 320, -320 * 7.8, 0);
75  h_ECLL1_2nd->GetXaxis()->SetTitle("ECLTRG 2nd input -> L1 trg [ns]");
76  h_CDC3DL1 = new TH1F("h_CDC3DL1", "CDCTRG 3D -> L1 trg [ns]", 320, -320 * 7.8, 0);
77  h_CDC3DL1->GetXaxis()->SetTitle("CDCTRG 3D -> L1 trg [ns]");
78  h_CDCNNL1 = new TH1F("h_CDCNNL1", "CDCTRG NN -> L1 trg [ns]", 320, -320 * 7.8, 0);
79  h_CDCNNL1->GetXaxis()->SetTitle("CDCTRG NN -> L1 trg [ns]");
80  h_TSFL1 = new TH1F("h_TSFL1", "CDCTRG TSF -> L1 trg [ns]", 320, -320 * 7.8, 0);
81  h_TSFL1->GetXaxis()->SetTitle("CDCTRG TSF -> L1 trg [ns]");
82  h_B2LL1 = new TH1F("h_B2LL1", "B2L window -> L1 trg [ns]", 320, -320 * 7.8, 0);
83  h_B2LL1->GetXaxis()->SetTitle("B2L window -> L1 trg [ns]");
84 
85  h_map_ST = new TH1F("h_map_ST", "CDCTRG short track map [5.625 degrees]", 64, 0, 360);
86  h_map_ST->GetXaxis()->SetTitle("CDCTRG short track map [5.625 degrees]");
87  h_map_ST2 = new TH1F("h_map_ST2", "CDCTRG short track map [5.625 degrees]", 64, 0, 360);
88  h_map_ST2->GetXaxis()->SetTitle("CDCTRG short track map [5.625 degrees]");
89  h_map_veto = new TH1F("h_map_veto", "CDCTRG 2D veto map [5.625 degrees]", 64, 0, 360);
90  h_map_veto->GetXaxis()->SetTitle("CDCTRG 2D veto map [5.625 degrees]");
91  h_map_TSF0 = new TH1F("h_map_TSF0", "CDCTRG TSF0 map [5.625 degrees]", 64, 0, 360);
92  h_map_TSF0->GetXaxis()->SetTitle("CDCTRG TSF0 map [5.625 degrees]");
93  h_map_TSF2 = new TH1F("h_map_TSF2", "CDCTRG TSF2 map [5.625 degrees]", 64, 0, 360);
94  h_map_TSF2->GetXaxis()->SetTitle("CDCTRG TSF2 map [5.625 degrees]");
95  h_map_TSF4 = new TH1F("h_map_TSF4", "CDCTRG TSF4 map [5.625 degrees]", 64, 0, 360);
96  h_map_TSF4->GetXaxis()->SetTitle("CDCTRG TSF4 map [5.625 degrees]");
97  h_map_TSF1 = new TH1F("h_map_TSF1", "CDCTRG TSF1 map [5.625 degrees]", 64, 0, 360);
98  h_map_TSF1->GetXaxis()->SetTitle("CDCTRG TSF1 map [5.625 degrees]");
99  h_map_TSF3 = new TH1F("h_map_TSF3", "CDCTRG TSF3 map [5.625 degrees]", 64, 0, 360);
100  h_map_TSF3->GetXaxis()->SetTitle("CDCTRG TSF3 map [5.625 degrees]");
101 
102  oldDir->cd();
103 }
104 
106 {
107 
108  dirDQM->cd();
109 
110  h_N_track->Reset();
111  h_phi_i->Reset();
112  h_phi_CDC->Reset();
113  h_sector_CDC->Reset();
114  h_sector_KLM->Reset();
115  h_slot_CDC->Reset();
116  h_slot_TOP->Reset();
117  h_E_ECL->Reset();
118  h_theta_ECL->Reset();
119  h_phi_ECL->Reset();
120  h_CDCL1->Reset();
121  h_ECLL1->Reset();
122  h_TOPL1->Reset();
123  h_KLML1->Reset();
124  h_CDC3DL1->Reset();
125  h_CDCNNL1->Reset();
126  h_TSFL1->Reset();
127  h_B2LL1->Reset();
128  h_map_ST->Reset();
129  h_map_ST2->Reset();
130  h_map_veto->Reset();
131  h_map_TSF0->Reset();
132  h_map_TSF2->Reset();
133  h_map_TSF4->Reset();
134  h_map_TSF1->Reset();
135  h_map_TSF3->Reset();
136 
137  oldDir->cd();
138 }
139 
141 {
142  // calls back the defineHisto() function, but the HistoManager module has to be in the path
143  REG_HISTOGRAM
144 }
145 
147 {
148 }
149 
151 {
152  StoreObjPtr<TRGGRLUnpackerStore> evtinfo("TRGGRLUnpackerStore");
153  if (!evtinfo) return;
154 
155  int N_track = evtinfo->m_N_track;
156  int bin = h_N_track->GetBinContent(N_track + 1);
157  h_N_track->SetBinContent(N_track + 1, bin + 1);
158 
159  for (int i = 0; i < 36; i++) {
160  if (evtinfo->m_phi_i[i]) {
161  h_phi_i->Fill(5 + i * 10);
162  }
163  if (evtinfo->m_phi_CDC[i]) {
164  h_phi_CDC->Fill(5 + i * 10);
165  }
166  }
167  for (int i = 0; i < 8; i++) {
168  if (evtinfo->m_sector_CDC[i]) {
169  h_sector_CDC->Fill(i * 45);
170  }
171  if (evtinfo->m_sector_KLM[i]) {
172  h_sector_KLM->Fill(i * 45);
173  }
174  }
175  for (int i = 0; i < 16; i++) {
176  if (evtinfo->m_slot_CDC[i]) {
177  h_slot_CDC->Fill(11.25 + i * 22.5);
178  }
179  if (evtinfo->m_slot_TOP[i]) {
180  h_slot_TOP->Fill(11.25 + i * 22.5);
181  }
182  }
183 
184  int N_cluster = evtinfo->m_N_cluster;
185  for (int i = 0; i < N_cluster; i++) {
186  h_E_ECL->Fill(evtinfo->m_E_ECL[i] * 0.005 + 0.0025);
187  h_theta_ECL->Fill(evtinfo->m_theta_ECL[i] * 1.40625 + 1.40625 * 0.5);
188  h_phi_ECL->Fill(evtinfo->m_phi_ECL[i] * 1.40625 + 1.40625 * 0.5);
189  }
190 
191  int timeL1 = evtinfo->m_coml1 - evtinfo->m_revoclk;
192 
193  if (evtinfo->m_CDCL1_count != 0) {
194  h_CDCL1->Fill((evtinfo->m_CDCL1_count + timeL1 - 0.5) * (-7.8));
195  }
196  if (evtinfo->m_ECLL1_count != 0) {
197  h_ECLL1->Fill((evtinfo->m_ECLL1_count + timeL1 - 0.5) * (-7.8));
198  }
199  if (evtinfo->m_ECLL1_count != 0 && evtinfo->m_N_cluster_1 != 0) {
200  h_ECLL1_2nd->Fill((evtinfo->m_ECLL1_count + timeL1 - 0.5) * (-7.8) + 7.8 * 16);
201  }
202  if (evtinfo->m_TOPL1_count != 0) {
203  h_TOPL1->Fill((evtinfo->m_TOPL1_count + timeL1 - 0.5) * (-7.8));
204  }
205  if (evtinfo->m_KLML1_count != 0) {
206  h_KLML1->Fill((evtinfo->m_KLML1_count + timeL1 - 0.5) * (-7.8));
207  }
208  if (evtinfo->m_CDC3DL1_count != 0) {
209  h_CDC3DL1->Fill((evtinfo->m_CDC3DL1_count + timeL1 - 0.5) * (-7.8));
210  }
211  if (evtinfo->m_CDCNNL1_count != 0) {
212  h_CDCNNL1->Fill((evtinfo->m_CDCNNL1_count + timeL1 - 0.5) * (-7.8));
213  }
214  if (evtinfo->m_TSFL1_count != 0) {
215  h_TSFL1->Fill((evtinfo->m_TSFL1_count + timeL1 - 0.5) * (-7.8));
216  }
217  if (timeL1 != 0) {
218  h_B2LL1->Fill((timeL1 - 0.5) * (-7.8));
219  }
220 
221  for (int i = 0; i < 64; i++) {
222  if (evtinfo->m_map_ST[i]) {
223  h_map_ST->Fill(2.8 + i * 360.0 / 64.0);
224  }
225  if (evtinfo->m_map_ST2[i]) {
226  h_map_ST2->Fill(2.8 + i * 360.0 / 64.0);
227  }
228  if (evtinfo->m_map_veto[i]) {
229  h_map_veto->Fill(2.8 + i * 360.0 / 64.0);
230  }
231  if (evtinfo->m_map_TSF0[i]) {
232  h_map_TSF0->Fill(2.8 + i * 360.0 / 64.0);
233  }
234  if (evtinfo->m_map_TSF2[i]) {
235  h_map_TSF2->Fill(2.8 + i * 360.0 / 64.0);
236  }
237  if (evtinfo->m_map_TSF4[i]) {
238  h_map_TSF4->Fill(2.8 + i * 360.0 / 64.0);
239  }
240  if (evtinfo->m_map_TSF1[i]) {
241  h_map_TSF1->Fill(2.8 + i * 360.0 / 64.0);
242  }
243  if (evtinfo->m_map_TSF3[i]) {
244  h_map_TSF3->Fill(2.8 + i * 360.0 / 64.0);
245  }
246  }
247 }
248 
249 
Belle2::TRGGRLDQMModule::oldDir
TDirectory * oldDir
TDirectory.
Definition: TRGGRLDQMModule.h:52
Belle2::Module::setDescription
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:216
Belle2::TRGGRLDQMModule::h_CDCNNL1
TH1F * h_CDCNNL1
Jitter of CDC NN -> L1.
Definition: TRGGRLDQMModule.h:92
Belle2::TRGGRLDQMModule::h_CDCL1
TH1F * h_CDCL1
Jitter of CDC 2D -> L1.
Definition: TRGGRLDQMModule.h:80
Belle2::TRGGRLDQMModule::h_ECLL1_2nd
TH1F * h_ECLL1_2nd
Jitter of ECl 2nd input -> L1.
Definition: TRGGRLDQMModule.h:84
Belle2::TRGGRLDQMModule::h_TSFL1
TH1F * h_TSFL1
Jitter of Short track -> L1.
Definition: TRGGRLDQMModule.h:94
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::Module::c_ParallelProcessingCertified
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:82
Belle2::TRGGRLDQMModule::h_ECLL1
TH1F * h_ECLL1
Jitter of ECL -> L1.
Definition: TRGGRLDQMModule.h:82
Belle2::TRGGRLDQMModule::defineHisto
virtual void defineHisto() override
Define Histogram.
Definition: TRGGRLDQMModule.cc:36
Belle2::TRGGRLDQMModule::h_CDC3DL1
TH1F * h_CDC3DL1
Jitter of CDC 3D -> L1.
Definition: TRGGRLDQMModule.h:90
Belle2::TRGGRLDQMModule::h_map_TSF0
TH1F * h_map_TSF0
TSF0 map.
Definition: TRGGRLDQMModule.h:105
Belle2::TRGGRLDQMModule::h_N_track
TH1I * h_N_track
Number of tracks.
Definition: TRGGRLDQMModule.h:57
Belle2::TRGGRLDQMModule::h_slot_CDC
TH1F * h_slot_CDC
slot_CDC, extrapolated phi at TOP of CDC 2D tracks
Definition: TRGGRLDQMModule.h:68
Belle2::TRGGRLDQMModule::h_E_ECL
TH1F * h_E_ECL
ECL cluster energy.
Definition: TRGGRLDQMModule.h:73
Belle2::TRGGRLDQMModule::beginRun
virtual void beginRun() override
begin Run
Definition: TRGGRLDQMModule.cc:105
Belle2::TRGGRLDQMModule::h_slot_TOP
TH1F * h_slot_TOP
slot map of TOP
Definition: TRGGRLDQMModule.h:70
Belle2::TRGGRLDQMModule::h_TOPL1
TH1F * h_TOPL1
Jitter of TOP -> L1.
Definition: TRGGRLDQMModule.h:86
Belle2::Module::setPropertyFlags
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:210
Belle2::TRGGRLDQMModule::h_B2LL1
TH1F * h_B2LL1
Jitter of B2L window -> L1.
Definition: TRGGRLDQMModule.h:96
Belle2::TRGGRLDQMModule::h_map_ST2
TH1F * h_map_ST2
Short track map.
Definition: TRGGRLDQMModule.h:101
Belle2::TRGGRLDQMModule::h_KLML1
TH1F * h_KLML1
Jitter of KLM -> L1.
Definition: TRGGRLDQMModule.h:88
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::TRGGRLDQMModule::dirDQM
TDirectory * dirDQM
TDirectory.
Definition: TRGGRLDQMModule.h:54
Belle2::TRGGRLDQMModule::h_map_TSF4
TH1F * h_map_TSF4
TSF4 map.
Definition: TRGGRLDQMModule.h:109
Belle2::TRGGRLDQMModule::h_map_TSF1
TH1F * h_map_TSF1
TSF1 map.
Definition: TRGGRLDQMModule.h:111
Belle2::TRGGRLDQMModule::h_map_veto
TH1F * h_map_veto
Full track veto map.
Definition: TRGGRLDQMModule.h:103
Belle2::TRGGRLDQMModule::initialize
virtual void initialize() override
initialize
Definition: TRGGRLDQMModule.cc:140
Belle2::TRGGRLDQMModule::h_map_TSF3
TH1F * h_map_TSF3
TSF3 map.
Definition: TRGGRLDQMModule.h:113
Belle2::TRGGRLDQMModule::h_map_TSF2
TH1F * h_map_TSF2
TSF2 map.
Definition: TRGGRLDQMModule.h:107
Belle2::TRGGRLDQMModule::h_sector_KLM
TH1F * h_sector_KLM
sector map of KLM
Definition: TRGGRLDQMModule.h:66
Belle2::TRGGRLDQMModule::h_phi_CDC
TH1F * h_phi_CDC
phi_CDC, extrapolated phi at ECL of CDC 2D tracks
Definition: TRGGRLDQMModule.h:62
Belle2::TRGGRLDQMModule::event
virtual void event() override
Event.
Definition: TRGGRLDQMModule.cc:150
Belle2::TRGGRLDQMModule::endRun
virtual void endRun() override
End Run.
Definition: TRGGRLDQMModule.cc:146
Belle2::TRGGRLDQMModule::h_map_ST
TH1F * h_map_ST
Short track map.
Definition: TRGGRLDQMModule.h:99
Belle2::TRGGRLDQMModule::h_phi_ECL
TH1F * h_phi_ECL
ECL cluster phi.
Definition: TRGGRLDQMModule.h:77
Belle2::TRGGRLDQMModule::h_theta_ECL
TH1F * h_theta_ECL
ECL cluster theta.
Definition: TRGGRLDQMModule.h:75
Belle2::TRGGRLDQMModule::h_phi_i
TH1F * h_phi_i
phi_i of CDC 2D tracks
Definition: TRGGRLDQMModule.h:60
Belle2::HistoModule
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
Belle2::TRGGRLDQMModule::h_sector_CDC
TH1F * h_sector_CDC
sector_CDC, extrapolated phi at KLM of CDC 2D tracks
Definition: TRGGRLDQMModule.h:64