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
sPHENIXActsDetectorElement.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file sPHENIXActsDetectorElement.cc
1
#include "
ActsGeometry.h
"
2
#include "
alignmentTransformationContainer.h
"
3
#include "
sPHENIXActsDetectorElement.h
"
4
5
#include <
phool/phool.h
>
6
7
sPHENIXActsDetectorElement::~sPHENIXActsDetectorElement
() =
default
;
8
9
const
Acts::Transform3
&
sPHENIXActsDetectorElement::transform
(
const
Acts::GeometryContext
& ctxt)
const
10
{
11
12
if
(
alignmentTransformationContainer::use_alignment
)
13
{
14
Acts::GeometryIdentifier
id
=
surface
().
geometryId
();
15
16
unsigned
int
volume =
id
.
volume
();
17
unsigned
int
layer
=
id
.layer();
18
unsigned
int
sphlayer =
base_layer_map
.find(volume)->second + layer / 2 -1;
19
unsigned
int
sensor =
id
.sensitive() - 1;
// Acts sensor ID starts at 1
20
21
const
alignmentTransformationContainer
* transformContainer
22
= ctxt.get<
alignmentTransformationContainer
*>();
23
24
const
auto
& transformVec = transformContainer->
getMap
();
25
auto
& layerVec = transformVec[sphlayer];
// get the vector of transforms for this layer
26
27
if
(layerVec.size() > sensor)
28
{
29
//std::cout << "sPHENIXActsDetectorElement: return transform: volume " << volume <<" Acts layer " << layer << " sensor " << sensor
30
// << " sphenix layer " << sphlayer << " layerVec size " << layerVec.size() << std::endl;
31
32
return
layerVec[sensor];
33
}
34
35
// if we are still here, it was not found
36
std::cout <<
PHWHERE
<<
" Alignment transform not found, for identifier "
<<
id
<<
" continuing on with ideal geometry is not ideal so we exit"
<< std::endl;
37
38
exit(1);
39
40
}
41
else
42
{
43
// return the construction transform
44
const
Acts::Transform3
&
transform
=
TGeoDetectorElement::transform
(ctxt);
// ctxt is unused here
45
return
transform
;
46
}
47
48
}
49
50
coresoftware
blob
master
offline
packages
trackbase
sPHENIXActsDetectorElement.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:09
using
1.8.2 with
sPHENIX GitHub integration