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
PHG4TrackFastSimEval.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4TrackFastSimEval.h
1
// Tell emacs that this is a C++ source
2
// -*- C++ -*-.
10
#ifndef G4TRACKFASTSIM_PHG4TRACKFASTSIMEVAL_H
11
#define G4TRACKFASTSIM_PHG4TRACKFASTSIMEVAL_H
12
13
#include <
fun4all/SubsysReco.h
>
14
15
#include <map>
16
#include <string>
17
#include <vector>
18
19
//Forward declarations
20
class
PHCompositeNode
;
21
class
PHG4TruthInfoContainer
;
22
class
SvtxTrackMap
;
23
class
SvtxVertexMap
;
24
class
TTree;
25
class
TH2D;
26
27
//Brief: basic ntuple and histogram creation for sim evaluation
28
class
PHG4TrackFastSimEval
:
public
SubsysReco
29
{
30
public
:
31
//Default constructor
32
PHG4TrackFastSimEval
(
const
std::string
&
name
=
"PHG4TrackFastSimEval"
,
33
const
std::string
&
filename
=
"g4eval.root"
,
34
const
std::string
& trackmapname =
"SvtxTrackMap"
);
35
36
//Initialization, called for initialization
37
int
Init
(
PHCompositeNode
*)
override
;
38
39
//Initialization, called for initialization
40
int
InitRun
(
PHCompositeNode
*)
override
;
41
42
//Process Event, called for each event
43
int
process_event
(
PHCompositeNode
*)
override
;
44
45
//End, write and close files
46
int
End
(
PHCompositeNode
*)
override
;
47
48
//Change output filename
49
void
set_filename
(
const
std::string
&
file
)
50
{
51
m_OutFileName
=
file
;
52
}
53
54
// set the name of the node with the trackmap
55
void
set_trackmapname
(
const
std::string
&
name
)
56
{
57
m_TrackMapName
=
name
;
58
}
59
60
//User modules
61
void
reset_variables
();
62
63
void
AddProjection
(
const
std::string
&
name
);
64
65
private
:
66
void
fill_track_tree
(
PHCompositeNode
*);
67
void
fill_vertex_tree
(
PHCompositeNode
*);
68
69
//Get all the nodes
70
int
GetNodes
(
PHCompositeNode
*);
71
72
//Node pointers
73
PHG4TruthInfoContainer
*
m_TruthInfoContainer
;
74
SvtxTrackMap
*
m_TrackMap
;
75
SvtxVertexMap
*
m_VertexMap
;
76
77
//TTrees
78
TTree*
m_TracksEvalTree
;
79
TTree*
m_VertexEvalTree
;
80
81
//Histos
82
TH2D*
m_H2D_DeltaMomVsTruthMom
;
83
TH2D*
m_H2D_DeltaMomVsTruthEta
;
84
85
//Event counter
86
int
m_EventCounter
;
87
88
// TTree variables
89
int
m_TTree_Event
;
90
//-- truth
91
int
m_TTree_gTrackID
;
92
int
m_TTree_gFlavor
;
93
float
m_TTree_gpx
;
94
float
m_TTree_gpy
;
95
float
m_TTree_gpz
;
96
float
m_TTree_gvx
;
97
float
m_TTree_gvy
;
98
float
m_TTree_gvz
;
99
float
m_TTree_gvt
;
100
101
//-- reco
102
int
m_TTree_TrackID
;
103
int
m_TTree_Charge
;
104
int
m_TTree_nHits
;
105
float
m_TTree_px
;
106
float
m_TTree_py
;
107
float
m_TTree_pz
;
108
float
m_TTree_pcax
;
109
float
m_TTree_pcay
;
110
float
m_TTree_pcaz
;
111
float
m_TTree_dca2d
;
112
113
std::map<int, int>
m_TTree_HitContainerID_nHits_map
;
114
115
//vertex
116
float
m_TTree_vx
;
117
float
m_TTree_vy
;
118
float
m_TTree_vz
;
119
float
m_TTree_DeltaVx
;
120
float
m_TTree_DeltaVy
;
121
float
m_TTree_DeltaVz
;
122
int
m_TTree_nTracks
;
123
int
m_TTree_nFromTruth
;
124
125
//output filename
126
std::string
m_OutFileName
;
127
128
//name of SvtxTrackMap collection
129
std::string
m_TrackMapName
;
130
131
// names and index of projections
132
std::map<std::string, unsigned int>
m_ProjectionNameMap
;
133
// projections to cylinders and planes
134
std::vector<std::vector<float>>
m_TTree_proj_vec
;
135
std::vector<std::vector<float>>
m_TTree_proj_p_vec
;
136
// hits on reference cylinders and planes
137
std::vector<std::vector<float>>
m_TTree_ref_vec
;
138
std::vector<std::vector<float>>
m_TTree_ref_p_vec
;
139
140
};
141
142
#endif //* G4TRACKFASTSIM_PHG4TRACKFASTSIMEVAL_H *//
coresoftware
blob
master
simulation
g4simulation
g4trackfastsim
PHG4TrackFastSimEval.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:16
using
1.8.2 with
sPHENIX GitHub integration