 |
Belle II Software
release-05-01-25
|
11 #include <reconstruction/modules/EventT0DQM/EventT0DQM.h>
12 #include <framework/core/HistoModule.h>
21 setPropertyFlags(c_ParallelProcessingCertified);
22 setDescription(
"Make data quality monitoring plots for event t0 for bhabha, mu mu, and hadron samples seeded by different trigger times.");
33 TDirectory* oldDir = gDirectory;
34 oldDir->mkdir(
"EventT0DQMdir")->cd();
41 "ECL event t0 - bhabhas - ECLTRG time;event t0 [ns];events / 0.5 ns",
44 "CDC event t0 - bhabhas - ECLTRG time;event t0 [ns];events / 0.5 ns",
47 "TOP event t0 - bhabhas - ECLTRG time;event t0 [ns];events / 0.5 ns",
50 "ECL event t0 - hadrons - ECLTRG time;event t0 [ns];events / 0.5 ns",
53 "CDC event t0 - hadrons - ECLTRG time;event t0 [ns];events / 0.5 ns",
56 "TOP event t0 - hadrons - ECLTRG time;event t0 [ns];events / 0.5 ns",
59 "ECL event t0 - mu mu - ECLTRG time;event t0 [ns];events / 0.5 ns",
62 "CDC event t0 - mu mu - ECLTRG time;event t0 [ns];events / 0.5 ns",
65 "TOP event t0 - mu mu - ECLTRG time;event t0 [ns];events / 0.5 ns",
73 "ECL event t0 - bhabhas - CDCTRG time;event t0 [ns];events / 0.5 ns",
76 "CDC event t0 - bhabhas - CDCTRG time;event t0 [ns];events / 0.5 ns",
79 "TOP event t0 - bhabhas - CDCTRG time;event t0 [ns];events / 0.5 ns",
82 "ECL event t0 - hadrons - CDCTRG time;event t0 [ns];events / 0.5 ns",
85 "CDC event t0 - hadrons - CDCTRG time;event t0 [ns];events / 0.5 ns",
88 "TOP event t0 - hadrons - CDCTRG time;event t0 [ns];events / 0.5 ns",
91 "ECL event t0 - mu mu - CDCTRG time;event t0 [ns];events / 0.5 ns",
94 "CDC event t0 - mu mu - CDCTRG time;event t0 [ns];events / 0.5 ns",
97 "TOP event t0 - mu mu - CDCTRG time;event t0 [ns];events / 0.5 ns",
122 B2WARNING(
"Missing event t0, EventT0DQM is skipped.");
127 B2WARNING(
"Missing SoftwareTriggerResult, EventT0DQM is skipped.");
158 B2WARNING(
"TRGSummary object not available but required to indicate which detector provided the L1 trigger time");
164 bool Is_ECL_L1TriggerSource = false ;
165 bool Is_CDC_L1TriggerSource = false ;
167 Is_ECL_L1TriggerSource = true ;
169 Is_CDC_L1TriggerSource = true ;
172 B2DEBUG(20,
"Is_ECL_L1TriggerSource = " << Is_ECL_L1TriggerSource) ;
173 B2DEBUG(20,
"Is_CDC_L1TriggerSource= " << Is_CDC_L1TriggerSource) ;
177 B2WARNING(
"SoftwareTriggerResult object not available but require to select bhabha/mumu/hadron events for this module");
181 const std::map<std::string, int>& fresults =
m_TrgResult->getResults();
182 if ((fresults.find(
"software_trigger_cut&skim&accept_bhabha") == fresults.end()) ||
183 (fresults.find(
"software_trigger_cut&skim&accept_mumu_2trk") == fresults.end()) ||
184 (fresults.find(
"software_trigger_cut&skim&accept_hadron") == fresults.end())) {
185 B2WARNING(
"EventT0DQMModule: Can't find required bhabha or mumu or hadron trigger identifier");
193 B2WARNING(
"Missing event t0, EventT0DQM is skipped.");
203 const bool IsEvtAcceptedBhabha = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_bhabha") ==
205 const bool IsEvtAcceptedHadron = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_hadron") ==
207 const bool IsEvtAcceptedMumu = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_mumu_2trk") ==
211 B2DEBUG(20,
"bhabha trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
212 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_bhabha"))) ;
213 B2DEBUG(20,
"hadron trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
214 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_hadron"))) ;
215 B2DEBUG(20,
"mu mu trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
216 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_mumu_2trk"))) ;
217 B2DEBUG(20,
"bhabha trigger comparison bool = " << IsEvtAcceptedBhabha) ;
218 B2DEBUG(20,
"hadron trigger comparison bool = " << IsEvtAcceptedHadron) ;
219 B2DEBUG(20,
"mumu trigger comparison bool = " << IsEvtAcceptedMumu) ;
223 double eventT0_ECL = -1000 ;
224 double eventT0_CDC = -1000 ;
225 double eventT0_TOP = -1000 ;
228 if (
m_eventT0->hasTemporaryEventT0(Const::EDetector::CDC)) {
229 auto evtT0List_CDC =
m_eventT0->getTemporaryEventT0s(Const::EDetector::CDC) ;
233 eventT0_CDC = evtT0List_CDC.back().eventT0 ;
237 if (
m_eventT0->hasTemporaryEventT0(Const::EDetector::ECL)) {
239 auto evtT0List_ECL =
m_eventT0->getTemporaryEventT0s(Const::EDetector::ECL) ;
242 double smallest_ECL_t0_minChi2 = evtT0List_ECL[0].quality ;
243 int smallest_ECL_t0_minChi2_idx = 0 ;
244 for (
long unsigned int ECLi = 0; ECLi < evtT0List_ECL.size(); ECLi++) {
245 if (evtT0List_ECL[ECLi].quality < smallest_ECL_t0_minChi2) {
246 smallest_ECL_t0_minChi2 = evtT0List_ECL[ECLi].quality ;
247 smallest_ECL_t0_minChi2_idx = ECLi ;
252 eventT0_ECL = evtT0List_ECL[smallest_ECL_t0_minChi2_idx].eventT0 ;
256 if (
m_eventT0->hasTemporaryEventT0(Const::EDetector::TOP)) {
257 auto evtT0List_TOP =
m_eventT0->getTemporaryEventT0s(Const::EDetector::TOP) ;
261 eventT0_TOP = evtT0List_TOP.back().eventT0 ;
268 if (Is_ECL_L1TriggerSource) {
270 if (IsEvtAcceptedBhabha) {
276 if (IsEvtAcceptedHadron) {
282 if (IsEvtAcceptedMumu) {
289 else if (Is_CDC_L1TriggerSource) {
291 if (IsEvtAcceptedBhabha) {
297 if (IsEvtAcceptedHadron) {
303 if (IsEvtAcceptedMumu) {
310 B2DEBUG(20,
"eventT0_ECL = " << eventT0_ECL <<
" ns") ;
311 B2DEBUG(20,
"eventT0_CDC = " << eventT0_CDC <<
" ns") ;
312 B2DEBUG(20,
"eventT0_TOP = " << eventT0_TOP <<
" ns") ;
TH1F * m_histEventT0_TOP_bhabha_L1_ECLTRG
event t0 histogram for TOP and bha bha events wrt the ECL trigger time
virtual void terminate() override
End of the event processing.
virtual ~EventT0DQMModule()
Destructor.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
TH1F * m_histEventT0_ECL_mumu_L1_ECLTRG
event t0 histogram for ECL and mu mu events wrt the ECL trigger time
StoreObjPtr< EventT0 > m_eventT0
Store array for event t0.
virtual void beginRun() override
This method is called for each run.
TH1F * m_histEventT0_ECL_bhabha_L1_ECLTRG
event t0 histogram for ECL and bha bha 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_bhabha_L1_CDCTRG
event t0 histogram for CDC and bha bha events wrt the CDC trigger time
TH1F * m_histEventT0_TOP_hadron_L1_CDCTRG
event t0 histogram for TOP and hadronic events wrt the CDC trigger time
@ c_accept
Accept this event.
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
TH1F * m_histEventT0_ECL_hadron_L1_ECLTRG
event t0 histogram for ECL and hadronic events wrt the ECL trigger time
TH1F * m_histEventT0_CDC_hadron_L1_CDCTRG
event t0 histogram for CDC and hadronic events wrt the CDC trigger time
TH1F * m_histEventT0_ECL_hadron_L1_CDCTRG
event t0 histogram for ECL and hadronic events wrt the CDC trigger time
TH1F * m_histEventT0_CDC_mumu_L1_CDCTRG
event t0 histogram for CDC 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
Abstract base class for different kinds of events.
virtual void endRun() override
This method is called at the end of each run.
TH1F * m_histEventT0_TOP_hadron_L1_ECLTRG
event t0 histogram for TOP and hadronic events wrt the ECL trigger time
virtual void defineHisto() override
Defination of histograms.
TH1F * m_histEventT0_CDC_bhabha_L1_ECLTRG
event t0 histogram for CDC and bha bha events wrt the ECL trigger time
virtual void initialize() override
Initialize the module.
TH1F * m_histEventT0_CDC_hadron_L1_ECLTRG
event t0 histogram for CDC and hadronic 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
StoreObjPtr< SoftwareTriggerResult > m_TrgResult
Store array for Trigger selection.
StoreObjPtr< TRGSummary > m_objTrgSummary
Trigger Summary data object.
TH1F * m_histEventT0_ECL_mumu_L1_CDCTRG
event t0 histogram for ECL and mu mu events wrt the CDC trigger time
TH1F * m_histEventT0_TOP_mumu_L1_ECLTRG
event t0 histogram for TOP and mu mu 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
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
This module to design collect the event t0 values base on different detectors and physics processes.