Belle II Software development
SVDDQMClustersOnTrackModule.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include "svd/modules/svdDQM/SVDDQMClustersOnTrackModule.h"
10
11#include <hlt/softwaretrigger/core/FinalTriggerDecisionCalculator.h>
12#include <framework/datastore/DataStore.h>
13#include <framework/datastore/StoreObjPtr.h>
14#include <framework/datastore/StoreArray.h>
15#include <framework/dataobjects/EventMetaData.h>
16#include <svd/dataobjects/SVDShaperDigit.h>
17#include <svd/dataobjects/SVDRecoDigit.h>
18#include <svd/dataobjects/SVDCluster.h>
19#include <tracking/dataobjects/RecoTrack.h>
20#include <vxd/geometry/GeoTools.h>
21
22#include "TDirectory.h"
23
24using namespace std;
25using namespace Belle2;
26using namespace SoftwareTrigger;
27
28//-----------------------------------------------------------------
29// Register the Module
30//-----------------------------------------------------------------
31REG_MODULE(SVDDQMClustersOnTrack);
32
33
34//-----------------------------------------------------------------
35// Implementation
36//-----------------------------------------------------------------
37
39{
40 //Set module properties
41 setDescription("SVD DQM module for clusters related to tracks.");
42
43 setPropertyFlags(c_ParallelProcessingCertified); // specify this flag if you need parallel processing
44 addParam("skipHLTRejectedEvents", m_skipRejectedEvents, "If True, skip events rejected by HLT.", bool(true));
45 addParam("TriggerBin", m_tb, "select events for a specific trigger bin, if -1 then no selection is applied (default)", int(-1));
46 addParam("histogramDirectoryName", m_histogramDirectoryName, "Name of the directory where histograms will be placed.",
47 std::string("SVDClsTrk"));
48 addParam("desynchronizeSVDTime", m_desynchSVDTime,
49 "if True, svd time back in SVD time reference", bool(false));
50 addParam("EventInfo", m_svdEventInfoName, "SVDEventInfo StoreArray name.", std::string(""));
51 addParam("Clusters", m_svdClustersName, "SVDCluster StoreArray name.", std::string(""));
52 addParam("RecoDigits", m_svdRecoDigitsName, "SVDRecoDigits StoreArray name.", std::string(""));
53 addParam("ShaperDigits", m_svdShaperDigitsName, "SVDShaperDigits StoreArray name.", std::string(""));
54 addParam("samples3", m_3Samples, "if True 3 samples histograms analysis is performed", bool(false));
55
56 m_histoList = new TList();
57
58 m_ladderMap = {
59 {{3, 1}, 0}, {{3, 2}, 1},
60 {{4, 1}, 2}, {{4, 2}, 3}, {{4, 3}, 4},
61 {{5, 1}, 5}, {{5, 2}, 6}, {{5, 3}, 7}, {{5, 4}, 8},
62 {{6, 1}, 9}, {{6, 2}, 10}, {{6, 3}, 11}, {{6, 4}, 12}, {{6, 5}, 13}
63 };
64}
65
66
67SVDDQMClustersOnTrackModule::~SVDDQMClustersOnTrackModule()
68{
69}
70
71//------------------------------------------------------------------
72// Function to define histograms
73//-----------------------------------------------------------------
74
76{
78 if (gTools->getNumberOfLayers() == 0) {
79 B2FATAL("Missing geometry for VXD, check steering file.");
80 }
81 if (gTools->getNumberOfSVDLayers() == 0) {
82 B2WARNING("Missing geometry for SVD, SVD-DQM is skipped.");
83 return;
84 }
85
86 // Create a separate histogram directories and cd into it.
87 TDirectory* oldDir = gDirectory;
88 if (m_histogramDirectoryName != "") {
89 oldDir->mkdir(m_histogramDirectoryName.c_str());// do not use return value with ->cd(), its ZERO if dir already exists
90 oldDir->cd(m_histogramDirectoryName.c_str());
91 }
92
93 int ChargeBins = 80;
94 float ChargeMax = 160;
95 int SNRBins = 50;
96 float SNRMax = 100;
97 int TimeBins = 300;
98 float TimeMin = -150;
99 float TimeMax = 150;
100
101 int MaxBinBins = 6;
102 int MaxBinMax = 6;
103
104 TString refFrame = "in FTSW reference";
106 refFrame = "in SVD reference";
107
108
109 //----------------------------------------------------------------
110 // Charge of clusters for L3/L456 sensors
111 //----------------------------------------------------------------
112 TString name = "SVDTRK_ClusterChargeU3";
113 TString title = "SVD U-Cluster-on-Track Charge for layer 3 sensors";
114 m_clsTrkChargeU3 = new TH1F(name.Data(), title.Data(), ChargeBins, 0, ChargeMax);
115 m_clsTrkChargeU3->GetXaxis()->SetTitle("cluster charge [ke-]");
116 m_clsTrkChargeU3->GetYaxis()->SetTitle("count");
118 name = "SVDTRK_ClusterChargeV3";
119 title = "SVD V-Cluster-on-Track Charge for layer 3 sensors";
120 m_clsTrkChargeV3 = new TH1F(name.Data(), title.Data(), ChargeBins, 0, ChargeMax);
121 m_clsTrkChargeV3->GetXaxis()->SetTitle("cluster charge [ke-]");
122 m_clsTrkChargeV3->GetYaxis()->SetTitle("count");
124
125 name = "SVDTRK_ClusterChargeU456";
126 title = "SVD U-Cluster-on-Track Charge for layers 4,5,6 sensors";
127 m_clsTrkChargeU456 = new TH1F(name.Data(), title.Data(), ChargeBins, 0, ChargeMax);
128 m_clsTrkChargeU456->GetXaxis()->SetTitle("cluster charge [ke-]");
129 m_clsTrkChargeU456->GetYaxis()->SetTitle("count");
131
132 name = "SVDTRK_ClusterChargeV456";
133 title = "SVD V-Cluster-on-Track Charge for layers 4,5,6 sensors";
134 m_clsTrkChargeV456 = new TH1F(name.Data(), title.Data(), ChargeBins, 0, ChargeMax);
135 m_clsTrkChargeV456->GetXaxis()->SetTitle("cluster charge [ke-]");
136 m_clsTrkChargeV456->GetYaxis()->SetTitle("count");
138
139 m_clsTrkChargeL3 = new TH1F*[4];
140 m_clsTrkSNRL3 = new TH1F*[4];
141
142 int ind = 0;
143 for (int ladder = 1; ladder <= 2; ++ladder) {
144 for (int sensor = 1; sensor <= 2; ++sensor) {
145
146 name = Form("SVDTRK_ClusterCharge_L3.%d.%d", ladder, sensor);
147 title = Form("SVD Cluster-on-Track Charge for L3.%d.%d", ladder, sensor);
148 m_clsTrkChargeL3[ind] = new TH1F(name.Data(), title.Data(), ChargeBins, 0, ChargeMax);
149 m_clsTrkChargeL3[ind]->GetXaxis()->SetTitle("cluster charge [ke-]");
150 m_clsTrkChargeL3[ind]->GetYaxis()->SetTitle("count");
151 m_histoList->Add(m_clsTrkChargeL3[ind]);
152
153 name = Form("SVDTRK_ClusterSNR_L3.%d.%d", ladder, sensor);
154 title = Form("SVD Cluster-on-Track SNR for L3.%d.%d", ladder, sensor);
155 m_clsTrkSNRL3[ind] = new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
156 m_clsTrkSNRL3[ind]->GetXaxis()->SetTitle("cluster SNR");
157 m_clsTrkSNRL3[ind]->GetYaxis()->SetTitle("count");
158 m_histoList->Add(m_clsTrkSNRL3[ind]);
159 ind++;
160 }
161 }
162
163 m_clsTrkCharge = new TH1F*[m_ladderMap.size()];
164 m_clsTrkSNR = new TH1F*[m_ladderMap.size()];
165
166 for (const auto& it : m_ladderMap) {
167 std::pair<int, int> p = it.first;
168 int layer = p.first;
169 int sensor = p.second;
170 int idx = it.second;
171 name = Form("SVDTRK_ClusterCharge_L%d.x.%d", layer, sensor);
172 title = Form("SVD Cluster-on-Track Charge for L%d.x.%d", layer, sensor);
173 m_clsTrkCharge[idx] = new TH1F(name.Data(), title.Data(), ChargeBins, 0, ChargeMax);
174 m_clsTrkCharge[idx]->GetXaxis()->SetTitle("cluster charge [ke-]");
175 m_clsTrkCharge[idx]->GetYaxis()->SetTitle("count");
176 m_histoList->Add(m_clsTrkCharge[idx]);
177
178 //printf("name %s layer %d sensor %d index %d\n", name.Data(), layer, sensor, idx);
179 name = Form("SVDTRK_ClusterSNR_L%d.x.%d", layer, sensor);
180 title = Form("SVD Cluster-on-Track SNR for L%d.x.%d", layer, sensor);
181 m_clsTrkSNR[idx] = new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
182 m_clsTrkSNR[idx]->GetXaxis()->SetTitle("cluster SNR");
183 m_clsTrkSNR[idx]->GetYaxis()->SetTitle("count");
184 m_histoList->Add(m_clsTrkSNR[idx]);
185 }
186
187 //----------------------------------------------------------------
188 // SNR of clusters for L3/L456 sensors
189 //----------------------------------------------------------------
190 name = "SVDTRK_ClusterSNRU3";
191 title = "SVD U-Cluster-on-Track SNR for layer 3 sensors";
192 m_clsTrkSNRU3 = new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
193 m_clsTrkSNRU3->GetXaxis()->SetTitle("cluster SNR");
194 m_clsTrkSNRU3->GetYaxis()->SetTitle("count");
196 name = "SVDTRK_ClusterSNRV3";
197 title = "SVD V-Cluster-on-Track SNR for layer 3 sensors";
198 m_clsTrkSNRV3 = new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
199 m_clsTrkSNRV3->GetXaxis()->SetTitle("cluster SNR");
200 m_clsTrkSNRV3->GetYaxis()->SetTitle("count");
202
203 name = "SVDTRK_ClusterSNRU456";
204 title = "SVD U-Cluster-on-Track SNR for layers 4,5,6 sensors";
205 m_clsTrkSNRU456 = new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
206 m_clsTrkSNRU456->GetXaxis()->SetTitle("cluster SNR");
207 m_clsTrkSNRU456->GetYaxis()->SetTitle("count");
209 name = "SVDTRK_ClusterSNRV456";
210 title = "SVD V-Cluster-on-Track SNR for layers 4,5,6 sensors";
211 m_clsTrkSNRV456 = new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
212 m_clsTrkSNRV456->GetXaxis()->SetTitle("cluster SNR");
213 m_clsTrkSNRV456->GetYaxis()->SetTitle("count");
215
216 //----------------------------------------------------------------
217 // Time of clusters for L3/L456 sensors
218 //----------------------------------------------------------------
219 name = "SVDTRK_ClusterTimeU3";
220 title = Form("SVD U-Cluster-on-Track Time %s for layer 3 sensors", refFrame.Data());
221 m_clsTrkTimeU3 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
222 m_clsTrkTimeU3->GetXaxis()->SetTitle("cluster time (ns)");
223 m_clsTrkTimeU3->GetYaxis()->SetTitle("count");
225 name = "SVDTRK_ClusterTimeV3";
226 title = Form("SVD V-Cluster-on-Track Time %s for layer 3 sensors", refFrame.Data());
227 m_clsTrkTimeV3 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
228 m_clsTrkTimeV3->GetXaxis()->SetTitle("cluster time (ns)");
229 m_clsTrkTimeV3->GetYaxis()->SetTitle("count");
231
232 if (m_3Samples) {
233 name = "SVDTRK_Cluster3SampleTimeU3";
234 title = Form("SVD U-Cluster-on-Track Time %s for layer 3 sensors for 3 samples", refFrame.Data());
235 m_cls3SampleTrkTimeU3 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
236 m_cls3SampleTrkTimeU3->GetXaxis()->SetTitle("cluster time (ns)");
237 m_cls3SampleTrkTimeU3->GetYaxis()->SetTitle("count");
239 name = "SVDTRK_Cluster3SampleTimeV3";
240 title = Form("SVD V-Cluster-on-Track Time %s for layer 3 sensors for 3 samples", refFrame.Data());
241 m_cls3SampleTrkTimeV3 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
242 m_cls3SampleTrkTimeV3->GetXaxis()->SetTitle("cluster time (ns)");
243 m_cls3SampleTrkTimeV3->GetYaxis()->SetTitle("count");
245
246 name = "SVDTRK_Cluster6SampleTimeU3";
247 title = Form("SVD U-Cluster-on-Track Time %s for layer 3 sensors for 6 samples", refFrame.Data());
248 m_cls6SampleTrkTimeU3 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
249 m_cls6SampleTrkTimeU3->GetXaxis()->SetTitle("cluster time (ns)");
250 m_cls6SampleTrkTimeU3->GetYaxis()->SetTitle("count");
252 name = "SVDTRK_Cluster6SampleTimeV3";
253 title = Form("SVD V-Cluster-on-Track Time %s for layer 3 sensors for 6 samples", refFrame.Data());
254 m_cls6SampleTrkTimeV3 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
255 m_cls6SampleTrkTimeV3->GetXaxis()->SetTitle("cluster time (ns)");
256 m_cls6SampleTrkTimeV3->GetYaxis()->SetTitle("count");
258 }
259
260 name = "SVDTRK_ClusterTimeU456";
261 title = Form("SVD U-Cluster-on-Track Time %s for layers 4,5,6 sensors", refFrame.Data());
262 m_clsTrkTimeU456 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
263 m_clsTrkTimeU456->GetXaxis()->SetTitle("cluster time (ns)");
264 m_clsTrkTimeU456->GetYaxis()->SetTitle("count");
266 name = "SVDTRK_ClusterTimeV456";
267 title = Form("SVD V-Cluster-on-Track Time %s for layers 4,5,6 sensors", refFrame.Data());
268 m_clsTrkTimeV456 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
269 m_clsTrkTimeV456->GetXaxis()->SetTitle("cluster time (ns)");
270 m_clsTrkTimeV456->GetYaxis()->SetTitle("count");
272
273 if (m_3Samples) {
274 name = "SVDTRK_Cluster3SampleTimeU456";
275 title = Form("SVD U-Cluster-on-Track Time %s for layers 4,5,6 sensors for 3 samples", refFrame.Data());
276 m_cls3SampleTrkTimeU456 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
277 m_cls3SampleTrkTimeU456->GetXaxis()->SetTitle("cluster time (ns)");
278 m_cls3SampleTrkTimeU456->GetYaxis()->SetTitle("count");
280 name = "SVDTRK_Cluster3SampleTimeV456";
281 title = Form("SVD V-Cluster-on-Track Time %s for layers 4,5,6 sensors for 3 samples", refFrame.Data());
282 m_cls3SampleTrkTimeV456 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
283 m_cls3SampleTrkTimeV456->GetXaxis()->SetTitle("cluster time (ns)");
284 m_cls3SampleTrkTimeV456->GetYaxis()->SetTitle("count");
286
287 name = "SVDTRK_Cluster6SampleTimeU456";
288 title = Form("SVD U-Cluster-on-Track Time %s for layers 4,5,6 sensors for 6 samples", refFrame.Data());
289 m_cls6SampleTrkTimeU456 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
290 m_cls6SampleTrkTimeU456->GetXaxis()->SetTitle("cluster time (ns)");
291 m_cls6SampleTrkTimeU456->GetYaxis()->SetTitle("count");
293 name = "SVDTRK_Cluster6SampleTimeV456";
294 title = Form("SVD V-Cluster-on-Track Time %s for layers 4,5,6 sensors for 6 samples", refFrame.Data());
295 m_cls6SampleTrkTimeV456 = new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
296 m_cls6SampleTrkTimeV456->GetXaxis()->SetTitle("cluster time (ns)");
297 m_cls6SampleTrkTimeV456->GetYaxis()->SetTitle("count");
299 }
300
301 //----------------------------------------------------------------
302 // EventT0 vs Time of clusters for U and V sides
303 //----------------------------------------------------------------
304 name = "SVDTRK_ClusterTimeUvsEventT0";
305 title = Form("SVD U-Cluster-on-Track Time vs EventT0 %s for layer 3 sensors", refFrame.Data());
306 m_clsTrkTimeUEvtT0 = new TH2F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax, 100, -50, 50);
307 m_clsTrkTimeUEvtT0->GetXaxis()->SetTitle("clusters time (ns)");
308 m_clsTrkTimeUEvtT0->GetYaxis()->SetTitle("EventT0 (ns)");
310 name = "SVDTRK_ClusterTimeVvsEventT0";
311 title = Form("SVD V-Cluster-on-Track Time vs EventT0 %s for layer 3 sensors", refFrame.Data());
312 m_clsTrkTimeVEvtT0 = new TH2F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax, 100, -50, 50);
313 m_clsTrkTimeVEvtT0->GetXaxis()->SetTitle("cluster time (ns)");
314 m_clsTrkTimeVEvtT0->GetYaxis()->SetTitle("EventT0 (ns)");
316
317 //----------------------------------------------------------------
318 // MaxBin of strips for all sensors (offline ZS)
319 //----------------------------------------------------------------
320 name = "SVDTRK_StripMaxBinUAll";
321 title = "SVD U-Strip-on-Track MaxBin for all sensors";
322 m_stripMaxBinUAll = new TH1F(name.Data(), title.Data(), MaxBinBins, 0, MaxBinMax);
323 m_stripMaxBinUAll->GetXaxis()->SetTitle("max bin");
324 m_stripMaxBinUAll->GetYaxis()->SetTitle("count");
326 name = "SVDTRK_StripMaxBinVAll";
327 title = "SVD V-Strip-on-Track MaxBin for all sensors";
328 m_stripMaxBinVAll = new TH1F(name.Data(), title.Data(), MaxBinBins, 0, MaxBinMax);
329 m_stripMaxBinVAll->GetXaxis()->SetTitle("max bin");
330 m_stripMaxBinVAll->GetYaxis()->SetTitle("count");
332
333
334 oldDir->cd();
335}
336
337
339{
340 // Register histograms (calls back defineHisto)
341 REG_HISTOGRAM
342
343 auto gTools = VXD::GeoCache::getInstance().getGeoTools();
344 if (gTools->getNumberOfSVDLayers() != 0) {
345
347 m_eventT0.isOptional();
348 m_tracks.isOptional();
349 m_resultStoreObjectPointer.isOptional();
350
351 }
352}
353
355{
356 auto gTools = VXD::GeoCache::getInstance().getGeoTools();
357 if (gTools->getNumberOfSVDLayers() == 0) return;
358
359 // Add experiment and run number to the title of selected histograms (CR shifter plots)
360 StoreObjPtr<EventMetaData> evtMetaData;
361 m_expNumber = evtMetaData->getExperiment();
362 m_runNumber = evtMetaData->getRun();
363 TString runID = TString::Format(" ~ Exp%d Run%d", m_expNumber, m_runNumber);
364
365 //reset histograms
366 TObject* obj;
367 TIter nextH(m_histoList);
368 while ((obj = nextH()))
369 if (obj->InheritsFrom("TH1")) {
370 ((TH1F*)obj)->Reset();
371
372 TString tmp = (TString)obj->GetTitle();
373 Int_t pos = tmp.Last('~');
374 if (pos == -1) pos = tmp.Length() + 2;
375
376 TString title = tmp(0, pos - 2);
377 ((TH1F*)obj)->SetTitle(title + runID);
378 }
379}
380
382{
383
384 if (!m_tracks.isValid()) {
385 B2WARNING("Missing Tracks StoreArray. Skipping SVDDQMClustersOnTrack");
386 return;
387 }
388
389 if (!m_svdEventInfo.isValid())
390 m_tb = -1;
391 else {
392 if (m_tb != -1)
393 if (m_svdEventInfo->getModeByte().getTriggerBin() != m_tb)
394 return;
395 }
396
397 int nSamples = 0;
398 if (m_svdEventInfo.isValid())
399 nSamples = m_svdEventInfo->getNSamples();
400 else
401 return;
402
403 // get EventT0 if present and valid
404 double eventT0 = -1000;
405 if (m_eventT0.isOptional())
406 if (m_eventT0.isValid())
407 if (m_eventT0->hasEventT0())
408 eventT0 = m_eventT0->getEventT0();
409
410 // if svd time in SVD time reference is shown, eventT0 is also synchronized with SVD reference frame, firstFrame = 0
411 if (m_desynchSVDTime && m_svdEventInfo.isValid())
412 eventT0 = eventT0 - m_svdEventInfo->getSVD2FTSWTimeShift(0);
413
414 //check HLT decision and increase number of events only if the event has been accepted
415
418 if (!eventAccepted) return;
419 }
420
421 auto gTools = VXD::GeoCache::getInstance().getGeoTools();
422 if (gTools->getNumberOfSVDLayers() == 0) return;
423
424
425 for (const Track& track : m_tracks) {
426
427 const TrackFitResult* tfr = track.getTrackFitResultWithClosestMass(Const::pion);
428 if (not tfr) continue;
429
430 const RecoTrack* recoTrack = track.getRelated<RecoTrack>();
431 if (not recoTrack) continue;
432
433 for (const SVDCluster& svdCluster : recoTrack->getRelationsWith<SVDCluster>(m_svdClustersName)) {
434
435 int iLayer = svdCluster.getSensorID().getLayerNumber();
436 int iLadder = svdCluster.getSensorID().getLadderNumber();
437 int iSensor = svdCluster.getSensorID().getSensorNumber();
438
439 if (iLayer == 3) {
440 int ind = -1;
441 if (iLadder == 1 && iSensor == 1) {
442 ind = 0;
443 } else if (iLadder == 1 && iSensor == 2) {
444 ind = 1;
445 } else if (iLadder == 2 && iSensor == 1) {
446 ind = 2;
447 } else if (iLadder == 2 && iSensor == 2) {
448 ind = 3;
449 }
450
451 if (ind != -1) {
452 if (m_clsTrkChargeL3[ind] != nullptr) m_clsTrkChargeL3[ind]->Fill(svdCluster.getCharge() / 1000.0); // in kelectrons
453 if (m_clsTrkSNRL3[ind] != nullptr) m_clsTrkSNRL3[ind]->Fill(svdCluster.getSNR());
454 }
455
456 }
457
458 std::pair<int, int> p(iLayer, iSensor);
459 int idx = m_ladderMap[p];
460
461 if (m_clsTrkCharge[idx] != nullptr) m_clsTrkCharge[idx]->Fill(svdCluster.getCharge() / 1000.0); // in kelectrons
462 if (m_clsTrkSNR[idx] != nullptr) m_clsTrkSNR[idx]->Fill(svdCluster.getSNR());
463
464 float time = svdCluster.getClsTime();
465 if (m_desynchSVDTime && m_svdEventInfo.isValid())
466 time = time - m_svdEventInfo->getSVD2FTSWTimeShift(svdCluster.getFirstFrame());
467
468 if (svdCluster.isUCluster()) {
469
470 m_clsTrkTimeUEvtT0->Fill(time, eventT0);
471
472 if (iLayer == 3) {
473 if (m_clsTrkChargeU3 != nullptr) m_clsTrkChargeU3->Fill(svdCluster.getCharge() / 1000.0); // in kelectrons
474 if (m_clsTrkSNRU3 != nullptr) m_clsTrkSNRU3->Fill(svdCluster.getSNR());
475 if (m_clsTrkTimeU3 != nullptr) m_clsTrkTimeU3->Fill(time);
476
477 if (m_3Samples) {
478 if (nSamples == 3) {
479 if (m_cls3SampleTrkTimeU3 != nullptr) m_cls3SampleTrkTimeU3->Fill(time);
480 } else {
481 if (m_cls6SampleTrkTimeU3 != nullptr) m_cls6SampleTrkTimeU3->Fill(time);
482 }
483 }
484 } else {
485 if (m_clsTrkChargeU456 != nullptr) m_clsTrkChargeU456->Fill(svdCluster.getCharge() / 1000.0); // in kelectrons
486 if (m_clsTrkSNRU456 != nullptr) m_clsTrkSNRU456->Fill(svdCluster.getSNR());
487 if (m_clsTrkTimeU456 != nullptr) m_clsTrkTimeU456->Fill(time);
488
489 if (m_3Samples) {
490 if (nSamples == 3) {
491 if (m_cls3SampleTrkTimeU456 != nullptr) m_cls3SampleTrkTimeU456->Fill(time);
492 } else {
493 if (m_cls6SampleTrkTimeU456 != nullptr) m_cls6SampleTrkTimeU456->Fill(time);
494 }
495 }
496 }
497
498 for (const SVDRecoDigit& recoDigit : svdCluster.getRelationsTo<SVDRecoDigit>(m_svdRecoDigitsName)) {
499
501 if (m_stripMaxBinUAll != nullptr and shaper != nullptr) m_stripMaxBinUAll->Fill(shaper->getMaxTimeBin());
502 }
503
504
505 } else {
506
507 m_clsTrkTimeVEvtT0->Fill(time, eventT0);
508
509 if (iLayer == 3) {
510 if (m_clsTrkChargeV3 != nullptr) m_clsTrkChargeV3->Fill(svdCluster.getCharge() / 1000.0); // in kelectrons
511 if (m_clsTrkSNRV3 != nullptr) m_clsTrkSNRV3->Fill(svdCluster.getSNR());
512 if (m_clsTrkTimeV3 != nullptr) m_clsTrkTimeV3->Fill(time);
513 if (m_3Samples) {
514 if (nSamples == 3) {
515 if (m_cls3SampleTrkTimeV3 != nullptr) m_cls3SampleTrkTimeV3->Fill(time);
516 } else {
517 if (m_cls6SampleTrkTimeV3 != nullptr) m_cls6SampleTrkTimeV3->Fill(time);
518 }
519 }
520 } else {
521 if (m_clsTrkChargeV456 != nullptr) m_clsTrkChargeV456->Fill(svdCluster.getCharge() / 1000.0); // in kelectrons
522 if (m_clsTrkSNRV456 != nullptr) m_clsTrkSNRV456->Fill(svdCluster.getSNR());
523 if (m_clsTrkTimeV456 != nullptr) m_clsTrkTimeV456->Fill(time);
524 if (m_3Samples) {
525 if (nSamples == 3) {
526 if (m_cls3SampleTrkTimeV456 != nullptr) m_cls3SampleTrkTimeV456->Fill(time);
527 } else {
528 if (m_cls6SampleTrkTimeV456 != nullptr) m_cls6SampleTrkTimeV456->Fill(time);
529 }
530 }
531 }
532
533 for (const SVDRecoDigit& recoDigit : svdCluster.getRelationsTo<SVDRecoDigit>(m_svdRecoDigitsName)) {
534
536 if (m_stripMaxBinVAll != nullptr and shaper != nullptr) m_stripMaxBinVAll->Fill(shaper->getMaxTimeBin());
537 }
538
539 }
540
541 }
542 }
543}
544
545
547{
548
549 delete m_histoList;
550
551}
static const ChargedStable pion
charged pion particle
Definition: Const.h:661
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
@ 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:80
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
RelationVector< T > getRelationsWith(const std::string &name="", const std::string &namedRelation="") const
Get the relations between this object and another store array.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:29
TH1F ** m_clsTrkSNRL3
SNR of clusters related to tracks per layer 3.
std::string m_svdClustersName
SVDClusters data object name.
void initialize() override final
Module function initialize.
TH1F ** m_clsTrkChargeL3
charge of clusters related to tracks per layer 3
TH1F ** m_clsTrkCharge
charge of clusters related to tracks per ladder
TH1F * m_clsTrkSNRV456
v SNR of clusters related to tracks for layer 4,5,6 sensors
std::string m_svdShaperDigitsName
SVDShaperDigits data object name.
StoreObjPtr< EventT0 > m_eventT0
EventT0 data object.
bool m_skipRejectedEvents
if true skip events rejected by HLT (default)
TH1F * m_clsTrkTimeU3
u Time of clusters related to tracks for layer 3 sensors
TH1F * m_cls3SampleTrkTimeV3
v Time of clusters related to tracks for layer 3 sensors for 3 sampes
StoreObjPtr< SVDEventInfo > m_svdEventInfo
SVDEventInfo data object.
TH1F * m_cls3SampleTrkTimeU456
u Time of clusters related to tracks for layer 4,5,6 sensors for 3 samples
TH1F * m_clsTrkChargeV3
v charge of clusters related to tracks for layer 3 sensors
void defineHisto() override final
Contains the Histogram definitions
TH1F * m_clsTrkSNRU456
u SNR of clusters related to tracks for layer 4,5,6 sensors
TH1F * m_clsTrkSNRV3
v SNR of clusters related to tracks for layer 3 sensors
TH1F * m_cls6SampleTrkTimeU3
u Time of clusters related to tracks for layer 3 sensors for 3 samples
TH1F * m_cls6SampleTrkTimeV456
v Time of clusters related to tracks for layer 4,5,6 sensors for 6 samples
TH2F * m_clsTrkTimeUEvtT0
u Time of clusters related to tracks vs EventT0
void terminate() override final
Module function terminate.
TH1F * m_clsTrkChargeU456
u charge of clusters related to tracks for layer 4,5,6 sensors
TH1F * m_cls6SampleTrkTimeV3
v Time of clusters related to tracks for layer 3 sensors for 3 sampes
void event() override final
Module function event.
TH1F * m_clsTrkTimeV3
v Time of clusters related to tracks for layer 3 sensors
TH1F * m_cls3SampleTrkTimeU3
u Time of clusters related to tracks for layer 3 sensors for 3 samples
std::string m_histogramDirectoryName
Name of the histogram directory in ROOT file.
StoreArray< Track > m_tracks
StoreArray of the Tracks.
int m_tb
choose one trigger bin, or none if the value is -1
TH1F * m_stripMaxBinUAll
u MaxBin of strips related to tracks for all sensors
bool m_3Samples
if true enable 3 samples histograms analysis
TList * m_histoList
list of cumulative histograms
std::string m_svdRecoDigitsName
SVDRecoDigits data object name.
std::string m_svdEventInfoName
SVDEventInfo data object name.
TH1F * m_cls6SampleTrkTimeU456
u Time of clusters related to tracks for layer 4,5,6 sensors for 6 samples
void beginRun() override final
Module function beginRun.
TH1F * m_clsTrkSNRU3
u SNR of clusters related to tracks for layer 3 sensors
bool m_desynchSVDTime
if TRUE: svdTime back in SVD time reference
TH1F * m_clsTrkChargeU3
u charge of clusters related to tracks for layer 3 sensors
TH1F * m_stripMaxBinVAll
v MaxBin of strips related to tracks for all sensors
TH1F * m_cls3SampleTrkTimeV456
v Time of clusters related to tracks for layer 4,5,6 sensors for 3 samples
StoreObjPtr< SoftwareTriggerResult > m_resultStoreObjectPointer
Store Object for reading the trigger decision.
TH1F * m_clsTrkTimeU456
u Time of clusters related to tracks for layer 4,5,6 sensors
TH1F ** m_clsTrkSNR
SNR of clusters related to tracks per ladder.
TH2F * m_clsTrkTimeVEvtT0
v Time of clusters related to tracks vs EventT0
TH1F * m_clsTrkChargeV456
v charge of clusters related to tracks for layer 4,5,6 sensors
TH1F * m_clsTrkTimeV456
v Time of clusters related to tracks for layer 4,5,6 sensors
std::map< std::pair< int, int >, int > m_ladderMap
map of ladder index
The SVD RecoDigit class.
Definition: SVDRecoDigit.h:43
The SVD ShaperDigit class.
int getMaxTimeBin() const
Get the max bin.
static bool getFinalTriggerDecision(const SoftwareTriggerResult &result, bool forgetTotalResult=false)
Calculate the final cut decision using all "total_results" of all sub triggers in the software trigge...
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Values of the result of a track fit with a given particle hypothesis.
Class that bundles various TrackFitResults.
Definition: Track.h:25
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
const GeoTools * getGeoTools()
Return a raw pointer to a GeoTools object.
Definition: GeoCache.h:142
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.
STL namespace.