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
TrkrClusterv5.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file TrkrClusterv5.cc
1
7
#include "
TrkrClusterv5.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
TrkrClusterv5::TrkrClusterv5
()
20
: m_subsurfkey(TrkrDefs::SUBSURFKEYMAX)
21
, m_phierr(0)
22
, m_zerr(0)
23
, m_adc(0)
24
, m_maxadc(0)
25
, m_phisize(0)
26
, m_zsize(0)
27
, m_overlap(0)
28
, m_edge(0)
29
{
30
for
(
int
i
= 0;
i
< 2;
i
++)
31
{
32
m_local
[
i
] = NAN;
33
}
34
}
35
36
void
TrkrClusterv5::identify
(std::ostream&
os
)
const
37
{
38
os <<
"---TrkrClusterv5--------------------"
<< std::endl;
39
40
os <<
" (rphi,z) = ("
<<
getLocalX
();
41
os <<
", "
<<
getLocalY
() <<
") cm "
;
42
43
os <<
" valid = "
<<
isValid
() << std::endl;
44
45
os << std::endl;
46
os <<
"-----------------------------------------------"
<< std::endl;
47
48
return
;
49
}
50
51
int
TrkrClusterv5::isValid
()
const
52
{
53
for
(
int
i
= 0;
i
< 2; ++
i
)
54
{
55
if
(std::isnan(
getPosition
(
i
))) {
return
0; }
56
}
57
if
(
m_adc
== 0xFFFF) {
return
0; }
58
59
return
1;
60
}
61
62
void
TrkrClusterv5::CopyFrom
(
const
TrkrCluster
&
source
)
63
{
64
// do nothing if copying onto oneself
65
if
(
this
== &source )
return
;
66
67
// parent class method
68
TrkrCluster::CopyFrom
( source );
69
70
setLocalX
( source.
getLocalX
() );
71
setLocalY
( source.
getLocalY
() );
72
setSubSurfKey
( source.
getSubSurfKey
() );
73
setAdc
( source.
getAdc
() );
74
setMaxAdc
( source.
getMaxAdc
());
75
setPhiError
(source.
getPhiError
());
76
setZError
(source.
getZError
());
77
setPhiSize
(source.
getPhiSize
());
78
setZSize
(source.
getZSize
());
79
setOverlap
(source.
getOverlap
());
80
setEdge
(source.
getEdge
());
81
}
82
83
coresoftware
blob
master
offline
packages
trackbase
TrkrClusterv5.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:09
using
1.8.2 with
sPHENIX GitHub integration