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
ActsSurfaceMaps.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file ActsSurfaceMaps.cc
1
7
#include "
ActsSurfaceMaps.h
"
8
#include "
TrkrCluster.h
"
9
#include "
MvtxDefs.h
"
10
#include "
InttDefs.h
"
11
12
#include <
Acts/Definitions/Units.hpp
>
13
#include <
Acts/Surfaces/Surface.hpp
>
14
15
namespace
16
{
18
template
<
class
T>
inline
constexpr
T
square
(
const
T
&
x
) {
return
x*
x
;}
19
21
template
<
class
T>
T
radius(
const
T
&
x
,
const
T
&
y
)
22
{
return
std::sqrt(
square
(x) +
square
(y));}
23
}
24
25
26
bool
ActsSurfaceMaps::isTpcSurface
(
const
Acts::Surface
*
surface
)
const
27
{
return
m_tpcVolumeIds
.find( surface->
geometryId
().
volume
() ) !=
m_tpcVolumeIds
.end(); }
28
29
bool
ActsSurfaceMaps::isMicromegasSurface
(
const
Acts::Surface
*
surface
)
const
30
{
return
m_micromegasVolumeIds
.find( surface->
geometryId
().
volume
() ) !=
m_micromegasVolumeIds
.end(); }
31
32
Surface
ActsSurfaceMaps::getSurface
(
TrkrDefs::cluskey
key,
33
TrkrCluster
*cluster)
const
34
{
35
const
auto
trkrid =
TrkrDefs::getTrkrId
(key);
36
const
auto
hitsetkey
=
TrkrDefs::getHitSetKeyFromClusKey
(key);
37
38
switch
( trkrid )
39
{
40
case
TrkrDefs::TrkrId::micromegasId
:
41
{
42
return
getMMSurface
(
hitsetkey
);
43
}
44
45
case
TrkrDefs::TrkrId::tpcId
:
46
{
47
const
auto
surfkey = cluster->
getSubSurfKey
();
48
return
getTpcSurface
(
hitsetkey
, surfkey);
49
}
50
51
case
TrkrDefs::TrkrId::mvtxId
:
52
case
TrkrDefs::TrkrId::inttId
:
53
{
54
return
getSiliconSurface
(
hitsetkey
);
55
}
56
}
57
58
// unreachable
59
return
nullptr
;
60
}
61
62
Surface
ActsSurfaceMaps::getSiliconSurface
(
TrkrDefs::hitsetkey
hitsetkey
)
const
63
{
64
unsigned
int
trkrid =
TrkrDefs::getTrkrId
(hitsetkey);
65
TrkrDefs::hitsetkey
tmpkey =
hitsetkey
;
66
67
if
(trkrid ==
TrkrDefs::inttId
)
68
{
69
// Set the hitsetkey crossing to zero
70
tmpkey =
InttDefs::resetCrossingHitSetKey
(hitsetkey);
71
}
72
73
if
(trkrid ==
TrkrDefs::mvtxId
)
74
{
75
// Set the hitsetkey crossing to zero
76
tmpkey =
MvtxDefs::resetStrobeHitSetKey
(hitsetkey);
77
}
78
79
auto
iter =
m_siliconSurfaceMap
.find(tmpkey);
80
if
(iter !=
m_siliconSurfaceMap
.end())
81
{
82
return
iter->second;
83
}
84
86
{
87
std::cout <<
"Failed to find silicon surface for hitsetkey "
<< hitsetkey <<
" tmpkey "
<< tmpkey << std::endl;
88
}
89
return
nullptr
;
90
}
91
92
Surface
ActsSurfaceMaps::getTpcSurface
(
TrkrDefs::hitsetkey
hitsetkey
,
93
TrkrDefs::subsurfkey
surfkey)
const
94
{
95
unsigned
int
layer
=
TrkrDefs::getLayer
(hitsetkey);
96
const
auto
iter =
m_tpcSurfaceMap
.find(layer);
97
98
if
(iter !=
m_tpcSurfaceMap
.end())
99
{
100
auto
surfvec = iter->second;
101
return
surfvec.at(surfkey);
102
}
103
105
return
nullptr
;
106
}
107
108
109
Surface
ActsSurfaceMaps::getMMSurface
(
TrkrDefs::hitsetkey
hitsetkey
)
const
110
{
111
const
auto
iter =
m_mmSurfaceMap
.find( hitsetkey );
112
return
(iter ==
m_mmSurfaceMap
.end()) ?
nullptr
:iter->second;
113
}
coresoftware
blob
master
offline
packages
trackbase
ActsSurfaceMaps.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:08
using
1.8.2 with
sPHENIX GitHub integration