Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
Analysis Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
acts-fatras
analysis
analysis_tpc_prototype
coresoftware
blob
master
calibrations
generators
offline
database
framework
packages
CaloBase
CaloEmbedding
CaloReco
centrality
ClusterIso
compressor
decayfinder
epd
eventplaneinfo
globalvertex
Half
HFTrackEfficiency
intt
jetbackground
jetbase
KFParticle_sPHENIX
mbd
micromegas
mvtx
NodeDump
particleflow
PHField
PHGenFitPkg
PHGeometry
QAUtils
rawtodst
ResonanceJetTagging
tpc
tpccalib
tpcdaq
TPCHitTrackDisplay
trackbase
trackbase_historic
ActsTransformations.cc
ActsTransformations.h
PHG4ParticleSvtxMap.cc
PHG4ParticleSvtxMap.h
PHG4ParticleSvtxMap_v1.cc
PHG4ParticleSvtxMap_v1.h
PHG4ParticleSvtxMap_v1LinkDef.h
PHG4ParticleSvtxMapLinkDef.h
SvtxAlignmentState.cc
SvtxAlignmentState.h
SvtxAlignmentState_v1.cc
SvtxAlignmentState_v1.h
SvtxAlignmentState_v1LinkDef.h
SvtxAlignmentStateLinkDef.h
SvtxAlignmentStateMap.cc
SvtxAlignmentStateMap.h
SvtxAlignmentStateMap_v1.cc
SvtxAlignmentStateMap_v1.h
SvtxAlignmentStateMap_v1LinkDef.h
SvtxAlignmentStateMapLinkDef.h
SvtxPHG4ParticleMap.cc
SvtxPHG4ParticleMap.h
SvtxPHG4ParticleMap_v1.cc
SvtxPHG4ParticleMap_v1.h
SvtxPHG4ParticleMap_v1LinkDef.h
SvtxPHG4ParticleMapLinkDef.h
SvtxTrack.cc
SvtxTrack.h
SvtxTrack_FastSim.cc
SvtxTrack_FastSim.h
SvtxTrack_FastSim_v1.cc
SvtxTrack_FastSim_v1.h
SvtxTrack_FastSim_v1LinkDef.h
SvtxTrack_FastSim_v2.cc
SvtxTrack_FastSim_v2.h
SvtxTrack_FastSim_v2LinkDef.h
SvtxTrack_FastSim_v3.cc
SvtxTrack_FastSim_v3.h
SvtxTrack_FastSim_v3LinkDef.h
SvtxTrack_FastSimLinkDef.h
SvtxTrack_v1.cc
SvtxTrack_v1.h
SvtxTrack_v1LinkDef.h
SvtxTrack_v2.cc
SvtxTrack_v2.h
SvtxTrack_v2LinkDef.h
SvtxTrack_v3.cc
SvtxTrack_v3.h
SvtxTrack_v3LinkDef.h
SvtxTrack_v4.cc
SvtxTrack_v4.h
SvtxTrack_v4LinkDef.h
SvtxTrackCaloClusterMap.cc
SvtxTrackCaloClusterMap.h
SvtxTrackCaloClusterMap_v1.cc
SvtxTrackCaloClusterMap_v1.h
SvtxTrackCaloClusterMap_v1LinkDef.h
SvtxTrackCaloClusterMapLinkDef.h
SvtxTrackInfo.h
SvtxTrackInfo_v1.cc
SvtxTrackInfo_v1.h
SvtxTrackInfo_v1LinkDef.h
SvtxTrackInfoLinkDef.h
SvtxTrackLinkDef.h
SvtxTrackMap.cc
SvtxTrackMap.h
SvtxTrackMap_v1.cc
SvtxTrackMap_v1.h
SvtxTrackMap_v1LinkDef.h
SvtxTrackMap_v2.cc
SvtxTrackMap_v2.h
SvtxTrackMap_v2LinkDef.h
SvtxTrackMapLinkDef.h
SvtxTrackSeed_v1.cc
SvtxTrackSeed_v1.h
SvtxTrackSeed_v1LinkDef.h
SvtxTrackSeed_v2.cc
SvtxTrackSeed_v2.h
SvtxTrackSeed_v2LinkDef.h
SvtxTrackState.h
SvtxTrackState_v1.cc
SvtxTrackState_v1.h
SvtxTrackState_v1LinkDef.h
SvtxTrackState_v2.cc
SvtxTrackState_v2.h
SvtxTrackState_v2LinkDef.h
SvtxTrackStateLinkDef.h
TrackAnalysisUtils.cc
TrackAnalysisUtils.h
TrackInfoContainer.h
TrackInfoContainer_v1.cc
TrackInfoContainer_v1.h
TrackInfoContainer_v1LinkDef.h
TrackInfoContainerLinkDef.h
TrackSeed.cc
TrackSeed.h
TrackSeed_FastSim_v1.cc
TrackSeed_FastSim_v1.h
TrackSeed_FastSim_v1LinkDef.h
TrackSeed_v1.cc
TrackSeed_v1.h
TrackSeed_v1LinkDef.h
TrackSeedContainer.cc
TrackSeedContainer.h
TrackSeedContainer_v1.cc
TrackSeedContainer_v1.h
TrackSeedContainer_v1LinkDef.h
TrackSeedContainerLinkDef.h
TrackSeedLinkDef.h
TrackStateInfo.h
TrackStateInfo_v1.cc
TrackStateInfo_v1.h
TrackStateInfo_v1LinkDef.h
TrackStateInfoLinkDef.h
TrackerMillepedeAlignment
TrackingDiagnostics
trackreco
trigger
vararray
QA
simulation
validation
Doxygen_Assist
g4exampledetector
GenFit
JETSCAPE
KFParticle
macros
online_distribution
OnlMon
prototype
pythia6
rcdaq
RDBC
tutorials
doxygen_mainpage.h
File Members
Examples
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SvtxTrackState_v2.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SvtxTrackState_v2.cc
1
#include "
SvtxTrackState_v2.h
"
2
3
#include <iostream>
4
#include <utility>
// for swap
5
6
7
using namespace
std;
8
9
namespace
10
{
11
12
// square convenience function
13
template
<
class
T>
inline
constexpr
T
square
(
const
T
&
x
) {
return
x*
x
; }
14
15
// get unique index in cov. matrix array from i and j
16
inline
unsigned
int
covar_index(
unsigned
int
i
,
unsigned
int
j
)
17
{
18
if
(i > j)
std::swap
(i, j);
19
return
i + 1 + (j + 1) * (j) / 2 - 1;
20
}
21
22
}
23
24
SvtxTrackState_v2::SvtxTrackState_v2
(
float
pathlength)
25
: _pathlength(pathlength)
26
{
27
for
(
int
i
= 0;
i
< 3; ++
i
)
_pos
[
i
] = 0.0;
28
for
(
int
i
= 0;
i
< 3; ++
i
)
_mom
[
i
] = NAN;
29
for
(
int
i
= 0;
i
< 6; ++
i
)
30
{
31
for
(
int
j
=
i
;
j
< 6; ++
j
)
32
{
33
set_error
(
i
,
j
, 0.0);
34
}
35
}
36
state_name
=
"UNKNOWN"
;
37
}
38
39
void
SvtxTrackState_v2::identify
(std::ostream &
os
)
const
40
{
41
os <<
"---SvtxTrackState_v2-------------"
<< endl;
42
os <<
"pathlength: "
<<
get_pathlength
() << endl;
43
os <<
"(px,py,pz) = ("
44
<<
get_px
() <<
","
45
<<
get_py
() <<
","
46
<<
get_pz
() <<
")"
<< endl;
47
48
os <<
"(x,y,z) = ("
<<
get_x
() <<
","
<<
get_y
() <<
","
<<
get_z
() <<
")"
<< endl;
49
os <<
"---------------------------------"
<< endl;
50
}
51
52
float
SvtxTrackState_v2::get_error
(
unsigned
int
i
,
unsigned
int
j
)
const
53
{
54
return
_covar
[covar_index(i, j)];
55
}
56
57
void
SvtxTrackState_v2::set_error
(
unsigned
int
i
,
unsigned
int
j
,
float
value
)
58
{
59
_covar
[covar_index(i, j)] =
value
;
60
return
;
61
}
62
63
float
SvtxTrackState_v2::get_phi_error
()
const
64
{
65
const
float
r
= std::sqrt(
square
(
_pos
[0]) +
square
(
_pos
[1]));
66
if
(r > 0)
return
get_rphi_error
() /
r
;
67
return
0;
68
}
69
70
float
SvtxTrackState_v2::get_rphi_error
()
const
71
{
72
const
auto
phi
= -std::atan2(
_pos
[1],
_pos
[0] );
73
const
auto
cosphi = std::cos(
phi
);
74
const
auto
sinphi = std::sin(
phi
);
75
return
std::sqrt(
76
square
(sinphi)*
get_error
(0,0) +
77
square
(cosphi)*
get_error
(1,1) +
78
2.*cosphi*sinphi*
get_error
(0,1));
79
}
80
81
float
SvtxTrackState_v2::get_z_error
()
const
82
{
return
std::sqrt(
get_error
(2, 2)); }
coresoftware
blob
master
offline
packages
trackbase_historic
SvtxTrackState_v2.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:09
using
1.8.2 with
sPHENIX GitHub integration