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
PHG4TpcElectronDrift.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4TpcElectronDrift.h
1
// Tell emacs that this is a C++ source
2
// -*- C++ -*-.
3
#ifndef G4TPC_PHG4TPCELECTRONDRIFT_H
4
#define G4TPC_PHG4TPCELECTRONDRIFT_H
5
6
#include "
TpcClusterBuilder.h
"
7
8
#include <array>
9
#include <cmath>
10
#include <fstream>
11
#include <
fun4all/SubsysReco.h
>
12
#include <
g4main/PHG4HitContainer.h
>
13
#include <gsl/gsl_rng.h>
14
#include <memory>
15
#include <phparameter/PHParameterInterface.h>
16
#include <string>
17
#include <
trackbase/ActsGeometry.h
>
18
19
class
PHG4TpcPadPlane
;
20
class
PHG4TpcDistortion
;
21
class
PHCompositeNode
;
22
class
TH1;
23
class
TH2;
24
class
TNtuple;
25
class
TFile;
26
class
TrkrHitSetContainer
;
27
class
TrkrHitTruthAssoc
;
28
class
TrkrTruthTrackContainer
;
29
class
TrkrClusterContainer
;
30
class
TrkrTruthTrack
;
31
class
DistortedTrackContainer;
32
class
TpcClusterBuilder
;
33
class
PHG4TpcCylinderGeomContainer
;
34
class
ClusHitsVerbose
;
35
36
class
PHG4TpcElectronDrift
:
public
SubsysReco
,
public
PHParameterInterface
37
{
38
public
:
39
PHG4TpcElectronDrift
(
const
std::string
&
name
=
"PHG4TpcElectronDrift"
);
40
~PHG4TpcElectronDrift
()
override
{ };
41
int
Init
(
PHCompositeNode
*)
override
;
42
int
InitRun
(
PHCompositeNode
*)
override
;
43
int
process_event
(
PHCompositeNode
*)
override
;
44
int
End
(
PHCompositeNode
*)
override
;
45
46
void
SetDefaultParameters
()
override
;
47
49
void
Detector
(
const
std::string
&d)
50
{
51
detector
= d;
52
}
53
55
std::string
Detector
()
const
56
{
57
return
detector
;
58
}
59
61
void
set_seed
(
const
unsigned
int
iseed);
62
64
void
setTpcDistortion
(
PHG4TpcDistortion
*);
65
66
//
67
void
set_flag_threshold_distortion
(
bool
setflag,
float
setthreshold)
68
{
69
printf
(
"The logical status of threshold is now %d! and the value is set to %f\n\n\n"
, setflag, setthreshold);
70
do_getReachReadout
= setflag;
71
thresholdforreachesreadout
= setthreshold;
72
}
73
74
76
void
registerPadPlane
(
PHG4TpcPadPlane
*
padplane
);
77
78
// cluster the PHG4Tracks individually
79
TpcClusterBuilder
truth_clusterer
{};
80
void
set_pixel_thresholdrat
(
double
val) {
truth_clusterer
.
set_pixel_thresholdrat
(val); };
81
void
set_max_g4hitstep
(
float
_
) {
max_g4hitstep
=
_
; };
82
void
set_ClusHitsVerbose
(
bool
set
=
true
) {
record_ClusHitsVerbose
=
set
; };
83
void
set_zero_bfield_flag
(
bool
flag) {
zero_bfield
= flag; };
84
void
set_zero_bfield_diffusion_factor
(
double
f
) {
zero_bfield_diffusion_factor
=
f
; };
85
ClusHitsVerbosev1
*
mClusHitsVerbose
{
nullptr
};
86
87
private
:
88
float
max_g4hitstep
{ 7. };
89
bool
record_ClusHitsVerbose
{
false
};
91
/* TpcClusterBuilder MapToPadPlane(const double x, const double y, const */
92
/* double z, const unsigned int side, PHG4HitContainer::ConstIterator hiter, */
93
/* TNtuple *ntpad, TNtuple *nthit); */
94
95
std::ofstream
f_out
;
96
97
TrkrHitSetContainer
*
hitsetcontainer
=
nullptr
;
98
TrkrHitTruthAssoc
*
hittruthassoc
=
nullptr
;
99
TrkrTruthTrackContainer
*
truthtracks
=
nullptr
;
100
TrkrTruthTrack
*
truth_track
=
nullptr
;
101
TrkrClusterContainer
*
truthclustercontainer
=
nullptr
;
// the TrkrClusterContainer for truth clusters
102
std::unique_ptr<TrkrHitSetContainer>
temp_hitsetcontainer
;
103
std::unique_ptr<TrkrHitSetContainer>
single_hitsetcontainer
;
104
std::unique_ptr<PHG4TpcPadPlane>
padplane
;
105
106
std::unique_ptr<PHG4TpcDistortion>
m_distortionMap
;
107
ActsGeometry
*
m_tGeometry
;
108
PHG4TpcCylinderGeomContainer
*
seggeo
;
109
110
int
event_num
= 0;
111
float
thresholdforreachesreadout
= 0.5;
112
bool
do_ElectronDriftQAHistos
=
false
;
113
bool
do_getReachReadout
=
false
;
114
116
117
TH1 *
dlong
=
nullptr
;
118
TH1 *
dtrans
=
nullptr
;
119
TH2 *
hitmapstart
=
nullptr
;
120
TH2 *
hitmapend
=
nullptr
;
121
TH2 *
z_startmap
=
nullptr
;
122
TH2 *
deltaphi
=
nullptr
;
123
TH2 *
deltar
=
nullptr
;
124
TH2 *
deltaphinodiff
=
nullptr
;
125
TH2 *
deltaRphinodiff
=
nullptr
;
126
TH2 *
deltaphivsRnodiff
=
nullptr
;
127
TH2 *
deltaphinodist
=
nullptr
;
128
TH2 *
deltarnodiff
=
nullptr
;
129
TH2 *
deltarnodist
=
nullptr
;
130
TH2 *
deltaz
=
nullptr
;
132
133
std::unique_ptr<TFile>
m_outf
;
134
std::unique_ptr<TFile>
EDrift_outf
;
135
136
TNtuple *
nt
=
nullptr
;
137
TNtuple *
nthit
=
nullptr
;
138
TNtuple *
ntfinalhit
=
nullptr
;
139
TNtuple *
ntpad
=
nullptr
;
140
141
std::string
detector
;
142
std::string
hitnodename
;
143
std::string
seggeonodename
;
144
145
double
diffusion_trans
= NAN;
146
double
added_smear_sigma_trans
= NAN;
147
double
diffusion_long
= NAN;
148
double
added_smear_sigma_long
= NAN;
149
double
drift_velocity
= NAN;
150
double
tpc_length
= NAN;
151
double
electrons_per_gev
= NAN;
152
double
min_active_radius
= NAN;
153
double
max_active_radius
= NAN;
154
double
min_time
= NAN;
155
double
max_time
= NAN;
156
157
bool
zero_bfield
=
false
;
158
double
zero_bfield_diffusion_factor
= 3.5;
// at drift voltage of 400 V
159
161
class
Deleter
162
{
163
public
:
165
void
operator()
(gsl_rng *
rng
)
const
{ gsl_rng_free(rng); }
166
};
167
std::unique_ptr<gsl_rng, Deleter>
RandomGenerator
;
168
};
169
170
#endif // G4TPC_PHG4TPCELECTRONDRIFT_H
coresoftware
blob
master
simulation
g4simulation
g4tpc
PHG4TpcElectronDrift.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:16
using
1.8.2 with
sPHENIX GitHub integration