CbmRoot
|
Container class for MC events with number, file and start time. More...
#include <CbmMCEventList.h>
Public Member Functions | |
CbmMCEventList () | |
Standard constructor. | |
virtual | ~CbmMCEventList () |
Destructor. | |
virtual void | Clear (Option_t *) |
Delete all event entries. | |
int32_t | GetEventIdByIndex (uint32_t index) |
Event number by index @value Event number for event at given index in list. | |
double | GetEventTime (uint32_t event, uint32_t file) |
Event start time. | |
Double_t | GetEventTime (const CbmLink &link) |
Event start time. | |
double | GetEventTimeByIndex (uint32_t index) |
Event time by index @value Event time for event at given index in list. | |
int32_t | GetFileIdByIndex (uint32_t index) |
File number by index @value File number for event at given index in list. | |
Int_t | GetEventIndex (UInt_t event, UInt_t file) |
Event index. | |
Int_t | GetEventIndex (const CbmLink &link) |
Event index. | |
CbmLink | GetEventLinkByIndex (uint32_t index) |
Event file and event indices as CbmLink. | |
std::size_t | GetNofEvents () const |
Number of events in the list @value Number of events. | |
bool | Insert (uint32_t event, uint32_t file, double time) |
virtual void | Print (Option_t *opt="") const |
void | Sort () |
Sort the list. | |
std::string | ToString (const char *option="") const |
Private Member Functions | |
bool | Check () |
Check for double occurrences of events in list @value true is no double occurrences, else false. | |
std::vector< CbmMCEventInfo >::iterator | Find (uint32_t file, uint32_t event) |
Find an element in the list. | |
ClassDef (CbmMCEventList, 3) | |
Private Attributes | |
std::vector< CbmMCEventInfo > | fEvents |
bool | fIsSorted |
Container class for MC events with number, file and start time.
Definition at line 43 of file CbmMCEventList.h.
CbmMCEventList::CbmMCEventList | ( | ) |
Standard constructor.
Definition at line 28 of file CbmMCEventList.cxx.
|
virtual |
Destructor.
Definition at line 33 of file CbmMCEventList.cxx.
|
private |
Check for double occurrences of events in list @value true is no double occurrences, else false.
Definition at line 38 of file CbmMCEventList.cxx.
References fEvents.
Referenced by Sort().
|
private |
|
inlinevirtual |
Delete all event entries.
Definition at line 55 of file CbmMCEventList.h.
References fEvents.
Referenced by CbmTofBuildDigiEvents::Exec(), CbmTofBuildDigiEvents::ProcessIdealEvents(), and CbmDaq::StartNextTimeSlice().
|
private |
Find an element in the list.
file | Input file ID |
event | MC event number (index) |
Definition at line 67 of file CbmMCEventList.cxx.
References fEvents, fIsSorted, and Sort().
Referenced by GetEventIndex(), and GetEventTime().
int32_t CbmMCEventList::GetEventIdByIndex | ( | uint32_t | index | ) |
Event number by index @value Event number for event at given index in list.
Returns -1 if the index is out of bounds.
Definition at line 79 of file CbmMCEventList.cxx.
References fEvents, fIsSorted, GetNofEvents(), and Sort().
Referenced by CbmCaInputQaTof::ExecQa(), cbm::ca::InputQaSetup::FillHistogramsDet(), CbmTofAnaTestbeam::FillHistos(), CbmSeedFinderSlidingWindow::FillSeedTimes(), cbm::ca::MCModule::InitEvent(), CbmRichUrqmdTest::NofHitsAndPoints(), CbmRichUrqmdTest::PmtXYSource(), CbmRichGeoTest::ProcessMc(), CbmTrdCalibTracker::ResolutionQa(), and CbmRichUrqmdTest::Vertex().
|
inline |
Event index.
Definition at line 106 of file CbmMCEventList.h.
References CbmLink::GetEntry(), GetEventIndex(), and CbmLink::GetFile().
Referenced by GetEventIndex().
Int_t CbmMCEventList::GetEventIndex | ( | UInt_t | event, |
UInt_t | file ) |
Event index.
event | MC event number |
file | MC input file number @value eventindex in list |
Returns -1. if the event is not present in the list.
Definition at line 100 of file CbmMCEventList.cxx.
References fEvents, Find(), fIsSorted, and Sort().
Referenced by CbmKFParticleFinder::Exec(), CbmKFParticleFinderQa::Exec(), CbmSeedFinderQa::FillQaMCInfo(), and CbmTrdCalibTracker::ResolutionQa().
CbmLink CbmMCEventList::GetEventLinkByIndex | ( | uint32_t | index | ) |
Event file and event indices as CbmLink.
Definition at line 132 of file CbmMCEventList.cxx.
References fEvents, fIsSorted, GetNofEvents(), and Sort().
Referenced by CbmKFParticleFinder::Exec(), and CbmKFParticleFinderQa::Exec().
|
inline |
Event start time.
link | link to the MC event |
Definition at line 78 of file CbmMCEventList.h.
References CbmLink::GetEntry(), GetEventTime(), and CbmLink::GetFile().
Referenced by GetEventTime().
double CbmMCEventList::GetEventTime | ( | uint32_t | event, |
uint32_t | file ) |
Event start time.
event | MC event number |
file | MC input file number @value MC event start time [ns] |
Returns -1. if the event is not present in the list.
Definition at line 89 of file CbmMCEventList.cxx.
References fEvents, Find(), fIsSorted, and Sort().
Referenced by CbmDaq::CopyEventList(), CbmEventBuilderQa::Exec(), CbmKFTrackQa::Exec(), CbmTofHitFinderTBQa::Exec(), CbmTofAnaTestbeam::FillHistos(), CbmTofBuildDigiEvents::FillMCEventList(), cbm::ca::MCModule::FillMCPoint(), CbmSeedFinderQa::FillQaMCInfo(), CbmSeedFinderQa::FillQaSeedInfo(), CbmLitClusteringQa::FillResidualAndPullHistograms(), CbmSimEventHeaderConverter::ProcessData(), CbmRichRecoTbQa::ProcessMc(), cbm::ca::MCModule::ReadMCTracks(), CbmRecoQa::record(), and CbmTrdCalibTracker::ResolutionQa().
double CbmMCEventList::GetEventTimeByIndex | ( | uint32_t | index | ) |
Event time by index @value Event time for event at given index in list.
Returns -1. if the index is out of bounds.
Definition at line 111 of file CbmMCEventList.cxx.
References fEvents, fIsSorted, GetNofEvents(), and Sort().
Referenced by CbmTofAnaTestbeam::FillHistos(), CbmSeedFinderQa::FillQaMCInfo(), and CbmSeedFinderSlidingWindow::FillSeedTimes().
int32_t CbmMCEventList::GetFileIdByIndex | ( | uint32_t | index | ) |
File number by index @value File number for event at given index in list.
Returns -1 if the index is out of bounds.
Definition at line 122 of file CbmMCEventList.cxx.
References fEvents, fIsSorted, GetNofEvents(), and Sort().
Referenced by CbmCaInputQaTof::ExecQa(), cbm::ca::InputQaSetup::FillHistogramsDet(), CbmTofAnaTestbeam::FillHistos(), CbmSeedFinderSlidingWindow::FillSeedTimes(), cbm::ca::MCModule::InitEvent(), CbmRichUrqmdTest::NofHitsAndPoints(), CbmRichUrqmdTest::PmtXYSource(), CbmRichGeoTest::ProcessMc(), CbmTrdCalibTracker::ResolutionQa(), and CbmRichUrqmdTest::Vertex().
|
inline |
Number of events in the list @value Number of events.
Definition at line 116 of file CbmMCEventList.h.
References fEvents.
Referenced by CbmBuildEventsFromTracksIdeal::Exec(), CbmEventBuilderQa::Exec(), CbmKFParticleFinder::Exec(), CbmKFParticleFinderQa::Exec(), CbmRichRecoTbQa::Exec(), CbmCaInputQaTof::ExecQa(), cbm::ca::InputQaSetup::FillHistogramsDet(), CbmTofAnaTestbeam::FillHistos(), CbmSeedFinderQa::FillQaMCInfo(), CbmSeedFinderSlidingWindow::FillSeedTimes(), GetEventIdByIndex(), GetEventLinkByIndex(), GetEventTimeByIndex(), GetFileIdByIndex(), cbm::ca::MCModule::InitEvent(), CbmRichUrqmdTest::NofHitsAndPoints(), CbmRichUrqmdTest::PmtXYSource(), CbmRichGeoTest::ProcessMc(), CbmTrdCalibTracker::ResolutionQa(), ToString(), and CbmRichUrqmdTest::Vertex().
bool CbmMCEventList::Insert | ( | uint32_t | event, |
uint32_t | file, | ||
double | time ) |
Insert an event with its start time into the event list
event | MC event number |
file | MC input file number |
time | MC event start time [ns] @value false if (file, event) is already in the list. Else true. |
If the event from the given file is already in the list, the list will not be modified and false is returned.
Negative event times are not allowed. In that case, false is returned and the list will not be modified.
Definition at line 142 of file CbmMCEventList.cxx.
References fEvents, and fIsSorted.
Referenced by CbmDaq::CopyEventList(), CbmDaq::Exec(), and CbmTofBuildDigiEvents::FillMCEventList().
|
virtual |
void CbmMCEventList::Sort | ( | ) |
Sort the list.
The sorting uses the comparison operator of std::tuple, i.e. the list is first sorted w.r.t. fileId, then w.r.t. the event Id. Double occurrences of a pair (fileId, eventId) will throw an exception.
Definition at line 158 of file CbmMCEventList.cxx.
References Check(), fEvents, and fIsSorted.
Referenced by CbmDaq::CloseTimeSlice(), CbmTofBuildDigiEvents::FillMCEventList(), Find(), GetEventIdByIndex(), GetEventIndex(), GetEventLinkByIndex(), GetEventTime(), GetEventTimeByIndex(), and GetFileIdByIndex().
string CbmMCEventList::ToString | ( | const char * | option = "" | ) | const |
Status to string
Definition at line 169 of file CbmMCEventList.cxx.
References fEvents, GetNofEvents(), and ToString().
Referenced by CbmDaq::Finish(), Print(), and ToString().
|
private |
Event container
Definition at line 154 of file CbmMCEventList.h.
Referenced by Check(), Clear(), Find(), GetEventIdByIndex(), GetEventIndex(), GetEventLinkByIndex(), GetEventTime(), GetEventTimeByIndex(), GetFileIdByIndex(), GetNofEvents(), Insert(), Sort(), and ToString().
|
private |
Flag whether list has been sorted
Definition at line 157 of file CbmMCEventList.h.
Referenced by Find(), GetEventIdByIndex(), GetEventIndex(), GetEventLinkByIndex(), GetEventTime(), GetEventTimeByIndex(), GetFileIdByIndex(), Insert(), and Sort().