9 #include "svd/modules/svdDQM/SVDDQMClustersOnTrackModule.h"
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>
22 #include "TDirectory.h"
26 using namespace SoftwareTrigger;
38 SVDDQMClustersOnTrackModule::SVDDQMClustersOnTrackModule() :
HistoModule()
45 addParam(
"TriggerBin",
m_tb,
"select events for a specific trigger bin, if -1 then no selection is applied (default)",
int(-1));
47 std::string(
"SVDClsTrk"));
49 "if True, svd time back in SVD time reference",
bool(
false));
58 {{3, 1}, 0}, {{3, 2}, 1},
59 {{4, 1}, 2}, {{4, 2}, 3}, {{4, 3}, 4},
60 {{5, 1}, 5}, {{5, 2}, 6}, {{5, 3}, 7}, {{5, 4}, 8},
61 {{6, 1}, 9}, {{6, 2}, 10}, {{6, 3}, 11}, {{6, 4}, 12}, {{6, 5}, 13}
66 SVDDQMClustersOnTrackModule::~SVDDQMClustersOnTrackModule()
77 if (gTools->getNumberOfLayers() == 0) {
78 B2FATAL(
"Missing geometry for VXD, check steering file.");
80 if (gTools->getNumberOfSVDLayers() == 0) {
81 B2WARNING(
"Missing geometry for SVD, SVD-DQM is skipped.");
86 TDirectory* oldDir = gDirectory;
93 float ChargeMax = 160;
103 TString refFrame =
"in FTSW reference";
105 refFrame =
"in SVD reference";
111 TString name =
"SVDTRK_ClusterChargeU3";
112 TString title =
"SVD U-Cluster-on-Track Charge for layer 3 sensors";
113 m_clsTrkChargeU3 =
new TH1F(name.Data(), title.Data(), ChargeBins, 0, ChargeMax);
117 name =
"SVDTRK_ClusterChargeV3";
118 title =
"SVD V-Cluster-on-Track Charge for layer 3 sensors";
119 m_clsTrkChargeV3 =
new TH1F(name.Data(), title.Data(), ChargeBins, 0, ChargeMax);
124 name =
"SVDTRK_ClusterChargeU456";
125 title =
"SVD U-Cluster-on-Track Charge for layers 4,5,6 sensors";
131 name =
"SVDTRK_ClusterChargeV456";
132 title =
"SVD V-Cluster-on-Track Charge for layers 4,5,6 sensors";
142 for (
int ladder = 1; ladder <= 2; ++ladder) {
143 for (
int sensor = 1; sensor <= 2; ++sensor) {
145 name = Form(
"SVDTRK_ClusterCharge_L3.%d.%d", ladder, sensor);
146 title = Form(
"SVD Cluster-on-Track Charge for L3.%d.%d", ladder, sensor);
147 m_clsTrkChargeL3[ind] =
new TH1F(name.Data(), title.Data(), ChargeBins, 0, ChargeMax);
152 name = Form(
"SVDTRK_ClusterSNR_L3.%d.%d", ladder, sensor);
153 title = Form(
"SVD Cluster-on-Track SNR for L3.%d.%d", ladder, sensor);
154 m_clsTrkSNRL3[ind] =
new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
166 std::pair<int, int> p = it.first;
168 int sensor = p.second;
170 name = Form(
"SVDTRK_ClusterCharge_L%d.x.%d", layer, sensor);
171 title = Form(
"SVD Cluster-on-Track Charge for L%d.x.%d", layer, sensor);
172 m_clsTrkCharge[idx] =
new TH1F(name.Data(), title.Data(), ChargeBins, 0, ChargeMax);
173 m_clsTrkCharge[idx]->GetXaxis()->SetTitle(
"cluster charge [ke-]");
178 name = Form(
"SVDTRK_ClusterSNR_L%d.x.%d", layer, sensor);
179 title = Form(
"SVD Cluster-on-Track SNR for L%d.x.%d", layer, sensor);
180 m_clsTrkSNR[idx] =
new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
181 m_clsTrkSNR[idx]->GetXaxis()->SetTitle(
"cluster SNR");
189 name =
"SVDTRK_ClusterSNRU3";
190 title =
"SVD U-Cluster-on-Track SNR for layer 3 sensors";
191 m_clsTrkSNRU3 =
new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
195 name =
"SVDTRK_ClusterSNRV3";
196 title =
"SVD V-Cluster-on-Track SNR for layer 3 sensors";
197 m_clsTrkSNRV3 =
new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
202 name =
"SVDTRK_ClusterSNRU456";
203 title =
"SVD U-Cluster-on-Track SNR for layers 4,5,6 sensors";
204 m_clsTrkSNRU456 =
new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
208 name =
"SVDTRK_ClusterSNRV456";
209 title =
"SVD V-Cluster-on-Track SNR for layers 4,5,6 sensors";
210 m_clsTrkSNRV456 =
new TH1F(name.Data(), title.Data(), SNRBins, 0, SNRMax);
218 name =
"SVDTRK_ClusterTimeU3";
219 title = Form(
"SVD U-Cluster-on-Track Time %s for layer 3 sensors", refFrame.Data());
220 m_clsTrkTimeU3 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
224 name =
"SVDTRK_ClusterTimeV3";
225 title = Form(
"SVD V-Cluster-on-Track Time %s for layer 3 sensors", refFrame.Data());
226 m_clsTrkTimeV3 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
231 name =
"SVDTRK_Cluster3TimeU3";
232 title = Form(
"SVD U-Cluster-on-Track Time %s for layer 3 sensors for 3 samples", refFrame.Data());
233 m_cls3TrkTimeU3 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
237 name =
"SVDTRK_Cluster3TimeV3";
238 title = Form(
"SVD V-Cluster-on-Track Time %s for layer 3 sensors for 3 samples", refFrame.Data());
239 m_cls3TrkTimeV3 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
244 name =
"SVDTRK_Cluster6TimeU3";
245 title = Form(
"SVD U-Cluster-on-Track Time %s for layer 3 sensors for 6 samples", refFrame.Data());
246 m_cls6TrkTimeU3 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
250 name =
"SVDTRK_Cluster6TimeV3";
251 title = Form(
"SVD V-Cluster-on-Track Time %s for layer 3 sensors for 6 samples", refFrame.Data());
252 m_cls6TrkTimeV3 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
258 name =
"SVDTRK_ClusterTimeU456";
259 title = Form(
"SVD U-Cluster-on-Track Time %s for layers 4,5,6 sensors", refFrame.Data());
260 m_clsTrkTimeU456 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
264 name =
"SVDTRK_ClusterTimeV456";
265 title = Form(
"SVD V-Cluster-on-Track Time %s for layers 4,5,6 sensors", refFrame.Data());
266 m_clsTrkTimeV456 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
271 name =
"SVDTRK_Cluster3TimeU456";
272 title = Form(
"SVD U-Cluster-on-Track Time %s for layers 4,5,6 sensors for 3 samples", refFrame.Data());
273 m_cls3TrkTimeU456 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
277 name =
"SVDTRK_Cluster3TimeV456";
278 title = Form(
"SVD V-Cluster-on-Track Time %s for layers 4,5,6 sensors for 3 samples", refFrame.Data());
279 m_cls3TrkTimeV456 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
284 name =
"SVDTRK_Cluster6TimeU456";
285 title = Form(
"SVD U-Cluster-on-Track Time %s for layers 4,5,6 sensors for 6 samples", refFrame.Data());
286 m_cls6TrkTimeU456 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
290 name =
"SVDTRK_Cluster6TimeV456";
291 title = Form(
"SVD V-Cluster-on-Track Time %s for layers 4,5,6 sensors for 6 samples", refFrame.Data());
292 m_cls6TrkTimeV456 =
new TH1F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax);
300 name =
"SVDTRK_ClusterTimeUvsEventT0";
301 title = Form(
"SVD U-Cluster-on-Track Time vs EventT0 %s for layer 3 sensors", refFrame.Data());
302 m_clsTrkTimeUEvtT0 =
new TH2F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax, 100, -50, 50);
306 name =
"SVDTRK_ClusterTimeVvsEventT0";
307 title = Form(
"SVD V-Cluster-on-Track Time vs EventT0 %s for layer 3 sensors", refFrame.Data());
308 m_clsTrkTimeVEvtT0 =
new TH2F(name.Data(), title.Data(), TimeBins, TimeMin, TimeMax, 100, -50, 50);
316 name =
"SVDTRK_StripMaxBinUAll";
317 title =
"SVD U-Strip-on-Track MaxBin for all sensors";
318 m_stripMaxBinUAll =
new TH1F(name.Data(), title.Data(), MaxBinBins, 0, MaxBinMax);
322 name =
"SVDTRK_StripMaxBinVAll";
323 title =
"SVD V-Strip-on-Track MaxBin for all sensors";
324 m_stripMaxBinVAll =
new TH1F(name.Data(), title.Data(), MaxBinBins, 0, MaxBinMax);
340 if (gTools->getNumberOfSVDLayers() != 0) {
353 if (gTools->getNumberOfSVDLayers() == 0)
return;
364 while ((obj = nextH()))
365 if (obj->InheritsFrom(
"TH1")) {
366 ((TH1F*)obj)->Reset();
368 TString tmp = (TString)obj->GetTitle();
369 Int_t pos = tmp.Last(
'~');
370 if (pos == -1) pos = tmp.Length() + 2;
372 TString title = tmp(0, pos - 2);
373 ((TH1F*)obj)->SetTitle(title + runID);
381 B2WARNING(
"Missing Tracks StoreArray. Skipping SVDDQMClustersOnTrack");
400 double eventT0 = -1000;
414 if (!eventAccepted)
return;
418 if (gTools->getNumberOfSVDLayers() == 0)
return;
424 if (not tfr)
continue;
427 if (not recoTrack)
continue;
431 int iLayer = svdCluster.getSensorID().getLayerNumber();
432 int iLadder = svdCluster.getSensorID().getLadderNumber();
433 int iSensor = svdCluster.getSensorID().getSensorNumber();
437 if (iLadder == 1 && iSensor == 1) {
439 }
else if (iLadder == 1 && iSensor == 2) {
441 }
else if (iLadder == 2 && iSensor == 1) {
443 }
else if (iLadder == 2 && iSensor == 2) {
454 std::pair<int, int> p(iLayer, iSensor);
460 float time = svdCluster.getClsTime();
462 time = time -
m_svdEventInfo->getSVD2FTSWTimeShift(svdCluster.getFirstFrame());
464 if (svdCluster.isUCluster()) {
static const ChargedStable pion
charged pion particle
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...
This is the Reconstruction Event-Data Model Track.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
RelationVector< T > getRelationsWith(const std::string &name="", const std::string &namedRelation="") const
Get the relations between this object and another store array.
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
TH1F * m_cls6TrkTimeV456
v Time of clusters related to tracks for layer 4,5,6 sensors for 6 samples
TH1F ** m_clsTrkSNRL3
SNR of clusters related to tracks per layer 3.
TH1F * m_cls6TrkTimeU3
u Time of clusters related to tracks for layer 3 sensors for 3 samples
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
int m_runNumber
run number
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_cls3TrkTimeU456
u Time of clusters related to tracks for layer 4,5,6 sensors for 3 samples
TH1F * m_clsTrkTimeU3
u Time of clusters related to tracks for layer 3 sensors
TH1F * m_cls3TrkTimeV456
v Time of clusters related to tracks for layer 4,5,6 sensors for 3 samples
StoreObjPtr< SVDEventInfo > m_svdEventInfo
SVDEventInfo data object.
TH1F * m_clsTrkChargeV3
v charge of clusters related to tracks for layer 3 sensors
int m_expNumber
experiment number
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_cls6TrkTimeU456
u 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_cls3TrkTimeV3
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
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
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_cls6TrkTimeV3
v Time of clusters related to tracks for layer 3 sensors for 3 sampes
TH1F * m_cls3TrkTimeU3
u Time of clusters related to tracks for layer 3 sensors for 3 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
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 ShaperDigit class.
int getMaxTimeBin() const
Get the max bin.
Type-safe access to single objects in the data store.
Values of the result of a track fit with a given particle hypothesis.
Class that bundles various TrackFitResults.
static GeoCache & getInstance()
Return a reference to the singleton instance.
const GeoTools * getGeoTools()
Return a raw pointer to a GeoTools object.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.