EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
simulation.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file simulation.C
1 
2 //
3 // Simulation for BeAST detector tracker reslution estimates;
4 //
5 
6 void simulation(Int_t nEvents = 1000)
7 {
8  // Load basic libraries;
9  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
10 
11  // Create simulation run manager; use GEANT3 for tracking excercises here;
12  EicRunSim *fRun = new EicRunSim("TGeant3");
13  fRun->SetOutputFile("simulation.root");
14 
15  // Yes, secondaries of no need here;
16  fRun->SuppressSecondaries();
17 
18  // Vertex tracker;
19  fRun->AddModule(new EicMaps ("VST", "MAPS/vst-v01.0-ss.root", qVST));
20  fRun->AddModule(new EicMaps ("FST", "MAPS/fst-v01.0-ss.root", qFST));
21 
22  // GEM disks, in front and behind the RICH;
23  fRun->AddModule(new EicGem ("FGT", "./fgt-v01.0.root", qFGT));
24  fRun->AddModule(new EicGem ("FFG", "./ffg-v01.0.root", qBGT));
25 
26  // TPC;
27  fRun->AddModule(new EicTpc ("TPC/tpc-v01.0-ns.root"));
28 
29  // Beam pipe; details of IR not known yet -> just a cylinder with thin walls;
30  //fRun->AddModule(new EicDummyDetector("BEAMPIPE", "BEAMPIPE/beampipe.root"));
31 
32  // RICH;
33  fRun->AddModule(new EicDetector("RICH", "./rich-v01.0.root", qDUMMY, qOneStepOneHit));
34 
35  // Create and set up (Box) Event Generator;
36  {
37  // Be lazy, hardcode polar angles matching eta [0..4]:
38  // ~0.00, 0.50, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50, 4.00;
39  // 89.00, 62.48, 40.40, 25.16, 15.41, 9.39, 5.70, 3.46, 2.10;
40 
41  int PDG = 211; // pion
42  double momentum = 5.0, theta = 15.41; //
43  //double momentum = 50.0, theta = 62.48;
44 
45  EicBoxGenerator *boxGen = new EicBoxGenerator(PDG);
46  boxGen->SetMomentum(momentum);
47  boxGen->SetTheta(theta);
48  //boxGen->SetPhi(50.0);
49 
50  fRun->AddGenerator(boxGen);
51  }
52 
53  // Create and set up Apr'2016 solenoid field (binary file "input/SolenoidMap8.root");
54  //fRun->AddField(new PndSolenoidMap("SolenoidMap2", "R"));
55  // ~3T BeAST central field with the realistic fringe fields;
56  fRun->AddField(new PndSolenoidMap("SolenoidMap8", "R"));
57 
58  // Initialize and run the simulation; exit at the end;
59  fRun->Run(nEvents);
60 } // simulation()
61