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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Fun4All_G4_simple_hadron_GEM.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Fun4All_G4_simple_hadron_GEM.C
1
#pragma once
2
#include <phgenfit/Track.h>
3
#include <
fun4all/Fun4AllDstInputManager.h
>
4
#include <
fun4all/Fun4AllDstOutputManager.h
>
5
#include <
fun4all/Fun4AllDummyInputManager.h
>
6
#include <
fun4all/Fun4AllInputManager.h
>
7
#include <
fun4all/Fun4AllNoSyncDstInputManager.h
>
8
#include <
fun4all/Fun4AllOutputManager.h
>
9
#include <
fun4all/Fun4AllServer.h
>
10
#include <
fun4all/SubsysReco.h
>
11
#include <
g4detectors/PHG4DetectorSubsystem.h
>
12
#include <
g4detectors/PHG4CylinderSubsystem.h
>
13
#include <
g4histos/G4HitNtuple.h
>
14
#include <
g4main/PHG4ParticleGenerator.h
>
15
#include <
g4main/PHG4ParticleGeneratorBase.h
>
16
#include <
g4main/PHG4Reco.h
>
17
#include <
g4main/PHG4TruthSubsystem.h
>
18
#include <
g4trackfastsim/PHG4TrackFastSim.h
>
19
#include <
g4trackfastsim/PHG4TrackFastSimEval.h
>
20
#include <
phool/recoConsts.h
>
21
#include <
g4lblvtx/EicFRichSubsystem.h
>
22
23
#include "
G4_GEM.C
"
24
25
R__LOAD_LIBRARY
(libfun4all.so)
26
R__LOAD_LIBRARY
(libg4detectors.so)
27
R__LOAD_LIBRARY
(libg4lblvtx.so)
28
R__LOAD_LIBRARY
(libg4trackfastsim.so)
29
30
void
Fun4All_G4_simple_hadron_GEM
(
31
int
nEvents
= -1,
// number of events
32
float
phi_deg_min = 0,
// phi range
33
TString out_name = "out_AKiselev_GEM")
// output filename
34
{
35
float
phi_min = phi_deg_min*TMath::Pi()/180.;
36
TString phi_range = Form(
"_%.0f_%.0f"
,phi_deg_min,phi_deg_min+45.);
37
TString outputFile = out_name+phi_range+
"_FastSimEval.root"
;
38
// ======================================================================================================
39
// Make the Server
40
Fun4AllServer
*se =
Fun4AllServer::instance
();
41
// ======================================================================================================
42
// Particle Generator Setup
43
PHG4ParticleGenerator
*gen =
new
PHG4ParticleGenerator
();
44
gen->
set_name
(std::string(
"pi-"
));
// geantino, pi-, pi+, mu-, mu+, e-., e+, proton, ... (currently passed as an input)
45
gen->
set_vtx
(0,0,0);
// Vertex generation range
46
gen->
set_mom_range
(5.,50.);
// Momentum generation range in GeV/c
47
gen->
set_z_range
(0.,0.);
48
gen->
set_eta_range
(2,6);
49
gen->
set_phi_range
(phi_min,phi_min+TMath::Pi()/4.);
50
se->
registerSubsystem
(gen);
51
// ======================================================================================================
52
PHG4Reco
*g4Reco =
new
PHG4Reco
();
53
g4Reco->
SetWorldMaterial
(
"G4_Galactic"
);
54
g4Reco->
set_field
(3.0);
55
// ======================================================================================================
56
double
si_z_pos[] = {25.,49.,73.,97.,121};
57
double
si_max_r = 44.;
58
double
si_min_r = 0.0001;
59
double
si_thick = 0.02811;
60
61
PHG4CylinderSubsystem
*cyl;
62
// here is our silicon:
63
for
(
int
ilayer = 0; ilayer < 5; ilayer++)
64
{
65
cyl =
new
PHG4CylinderSubsystem
(
"SVTX"
, ilayer);
66
cyl->
set_string_param
(
"material"
,
"G4_Si"
);
67
cyl->
set_double_param
(
"radius"
, si_min_r );
68
cyl->
set_double_param
(
"thickness"
, si_max_r );
69
cyl->
set_double_param
(
"place_z"
, si_z_pos[ilayer]);
70
cyl->
set_double_param
(
"length"
, si_thick );
71
cyl->
SetActive
();
72
cyl->
SuperDetector
(
"SVTX"
);
73
g4Reco->
registerSubsystem
(cyl);
74
}
75
76
FGEM_Init
();
// Loading forward GEM geometry
77
FGEMSetup
(g4Reco);
78
// ------------
79
// Forward RICH
80
EicFRichSubsystem
*
RICH
=
new
EicFRichSubsystem
(
"RICH"
);
81
g4Reco->
registerSubsystem
(RICH);
82
83
//---------------------------
84
PHG4TruthSubsystem
*truth =
new
PHG4TruthSubsystem
();
85
g4Reco->
registerSubsystem
(truth);
86
87
se->
registerSubsystem
(g4Reco);
88
89
//---------------------------
90
// fast pattern recognition and full Kalman filter
91
// output evaluation file for truth track and reco tracks are PHG4TruthInfoContainer
92
//---------------------------
93
PHG4TrackFastSim
*kalman =
new
PHG4TrackFastSim
(
"PHG4TrackFastSim"
);
94
kalman->
set_use_vertex_in_fitting
(
false
);
95
kalman->
set_sub_top_node_name
(
"SVTX"
);
96
kalman->
set_trackmap_out_name
(
"SvtxTrackMap"
);
97
98
// add Si Trtacker
99
kalman->
add_phg4hits
(
100
"G4HIT_SVTX"
,
// const std::string& phg4hitsNames,
101
PHG4TrackFastSim::Vertical_Plane
,
102
20./10000./sqrt(12.),
// radial-resolution [cm]
103
20./10000./sqrt(12.),
// azimuthal-resolution [cm]
104
999.,
// z-resolution [cm]
105
1,
// efficiency,
106
0
// noise hits
107
);
108
109
kalman->
add_phg4hits
(
"G4HIT_FGEM"
,
// const std::string& phg4hitsNames,
110
PHG4TrackFastSim::Vertical_Plane
,
// const DETECTOR_TYPE phg4dettype,
111
50
e
-4,
//1. / sqrt(12.), // const float radres,
112
50
e
-4,
// const float phires,
113
999.,
// longitudinal (z) resolution [cm] (this number is not used in vertical plane geometry)
114
1,
// const float eff,
115
0
// const float noise
116
);
117
118
//kalman->Verbosity(10);
119
se->
registerSubsystem
(kalman);
120
121
PHG4TrackFastSimEval
*fast_sim_eval =
new
PHG4TrackFastSimEval
(
"FastTrackingEval"
);
122
fast_sim_eval->
set_filename
(outputFile);
123
se->
registerSubsystem
(fast_sim_eval);
124
125
// ======================================================================================================
126
// IOManagers...
127
const
std::string dst_name = std::string(out_name+phi_range)+
"_G4LBLVtx.root"
;
128
Fun4AllDstOutputManager
*out =
new
Fun4AllDstOutputManager
(
"DSTOUT"
,dst_name);
129
out->
Verbosity
(0);
130
se->
registerOutputManager
(out);
131
132
Fun4AllInputManager
*
in
=
new
Fun4AllDummyInputManager
(
"JADE"
);
133
se->
registerInputManager
(in);
134
135
if
(nEvents <= 0)
return
;
136
137
se->
run
(nEvents);
138
se->
End
();
139
delete
se;
140
141
gSystem->Exit(0);
142
}
g4lblvtx
blob
master
macros
auxiliary_studies
hadron_phi_asymmetry
Fun4All_G4_simple_hadron_GEM.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:53
using
1.8.2 with
EIC GitHub integration