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
PHG4DSTReader.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4DSTReader.h
1
// $Id: PHG4DSTReader.h,v 1.7 2015/02/27 23:42:23 jinhuang Exp $
2
10
#ifndef G4EVAL_PHG4DSTREADER_H
11
#define G4EVAL_PHG4DSTREADER_H
12
13
#include <
fun4all/SubsysReco.h
>
14
15
#include <boost/smart_ptr.hpp>
16
17
#include <set>
18
#include <string>
19
#include <vector>
20
21
class
PHCompositeNode
;
22
23
class
PHG4Particle
;
24
25
class
TClonesArray;
26
class
TTree;
27
32
class
PHG4DSTReader
:
public
SubsysReco
33
{
34
public
:
35
PHG4DSTReader
(
const
std::string
&
filename
);
36
~PHG4DSTReader
()
override
;
37
39
int
Init
(
PHCompositeNode
*)
override
;
40
42
int
process_event
(
PHCompositeNode
*)
override
;
43
45
int
End
(
PHCompositeNode
*)
override
;
46
47
void
48
AddNode
(
const
std::string
&
name
)
49
{
50
_node_postfix
.push_back(name);
51
}
52
53
void
54
AddHit
(
const
std::string
&
name
)
55
{
56
_node_postfix
.push_back(name);
57
}
58
59
void
60
AddTower
(
const
std::string
&
name
)
61
{
62
_tower_postfix
.push_back(name);
63
}
64
65
void
66
AddJet
(
const
std::string
&
name
)
67
{
68
_jet_postfix
.push_back(name);
69
}
70
73
void
74
set_load_all_particle
(
bool
b
)
75
{
76
_load_all_particle
=
b
;
77
}
78
80
void
81
set_load_active_particle
(
bool
b
)
82
{
83
_load_active_particle
=
b
;
84
}
85
87
void
88
set_save_particle
(
bool
b
)
89
{
90
_save_particle
=
b
;
91
}
92
94
void
95
set_save_vertex
(
bool
b
)
96
{
97
_save_vertex
=
b
;
98
}
99
101
double
102
get_tower_zero_sup
()
103
{
104
return
_save_particle
;
105
}
106
108
void
109
set_tower_zero_sup
(
double
b
)
110
{
111
_tower_zero_sup
=
b
;
112
}
113
114
protected
:
115
std::vector<std::string>
_node_postfix
;
116
std::vector<std::string>
_tower_postfix
;
117
std::vector<std::string>
_jet_postfix
;
118
// std::vector<std::string> _node_name;
119
int
nblocks
= 0;
120
121
typedef
boost::shared_ptr<TClonesArray>
arr_ptr
;
122
123
struct
record
124
{
125
unsigned
int
_cnt
;
126
std::string
_name
;
127
arr_ptr
_arr
;
128
TClonesArray *
_arr_ptr
;
129
130
enum
enu_type
131
{
132
typ_hit
,
133
typ_part
,
134
typ_vertex
,
135
typ_tower
,
136
typ_jets
137
};
138
enu_type
_type
;
139
};
140
typedef
std::vector<record>
records_t
;
141
records_t
_records
;
142
143
int
_event
= 0;
144
145
std::string
_out_file_name
;
146
147
// TFile * _file;
148
TTree *
_T
=
nullptr
;
149
151
bool
_save_particle
=
true
;
152
154
bool
_load_all_particle
=
true
;
155
157
bool
_load_active_particle
=
true
;
158
159
typedef
std::set<int>
PartSet_t
;
160
PartSet_t
_particle_set
;
161
PartSet_t
_vertex_set
;
162
164
bool
_save_vertex
=
true
;
165
167
double
_tower_zero_sup
= 0.;
168
170
void
171
add_particle
(
record
&rec,
PHG4Particle
*part);
172
173
void
174
build_tree
();
175
};
176
177
#endif
/* G4EVAL_PHG4DSTREADER_H */
coresoftware
blob
master
simulation
g4simulation
g4eval
PHG4DSTReader.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:14
using
1.8.2 with
sPHENIX GitHub integration