9#include <reconstruction/modules/EventT0DQM/EventT0DQM.h>
10#include <framework/core/HistoModule.h>
20 setDescription(
"Make data quality monitoring plots for EventT0 for bhabha, mu mu, and hadron samples for different trigger (time) sources.");
31 TDirectory* oldDir = gDirectory;
32 oldDir->mkdir(
"EventT0")->cd();
39 "ECL EventT0, L1TRG from ECL, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
42 "CDC EventT0, L1TRG from ECL, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
45 "TOP EventT0, L1TRG from ECL, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
48 "SVD EventT0, L1TRG from ECL, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
52 "ECL EventT0, L1TRG from ECL, HLT Hadron;EventT0 [ns];events / 0.5 ns",
55 "CDC EventT0, L1TRG from ECL, HLT Hadron;EventT0 [ns];events / 0.5 ns",
58 "TOP EventT0, L1TRG from ECL, HLT Hadron;EventT0 [ns];events / 0.5 ns",
61 "SVD EventT0, L1TRG from ECL, HLT Hadron;EventT0 [ns];events / 0.5 ns",
65 "ECL EventT0, L1TRG from ECL, HLT mumu;EventT0 [ns];events / 0.5 ns",
68 "CDC EventT0, L1TRG from ECL, HLT mumu;EventT0 [ns];events / 0.5 ns",
71 "TOP EventT0, L1TRG from ECL, HLT mumu;EventT0 [ns];events / 0.5 ns",
74 "SVD EventT0, L1TRG from ECL, HLT mumu;EventT0 [ns];events / 0.5 ns",
79 "ECL EventT0, L1TRG from CDC, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
82 "CDC EventT0, L1TRG from CDC, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
85 "TOP EventT0, L1TRG from CDC, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
88 "SVD EventT0, L1TRG from CDC, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
92 "ECL EventT0, L1TRG from CDC, HLT Hadron;EventT0 [ns];events / 0.5 ns",
95 "CDC EventT0, L1TRG from CDC, HLT Hadron;EventT0 [ns];events / 0.5 ns",
98 "TOP EventT0, L1TRG from CDC, HLT Hadron;EventT0 [ns];events / 0.5 ns",
101 "SVD EventT0, L1TRG from CDC, HLT Hadron;EventT0 [ns];events / 0.5 ns",
102 nBins, minT0, maxT0);
105 "ECL EventT0, L1TRG from CDC, HLT mumu;EventT0 [ns];events / 0.5 ns",
106 nBins, minT0, maxT0);
108 "CDC EventT0, L1TRG from CDC, HLT mumu;EventT0 [ns];events / 0.5 ns",
109 nBins, minT0, maxT0);
111 "TOP EventT0, L1TRG from CDC, HLT mumu;EventT0 [ns];events / 0.5 ns",
112 nBins, minT0, maxT0);
114 "SVD EventT0, L1TRG from CDC, HLT mumu;EventT0 [ns];events / 0.5 ns",
115 nBins, minT0, maxT0);
119 "ECL EventT0, L1TRG from TOP, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
120 nBins, minT0, maxT0);
122 "CDC EventT0, L1TRG from TOP, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
123 nBins, minT0, maxT0);
125 "TOP EventT0, L1TRG from TOP, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
126 nBins, minT0, maxT0);
128 "SVD EventT0, L1TRG from TOP, HLT Bhabha;EventT0 [ns];events / 0.5 ns",
129 nBins, minT0, maxT0);
132 "ECL EventT0, L1TRG from TOP, HLT Hadron;EventT0 [ns];events / 0.5 ns",
133 nBins, minT0, maxT0);
135 "CDC EventT0, L1TRG from TOP, HLT Hadron;EventT0 [ns];events / 0.5 ns",
136 nBins, minT0, maxT0);
138 "TOP EventT0, L1TRG from TOP, HLT Hadron;EventT0 [ns];events / 0.5 ns",
139 nBins, minT0, maxT0);
141 "SVD EventT0, L1TRG from TOP, HLT Hadron;EventT0 [ns];events / 0.5 ns",
142 nBins, minT0, maxT0);
145 "ECL EventT0, L1TRG from TOP, HLT mumu;EventT0 [ns];events / 0.5 ns",
146 nBins, minT0, maxT0);
148 "CDC EventT0, L1TRG from TOP, HLT mumu;EventT0 [ns];events / 0.5 ns",
149 nBins, minT0, maxT0);
151 "TOP EventT0, L1TRG from TOP, HLT mumu;EventT0 [ns];events / 0.5 ns",
152 nBins, minT0, maxT0);
154 "SVD EventT0, L1TRG from TOP, HLT mumu;EventT0 [ns];events / 0.5 ns",
155 nBins, minT0, maxT0);
158 new TH1D(
"AlgorithmSourceFractionsHadronL1ECLTRG",
159 "Fraction of events with EventT0 from each algorithm for hadronic events triggerd by ECL;Algorithm;Fraction",
162 new TH1D(
"AlgorithmSourceFractionsHadronL1CDCTRG",
163 "Fraction of events with EventT0 from each algorithm for hadronic events triggerd by CDC;Algorithm;Fraction",
166 new TH1D(
"AlgorithmSourceFractionsHadronL1TOPTRG",
167 "Fraction of events with EventT0 from each algorithm for hadronic events triggerd by TOP;Algorithm;Fraction",
170 new TH1D(
"AlgorithmSourceFractionsBhaBhaL1ECLTRG",
171 "Fraction of events with EventT0 from each algorithm for Bhabha events triggerd by ECL;Algorithm;Fraction",
174 new TH1D(
"AlgorithmSourceFractionsBhaBhaL1CDCTRG",
175 "Fraction of events with EventT0 from each algorithm for Bhabha events triggerd by CDC;Algorithm;Fraction",
178 new TH1D(
"AlgorithmSourceFractionsBhaBhaL1TOPTRG",
179 "Fraction of events with EventT0 from each algorithm for Bhabha events triggerd by TOP;Algorithm;Fraction",
182 new TH1D(
"AlgorithmSourceFractionsMuMuL1ECLTRG",
183 "Fraction of events with EventT0 from each algorithm for #mu#mu events triggerd by ECL;Algorithm;Fraction",
186 new TH1D(
"AlgorithmSourceFractionsMuMuL1CDCTRG",
187 "Fraction of events with EventT0 from each algorithm for #mu#mu events triggerd by CDC;Algorithm;Fraction",
190 new TH1D(
"AlgorithmSourceFractionsMuMuL1TOPTRG",
191 "Fraction of events with EventT0 from each algorithm for #mu#mu events triggerd by TOP;Algorithm;Fraction",
194 for (uint i = 0; i < 6; i++) {
228 B2WARNING(
"Missing EventT0, EventT0DQM is skipped.");
233 B2WARNING(
"Missing SoftwareTriggerResult, EventT0DQM is skipped.");
299 B2WARNING(
"TRGSummary object not available but required to indicate which detector provided the L1 trigger time");
305 B2WARNING(
"Missing EventT0, EventT0DQM is skipped.");
315 B2WARNING(
"SoftwareTriggerResult object not available but require to select bhabha/mumu/hadron events for this module");
319 const std::map<std::string, int>& fresults =
m_TrgResult->getResults();
320 if ((fresults.find(
"software_trigger_cut&skim&accept_bhabha") == fresults.end()) ||
321 (fresults.find(
"software_trigger_cut&skim&accept_mumu_2trk") == fresults.end()) ||
322 (fresults.find(
"software_trigger_cut&skim&accept_hadron") == fresults.end())) {
323 B2WARNING(
"EventT0DQMModule: Can't find required bhabha or mumu or hadron trigger identifier");
334 B2DEBUG(20,
"IsECLL1TriggerSource = " << IsECLL1TriggerSource);
335 B2DEBUG(20,
"IsTOPL1TriggerSource = " << IsTOPL1TriggerSource);
336 B2DEBUG(20,
"IsCDCL1TriggerSource = " << IsCDCL1TriggerSource);
339 const bool IsEvtAcceptedBhabha = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_bhabha") ==
341 const bool IsEvtAcceptedHadron = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_hadron") ==
343 const bool IsEvtAcceptedMumu = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_mumu_2trk") ==
347 B2DEBUG(20,
"bhabha trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
348 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_bhabha"))) ;
349 B2DEBUG(20,
"hadron trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
350 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_hadron"))) ;
351 B2DEBUG(20,
"mu mu trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
352 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_mumu_2trk"))) ;
353 B2DEBUG(20,
"bhabha trigger comparison bool = " << IsEvtAcceptedBhabha) ;
354 B2DEBUG(20,
"hadron trigger comparison bool = " << IsEvtAcceptedHadron) ;
355 B2DEBUG(20,
"mumu trigger comparison bool = " << IsEvtAcceptedMumu) ;
359 const double eventT0ECL =
360 m_eventT0->hasTemporaryEventT0(Const::EDetector::ECL) ?
m_eventT0->getBestECLTemporaryEventT0()->eventT0 : -1000;
361 const double eventT0CDC =
362 m_eventT0->hasTemporaryEventT0(Const::EDetector::CDC) ?
m_eventT0->getBestCDCTemporaryEventT0()->eventT0 : -1000;
363 const double eventT0TOP =
364 m_eventT0->hasTemporaryEventT0(Const::EDetector::TOP) ?
m_eventT0->getBestTOPTemporaryEventT0()->eventT0 : -1000;
365 const double eventT0SVD =
366 m_eventT0->hasTemporaryEventT0(Const::EDetector::SVD) ?
m_eventT0->getBestSVDTemporaryEventT0()->eventT0 : -1000;
368 const auto checkForCDCAlgorithm = [cdcEventT0s =
m_eventT0->getTemporaryEventT0s(Const::EDetector::CDC)](
369 const std::string & algorithm) {
370 for (
const auto& evtt0 : cdcEventT0s) {
371 if (evtt0.algorithm == algorithm) {
378 const bool hasCDCHitBasedEventT0 = checkForCDCAlgorithm(
"hit based");
379 const bool hasCDCFullGridEventT0 = checkForCDCAlgorithm(
"chi2");
381 const bool hasAnyEventT0 =
m_eventT0->hasEventT0();
382 const bool hasECLEventT0 =
m_eventT0->hasTemporaryEventT0(Const::EDetector::ECL);
383 const bool hasSVDEventT0 =
m_eventT0->hasTemporaryEventT0(Const::EDetector::SVD);
384 const bool hasTOPEventT0 =
m_eventT0->hasTemporaryEventT0(Const::EDetector::TOP);
387 if (IsECLL1TriggerSource) {
389 if (IsEvtAcceptedBhabha) {
395 hasCDCHitBasedEventT0, hasCDCFullGridEventT0, hasTOPEventT0);
398 if (IsEvtAcceptedHadron) {
404 hasCDCHitBasedEventT0, hasCDCFullGridEventT0, hasTOPEventT0);
407 if (IsEvtAcceptedMumu) {
413 hasCDCHitBasedEventT0, hasCDCFullGridEventT0, hasTOPEventT0);
417 else if (IsTOPL1TriggerSource) {
419 if (IsEvtAcceptedBhabha) {
425 hasCDCHitBasedEventT0, hasCDCFullGridEventT0, hasTOPEventT0);
428 if (IsEvtAcceptedHadron) {
434 hasCDCHitBasedEventT0, hasCDCFullGridEventT0, hasTOPEventT0);
437 if (IsEvtAcceptedMumu) {
443 hasCDCHitBasedEventT0, hasCDCFullGridEventT0, hasTOPEventT0);
447 else if (IsCDCL1TriggerSource) {
449 if (IsEvtAcceptedBhabha) {
455 hasCDCHitBasedEventT0, hasCDCFullGridEventT0, hasTOPEventT0);
458 if (IsEvtAcceptedHadron) {
464 hasCDCHitBasedEventT0, hasCDCFullGridEventT0, hasTOPEventT0);
467 if (IsEvtAcceptedMumu) {
473 hasCDCHitBasedEventT0, hasCDCFullGridEventT0, hasTOPEventT0);
477 B2DEBUG(20,
"eventT0ECL = " << eventT0ECL <<
" ns") ;
478 B2DEBUG(20,
"eventT0CDC = " << eventT0CDC <<
" ns") ;
479 B2DEBUG(20,
"eventT0TOP = " << eventT0TOP <<
" ns") ;
480 B2DEBUG(20,
"eventT0SVD = " << eventT0SVD <<
" ns") ;
484 const bool hasCDCHitT0,
const bool hasCDCGridT0,
const bool hasTOPT0)
TH1F * m_histEventT0_CDC_bhabha_L1_TOPTRG
event t0 histogram for CDC, HLT bha bha events, L1 time by TOP trigger
TH1D * m_histAlgorithmSourceFractionsBhaBhaL1CDCTRG
Fraction of events with EventT0 from a given algorithm, HLT bhabha events, L1 time by CDC trigger.
TH1F * m_histEventT0_CDC_bhabha_L1_CDCTRG
event t0 histogram for CDC, HLT bha bha events, L1 time by CDC trigger
virtual ~EventT0DQMModule()
Destructor.
TH1F * m_histEventT0_TOP_bhabha_L1_TOPTRG
event t0 histogram for TOP, HLT bha bha events, L1 time by TOP trigger
TH1F * m_histEventT0_ECL_hadron_L1_ECLTRG
event t0 histogram for ECL, HLT hadronic events, L1 time by ECL trigger
TH1F * m_histEventT0_ECL_bhabha_L1_CDCTRG
event t0 histogram for ECL, HLT bha bha events, L1 time by CDC trigger
TH1F * m_histEventT0_SVD_mumu_L1_ECLTRG
event t0 histogram for SVD, HLT mu mu events, L1 time by ECL trigger
StoreObjPtr< EventT0 > m_eventT0
Store array for event t0.
const char * c_eventT0Algorithms[6]
EventT0 algorithms for which to calculate fractions of abundance.
TH1F * m_histEventT0_ECL_hadron_L1_TOPTRG
event t0 histogram for ECL, HLT hadronic events, L1 time by TOP trigger
TH1F * m_histEventT0_CDC_mumu_L1_TOPTRG
event t0 histogram for CDC, HLT mu mu events, L1 time by TOP trigger
TH1F * m_histEventT0_CDC_hadron_L1_ECLTRG
event t0 histogram for CDC, HLT hadronic events, L1 time by ECL trigger
virtual void initialize() override
Initialize the module.
TH1F * m_histEventT0_SVD_bhabha_L1_CDCTRG
event t0 histogram for SVD, HLT bha bha events, L1 time by CDC trigger
TH1F * m_histEventT0_CDC_mumu_L1_CDCTRG
event t0 histogram for CDC, HLT mu mu events, L1 time by CDC trigger
virtual void event() override
This method is called for each event.
TH1D * m_histAlgorithmSourceFractionsHadronL1CDCTRG
Fraction of events with EventT0 from a given algorithm, HLT hadronic events, L1 time by CDC trigger.
TH1F * m_histEventT0_SVD_bhabha_L1_TOPTRG
event t0 histogram for SVD, HLT bha bha events, L1 time by TOP trigger
TH1F * m_histEventT0_SVD_hadron_L1_ECLTRG
event t0 histogram for SVD, HLT hadronic events, L1 time by ECL trigger
TH1F * m_histEventT0_CDC_mumu_L1_ECLTRG
event t0 histogram for CDC, HLT mu mu events, L1 time by ECL trigger
TH1F * m_histEventT0_SVD_bhabha_L1_ECLTRG
event t0 histogram for SVD, HLT bha bha events, L1 time by ECL trigger
TH1F * m_histEventT0_SVD_mumu_L1_CDCTRG
event t0 histogram for SVD, HLT mu mu events, L1 time by CDC trigger
TH1F * m_histEventT0_TOP_bhabha_L1_ECLTRG
event t0 histogram for TOP, HLT bha bha events, L1 time by ECL trigger
TH1F * m_histEventT0_ECL_mumu_L1_TOPTRG
event t0 histogram for ECL, HLT mu mu events, L1 time by TOP trigger
StoreObjPtr< TRGSummary > m_objTrgSummary
Trigger Summary data object.
TH1D * m_histAlgorithmSourceFractionsHadronL1ECLTRG
Fraction of events with EventT0 from a given algorithm, HLT hadronic events, L1 time by ECL trigger.
virtual void beginRun() override
This method is called for each run.
void fillHistogram(TH1D *hist, const bool hasAnyT0, const bool hasECLT0, const bool hasSVDT0, const bool hasCDCHitT0, const bool hasCDCGridT0, const bool hasTOPT0)
Fill fraction histogram with values.
TH1F * m_histEventT0_TOP_mumu_L1_ECLTRG
event t0 histogram for TOP, HLT mu mu events, L1 time by ECL trigger
TH1F * m_histEventT0_TOP_hadron_L1_CDCTRG
event t0 histogram for TOP, HLT hadronic events, L1 time by CDC trigger
TH1D * m_histAlgorithmSourceFractionsMuMuL1CDCTRG
Fraction of events with EventT0 from a given algorithm, HLT mumu events, L1 time by CDC trigger.
TH1F * m_histEventT0_SVD_hadron_L1_CDCTRG
event t0 histogram for SVD, HLT hadronic events, L1 time by CDC trigger
TH1F * m_histEventT0_TOP_hadron_L1_TOPTRG
event t0 histogram for TOP, HLT hadronic events, L1 time by TOP trigger
TH1D * m_histAlgorithmSourceFractionsBhaBhaL1ECLTRG
Fraction of events with EventT0 from a given algorithm, HLT bhabha events, L1 time by ECL trigger.
TH1D * m_histAlgorithmSourceFractionsBhaBhaL1TOPTRG
Fraction of events with EventT0 from a given algorithm, HLT bhabha events, L1 time by TOP trigger.
TH1F * m_histEventT0_SVD_mumu_L1_TOPTRG
event t0 histogram for SVD, HLT mu mu events, L1 time by TOP trigger
TH1F * m_histEventT0_SVD_hadron_L1_TOPTRG
event t0 histogram for SVD, HLT hadronic events, L1 time by TOP trigger
TH1F * m_histEventT0_ECL_mumu_L1_CDCTRG
event t0 histogram for ECL, HLT mu mu events, L1 time by CDC trigger
TH1F * m_histEventT0_TOP_mumu_L1_TOPTRG
event t0 histogram for TOP, HLT mu mu events, L1 time by TOP trigger
TH1F * m_histEventT0_ECL_mumu_L1_ECLTRG
event t0 histogram for ECL, HLT mu mu events, L1 time by ECL trigger
EventT0DQMModule()
Default constructor.
TH1F * m_histEventT0_TOP_mumu_L1_CDCTRG
event t0 histogram for TOP, HLT mu mu events, L1 time by CDC trigger
TH1F * m_histEventT0_TOP_bhabha_L1_CDCTRG
event t0 histogram for TOP, HLT bha bha events, L1 time by CDC trigger
TH1F * m_histEventT0_TOP_hadron_L1_ECLTRG
event t0 histogram for TOP, HLT hadronic events, L1 time by ECL trigger
TH1F * m_histEventT0_ECL_bhabha_L1_TOPTRG
event t0 histogram for ECL, HLT bha bha events, L1 time by TOP trigger
TH1D * m_histAlgorithmSourceFractionsMuMuL1TOPTRG
Fraction of events with EventT0 from a given algorithm, HLT mumu events, L1 time by TOP trigger.
TH1F * m_histEventT0_CDC_hadron_L1_TOPTRG
event t0 histogram for CDC, HLT hadronic events, L1 time by TOP trigger
TH1F * m_histEventT0_CDC_hadron_L1_CDCTRG
event t0 histogram for CDC, HLT hadronic events, L1 time by CDC trigger
StoreObjPtr< SoftwareTriggerResult > m_TrgResult
Store array for Trigger selection.
TH1D * m_histAlgorithmSourceFractionsMuMuL1ECLTRG
Fraction of events with EventT0 from a given algorithm, HLT mumu events, L1 time by ECL trigger.
TH1F * m_histEventT0_CDC_bhabha_L1_ECLTRG
event t0 histogram for CDC, HLT bha bha events, L1 time by ECL trigger
TH1F * m_histEventT0_ECL_hadron_L1_CDCTRG
event t0 histogram for ECL, HLT hadronic events, L1 time by CDC trigger
virtual void defineHisto() override
Defination of histograms.
TH1F * m_histEventT0_ECL_bhabha_L1_ECLTRG
event t0 histogram for ECL, HLT bha bha events, L1 time by ECL trigger
TH1D * m_histAlgorithmSourceFractionsHadronL1TOPTRG
Fraction of events with EventT0 from a given algorithm, HLT hadronic events, L1 time by TOP trigger.
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...
@ TTYP_TOP
events triggered by TOP timing
@ TTYP_CDC
events triggered by CDC timing
@ TTYP_ECL
events triggered by ECL timing
#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.