|
CbmRoot
|
This class represents a package for tracking-related data. More...
#include <CaMcData.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 | SetMcHitInfo (const ca::Vector< cbm::algo::ca::McHitInfo > &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. | |
| const ca::Vector< cbm::algo::ca::McHitInfo > * | GetMcHitInfo () const |
| Gets pointer to MC hit info container. | |
| int | GetBestMcPointIdForCaHit (int iHit) const |
| int | GetBestMcTrackIdForCaHit (int iHit) const |
| McMatch | GetMcMatchForCaHit (int iHit) const |
| std::string | ToString (int verbose=1) const |
Private Attributes | |
| ca::Vector< McPoint > | fvPoints = {"ca::algo::ca::McData::fvPoints"} |
| Container of points. | |
| ca::Vector< McTrack > | fvTracks = {"ca::algo::ca::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< McLinkKey, int > | fmPointLinkMap = {} |
| MC point internal index vs. link. | |
| std::unordered_map< McLinkKey, int > | fmTrackLinkMap = {} |
| MC track internal index vs. link. | |
| const ca::Vector< cbm::algo::ca::McHitInfo > * | fpMcHitInfos = {nullptr} |
This class represents a package for tracking-related data.
Definition at line 33 of file CaMcData.h.
| McData::McData | ( | ) |
Default constructor.
Definition at line 22 of file CaMcData.cxx.
Referenced by McData(), McData(), operator=(), operator=(), Swap(), and ~McData().
|
default |
Destructor.
References McData().
| McData::McData | ( | const McData & | other | ) |
Copy constructor.
Definition at line 26 of file CaMcData.cxx.
References fmPointLinkMap, fmTrackLinkMap, fvNofPointsOrig, fvNofPointsUsed, fvPoints, fvTracks, and McData().
|
noexcept |
|
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 245 of file CaMcData.h.
References fmPointLinkMap, fvNofPointsUsed, fvPoints, cbm::algo::ca::McPoint::GetDetectorId(), cbm::algo::ca::McPoint::GetId(), and cbm::algo::ca::McPoint::GetLinkKey().
|
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 254 of file CaMcData.h.
References fmTrackLinkMap, fvTracks, cbm::algo::ca::McTrack::GetId(), and cbm::algo::ca::McTrack::GetLinkKey().
| void McData::Clear | ( | ) |
Clears contents.
Definition at line 76 of file CaMcData.cxx.
References fmPointLinkMap, fmTrackLinkMap, fvPoints, and fvTracks.
|
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 78 of file CaMcData.h.
References fmPointLinkMap, and GetPointGlobExtIndex().
|
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 91 of file CaMcData.h.
References fmTrackLinkMap.
|
inline |
Definition at line 180 of file CaMcData.h.
References fpMcHitInfos.
|
inline |
Definition at line 188 of file CaMcData.h.
References fpMcHitInfos, GetNofPoints(), and GetPoint().
|
inline |
Gets the first point index for a given detector subsystem.
| detID | Detector ID |
Definition at line 99 of file CaMcData.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 106 of file CaMcData.h.
References fvNofPointsUsed.
|
inline |
Gets pointer to MC hit info container.
Definition at line 178 of file CaMcData.h.
References fpMcHitInfos.
|
inline |
Definition at line 199 of file CaMcData.h.
References cbm::algo::ca::McMatch::AddLink(), fpMcHitInfos, GetNofPoints(), and GetPoint().
|
inline |
Gets number of points in this event/TS.
Definition at line 126 of file CaMcData.h.
References fvPoints.
Referenced by GetBestMcTrackIdForCaHit(), GetMcMatchForCaHit(), and ToString().
|
inline |
Gets original number of MC points in different detectors.
| detID | Detector ID |
Definition at line 130 of file CaMcData.h.
References fvNofPointsOrig.
|
inline |
Gets used number of MC points in different detectors.
| detID | Detector ID |
Definition at line 134 of file CaMcData.h.
References fvNofPointsUsed.
|
inline |
Gets number of tracks in this event/TS.
Definition at line 123 of file CaMcData.h.
References fvTracks.
Referenced by ToString().
|
inline |
Gets mutual reference to MC point by its index.
Definition at line 142 of file CaMcData.h.
References fvPoints.
|
inline |
Gets a reference to MC point by its index.
Definition at line 137 of file CaMcData.h.
References fvPoints.
Referenced by GetBestMcTrackIdForCaHit(), and GetMcMatchForCaHit().
|
inline |
Gets a reference to the vector of points.
Definition at line 145 of file CaMcData.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 117 of file CaMcData.h.
References fvNofPointsOrig.
Referenced by FindInternalPointIndex().
|
inline |
Gets a mutual reference to MC track by its internal index.
Definition at line 151 of file CaMcData.h.
References fvTracks.
|
inline |
Gets a reference to MC track by its internal index.
Definition at line 148 of file CaMcData.h.
References fvTracks.
|
inline |
Gets a mutual reference to the vector of tracks.
Definition at line 157 of file CaMcData.h.
References fvTracks.
|
inline |
Gets a reference to the vector of tracks.
Definition at line 154 of file CaMcData.h.
References fvTracks.
Move assignment operator.
Definition at line 52 of file CaMcData.cxx.
|
inline |
Reserves memory for points to avoid extra allocations.
Definition at line 170 of file CaMcData.h.
References fvPoints.
|
inline |
Reserves memory for tracks to avoid extra allocations.
Definition at line 167 of file CaMcData.h.
References fvTracks.
| void McData::SetMcHitInfo | ( | const ca::Vector< cbm::algo::ca::McHitInfo > & | 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 CaMcData.cxx.
References fpMcHitInfos, fvPoints, and fvTracks.
|
inline |
Sets original number of MC points in different detectors.
| detID | Detector ID |
| nPoints | Number of points |
Definition at line 175 of file CaMcData.h.
References fvNofPointsOrig.
|
noexcept |
Swap method.
Definition at line 63 of file CaMcData.cxx.
References fmPointLinkMap, fmTrackLinkMap, fvNofPointsOrig, fvNofPointsUsed, fvPoints, fvTracks, and McData().
Referenced by McData(), and operator=().
| std::string McData::ToString | ( | int | verbose = 1 | ) | const |
Prints an example of tracks and points
| verbose | Verbose level:
|
Definition at line 109 of file CaMcData.cxx.
References fmPointLinkMap, fmTrackLinkMap, fvPoints, fvTracks, GetNofPoints(), and GetNofTracks().
|
private |
MC point internal index vs. link.
Definition at line 232 of file CaMcData.h.
Referenced by AddPoint(), Clear(), FindInternalPointIndex(), McData(), Swap(), and ToString().
|
private |
MC track internal index vs. link.
Definition at line 233 of file CaMcData.h.
Referenced by AddTrack(), Clear(), FindInternalTrackIndex(), McData(), Swap(), and ToString().
|
private |
Definition at line 235 of file CaMcData.h.
Referenced by GetBestMcPointIdForCaHit(), GetBestMcTrackIdForCaHit(), GetMcHitInfo(), GetMcMatchForCaHit(), and SetMcHitInfo().
|
private |
Total number of points by detector.
Definition at line 229 of file CaMcData.h.
Referenced by GetNofPointsOrig(), GetPointGlobExtIndex(), McData(), SetNofPointsOrig(), and Swap().
|
private |
Number of points used vs. detector.
Definition at line 230 of file CaMcData.h.
Referenced by AddPoint(), GetFirstPointIndex(), GetLastPointIndex(), GetNofPointsUsed(), McData(), and Swap().
|
private |
Container of points.
Definition at line 226 of file CaMcData.h.
Referenced by AddPoint(), Clear(), GetNofPoints(), GetPoint(), GetPoint(), GetPointContainer(), McData(), ReserveNofPoints(), SetMcHitInfo(), Swap(), and ToString().
|
private |
Container of tracks.
Definition at line 227 of file CaMcData.h.
Referenced by AddTrack(), Clear(), GetNofTracks(), GetTrack(), GetTrack(), GetTrackContainer(), GetTrackContainer(), McData(), ReserveNofTracks(), SetMcHitInfo(), Swap(), and ToString().