Skip to content

Commit 38ec29f

Browse files
committed
MCTrack : query if secondary
1 parent b4cecbb commit 38ec29f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • DataFormats/simulation/include/SimulationDataFormat

DataFormats/simulation/include/SimulationDataFormat/MCTrack.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class MCTrackT
5858
/// Accessors
5959
Int_t GetPdgCode() const { return mPdgCode; }
6060
Int_t getMotherTrackId() const { return mMotherTrackId; }
61+
bool isSecondary() const { return mMotherTrackId != -1; }
6162
Double_t GetStartVertexMomentumX() const { return mStartVertexMomentumX; }
6263
Double_t GetStartVertexMomentumY() const { return mStartVertexMomentumY; }
6364
Double_t GetStartVertexMomentumZ() const { return mStartVertexMomentumZ; }
@@ -165,7 +166,7 @@ class MCTrackT
165166
Int_t mPdgCode;
166167

167168
/// Index of mother track. -1 for primary particles.
168-
Int_t mMotherTrackId;
169+
Int_t mMotherTrackId = -1;
169170

170171
// hitmask stored as an int
171172
// if bit i is set it means that this track left a trace in detector i

0 commit comments

Comments
 (0)