9 #include <tracking/modules/trackingDQM/TrackingExpressRecoDQMModule.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 ExpressReco.");
34 addParam(
"produce1Dresiduals", m_produce1Dres,
"If True, produce 1D residual plots for each VXD sensor", m_produce1Dres);
35 addParam(
"produce2Dresiduals", m_produce2Dres,
"If True, produce 2D residual plots for each VXD sensor", m_produce2Dres);
36 addParam(
"histogramDirectoryName", m_histogramDirectoryName,
"Name of the directory for the histograms", m_histogramDirectoryName);
37 addParam(
"histogramTitleSuffix", m_histogramTitleSuffix,
38 "Optional suffix to be appended to the title of the histograms."
39 " Applied only to those histograms whose content depend on the track StoreArray chosen.",
40 m_histogramTitleSuffix);
50 m_eventLevelTrackingInfo.isOptional();
58 B2FATAL(
"Missing geometry for VXD.");
61 TDirectory* originalDirectory = gDirectory;
63 TDirectory* TracksDQM = originalDirectory->GetDirectory(m_histogramDirectoryName.c_str());
65 TracksDQM = originalDirectory->mkdir(m_histogramDirectoryName.c_str());
70 DefineHelixParametersAndCorrelations();
71 DefineTrackFitStatus();
73 DefineUBResidualsVXD();
74 DefineHalfShellsVXD();
76 DefineAbortFlagsHistograms();
82 originalDirectory->cd();
84 for (
auto change : m_histogramParameterChanges)
85 ProcessHistogramParameterChange(get<0>(change), get<1>(change), get<2>(change));
88 for (TH1* hist : m_histograms) {
91 if (hist->GetName() ==
string(
"NumberTrackingErrorFlags"))
93 if (hist->GetName() ==
string(
"TrackingErrorFlagsReasons"))
95 string newTitle = hist->GetTitle() + m_histogramTitleSuffix;
96 hist->SetTitle(newTitle.c_str());
103 if (!histogramsDefined)
106 bool runningOnHLT =
false;
116 eventProcessor.
Run();
118 if (m_eventLevelTrackingInfo.isValid()) {
119 if (m_eventLevelTrackingInfo->hasAnErrorFlag()) {
120 m_trackingErrorFlags->Fill(1);
121 if (m_eventLevelTrackingInfo->hasUnspecifiedTrackFindingFailure())
122 m_trackingErrorFlagsReasons->Fill(1);
123 if (m_eventLevelTrackingInfo->hasVXDTF2AbortionFlag())
124 m_trackingErrorFlagsReasons->Fill(2);
125 if (m_eventLevelTrackingInfo->hasSVDCKFAbortionFlag())
126 m_trackingErrorFlagsReasons->Fill(3);
127 if (m_eventLevelTrackingInfo->hasPXDCKFAbortionFlag())
128 m_trackingErrorFlagsReasons->Fill(4);
129 if (m_eventLevelTrackingInfo->hasSVDSpacePointCreatorAbortionFlag())
130 m_trackingErrorFlagsReasons->Fill(5);
132 m_trackingErrorFlags->Fill(0);
133 m_trackingErrorFlagsReasons->Fill(0);
136 m_trackingErrorFlags->Fill(0);
142 m_trackingErrorFlags =
143 Create(
"NumberTrackingErrorFlags",
144 "Tracking error summary. Mean = errors/event (should be 0 or very close to 0);Error occured yes or no;Number of events",
145 2, -0.5, 1.5,
"Error occured yes or no",
"Number of events");
146 m_trackingErrorFlags->GetXaxis()->SetBinLabel(1,
"No Error");
147 m_trackingErrorFlags->GetXaxis()->SetBinLabel(2,
"Error occured");
150 m_trackingErrorFlagsReasons =
151 Create(
"TrackingErrorFlagsReasons",
152 "Tracking errors by reason. A single event may fall in multiple bins.;Type of error occurred;Number of events",
153 6, -0.5, 5.5,
"Type of error occurred",
"Number of events");
154 m_trackingErrorFlagsReasons->GetXaxis()->SetBinLabel(1,
"No Error");
155 m_trackingErrorFlagsReasons->GetXaxis()->SetBinLabel(2,
"Unspecified PR");
156 m_trackingErrorFlagsReasons->GetXaxis()->SetBinLabel(3,
"VXDTF2");
157 m_trackingErrorFlagsReasons->GetXaxis()->SetBinLabel(4,
"SVDCKF");
158 m_trackingErrorFlagsReasons->GetXaxis()->SetBinLabel(5,
"PXDCKF");
159 m_trackingErrorFlagsReasons->GetXaxis()->SetBinLabel(6,
"SpacePoint");
void produce1Dres()
Call this if you want to produce 1D Track Residual plots for each VXD sensor.
virtual void Run()
Call this to start processing the event data and filling histograms.
void produce2Dres()
Call this if you want to produce 2D Track Residual plots for each VXD sensor.
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.
virtual void defineHisto() override
Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....
The purpose of this class is to process one event() in TrackDQMModule.
Tracking ExpressReco DQM.
void initialize() override
Module functions.
void event() override
fill of the histograms happens here
virtual void DefineAbortFlagsHistograms()
Defines the histograms for the tracking abort flags.
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.