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));
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);
107 m_SVD3EventT0 =
new TH1F(
"SVD3EventT0",
"SVD EventT0 for 3 samples", nBins, minT0, maxT0);
108 m_SVD3EventT0->GetXaxis()->SetTitle(
"SVD EventT0 time (ns)");
111 m_SVD6EventT0 =
new TH1F(
"SVD6EventT0",
"SVD EventT0 for 6 samples", nBins, minT0, maxT0);
112 m_SVD6EventT0->GetXaxis()->SetTitle(
"SVD EventT0 time (ns)");
116 "SVD EventT0 3 samples : bhabhas, ECLTRG time",
117 nBins, minT0, maxT0);
121 "SVD EventT0 3 samples : hadrons, ECLTRG time",
122 nBins, minT0, maxT0);
126 "SVD EventT0 3 samples : mumus, ECLTRG time",
127 nBins, minT0, maxT0);
131 "SVD EventT0 3 samples : bhabhas, CDCTRG time",
132 nBins, minT0, maxT0);
136 "SVD EventT0 3 samples : hadrons, CDCTRG time",
137 nBins, minT0, maxT0);
141 "SVD EventT0 3 samples : mumus, CDCTRG time",
142 nBins, minT0, maxT0);
148 "SVD EventT0 6 samples : bhabhas, ECLTRG time",
149 nBins, minT0, maxT0);
153 "SVD EventT0 6 samples : hadrons, ECLTRG time",
154 nBins, minT0, maxT0);
158 "SVD EventT0 6 samples : mumus, ECLTRG time",
159 nBins, minT0, maxT0);
163 "SVD EventT0 6 samples : bhabhas, CDCTRG time",
164 nBins, minT0, maxT0);
168 "SVD EventT0 6 samples : hadrons, CDCTRG time",
169 nBins, minT0, maxT0);
173 "SVD EventT0 6 samples : mumus, CDCTRG time",
174 nBins, minT0, maxT0);
239 B2WARNING(
"Missing TRGSummary, SVDDQMHitTime is skipped.");
243 B2WARNING(
"Missing SVDEventInfo, SVDDQMHitTime is skipped.");
250 B2WARNING(
"Missing SVDClusters, SVDDQMHitTime is skipped.");
256 B2WARNING(
"TRGSummary object not available but required to indicate which detector provided the L1 trigger time");
262 bool Is_ECL_L1TriggerSource = false ;
263 bool Is_CDC_L1TriggerSource = false ;
265 Is_ECL_L1TriggerSource = true ;
266 }
else if (
m_L1TimingSrc == TRGSummary::ETimingType::TTYP_CDC) {
267 Is_CDC_L1TriggerSource = true ;
270 B2DEBUG(20,
"Is_ECL_L1TriggerSource = " << Is_ECL_L1TriggerSource) ;
271 B2DEBUG(20,
"Is_CDC_L1TriggerSource= " << Is_CDC_L1TriggerSource) ;
275 B2WARNING(
"SoftwareTriggerResult object not available but require to select bhabha/mumu/hadron events for this module");
279 const std::map<std::string, int>& fresults =
m_TrgResult->getResults();
280 if ((fresults.find(
"software_trigger_cut&skim&accept_bhabha") == fresults.end()) ||
281 (fresults.find(
"software_trigger_cut&skim&accept_mumu_2trk") == fresults.end()) ||
282 (fresults.find(
"software_trigger_cut&skim&accept_hadron") == fresults.end())) {
283 B2WARNING(
"SVDDQMHitTimeModule: Can't find required bhabha or mumu or hadron trigger identifier");
290 const bool IsEvtAcceptedBhabha = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_bhabha") ==
292 const bool IsEvtAcceptedHadron = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_hadron") ==
294 const bool IsEvtAcceptedMumu = (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_mumu_2trk") ==
298 B2DEBUG(20,
"bhabha trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
299 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_bhabha"))) ;
300 B2DEBUG(20,
"hadron trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
301 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_hadron"))) ;
302 B2DEBUG(20,
"mu mu trigger result = " <<
static_cast<std::underlying_type<SoftwareTriggerCutResult>::type
>
303 (
m_TrgResult->getResult(
"software_trigger_cut&skim&accept_mumu_2trk"))) ;
304 B2DEBUG(20,
"bhabha trigger comparison bool = " << IsEvtAcceptedBhabha) ;
305 B2DEBUG(20,
"hadron trigger comparison bool = " << IsEvtAcceptedHadron) ;
306 B2DEBUG(20,
"mumu trigger comparison bool = " << IsEvtAcceptedMumu) ;
310 double eventT0 = -1000;
321 if (
m_eventT0->hasTemporaryEventT0(Const::EDetector::SVD)) {
322 const auto bestSVDEvtT0 =
m_eventT0->getBestSVDTemporaryEventT0() ;
324 float svdEventT0 = bestSVDEvtT0->eventT0 ;
332 if (Is_ECL_L1TriggerSource) {
333 if (IsEvtAcceptedBhabha) {
340 if (IsEvtAcceptedHadron) {
347 if (IsEvtAcceptedMumu) {
357 else if (Is_CDC_L1TriggerSource) {
358 if (IsEvtAcceptedBhabha) {
365 if (IsEvtAcceptedHadron) {
372 if (IsEvtAcceptedMumu) {
386 if (cluster.getSensorID().getLayerNumber() != 3)
continue;
388 if (cluster.isUCluster())
continue;
390 double time = cluster.getClsTime();
394 time = time -
m_svdEventInfo->getSVD2FTSWTimeShift(cluster.getFirstFrame());
397 if (Is_ECL_L1TriggerSource) {
398 if (IsEvtAcceptedBhabha) {
402 if (IsEvtAcceptedHadron) {
406 if (IsEvtAcceptedMumu) {
413 else if (Is_CDC_L1TriggerSource) {
414 if (IsEvtAcceptedBhabha) {
418 if (IsEvtAcceptedHadron) {
422 if (IsEvtAcceptedMumu) {
428 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.
StoreObjPtr< EventT0 > m_eventT0
EventT0 data object.
TH1F * m_SVD3EventT0_hadron_L1_ECLTRG
svd eventT0 histogram for hadronic events wrt the ECL trigger time for 3 samples
TH1F * m_l3v_mumu_L1_ECLTRG
svd time histogram for mu mu events wrt the ECL trigger time
TH1F * m_SVD3EventT0
SVD event T0 for 3 sampels.
virtual void initialize() override
Initialize the module.
StoreObjPtr< SVDEventInfo > m_svdEventInfo
SVDEventInfo data object.
TH1F * m_SVD3EventT0_bhabha_L1_CDCTRG
svd eventT0 histogram for bhabha events wrt the CDC trigger time for 3 samples
TH1F * m_SVD3EventT0_bhabha_L1_ECLTRG
svd eventT0 histogram for bhabha events wrt the ECL trigger time for 3 samples
virtual void event() override
This method is called for each event.
TH1F * m_l3vEvtT0_mumu_L1_ECLTRG
svd time histogram for mu mu events wrt the ECL trigger time
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_SVD6EventT0_mumu_L1_ECLTRG
svd eventT0 histogram for mu mu events wrt the ECL trigger time for 6 samples
TH1F * m_l3vEvtT0_hadron_L1_CDCTRG
svd time histogram for hadronic events wrt the CDC trigger time
TH1F * m_SVD3EventT0_mumu_L1_ECLTRG
svd eventT0 histogram for mu mu events wrt the ECL trigger time for 3 samples
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
TH1F * m_SVD6EventT0_hadron_L1_CDCTRG
svd EventT0 histogram for hadronic events wrt the CDC trigger time for 6 samples
StoreObjPtr< TRGSummary > m_objTrgSummary
Trigger Summary data object.
TH1F * m_SVD6EventT0_mumu_L1_CDCTRG
svd eventT0 histogram for mu mu events wrt the CDC trigger time for 6 samples
TH1F * m_SVD6EventT0_bhabha_L1_ECLTRG
svd eventT0 histogram for bhabha events wrt the ECL trigger time for 6 samples
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_SVD6EventT0
SVD event T0 for 6 sampels.
TH1F * m_l3v_bhabha_L1_ECLTRG
svd time histogram for bhabha events wrt the ECL trigger time
TH1F * m_l3vEvtT0_bhabha_L1_CDCTRG
svd time histogram for bhabha events wrt the CDC trigger time
TH1F * m_l3v_mumu_L1_CDCTRG
svd time histogram for mu mu events wrt the CDC trigger time
TH1F * m_SVD6EventT0_bhabha_L1_CDCTRG
svd eventT0 histogram for bhabha events wrt the CDC trigger time for 6 samples
TH1F * m_SVD6EventT0_hadron_L1_ECLTRG
svd eventT0 histogram for hadronic events wrt the ECL trigger time for 6 samples
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_SVD3EventT0_hadron_L1_CDCTRG
svd eventT0 histogram for hadronic events wrt the CDC trigger time for 3 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.
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_SVD3EventT0_mumu_L1_CDCTRG
svd eventT0 histogram for mu mu 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.
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
@ c_accept
Accept this event.
Abstract base class for different kinds of events.