9 #include <tracking/modules/trackingDQM/TrackingHLTDQMModule.h>
10 #include <tracking/modules/trackingDQM/TrackDQMEventProcessor.h>
11 #include <tracking/dqmUtils/HistogramFactory.h>
13 #include <TDirectory.h>
16 using namespace Belle2::HistogramFactory;
32 setPropertyFlags(c_ParallelProcessingCertified);
33 setDescription(
"Data Quality Monitoring of the tracking run on HLT. "
46 m_eventLevelTrackingInfo.isOptional();
48 m_rawTTD.isOptional();
57 B2FATAL(
"Missing geometry for VXD.");
60 TDirectory* originalDirectory = gDirectory;
63 TDirectory* TracksDQM = originalDirectory->GetDirectory(
"TrackingHLTDQM");
65 TracksDQM = originalDirectory->mkdir(
"TrackingHLTDQM");
70 DefineMomentumAngles();
71 DefineMomentumCoordinates();
72 DefineHelixParametersAndCorrelations();
73 DefineTrackFitStatus();
75 DefineAbortFlagsHistograms();
77 originalDirectory->cd();
79 for (
auto change : m_histogramParameterChanges)
80 ProcessHistogramParameterChange(get<0>(change), get<1>(change), get<2>(change));
86 if (!histogramsDefined)
89 bool runningOnHLT =
true;
96 if (m_eventLevelTrackingInfo.isValid()) {
97 m_trackingErrorFlags->Fill((
double)m_eventLevelTrackingInfo->hasAnErrorFlag());
99 if (m_rawTTD.isValid()) {
101 for (
auto& it : m_rawTTD) {
104 auto difference = it.GetTimeSinceLastInjection(0);
106 if (difference != 0x7FFFFFFF) {
108 double timeSinceInj = it.GetTimeSinceLastInjection(0) / c_globalClock;
109 double timeInCycle = timeSinceInj - (int)(timeSinceInj / c_revolutionTime) * c_revolutionTime;
112 m_allVStimeHER->Fill(timeSinceInj, timeInCycle);
114 m_allVStimeLER->Fill(timeSinceInj, timeInCycle);
116 if (m_eventLevelTrackingInfo->hasAnErrorFlag()) {
118 m_abortVStimeHER->Fill(timeSinceInj, timeInCycle);
120 m_abortVStimeLER->Fill(timeSinceInj, timeInCycle);
126 m_trackingErrorFlags->Fill(0.0);
133 const char* flagTitle =
134 "Tracking error summary. Mean = errors/event (should be 0 or very close to 0); Error occured yes or no; Number of events";
136 m_trackingErrorFlags = Create(
"NumberTrackingErrorFlags", flagTitle, 2, -0.5, 1.5,
"",
"");
138 m_trackingErrorFlags->GetXaxis()->SetBinLabel(1,
"No Error");
139 m_trackingErrorFlags->GetXaxis()->SetBinLabel(2,
"Error occured");
142 m_abortVStimeHER =
new TH2F(
144 "Tracking Abort vs HER Injection;Time since last injection [#mus];Time in beam cycle [#mus];Events / bin",
145 100, 0, c_noInjectionTime, 50, 0, c_revolutionTime);
147 m_abortVStimeLER =
new TH2F(
149 "Tracking Abort vs LER Injection;Time since last injection [#mus];Time in beam cycle [#mus];Events / bin",
150 100, 0, c_noInjectionTime, 50, 0, c_revolutionTime);
153 m_allVStimeHER =
new TH2F(
155 "Number Of Events vs HER Injection;Time since last injection [#mus];Time in beam cycle [#mus];Events / bin",
156 100, 0, c_noInjectionTime, 50, 0, c_revolutionTime);
158 m_allVStimeLER =
new TH2F(
160 "Number of Events vs LER Injection;Time since last injection [#mus];Time in beam cycle [#mus];Events / bin",
161 100, 0, c_noInjectionTime, 50, 0, c_revolutionTime);
virtual void Run()
Call this to start processing the event data and filling histograms.
This class serves as a base for the TrackDQMModule and AlignDQMModule (and possibly other DQM histogr...
virtual void initialize() override
Initializer.
virtual void event() override
This method is called for each event.
void runningOnHLT()
function called when the module is run on HLT
virtual void defineHisto() override
Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....
The purpose of this class is to process one event() in TrackDQMModule.
void initialize() override
Module functions.
void event() override
fill of the histograms happens here
virtual void DefineAbortFlagsHistograms()
All the following Define- functions should be used in the defineHisto() function to define histograms...
virtual void defineHisto() override
Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....
static GeoCache & getInstance()
Return a reference to the singleton instance.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.