CbmRoot
Loading...
Searching...
No Matches
CbmMCInputSet.h
Go to the documentation of this file.
1
/* Copyright (C) 2018-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Volker Friese [committer] */
4
10
#ifndef CBMMCINPUTSET_H
11
#define CBMMCINPUTSET_H 1
12
13
#include "
CbmDefs.h
"
14
#include "
CbmMCInput.h
"
15
16
#include "TF1.h"
17
#include "TObject.h"
18
19
#include <map>
20
#include <set>
21
#include <utility>
22
23
#include "
Defs.h
"
24
25
42
class
CbmMCInputSet
:
public
TObject {
43
44
public
:
46
CbmMCInputSet
();
47
48
52
CbmMCInputSet
(
cbm::sim::TimeDist
dist, Double_t rate);
53
54
56
virtual
~CbmMCInputSet
();
57
58
65
virtual
Bool_t
ActivateObject
(TObject**
object
,
const
char
* branchName);
66
67
72
void
AddInput
(UInt_t inputId, TChain* chain,
ECbmTreeAccess
mode =
ECbmTreeAccess::kRegular
);
73
74
78
const
std::set<TString>&
GetBranchList
()
const
{
return
fBranches
; }
79
80
89
Double_t
GetDeltaT
();
90
91
97
std::pair<UInt_t, CbmMCInput*>
GetFirstInput
()
98
{
99
return
(
fInputs
.empty() ? std::make_pair(-1,
nullptr
)
100
: std::make_pair(
fInputs
.begin()->first,
fInputs
.begin()->second));
101
}
102
103
108
CbmMCInput
*
GetInput
(UInt_t
id
) {
return
(
fInputs
.find(
id
) ==
fInputs
.end() ?
nullptr
:
fInputs
[
id
]); }
109
110
120
Int_t
GetMaxNofEvents
()
const
;
121
122
132
std::tuple<Bool_t, UInt_t, Int_t>
GetNextEntry
();
133
134
138
Double_t
GetEventRate
()
const
{
return
fEventRate
; }
139
140
142
void
RegisterChains
();
143
144
145
private
:
146
cbm::sim::TimeDist
fTimeDist
=
cbm::sim::TimeDist::Poisson
;
// Event time distribution model
147
Double_t
fEventRate
;
// Event rate [1/s]
148
std::map<UInt_t, CbmMCInput*>
fInputs
;
// Key is input ID
149
std::map<UInt_t, CbmMCInput*>::iterator
fInputHandle
;
// Handle for inputs
150
std::set<TString>
fBranches
;
// List of branch names
151
TF1*
fDeltaDist
;
// Probability distribution for delta(t)
152
153
163
Bool_t
CheckBranchList
(
CbmMCInput
* input);
164
165
166
ClassDef
(
CbmMCInputSet
, 1);
167
};
168
169
#endif
/* CBMMCINPUT_H */
CbmDefs.h
ECbmTreeAccess
ECbmTreeAccess
Mode to read entries from a ROOT TTree.
Definition
CbmDefs.h:152
ECbmTreeAccess::kRegular
@ kRegular
CbmMCInput.h
Defs.h
Int_t
int Int_t
Definition
RootTypesDef.h:16
Bool_t
bool Bool_t
Definition
RootTypesDef.h:15
CbmMCInputSet
A MC transport input to digitisation in CBM.
Definition
CbmMCInputSet.h:42
CbmMCInputSet::fDeltaDist
TF1 * fDeltaDist
Definition
CbmMCInputSet.h:151
CbmMCInputSet::ClassDef
ClassDef(CbmMCInputSet, 1)
CbmMCInputSet::GetFirstInput
std::pair< UInt_t, CbmMCInput * > GetFirstInput()
Accessor to first input @value ID and Pointer to first CbmMCInput object.
Definition
CbmMCInputSet.h:97
CbmMCInputSet::GetDeltaT
Double_t GetDeltaT()
Time difference to next event @value Time difference to next event [ns].
Definition
CbmMCInputSet.cxx:144
CbmMCInputSet::AddInput
void AddInput(UInt_t inputId, TChain *chain, ECbmTreeAccess mode=ECbmTreeAccess::kRegular)
Add an input to the set.
Definition
CbmMCInputSet.cxx:74
CbmMCInputSet::~CbmMCInputSet
virtual ~CbmMCInputSet()
Destructor.
Definition
CbmMCInputSet.cxx:47
CbmMCInputSet::GetEventRate
Double_t GetEventRate() const
Event rate @value Event rate [1/s].
Definition
CbmMCInputSet.h:138
CbmMCInputSet::GetNextEntry
std::tuple< Bool_t, UInt_t, Int_t > GetNextEntry()
Get the next entry from the inputs @value Status tuple.
Definition
CbmMCInputSet.cxx:186
CbmMCInputSet::RegisterChains
void RegisterChains()
register all input chains to the FairRootManager
Definition
CbmMCInputSet.cxx:210
CbmMCInputSet::fTimeDist
cbm::sim::TimeDist fTimeDist
Definition
CbmMCInputSet.h:146
CbmMCInputSet::CheckBranchList
Bool_t CheckBranchList(CbmMCInput *input)
Compare an input branch list with the reference branch list.
Definition
CbmMCInputSet.cxx:111
CbmMCInputSet::ActivateObject
virtual Bool_t ActivateObject(TObject **object, const char *branchName)
Activate and connect all input chains.
Definition
CbmMCInputSet.cxx:57
CbmMCInputSet::fBranches
std::set< TString > fBranches
Definition
CbmMCInputSet.h:150
CbmMCInputSet::GetInput
CbmMCInput * GetInput(UInt_t id)
Accessor to input.
Definition
CbmMCInputSet.h:108
CbmMCInputSet::GetMaxNofEvents
Int_t GetMaxNofEvents() const
Maximal number of events to be read from the input set @value Maximal number of events.
Definition
CbmMCInputSet.cxx:166
CbmMCInputSet::CbmMCInputSet
CbmMCInputSet()
Default constructor.
Definition
CbmMCInputSet.cxx:21
CbmMCInputSet::fInputHandle
std::map< UInt_t, CbmMCInput * >::iterator fInputHandle
Definition
CbmMCInputSet.h:149
CbmMCInputSet::GetBranchList
const std::set< TString > & GetBranchList() const
List of branches @value Reference to branch list.
Definition
CbmMCInputSet.h:78
CbmMCInputSet::fEventRate
Double_t fEventRate
Definition
CbmMCInputSet.h:147
CbmMCInputSet::fInputs
std::map< UInt_t, CbmMCInput * > fInputs
Definition
CbmMCInputSet.h:148
CbmMCInput
An MC (transport) input to digitisation in CBM.
Definition
CbmMCInput.h:33
cbm::sim::TimeDist
TimeDist
Definition
Defs.h:29
cbm::sim::TimeDist::Poisson
@ Poisson
sim
response
base
CbmMCInputSet.h
Generated on Fri Mar 7 2025 23:04:19 for CbmRoot by
1.12.0