@@ -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}
0 commit comments