EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
BeastMagneticField
delphes_EIC
Doxygen_Assist
east
eic-smear
EicRoot
blob
master
base
cbmbase
cbmdata
dbase
eic
eventdisplay
examples
calorimetry
physics
tracking
config.1
config.1a
config.1b
config.2
digitization.C
eventDisplay.C
reconstruction.C
simulation.C
tpc-builder.C
vtx-builder.C
config.3
config.4
config.77
config.88
config.999
analysis-vtx.C
analysis.C
fairtools
field
gconfig
geane
genfit
GenfitTools
geobase
geometry
input
littrack
parbase
passive
pCDR-2018
pid
pnddata
PndTools
rich
trackbase
eicsmear-jetexample
eicsmeardetectors
EicToyModel
estarlight
Fun4All-lmon
fun4all_coresoftware
fun4all_eic_qa
fun4all_eic_tutorials
fun4all_eicdetectors
fun4all_eicmacros
fun4all_g4jleic
fun4all_GenFit
fun4all_macros
fun4all_tutorials
g4exampledetector
g4lblvtx
online_distribution
PEPSI
doxygen_mainpage.h
File Members
External Links
•
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
void
simulation
(Int_t
nEvents
= 1000)
3
{
4
// Load basic libraries;
5
gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C"
);
6
7
// Create simulation run manager; use GEANT3 for tracking excercises here;
8
EicRunSim
*fRun =
new
EicRunSim
(
"TGeant3"
);
9
fRun->
SetOutputFile
(
"simulation.root"
);
10
11
// Well, do not need secondaries in this simulation;
12
fRun->
SuppressSecondaries
();
13
14
// "VTX" & "TPC" names here (case-insensitive) should match the respective names
15
// in vtx-builder.C and tpc-builder.C scripts used to create the detectors;
16
// qMergeStepsInOneHit as a last parameter means that if particle makes more than one
17
// step in silicon, they will be merged together and yield only one hit;
18
fRun->
AddModule
(
new
EicDetector
(
"VTX"
,
"./vtx.root"
,
qDUMMY
,
qMergeStepsInOneHit
));
19
// qOneStepOneHit as a last parameter means that hits will be produced for each
20
// GEANT step; gas medium has max.step of 1cm in media.geo, which makes sense for
21
// a *simplistic* TPC example (remember, we are only interested to obtain reasonable
22
// track fits from some combination of hits);
23
fRun->
AddModule
(
new
EicDetector
(
"TPC"
,
"./tpc.root"
,
qDUMMY
,
qOneStepOneHit
));
24
25
// Create and set up (Box) Event Generator;
26
{
27
int
PDG = 211;
// pion
28
double
momentum
= 10.0,
theta
= 75.0;
// 10 GeV/c @ 75 degrees
29
30
EicBoxGenerator
*boxGen =
new
EicBoxGenerator
(PDG);
31
boxGen->
SetMomentum
(momentum);
32
boxGen->
SetTheta
(
theta
);
33
34
fRun->
AddGenerator
(boxGen);
35
}
36
37
// Hook up 3T constant field aligned with Z axis;
38
fRun->
AddField
(
new
PndSolenoidMap
(
"SolenoidMap1"
,
"R"
));
39
40
// Initialize and run the simulation; exit at the end;
41
fRun->
Run
(
nEvents
);
42
}
// simulation()
EicRoot
blob
master
examples
tracking
config.2
simulation.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:35
using
1.8.2 with
EIC GitHub integration