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_Lmon.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Fun4All_G4_Lmon.C
1
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
2
#include <
fun4all/SubsysReco.h
>
3
#include <
fun4all/Fun4AllServer.h
>
4
#include <
fun4all/Fun4AllInputManager.h
>
5
#include <
fun4all/Fun4AllDummyInputManager.h
>
6
#include <
fun4all/Fun4AllOutputManager.h
>
7
#include <
fun4all/Fun4AllDstOutputManager.h
>
8
#include <
g4detectors/PHG4DetectorSubsystem.h
>
9
#include <
g4histos/G4HitNtuple.h
>
10
#include <
g4main/PHG4ParticleGeneratorBase.h
>
11
#include <
g4main/PHG4ParticleGenerator.h
>
12
#include <
g4main/PHG4SimpleEventGenerator.h
>
13
#include <
g4main/PHG4ParticleGun.h
>
14
#include <
g4main/PHG4Reco.h
>
15
#include <g4lmondetector/G4LmonSubsystem.h>
16
#include <
phool/recoConsts.h
>
17
18
R__LOAD_LIBRARY
(libfun4all.so)
19
R__LOAD_LIBRARY
(libg4detectors.so)
20
R__LOAD_LIBRARY
(libg4lmondetector.so)
21
R__LOAD_LIBRARY
(libg4histos.so)
22
23
#endif
24
25
void
Fun4All_G4_Lmon
(
int
nEvents
= 1)
26
{
27
28
gSystem->Load(
"libfun4all"
);
29
gSystem->Load(
"libg4detectors"
);
30
gSystem->Load(
"libg4testbench"
);
31
gSystem->Load(
"libg4histos"
);
32
gSystem->Load(
"libg4lmondetector.so"
);
33
35
// Make the Server
37
Fun4AllServer
*se =
Fun4AllServer::instance
();
38
recoConsts
*rc =
recoConsts::instance
();
39
// if you want to fix the random seed to reproduce results
40
// set this flag
41
// rc->set_IntFlag("RANDOMSEED",12345);
42
43
//
44
// Particle Generator
45
//
46
47
// the PHG4ParticleGenerator makes cones using phi and eta
48
PHG4ParticleGenerator
*gen =
new
PHG4ParticleGenerator
();
49
gen->
set_name
(
"geantino"
);
50
gen->
set_vtx
(0, 3, 0);
51
gen->
set_eta_range
(-0.9, 0.9);
52
gen->
set_mom_range
(1.0, 10.0);
53
gen->
set_z_range
(0.,0.);
54
gen->
set_phi_range
(0.*TMath::Pi(), 2.*TMath::Pi());
55
// se->registerSubsystem(gen);
56
57
PHG4ParticleGun
*gun =
new
PHG4ParticleGun
();
58
gun->
set_name
(
"gamma"
);
59
//gun->set_name("geantino");
60
gun->
AddParticle
(
"pi-"
, 0, 0, -1);
// see the magnetic field with this one
61
gun->
set_vtx
(0, 0, 0);
// shoots right into the original Examle01 volume
62
gun->
set_mom
(0, 0, -1);
// hits the tagger
63
se->
registerSubsystem
(gun);
64
65
//
66
// Geant4 setup
67
//
68
PHG4Reco
* g4Reco =
new
PHG4Reco
();
69
g4Reco->
set_field
(0);
// no field
70
g4Reco->
save_DST_geometry
(
false
);
71
// try non default physics lists
72
//g4Reco->SetPhysicsList("FTFP_BERT_HP");
73
74
G4LmonSubsystem
*lmon =
new
G4LmonSubsystem
(
"LumiMon"
);
75
g4Reco->
registerSubsystem
(lmon);
76
77
se->
registerSubsystem
( g4Reco );
78
// this (dummy) input manager just drives the event loop
79
Fun4AllInputManager
*
in
=
new
Fun4AllDummyInputManager
(
"Dummy"
);
80
se->
registerInputManager
( in );
81
// events = 0 => run forever
82
if
(
nEvents
<= 0)
83
{
84
return
0;
85
}
86
se->
run
(
nEvents
);
87
lmon->
Print
();
88
se->
End
();
89
std::cout <<
"All done"
<< std::endl;
90
delete
se;
91
gSystem->Exit(0);
92
}
Fun4All-lmon
blob
master
macros
Fun4All_G4_Lmon.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:38
using
1.8.2 with
EIC GitHub integration