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