CbmRoot
Loading...
Searching...
No Matches
cbm::ca::TimeSliceReader Class Reference

A reader of time slice for CA tracker. More...

#include <CbmCaTimeSliceReader.h>

Collaboration diagram for cbm::ca::TimeSliceReader:
[legend]

Public Member Functions

 TimeSliceReader ()=default
 Constructor from parameters.
 
 ~TimeSliceReader ()=default
 Destructor.
 
 TimeSliceReader (const TimeSliceReader &)=delete
 Copy constructor.
 
 TimeSliceReader (TimeSliceReader &&)=delete
 Move constructor.
 
TimeSliceReaderoperator= (const TimeSliceReader &)=delete
 Copy assignment operator.
 
TimeSliceReaderoperator= (TimeSliceReader &&)=delete
 Move assignment operator.
 
void Clear ()
 Clears class content.
 
const auto & GetHitFirstIndexDet () const
 Gets reference to container of first hit indexes in a detector subsystem.
 
int GetNofHits (ca::EDetectorID iDet) const
 Gets number of hits stored for a given detector.
 
ECbmCaTrackingMode GetTrackingMode () const
 Gets CBM tracking mode.
 
bool InitRun ()
 Run initializer function.
 
void ReadEvent (CbmEvent *pEvent=nullptr)
 Reads time slice.
 
void RegisterQaHitContainer (ca::Vector< CbmL1HitDebugInfo > &vQaHits)
 Registers hit debug info container.
 
void RegisterHitIndexContainer (ca::Vector< CbmL1HitId > &vHitIds)
 Registers hit index container.
 
void RegisterParameters (std::shared_ptr< ca::Parameters< float > > &pParameters)
 Registers CA parameters object.
 
void RegisterIODataManager (std::shared_ptr< ca::DataManager > &ioDataManager)
 Registers the CA IO data manager instance.
 
void RegisterTracksContainer (ca::Vector< CbmL1Track > &vTracks)
 Register the reconstructed tracks container.
 
void SetDetector (ca::EDetectorID detID, bool flag=true)
 Sets used detector subsystems.
 
void SetTrackingMode (ECbmCaTrackingMode mode)
 Sets the tracking mode.
 
void SetSortQaHits (bool doSortQaHits)
 Sets flag to additionally sort QA hits by stations.
 

Private Member Functions

void CheckInit () const
 Check class initialization.
 
void ReadHits ()
 Reads hits.
 
void ReadRecoTracks ()
 Reads reconstructed tracks.
 
template<ca::EDetectorID DetID>
int ReadHitsForDetector ()
 Reads hits for a given detector subsystem.
 
void SortQaHits ()
 Sorts QA hit objects by stations.
 
void StoreHitRecord (const tools::HitRecord &hitRecord)
 Saves hit to data structures.
 

Private Attributes

DetIdArr_t< const CbmTrackingDetectorInterfaceBase * > fvpDetInterface = {{nullptr}}
 Pointers to the tracking detector interfaces for each subsystem.
 
CbmEventfpEvent = nullptr
 Pointer to the event object.
 
DetIdArr_t< TClonesArray * > fvpBrHits = {{nullptr}}
 Input branch for hits.
 
TClonesArray * fpBrRecoTracks = nullptr
 Input branch for reconstructed tracks ("GlobalTrack", "StsTrack")
 
TClonesArray * fpBrStsTracks = nullptr
 Input branch for reconstructed STS tracks ("StsTrack")
 
TClonesArray * fpBrMuchTracks = nullptr
 Input branch for reconstructed MuCh tracks ("MuchTrack")
 
TClonesArray * fpBrTrdTracks = nullptr
 Input branch for reconstructed TRD tracks ("TrdTrack")
 
TClonesArray * fpBrTofTracks = nullptr
 Input branch for reconstructed TOF tracks ("TofTrack")
 
ca::Vector< CbmL1HitId > * fpvHitIds = nullptr
 Pointer to array of hit index objects.
 
ca::Vector< CbmL1HitDebugInfo > * fpvQaHits = nullptr
 Pointer to array of debug hits.
 
ca::Vector< CbmL1Track > * fpvTracks = nullptr
 Pointer to array of reconstructed tracks.
 
std::shared_ptr< ca::DataManagerfpIODataManager = nullptr
 Pointer to input data manager.
 
std::shared_ptr< ca::Parameters< float > > fpParameters = nullptr
 Pointer to tracking parameters object.
 
DetIdArr_t< std::unordered_map< int, int > > fvmHitExtToIntIndexMap
 Hit index map ext -> int.
 
DetIdArr_t< int > fvNofHitsTotal = {{0}}
 Total hit number in detector.
 
DetIdArr_t< int > fvNofHitsUsed = {{0}}
 Number of used hits in detector.
 
DetIdArr_t< bool > fvbUseDet = {{false}}
 Flag: is detector subsystem used.
 
ECbmCaTrackingMode fTrackingMode = ECbmCaTrackingMode::kSTS
 Tracking mode.
 
bool fbSortQaHits = false
 Flag, if the QA hits must be sorted after reading.
 
int fNofHits = 0
 Stored number of hits.
 
int fNofHitKeys = 0
 Recorded number of hit keys.
 
int fFirstHitKey = 0
 First index of hit key for the detector subsystem.
 
std::array< int, constants::size::MaxNdetectors+1 > fvHitFirstIndexDet = {{0}}
 First hit index in detector.
 

Detailed Description

A reader of time slice for CA tracker.

The class reads reconstructed hits and reconstructed tracks (optionally) and fills the CA tracking internal data structures.

Definition at line 49 of file CbmCaTimeSliceReader.h.

Constructor & Destructor Documentation

◆ TimeSliceReader() [1/3]

cbm::ca::TimeSliceReader::TimeSliceReader ( )
default

Constructor from parameters.

Parameters
modeTracking mode

◆ ~TimeSliceReader()

cbm::ca::TimeSliceReader::~TimeSliceReader ( )
default

Destructor.

◆ TimeSliceReader() [2/3]

cbm::ca::TimeSliceReader::TimeSliceReader ( const TimeSliceReader & )
delete

Copy constructor.

◆ TimeSliceReader() [3/3]

cbm::ca::TimeSliceReader::TimeSliceReader ( TimeSliceReader && )
delete

Move constructor.

Member Function Documentation

◆ CheckInit()

void TimeSliceReader::CheckInit ( ) const
private

Check class initialization.

Note
The function throws std::logic_error, if initialization is incomplete

Definition at line 69 of file CbmCaTimeSliceReader.cxx.

References fpBrMuchTracks, fpBrRecoTracks, fpBrStsTracks, fpBrTofTracks, fpBrTrdTracks, fpParameters, fpvHitIds, fpvTracks, fTrackingMode, fvbUseDet, fvpBrHits, cbm::ca::kDetName, kMCBM, and kSTS.

Referenced by InitRun().

◆ Clear()

◆ GetHitFirstIndexDet()

const auto & cbm::ca::TimeSliceReader::GetHitFirstIndexDet ( ) const
inline

Gets reference to container of first hit indexes in a detector subsystem.

Returns
Ref. to the container

Definition at line 75 of file CbmCaTimeSliceReader.h.

References fvHitFirstIndexDet.

◆ GetNofHits()

int cbm::ca::TimeSliceReader::GetNofHits ( ca::EDetectorID iDet) const
inline

Gets number of hits stored for a given detector.

Parameters
iDetDetector ID
Returns
Number of hits

Definition at line 80 of file CbmCaTimeSliceReader.h.

References fvHitFirstIndexDet.

◆ GetTrackingMode()

ECbmCaTrackingMode cbm::ca::TimeSliceReader::GetTrackingMode ( ) const
inline

Gets CBM tracking mode.

Definition at line 86 of file CbmCaTimeSliceReader.h.

References fTrackingMode.

◆ InitRun()

◆ operator=() [1/2]

TimeSliceReader & cbm::ca::TimeSliceReader::operator= ( const TimeSliceReader & )
delete

Copy assignment operator.

◆ operator=() [2/2]

TimeSliceReader & cbm::ca::TimeSliceReader::operator= ( TimeSliceReader && )
delete

Move assignment operator.

◆ ReadEvent()

void TimeSliceReader::ReadEvent ( CbmEvent * pEvent = nullptr)

Reads time slice.

Parameters
pEventA pointer to CbmEvent

Reads hits and tracks (optionally) from time slice

Definition at line 194 of file CbmCaTimeSliceReader.cxx.

References fpEvent, fpvTracks, ReadHits(), and ReadRecoTracks().

◆ ReadHits()

◆ ReadHitsForDetector()

◆ ReadRecoTracks()

◆ RegisterHitIndexContainer()

void cbm::ca::TimeSliceReader::RegisterHitIndexContainer ( ca::Vector< CbmL1HitId > & vHitIds)
inline

Registers hit index container.

Parameters
vHitIdsReference to hits indexes container
Note
If no container is registered, all related routines are omitted

Definition at line 108 of file CbmCaTimeSliceReader.h.

References fpvHitIds.

◆ RegisterIODataManager()

void TimeSliceReader::RegisterIODataManager ( std::shared_ptr< ca::DataManager > & ioDataManager)

Registers the CA IO data manager instance.

Parameters
pIODataManagerShared pointer to the IO data manager instance
Note
If no container is registered, all related routines are omitted

Definition at line 324 of file CbmCaTimeSliceReader.cxx.

References fpIODataManager.

◆ RegisterParameters()

void cbm::ca::TimeSliceReader::RegisterParameters ( std::shared_ptr< ca::Parameters< float > > & pParameters)
inline

Registers CA parameters object.

Parameters
pParametersA shared pointer to the parameters object

Definition at line 112 of file CbmCaTimeSliceReader.h.

References fpParameters.

◆ RegisterQaHitContainer()

void cbm::ca::TimeSliceReader::RegisterQaHitContainer ( ca::Vector< CbmL1HitDebugInfo > & vQaHits)
inline

Registers hit debug info container.

Parameters
vQaHitsReference to Qa hit container
Note
If no container is registered, all related routines are omitted

Definition at line 103 of file CbmCaTimeSliceReader.h.

References fpvQaHits.

◆ RegisterTracksContainer()

void cbm::ca::TimeSliceReader::RegisterTracksContainer ( ca::Vector< CbmL1Track > & vTracks)
inline

Register the reconstructed tracks container.

Parameters
vTracksReference to reconstructed tracks container
Note
If no container is registered, all related routines are omitted

Definition at line 122 of file CbmCaTimeSliceReader.h.

References fpvTracks.

◆ SetDetector()

void cbm::ca::TimeSliceReader::SetDetector ( ca::EDetectorID detID,
bool flag = true )
inline

Sets used detector subsystems.

Parameters
detIDId of detector
flagFlag: true - detector is used
Note
Should be called before this->Init()

Definition at line 128 of file CbmCaTimeSliceReader.h.

References fvbUseDet.

◆ SetSortQaHits()

void cbm::ca::TimeSliceReader::SetSortQaHits ( bool doSortQaHits)
inline

Sets flag to additionally sort QA hits by stations.

Parameters
doSortQaHitstrue: hits are sorted

Definition at line 136 of file CbmCaTimeSliceReader.h.

References fbSortQaHits.

◆ SetTrackingMode()

void cbm::ca::TimeSliceReader::SetTrackingMode ( ECbmCaTrackingMode mode)
inline

Sets the tracking mode.

Parameters
modeTracking mode (from ECbmTrackingMode)

Definition at line 132 of file CbmCaTimeSliceReader.h.

References fTrackingMode.

◆ SortQaHits()

void TimeSliceReader::SortQaHits ( )
private

Sorts QA hit objects by stations.

Definition at line 332 of file CbmCaTimeSliceReader.cxx.

References fpParameters, fpvQaHits, cbm::algo::ca::Vector< T >::GetName(), and cbm::algo::ca::Vector< T >::SetName().

Referenced by ReadHits().

◆ StoreHitRecord()

void TimeSliceReader::StoreHitRecord ( const tools::HitRecord & hitRecord)
private

Saves hit to data structures.

Parameters
hitRecordFilled hit record

Stores recorded hit information into registered hit containers

Definition at line 540 of file CbmCaTimeSliceReader.cxx.

References CbmL1HitDebugInfo::Det, CbmL1HitDebugInfo::dt, CbmL1HitDebugInfo::dx, CbmL1HitDebugInfo::dxy, CbmL1HitDebugInfo::dy, cbm::algo::ca::Vector< T >::emplace_back(), CbmL1HitDebugInfo::ExtIndex, cbm::ca::tools::HitRecord::fDataStream, cbm::ca::tools::HitRecord::fDet, cbm::ca::tools::HitRecord::fDt2, cbm::ca::tools::HitRecord::fDx2, cbm::ca::tools::HitRecord::fDxy, cbm::ca::tools::HitRecord::fDy2, cbm::ca::tools::HitRecord::fExtId, fpIODataManager, fpvHitIds, fpvQaHits, cbm::ca::tools::HitRecord::fRangeT, cbm::ca::tools::HitRecord::fRangeX, cbm::ca::tools::HitRecord::fRangeY, cbm::ca::tools::HitRecord::fStaId, cbm::ca::tools::HitRecord::fStripB, cbm::ca::tools::HitRecord::fStripF, cbm::ca::tools::HitRecord::fT, cbm::ca::tools::HitRecord::fX, cbm::ca::tools::HitRecord::fY, cbm::ca::tools::HitRecord::fZ, CbmL1HitDebugInfo::IntIndex, CbmL1HitDebugInfo::iStation, cbm::algo::ca::Vector< T >::push_back(), cbm::algo::ca::Hit::SetBackKey(), cbm::algo::ca::Hit::SetDt2(), cbm::algo::ca::Hit::SetDx2(), cbm::algo::ca::Hit::SetDxy(), cbm::algo::ca::Hit::SetDy2(), cbm::algo::ca::Hit::SetFrontKey(), cbm::algo::ca::Hit::SetId(), cbm::algo::ca::Hit::SetRangeT(), cbm::algo::ca::Hit::SetRangeX(), cbm::algo::ca::Hit::SetRangeY(), cbm::algo::ca::Hit::SetStation(), cbm::algo::ca::Hit::SetT(), cbm::algo::ca::Hit::SetX(), cbm::algo::ca::Hit::SetY(), cbm::algo::ca::Hit::SetZ(), sqrt(), CbmL1HitDebugInfo::time, CbmL1HitDebugInfo::x, CbmL1HitDebugInfo::y, and CbmL1HitDebugInfo::z.

Member Data Documentation

◆ fbSortQaHits

bool cbm::ca::TimeSliceReader::fbSortQaHits = false
private

Flag, if the QA hits must be sorted after reading.

Definition at line 199 of file CbmCaTimeSliceReader.h.

Referenced by ReadHits(), and SetSortQaHits().

◆ fFirstHitKey

int cbm::ca::TimeSliceReader::fFirstHitKey = 0
private

First index of hit key for the detector subsystem.

Definition at line 204 of file CbmCaTimeSliceReader.h.

Referenced by Clear(), and ReadHits().

◆ fNofHitKeys

int cbm::ca::TimeSliceReader::fNofHitKeys = 0
private

Recorded number of hit keys.

Definition at line 203 of file CbmCaTimeSliceReader.h.

Referenced by Clear(), and ReadHits().

◆ fNofHits

int cbm::ca::TimeSliceReader::fNofHits = 0
private

Stored number of hits.

Definition at line 202 of file CbmCaTimeSliceReader.h.

Referenced by Clear(), and ReadHits().

◆ fpBrMuchTracks

TClonesArray* cbm::ca::TimeSliceReader::fpBrMuchTracks = nullptr
private

Input branch for reconstructed MuCh tracks ("MuchTrack")

Definition at line 179 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), Clear(), InitRun(), and ReadRecoTracks().

◆ fpBrRecoTracks

TClonesArray* cbm::ca::TimeSliceReader::fpBrRecoTracks = nullptr
private

Input branch for reconstructed tracks ("GlobalTrack", "StsTrack")

Definition at line 177 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), Clear(), InitRun(), and ReadRecoTracks().

◆ fpBrStsTracks

TClonesArray* cbm::ca::TimeSliceReader::fpBrStsTracks = nullptr
private

Input branch for reconstructed STS tracks ("StsTrack")

Definition at line 178 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), Clear(), InitRun(), and ReadRecoTracks().

◆ fpBrTofTracks

TClonesArray* cbm::ca::TimeSliceReader::fpBrTofTracks = nullptr
private

Input branch for reconstructed TOF tracks ("TofTrack")

Definition at line 181 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), Clear(), InitRun(), and ReadRecoTracks().

◆ fpBrTrdTracks

TClonesArray* cbm::ca::TimeSliceReader::fpBrTrdTracks = nullptr
private

Input branch for reconstructed TRD tracks ("TrdTrack")

Definition at line 180 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), Clear(), InitRun(), and ReadRecoTracks().

◆ fpEvent

CbmEvent* cbm::ca::TimeSliceReader::fpEvent = nullptr
private

Pointer to the event object.

Definition at line 170 of file CbmCaTimeSliceReader.h.

Referenced by ReadEvent(), ReadHits(), and ReadRecoTracks().

◆ fpIODataManager

std::shared_ptr<ca::DataManager> cbm::ca::TimeSliceReader::fpIODataManager = nullptr
private

Pointer to input data manager.

Definition at line 187 of file CbmCaTimeSliceReader.h.

Referenced by Clear(), ReadHits(), RegisterIODataManager(), and StoreHitRecord().

◆ fpParameters

std::shared_ptr<ca::Parameters<float> > cbm::ca::TimeSliceReader::fpParameters = nullptr
private

Pointer to tracking parameters object.

Definition at line 188 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), Clear(), RegisterParameters(), and SortQaHits().

◆ fpvHitIds

ca::Vector<CbmL1HitId>* cbm::ca::TimeSliceReader::fpvHitIds = nullptr
private

Pointer to array of hit index objects.

Definition at line 184 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), Clear(), ReadHits(), RegisterHitIndexContainer(), and StoreHitRecord().

◆ fpvQaHits

ca::Vector<CbmL1HitDebugInfo>* cbm::ca::TimeSliceReader::fpvQaHits = nullptr
private

Pointer to array of debug hits.

Definition at line 185 of file CbmCaTimeSliceReader.h.

Referenced by Clear(), ReadHits(), RegisterQaHitContainer(), SortQaHits(), and StoreHitRecord().

◆ fpvTracks

ca::Vector<CbmL1Track>* cbm::ca::TimeSliceReader::fpvTracks = nullptr
private

Pointer to array of reconstructed tracks.

Definition at line 186 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), Clear(), InitRun(), ReadEvent(), ReadRecoTracks(), and RegisterTracksContainer().

◆ fTrackingMode

ECbmCaTrackingMode cbm::ca::TimeSliceReader::fTrackingMode = ECbmCaTrackingMode::kSTS
private

Tracking mode.

Definition at line 197 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), GetTrackingMode(), InitRun(), ReadRecoTracks(), and SetTrackingMode().

◆ fvbUseDet

DetIdArr_t<bool> cbm::ca::TimeSliceReader::fvbUseDet = {{false}}
private

Flag: is detector subsystem used.

Definition at line 195 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), Clear(), InitRun(), ReadHits(), ReadRecoTracks(), and SetDetector().

◆ fvHitFirstIndexDet

std::array<int, constants::size::MaxNdetectors + 1> cbm::ca::TimeSliceReader::fvHitFirstIndexDet = {{0}}
private

First hit index in detector.

Definition at line 206 of file CbmCaTimeSliceReader.h.

Referenced by Clear(), GetHitFirstIndexDet(), GetNofHits(), and ReadHits().

◆ fvmHitExtToIntIndexMap

DetIdArr_t<std::unordered_map<int, int> > cbm::ca::TimeSliceReader::fvmHitExtToIntIndexMap
private

Hit index map ext -> int.

Definition at line 191 of file CbmCaTimeSliceReader.h.

Referenced by ReadHits(), and ReadRecoTracks().

◆ fvNofHitsTotal

DetIdArr_t<int> cbm::ca::TimeSliceReader::fvNofHitsTotal = {{0}}
private

Total hit number in detector.

Definition at line 193 of file CbmCaTimeSliceReader.h.

Referenced by ReadHits().

◆ fvNofHitsUsed

DetIdArr_t<int> cbm::ca::TimeSliceReader::fvNofHitsUsed = {{0}}
private

Number of used hits in detector.

Definition at line 194 of file CbmCaTimeSliceReader.h.

Referenced by ReadHits().

◆ fvpBrHits

DetIdArr_t<TClonesArray*> cbm::ca::TimeSliceReader::fvpBrHits = {{nullptr}}
private

Input branch for hits.

Definition at line 171 of file CbmCaTimeSliceReader.h.

Referenced by CheckInit(), Clear(), InitRun(), and ReadHits().

◆ fvpDetInterface

DetIdArr_t<const CbmTrackingDetectorInterfaceBase*> cbm::ca::TimeSliceReader::fvpDetInterface = {{nullptr}}
private

Pointers to the tracking detector interfaces for each subsystem.

Definition at line 166 of file CbmCaTimeSliceReader.h.

Referenced by InitRun().


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