File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ class MCKinematicsReader
3535 // / default constructor
3636 MCKinematicsReader () = default ;
3737
38+ // / destructor
39+ ~MCKinematicsReader ();
40+
3841 // / constructor taking a name and mode (either kDigiContext or kMCKine)
3942 // / In case of "context", the name is the filename of the digitization context.
4043 // / In case of MCKine mode, the name is the "prefix" referencing a single simulation production.
@@ -114,8 +117,8 @@ class MCKinematicsReader
114117 std::vector<TChain*> mInputChains ;
115118
116119 // a vector of tracks foreach source and each collision
117- mutable std::vector<std::vector<std::vector<o2::MCTrack>>> mTracks ; // the in-memory track container
118- mutable std::vector<std::vector<o2::dataformats::MCEventHeader>> mHeaders ; // the in-memory header container
120+ mutable std::vector<std::vector<std::vector<o2::MCTrack>>> mTracks ; // the in-memory track container
121+ mutable std::vector<std::vector<o2::dataformats::MCEventHeader>> mHeaders ; // the in-memory header container
119122 mutable std::vector<std::vector<o2::dataformats::MCTruthContainer<o2::TrackReference>>> mIndexedTrackRefs ; // the in-memory track ref container
120123
121124 bool mInitialized = false ; // whether initialized
Original file line number Diff line number Diff line change 1818
1919using namespace o2 ::steer;
2020
21+ MCKinematicsReader::~MCKinematicsReader ()
22+ {
23+ for (auto chain : mInputChains ) {
24+ delete chain;
25+ }
26+ mInputChains .clear ();
27+
28+ if (mDigitizationContext ) {
29+ delete mDigitizationContext ;
30+ }
31+ }
32+
2133void MCKinematicsReader::initIndexedTrackRefs (std::vector<o2::TrackReference>& refs, o2::dataformats::MCTruthContainer<o2::TrackReference>& indexedrefs) const
2234{
2335 // sort trackrefs according to track index then according to track length
You can’t perform that action at this time.
0 commit comments