Project
Loading...
Searching...
No Matches
o2::steer::MCKinematicsReader Class Reference

#include <MCKinematicsReader.h>

Public Types

enum class  Mode { kDigiContext , kMCKine }
 

Public Member Functions

 MCKinematicsReader ()=default
 default constructor
 
 ~MCKinematicsReader ()
 destructor
 
 MCKinematicsReader (std::string_view name, Mode mode=Mode::kDigiContext)
 
 MCKinematicsReader (o2::steer::DigitizationContext const *context)
 constructing directly from a digitization context
 
bool initFromDigitContext (std::string_view filename)
 
bool initFromDigitContext (o2::steer::DigitizationContext const *digicontext)
 
bool initFromKinematics (std::string_view filename)
 inits the reader from a simple kinematics file
 
bool isInitialized () const
 
MCTrack const * getTrack (o2::MCCompLabel const &) const
 
MCTrack const * getTrack (int source, int event, int track) const
 
MCTrack const * getTrack (int event, int track) const
 
std::vector< MCTrack > const & getTracks (int source, int event) const
 variant returning all tracks for source and event at once
 
void releaseTracksForSourceAndEvent (int source, int event)
 API to ask releasing tracks (freeing memory) for source + event.
 
std::vector< MCTrack > const & getTracks (int event) const
 variant returning all tracks for an event id (source = 0) at once
 
gsl::span< o2::TrackReferencegetTrackRefs (int source, int event, int track) const
 get all primaries for a certain event
 
const std::vector< o2::TrackReference > & getTrackRefsByEvent (int source, int event) const
 return all track references associated to a source/event
 
gsl::span< o2::TrackReferencegetTrackRefs (int event, int track) const
 return all track references associated to a event/track (when initialized from kinematics directly)
 
o2::dataformats::MCEventHeader const & getMCEventHeader (int source, int event) const
 retrieves the MCEventHeader for a given eventID and sourceID
 
size_t getNSources () const
 Get number of sources.
 
size_t getNEvents (int source) const
 Get number of events.
 
DigitizationContext const * getDigitizationContext () const
 

Detailed Description

Definition at line 31 of file MCKinematicsReader.h.

Member Enumeration Documentation

◆ Mode

Enumerator
kDigiContext 
kMCKine 

Definition at line 34 of file MCKinematicsReader.h.

Constructor & Destructor Documentation

◆ MCKinematicsReader() [1/3]

o2::steer::MCKinematicsReader::MCKinematicsReader ( )
default

default constructor

◆ ~MCKinematicsReader()

MCKinematicsReader::~MCKinematicsReader ( )

destructor

Definition at line 22 of file MCKinematicsReader.cxx.

◆ MCKinematicsReader() [2/3]

o2::steer::MCKinematicsReader::MCKinematicsReader ( std::string_view  name,
Mode  mode = Mode::kDigiContext 
)
inline

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. The default mode is kDigiContext.

Definition at line 49 of file MCKinematicsReader.h.

◆ MCKinematicsReader() [3/3]

o2::steer::MCKinematicsReader::MCKinematicsReader ( o2::steer::DigitizationContext const *  context)
inline

constructing directly from a digitization context

Definition at line 59 of file MCKinematicsReader.h.

Member Function Documentation

◆ getDigitizationContext()

DigitizationContext const * o2::steer::MCKinematicsReader::getDigitizationContext ( ) const
inline

Definition at line 118 of file MCKinematicsReader.h.

◆ getMCEventHeader()

o2::dataformats::MCEventHeader const & o2::steer::MCKinematicsReader::getMCEventHeader ( int  source,
int  event 
) const
inline

retrieves the MCEventHeader for a given eventID and sourceID

Definition at line 178 of file MCKinematicsReader.h.

◆ getNEvents()

size_t o2::steer::MCKinematicsReader::getNEvents ( int  source) const
inline

Get number of events.

Definition at line 212 of file MCKinematicsReader.h.

◆ getNSources()

size_t o2::steer::MCKinematicsReader::getNSources ( ) const
inline

Get number of sources.

Definition at line 207 of file MCKinematicsReader.h.

◆ getTrack() [1/3]

MCTrack const * o2::steer::MCKinematicsReader::getTrack ( int  event,
int  track 
) const
inline

query an MC track given event, track IDs returns nullptr if no track was found

Definition at line 157 of file MCKinematicsReader.h.

◆ getTrack() [2/3]

MCTrack const * o2::steer::MCKinematicsReader::getTrack ( int  source,
int  event,
int  track 
) const
inline

query an MC track given source, event, track IDs returns nullptr if no track was found

Definition at line 152 of file MCKinematicsReader.h.

◆ getTrack() [3/3]

MCTrack const * o2::steer::MCKinematicsReader::getTrack ( o2::MCCompLabel const &  label) const
inline

query an MC track given a basic label object returns nullptr if no track was found

Definition at line 144 of file MCKinematicsReader.h.

◆ getTrackRefs() [1/2]

gsl::span< o2::TrackReference > o2::steer::MCKinematicsReader::getTrackRefs ( int  event,
int  track 
) const
inline

return all track references associated to a event/track (when initialized from kinematics directly)

Definition at line 202 of file MCKinematicsReader.h.

◆ getTrackRefs() [2/2]

gsl::span< o2::TrackReference > o2::steer::MCKinematicsReader::getTrackRefs ( int  source,
int  event,
int  track 
) const
inline

get all primaries for a certain event

get all secondaries of the given label get all mothers/daughters of the given label return all track references associated to a source/event/track

Definition at line 186 of file MCKinematicsReader.h.

◆ getTrackRefsByEvent()

const std::vector< o2::TrackReference > & o2::steer::MCKinematicsReader::getTrackRefsByEvent ( int  source,
int  event 
) const
inline

return all track references associated to a source/event

Definition at line 194 of file MCKinematicsReader.h.

◆ getTracks() [1/2]

std::vector< MCTrack > const & o2::steer::MCKinematicsReader::getTracks ( int  event) const
inline

variant returning all tracks for an event id (source = 0) at once

Definition at line 173 of file MCKinematicsReader.h.

◆ getTracks() [2/2]

std::vector< MCTrack > const & o2::steer::MCKinematicsReader::getTracks ( int  source,
int  event 
) const
inline

variant returning all tracks for source and event at once

Definition at line 162 of file MCKinematicsReader.h.

◆ initFromDigitContext() [1/2]

bool MCKinematicsReader::initFromDigitContext ( o2::steer::DigitizationContext const *  digicontext)

Definition at line 135 of file MCKinematicsReader.cxx.

◆ initFromDigitContext() [2/2]

bool MCKinematicsReader::initFromDigitContext ( std::string_view  filename)

inits the reader from a digitization context returns true if successful

Definition at line 159 of file MCKinematicsReader.cxx.

◆ initFromKinematics()

bool MCKinematicsReader::initFromKinematics ( std::string_view  filename)

inits the reader from a simple kinematics file

Definition at line 174 of file MCKinematicsReader.cxx.

◆ isInitialized()

bool o2::steer::MCKinematicsReader::isInitialized ( ) const
inline

Definition at line 73 of file MCKinematicsReader.h.

◆ releaseTracksForSourceAndEvent()

void MCKinematicsReader::releaseTracksForSourceAndEvent ( int  source,
int  event 
)

API to ask releasing tracks (freeing memory) for source + event.

Definition at line 80 of file MCKinematicsReader.cxx.


The documentation for this class was generated from the following files: