CbmRoot
|
Container class for MC events with number, file and start time. More...
#include <CbmMCEventList.h>
Public Member Functions | |
CbmMCEventList () | |
Standard constructor. More... | |
virtual | ~CbmMCEventList () |
Destructor. More... | |
virtual void | Clear (Option_t *) |
Delete all event entries. More... | |
Int_t | GetEventIdByIndex (UInt_t index) |
Event number by index @value Event number for event at given index in list. More... | |
Double_t | GetEventTime (UInt_t event, UInt_t file) |
Event start time. More... | |
Double_t | GetEventTimeByIndex (UInt_t index) |
Event time by index @value Event time for event at given index in list. More... | |
Int_t | GetFileIdByIndex (UInt_t index) |
File number by index @value File number for event at given index in list. More... | |
std::size_t | GetNofEvents () const |
Number of events in the list @value Number of events. More... | |
Bool_t | Insert (UInt_t event, UInt_t file, Double_t time) |
virtual void | Print (Option_t *opt="") const |
void | Sort () |
Sort the list. More... | |
std::string | ToString (const char *option="") const |
Private Member Functions | |
Bool_t | Check () |
Check for double occurrences of events in list @value kTRUE is no double occurrences, else kFALSE. More... | |
std::vector< CbmMCEventInfo >::iterator | Find (UInt_t file, UInt_t event) |
Find an element in the list. More... | |
ClassDef (CbmMCEventList, 3) | |
Private Attributes | |
std::vector< CbmMCEventInfo > | fEvents |
Bool_t | fIsSorted |
Container class for MC events with number, file and start time.
Definition at line 38 of file CbmMCEventList.h.
CbmMCEventList::CbmMCEventList | ( | ) |
Standard constructor.
Definition at line 24 of file CbmMCEventList.cxx.
|
virtual |
Destructor.
Definition at line 30 of file CbmMCEventList.cxx.
|
private |
Check for double occurrences of events in list @value kTRUE is no double occurrences, else kFALSE.
Definition at line 35 of file CbmMCEventList.cxx.
References fEvents.
Referenced by Sort().
|
private |
|
inlinevirtual |
Delete all event entries.
Definition at line 50 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 64 of file CbmMCEventList.cxx.
References fEvents, fIsSorted, and Sort().
Referenced by GetEventTime().
Int_t CbmMCEventList::GetEventIdByIndex | ( | UInt_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 77 of file CbmMCEventList.cxx.
References fEvents, fIsSorted, GetNofEvents(), and Sort().
Referenced by CbmRichRingFinderIdeal::DoFind(), CbmTofAnaTestbeam::FillHistos(), CbmRichUrqmdTest::NofHitsAndPoints(), CbmRichUrqmdTest::PmtXYSource(), CbmRichGeoTest::ProcessMc(), CbmL1::Reconstruct(), and CbmRichUrqmdTest::Vertex().
Double_t CbmMCEventList::GetEventTime | ( | UInt_t | event, |
UInt_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 86 of file CbmMCEventList.cxx.
References fEvents, Find(), fIsSorted, and Sort().
Referenced by CbmDaq::CopyEventList(), CbmTofHitFinderTBQA::Exec(), CbmEventBuilderQA::Exec(), CbmTofAnaTestbeam::FillHistos(), CbmTofBuildDigiEvents::FillMCEventList(), CbmLitClusteringQa::FillResidualAndPullHistograms(), CbmL1::InputPerformance(), CbmRichRecoTbQa::ProcessMc(), CbmL1::ReadMCPoint(), and CbmRecoQa::record().
Double_t CbmMCEventList::GetEventTimeByIndex | ( | UInt_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 96 of file CbmMCEventList.cxx.
References fEvents, fIsSorted, GetNofEvents(), and Sort().
Referenced by CbmTofAnaTestbeam::FillHistos().
Int_t CbmMCEventList::GetFileIdByIndex | ( | UInt_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 106 of file CbmMCEventList.cxx.
References fEvents, fIsSorted, GetNofEvents(), and Sort().
Referenced by CbmRichRingFinderIdeal::DoFind(), CbmTofAnaTestbeam::FillHistos(), CbmRichUrqmdTest::NofHitsAndPoints(), CbmRichUrqmdTest::PmtXYSource(), CbmRichGeoTest::ProcessMc(), CbmL1::Reconstruct(), and CbmRichUrqmdTest::Vertex().
|
inline |
Number of events in the list @value Number of events.
Definition at line 90 of file CbmMCEventList.h.
References fEvents.
Referenced by CbmRichRingFinderIdeal::DoFind(), CbmKFParticleFinderQA::Exec(), CbmBuildEventsFromTracksIdeal::Exec(), CbmRichRecoTbQa::Exec(), CbmKFParticleFinder::Exec(), CbmEventBuilderQA::Exec(), CbmTofAnaTestbeam::FillHistos(), GetEventIdByIndex(), GetEventTimeByIndex(), GetFileIdByIndex(), CbmRichUrqmdTest::NofHitsAndPoints(), CbmRichUrqmdTest::PmtXYSource(), CbmRichGeoTest::ProcessMc(), CbmL1::Reconstruct(), ToString(), and CbmRichUrqmdTest::Vertex().
Bool_t CbmMCEventList::Insert | ( | UInt_t | event, |
UInt_t | file, | ||
Double_t | 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 kFALSE if (file, event) is already in the list. Else kTRUE. |
If the event from the given file is already in the list, the list will not be modified and kFALSE is returned.
Negative event times are not allowed. In that case, kFALSE is returned and the list will not be modified.
Definition at line 116 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 133 of file CbmMCEventList.cxx.
References Check(), fEvents, and fIsSorted.
Referenced by CbmDaq::CloseTimeSlice(), CbmTofBuildDigiEvents::FillMCEventList(), Find(), GetEventIdByIndex(), GetEventTime(), GetEventTimeByIndex(), and GetFileIdByIndex().
string CbmMCEventList::ToString | ( | const char * | option = "" | ) | const |
Status to string
Definition at line 143 of file CbmMCEventList.cxx.
References fEvents, and GetNofEvents().
Referenced by CbmDaq::Finish(), and Print().
|
private |
Event container
Definition at line 128 of file CbmMCEventList.h.
Referenced by Check(), Clear(), Find(), GetEventIdByIndex(), GetEventTime(), GetEventTimeByIndex(), GetFileIdByIndex(), GetNofEvents(), Insert(), Sort(), and ToString().
|
private |
Flag whether list has been sorted
Definition at line 131 of file CbmMCEventList.h.
Referenced by Find(), GetEventIdByIndex(), GetEventTime(), GetEventTimeByIndex(), GetFileIdByIndex(), Insert(), and Sort().