Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Fun4All_EICAnalysis_TrackEval.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Fun4All_EICAnalysis_TrackEval.C
1
/* To run this macro, need to compile the library from analysis/Tracking/FastTrackingEval */
2
3
int
Fun4All_EICAnalysis_TrackEval
(
4
const
int
nEvents
= 10,
5
const
char
* inputFile =
"/gpfs/mnt/gpfs04/sphenix/user/nfeege/sphenixsw/devel/analysis/EICAnalysis/data/G4EICDetector_DIS_SingleParticle_ele_10GeV_m3eta.root"
,
6
// const char * inputFile = "/gpfs/mnt/gpfs04/sphenix/user/nfeege/sphenixsw/devel/analysis/EICAnalysis/data/G4EICDetector_DIS_SingleParticle_ele_10GeV_m2eta.root",
7
// const char * inputFile = "/gpfs/mnt/gpfs04/sphenix/user/nfeege/sphenixsw/devel/analysis/EICAnalysis/data/G4EICDetector_DIS_SingleParticle_ele_10GeV_m05eta.root",
8
// const char * inputFile = "/gpfs/mnt/gpfs04/sphenix/user/nfeege/sphenixsw/devel/analysis/EICAnalysis/data/G4EICDetector_DIS_SingleParticle_ele_10GeV_p05eta.root",
9
// const char * inputFile = "/gpfs/mnt/gpfs04/sphenix/user/nfeege/sphenixsw/devel/analysis/EICAnalysis/data/G4EICDetector_DIS_SingleParticle_ele_10GeV_p2eta.root",
10
const
char
* evalFile =
"eval_track_fastsim.root"
11
)
12
{
13
14
bool
readdst =
true
;
15
bool
readhepmc =
false
;
16
17
//---------------
18
// Load libraries
19
//---------------
20
21
gSystem->Load(
"libeicana.so"
);
22
gSystem->Load(
"libfun4all.so"
);
23
gSystem->Load(
"libg4eval.so"
);
24
25
//---------------
26
// Fun4All server
27
//---------------
28
29
Fun4AllServer
*se =
Fun4AllServer::instance
();
30
se->
Verbosity
(0);
31
// just if we set some flags somewhere in this macro
32
recoConsts
*rc =
recoConsts::instance
();
33
34
//--------------
35
// Additional tracking modules
36
//--------------
37
38
gROOT->LoadMacro(
"G4_FastSim_Reco_EIC.C"
);
39
FastSim_Reco_EIC
();
40
41
//--------------
42
// Analysis modules
43
//--------------
44
45
gSystem->Load(
"libFastTrackingEval.so"
);
46
FastTrackingEval
* eval_fasttrack;
47
eval_fasttrack =
new
FastTrackingEval
(
"FASTTRACKEVALUATOR"
, evalFile,
"SvtxTrackMap_FastSim"
);
48
se->
registerSubsystem
( eval_fasttrack );
49
50
//SvtxEvaluator* eval;
51
//eval = new SvtxEvaluator("SVTXEVALUATOR", "track_eval.root", "SvtxTrackMap_FastSim");
53
//eval->do_cluster_eval(true);
54
//eval->do_g4hit_eval(true);
55
//eval->do_hit_eval(false); // enable to see the hits that includes the chamber physics...
56
//eval->do_gpoint_eval(false);
57
//eval->scan_for_embedded(false); // take all tracks if false - take only embedded tracks if true
58
//eval->Verbosity(0);
59
//se->registerSubsystem(eval);
60
61
//--------------
62
// IO management
63
//--------------
64
65
/* Read DST Files */
66
if
( readdst )
67
{
68
Fun4AllInputManager
*hitsin =
new
Fun4AllDstInputManager
(
"DSTin"
);
69
hitsin->
fileopen
(inputFile);
70
se->
registerInputManager
(hitsin);
71
}
72
/* Read HepMC ASCII files */
73
else
if
( readhepmc )
74
{
75
Fun4AllInputManager
*
in
=
new
Fun4AllHepMCInputManager
(
"DSTIN"
);
76
se->
registerInputManager
( in );
77
se->
fileopen
( in->
Name
().c_str(), inputFile );
78
}
79
80
81
//-----------------
82
// Event processing
83
//-----------------
84
if
(
nEvents
< 0)
85
{
86
return
;
87
}
88
// if we run the particle generator and use 0 it'll run forever
89
if
(
nEvents
== 0 && !readhits && !readhepmc)
90
{
91
cout <<
"using 0 for number of events is a bad idea when using particle generators"
<< endl;
92
cout <<
"it will run forever, so I just return without running anything"
<< endl;
93
return
;
94
}
95
96
se->
run
(
nEvents
);
97
98
//-----
99
// Exit
100
//-----
101
102
se->
End
();
103
std::cout <<
"All done"
<< std::endl;
104
delete
se;
105
gSystem->Exit(0);
106
}
analysis
blob
master
EICAnalysis
macros
diskinematics_fun4all
Fun4All_EICAnalysis_TrackEval.C
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:48
using
1.8.2 with
sPHENIX GitHub integration