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
sPHElectronv1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file sPHElectronv1.cc
1
#include "
sPHElectronv1.h
"
2
3
#include <
trackbase_historic/SvtxTrack.h
>
4
#include <
trackbase/TrkrDefs.h
>
5
6
#include <cmath>
7
#include <utility>
// for swap
8
9
sPHElectronv1::sPHElectronv1
()
10
{
11
_id
= 99999;
12
_charge
= 0;
13
_px
= 0.;
14
_py
= 0.;
15
_pz
= 0.;
16
_emce
= 0.;
17
_dphi
= 99999.;
18
_deta
= 99999.;
19
_e3x3
= 0.;
20
_e5x5
= 0.;
21
22
_chi2
= 99999.;
23
_ndf
= 0;
24
_zvtx
= 99999.;
25
_dca2d
= 99999.;
26
_dca2d_error
= 99999.;
27
_dca3d_xy
= 99999.;
28
_dca3d_z
= 99999.;
29
30
_nmvtx
= 0;
31
_ntpc
= 0;
32
33
_cemc_ecore
= 0.;
34
_cemc_chi2
= 99999.;
35
_cemc_prob
= 99999.;
36
_cemc_dphi
= 99999.;
37
_cemc_deta
= 99999.;
38
_hcalin_e
= 99999.;
39
_hcalin_dphi
= 99999.;
40
_hcalin_deta
= 99999.;
41
42
}
43
44
sPHElectronv1::sPHElectronv1
(
const
SvtxTrack
* trk) {
45
_id
= trk->
get_id
();
46
_charge
= trk->
get_charge
();
47
_px
= trk->
get_px
();
48
_py
= trk->
get_py
();
49
_pz
= trk->
get_pz
();
50
_dphi
= trk->
get_cal_dphi
(
SvtxTrack::CAL_LAYER::CEMC
);
51
_deta
= trk->
get_cal_deta
(
SvtxTrack::CAL_LAYER::CEMC
);
52
_emce
= trk->
get_cal_cluster_e
(
SvtxTrack::CAL_LAYER::CEMC
);
53
_e3x3
= trk->
get_cal_energy_3x3
(
SvtxTrack::CAL_LAYER::CEMC
);
54
_e5x5
= trk->
get_cal_energy_5x5
(
SvtxTrack::CAL_LAYER::CEMC
);
55
56
_chi2
= trk->
get_chisq
();
57
_ndf
= trk->
get_ndf
();
58
_zvtx
= trk->
get_z
();
59
_dca2d
= trk->
get_dca2d
();
60
_dca2d_error
= trk->
get_dca2d_error
();
61
_dca3d_xy
= trk->
get_dca3d_xy
();
62
_dca3d_z
= trk->
get_dca3d_z
();
63
64
_cemc_ecore
= 0.;
65
_cemc_chi2
= 99999.;
66
_cemc_prob
= 99999.;
67
_cemc_dphi
= trk->
get_cal_dphi
(
SvtxTrack::CAL_LAYER::CEMC
);
68
_cemc_deta
= trk->
get_cal_deta
(
SvtxTrack::CAL_LAYER::CEMC
);
69
_hcalin_e
= trk->
get_cal_cluster_e
(
SvtxTrack::CAL_LAYER::HCALIN
);
70
_hcalin_dphi
= trk->
get_cal_dphi
(
SvtxTrack::CAL_LAYER::HCALIN
);
71
_hcalin_deta
= trk->
get_cal_deta
(
SvtxTrack::CAL_LAYER::HCALIN
);
72
73
_nmvtx
= 0;
74
_ntpc
= 0;
75
for
(
SvtxTrack::ConstClusterKeyIter
iter = trk->
begin_cluster_keys
();
76
iter != trk->
end_cluster_keys
();
77
++iter)
78
{
79
TrkrDefs::cluskey
cluster_key = *iter;
80
int
trackerid =
TrkrDefs::getTrkrId
(cluster_key);
81
if
(trackerid==0)
_nmvtx
++;
82
if
(trackerid==2)
_ntpc
++;
83
}
84
}
85
86
sPHElectronv1::sPHElectronv1
(
const
sPHElectronv1
&
electron
)
87
{
88
*
this
=
electron
;
89
return
;
90
}
91
92
sPHElectronv1
&
sPHElectronv1::operator=
(
const
sPHElectronv1
&
electron
)
93
{
94
_id
= electron.
get_id
();
95
_charge
= electron.
get_charge
();
96
_px
= electron.
get_px
();
97
_py
= electron.
get_py
();
98
_pz
= electron.
get_pz
();
99
_dphi
= electron.
get_dphi
();
100
_deta
= electron.
get_deta
();
101
_emce
= electron.
get_emce
();
102
_e3x3
= electron.
get_e3x3
();
103
_e5x5
= electron.
get_e5x5
();
104
105
_chi2
= electron.
get_chi2
();
106
_ndf
= electron.
get_ndf
();
107
_zvtx
= electron.
get_zvtx
();
108
_dca2d
= electron.
get_dca2d
();
109
_dca2d_error
= electron.
get_dca2d_error
();
110
_dca3d_xy
= electron.
get_dca3d_xy
();
111
_dca3d_z
= electron.
get_dca3d_z
();
112
113
_nmvtx
= electron.
get_nmvtx
();
114
_ntpc
= electron.
get_ntpc
();
115
116
_cemc_ecore
= electron.
get_cemc_ecore
();
117
_cemc_chi2
= electron.
get_cemc_chi2
();
118
_cemc_prob
= electron.
get_cemc_prob
();
119
_cemc_dphi
= electron.
get_cemc_dphi
();
120
_cemc_deta
= electron.
get_cemc_deta
();
121
_hcalin_e
= electron.
get_hcalin_e
();
122
_hcalin_dphi
= electron.
get_hcalin_dphi
();
123
_hcalin_deta
= electron.
get_hcalin_deta
();
124
125
return
*
this
;
126
}
127
128
void
sPHElectronv1::identify
(std::ostream&
os
)
const
129
{
130
os <<
" sPHElectronv1 object"
<< std::endl;
131
return
;
132
}
133
134
int
sPHElectronv1::isValid
()
const
135
{
136
if
(
_charge
!=0) {
return
1;}
else
{
return
0;}
137
}
138
analysis
blob
master
EventMix
src
sPHElectronv1.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:51
using
1.8.2 with
sPHENIX GitHub integration