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
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 <climits>
11
#include <cmath>
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
float
get_raw_light_yield
()
const
{
return
NAN; }
43
virtual
unsigned
int
get_layer
()
const
{
return
UINT_MAX; }
44
virtual
PHG4HitDefs::keytype
get_hit_id
()
const
{
return
ULONG_LONG_MAX; }
45
virtual
int
get_detid
()
const
{
return
INT_MIN; }
46
virtual
int
get_shower_id
()
const
{
return
INT_MIN; }
47
virtual
int
get_scint_id
()
const
{
return
INT_MIN; }
48
virtual
int
get_row
()
const
{
return
INT_MIN; }
49
virtual
int
get_sector
()
const
{
return
INT_MIN; }
50
virtual
int
get_trkid
()
const
{
return
INT_MIN; }
51
virtual
int
get_strip_z_index
()
const
{
return
INT_MIN; }
52
virtual
int
get_strip_y_index
()
const
{
return
INT_MIN; }
53
virtual
int
get_ladder_z_index
()
const
{
return
INT_MIN; }
54
virtual
int
get_ladder_phi_index
()
const
{
return
INT_MIN; }
55
virtual
int
get_index_i
()
const
{
return
INT_MIN; }
56
virtual
int
get_index_j
()
const
{
return
INT_MIN; }
57
virtual
int
get_index_k
()
const
{
return
INT_MIN; }
58
virtual
int
get_index_l
()
const
{
return
INT_MIN; }
59
virtual
int
get_hit_type
()
const
{
return
INT_MIN; }
60
61
virtual
void
set_x
(
const
int
,
const
float
) {
return
; }
62
virtual
void
set_y
(
const
int
,
const
float
) {
return
; }
63
virtual
void
set_z
(
const
int
,
const
float
) {
return
; }
64
virtual
void
set_px
(
const
int
,
const
float
) {
return
; }
65
virtual
void
set_py
(
const
int
,
const
float
) {
return
; }
66
virtual
void
set_pz
(
const
int
,
const
float
) {
return
; }
67
virtual
void
set_local_x
(
const
int
,
const
float
) {
return
; }
68
virtual
void
set_local_y
(
const
int
,
const
float
) {
return
; }
69
virtual
void
set_local_z
(
const
int
,
const
float
) {
return
; }
70
virtual
void
set_t
(
const
int
,
const
float
) {
return
; }
71
virtual
void
set_edep
(
const
float
) {
return
; }
72
virtual
void
set_eion
(
const
float
) {
return
; }
73
virtual
void
set_light_yield
(
const
float
) {
return
; }
74
virtual
void
set_raw_light_yield
(
const
float
) {
return
; }
75
virtual
void
set_path_length
(
const
float
) {
return
; }
76
virtual
void
set_layer
(
const
unsigned
int
) {
return
; }
77
virtual
void
set_hit_id
(
const
PHG4HitDefs::keytype
) {
return
; }
78
virtual
void
set_shower_id
(
const
int
) {
return
; }
79
virtual
void
set_scint_id
(
const
int
) {
return
; }
80
virtual
void
set_row
(
const
int
) {
return
; }
81
virtual
void
set_sector
(
const
int
) {
return
; }
82
virtual
void
set_trkid
(
const
int
) {
return
; }
83
virtual
void
set_strip_z_index
(
const
int
) {
return
; }
84
virtual
void
set_strip_y_index
(
const
int
) {
return
; }
85
virtual
void
set_ladder_z_index
(
const
int
) {
return
; }
86
virtual
void
set_ladder_phi_index
(
const
int
) {
return
; }
87
virtual
void
set_index_i
(
const
int
) {
return
; }
88
virtual
void
set_index_j
(
const
int
) {
return
; }
89
virtual
void
set_index_k
(
const
int
) {
return
; }
90
virtual
void
set_index_l
(
const
int
) {
return
; }
91
virtual
void
set_hit_type
(
const
int
) {
return
; }
92
93
virtual
float
get_avg_x
()
const
;
94
virtual
float
get_avg_y
()
const
;
95
virtual
float
get_avg_z
()
const
;
96
virtual
float
get_avg_t
()
const
;
97
98
virtual
void
print
()
const
{ std::cout <<
"PHG4Hit base class - print() not implemented"
<< std::endl; }
99
103
enum
PROPERTY
104
{
//
105
106
//-- hit properties: 1 - 10 --
108
prop_eion
= 1,
109
111
prop_light_yield
= 2,
112
scint_gammas
= 3,
113
cerenkov_gammas
= 4,
114
prop_raw_light_yield
= 5,
115
116
//-- track properties: 10 - 20 --
117
119
prop_px_0
= 10,
120
prop_px_1
= 11,
121
prop_py_0
= 12,
122
prop_py_1
= 13,
123
prop_pz_0
= 14,
124
prop_pz_1
= 15,
125
127
prop_path_length
= 16,
128
130
prop_local_x_0
= 20,
131
prop_local_x_1
= 21,
132
prop_local_y_0
= 22,
133
prop_local_y_1
= 23,
134
prop_local_z_0
= 24,
135
prop_local_z_1
= 25,
136
137
//-- detector specific IDs: 100+ --
138
140
prop_layer
= 101,
142
prop_scint_id
= 102,
144
prop_row
= 103,
146
prop_sector
= 104,
147
149
prop_strip_z_index
= 110,
150
prop_strip_y_index
= 111,
151
prop_ladder_z_index
= 112,
152
prop_ladder_phi_index
= 113,
153
154
// MAPS stuff
155
prop_stave_index
= 114,
156
prop_half_stave_index
= 115,
157
prop_module_index
= 116,
158
prop_chip_index
= 117,
159
160
prop_local_pos_x_0
= 118,
161
prop_local_pos_y_0
= 119,
162
prop_local_pos_z_0
= 120,
163
165
prop_index_i
= 121,
166
prop_index_j
= 122,
167
prop_index_k
= 123,
168
prop_index_l
= 124,
169
171
prop_hit_type
= 125,
172
173
prop_local_pos_x_1
= 128,
174
prop_local_pos_y_1
= 126,
175
prop_local_pos_z_1
= 127,
176
178
prop_MAX_NUMBER
= UCHAR_MAX
179
};
180
181
enum
PROPERTY_TYPE
182
{
//
183
type_int
= 1,
184
type_uint
= 2,
185
type_float
= 3,
186
type_unknown
= -1
187
};
188
189
virtual
bool
has_property
(
const
PROPERTY
/*prop_id*/
)
const
{
return
false
; }
190
virtual
float
get_property_float
(
const
PROPERTY
/*prop_id*/
)
const
{
return
NAN; }
191
virtual
int
get_property_int
(
const
PROPERTY
/*prop_id*/
)
const
{
return
INT_MIN; }
192
virtual
unsigned
int
get_property_uint
(
const
PROPERTY
/*prop_id*/
)
const
{
return
UINT_MAX; }
193
virtual
void
set_property
(
const
PROPERTY
/*prop_id*/
,
const
float
/*value*/
) {
return
; }
194
virtual
void
set_property
(
const
PROPERTY
/*prop_id*/
,
const
int
/*value*/
) {
return
; }
195
virtual
void
set_property
(
const
PROPERTY
/*prop_id*/
,
const
unsigned
int
/*value*/
) {
return
; }
196
static
std::pair<const std::string, PROPERTY_TYPE>
get_property_info
(
PROPERTY
prop_id);
197
static
bool
check_property
(
const
PROPERTY
prop_id,
const
PROPERTY_TYPE
prop_type);
198
static
std::string
get_property_type
(
const
PROPERTY_TYPE
prop_type);
199
200
protected
:
201
virtual
unsigned
int
get_property_nocheck
(
const
PROPERTY
/*prop_id*/
)
const
{
return
UINT_MAX; }
202
virtual
void
set_property_nocheck
(
const
PROPERTY
/*prop_id*/
,
const
unsigned
int
) {
return
; }
203
ClassDefOverride(
PHG4Hit
, 1)
204
};
205
206
inline
float
PHG4Hit::get_avg_x
()
const
{
return
0.5 * (
get_x
(0) +
get_x
(1)); }
207
inline
float
PHG4Hit::get_avg_y
()
const
{
return
0.5 * (
get_y
(0) +
get_y
(1)); }
208
inline
float
PHG4Hit::get_avg_z
()
const
{
return
0.5 * (
get_z
(0) +
get_z
(1)); }
209
inline
float
PHG4Hit::get_avg_t
()
const
{
return
0.5 * (
get_t
(0) +
get_t
(1)); }
210
211
#endif
coresoftware
blob
master
simulation
g4simulation
g4main
PHG4Hit.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:15
using
1.8.2 with
sPHENIX GitHub integration