CbmRoot
|
#include <CbmDigitization.h>
Public Member Functions | |
CbmDigitization () | |
Constructor. More... | |
virtual | ~CbmDigitization () |
Destructor More... | |
void | AddInput (UInt_t inputId, TString fileName, Double_t eventRate=-1., ECbmTreeAccess mode=ECbmTreeAccess::kRegular) |
Add an input file. More... | |
void | AddInput (TString fileName, Double_t eventRate=-1., ECbmTreeAccess mode=ECbmTreeAccess::kRegular) |
Add an input file. More... | |
Bool_t | AddParameterAsciiFile (TString fileName) |
Add an ASCII parameter file. More... | |
void | Deactivate (ECbmModuleId system) |
Deactivate a system for digitisation. More... | |
void | DeactivateAllBut (ECbmModuleId system) |
Deactivate all systems except the specified one. More... | |
void | EmbedInput (UInt_t inputId, TString fileName, UInt_t targetInputId, ECbmTreeAccess mode=ECbmTreeAccess::kRegular) |
Embed an input file into another one. More... | |
void | GenerateRunInfo (Bool_t choice=kTRUE) |
Write run info (default is kTRUE) More... | |
void | DefaultInit () |
Initialize the branches, digitizers and parameter files With default values. More... | |
void | Run () |
Process all events from input. More... | |
void | Run (Int_t nEvents) |
Process nEvents from input, starting with the first event. More... | |
void | Run (Int_t event1, Int_t event2) |
Process input from event1 to event2. More... | |
void | SetCreateMatches (Bool_t choice=kTRUE) |
Set creation of links to MC. More... | |
void | SetDigitizer (ECbmModuleId system, CbmDigitizeBase *digitizer, TString branch="", Bool_t persistent=kTRUE) |
Set a digitizer explicitly. More... | |
void | SetEventMode (Bool_t choice=kTRUE) |
Set event-by-event mode. More... | |
void | SetMonitorFile (const char *fileName) |
Set the monitor file name. More... | |
void | SetOutputFile (TString fileName, Bool_t overwrite=kFALSE) |
Set the output file name. More... | |
void | SetParameterRootFile (TString fileName) |
Set the parameter file name. More... | |
void | SetProduceNoise (Bool_t choice=kTRUE) |
Set production of inter-event noise. More... | |
void | SetStartTime (Double_t time) |
Set the start time of the run. More... | |
void | SetTimeSliceLength (Double_t length) |
Set length of the time-slices. More... | |
void | StoreAllTimeSlices (Bool_t choice=kTRUE) |
Store all time-slices. More... | |
CbmDigitizeBase * | GetDigitizer (ECbmModuleId system) |
Get the pointer on a given digitizer if existing. More... | |
Private Member Functions | |
CbmDigitization (const CbmDigitization &)=delete | |
Copy constructor forbidden. More... | |
CbmDigitization | operator= (const CbmDigitization &)=delete |
Assignment operator forbidden. More... | |
Int_t | CheckInput () |
Check the presence of input branches. More... | |
Int_t | CreateDefaultDigitizers () |
Instantiate the default digitisers for the active systems. More... | |
TString | GetGeoTag (ECbmModuleId system, TGeoManager *geo) |
Get the geometry tag of a system from a TGeoManager. More... | |
void | SetDefaultBranches () |
Default settings for digitizers. More... | |
ClassDef (CbmDigitization, 3) | |
Private Attributes | |
Bool_t | fIsInit |
Bool_t | fEventMode |
Double_t | fTimeSliceLength |
Bool_t | fProduceNoise |
Bool_t | fCreateMatches |
std::map< ECbmModuleId, CbmDigitizeInfo * > | fDigitizers |
CbmDaq * | fDaq |
CbmDigitizationSource * | fSource |
Input source. More... | |
TString | fOutFile |
Output data (digis) More... | |
TString | fParRootFile |
ROOT parameter file. More... | |
TList | fParAsciiFiles |
ASCII parameter files. More... | |
TString | fMoniFile |
Resource monitoring information. More... | |
Bool_t | fOverwriteOutput |
Bool_t | fGenerateRunInfo |
Int_t | fRun |
Definition at line 25 of file CbmDigitization.h.
CbmDigitization::CbmDigitization | ( | ) |
|
virtual |
|
privatedelete |
Copy constructor forbidden.
|
inline |
Add an input file.
fileName | Name of input file (MC) |
eventRate | Rate for events from input file [1/s] |
mode | Tree access mode (kRegular / kRepeat / kRandom) |
Shortcut for legacy reasons, when only one input file is used. This will set the inputId to zero. Repeated use will lead to abort.
Definition at line 56 of file CbmDigitization.h.
References AddInput().
void CbmDigitization::AddInput | ( | UInt_t | inputId, |
TString | fileName, | ||
Double_t | eventRate = -1. , |
||
ECbmTreeAccess | mode = ECbmTreeAccess::kRegular |
||
) |
Add an input file.
inputId | Unique input identifier |
fileName | Name of input file (MC) |
eventRate | Rate for events from input file [1/s] |
mode | Tree access mode (kRegular / kRepeat / kRandom) |
Definition at line 67 of file CbmDigitization.cxx.
References CbmDigitizationSource::AddInput(), and fSource.
Referenced by AddInput().
Bool_t CbmDigitization::AddParameterAsciiFile | ( | TString | fileName | ) |
Add an ASCII parameter file.
fileName | Name of parameter file |
All ASCII parameter files will be concatenated and used as second input to the runtime database.
Definition at line 81 of file CbmDigitization.cxx.
References fParAsciiFiles.
Referenced by DefaultInit().
|
private |
Check the presence of input branches.
The branch list is searched for the input branches (MCPoint) required by the digitizers. For each present input branch, the corresponding digitizer will be instantiated. In addition, the run number is extracted from the MCEventHeader.
Definition at line 95 of file CbmDigitization.cxx.
References fDigitizers, fRun, fSource, CbmDigitizationSource::GetBranchList(), CbmMCInput::GetChain(), CbmDigitizationSource::GetFirstInput(), and CbmModuleList::GetModuleNameCaps().
Referenced by DefaultInit().
|
private |
|
private |
Instantiate the default digitisers for the active systems.
For systems not having explicitly defined their digitizers, the default digitisers are instantiated.
Definition at line 133 of file CbmDigitization.cxx.
References fDigitizers, fEventMode, kMuch, kMvd, kPsd, kRich, kSts, kTof, and kTrd.
Referenced by DefaultInit().
void CbmDigitization::Deactivate | ( | ECbmModuleId | system | ) |
Deactivate a system for digitisation.
system | System ID (ECbmModuleId) |
The digitiser for this system will not be run even if the MCPoint branch is present in the input tree.
Definition at line 207 of file CbmDigitization.cxx.
References fDigitizers.
void CbmDigitization::DeactivateAllBut | ( | ECbmModuleId | system | ) |
Deactivate all systems except the specified one.
system | System ID (ECbmModuleId) |
Only the digitiser of the specified system will run.
Definition at line 215 of file CbmDigitization.cxx.
References fDigitizers.
void CbmDigitization::DefaultInit | ( | ) |
Initialize the branches, digitizers and parameter files With default values.
Definition at line 261 of file CbmDigitization.cxx.
References AddParameterAsciiFile(), CheckInput(), CreateDefaultDigitizers(), fIsInit, fParRootFile, fRun, GetGeoTag(), kTof, and kTrd.
Referenced by Run().
void CbmDigitization::EmbedInput | ( | UInt_t | inputId, |
TString | fileName, | ||
UInt_t | targetInputId, | ||
ECbmTreeAccess | mode = ECbmTreeAccess::kRegular |
||
) |
Embed an input file into another one.
inputId | Unique input identifier |
fileName | Name of input file (MC) |
targetInputId | ID of the input to be embedded into |
mode | Tree access mode (kRegular / kRepeat / kRandom) |
Definition at line 225 of file CbmDigitization.cxx.
References CbmDigitizationSource::EmbedInput(), and fSource.
|
inline |
Write run info (default is kTRUE)
choice | If kTRUE, run info will be written |
The run info comprises CPU and memory consumption for each event. It will be written to a separate ROOT file.
Definition at line 107 of file CbmDigitization.h.
References fGenerateRunInfo.
CbmDigitizeBase * CbmDigitization::GetDigitizer | ( | ECbmModuleId | system | ) |
Get the pointer on a given digitizer if existing.
system | System ID (ECbmModuleId) |
This method can be called from the macro level, between CbmDigitization instantiation and the call to the Run method (which itself calls the CbmRunAna Init method) to set specific parameters.
Definition at line 561 of file CbmDigitization.cxx.
References fDigitizers.
|
private |
Get the geometry tag of a system from a TGeoManager.
system | Detector system (ECbmModuleId) |
geo | Pointer to TGeoManager |
The implementation assumes that the top-level volume name of each system in the geometry contains the geometry tag in the form of e.g., sts_v16g
Definition at line 239 of file CbmDigitization.cxx.
References CbmModuleList::GetModuleName().
Referenced by DefaultInit().
|
privatedelete |
Assignment operator forbidden.
|
inline |
Process all events from input.
Definition at line 115 of file CbmDigitization.h.
References Run().
Referenced by Run().
void CbmDigitization::Run | ( | Int_t | event1, |
Int_t | event2 | ||
) |
Process input from event1 to event2.
event1 | First event to process |
event2 | Last event to process |
Definition at line 335 of file CbmDigitization.cxx.
References DefaultInit(), fCreateMatches, fDaq, fDigitizers, fEventMode, fGenerateRunInfo, fMoniFile, fOutFile, fParAsciiFiles, fParRootFile, fProduceNoise, fSource, fTimeSliceLength, CbmRunAna::SetAsync(), CbmDigitizeBase::SetCreateMatches(), CbmDaq::SetDigitizer(), CbmDigitizeBase::SetEventMode(), CbmDigitizationSource::SetEventMode(), CbmDigitizeBase::SetProduceNoise(), and StoreAllTimeSlices().
|
inline |
Process nEvents from input, starting with the first event.
nEvents | Number of events to process |
Definition at line 121 of file CbmDigitization.h.
References Run().
Referenced by Run().
|
inline |
Set creation of links to MC.
Choice | If kTRUE, the match objects will be created |
Definition at line 134 of file CbmDigitization.h.
References fCreateMatches.
|
private |
Default settings for digitizers.
Definition at line 478 of file CbmDigitization.cxx.
References fDigitizers, kMuch, kMvd, kPsd, kRich, kSts, kTof, and kTrd.
Referenced by CbmDigitization().
void CbmDigitization::SetDigitizer | ( | ECbmModuleId | system, |
CbmDigitizeBase * | digitizer, | ||
TString | branch = "" , |
||
Bool_t | persistent = kTRUE |
||
) |
Set a digitizer explicitly.
system | System ID (ECbmModuleId) |
digitizer | Pointer to digitizer instance |
branch | Input branch name (MCPoint) |
persistent | if kTRUE, the output (digis) will be persistent |
This method has to be called from the macro level, if a digitizer different from the default one or with different settings than the default ones is to be used. The respective digitizer has to be instantiated before. The ownership is passed to this class.
Definition at line 498 of file CbmDigitization.cxx.
References fDigitizers.
|
inline |
Set event-by-event mode.
choice | If kTRUE, digitisation will be done event-by-event |
In the event-by-event mode, one time slice will be created for each input event. There will be no interference between events.
Definition at line 160 of file CbmDigitization.h.
References fEventMode.
|
inline |
Set the monitor file name.
fileName | Name of monitor file |
The monitor file stores information on the resource usage. If a file name is specified, a corresponding file will be created and filled. By default, monitoring is not recorded.
Definition at line 170 of file CbmDigitization.h.
References fMoniFile.
void CbmDigitization::SetOutputFile | ( | TString | fileName, |
Bool_t | overwrite = kFALSE |
||
) |
Set the output file name.
path | Name of output file |
overwrite | Overwrite output file if already existing |
If the directory of the file does not exist, it will be created.
Definition at line 526 of file CbmDigitization.cxx.
References fOutFile.
void CbmDigitization::SetParameterRootFile | ( | TString | fileName | ) |
Set the parameter file name.
fileName | Name of output file |
Definition at line 551 of file CbmDigitization.cxx.
References fParRootFile.
|
inline |
Set production of inter-event noise.
Choice | If kTRUE, the digitizer will produce noise |
Definition at line 191 of file CbmDigitization.h.
References fProduceNoise.
|
inline |
Set the start time of the run.
time | Start time of run [ns] |
A default of 1000 ns is hard-coded in the constructor of CbmDigitizationSource. It can be changed with this method.
Definition at line 200 of file CbmDigitization.h.
References fSource, and CbmDigitizationSource::SetTimeStart().
|
inline |
Set length of the time-slices.
length | Length of time-slices [ns] |
The raw data will be sorted into time-slices of the specified length.
If the time-slice length is negative (default), one time-slice for all input data will be created.
Definition at line 212 of file CbmDigitization.h.
References fTimeSliceLength.
|
inline |
Store all time-slices.
choice | If kTRUE; also empty slices will be stored. |
By default, only time slices containing data are filled into the tree.
Definition at line 220 of file CbmDigitization.h.
References fDaq, and CbmDaq::StoreAllTimeSlices().
Referenced by Run().
|
private |
Definition at line 240 of file CbmDigitization.h.
Referenced by Run(), and SetCreateMatches().
|
private |
Definition at line 242 of file CbmDigitization.h.
Referenced by Run(), and StoreAllTimeSlices().
|
private |
Definition at line 241 of file CbmDigitization.h.
Referenced by CheckInput(), CreateDefaultDigitizers(), Deactivate(), DeactivateAllBut(), GetDigitizer(), Run(), SetDefaultBranches(), SetDigitizer(), and ~CbmDigitization().
|
private |
Definition at line 237 of file CbmDigitization.h.
Referenced by CreateDefaultDigitizers(), Run(), and SetEventMode().
|
private |
Definition at line 249 of file CbmDigitization.h.
Referenced by GenerateRunInfo(), and Run().
|
private |
Definition at line 236 of file CbmDigitization.h.
Referenced by DefaultInit().
|
private |
Resource monitoring information.
Definition at line 247 of file CbmDigitization.h.
Referenced by Run(), and SetMonitorFile().
|
private |
Output data (digis)
Definition at line 244 of file CbmDigitization.h.
Referenced by Run(), and SetOutputFile().
|
private |
Definition at line 248 of file CbmDigitization.h.
|
private |
ASCII parameter files.
Definition at line 246 of file CbmDigitization.h.
Referenced by AddParameterAsciiFile(), and Run().
|
private |
ROOT parameter file.
Definition at line 245 of file CbmDigitization.h.
Referenced by DefaultInit(), Run(), and SetParameterRootFile().
|
private |
Definition at line 239 of file CbmDigitization.h.
Referenced by Run(), and SetProduceNoise().
|
private |
Definition at line 250 of file CbmDigitization.h.
Referenced by CheckInput(), and DefaultInit().
|
private |
Input source.
Definition at line 243 of file CbmDigitization.h.
Referenced by AddInput(), CheckInput(), EmbedInput(), Run(), SetStartTime(), and ~CbmDigitization().
|
private |
Definition at line 238 of file CbmDigitization.h.
Referenced by Run(), and SetTimeSliceLength().