Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Steer/include/Steer/MCKinematicsReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class MCKinematicsReader
/// default constructor
MCKinematicsReader() = default;

/// destructor
~MCKinematicsReader();

/// constructor taking a name and mode (either kDigiContext or kMCKine)
/// In case of "context", the name is the filename of the digitization context.
/// In case of MCKine mode, the name is the "prefix" referencing a single simulation production.
Expand Down Expand Up @@ -114,8 +117,8 @@ class MCKinematicsReader
std::vector<TChain*> mInputChains;

// a vector of tracks foreach source and each collision
mutable std::vector<std::vector<std::vector<o2::MCTrack>>> mTracks; // the in-memory track container
mutable std::vector<std::vector<o2::dataformats::MCEventHeader>> mHeaders; // the in-memory header container
mutable std::vector<std::vector<std::vector<o2::MCTrack>>> mTracks; // the in-memory track container
mutable std::vector<std::vector<o2::dataformats::MCEventHeader>> mHeaders; // the in-memory header container
mutable std::vector<std::vector<o2::dataformats::MCTruthContainer<o2::TrackReference>>> mIndexedTrackRefs; // the in-memory track ref container

bool mInitialized = false; // whether initialized
Expand Down
12 changes: 12 additions & 0 deletions Steer/src/MCKinematicsReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@

using namespace o2::steer;

MCKinematicsReader::~MCKinematicsReader()
{
for (auto chain : mInputChains) {
delete chain;
}
mInputChains.clear();

if (mDigitizationContext) {
delete mDigitizationContext;
}
}

void MCKinematicsReader::initIndexedTrackRefs(std::vector<o2::TrackReference>& refs, o2::dataformats::MCTruthContainer<o2::TrackReference>& indexedrefs) const
{
// sort trackrefs according to track index then according to track length
Expand Down