ECCE @ EIC Software
Reference for
ECCE @ 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
PHG4Hit.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4Hit.h
1
// Tell emacs that this is a C++ source
2
// -*- C++ -*-.
3
#ifndef G4MAIN_PHG4HIT_H
4
#define G4MAIN_PHG4HIT_H
5
6
#include "
PHG4HitDefs.h
"
7
8
#include <
phool/PHObject.h
>
9
10
#include <cmath>
11
#include <climits>
12
#include <iostream>
13
#include <string>
14
#include <utility>
15
16
class
PHG4Hit
:
public
PHObject
17
{
18
public
:
19
PHG4Hit
() {}
20
~PHG4Hit
()
override
{}
21
22
void
identify
(std::ostream& os = std::cout)
const override
;
23
void
CopyFrom
(
const
PHObject
*phobj)
override
;
24
friend
std::ostream &
operator<<
(std::ostream & stream,
const
PHG4Hit
* hit);
25
void
Reset
()
override
;
26
27
// The indices here represent the entry and exit points of the particle
28
virtual
float
get_x
(
const
int
)
const
{
return
NAN;}
29
virtual
float
get_y
(
const
int
)
const
{
return
NAN;}
30
virtual
float
get_z
(
const
int
)
const
{
return
NAN;}
31
virtual
float
get_px
(
const
int
)
const
{
return
NAN;}
32
virtual
float
get_py
(
const
int
)
const
{
return
NAN;}
33
virtual
float
get_pz
(
const
int
)
const
{
return
NAN;}
34
virtual
float
get_local_x
(
const
int
)
const
{
return
NAN;}
35
virtual
float
get_local_y
(
const
int
)
const
{
return
NAN;}
36
virtual
float
get_local_z
(
const
int
)
const
{
return
NAN;}
37
virtual
float
get_t
(
const
int
)
const
{
return
NAN;}
38
virtual
float
get_edep
()
const
{
return
NAN;}
39
virtual
float
get_eion
()
const
{
return
NAN;}
40
virtual
float
get_light_yield
()
const
{
return
NAN;}
41
virtual
float
get_path_length
()
const
{
return
NAN;}
42
virtual
unsigned
int
get_layer
()
const
{
return
UINT_MAX;}
43
virtual
PHG4HitDefs::keytype
get_hit_id
()
const
{
return
ULONG_LONG_MAX;}
44
virtual
int
get_detid
()
const
{
return
INT_MIN
;}
45
virtual
int
get_shower_id
()
const
{
return
INT_MIN
;}
46
virtual
int
get_scint_id
()
const
{
return
INT_MIN
;}
47
virtual
int
get_row
()
const
{
return
INT_MIN
;}
48
virtual
int
get_trkid
()
const
{
return
INT_MIN
;}
49
virtual
int
get_strip_z_index
()
const
{
return
INT_MIN
;}
50
virtual
int
get_strip_y_index
()
const
{
return
INT_MIN
;}
51
virtual
int
get_ladder_z_index
()
const
{
return
INT_MIN
;}
52
virtual
int
get_ladder_phi_index
()
const
{
return
INT_MIN
;}
53
virtual
int
get_index_i
()
const
{
return
INT_MIN
;}
54
virtual
int
get_index_j
()
const
{
return
INT_MIN
;}
55
virtual
int
get_index_k
()
const
{
return
INT_MIN
;}
56
virtual
int
get_index_l
()
const
{
return
INT_MIN
;}
57
virtual
int
get_hit_type
()
const
{
return
INT_MIN
;}
58
59
virtual
void
set_x
(
const
int
,
const
float
) {
return
;}
60
virtual
void
set_y
(
const
int
,
const
float
) {
return
;}
61
virtual
void
set_z
(
const
int
,
const
float
) {
return
;}
62
virtual
void
set_px
(
const
int
,
const
float
) {
return
;}
63
virtual
void
set_py
(
const
int
,
const
float
) {
return
;}
64
virtual
void
set_pz
(
const
int
,
const
float
) {
return
;}
65
virtual
void
set_local_x
(
const
int
,
const
float
) {
return
;}
66
virtual
void
set_local_y
(
const
int
,
const
float
) {
return
;}
67
virtual
void
set_local_z
(
const
int
,
const
float
) {
return
;}
68
virtual
void
set_t
(
const
int
,
const
float
) {
return
;}
69
virtual
void
set_edep
(
const
float
) {
return
;}
70
virtual
void
set_eion
(
const
float
) {
return
;}
71
virtual
void
set_light_yield
(
const
float
){
return
;}
72
virtual
void
set_path_length
(
const
float
){
return
;}
73
virtual
void
set_layer
(
const
unsigned
int
) {
return
;}
74
virtual
void
set_hit_id
(
const
PHG4HitDefs::keytype
) {
return
;}
75
virtual
void
set_shower_id
(
const
int
) {
return
;}
76
virtual
void
set_scint_id
(
const
int
) {
return
;}
77
virtual
void
set_row
(
const
int
) {
return
;}
78
virtual
void
set_trkid
(
const
int
) {
return
;}
79
virtual
void
set_strip_z_index
(
const
int
) {
return
;}
80
virtual
void
set_strip_y_index
(
const
int
) {
return
;}
81
virtual
void
set_ladder_z_index
(
const
int
) {
return
;}
82
virtual
void
set_ladder_phi_index
(
const
int
) {
return
;}
83
virtual
void
set_index_i
(
const
int
) {
return
;}
84
virtual
void
set_index_j
(
const
int
) {
return
;}
85
virtual
void
set_index_k
(
const
int
) {
return
;}
86
virtual
void
set_index_l
(
const
int
) {
return
;}
87
virtual
void
set_hit_type
(
const
int
) {
return
;}
88
89
virtual
float
get_avg_x
()
const
;
90
virtual
float
get_avg_y
()
const
;
91
virtual
float
get_avg_z
()
const
;
92
virtual
float
get_avg_t
()
const
;
93
94
virtual
void
print
()
const
{std::cout<<
"PHG4Hit base class - print() not implemented"
<<std::endl;}
95
96
100
enum
PROPERTY
101
{
//
102
103
//-- hit properties: 1 - 10 --
105
prop_eion
= 1,
106
108
prop_light_yield
= 2,
109
scint_gammas
= 3,
110
cerenkov_gammas
= 4,
111
112
//-- track properties: 10 - 20 --
113
115
prop_px_0
= 10,
116
prop_px_1
= 11,
117
prop_py_0
= 12,
118
prop_py_1
= 13,
119
prop_pz_0
= 14,
120
prop_pz_1
= 15,
121
123
prop_path_length
= 16,
124
126
prop_local_x_0
= 20,
127
prop_local_x_1
= 21,
128
prop_local_y_0
= 22,
129
prop_local_y_1
= 23,
130
prop_local_z_0
= 24,
131
prop_local_z_1
= 25,
132
133
//-- detector specific IDs: 100+ --
134
136
prop_layer
= 101,
138
prop_scint_id
= 102,
140
prop_row
= 103,
141
143
prop_strip_z_index
= 110,
144
prop_strip_y_index
= 111,
145
prop_ladder_z_index
= 112,
146
prop_ladder_phi_index
= 113,
147
148
// MAPS stuff
149
prop_stave_index
= 114,
150
prop_half_stave_index
= 115,
151
prop_module_index
= 116,
152
prop_chip_index
= 117,
153
154
prop_local_pos_x_0
= 118,
155
prop_local_pos_y_0
= 119,
156
prop_local_pos_z_0
= 120,
157
159
prop_index_i
= 121,
160
prop_index_j
= 122,
161
prop_index_k
= 123,
162
prop_index_l
= 124,
163
165
prop_hit_type
= 125,
166
167
prop_local_pos_x_1
= 128,
168
prop_local_pos_y_1
= 126,
169
prop_local_pos_z_1
= 127,
170
172
prop_MAX_NUMBER
= UCHAR_MAX
173
};
174
175
enum
PROPERTY_TYPE
176
{
//
177
type_int
= 1,
178
type_uint
= 2,
179
type_float
= 3,
180
type_unknown
= -1
181
};
182
183
virtual
bool
has_property
(
const
PROPERTY
/*prop_id*/
)
const
{
return
false
;}
184
virtual
float
get_property_float
(
const
PROPERTY
/*prop_id*/
)
const
{
return
NAN;}
185
virtual
int
get_property_int
(
const
PROPERTY
/*prop_id*/
)
const
{
return
INT_MIN
;}
186
virtual
unsigned
int
get_property_uint
(
const
PROPERTY
/*prop_id*/
)
const
{
return
UINT_MAX;}
187
virtual
void
set_property
(
const
PROPERTY
/*prop_id*/
,
const
float
/*value*/
) {
return
;}
188
virtual
void
set_property
(
const
PROPERTY
/*prop_id*/
,
const
int
/*value*/
) {
return
;}
189
virtual
void
set_property
(
const
PROPERTY
/*prop_id*/
,
const
unsigned
int
/*value*/
) {
return
;}
190
static
std::pair<const std::string,PROPERTY_TYPE>
get_property_info
(
PROPERTY
prop_id);
191
static
bool
check_property
(
const
PROPERTY
prop_id,
const
PROPERTY_TYPE
prop_type);
192
static
std::string
get_property_type
(
const
PROPERTY_TYPE
prop_type);
193
194
protected
:
195
virtual
unsigned
int
get_property_nocheck
(
const
PROPERTY
/*prop_id*/
)
const
{
return
UINT_MAX;}
196
virtual
void
set_property_nocheck
(
const
PROPERTY
/*prop_id*/
,
const
unsigned
int
) {
return
;}
197
ClassDefOverride(
PHG4Hit
,1)
198
};
199
200
201
inline
float
PHG4Hit::get_avg_x
()
const
{
return
0.5*(
get_x
(0)+
get_x
(1)); }
202
inline
float
PHG4Hit::get_avg_y
()
const
{
return
0.5*(
get_y
(0)+
get_y
(1)); }
203
inline
float
PHG4Hit::get_avg_z
()
const
{
return
0.5*(
get_z
(0)+
get_z
(1)); }
204
inline
float
PHG4Hit::get_avg_t
()
const
{
return
0.5*(
get_t
(0)+
get_t
(1)); }
205
206
207
#endif
coresoftware
blob
master
simulation
g4simulation
g4main
PHG4Hit.h
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:44
using
1.8.2 with
ECCE GitHub integration