CbmRoot
CbmDigitization.h
Go to the documentation of this file.
1 
6 #ifndef CBMDIGITIZATION_H
7 #define CBMDIGITIZATION_H 1
8 
9 #include "CbmDaq.h"
10 #include "CbmDefs.h"
11 #include "CbmDigitizationSource.h"
12 #include "CbmDigitizeInfo.h"
13 #include "FairLogger.h"
14 #include "TList.h"
15 #include "TNamed.h"
16 #include "TString.h"
17 #include "TSystem.h"
18 #include <map>
19 #include <vector>
20 
21 class TGeoManager;
22 class CbmDigitizeBase;
23 
24 
25 class CbmDigitization : public TNamed {
26 
27 public:
30 
31 
33  virtual ~CbmDigitization();
34 
35 
42  void AddInput(UInt_t inputId,
43  TString fileName,
44  Double_t eventRate = -1.,
46 
47 
56  void AddInput(TString fileName,
57  Double_t eventRate = -1.,
59  AddInput(0, fileName, eventRate, mode);
60  }
61 
69  Bool_t AddParameterAsciiFile(TString fileName);
70 
71 
78  void Deactivate(ECbmModuleId system);
79 
80 
86  void DeactivateAllBut(ECbmModuleId system);
87 
88 
95  void EmbedInput(UInt_t inputId,
96  TString fileName,
97  UInt_t targetInputId,
99 
100 
107  void GenerateRunInfo(Bool_t choice = kTRUE) { fGenerateRunInfo = choice; }
108 
112  void DefaultInit();
113 
115  void Run() { Run(-1, -1); }
116 
117 
121  void Run(Int_t nEvents) { Run(0, nEvents); }
122 
123 
128  void Run(Int_t event1, Int_t event2);
129 
130 
134  void SetCreateMatches(Bool_t choice = kTRUE) { fCreateMatches = choice; }
135 
136 
148  void SetDigitizer(ECbmModuleId system,
149  CbmDigitizeBase* digitizer,
150  TString branch = "",
151  Bool_t persistent = kTRUE);
152 
153 
160  void SetEventMode(Bool_t choice = kTRUE) { fEventMode = choice; }
161 
162 
170  void SetMonitorFile(const char* fileName) { fMoniFile = fileName; }
171 
172 
179  void SetOutputFile(TString fileName, Bool_t overwrite = kFALSE);
180 
181 
185  void SetParameterRootFile(TString fileName);
186 
187 
191  void SetProduceNoise(Bool_t choice = kTRUE) { fProduceNoise = choice; }
192 
193 
200  void SetStartTime(Double_t time) { fSource->SetTimeStart(time); }
201 
202 
212  void SetTimeSliceLength(Double_t length) { fTimeSliceLength = length; }
213 
214 
220  void StoreAllTimeSlices(Bool_t choice = kTRUE) {
221  fDaq->StoreAllTimeSlices(choice);
222  }
223 
233 
234 
235 private:
236  Bool_t fIsInit;
237  Bool_t fEventMode;
241  std::map<ECbmModuleId, CbmDigitizeInfo*> fDigitizers;
244  TString fOutFile;
245  TString fParRootFile;
247  TString fMoniFile;
250  Int_t fRun;
251 
252 
255 
256 
259 
260 
269  Int_t CheckInput();
270 
271 
278  Int_t CreateDefaultDigitizers();
279 
280 
290  TString GetGeoTag(ECbmModuleId system, TGeoManager* geo);
291 
292 
294  void SetDefaultBranches();
295 
296 
298 };
299 
300 #endif /* CBMDIGITIZATION_H */
CbmDigitization::AddInput
void AddInput(TString fileName, Double_t eventRate=-1., ECbmTreeAccess mode=ECbmTreeAccess::kRegular)
Add an input file.
Definition: CbmDigitization.h:56
CbmDigitization::SetCreateMatches
void SetCreateMatches(Bool_t choice=kTRUE)
Set creation of links to MC.
Definition: CbmDigitization.h:134
CbmDigitization::SetStartTime
void SetStartTime(Double_t time)
Set the start time of the run.
Definition: CbmDigitization.h:200
CbmDigitization::~CbmDigitization
virtual ~CbmDigitization()
Destructor
Definition: CbmDigitization.cxx:55
CbmDaq.h
CbmDigitization::SetDigitizer
void SetDigitizer(ECbmModuleId system, CbmDigitizeBase *digitizer, TString branch="", Bool_t persistent=kTRUE)
Set a digitizer explicitly.
Definition: CbmDigitization.cxx:498
CbmDigitization::fCreateMatches
Bool_t fCreateMatches
Definition: CbmDigitization.h:240
CbmDigitization::CreateDefaultDigitizers
Int_t CreateDefaultDigitizers()
Instantiate the default digitisers for the active systems.
Definition: CbmDigitization.cxx:133
CbmDigitization::GetGeoTag
TString GetGeoTag(ECbmModuleId system, TGeoManager *geo)
Get the geometry tag of a system from a TGeoManager.
Definition: CbmDigitization.cxx:239
CbmDigitization::Run
void Run(Int_t nEvents)
Process nEvents from input, starting with the first event.
Definition: CbmDigitization.h:121
CbmDigitization::operator=
CbmDigitization operator=(const CbmDigitization &)=delete
Assignment operator forbidden.
CbmDigitization::fEventMode
Bool_t fEventMode
Definition: CbmDigitization.h:237
CbmDigitization::fGenerateRunInfo
Bool_t fGenerateRunInfo
Definition: CbmDigitization.h:249
CbmDigitization::fTimeSliceLength
Double_t fTimeSliceLength
Definition: CbmDigitization.h:238
CbmDigitization::SetMonitorFile
void SetMonitorFile(const char *fileName)
Set the monitor file name.
Definition: CbmDigitization.h:170
ECbmModuleId
ECbmModuleId
Definition: CbmDefs.h:33
ECbmTreeAccess::kRegular
@ kRegular
CbmDigitization::Run
void Run()
Process all events from input.
Definition: CbmDigitization.h:115
CbmDigitization
Definition: CbmDigitization.h:25
CbmDigitization::DeactivateAllBut
void DeactivateAllBut(ECbmModuleId system)
Deactivate all systems except the specified one.
Definition: CbmDigitization.cxx:215
CbmDigitization::fProduceNoise
Bool_t fProduceNoise
Definition: CbmDigitization.h:239
CbmDigitization::fOutFile
TString fOutFile
Output data (digis)
Definition: CbmDigitization.h:244
CbmDigitization::SetParameterRootFile
void SetParameterRootFile(TString fileName)
Set the parameter file name.
Definition: CbmDigitization.cxx:551
CbmDigitizationSource::SetTimeStart
void SetTimeStart(Double_t time)
Set the offset for the first event time.
Definition: CbmDigitizationSource.h:199
CbmDigitization::GenerateRunInfo
void GenerateRunInfo(Bool_t choice=kTRUE)
Write run info (default is kTRUE)
Definition: CbmDigitization.h:107
ECbmTreeAccess
ECbmTreeAccess
Mode to read entries from a ROOT TTree.
Definition: CbmDefs.h:130
CbmDaq::StoreAllTimeSlices
void StoreAllTimeSlices(Bool_t choice=kTRUE)
Store all time-slices.
Definition: CbmDaq.h:109
CbmDigitization::AddInput
void AddInput(UInt_t inputId, TString fileName, Double_t eventRate=-1., ECbmTreeAccess mode=ECbmTreeAccess::kRegular)
Add an input file.
Definition: CbmDigitization.cxx:67
CbmDigitization::fOverwriteOutput
Bool_t fOverwriteOutput
Definition: CbmDigitization.h:248
CbmDigitization::fSource
CbmDigitizationSource * fSource
Input source.
Definition: CbmDigitization.h:243
CbmDigitizeInfo.h
CbmDigitization::StoreAllTimeSlices
void StoreAllTimeSlices(Bool_t choice=kTRUE)
Store all time-slices.
Definition: CbmDigitization.h:220
CbmDigitization::CbmDigitization
CbmDigitization()
Constructor.
Definition: CbmDigitization.cxx:32
CbmDigitizationSource
Source class for the input to digitization in CBM.
Definition: CbmDigitizationSource.h:42
CbmDigitization::EmbedInput
void EmbedInput(UInt_t inputId, TString fileName, UInt_t targetInputId, ECbmTreeAccess mode=ECbmTreeAccess::kRegular)
Embed an input file into another one.
Definition: CbmDigitization.cxx:225
CbmDigitization::ClassDef
ClassDef(CbmDigitization, 3)
CbmDaq
CBM task class for filling digis into time slices.
Definition: CbmDaq.h:40
CbmDigitization::CheckInput
Int_t CheckInput()
Check the presence of input branches.
Definition: CbmDigitization.cxx:95
CbmDigitizationSource.h
CbmDigitization::DefaultInit
void DefaultInit()
Initialize the branches, digitizers and parameter files With default values.
Definition: CbmDigitization.cxx:261
CbmDigitization::AddParameterAsciiFile
Bool_t AddParameterAsciiFile(TString fileName)
Add an ASCII parameter file.
Definition: CbmDigitization.cxx:81
CbmDigitization::fIsInit
Bool_t fIsInit
Definition: CbmDigitization.h:236
CbmDigitization::fMoniFile
TString fMoniFile
Resource monitoring information.
Definition: CbmDigitization.h:247
CbmDigitization::fParAsciiFiles
TList fParAsciiFiles
ASCII parameter files.
Definition: CbmDigitization.h:246
CbmDigitization::SetProduceNoise
void SetProduceNoise(Bool_t choice=kTRUE)
Set production of inter-event noise.
Definition: CbmDigitization.h:191
CbmDigitization::SetOutputFile
void SetOutputFile(TString fileName, Bool_t overwrite=kFALSE)
Set the output file name.
Definition: CbmDigitization.cxx:526
CbmDigitization::CbmDigitization
CbmDigitization(const CbmDigitization &)=delete
Copy constructor forbidden.
CbmDigitization::fParRootFile
TString fParRootFile
ROOT parameter file.
Definition: CbmDigitization.h:245
CbmDigitization::GetDigitizer
CbmDigitizeBase * GetDigitizer(ECbmModuleId system)
Get the pointer on a given digitizer if existing.
Definition: CbmDigitization.cxx:561
CbmDigitization::SetTimeSliceLength
void SetTimeSliceLength(Double_t length)
Set length of the time-slices.
Definition: CbmDigitization.h:212
CbmDigitizeBase
Abstract base class for CBM digitisation tasks.
Definition: CbmDigitizeBase.h:26
CbmDigitization::SetEventMode
void SetEventMode(Bool_t choice=kTRUE)
Set event-by-event mode.
Definition: CbmDigitization.h:160
CbmDigitization::Deactivate
void Deactivate(ECbmModuleId system)
Deactivate a system for digitisation.
Definition: CbmDigitization.cxx:207
CbmDigitization::fDigitizers
std::map< ECbmModuleId, CbmDigitizeInfo * > fDigitizers
Definition: CbmDigitization.h:241
CbmDigitization::fDaq
CbmDaq * fDaq
Definition: CbmDigitization.h:242
CbmDigitization::SetDefaultBranches
void SetDefaultBranches()
Default settings for digitizers.
Definition: CbmDigitization.cxx:478
CbmDigitization::fRun
Int_t fRun
Definition: CbmDigitization.h:250
CbmDefs.h