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"
26using namespace SoftwareTrigger;
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));
54 addParam(
"samples3",
m_3Samples,
"if True 3 samples histograms analysis is performed",
bool(
false));
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}
67SVDDQMClustersOnTrackModule::~SVDDQMClustersOnTrackModule()
78 if (gTools->getNumberOfLayers() == 0) {
79 B2FATAL(
"Missing geometry for VXD, check steering file.");
81 if (gTools->getNumberOfSVDLayers() == 0) {
82 B2WARNING(
"Missing geometry for SVD, SVD-DQM is skipped.");
87 TDirectory* oldDir = gDirectory;
94 float ChargeMax = 160;
104 TString refFrame =
"in FTSW reference";
106 refFrame =
"in SVD reference";
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);
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);
125 name =
"SVDTRK_ClusterChargeU456";
126 title =
"SVD U-Cluster-on-Track Charge for layers 4,5,6 sensors";
132 name =
"SVDTRK_ClusterChargeV456";
133 title =
"SVD V-Cluster-on-Track Charge for layers 4,5,6 sensors";
143 for (
int ladder = 1; ladder <= 2; ++ladder) {
144 for (
int sensor = 1; sensor <= 2; ++sensor) {
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);
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);
167 std::pair<int, int> p = it.first;
169 int sensor = p.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-]");
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");
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);
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);
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);
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);
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);
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);
233 name =
"SVDTRK_Cluster3SampleTimeU3";
234 title = Form(
"SVD U-Cluster-on-Track Time %s for layer 3 sensors for 3 samples", refFrame.Data());
239 name =
"SVDTRK_Cluster3SampleTimeV3";
240 title = Form(
"SVD V-Cluster-on-Track Time %s for layer 3 sensors for 3 samples", refFrame.Data());
246 name =
"SVDTRK_Cluster6SampleTimeU3";
247 title = Form(
"SVD U-Cluster-on-Track Time %s for layer 3 sensors for 6 samples", refFrame.Data());
252 name =
"SVDTRK_Cluster6SampleTimeV3";
253 title = Form(
"SVD V-Cluster-on-Track Time %s for layer 3 sensors for 6 samples", refFrame.Data());
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);
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);
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());
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());
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());
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());
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);
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);
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);
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);
344 if (gTools->getNumberOfSVDLayers() != 0) {
357 if (gTools->getNumberOfSVDLayers() == 0)
return;
368 while ((obj = nextH()))
369 if (obj->InheritsFrom(
"TH1")) {
370 ((TH1F*)obj)->Reset();
372 TString tmp = (TString)obj->GetTitle();
373 Int_t pos = tmp.Last(
'~');
374 if (pos == -1) pos = tmp.Length() + 2;
376 TString title = tmp(0, pos - 2);
377 ((TH1F*)obj)->SetTitle(title + runID);
385 B2WARNING(
"Missing Tracks StoreArray. Skipping SVDDQMClustersOnTrack");
404 double eventT0 = -1000;
418 if (!eventAccepted)
return;
422 if (gTools->getNumberOfSVDLayers() == 0)
return;
428 if (not tfr)
continue;
431 if (not recoTrack)
continue;
435 int iLayer = svdCluster.getSensorID().getLayerNumber();
436 int iLadder = svdCluster.getSensorID().getLadderNumber();
437 int iSensor = svdCluster.getSensorID().getSensorNumber();
441 if (iLadder == 1 && iSensor == 1) {
443 }
else if (iLadder == 1 && iSensor == 2) {
445 }
else if (iLadder == 2 && iSensor == 1) {
447 }
else if (iLadder == 2 && iSensor == 2) {
458 std::pair<int, int> p(iLayer, iSensor);
464 float time = svdCluster.getClsTime();
466 time = time -
m_svdEventInfo->getSVD2FTSWTimeShift(svdCluster.getFirstFrame());
468 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.
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.
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
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_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
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_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
SVDDQMClustersOnTrackModule()
Constructor.
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 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.
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.