9#include <trg/grl/modules/TRGGRLDQM/TRGGRLDQMModule.h>
11#include <framework/datastore/StoreObjPtr.h>
13#include "trg/grl/dataobjects/TRGGRLUnpackerStore.h"
18#include <TDirectory.h>
42 h_N_track =
new TH1I(
"h_N_track",
"CDCTRG 2D N_track", 8, 0, 8);
43 h_N_track->GetXaxis()->SetTitle(
"CDCTRG 2D N_track");
45 h_phi_i =
new TH1F(
"h_phi_i",
"phi_i CDCTRG 2D [10 degrees]", 36, 0, 360);
46 h_phi_i->GetXaxis()->SetTitle(
"#phi_{i} CDCTRG 2D [10 degrees]");
47 h_phi_CDC =
new TH1F(
"h_phi_CDC",
"phi_CDC CDCTRG 2D [10 degrees]", 36, 0, 360);
48 h_phi_CDC->GetXaxis()->SetTitle(
"#phi_{CDC} CDCTRG 2D [10 degrees]");
49 h_sector_CDC =
new TH1F(
"h_sector_CDC",
"Sector_CDC CDCTRG 2D [45 degrees]", 8, -22.5, 337.5);
50 h_sector_CDC->GetXaxis()->SetTitle(
"Sector_{CDC} CDCTRG 2D [45 degrees]");
51 h_sector_KLM =
new TH1F(
"h_sector_KLM",
"Sector_KLM [45 degrees]", 8, -22.5, 337.5);
52 h_sector_KLM->GetXaxis()->SetTitle(
"Sector_{KLM} [45 degrees]");
53 h_slot_CDC =
new TH1F(
"h_slot_CDC",
"Slot_CDC CDCTRG 2D [22.5 degrees]", 16, 0, 360);
54 h_slot_CDC->GetXaxis()->SetTitle(
"Slot_{CDC} CDCTRG 2D [22.5 degrees]");
55 h_slot_TOP =
new TH1F(
"h_slot_TOP",
"Slot_TOP [22.5 degrees]", 16, 0, 360);
56 h_slot_TOP->GetXaxis()->SetTitle(
"Slot_{TOP} [22.5 degrees]");
58 h_E_ECL =
new TH1F(
"h_E_ECL",
"ECL cluster energy [5 MeV]", 2048, 0, 10.24);
59 h_E_ECL->GetXaxis()->SetTitle(
"ECL cluster energy [5 MeV]");
60 h_theta_ECL =
new TH1F(
"h_theta_ECL",
"ECL cluster theta [1.4 degrees]", 128, 0, 180);
61 h_theta_ECL->GetXaxis()->SetTitle(
"ECL cluster #theta [1.4 degrees]");
62 h_phi_ECL =
new TH1F(
"h_phi_ECL",
"ECL cluster phi [1.4 degrees]", 256, 0, 360);
63 h_phi_ECL->GetXaxis()->SetTitle(
"ECL cluster #phi [1.4 degrees]");
65 h_CDCL1 =
new TH1F(
"h_CDCL1",
"CDCTRG 2D -> L1 trg [ns]", 320, -320 * 7.8, 0);
66 h_CDCL1->GetXaxis()->SetTitle(
"CDCTRG 2D -> L1 trg [ns]");
67 h_ECLL1 =
new TH1F(
"h_ECLL1",
"ECLTRG -> L1 trg [ns]", 320, -320 * 7.8, 0);
68 h_ECLL1->GetXaxis()->SetTitle(
"ECLTRG -> L1 trg [ns]");
69 h_TOPL1 =
new TH1F(
"h_TOPL1",
"TOPTRG -> L1 trg [ns]", 320, -320 * 7.8, 0);
70 h_TOPL1->GetXaxis()->SetTitle(
"TOPTRG -> L1 trg [ns]");
71 h_KLML1 =
new TH1F(
"h_KLML1",
"KLMTRG -> L1 trg [ns]", 320, -320 * 7.8, 0);
72 h_KLML1->GetXaxis()->SetTitle(
"KLMTRG -> L1 trg [ns]");
73 h_ECLL1_2nd =
new TH1F(
"h_ECLL1_2nd",
"ECLTRG 2nd input-> L1 trg [ns]", 320, -320 * 7.8, 0);
74 h_ECLL1_2nd->GetXaxis()->SetTitle(
"ECLTRG 2nd input -> L1 trg [ns]");
75 h_CDC3DL1 =
new TH1F(
"h_CDC3DL1",
"CDCTRG 3D -> L1 trg [ns]", 320, -320 * 7.8, 0);
76 h_CDC3DL1->GetXaxis()->SetTitle(
"CDCTRG 3D -> L1 trg [ns]");
77 h_CDCNNL1 =
new TH1F(
"h_CDCNNL1",
"CDCTRG NN -> L1 trg [ns]", 320, -320 * 7.8, 0);
78 h_CDCNNL1->GetXaxis()->SetTitle(
"CDCTRG NN -> L1 trg [ns]");
79 h_TSFL1 =
new TH1F(
"h_TSFL1",
"CDCTRG TSF -> L1 trg [ns]", 320, -320 * 7.8, 0);
80 h_TSFL1->GetXaxis()->SetTitle(
"CDCTRG TSF -> L1 trg [ns]");
81 h_B2LL1 =
new TH1F(
"h_B2LL1",
"B2L window -> L1 trg [ns]", 320, -320 * 7.8, 0);
82 h_B2LL1->GetXaxis()->SetTitle(
"B2L window -> L1 trg [ns]");
84 h_map_ST =
new TH1F(
"h_map_ST",
"CDCTRG short track map [5.625 degrees]", 64, 0, 360);
85 h_map_ST->GetXaxis()->SetTitle(
"CDCTRG short track map [5.625 degrees]");
86 h_map_ST2 =
new TH1F(
"h_map_ST2",
"CDCTRG short track map [5.625 degrees]", 64, 0, 360);
87 h_map_ST2->GetXaxis()->SetTitle(
"CDCTRG short track map [5.625 degrees]");
88 h_map_veto =
new TH1F(
"h_map_veto",
"CDCTRG 2D veto map [5.625 degrees]", 64, 0, 360);
89 h_map_veto->GetXaxis()->SetTitle(
"CDCTRG 2D veto map [5.625 degrees]");
90 h_map_TSF0 =
new TH1F(
"h_map_TSF0",
"CDCTRG TSF0 map [5.625 degrees]", 64, 0, 360);
91 h_map_TSF0->GetXaxis()->SetTitle(
"CDCTRG TSF0 map [5.625 degrees]");
92 h_map_TSF2 =
new TH1F(
"h_map_TSF2",
"CDCTRG TSF2 map [5.625 degrees]", 64, 0, 360);
93 h_map_TSF2->GetXaxis()->SetTitle(
"CDCTRG TSF2 map [5.625 degrees]");
94 h_map_TSF4 =
new TH1F(
"h_map_TSF4",
"CDCTRG TSF4 map [5.625 degrees]", 64, 0, 360);
95 h_map_TSF4->GetXaxis()->SetTitle(
"CDCTRG TSF4 map [5.625 degrees]");
96 h_map_TSF1 =
new TH1F(
"h_map_TSF1",
"CDCTRG TSF1 map [5.625 degrees]", 64, 0, 360);
97 h_map_TSF1->GetXaxis()->SetTitle(
"CDCTRG TSF1 map [5.625 degrees]");
98 h_map_TSF3 =
new TH1F(
"h_map_TSF3",
"CDCTRG TSF3 map [5.625 degrees]", 64, 0, 360);
99 h_map_TSF3->GetXaxis()->SetTitle(
"CDCTRG TSF3 map [5.625 degrees]");
101 h_wc_TSF0 =
new TH1F(
"h_wirecnt_TSF0",
"The wire counter from TSF 0", 2001, 0, 2000);
102 h_wc_TSF0->GetXaxis()->SetTitle(
"Number of wires for TSF 0 input");
103 h_wc_TSF1 =
new TH1F(
"h_wirecnt_TSF1",
"The wire counter from TSF 1", 2001, 0, 2000);
104 h_wc_TSF1->GetXaxis()->SetTitle(
"Number of wires for TSF 1 input");
105 h_wc_TSF2 =
new TH1F(
"h_wirecnt_TSF2",
"The wire counter from TSF 2", 2001, 0, 2000);
106 h_wc_TSF2->GetXaxis()->SetTitle(
"Number of wires for TSF 2 input");
107 h_wc_TSF3 =
new TH1F(
"h_wirecnt_TSF3",
"The wire counter from TSF 3", 2001, 0, 2000);
108 h_wc_TSF3->GetXaxis()->SetTitle(
"Number of wires for TSF 3 input");
109 h_wc_TSF4 =
new TH1F(
"h_wirecnt_TSF4",
"The wire counter from TSF 4", 2001, 0, 2000);
110 h_wc_TSF4->GetXaxis()->SetTitle(
"Number of wires for TSF 4 input");
111 h_wc_TSF5 =
new TH1F(
"h_wirecnt_TSF5",
"The wire counter from TSF 5", 2001, 0, 2000);
112 h_wc_TSF5->GetXaxis()->SetTitle(
"Number of wires for TSF 5 input");
113 h_wc_TSF6 =
new TH1F(
"h_wirecnt_TSF6",
"The wire counter from TSF 6", 2001, 0, 2000);
114 h_wc_TSF6->GetXaxis()->SetTitle(
"Number of wires for TSF 6 input");
115 h_wc_sum =
new TH1F(
"h_wirecnt_sum",
"The wire counter from TSF0-6", 20001, 0, 20000);
116 h_wc_sum->GetXaxis()->SetTitle(
"Summation of the number of wires for TSF0-6 inputs");
117 h_wcsum_clean =
new TH1F(
"h_wirecnt_sum_clean",
"The wire counter from TSF0-6 (Injection BG Clean)", 20001, 0, 20000);
118 h_wcsum_clean->GetXaxis()->SetTitle(
"Summation of the number of wires for TSF0-6 inputs");
119 h_wcsum_injHER =
new TH1F(
"h_wirecnt_sum_injHER",
"The wire counter from TSF0-6 (HER Injection BG)", 20001, 0, 20000);
120 h_wcsum_injHER->GetXaxis()->SetTitle(
"Summation of the number of wires for TSF0-6 inputs");
121 h_wcsum_injLER =
new TH1F(
"h_wirecnt_sum_injLER",
"The wire counter from TSF0-6 (LER Injection BG)", 20001, 0, 20000);
122 h_wcsum_injLER->GetXaxis()->SetTitle(
"Summation of the number of wires for TSF0-6 inputs");
124 h_wc0_injtime =
new TH2F(
"h_wirecnt0_injtime",
"The wire counter from TSF 0", 201, 0, 1000, 100, 0, 50);
125 h_wc0_injtime->GetXaxis()->SetTitle(
"Number of wires for TSF 0 input");
126 h_wc0_injtime->GetYaxis()->SetTitle(
"Time since injection [ms]");
127 h_wc1_injtime =
new TH2F(
"h_wirecnt1_injtime",
"The wire counter from TSF 1", 201, 0, 1000, 100, 0, 50);
128 h_wc1_injtime->GetXaxis()->SetTitle(
"Number of wires for TSF 1 input");
129 h_wc1_injtime->GetYaxis()->SetTitle(
"Time since injection [ms]");
130 h_wc2_injtime =
new TH2F(
"h_wirecnt2_injtime",
"The wire counter from TSF 2", 201, 0, 1000, 100, 0, 50);
131 h_wc2_injtime->GetXaxis()->SetTitle(
"Number of wires for TSF 2 input");
132 h_wc2_injtime->GetYaxis()->SetTitle(
"Time since injection [ms]");
133 h_wc3_injtime =
new TH2F(
"h_wirecnt3_injtime",
"The wire counter from TSF 3", 201, 0, 1000, 100, 0, 50);
134 h_wc3_injtime->GetXaxis()->SetTitle(
"Number of wires for TSF 3 input");
135 h_wc3_injtime->GetYaxis()->SetTitle(
"Time since injection [ms]");
136 h_wc4_injtime =
new TH2F(
"h_wirecnt4_injtime",
"The wire counter from TSF 4", 201, 0, 1000, 100, 0, 50);
137 h_wc4_injtime->GetXaxis()->SetTitle(
"Number of wires for TSF 4 input");
138 h_wc4_injtime->GetYaxis()->SetTitle(
"Time since injection [ms]");
139 h_wc5_injtime =
new TH2F(
"h_wirecnt5_injtime",
"The wire counter from TSF 5", 201, 0, 1000, 100, 0, 50);
140 h_wc5_injtime->GetXaxis()->SetTitle(
"Number of wires for TSF 5 input");
141 h_wc5_injtime->GetYaxis()->SetTitle(
"Time since injection [ms]");
142 h_wc6_injtime =
new TH2F(
"h_wirecnt6_injtime",
"The wire counter from TSF 6", 201, 0, 1000, 100, 0, 50);
143 h_wc6_injtime->GetXaxis()->SetTitle(
"Number of wires for TSF 6 input");
144 h_wc6_injtime->GetYaxis()->SetTitle(
"Time since injection [ms]");
145 h_wcsum_injtime =
new TH2F(
"h_wirecntsum_injtime",
"The wire counter from TSF0-6", 601, 0, 6000, 100, 0, 50);
146 h_wcsum_injtime->GetXaxis()->SetTitle(
"Summation of the number of wires for TSF0-6 inputs");
220 if (!evtinfo)
return;
222 int N_track = evtinfo->get_N_track();
223 int bin =
h_N_track->GetBinContent(N_track + 1);
224 h_N_track->SetBinContent(N_track + 1, bin + 1);
226 for (
int i = 0; i < 36; i++) {
227 if (evtinfo->get_phi_i(i)) {
230 if (evtinfo->get_phi_CDC(i)) {
234 for (
int i = 0; i < 8; i++) {
235 if (evtinfo->get_sector_CDC(i)) {
238 if (evtinfo->get_sector_KLM(i)) {
242 for (
int i = 0; i < 16; i++) {
243 if (evtinfo->get_slot_CDC(i)) {
246 if (evtinfo->get_slot_TOP(i)) {
251 int N_cluster = evtinfo->get_N_cluster();
252 for (
int i = 0; i < N_cluster; i++) {
253 h_E_ECL->Fill(evtinfo->get_E_ECL(i) * 0.005 + 0.0025);
254 h_theta_ECL->Fill(evtinfo->get_theta_ECL(i) * 1.40625 + 1.40625 * 0.5);
255 h_phi_ECL->Fill(evtinfo->get_phi_ECL(i) * 1.40625 + 1.40625 * 0.5);
258 int timeL1 = evtinfo->get_coml1() - evtinfo->get_revoclk();
260 if (evtinfo->get_CDCL1_count() != 0) {
261 h_CDCL1->Fill((evtinfo->get_CDCL1_count() + timeL1 - 0.5) * (-7.8));
263 if (evtinfo->get_ECLL1_count() != 0) {
264 h_ECLL1->Fill((evtinfo->get_ECLL1_count() + timeL1 - 0.5) * (-7.8));
266 if (evtinfo->get_ECLL1_count() != 0 && evtinfo->get_N_cluster_1() != 0) {
267 h_ECLL1_2nd->Fill((evtinfo->get_ECLL1_count() + timeL1 - 0.5) * (-7.8) + 7.8 * 16);
269 if (evtinfo->get_TOPL1_count() != 0) {
270 h_TOPL1->Fill((evtinfo->get_TOPL1_count() + timeL1 - 0.5) * (-7.8));
272 if (evtinfo->get_KLML1_count() != 0) {
273 h_KLML1->Fill((evtinfo->get_KLML1_count() + timeL1 - 0.5) * (-7.8));
275 if (evtinfo->get_CDC3DL1_count() != 0) {
276 h_CDC3DL1->Fill((evtinfo->get_CDC3DL1_count() + timeL1 - 0.5) * (-7.8));
278 if (evtinfo->get_CDCNNL1_count() != 0) {
279 h_CDCNNL1->Fill((evtinfo->get_CDCNNL1_count() + timeL1 - 0.5) * (-7.8));
281 if (evtinfo->get_TSFL1_count() != 0) {
282 h_TSFL1->Fill((evtinfo->get_TSFL1_count() + timeL1 - 0.5) * (-7.8));
285 h_B2LL1->Fill((timeL1 - 0.5) * (-7.8));
288 for (
int i = 0; i < 64; i++) {
289 if (evtinfo->get_map_ST(i)) {
290 h_map_ST->Fill(2.8 + i * 360.0 / 64.0);
292 if (evtinfo->get_map_ST2(i)) {
295 if (evtinfo->get_map_veto(i)) {
298 if (evtinfo->get_map_TSF0(i)) {
301 if (evtinfo->get_map_TSF2(i)) {
304 if (evtinfo->get_map_TSF4(i)) {
307 if (evtinfo->get_map_TSF1(i)) {
310 if (evtinfo->get_map_TSF3(i)) {
315 int wcsum = 0, nowcnt;
317 const double revotime_in_us = 5.120 /
m_hwclkdb->getAcceleratorRF();
319 double diff_in_ms, diff_in_us;
320 diff_in_us =
m_trgTime->getTimeSinceLastInjectionInMicroSeconds();
321 diff_in_ms = diff_in_us / 1000.;
323 nowcnt = evtinfo->get_wirecnt_tsf0();
328 nowcnt = evtinfo->get_wirecnt_tsf1();
333 nowcnt = evtinfo->get_wirecnt_tsf2();
338 nowcnt = evtinfo->get_wirecnt_tsf3();
343 nowcnt = evtinfo->get_wirecnt_tsf4();
348 nowcnt = evtinfo->get_wirecnt_tsf5();
353 nowcnt = evtinfo->get_wirecnt_tsf6();
362 double running_in_us;
363 quotient = diff_in_us / revotime_in_us;
364 running_in_us = diff_in_us - quotient * revotime_in_us;
366 bool cond_clean, cond_injHER, cond_injLER;
368 cond_clean = (6 < running_in_us && running_in_us < 8) && (50 < diff_in_ms && diff_in_ms < 70);
370 cond_injHER =
m_trgTime->isHER() && ((diff_in_ms < 0.5) || ((diff_in_ms < 20) && (2 < running_in_us && running_in_us < 3)));
371 cond_injLER = !
m_trgTime->isHER() && ((diff_in_ms < 0.5) || ((diff_in_ms < 20) && (1 < running_in_us && running_in_us < 2)));
375 }
else if (cond_injHER) {
377 }
else if (cond_injLER) {
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Type-safe access to single objects in the data store.
TH1F * h_phi_CDC
phi_CDC, extrapolated phi at ECL of CDC 2D tracks
TH1F * h_map_TSF3
TSF3 map.
TH2F * h_wc2_injtime
2D plot: TSF2 cnt vs.
TH1F * h_wcsum_injLER
Wirecnt from all TSFs from the LER injection BG region.
TH1F * h_wc_TSF6
Wirecnt from TSF6.
TRGGRLDQMModule()
Costructor.
TH1F * h_map_TSF4
TSF4 map.
TH2F * h_wc1_injtime
2D plot: TSF1 cnt vs.
virtual void initialize() override
initialize
TH2F * h_wc6_injtime
2D plot: TSF6 cnt vs.
TH1F * h_wc_TSF3
Wirecnt from TSF3.
TH1F * h_map_TSF1
TSF1 map.
TDirectory * oldDir
TDirectory.
virtual void event() override
Event.
TH1F * h_CDC3DL1
Jitter of CDC 3D -> L1.
TH1F * h_KLML1
Jitter of KLM -> L1.
TH1F * h_phi_i
phi_i of CDC 2D tracks
TH1F * h_E_ECL
ECL cluster energy.
virtual void endRun() override
End Run.
TH2F * h_wc4_injtime
2D plot: TSF4 cnt vs.
DBObjPtr< HardwareClockSettings > m_hwclkdb
DB pointerto access the hardware clock information.
TH1F * h_map_TSF0
TSF0 map.
TH1F * h_ECLL1
Jitter of ECL -> L1.
TH1F * h_wc_sum
Wirecnt from all TSFs.
TH1F * h_wc_TSF5
Wirecnt from TSF5.
TH1F * h_wc_TSF2
Wirecnt from TSF2.
TH1F * h_wcsum_injHER
Wirecnt from all TSFs from the HER injection BG region.
TH1F * h_TOPL1
Jitter of TOP -> L1.
TH1F * h_CDCNNL1
Jitter of CDC NN -> L1.
TH1F * h_B2LL1
Jitter of B2L window -> L1.
TH1F * h_map_ST2
Short track map.
TH1I * h_N_track
Number of tracks.
TH1F * h_map_TSF2
TSF2 map.
TH1F * h_CDCL1
Jitter of CDC 2D -> L1.
TH1F * h_phi_ECL
ECL cluster phi.
TH1F * h_wc_TSF4
Wirecnt from TSF4.
virtual void beginRun() override
begin Run
TH1F * h_ECLL1_2nd
Jitter of ECl 2nd input -> L1.
TH1F * h_TSFL1
Jitter of Short track -> L1.
TH1F * h_sector_KLM
sector map of KLM
TH1F * h_theta_ECL
ECL cluster theta.
TH1F * h_slot_CDC
slot_CDC, extrapolated phi at TOP of CDC 2D tracks
TDirectory * dirDQM
TDirectory.
TH1F * h_wc_TSF0
Wirecnt from TSF0.
TH2F * h_wc5_injtime
2D plot: TSF5 cnt vs.
TH2F * h_wc0_injtime
2D plot: TSF0 cnt vs.
TH2F * h_wc3_injtime
2D plot: TSF3 cnt vs.
TH1F * h_sector_CDC
sector_CDC, extrapolated phi at KLM of CDC 2D tracks
TH1F * h_map_veto
Full track veto map.
TH1F * h_slot_TOP
slot map of TOP
TH1F * h_wc_TSF1
Wirecnt from TSF1.
TH2F * h_wcsum_injtime
2D plot: all TSFs cnt vs.
StoreObjPtr< EventLevelTriggerTimeInfo > m_trgTime
Array to access the event time information from the trigger and FTSW.
TH1F * h_map_ST
Short track map.
virtual void defineHisto() override
Define Histogram.
TH1F * h_wcsum_clean
Wirecnt from all TSFs from the injection BG clean region.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.