Skip to content

Commit b7a866d

Browse files
author
Qingyuan LIU
committed
Check PXDHits pointer before processing.
1 parent c04d696 commit b7a866d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pxd/calibration/src/PXDHotPixelMaskCalibrationAlgorithm.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ CalibrationAlgorithm::EResult PXDHotPixelMaskCalibrationAlgorithm::calibrate()
9696
auto collector_pxdhits = getObjectPtr<TH1I>("PXDHits");
9797
auto collector_pxdhitcounts = getObjectPtr<TH1I>("PXDHitCounts");
9898

99+
// Check if there is any PXD hit
100+
if (!collector_pxdhits) {
101+
if (forceContinueMasking)
102+
return c_OK;
103+
else
104+
return c_NotEnoughData;
105+
}
106+
99107
// We should have some minimum number of events
100108
auto nevents = collector_pxdhits->GetEntries();
101109
if (nevents < minEvents) {

0 commit comments

Comments
 (0)