9 #include <reconstruction/modules/EventT0DQM/EventT0DQM.h>
10 #include <framework/core/HistoModule.h>
19 setPropertyFlags(c_ParallelProcessingCertified);
20 setDescription(
"Make data quality monitoring plots for event t0 for bhabha, mu mu, and hadron samples seeded by different trigger times.");
31 TDirectory* oldDir = gDirectory;
32 oldDir->mkdir(
"EventT0DQMdir")->cd();
39 "ECL event t0 - bhabhas - ECLTRG time;event t0 [ns];events / 0.5 ns",
42 "CDC event t0 - bhabhas - ECLTRG time;event t0 [ns];events / 0.5 ns",
45 "TOP event t0 - bhabhas - ECLTRG time;event t0 [ns];events / 0.5 ns",
48 "ECL event t0 - hadrons - ECLTRG time;event t0 [ns];events / 0.5 ns",
51 "CDC event t0 - hadrons - ECLTRG time;event t0 [ns];events / 0.5 ns",
54 "TOP event t0 - hadrons - ECLTRG time;event t0 [ns];events / 0.5 ns",
57 "ECL event t0 - mu mu - ECLTRG time;event t0 [ns];events / 0.5 ns",
60 "CDC event t0 - mu mu - ECLTRG time;event t0 [ns];events / 0.5 ns",
63 "TOP event t0 - mu mu - ECLTRG time;event t0 [ns];events / 0.5 ns",
71 "ECL event t0 - bhabhas - CDCTRG time;event t0 [ns];events / 0.5 ns",
74 "CDC event t0 - bhabhas - CDCTRG time;event t0 [ns];events / 0.5 ns",
77 "TOP event t0 - bhabhas - CDCTRG time;event t0 [ns];events / 0.5 ns",
80 "ECL event t0 - hadrons - CDCTRG time;event t0 [ns];events / 0.5 ns",
83 "CDC event t0 - hadrons - CDCTRG time;event t0 [ns];events / 0.5 ns",
86 "TOP event t0 - hadrons - CDCTRG time;event t0 [ns];events / 0.5 ns",
89 "ECL event t0 - mu mu - CDCTRG time;event t0 [ns];events / 0.5 ns",
92 "CDC event t0 - mu mu - CDCTRG time;event t0 [ns];events / 0.5 ns",
95 "TOP event t0 - mu mu - CDCTRG time;event t0 [ns];events / 0.5 ns",
120 B2WARNING(
"Missing event t0, EventT0DQM is skipped.");
125 B2WARNING(
"Missing SoftwareTriggerResult, EventT0DQM is skipped.");
156 B2WARNING(
"TRGSummary object not available but required to indicate which detector provided the L1 trigger time");
162 bool Is_ECL_L1TriggerSource = false ;
163 bool Is_CDC_L1TriggerSource = false ;
165 Is_ECL_L1TriggerSource = true ;
167 Is_CDC_L1TriggerSource = true ;
170 B2DEBUG(20,
"Is_ECL_L1TriggerSource = " << Is_ECL_L1TriggerSource) ;
171 B2DEBUG(20,
"Is_CDC_L1TriggerSource= " << Is_CDC_L1TriggerSource) ;
175 B2WARNING(
"SoftwareTriggerResult object not available but require to select bhabha/mumu/hadron events for this module");
179 const std::map<std::string, int>& fresults =
m_TrgResult->getResults();
180 if ((fresults.find(
"software_trigger_cut&skim&accept_bhabha") == fresults.end()) ||
181 (fresults.find(
"software_trigger_cut&skim&accept_mumu_2trk") == fresults.end()) ||
182 (fresults.find(
"software_trigger_cut&skim&accept_hadron") == fresults.end())) {
183 B2WARNING(
"EventT0DQMModule: Can't find required bhabha or mumu or hadron trigger identifier");
191 B2WARNING(
"Missing event t0, EventT0DQM is skipped.");
201 const bool IsEvtAcceptedBhabha = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_bhabha") ==
203 const bool IsEvtAcceptedHadron = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_hadron") ==
205 const bool IsEvtAcceptedMumu = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_mumu_2trk") ==
209 B2DEBUG(20,
"bhabha trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
210 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_bhabha"))) ;
211 B2DEBUG(20,
"hadron trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
212 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_hadron"))) ;
213 B2DEBUG(20,
"mu mu trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
214 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_mumu_2trk"))) ;
215 B2DEBUG(20,
"bhabha trigger comparison bool = " << IsEvtAcceptedBhabha) ;
216 B2DEBUG(20,
"hadron trigger comparison bool = " << IsEvtAcceptedHadron) ;
217 B2DEBUG(20,
"mumu trigger comparison bool = " << IsEvtAcceptedMumu) ;
221 double eventT0_ECL = -1000 ;
222 double eventT0_CDC = -1000 ;
223 double eventT0_TOP = -1000 ;
226 if (
m_eventT0->hasTemporaryEventT0(Const::EDetector::CDC)) {
227 auto evtT0List_CDC =
m_eventT0->getTemporaryEventT0s(Const::EDetector::CDC) ;
231 eventT0_CDC = evtT0List_CDC.back().eventT0 ;
235 if (
m_eventT0->hasTemporaryEventT0(Const::EDetector::ECL)) {
237 auto evtT0List_ECL =
m_eventT0->getTemporaryEventT0s(Const::EDetector::ECL) ;
240 double smallest_ECL_t0_minChi2 = evtT0List_ECL[0].quality ;
241 int smallest_ECL_t0_minChi2_idx = 0 ;
242 for (
long unsigned int ECLi = 0; ECLi < evtT0List_ECL.size(); ECLi++) {
243 if (evtT0List_ECL[ECLi].quality < smallest_ECL_t0_minChi2) {
244 smallest_ECL_t0_minChi2 = evtT0List_ECL[ECLi].quality ;
245 smallest_ECL_t0_minChi2_idx = ECLi ;
250 eventT0_ECL = evtT0List_ECL[smallest_ECL_t0_minChi2_idx].eventT0 ;
254 if (
m_eventT0->hasTemporaryEventT0(Const::EDetector::TOP)) {
255 auto evtT0List_TOP =
m_eventT0->getTemporaryEventT0s(Const::EDetector::TOP) ;
259 eventT0_TOP = evtT0List_TOP.back().eventT0 ;
266 if (Is_ECL_L1TriggerSource) {
268 if (IsEvtAcceptedBhabha) {
274 if (IsEvtAcceptedHadron) {
280 if (IsEvtAcceptedMumu) {
287 else if (Is_CDC_L1TriggerSource) {
289 if (IsEvtAcceptedBhabha) {
295 if (IsEvtAcceptedHadron) {
301 if (IsEvtAcceptedMumu) {
308 B2DEBUG(20,
"eventT0_ECL = " << eventT0_ECL <<
" ns") ;
309 B2DEBUG(20,
"eventT0_CDC = " << eventT0_CDC <<
" ns") ;
310 B2DEBUG(20,
"eventT0_TOP = " << eventT0_TOP <<
" ns") ;
This module to design collect the event t0 values base on different detectors and physics processes.
TH1F * m_histEventT0_CDC_bhabha_L1_CDCTRG
event t0 histogram for CDC and bha bha events wrt the CDC trigger time
virtual ~EventT0DQMModule()
Destructor.
TH1F * m_histEventT0_ECL_hadron_L1_ECLTRG
event t0 histogram for ECL and hadronic events wrt the ECL trigger time
TH1F * m_histEventT0_ECL_bhabha_L1_CDCTRG
event t0 histogram for ECL and bha bha events wrt the CDC trigger time
StoreObjPtr< EventT0 > m_eventT0
Store array for event t0.
TH1F * m_histEventT0_CDC_hadron_L1_ECLTRG
event t0 histogram for CDC and hadronic events wrt the ECL trigger time
virtual void initialize() override
Initialize the module.
TH1F * m_histEventT0_CDC_mumu_L1_CDCTRG
event t0 histogram for CDC and mu mu events wrt the CDC trigger time
virtual void event() override
This method is called for each event.
TH1F * m_histEventT0_CDC_mumu_L1_ECLTRG
event t0 histogram for CDC and mu mu events wrt the ECL trigger time
virtual void endRun() override
This method is called at the end of each run.
virtual void terminate() override
End of the event processing.
TH1F * m_histEventT0_TOP_bhabha_L1_ECLTRG
event t0 histogram for TOP and bha bha 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.
TH1F * m_histEventT0_TOP_mumu_L1_ECLTRG
event t0 histogram for TOP and mu mu events wrt the ECL trigger time
TH1F * m_histEventT0_TOP_hadron_L1_CDCTRG
event t0 histogram for TOP and hadronic events wrt the CDC trigger time
TH1F * m_histEventT0_ECL_mumu_L1_CDCTRG
event t0 histogram for ECL and mu mu events wrt the CDC trigger time
TH1F * m_histEventT0_ECL_mumu_L1_ECLTRG
event t0 histogram for ECL and mu mu events wrt the ECL trigger time
TH1F * m_histEventT0_TOP_mumu_L1_CDCTRG
event t0 histogram for TOP and mu mu events wrt the CDC trigger time
TH1F * m_histEventT0_TOP_bhabha_L1_CDCTRG
event t0 histogram for TOP and bha bha events wrt the CDC trigger time
TH1F * m_histEventT0_TOP_hadron_L1_ECLTRG
event t0 histogram for TOP and hadronic events wrt the ECL trigger time
int m_L1TimingSrc
L1 timing source from getTimeType() in TRGSummary See ETimingTYpe in mdst/dataobjects/include/TRGSumm...
TH1F * m_histEventT0_CDC_hadron_L1_CDCTRG
event t0 histogram for CDC and hadronic events wrt the CDC trigger time
StoreObjPtr< SoftwareTriggerResult > m_TrgResult
Store array for Trigger selection.
TH1F * m_histEventT0_CDC_bhabha_L1_ECLTRG
event t0 histogram for CDC and bha bha events wrt the ECL trigger time
TH1F * m_histEventT0_ECL_hadron_L1_CDCTRG
event t0 histogram for ECL and hadronic events wrt the CDC trigger time
virtual void defineHisto() override
Defination of histograms.
TH1F * m_histEventT0_ECL_bhabha_L1_ECLTRG
event t0 histogram for ECL and bha bha events wrt the ECL trigger time
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
#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.