CbmRoot
|
This class represents a package for tracking-related data. More...
#include <CaToolsMCData.h>
Public Member Functions | |
MCData () | |
Default constructor. | |
~MCData ()=default | |
Destructor. | |
MCData (const MCData &other) | |
Copy constructor. | |
MCData (MCData &&other) noexcept | |
Move constructor. | |
MCData & | operator= (const MCData &other) |
Copy assignment operator. | |
MCData & | operator= (MCData &&other) noexcept |
Move assignment operator. | |
void | Swap (MCData &other) noexcept |
Swap method. | |
void | AddPoint (const MCPoint &point) |
void | AddTrack (const MCTrack &track) |
void | Clear () |
Clears contents. | |
int | FindInternalPointIndex (ca::EDetectorID detID, int index, int event, int file) const |
Finds an index of MC point in internal point container. | |
int | FindInternalTrackIndex (int index, int event, int file) const |
Finds an index of MC track in internal track container. | |
int | GetFirstPointIndex (ca::EDetectorID detID) const |
Gets the first point index for a given detector subsystem. | |
int | GetLastPointIndex (ca::EDetectorID detID) const |
Gets the next index of point, which is expected being after the last one for a given detector. | |
int | GetPointGlobExtIndex (ca::EDetectorID detID, int iPointLocal) const |
Calculates global index of MC point. | |
int | GetNofTracks () const |
Gets number of tracks in this event/TS. | |
int | GetNofPoints () const |
Gets number of points in this event/TS. | |
int | GetNofPointsOrig (ca::EDetectorID detID) const |
Gets original number of MC points in different detectors. | |
int | GetNofPointsUsed (ca::EDetectorID detID) const |
Gets used number of MC points in different detectors. | |
const auto & | GetPoint (int idx) const |
Gets a reference to MC point by its index. | |
auto & | GetPoint (int idx) |
Gets mutual reference to MC point by its index. | |
const auto & | GetPointContainer () const |
Gets a reference to the vector of points. | |
const auto & | GetTrack (int idx) const |
Gets a reference to MC track by its internal index. | |
auto & | GetTrack (int idx) |
Gets a mutual reference to MC track by its internal index. | |
const auto & | GetTrackContainer () const |
Gets a reference to the vector of tracks. | |
auto & | GetTrackContainer () |
Gets a mutual reference to the vector of tracks. | |
void | InitTrackInfo (const ca::Vector< CbmL1HitDebugInfo > &vHits) |
Initialize information about points and hits association with MC track. | |
void | ReserveNofTracks (int nTracks) |
Reserves memory for tracks to avoid extra allocations. | |
void | ReserveNofPoints (int nPoints) |
Reserves memory for points to avoid extra allocations. | |
void | SetNofPointsOrig (ca::EDetectorID detID, int nPoints) |
Sets original number of MC points in different detectors. | |
std::string | ToString (int verbose=1) const |
Private Attributes | |
ca::Vector< MCPoint > | fvPoints = {"ca::tools::MCData::fvPoints"} |
Container of points. | |
ca::Vector< MCTrack > | fvTracks = {"ca::tools::MCData::fvTracks"} |
Container of tracks. | |
std::array< int, constants::size::MaxNdetectors > | fvNofPointsOrig = {0} |
Total number of points by detector. | |
std::array< int, constants::size::MaxNdetectors > | fvNofPointsUsed = {0} |
Number of points used vs. detector. | |
std::unordered_map< LinkKey, int > | fmPointLinkMap = {} |
MC point internal index vs. link. | |
std::unordered_map< LinkKey, int > | fmTrackLinkMap = {} |
MC track internal index vs. link. | |
This class represents a package for tracking-related data.
Definition at line 34 of file CaToolsMCData.h.
MCData::MCData | ( | ) |
|
default |
Destructor.
MCData::MCData | ( | const MCData & | other | ) |
Copy constructor.
Definition at line 26 of file CaToolsMCData.cxx.
|
noexcept |
Move constructor.
Definition at line 38 of file CaToolsMCData.cxx.
|
inline |
Adds an MC point to points container and a corresponding link key to the point index map
point | MC point object |
Definition at line 207 of file CaToolsMCData.h.
References fmPointLinkMap, fvNofPointsUsed, fvPoints, cbm::ca::tools::MCPoint::GetDetectorId(), cbm::ca::tools::MCPoint::GetId(), and cbm::ca::tools::MCPoint::GetLinkKey().
Referenced by cbm::ca::MCModule::ReadMCPointsForDetector().
|
inline |
Adds an MC track to tracks container and a corresponding link key to the link index map
track | MC track object |
Definition at line 216 of file CaToolsMCData.h.
References fmTrackLinkMap, fvTracks, cbm::ca::tools::MCTrack::GetId(), and cbm::ca::tools::MCTrack::GetLinkKey().
Referenced by cbm::ca::MCModule::ReadMCTracks().
void MCData::Clear | ( | ) |
Clears contents.
Definition at line 76 of file CaToolsMCData.cxx.
References fmPointLinkMap, fmTrackLinkMap, fvPoints, and fvTracks.
Referenced by cbm::ca::MCModule::InitEvent().
|
inline |
Finds an index of MC point in internal point container.
detID | Detector ID |
index | Index of MC point in external point container |
event | Index of MC event |
file | Index of MC file |
Definition at line 79 of file CaToolsMCData.h.
References fmPointLinkMap, and GetPointGlobExtIndex().
Referenced by cbm::ca::MCModule::MatchHitWithMc().
|
inline |
Finds an index of MC track in internal track container.
index | Index of MC track in external track container |
event | Index of MC event |
file | Index of MC file |
Definition at line 92 of file CaToolsMCData.h.
References fmTrackLinkMap.
Referenced by cbm::ca::MCModule::FillMCPoint(), and cbm::ca::MCModule::ReadMCTracks().
|
inline |
Gets the first point index for a given detector subsystem.
detID | Detector ID |
Definition at line 100 of file CaToolsMCData.h.
References fvNofPointsUsed.
|
inline |
Gets the next index of point, which is expected being after the last one for a given detector.
detID | Detector ID |
Definition at line 107 of file CaToolsMCData.h.
References fvNofPointsUsed.
|
inline |
Gets number of points in this event/TS.
Definition at line 127 of file CaToolsMCData.h.
References fvPoints.
Referenced by cbm::ca::OutputQa::DrawEvent(), cbm::ca::OutputQa::ExecQa(), cbm::ca::MCModule::FillMCPoint(), cbm::ca::MCModule::InitEvent(), and ToString().
|
inline |
Gets original number of MC points in different detectors.
detID | Detector ID |
Definition at line 131 of file CaToolsMCData.h.
References fvNofPointsOrig.
|
inline |
Gets used number of MC points in different detectors.
detID | Detector ID |
Definition at line 135 of file CaToolsMCData.h.
References fvNofPointsUsed.
|
inline |
Gets number of tracks in this event/TS.
Definition at line 124 of file CaToolsMCData.h.
References fvTracks.
Referenced by cbm::ca::OutputQa::DrawEvent(), cbm::ca::OutputQa::ExecQa(), cbm::ca::MCModule::InitEvent(), cbm::ca::MCModule::ReadMCPoints(), cbm::ca::MCModule::ReadMCTracks(), and ToString().
|
inline |
Gets mutual reference to MC point by its index.
Definition at line 143 of file CaToolsMCData.h.
References fvPoints.
|
inline |
Gets a reference to MC point by its index.
Definition at line 138 of file CaToolsMCData.h.
References fvPoints.
Referenced by CbmL1MCTrack::CalculateMaxNStaMC(), CbmL1MCTrack::CalculateMCCont(), cbm::ca::OutputQa::DrawEvent(), CbmL1::DumpMCTripletsToTree(), cbm::ca::TrackTypeQa::FillRecoTrack(), CbmL1::HistoPerformance(), cbm::ca::MCModule::InitEvent(), cbm::ca::MCModule::InitTrackInfo(), cbm::ca::MCModule::MatchPointsAndHits(), cbm::ca::MCModule::MatchRecoAndMCTracks(), and CbmL1::TrackFitPerformance().
|
inline |
Gets a reference to the vector of points.
Definition at line 146 of file CaToolsMCData.h.
References fvPoints.
|
inline |
Calculates global index of MC point.
iPointLocal | Local index of MC psinoint |
detID | Detector ID |
The function calculates global external index of MC point as a sum of a given local index and total provided number of points in previous detector subsystem.
Definition at line 118 of file CaToolsMCData.h.
References fvNofPointsOrig.
Referenced by cbm::ca::MCModule::FillMCPoint(), and FindInternalPointIndex().
|
inline |
Gets a mutual reference to MC track by its internal index.
Definition at line 152 of file CaToolsMCData.h.
References fvTracks.
|
inline |
Gets a reference to MC track by its internal index.
Definition at line 149 of file CaToolsMCData.h.
References fvTracks.
Referenced by cbm::ca::OutputQa::DrawEvent(), CbmL1::EfficienciesPerformance(), cbm::ca::OutputQa::ExecQa(), cbm::ca::MCModule::FillMCPoint(), cbm::ca::TrackTypeQa::FillMCTrack(), cbm::ca::TrackTypeQa::FillRecoTrack(), CbmL1::HistoPerformance(), cbm::ca::MCModule::MatchRecoAndMCTracks(), and CbmL1::TrackFitPerformance().
|
inline |
Gets a mutual reference to the vector of tracks.
Definition at line 158 of file CaToolsMCData.h.
References fvTracks.
|
inline |
Gets a reference to the vector of tracks.
Definition at line 155 of file CaToolsMCData.h.
References fvTracks.
Referenced by CbmL1::DumpMCTripletsToTree(), CbmL1::EfficienciesPerformance(), CbmL1::HistoPerformance(), CbmL1::IdealTrackFinder(), cbm::ca::MCModule::InitEvent(), cbm::ca::MCModule::InitTrackInfo(), and cbm::ca::MCModule::MatchTracks().
void MCData::InitTrackInfo | ( | const ca::Vector< CbmL1HitDebugInfo > & | vHits | ) |
Initialize information about points and hits association with MC track.
vHits | Vector of hit objects Initialize tracks: defines indexes of hits and points related to the track, calculates max number of points and hits on a station, number of consecutive stations containing a hit or point and number of stations and points with hits. |
Definition at line 86 of file CaToolsMCData.cxx.
References fvPoints, and fvTracks.
Referenced by cbm::ca::MCModule::InitTrackInfo().
Move assignment operator.
Definition at line 52 of file CaToolsMCData.cxx.
|
inline |
Reserves memory for points to avoid extra allocations.
Definition at line 171 of file CaToolsMCData.h.
References fvPoints.
Referenced by cbm::ca::MCModule::ReadMCPoints().
|
inline |
Reserves memory for tracks to avoid extra allocations.
Definition at line 168 of file CaToolsMCData.h.
References fvTracks.
Referenced by cbm::ca::MCModule::ReadMCTracks().
|
inline |
Sets original number of MC points in different detectors.
detID | Detector ID |
nPoints | Number of points |
Definition at line 176 of file CaToolsMCData.h.
References fvNofPointsOrig.
Referenced by cbm::ca::MCModule::ReadMCPoints().
|
noexcept |
Swap method.
Definition at line 63 of file CaToolsMCData.cxx.
std::string MCData::ToString | ( | int | verbose = 1 | ) | const |
Prints an example of tracks and points
verbose | Verbose level:
|
Definition at line 108 of file CaToolsMCData.cxx.
References fmPointLinkMap, fmTrackLinkMap, fvPoints, fvTracks, GetNofPoints(), and GetNofTracks().
|
private |
MC point internal index vs. link.
Definition at line 196 of file CaToolsMCData.h.
Referenced by AddPoint(), Clear(), FindInternalPointIndex(), and ToString().
|
private |
MC track internal index vs. link.
Definition at line 197 of file CaToolsMCData.h.
Referenced by AddTrack(), Clear(), FindInternalTrackIndex(), and ToString().
|
private |
Total number of points by detector.
Definition at line 193 of file CaToolsMCData.h.
Referenced by GetNofPointsOrig(), GetPointGlobExtIndex(), and SetNofPointsOrig().
|
private |
Number of points used vs. detector.
Definition at line 194 of file CaToolsMCData.h.
Referenced by AddPoint(), GetFirstPointIndex(), GetLastPointIndex(), and GetNofPointsUsed().
|
private |
Container of points.
Definition at line 190 of file CaToolsMCData.h.
Referenced by AddPoint(), Clear(), GetNofPoints(), GetPoint(), GetPoint(), GetPointContainer(), InitTrackInfo(), ReserveNofPoints(), and ToString().
|
private |
Container of tracks.
Definition at line 191 of file CaToolsMCData.h.
Referenced by AddTrack(), Clear(), GetNofTracks(), GetTrack(), GetTrack(), GetTrackContainer(), GetTrackContainer(), InitTrackInfo(), ReserveNofTracks(), and ToString().