CbmRoot
|
A reader of time slice for CA tracker. More...
#include <CbmCaTimeSliceReader.h>
Public Member Functions | |
TimeSliceReader ()=default | |
Constructor from parameters. | |
~TimeSliceReader ()=default | |
Destructor. | |
TimeSliceReader (const TimeSliceReader &)=delete | |
Copy constructor. | |
TimeSliceReader (TimeSliceReader &&)=delete | |
Move constructor. | |
TimeSliceReader & | operator= (const TimeSliceReader &)=delete |
Copy assignment operator. | |
TimeSliceReader & | operator= (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. | |
CbmEvent * | fpEvent = 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::DataManager > | fpIODataManager = 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. | |
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.
|
default |
Constructor from parameters.
mode | Tracking mode |
|
default |
Destructor.
|
delete |
Copy constructor.
|
delete |
Move constructor.
|
private |
Check class initialization.
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().
void TimeSliceReader::Clear | ( | ) |
Clears class content.
Definition at line 37 of file CbmCaTimeSliceReader.cxx.
References fFirstHitKey, fNofHitKeys, fNofHits, fpBrMuchTracks, fpBrRecoTracks, fpBrStsTracks, fpBrTofTracks, fpBrTrdTracks, fpIODataManager, fpParameters, fpvHitIds, fpvQaHits, fpvTracks, fvbUseDet, fvHitFirstIndexDet, and fvpBrHits.
|
inline |
Gets reference to container of first hit indexes in a detector subsystem.
Definition at line 75 of file CbmCaTimeSliceReader.h.
References fvHitFirstIndexDet.
|
inline |
Gets number of hits stored for a given detector.
iDet | Detector ID |
Definition at line 80 of file CbmCaTimeSliceReader.h.
References fvHitFirstIndexDet.
|
inline |
Gets CBM tracking mode.
Definition at line 86 of file CbmCaTimeSliceReader.h.
References fTrackingMode.
bool TimeSliceReader::InitRun | ( | ) |
Run initializer function.
Initializes data branches and provides necessary checks in the beginning of the run
Definition at line 117 of file CbmCaTimeSliceReader.cxx.
References CheckInit(), cbm::algo::ca::constants::clrs::CL, fpBrMuchTracks, fpBrRecoTracks, fpBrStsTracks, fpBrTofTracks, fpBrTrdTracks, fpvTracks, fTrackingMode, fvbUseDet, fvpBrHits, fvpDetInterface, cbm::algo::ca::constants::clrs::GNb, CbmMuchTrackingInterface::Instance(), CbmMvdTrackingInterface::Instance(), CbmStsTrackingInterface::Instance(), CbmTofTrackingInterface::Instance(), CbmTrdTrackingInterface::Instance(), kMCBM, and kSTS.
|
delete |
Copy assignment operator.
|
delete |
Move assignment operator.
void TimeSliceReader::ReadEvent | ( | CbmEvent * | pEvent = nullptr | ) |
Reads time slice.
pEvent | A 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().
|
private |
Reads hits.
Definition at line 470 of file CbmCaTimeSliceReader.cxx.
References fbSortQaHits, fFirstHitKey, fNofHitKeys, fNofHits, fpEvent, fpIODataManager, fpvHitIds, fpvQaHits, fvbUseDet, fvHitFirstIndexDet, fvmHitExtToIntIndexMap, fvNofHitsTotal, fvNofHitsUsed, fvpBrHits, CbmEvent::GetNofData(), cbm::ca::kCbmHitType, ReadHitsForDetector(), cbm::algo::ca::Vector< T >::reserve(), and SortQaHits().
Referenced by ReadEvent().
|
private |
Reads hits for a given detector subsystem.
Detector | ID |
Definition at line 359 of file CbmCaTimeSliceReader.cxx.
References cbm::ca::tools::HitRecord::Accept(), 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, 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, CbmL1::GetDetectorName(), CbmTofAddress::GetSmType(), cbm::algo::ca::Station< DataT >::GetXmax(), cbm::algo::ca::Station< DataT >::GetXmin(), cbm::algo::ca::Station< DataT >::GetYmax(), cbm::algo::ca::Station< DataT >::GetYmin(), cbm::algo::ca::Station< DataT >::GetZ(), cbm::ca::kCbmHitType, and cbm::ca::tools::HitRecord::ToString().
Referenced by ReadHits().
|
private |
Reads reconstructed tracks.
Definition at line 206 of file CbmCaTimeSliceReader.cxx.
References cbm::kf::ConvertTrackParam(), fpBrMuchTracks, fpBrRecoTracks, fpBrStsTracks, fpBrTofTracks, fpBrTrdTracks, fpEvent, fpvTracks, fTrackingMode, fvbUseDet, fvmHitExtToIntIndexMap, CbmEvent::GetIndex(), CbmEvent::GetNofData(), kGlobalTrack, kMCBM, kSTS, kStsTrack, and cbm::algo::ca::Vector< T >::reset().
Referenced by ReadEvent().
|
inline |
Registers hit index container.
vHitIds | Reference to hits indexes container |
Definition at line 108 of file CbmCaTimeSliceReader.h.
References fpvHitIds.
void TimeSliceReader::RegisterIODataManager | ( | std::shared_ptr< ca::DataManager > & | ioDataManager | ) |
Registers the CA IO data manager instance.
pIODataManager | Shared pointer to the IO data manager instance |
Definition at line 324 of file CbmCaTimeSliceReader.cxx.
References fpIODataManager.
|
inline |
Registers CA parameters object.
pParameters | A shared pointer to the parameters object |
Definition at line 112 of file CbmCaTimeSliceReader.h.
References fpParameters.
|
inline |
Registers hit debug info container.
vQaHits | Reference to Qa hit container |
Definition at line 103 of file CbmCaTimeSliceReader.h.
References fpvQaHits.
|
inline |
Register the reconstructed tracks container.
vTracks | Reference to reconstructed tracks container |
Definition at line 122 of file CbmCaTimeSliceReader.h.
References fpvTracks.
|
inline |
Sets used detector subsystems.
detID | Id of detector |
flag | Flag: true - detector is used |
Definition at line 128 of file CbmCaTimeSliceReader.h.
References fvbUseDet.
|
inline |
Sets flag to additionally sort QA hits by stations.
doSortQaHits | true: hits are sorted |
Definition at line 136 of file CbmCaTimeSliceReader.h.
References fbSortQaHits.
|
inline |
Sets the tracking mode.
mode | Tracking mode (from ECbmTrackingMode) |
Definition at line 132 of file CbmCaTimeSliceReader.h.
References fTrackingMode.
|
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().
|
private |
Saves hit to data structures.
hitRecord | Filled 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.
|
private |
Flag, if the QA hits must be sorted after reading.
Definition at line 199 of file CbmCaTimeSliceReader.h.
Referenced by ReadHits(), and SetSortQaHits().
|
private |
First index of hit key for the detector subsystem.
Definition at line 204 of file CbmCaTimeSliceReader.h.
Referenced by Clear(), and ReadHits().
|
private |
Recorded number of hit keys.
Definition at line 203 of file CbmCaTimeSliceReader.h.
Referenced by Clear(), and ReadHits().
|
private |
Stored number of hits.
Definition at line 202 of file CbmCaTimeSliceReader.h.
Referenced by Clear(), and ReadHits().
|
private |
Input branch for reconstructed MuCh tracks ("MuchTrack")
Definition at line 179 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), Clear(), InitRun(), and ReadRecoTracks().
|
private |
Input branch for reconstructed tracks ("GlobalTrack", "StsTrack")
Definition at line 177 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), Clear(), InitRun(), and ReadRecoTracks().
|
private |
Input branch for reconstructed STS tracks ("StsTrack")
Definition at line 178 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), Clear(), InitRun(), and ReadRecoTracks().
|
private |
Input branch for reconstructed TOF tracks ("TofTrack")
Definition at line 181 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), Clear(), InitRun(), and ReadRecoTracks().
|
private |
Input branch for reconstructed TRD tracks ("TrdTrack")
Definition at line 180 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), Clear(), InitRun(), and ReadRecoTracks().
|
private |
Pointer to the event object.
Definition at line 170 of file CbmCaTimeSliceReader.h.
Referenced by ReadEvent(), ReadHits(), and ReadRecoTracks().
|
private |
Pointer to input data manager.
Definition at line 187 of file CbmCaTimeSliceReader.h.
Referenced by Clear(), ReadHits(), RegisterIODataManager(), and StoreHitRecord().
|
private |
Pointer to tracking parameters object.
Definition at line 188 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), Clear(), RegisterParameters(), and SortQaHits().
|
private |
Pointer to array of hit index objects.
Definition at line 184 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), Clear(), ReadHits(), RegisterHitIndexContainer(), and StoreHitRecord().
|
private |
Pointer to array of debug hits.
Definition at line 185 of file CbmCaTimeSliceReader.h.
Referenced by Clear(), ReadHits(), RegisterQaHitContainer(), SortQaHits(), and StoreHitRecord().
|
private |
Pointer to array of reconstructed tracks.
Definition at line 186 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), Clear(), InitRun(), ReadEvent(), ReadRecoTracks(), and RegisterTracksContainer().
|
private |
Tracking mode.
Definition at line 197 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), GetTrackingMode(), InitRun(), ReadRecoTracks(), and SetTrackingMode().
|
private |
Flag: is detector subsystem used.
Definition at line 195 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), Clear(), InitRun(), ReadHits(), ReadRecoTracks(), and SetDetector().
|
private |
First hit index in detector.
Definition at line 206 of file CbmCaTimeSliceReader.h.
Referenced by Clear(), GetHitFirstIndexDet(), GetNofHits(), and ReadHits().
|
private |
Hit index map ext -> int.
Definition at line 191 of file CbmCaTimeSliceReader.h.
Referenced by ReadHits(), and ReadRecoTracks().
|
private |
Total hit number in detector.
Definition at line 193 of file CbmCaTimeSliceReader.h.
Referenced by ReadHits().
|
private |
Number of used hits in detector.
Definition at line 194 of file CbmCaTimeSliceReader.h.
Referenced by ReadHits().
|
private |
Input branch for hits.
Definition at line 171 of file CbmCaTimeSliceReader.h.
Referenced by CheckInit(), Clear(), InitRun(), and ReadHits().
|
private |
Pointers to the tracking detector interfaces for each subsystem.
Definition at line 166 of file CbmCaTimeSliceReader.h.
Referenced by InitRun().