CbmRoot
Loading...
Searching...
No Matches
CbmTransport.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese, Florian Uhlig [committer] */
4
10#ifndef CBMTRANSPORT_H
11#define CBMTRANSPORT_H 1
12
13
14#include "CbmMCEventFilter.h"
15#include "CbmSetup.h"
16#include "CbmStackFilter.h"
17
18#include "TNamed.h"
19#include "TString.h"
20
21#include <functional>
22#include <iostream>
23#include <memory>
24
25class TGeant3;
26class TGeant4;
27class TVirtualMC;
28class FairField;
29class FairGenerator;
30class FairRunSim;
32class CbmTarget;
35
42
48
49
55class CbmTransport : public TNamed {
56
57public:
60
61
63 virtual ~CbmTransport();
64
65
70 void AddInput(const char* fileName, ECbmGenerator generator = kUnigen);
71
72
76 void AddInput(FairGenerator* generator);
77
78
80 void ConfigureVMC();
81
82
90 void ForceVertexAtZ(Double_t zVertex);
91
92
96 void ForceVertexInTarget(Bool_t choice = kTRUE);
97
98
104 void GenerateRunInfo(Bool_t choice = kTRUE) { fGenerateRunInfo = choice; }
105
106
110 CbmSetup* GetSetup() const { return fSetup; }
111
112
116 std::unique_ptr<CbmStackFilter>& GetStackFilter() { return fStackFilter; }
117
118
122 void SetSetupSource(ECbmSetupSource setupSource);
123
124
128 void LoadSetup(const char* setupName);
129
130
139 void RegisterRadLength(Bool_t choice = kTRUE);
140
141
145 void Run(Int_t nEvents);
146
147
161 void SetBeamAngle(Double_t x0, Double_t y0, Double_t sigmaX = -1., Double_t sigmaY = -1.);
162
163
180 void SetBeamPosition(Double_t x0, Double_t y0, Double_t sigmaX = -1., Double_t sigmaY = -1., Double_t zF = 0.);
181
182
191 void SetDecayMode(Int_t pdg, UInt_t nDaughters, Int_t* daughterPdg);
192
193
199 void SetEngine(ECbmEngine engine) { fEngine = engine; }
200
201
209 void SetEventFilter(std::unique_ptr<CbmMCEventFilter>& filter)
210 {
211 fEventFilter.reset();
212 fEventFilter = std::move(filter);
213 }
214
215
216 void SetEventFilterMinNofData(ECbmDataType type, Int_t value) { fEventFilter->SetMinNofData(type, value); }
217
218
226 void SetField(FairField* field) { fField = field; }
227
228
235 void SetGeoFileName(TString name);
236
237
247 void SetMediaFileName(TString fileName) { fSetup->SetMediaFilePath(fileName.Data()); }
248
249
255 void SetParFileName(TString name);
256
257
265 void SetStackFilter(std::unique_ptr<CbmStackFilter>& filter)
266 {
267 fStackFilter.reset();
268 fStackFilter = std::move(filter);
269 }
270
271
286 void SetTarget(const char* medium = "Gold", Double_t thickness = 0.025, Double_t diameter = 2.5, Double_t x = 0.,
287 Double_t y = 0., Double_t z = -44.0, Double_t rot = 0., Double_t density = -1);
288
289
296 void SetOutFileName(TString name, Bool_t overwrite = kFALSE);
297
298
308 void SetRandomEventPlane(Double_t phiMin = 0., Double_t phiMax = 2. * TMath::Pi());
309
310
317 void SetRandomSeed(const ULong_t seedValue) { fRandomSeed = seedValue; }
318
331 void SetVertexSmearXY(Bool_t choice = kTRUE);
332
333
341 void SetVertexSmearZ(Bool_t choice = kTRUE);
342
343
352 void StoreTrajectories(Bool_t choice = kTRUE) { fStoreTrajectories = choice; }
353
362
371
372private:
374 FairField* fField;
375 std::shared_ptr<CbmTarget> fTarget;
377 std::unique_ptr<CbmMCEventFilter> fEventFilter;
378 FairRunSim* fRun;
382 std::vector<FairGenerator*> fGenerators;
384 Double_t fRealTimeRun;
385 Double_t fCpuTime;
387 std::unique_ptr<CbmStackFilter> fStackFilter;
390 std::function<void()> fSimSetup;
391 std::map<Int_t, std::vector<Int_t>> fDecayModes;
392
395
396 ULong_t fRandomSeed {0};
397
399 void InitEventGenerator();
400
401
403 void ForceUserDecays();
404
405
407 void PiAndEtaDecay(TVirtualMC* vmc);
408
414 void RegisterIons();
415
416
418 void RegisterSetup();
419
421};
422
423#endif /* CBMTRANSPORT_H */
ECbmDataType
Definition CbmDefs.h:90
ECbmSetupSource
Definition CbmSetup.h:34
ECbmGenerator
@ kPluto
@ kUnigen
@ kUrqmd
ECbmEngine
@ kGeant3
@ kGeant4
CbmEventGenerator.
User interface class to define the Geant3 simulation settings.
User interface class to define the Geant4 simulation settings.
void SetMediaFilePath(std::string filePath)
Definition CbmSetup.h:77
Class for constructing the geometry of the CBM target.
Definition CbmTarget.h:37
User interface class for transport simulation.
void SetDecayMode(Int_t pdg, UInt_t nDaughters, Int_t *daughterPdg)
Set a decay mode for a particle.
void SetTarget(const char *medium="Gold", Double_t thickness=0.025, Double_t diameter=2.5, Double_t x=0., Double_t y=0., Double_t z=-44.0, Double_t rot=0., Double_t density=-1)
Define the target.
void SetEventFilterMinNofData(ECbmDataType type, Int_t value)
std::shared_ptr< CbmTarget > fTarget
void RegisterRadLength(Bool_t choice=kTRUE)
Enable registration of radiation length.
void SetField(FairField *field)
Set magnetic field.
virtual ~CbmTransport()
Destructor
void SetOutFileName(TString name, Bool_t overwrite=kFALSE)
Set the output file name.
CbmTransport()
Constructor.
void SetMediaFileName(TString fileName)
Set the media file name.
CbmGeant3Settings * fGeant3Settings
void SetStackFilter(std::unique_ptr< CbmStackFilter > &filter)
Set a user-defined stack filter class.
std::unique_ptr< CbmMCEventFilter > fEventFilter
FairRunSim * fRun
std::function< void()> fSimSetup
Double_t fRealTimeInit
void SetGeoFileName(TString name)
Define geometry file name (output)
void LoadSetup(const char *setupName)
Use a standard setup.
void PiAndEtaDecay(TVirtualMC *vmc)
Correct decay modes for pi0 and eta.
void SetBeamPosition(Double_t x0, Double_t y0, Double_t sigmaX=-1., Double_t sigmaY=-1., Double_t zF=0.)
Set the beam position.
void SetRandomEventPlane(Double_t phiMin=0., Double_t phiMax=2. *TMath::Pi())
Activate random event plane.
ULong_t fRandomSeed
Double_t fCpuTime
void AddInput(const char *fileName, ECbmGenerator generator=kUnigen)
Add an input by file name and generator type.
void SetGeant3Settings(CbmGeant3Settings *val)
Set user defined transport settings for Geant3.
void SetVertexSmearZ(Bool_t choice=kTRUE)
Enable smearing of event vertex in z.
CbmSetup * GetSetup() const
Detector setup interface.
void ConfigureVMC()
Set the parameters for the TVirtualMC.
void ForceVertexAtZ(Double_t zVertex)
Force the event vertex to be at a given z position.
ClassDef(CbmTransport, 4)
void SetGeant4Settings(CbmGeant4Settings *val)
Set user defined transport settings for Geant4.
std::unique_ptr< CbmStackFilter > & GetStackFilter()
Access to stack filter object.
std::vector< FairGenerator * > fGenerators
void SetRandomSeed(const ULong_t seedValue)
Set global random seed value.
void RegisterIons()
Register ions.
void SetParFileName(TString name)
Define parameter file name.
void SetEngine(ECbmEngine engine)
Set transport engine.
std::unique_ptr< CbmStackFilter > fStackFilter
TString fParFileName
TString fOutFileName
CbmSetup * fSetup
void SetVertexSmearXY(Bool_t choice=kTRUE)
Enable smearing of event vertex in x and y.
void ForceUserDecays()
Force user-defined single-mode decays.
Bool_t fStoreTrajectories
void GenerateRunInfo(Bool_t choice=kTRUE)
Trigger generation of a run info file.
ECbmEngine fEngine
void StoreTrajectories(Bool_t choice=kTRUE)
Enable storing of trajectories.
FairField * fField
void InitEventGenerator()
Event generator initialisation.
Double_t fRealTimeRun
void SetSetupSource(ECbmSetupSource setupSource)
Set the source the setup will be loaded from.
void RegisterSetup()
Create and register the setup modules.
CbmGeant4Settings * fGeant4Settings
void Run(Int_t nEvents)
Execute transport run.
TString fGeoFileName
Bool_t fGenerateRunInfo
std::map< Int_t, std::vector< Int_t > > fDecayModes
CbmEventGenerator * fEventGen
void SetBeamAngle(Double_t x0, Double_t y0, Double_t sigmaX=-1., Double_t sigmaY=-1.)
Set the beam angle (emittency at the beam position)
void ForceVertexInTarget(Bool_t choice=kTRUE)
Enable or disable forcing the vertex to be in the target.
void SetEventFilter(std::unique_ptr< CbmMCEventFilter > &filter)
Set a user-defined event filter class.