9#include <svd/modules/svdDQM/SVDDQMHitTimeModule.h>
10#include <framework/core/HistoModule.h>
11#include <mdst/dataobjects/TRGSummary.h>
12#include <TDirectory.h>
22 setDescription(
"Make data quality monitoring plots for SVD Hit Time for bhabha, mu mu, and hadron samples seeded by different trigger times (ECL, CDC).");
24 std::string(
"SVDHitTime"));
30 "if True, svd time back in SVD time reference",
bool(
false));
31 addParam(
"samples3",
m_3Samples,
"if True 3 samples histograms analysis is performed",
bool(
false));
42 TDirectory* oldDir = gDirectory;
49 TString refFrame =
"in FTSW reference";
51 refFrame =
"in SVD reference";
54 Form(
"SVD L3 V-Side Cluster Time %s: bhabhas, ECLTRG time", refFrame.Data()),
58 "SVD L3 V-Side Cluster Time - EventT0 : bhabhas, ECLTRG time",
63 Form(
"SVD L3 V-Side Cluster Time %s: hadrons, ECLTRG time", refFrame.Data()),
67 "SVD L3 V-Side Cluster Time - EventT0 : hadrons, ECLTRG time",
72 Form(
"SVD L3 V-Side Cluster Time %s: mumus, ECLTRG time", refFrame.Data()),
76 "SVD L3 V-Side Cluster Time - EventT0 : mumus, ECLTRG time",
81 Form(
"SVD L3 V-Side Cluster Time %s: bhabhas, CDCTRG time", refFrame.Data()),
85 "SVD L3 V-Side Cluster Time - EventT0 : bhabhas, CDCTRG time",
90 Form(
"SVD L3 V-Side Cluster Time %s: hadrons, CDCTRG time", refFrame.Data()),
94 "SVD L3 V-Side Cluster Time - EventT0 : hadrons, CDCTRG time",
99 Form(
"SVD L3 V-Side Cluster Time %s: mumus, CDCTRG time", refFrame.Data()),
100 nBins, minT0, maxT0);
103 "SVD L3 V-Side Cluster Time - EventT0 : mumus, CDCTRG time",
104 nBins, minT0, maxT0);
108 m_SVDEventT03Sample =
new TH1F(
"SVD3EventT0",
"SVD EventT0 for 3 samples", nBins, minT0, maxT0);
112 m_SVDEventT06Sample =
new TH1F(
"SVDEventT06Sample",
"SVD EventT0 for 6 samples", nBins, minT0, maxT0);
117 "SVD EventT0 3 samples : bhabhas, ECLTRG time",
118 nBins, minT0, maxT0);
122 "SVD EventT0 3 samples : hadrons, ECLTRG time",
123 nBins, minT0, maxT0);
127 "SVD EventT0 3 samples : mumus, ECLTRG time",
128 nBins, minT0, maxT0);
132 "SVD EventT0 3 samples : bhabhas, CDCTRG time",
133 nBins, minT0, maxT0);
137 "SVD EventT0 3 samples : hadrons, CDCTRG time",
138 nBins, minT0, maxT0);
142 "SVD EventT0 3 samples : mumus, CDCTRG time",
143 nBins, minT0, maxT0);
149 "SVD EventT0 6 samples : bhabhas, ECLTRG time",
150 nBins, minT0, maxT0);
154 "SVD EventT0 6 samples : hadrons, ECLTRG time",
155 nBins, minT0, maxT0);
159 "SVD EventT0 6 samples : mumus, ECLTRG time",
160 nBins, minT0, maxT0);
164 "SVD EventT0 6 samples : bhabhas, CDCTRG time",
165 nBins, minT0, maxT0);
169 "SVD EventT0 6 samples : hadrons, CDCTRG time",
170 nBins, minT0, maxT0);
174 "SVD EventT0 6 samples : mumus, CDCTRG time",
175 nBins, minT0, maxT0);
242 B2WARNING(
"Missing TRGSummary, SVDDQMHitTime is skipped.");
246 B2WARNING(
"Missing SVDEventInfo, SVDDQMHitTime is skipped.");
253 B2WARNING(
"Missing SVDClusters, SVDDQMHitTime is skipped.");
259 B2WARNING(
"TRGSummary object not available but required to indicate which detector provided the L1 trigger time");
265 bool Is_ECL_L1TriggerSource = false ;
266 bool Is_CDC_L1TriggerSource = false ;
268 Is_ECL_L1TriggerSource = true ;
270 Is_CDC_L1TriggerSource = true ;
273 B2DEBUG(20,
"Is_ECL_L1TriggerSource = " << Is_ECL_L1TriggerSource) ;
274 B2DEBUG(20,
"Is_CDC_L1TriggerSource= " << Is_CDC_L1TriggerSource) ;
278 B2WARNING(
"SoftwareTriggerResult object not available but require to select bhabha/mumu/hadron events for this module");
282 const std::map<std::string, int>& fresults =
m_TrgResult->getResults();
283 if ((fresults.find(
"software_trigger_cut&skim&accept_bhabha") == fresults.end()) ||
284 (fresults.find(
"software_trigger_cut&skim&accept_mumu_2trk") == fresults.end()) ||
285 (fresults.find(
"software_trigger_cut&skim&accept_hadron") == fresults.end())) {
286 B2WARNING(
"SVDDQMHitTimeModule: Can't find required bhabha or mumu or hadron trigger identifier");
293 const bool IsEvtAcceptedBhabha = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_bhabha") ==
295 const bool IsEvtAcceptedHadron = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_hadron") ==
297 const bool IsEvtAcceptedMumu = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_mumu_2trk") ==
301 B2DEBUG(20,
"bhabha trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
302 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_bhabha"))) ;
303 B2DEBUG(20,
"hadron trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
304 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_hadron"))) ;
305 B2DEBUG(20,
"mu mu trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
306 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_mumu_2trk"))) ;
307 B2DEBUG(20,
"bhabha trigger comparison bool = " << IsEvtAcceptedBhabha) ;
308 B2DEBUG(20,
"hadron trigger comparison bool = " << IsEvtAcceptedHadron) ;
309 B2DEBUG(20,
"mumu trigger comparison bool = " << IsEvtAcceptedMumu) ;
313 double eventT0 = -1000;
324 if (
m_eventT0->hasTemporaryEventT0(Const::EDetector::SVD)) {
325 const auto bestSVDEvtT0 =
m_eventT0->getBestSVDTemporaryEventT0() ;
327 float svdEventT0 = bestSVDEvtT0->eventT0 ;
336 if (Is_ECL_L1TriggerSource) {
337 if (IsEvtAcceptedBhabha) {
344 if (IsEvtAcceptedHadron) {
351 if (IsEvtAcceptedMumu) {
361 else if (Is_CDC_L1TriggerSource) {
362 if (IsEvtAcceptedBhabha) {
369 if (IsEvtAcceptedHadron) {
376 if (IsEvtAcceptedMumu) {
391 if (cluster.getSensorID().getLayerNumber() != 3)
continue;
393 if (cluster.isUCluster())
continue;
395 double time = cluster.getClsTime();
399 time = time -
m_svdEventInfo->getSVD2FTSWTimeShift(cluster.getFirstFrame());
402 if (Is_ECL_L1TriggerSource) {
403 if (IsEvtAcceptedBhabha) {
407 if (IsEvtAcceptedHadron) {
411 if (IsEvtAcceptedMumu) {
418 else if (Is_CDC_L1TriggerSource) {
419 if (IsEvtAcceptedBhabha) {
423 if (IsEvtAcceptedHadron) {
427 if (IsEvtAcceptedMumu) {
433 B2DEBUG(20,
"eventT0 = " << eventT0 <<
" ns" <<
", SVD HitTime = " << time <<
" ns") ;
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...
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
virtual ~SVDDQMHitTimeModule()
Destructor.
TH1F * m_SVDEventT03Sample_mumu_L1_CDCTRG
svd eventT0 histogram for mu mu events wrt the CDC trigger time for 3 samples
StoreObjPtr< EventT0 > m_eventT0
EventT0 data object.
TH1F * m_l3v_mumu_L1_ECLTRG
svd time histogram for mu mu events wrt the ECL trigger time
virtual void initialize() override
Initialize the module.
StoreObjPtr< SVDEventInfo > m_svdEventInfo
SVDEventInfo data object.
TH1F * m_SVDEventT03Sample_hadron_L1_CDCTRG
svd eventT0 histogram for hadronic events wrt the CDC trigger time for 3 samples
TH1F * m_SVDEventT03Sample_mumu_L1_ECLTRG
svd eventT0 histogram for mu mu events wrt the ECL trigger time for 3 samples
virtual void event() override
This method is called for each event.
TH1F * m_SVDEventT06Sample_hadron_L1_CDCTRG
svd EventT0 histogram for hadronic events wrt the CDC trigger time for 6 samples
TH1F * m_l3vEvtT0_mumu_L1_ECLTRG
svd time histogram for mu mu events wrt the ECL trigger time
TH1F * m_SVDEventT06Sample
SVD event T0 for 6 sampels.
TH1F * m_SVDEventT06Sample_bhabha_L1_CDCTRG
svd eventT0 histogram for bhabha events wrt the CDC trigger time for 6 samples
TH1F * m_SVDEventT06Sample_bhabha_L1_ECLTRG
svd eventT0 histogram for bhabha events wrt the ECL trigger time for 6 samples
StoreArray< SVDCluster > m_clusters
Store array for clusters.
TH1F * m_l3v_hadron_L1_CDCTRG
svd time histogram for hadronic events wrt the CDC trigger time
TH1F * m_l3vEvtT0_mumu_L1_CDCTRG
svd time histogram for mu mu events wrt the CDC trigger time
TH1F * m_l3vEvtT0_hadron_L1_CDCTRG
svd time histogram for hadronic events wrt the CDC trigger time
TH1F * m_l3v_hadron_L1_ECLTRG
svd time histogram for hadronic events wrt the ECL trigger time
TH1F * m_l3vEvtT0_hadron_L1_ECLTRG
svd time histogram for hadronic events wrt the ECL trigger time
StoreObjPtr< TRGSummary > m_objTrgSummary
Trigger Summary data object.
virtual void beginRun() override
This method is called for each run.
std::string m_histogramDirectoryName
Name of the histogram directory in ROOT file.
TH1F * m_l3v_bhabha_L1_ECLTRG
svd time histogram for bhabha events wrt the ECL trigger time
bool m_3Samples
if true enable 3 samples histograms analysis
TH1F * m_l3vEvtT0_bhabha_L1_CDCTRG
svd time histogram for bhabha events wrt the CDC trigger time
TH1F * m_SVDEventT06Sample_mumu_L1_CDCTRG
svd eventT0 histogram for mu mu events wrt the CDC trigger time for 6 samples
TH1F * m_SVDEventT03Sample_bhabha_L1_ECLTRG
svd eventT0 histogram for bhabha events wrt the ECL trigger time for 3 samples
TH1F * m_l3v_mumu_L1_CDCTRG
svd time histogram for mu mu events wrt the CDC trigger time
bool m_desynchSVDTime
if TRUE: svdTime back in SVD time reference
TH1F * m_l3v_bhabha_L1_CDCTRG
svd time histogram for bhabha events wrt the CDC trigger time
TH1F * m_SVDEventT06Sample_hadron_L1_ECLTRG
svd eventT0 histogram for hadronic events wrt the ECL trigger time for 6 samples
TH1F * m_SVDEventT03Sample_hadron_L1_ECLTRG
svd eventT0 histogram for hadronic events wrt the ECL trigger time for 3 samples
TH1F * m_SVDEventT06Sample_mumu_L1_ECLTRG
svd eventT0 histogram for mu mu events wrt the ECL trigger time for 6 samples
int m_L1TimingSrc
L1 timing source from getTimeType() in TRGSummary See ETimingTYpe in mdst/dataobjects/include/TRGSumm...
std::string m_storeSVDClustersName
SVDClusters StoreArray name.
SVDDQMHitTimeModule()
Default constructor.
TH1F * m_SVDEventT03Sample
SVD event T0 for 3 sampels.
std::string m_storeSVDEventInfoName
SVDEventInfo StoreObjPtry name.
StoreObjPtr< SoftwareTriggerResult > m_TrgResult
Trigger selection data object.
TH1F * m_l3vEvtT0_bhabha_L1_ECLTRG
svd time histogram for bhabha events wrt the ECL trigger time
TH1F * m_SVDEventT03Sample_bhabha_L1_CDCTRG
svd eventT0 histogram for bhabha events wrt the CDC trigger time for 3 samples
virtual void defineHisto() override
Definition of histograms.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool isValid() const
Check wether the array was registered.
@ TTYP_CDC
events triggered by CDC timing
@ TTYP_ECL
events triggered by ECL timing
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.
@ c_accept
Accept this event.
Abstract base class for different kinds of events.