9#include "tracking/modules/trackingDQM/TrackingAbortDQMModule.h"
11#include <framework/dataobjects/EventMetaData.h>
12#include <svd/dataobjects/SVDShaperDigit.h>
13#include <svd/dataobjects/SVDCluster.h>
14#include <mdst/dataobjects/EventLevelTrackingInfo.h>
15#include <mdst/dataobjects/TRGSummary.h>
17#include <TDirectory.h>
25using namespace TrackFindingCDC;
39 setDescription(
"DQM Module to monitor Tracking Aborts and detector-related quantities.");
42 std::string(
"TrackingAbort"));
48TrackingAbortDQMModule::~TrackingAbortDQMModule()
60 TDirectory* oldDir = gDirectory;
68 std::string tag[2] = {
"OUT",
"IN"};
69 std::string title[2] = {
"[Outside Active Veto Window]",
"[Inside Active Veto Window]"};
74 std::string histoName =
"EventsWithAborts";
75 std::string histoTitle =
"Events With at Least one Abort";
76 m_nEventsWithAbort[0] =
new TH1F(TString::Format(
"%s_%s", histoName.c_str(), tag[0].c_str()),
77 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
86 m_nEventsWithAbort[1]->SetName(TString::Format(
"%s_%s", histoName.c_str(), tag[1].c_str()));
87 m_nEventsWithAbort[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
91 histoName =
"TrkAbortReason";
92 histoTitle =
"Tracking Abort Reason";
94 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
110 histoName =
"SVDL3UOcc";
111 histoTitle =
"SVD L3 u-side ZS5 Occupancy (%)";
114 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
115 90, 0, 100.0 / 1536.0 * 90);
121 m_svdL3uZS5Occupancy[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
124 histoName =
"SVDL3UOccVXDTF2aborts";
125 histoTitle =
"SVD L3 u-side ZS5 Occupancy (%) when VXDTF2 Aborts";
128 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
129 180, 0, 100.0 / 1536.0 * 180);
138 histoName =
"SVDL3UOccToSVDCKFaborts";
139 histoTitle =
"SVD L3 u-side ZS5 Occupancy (%) when toSVDCKF Aborts";
142 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
143 180, 0, 100.0 / 1536.0 * 180);
152 histoName =
"nCDCExtraHits";
153 histoTitle =
"Number of CDC Extra Hits";
155 m_nCDCExtraHits[0] =
new TH1F(TString::Format(
"%s_%s", histoName.c_str(), tag[0].c_str()),
156 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
162 m_nCDCExtraHits[1]->SetName(TString::Format(
"%s_%s", histoName.c_str(), tag[1].c_str()));
163 m_nCDCExtraHits[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
166 histoName =
"svdL3VTime";
167 histoTitle =
"Layer3 v-side Cluster Time Distribution";
169 m_svdTime[0] =
new TH1F(TString::Format(
"%s_%s", histoName.c_str(), tag[0].c_str()),
170 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
172 m_svdTime[0]->GetXaxis()->SetTitle(
"cluster time (ns)");
173 m_svdTime[0]->GetYaxis()->SetTitle(
"Number of Clusters");
176 m_svdTime[1]->SetName(TString::Format(
"%s_%s", histoName.c_str(), tag[1].c_str()));
177 m_svdTime[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
180 histoName =
"averages";
181 histoTitle =
"Averages from SVD and CDC";
184 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
195 m_integratedAverages[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
198 histoName =
"nCDCExtraHitsSL";
199 histoTitle =
"Number of CDC Extra Hits in SL";
200 for (
int sl = 0; sl < 9; sl++) {
202 m_nCDCExtraHitsSL[0][sl] =
new TH1F(TString::Format(
"%s%d_%s", histoName.c_str(), sl, tag[0].c_str()),
203 TString::Format(
"%s%d %s", histoTitle.c_str(), sl, title[0].c_str()),
204 201, -1000 / 200 / 2, 1000 + 1000 / 200 / 2);
209 m_nCDCExtraHitsSL[1][sl]->SetName(TString::Format(
"%s%d_%s", histoName.c_str(), sl, tag[1].c_str()));
210 m_nCDCExtraHitsSL[1][sl]->SetTitle(TString::Format(
"%s%d %s", histoTitle.c_str(), sl, title[1].c_str()));
214 histoName =
"nCDCHitsSL";
215 histoTitle =
"Average Number of CDC Hits per Track in SL";
216 for (
int sl = 0; sl < 9; sl++) {
218 m_nCDCHitsSL[0][sl] =
new TH1F(TString::Format(
"%s%d_%s", histoName.c_str(), sl, tag[0].c_str()),
219 TString::Format(
"%s%d %s", histoTitle.c_str(), sl, title[0].c_str()),
221 m_nCDCHitsSL[0][sl]->GetXaxis()->SetTitle(
"average nCDCHits per track");
222 m_nCDCHitsSL[0][sl]->GetYaxis()->SetTitle(
"Number of Events");
225 m_nCDCHitsSL[1][sl]->SetName(TString::Format(
"%s%d_%s", histoName.c_str(), sl, tag[1].c_str()));
226 m_nCDCHitsSL[1][sl]->SetTitle(TString::Format(
"%s%d %s", histoTitle.c_str(), sl, title[1].c_str()));
230 histoName =
"noCDCHitsInSL";
231 histoTitle =
"No Signal CDC Hits in SL";
233 m_noCDCHitsInSL[0] =
new TH1F(TString::Format(
"%s_%s", histoName.c_str(), tag[0].c_str()),
234 TString::Format(
"%s %s", histoTitle.c_str(), title[0].c_str()),
240 m_noCDCHitsInSL[1]->SetName(TString::Format(
"%s_%s", histoName.c_str(), tag[1].c_str()));
241 m_noCDCHitsInSL[1]->SetTitle(TString::Format(
"%s %s", histoTitle.c_str(), title[1].c_str()));
278 for (
int sl = 0; sl < 9; sl++) {
313 }
catch (
const std::exception&) {
339 float nStripsL3UZS5 = 0;
340 float nStripsL3VZS5 = 0;
341 float nStripsL4UZS5 = 0;
342 float nStripsL4VZS5 = 0;
344 const VxdID& sensorID = hit.getSensorID();
347 const float cutMinSignal = std::round(5 * noise);
349 if (hit.passesZS(1, cutMinSignal)) {
351 if (hit.isUStrip()) nStripsL3UZS5++;
352 else nStripsL3VZS5++;
353 }
else if (hit.isUStrip()) nStripsL4UZS5++;
354 else nStripsL4VZS5++;
360 const VxdID& sensorID = hit.getSensorID();
362 if (hit.isUCluster())
continue;
364 m_svdTime[index]->Fill(hit.getClsTime());
368 double tmp_L3uZS5occupancy = (double)nStripsL3UZS5 /
m_nStripsL3U * 100;
369 double L3uZS5occupancy = std::min(tmp_L3uZS5occupancy, (
double)100.0 / 1536.0 * 90);
371 double L3uZS5occupancy_abort = std::min(tmp_L3uZS5occupancy, (
double)100.0 / 1536.0 * 180);
383 int nTracks =
m_tracks.getEntries();
385 int nCDCHitsInner = 0;
386 int nCDCHitsOuter = 0;
387 int nTotalCDCHits[9] = {0};
388 int nTakenCDCHits[9] = {0};
389 int nBgCDCHits[9] = {0};
392 int wireHitAmount = wireHitVector.size();
393 for (
int hitID = 0; hitID < wireHitAmount; ++hitID) {
394 const auto& wireHit = wireHitVector[hitID];
395 int sl = wireHit.getISuperLayer();
396 if (sl == 0) nCDCHitsInner++;
397 else nCDCHitsOuter++;
399 nTotalCDCHits[sl] += 1;
400 if (wireHit->hasTakenFlag()) nTakenCDCHits[sl] += 1;
401 if (wireHit->hasBackgroundFlag()) nBgCDCHits[sl] += 1;
404 for (
int sl = 0; sl < 9; sl++) {
406 float nSignalCDCHits = nTakenCDCHits[sl] - nBgCDCHits[sl];
407 int nCDCExtraHits = nTotalCDCHits[sl] - nSignalCDCHits;
408 if (nTracks > 0) nSignalCDCHits = nSignalCDCHits / nTracks;
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.
float getNoise(const VxdID &sensorID, const bool &isU, const unsigned short &strip) const
This is the method for getting the noise.
The SVD ShaperDigit class.
void initialize() override final
Module function initialize.
TH1F * m_svdTime[2]
L3 V-side time for all clusters.
TH1F * m_svdL3uZS5Occupancy_toSVDCKFaborts[2]
distribution of the SVD L3 V ZS5 occupancy when toSVDCKF aborts
TH1F * m_nCDCHitsSL[2][9]
distribution of the number of signal CDC hits divided by SL
TH1F * m_svdL3uZS5Occupancy_VXDTF2aborts[2]
distribution of the SVD L3 V ZS5 occupancy when VXDTF2 aborts
StoreObjPtr< EventLevelTrackingInfo > m_eventLevelTrackingInfo
tracking abort info
TH1D * m_integratedAverages[2]
integrated averages of additional SVD, CDC variables
SVDNoiseCalibrations m_NoiseCal
SVDNoise calibration db object.
TH1F * m_trackingErrorFlagsReasons[2]
stores the reason of the abort
void defineHisto() override final
Defines Histograms.
StoreObjPtr< TRGSummary > m_trgSummary
trg summary
TH1F * m_svdL3uZS5Occupancy[2]
distribution of the SVD L3 V ZS5 occupancy
TrackFindingCDC::StoreWrappedObjPtr< std::vector< TrackFindingCDC::CDCWireHit > > m_wireHitVector
CDC wire hits.
TH1F * m_noCDCHitsInSL[2]
number of tracks without CDC hits in each SL
StoreArray< SVDCluster > m_clusters
SVD clusters.
TH1F * m_nEventsWithAbort[2]
0: no abort; 1: at least one abort
TH1F * m_nCDCExtraHits[2]
distribution of the number of extra CDC hits
static constexpr int m_nStripsL3U
number of U-side L3 strips
StoreObjPtr< EventMetaData > m_eventMetaData
event meta data
TH1F * m_nCDCExtraHitsSL[2][9]
distribution of the number of extra CDC hits divided by SL
void event() override final
Module function event.
StoreArray< SVDShaperDigit > m_strips
SVD strips.
void updateBinContent(int index, int bin, float valueToBeAdded)
function to update the bin content
std::string m_histogramDirectoryName
Name of the histogram directory in ROOT file.
StoreArray< Track > m_tracks
tracks
void beginRun() override final
Module function beginRun.
TrackingAbortDQMModule()
Constructor.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getLayerNumber() const
Get the layer id.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.