/
simulation.C
46 lines (36 loc) · 1.74 KB
/
simulation.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Tracker simulation script; all parameters hardcoded for simplicity;
//
void simulation(Int_t nEvents = 1000)
{
// Load basic libraries;
gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
// Create the simulation run manager; use GEANT4 transport;
EicRunSim *fRun = new EicRunSim("TGeant3");
fRun->SetOutputFile("simulation.root");
// Well, do not need secondaries in this simulation;
fRun->SuppressSecondaries();
// "FWDST" name here (case-insensitive) should match the respective name
// in tracker.C script used to create the detector; one can actually
// create more than one tracking detector this way, and as long as their names differ
// (and physical locations do not overlap), all the simulation/digitization/reconstruction
// scheme will work (including Kalman filter track fitting); qMergeStepsInOneHit as a
// last parameter means that if particle makes more than one step in silicon, they will
// be merged together and yield only one hit;
fRun->AddModule(new EicDetector("FWDST", "./fwdst.root", qDUMMY, qMergeStepsInOneHit));
// Create and set up (Box) Event Generator;
{
int PDG = 211; // pion
double pmin = 5.0, pmax = 5.0, theta = 6.8; // [9..11] GeV/c @ 5 degrees
EicBoxGenerator* boxGen = new EicBoxGenerator(PDG);
boxGen->SetMomentumRange(pmin, pmax);
boxGen->SetTheta(theta);
boxGen->SetPhi(45.0);
fRun->AddGenerator(boxGen);
}
// Create and set up Elmer-based Apr'2016 solenoid field (binary file "input/SolenoidMap8.root");
//fRun->AddField(new PndSolenoidMap("SolenoidMap8", "R"));
fRun->AddField(new PndDipoleMap("DipoleMap3", "R"));
// Initialize and run the simulation; exit at the end;
fRun->Run(nEvents);
} // simulation()