CbmRoot
|
A MC transport input to digitisation in CBM. More...
#include <CbmMCInputSet.h>
Public Member Functions | |
CbmMCInputSet () | |
Default constructor. More... | |
CbmMCInputSet (Double_t rate) | |
Constructor. More... | |
virtual | ~CbmMCInputSet () |
Destructor. More... | |
virtual Bool_t | ActivateObject (TObject **object, const char *branchName) |
Activate and connect all input chains. More... | |
void | AddInput (UInt_t inputId, TChain *chain, ECbmTreeAccess mode=ECbmTreeAccess::kRegular) |
Add an input to the set. More... | |
const std::set< TString > & | GetBranchList () const |
List of branches @value Reference to branch list. More... | |
Double_t | GetDeltaT () |
Time difference to next event @value Time difference to next event [ns]. More... | |
std::pair< UInt_t, CbmMCInput * > | GetFirstInput () |
Accessor to first input @value ID and Pointer to first CbmMCInput object. More... | |
CbmMCInput * | GetInput (UInt_t id) |
Accessor to input. More... | |
Int_t | GetMaxNofEvents () const |
Maximal number of events to be read from the input set @value Maximal number of events. More... | |
std::tuple< Bool_t, UInt_t, Int_t > | GetNextEntry () |
Get the next entry from the inputs @value Status tuple. More... | |
Double_t | GetRate () const |
Event rate @value Event rate [1/s]. More... | |
void | RegisterChains () |
register all input chains to the FairRootManager More... | |
Private Member Functions | |
Bool_t | CheckBranchList (CbmMCInput *input) |
Compare an input branch list with the reference branch list. More... | |
ClassDef (CbmMCInputSet, 1) | |
Private Attributes | |
Double_t | fRate |
std::map< UInt_t, CbmMCInput * > | fInputs |
std::map< UInt_t, CbmMCInput * >::iterator | fInputHandle |
std::set< TString > | fBranches |
TF1 * | fDeltaDist |
A MC transport input to digitisation in CBM.
The input set consists of one or several single inputs (class CbmMCInput). Subsequent calls to GetNextEntry() will subsequently call CbmMCInput::GetNextEntry(), until all inputs were used once, after which GetNextEntry() will return kTRUE.
Definition at line 34 of file CbmMCInputSet.h.
CbmMCInputSet::CbmMCInputSet | ( | ) |
Default constructor.
Definition at line 14 of file CbmMCInputSet.cxx.
CbmMCInputSet::CbmMCInputSet | ( | Double_t | rate | ) |
Constructor.
rate | Event rate [1/s]. Must be positive. |
Definition at line 19 of file CbmMCInputSet.cxx.
References fDeltaDist, fInputHandle, and fInputs.
|
virtual |
|
virtual |
Activate and connect all input chains.
object | Pointer to pointer to branch class |
branchName | Name of branch |
All input trees have to be connected to the argument object.
Definition at line 47 of file CbmMCInputSet.cxx.
References fInputs, and CbmMCInput::GetChain().
void CbmMCInputSet::AddInput | ( | UInt_t | inputId, |
TChain * | chain, | ||
ECbmTreeAccess | mode = ECbmTreeAccess::kRegular |
||
) |
Add an input to the set.
inputId | Unique input identifier |
input | Pointer to CbmMCInput object |
Definition at line 63 of file CbmMCInputSet.cxx.
References CheckBranchList(), fBranches, fInputHandle, fInputs, and CbmMCInput::GetBranchList().
Referenced by CbmDigitizationSource::AddInput().
|
private |
Compare an input branch list with the reference branch list.
input | Pointer to CbmMCInput object @value kTRUE if the branch list of the input is compatible |
The branch list of the input is considered compatible if all branches of the global list are present in the input. Additional branches in the input are not considered harmful. The reference branch list is defined by the first input.
Definition at line 103 of file CbmMCInputSet.cxx.
References fBranches, and CbmMCInput::GetBranchList().
Referenced by AddInput().
|
private |
|
inline |
List of branches @value Reference to branch list.
Definition at line 72 of file CbmMCInputSet.h.
References fBranches.
Referenced by CbmDigitizationSource::AddInput(), and CbmDigitizationSource::CheckBranchList().
Double_t CbmMCInputSet::GetDeltaT | ( | ) |
Time difference to next event @value Time difference to next event [ns].
This method samples from the probability distribution for the time difference between two subsequent events, assuming a Poisson process (exponential distribution). The return value is zero if the rate was specified to be non-positive.
Definition at line 136 of file CbmMCInputSet.cxx.
References fDeltaDist.
Referenced by CbmDigitizationSource::Init(), and CbmDigitizationSource::ReadEvent().
|
inline |
Accessor to first input @value ID and Pointer to first CbmMCInput object.
Returns -1 for the ID and a null pointer if no input is connected.
Definition at line 91 of file CbmMCInputSet.h.
References fInputs.
|
inline |
Accessor to input.
id | Unique input identifier @value Pointer to CbmMCInput object. Null if ID is not used. |
Definition at line 102 of file CbmMCInputSet.h.
References fInputs.
Int_t CbmMCInputSet::GetMaxNofEvents | ( | ) | const |
Maximal number of events to be read from the input set @value Maximal number of events.
If there is at least one limited input (mode = kRegular), the return value is the number of inputs times the minimal event number from all inputs. This reflects the fact that all inputs are read sequentially. If all inputs are unlimited (kRepeat or kRandom), the return value is -1.
Definition at line 144 of file CbmMCInputSet.cxx.
References fInputs.
std::tuple< Bool_t, UInt_t, Int_t > CbmMCInputSet::GetNextEntry | ( | ) |
Get the next entry from the inputs @value Status tuple.
The return tuple consists of: Flag whether the used input is the last one in the set ID of the used input Entry number from the used input. If -1, the end of this input was reached.
Definition at line 164 of file CbmMCInputSet.cxx.
References fInputHandle, and fInputs.
Referenced by CbmDigitizationSource::ReadEvent().
|
inline |
Event rate @value Event rate [1/s].
Definition at line 134 of file CbmMCInputSet.h.
References fRate.
void CbmMCInputSet::RegisterChains | ( | ) |
register all input chains to the FairRootManager
Definition at line 187 of file CbmMCInputSet.cxx.
References fInputs.
|
private |
Definition at line 145 of file CbmMCInputSet.h.
Referenced by AddInput(), CheckBranchList(), and GetBranchList().
|
private |
Definition at line 146 of file CbmMCInputSet.h.
Referenced by CbmMCInputSet(), GetDeltaT(), and ~CbmMCInputSet().
|
private |
Definition at line 144 of file CbmMCInputSet.h.
Referenced by AddInput(), CbmMCInputSet(), and GetNextEntry().
|
private |
Definition at line 143 of file CbmMCInputSet.h.
Referenced by ActivateObject(), AddInput(), CbmMCInputSet(), GetFirstInput(), GetInput(), GetMaxNofEvents(), GetNextEntry(), RegisterChains(), and ~CbmMCInputSet().
|
private |
Definition at line 142 of file CbmMCInputSet.h.
Referenced by GetRate().