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
TrkrClusterv3.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file TrkrClusterv3.cc
1
7
#include "
TrkrClusterv3.h
"
8
9
#include <cmath>
10
#include <utility>
// for swap
11
12
namespace
13
{
14
// square convenience function
15
template
<
class
T>
inline
constexpr
T
square
(
const
T
&
x
)
16
{
return
x*
x
; }
17
}
18
19
TrkrClusterv3::TrkrClusterv3
()
20
: m_cluskey(TrkrDefs::CLUSKEYMAX)
21
, m_subsurfkey(TrkrDefs::SUBSURFKEYMAX)
22
, m_adc(0xFFFFFFFF)
23
{
24
for
(
int
i
= 0;
i
< 2;
i
++)
25
{
26
m_local
[
i
] = NAN;
27
for
(
int
j
= 0;
j
< 2;
j
++)
28
{
29
m_actsLocalErr
[
i
][
j
] = NAN;
30
}
31
}
32
}
33
34
void
TrkrClusterv3::identify
(std::ostream&
os
)
const
35
{
36
os <<
"---TrkrClusterv3--------------------"
<< std::endl;
37
38
os <<
" (rphi,z) = ("
<<
getLocalX
();
39
os <<
", "
<<
getLocalY
() <<
") cm "
;
40
41
os <<
" adc = "
<<
getAdc
() << std::endl;
42
43
os <<
"Error "
<< std::endl;
44
os <<
" ( "
;
45
os <<
getActsLocalError
(0, 0) <<
" , "
;
46
os <<
getActsLocalError
(0, 1) <<
" ) "
<< std::endl;
47
os <<
" ( "
;
48
os <<
getActsLocalError
(1, 0) <<
", "
;
49
os <<
getActsLocalError
(1, 1) <<
" ) "
<< std::endl;
50
51
os << std::endl;
52
os <<
"-----------------------------------------------"
<< std::endl;
53
54
return
;
55
}
56
57
int
TrkrClusterv3::isValid
()
const
58
{
59
if
(
m_cluskey
== TrkrDefs::CLUSKEYMAX) {
return
0; }
60
for
(
int
i
= 0;
i
< 2; ++
i
)
61
{
62
if
(std::isnan(
getPosition
(
i
))) {
return
0; }
63
for
(
int
j
= 0;
j
< 2; ++
j
)
64
{
if
(std::isnan(
getActsLocalError
(
i
,
j
))) {
return
0; }}
65
}
66
if
(
m_adc
== 0xFFFFFFFF) {
return
0; }
67
68
return
1;
69
}
70
71
void
TrkrClusterv3::CopyFrom
(
const
TrkrCluster
&
source
)
72
{
73
// do nothing if copying onto oneself
74
if
(
this
== &source )
return
;
75
76
// parent class method
77
TrkrCluster::CopyFrom
( source );
78
79
setLocalX
( source.
getLocalX
() );
80
setLocalY
( source.
getLocalY
() );
81
82
for
(
int
j
= 0;
j
< 2; ++
j
)
83
for
(
int
i
= 0;
i
< 2; ++
i
)
84
{
setActsLocalError
(
i
,
j
, source.
getActsLocalError
(
i
,
j
)); }
85
86
setSubSurfKey
( source.
getSubSurfKey
() );
87
setAdc
( source.
getAdc
() );
88
}
89
90
float
TrkrClusterv3::getRPhiError
()
const
91
{
return
std::sqrt(
m_actsLocalErr
[0][0]); }
92
93
float
TrkrClusterv3::getZError
()
const
94
{
return
std::sqrt(
m_actsLocalErr
[1][1]); }
95
96
void
TrkrClusterv3::setActsLocalError
(
unsigned
int
i
,
unsigned
int
j
,
97
float
value
)
98
{
99
m_actsLocalErr
[
i
][
j
] =
value
;
100
}
coresoftware
blob
master
offline
packages
trackbase
TrkrClusterv3.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:09
using
1.8.2 with
sPHENIX GitHub integration