Skip to content

Commit adb9828

Browse files
committed
TrackReference: possibility to have unknown DetectorID
We've been using 0 as detectorID in generic "Stopping" TrackReferences. Unfortunately, 0 is also the ID of the ITS sensitive detector according to o2::detectors::DetID class. The commit changes this to using -1, where -1 means simply means "unknown".
1 parent 5a776ff commit adb9828

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

DataFormats/simulation/include/SimulationDataFormat/TrackReference.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class TrackReference
171171
float mTrackLength = 0; ///< track length from its origin in cm
172172
float mTof = 0; ///< time of flight in cm
173173
Int_t mUserId = 0; ///< optional Id defined by user
174-
Int_t mDetectorId = 0; ///< Detector Id
174+
Int_t mDetectorId = -1; ///< sensitive Detector Id (-1 if unknown or in passive material)
175175
SimTrackStatus mStatus; ///< encoding the track status
176176

177177
friend std::ostream& operator<<(std::ostream&, const TrackReference&);

Detectors/gconfig/src/StandardSteppingTrackRefHook.macro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ o2::steer::O2MCApplicationBase::TrackRefFcn trackRefHook() {
88
if (vmc->IsTrackStop() && stack->currentTrackLeftTrackRef()) {
99
// we add a stopping TrackRef when the current track already
1010
// registered previous TrackRefs
11-
stack->addTrackReference(o2::TrackReference(*vmc, 0));
11+
stack->addTrackReference(o2::TrackReference(*vmc, -1));
1212
}
1313
};
1414
}

0 commit comments

Comments
 (0)