BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
SimulateLambdaPassing.C
Go to the documentation of this file.
1// #include <Rtypes.h>
2#include <FairPrimaryGenerator.h>
3
4R__ADD_INCLUDE_PATH($VMCWORKDIR)
5#include "macro/run/geometry_run/geometry_run7.C"
6
7void SimulateLambdaPassing(Int_t nEvents = 1,
8 Double_t fieldScale = 2.,
9 Double_t P = 1.,
10 Double_t eta = 2.,
11 Double_t phi = 180.,
12 Double_t X = 0.5,
13 Double_t Y = -4.6,
14 Double_t Z = -2.3,
15 TString outFile = "test.root")
16{
17 FairRunSim* fRun = new FairRunSim();
18 fRun->SetName("TGeant3");
19
20 geometry(fRun);
21
22 FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
23 fRun->SetGenerator(primGen);
24
25 primGen->SetBeam(X, Y, 0.0, 0.0);
26 primGen->SetTarget(Z, 0.0);
27 primGen->SmearVertexZ(kFALSE);
28 primGen->SmearVertexXY(kFALSE);
29
30 gRandom->SetSeed(0);
31 FairBoxGenerator* boxGen1 = new FairBoxGenerator(3122, 1);
32 boxGen1->SetPRange(P, P); // GeV/c, setPRange vs setPtRange
33 boxGen1->SetPhiRange(phi, phi); // Azimuth angle range [degree]
34 boxGen1->SetEtaRange(eta, eta); // Polar angle in lab system range [degree]
35 primGen->AddGenerator(boxGen1);
36
37 fRun->SetSink(new FairRootFileSink(outFile));
38 fRun->SetIsMT(false);
39
40 BmnFieldMap* magField = new BmnNewFieldMap("field_sp41v4_ascii_Extrap.root");
41 magField->SetScale(fieldScale);
42 fRun->SetField(magField);
43
44 // SILICON-Digitizer
46 BmnSiliconDigitizer* siliconDigit = new BmnSiliconDigitizer();
47 siliconDigit->SetCurrentConfig(si_config);
48 siliconDigit->SetOnlyPrimary(kFALSE);
49 siliconDigit->SetUseRealEffects(kTRUE);
50 fRun->AddTask(siliconDigit);
51
52 // GEM-Digitizer
57 gemDigit->SetCurrentConfig(gem_config);
58 gemDigit->SetOnlyPrimary(kFALSE);
59 gemDigit->SetUseRealEffects(kTRUE);
60 gemDigit->SetStripMatching(kTRUE);
61 fRun->AddTask(gemDigit);
62
63 // CSC-Digitizer
65 BmnCSCDigitizer* cscDigit = new BmnCSCDigitizer();
66 cscDigit->SetCurrentConfig(csc_config);
67 cscDigit->SetOnlyPrimary(kFALSE);
68 cscDigit->SetStripMatching(kTRUE);
69 fRun->AddTask(cscDigit);
70
71 fRun->Init();
72
73 fRun->Run(nEvents);
74
75 delete fRun;
76}
int Int_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
#define R__ADD_INCLUDE_PATH(PATH)
R__EXTERN TRandom * gRandom
void SetOnlyPrimary(Bool_t opt=kFALSE)
void SetStripMatching(Bool_t opt=kTRUE)
void SetCurrentConfig(BmnCSCConfiguration::CSC_CONFIG config)
void SetScale(Double_t factor)
Set a global field scaling factor.
Definition BmnFieldMap.h:55
void SetCurrentConfig(BmnGemStripConfiguration::GEM_CONFIG config)
void SetStripMatching(Bool_t opt=kTRUE)
void SetOnlyPrimary(Bool_t opt=kFALSE)
void SetUseRealEffects(Bool_t opt=kTRUE)
static BmnGemStripMedium & GetInstance()
Bool_t SetCurrentConfiguration(BmnGemStripMediumConfiguration::MEDIUM medium)
Field Map does not have any symmetries w.r.t coordinate axises.
void SetCurrentConfig(BmnSiliconConfiguration::SILICON_CONFIG config)
void SetOnlyPrimary(Bool_t opt=kFALSE)
void SetUseRealEffects(Bool_t opt=kTRUE)
void SimulateLambdaPassing(Int_t nEvents=1, Double_t fieldScale=2., Double_t P=1., Double_t eta=2., Double_t phi=180., Double_t X=0.5, Double_t Y=-4.6, Double_t Z=-2.3, TString outFile="test.root")