Skip to content

Commit 8e4ac1b

Browse files
committed
improvements after Thomas' comments + added th2f of n of events vs time after inj and time withing a beam cycle
1 parent e928728 commit 8e4ac1b

File tree

3 files changed

+42
-24
lines changed

3 files changed

+42
-24
lines changed

dqm/analysis/modules/src/DQMHistAnalysisTrackingER.cc

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DQMHistAnalysisTrackingERModule::DQMHistAnalysisTrackingERModule()
3232

3333
setDescription("DQM Analysis Module of the Tracking ER Plots.");
3434

35-
addParam("onTimeHalfWidth", m_onTimeHalfWidth, "a cluster is on time if within ± onTimeHalfWidth", float(50));
35+
addParam("onTimeHalfWidth", m_onTimeHalfWidth, "a cluster is on time if within ± onTimeHalfWidth [ns]", float(m_onTimeHalfWidth));
3636

3737
}
3838

@@ -53,34 +53,39 @@ void DQMHistAnalysisTrackingERModule::event()
5353
//compute fraction of tracks with no PXD hits
5454

5555
TH1* hNoPXDHits = findHist("TrackingERDQM/NoOfHitsInTrack_PXD");
56-
if (hNoPXDHits != NULL) {
56+
if (hNoPXDHits != nullptr) {
5757

5858
int nTracks = hNoPXDHits->GetEntries();
5959
int nTracksNoPXD = hNoPXDHits->GetBinContent(1);
6060

61-
m_monObj->setVariable("tracksNoPXDHit", (double)nTracksNoPXD / nTracks);
61+
if (nTracks > 0)
62+
m_monObj->setVariable("tracksNoPXDHit", (double)nTracksNoPXD / nTracks);
6263
}
6364

6465
//fraction of offtime SVD hits
6566
//considering L3V and L456V clusters (separately)
6667

6768
TH1* hSVDL3VTime = findHist("SVDClsTrk/SVDTRK_ClusterTimeV3");
68-
if (hSVDL3VTime != NULL) {
69+
if (hSVDL3VTime != nullptr) {
6970
int all = hSVDL3VTime->GetEntries();
70-
int bin_min = hSVDL3VTime->GetXaxis()->FindBin(-m_onTimeHalfWidth);
71-
int bin_max = hSVDL3VTime->GetXaxis()->FindBin(+m_onTimeHalfWidth);
72-
int offtime = all - hSVDL3VTime->Integral(bin_min, bin_max);
73-
double offtimeL3Hits = (double)offtime / all;
74-
m_monObj->setVariable("offtimeL3Hits", offtimeL3Hits);
71+
if (all > 0) {
72+
int bin_min = hSVDL3VTime->GetXaxis()->FindBin(-m_onTimeHalfWidth);
73+
int bin_max = hSVDL3VTime->GetXaxis()->FindBin(+m_onTimeHalfWidth);
74+
int offtime = all - hSVDL3VTime->Integral(bin_min, bin_max);
75+
double offtimeL3Hits = (double)offtime / all;
76+
m_monObj->setVariable("offtimeL3Hits", offtimeL3Hits);
77+
}
7578
}
7679

7780
TH1* hSVDL456VTime = findHist("SVDClsTrk/SVDTRK_ClusterTimeV456");
78-
if (hSVDL456VTime != NULL) {
81+
if (hSVDL456VTime != nullptr) {
7982
int all = hSVDL456VTime->GetEntries();
80-
int bin_min = hSVDL456VTime->GetXaxis()->FindBin(-m_onTimeHalfWidth);
81-
int bin_max = hSVDL456VTime->GetXaxis()->FindBin(+m_onTimeHalfWidth);
82-
int offtime = all - hSVDL456VTime->Integral(bin_min, bin_max);
83-
double offtimeL456Hits = (double)offtime / all;
84-
m_monObj->setVariable("offtimeL456Hits", offtimeL456Hits);
83+
if (all > 0) {
84+
int bin_min = hSVDL456VTime->GetXaxis()->FindBin(-m_onTimeHalfWidth);
85+
int bin_max = hSVDL456VTime->GetXaxis()->FindBin(+m_onTimeHalfWidth);
86+
int offtime = all - hSVDL456VTime->Integral(bin_min, bin_max);
87+
double offtimeL456Hits = (double)offtime / all;
88+
m_monObj->setVariable("offtimeL456Hits", offtimeL456Hits);
89+
}
8590
}
8691
}

tracking/modules/trackingDQM/include/TrackingHLTDQMModule.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,18 @@ namespace Belle2 {
5353
* The histogram records if any flag was set. */
5454
TH1F* m_trackingErrorFlags = nullptr;
5555

56-
/** abort rate as a function of time after injection and time within a bam cycle - HER*/
56+
/** abort rate as a function of time after injection and time within a beam cycle - HER*/
5757
TH2F* m_abortVStimeHER = nullptr;
5858

59-
/** abort rate as a function of time after injection and time within a bam cycle - LER*/
59+
/** number of events as a function of time after injection and time within a beam cycle - HER*/
60+
TH2F* m_allVStimeHER = nullptr;
61+
62+
/** abort rate as a function of time after injection and time within a beam cycle - LER*/
6063
TH2F* m_abortVStimeLER = nullptr;
6164

65+
/** number of events as a function of time after injection and time within a beam cycle - LER*/
66+
TH2F* m_allVStimeLER = nullptr;
67+
6268
/** Beam revolution time in microseconds (approximated).
6369
*
6470
* The exact time could be obtained as

tracking/modules/trackingDQM/src/TrackingHLTDQMModule.cc

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,25 @@ void TrackingHLTDQMModule::event()
103103
// get last injection time
104104
auto difference = it.GetTimeSinceLastInjection(0);
105105
// check time overflow, too long ago
106-
if (difference != 0x7FFFFFFF)
107-
if (m_eventLevelTrackingInfo->hasAnErrorFlag()) {
108-
double timeSinceInj = it.GetTimeSinceLastInjection(0) / c_globalClock;
109-
double timeInCycle = timeSinceInj - (int)(timeSinceInj / c_revolutionTime) * c_revolutionTime;
106+
if (difference != 0x7FFFFFFF) {
107+
108+
double timeSinceInj = it.GetTimeSinceLastInjection(0) / c_globalClock;
109+
double timeInCycle = timeSinceInj - (int)(timeSinceInj / c_revolutionTime) * c_revolutionTime;
110110

111+
if (it.GetIsHER(0))
112+
m_allVStimeHER->Fill(timeSinceInj, timeInCycle);
113+
else
114+
m_allVStimeLER->Fill(timeSinceInj, timeInCycle);
115+
116+
if (m_eventLevelTrackingInfo->hasAnErrorFlag()) {
111117
if (it.GetIsHER(0))
112118
m_abortVStimeHER->Fill(timeSinceInj, timeInCycle);
113119
else
114120
m_abortVStimeLER->Fill(timeSinceInj, timeInCycle);
115-
}
116-
}
117-
}
121+
} //has error flag
122+
} //time overflow
123+
}// loop on RawFTSW
124+
} //RawFTSW is valid
118125
} else
119126
m_trackingErrorFlags->Fill(0.0);
120127

0 commit comments

Comments
 (0)