ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
InDetReadoutGeometry
src
SiDetectorManager.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#include "
GeoPrimitives/CLHEPtoEigenConverter.h
"
7
8
#include "
InDetReadoutGeometry/SiDetectorManager.h
"
9
#include "
AtlasDetDescr/AtlasDetectorID.h
"
10
#include "
IdDictDetDescr/IdDictManager.h
"
11
#include "
StoreGate/StoreGateSvc.h
"
12
13
#include "GeoModelKernel/GeoXF.h"
14
#include "GeoGenericFunctions/Variable.h"
15
#include "GeoModelKernel/GeoAlignableTransform.h"
16
#include "
DetDescrConditions/AlignableTransformContainer.h
"
17
#include "
ReadoutGeometryBase/SiCommonItems.h
"
18
#include "
InDetReadoutGeometry/SiDetectorElementCollection.h
"
19
#include "
InDetReadoutGeometry/SiDetectorElement.h
"
20
#include "
InDetReadoutGeometry/ExtendedAlignableTransform.h
"
21
22
#include <iostream>
23
24
namespace
InDetDD
25
{
26
27
SiDetectorManager::SiDetectorManager
(
StoreGateSvc
* detStore,
const
std::string & name)
28
:
InDetDetectorManager
(detStore, name)
29
{
30
}
31
32
SiDetectorManager::~SiDetectorManager
() =
default
;
33
34
const
std::string&
SiDetectorManager::tag
()
const
35
{
36
return
m_tag
;
37
}
38
39
void
SiDetectorManager::invalidateAll
()
40
{
41
for
(
SiDetectorElementCollection::iterator
element_iter =
getDetectorElementBegin
();
42
element_iter !=
getDetectorElementEnd
();
43
++element_iter) {
44
45
if
(*element_iter) {
46
(*element_iter)->invalidate();
47
}
48
}
49
}
50
51
void
SiDetectorManager::updateAll
()
const
52
{
53
for
(
SiDetectorElementCollection::const_iterator
element_iter =
getDetectorElementBegin
();
54
element_iter !=
getDetectorElementEnd
();
55
++element_iter) {
56
if
(*element_iter) {
57
(*element_iter)->updateCache();
58
}
59
}
60
}
61
62
bool
SiDetectorManager::setAlignableTransformLocalDelta
(
ExtendedAlignableTransform
* extXF,
63
const
Amg::Transform3D
& localToGlobalXF,
64
const
Amg::Transform3D
& delta,
65
GeoVAlignmentStore* alignStore)
66
{
67
// ATTENTION -------------------------------------------------------- (A.S.)
68
// CLHEP < -- > AMG interface method
69
70
// Sets the alignable transform delta when the supplied delta is in the local
71
// reconstruction frame
72
73
// If the default transform to the local recostruction frame is
74
// T = A*B*C*D*E
75
// and the alignable transform is C with delta c and the delat in the local frame is l, then
76
// A*B*C*c*D*E = A*B*C*D*E*l
77
// c = (D*E) * l * (D*E).inverse()
78
// c = (A*B*C).inverse * T * l * T.inverse() * (A*B*C)
79
80
// To get default transform up and including the alignable transform,
81
// we assume the next volume down is a fullphys volume and so its
82
// transform is the transform we want (ie A*B*C in the above example).
83
84
if
(!extXF)
return
false
;
85
86
const
GeoVFullPhysVol* child = extXF->
child
();
87
if
(child && extXF->
alignableTransform
()) {
88
// the definitiv absolut transform is in CLHEP -> do the calculation in CLHEP
89
const
GeoTrf::Transform3D& transform = child->getDefAbsoluteTransform(alignStore);
90
// calucluate the corrected delta according to the formula above
91
GeoTrf::Transform3D correctedDelta = transform.inverse()*localToGlobalXF
// (A*B*C).inverse() * T
92
* delta
// l
93
* localToGlobalXF.inverse() * transform;
// T.inverse() * (A*B*C)
94
extXF->
alignableTransform
()->setDelta(correctedDelta, alignStore);
95
return
true
;
96
}
else
{
97
return
false
;
98
}
99
}
100
101
bool
SiDetectorManager::setAlignableTransformGlobalDelta
(
ExtendedAlignableTransform
* extXF,
102
const
Amg::Transform3D
& delta,
103
GeoVAlignmentStore* alignStore) {
104
// ATTENTION -------------------------------------------------------- (A.S.)
105
// CLHEP < -- > AMG interface method
106
107
// Sets the alignable transform delta when the supplied delta is in the global frame.
108
109
// If the default transform down to the alignable transform is
110
// T = A*B*C
111
// and the alignable transform is C with delta c and the delta in the global frame is g, then
112
// A*B*C*c = g*A*B*C
113
// T*c = g*T
114
// c = T.inverse() * g * T
115
116
// To get default transform up and including the alignable transform,
117
// we assume the next volume down is a fullphys volume and so its
118
// transform is the transform we want (ie T=A*B*C in the above example).
119
120
121
if
(!extXF)
return
false
;
122
123
const
GeoVFullPhysVol * child = extXF->
child
();
124
if
(child && extXF->
alignableTransform
()) {
125
// do the calculation in CLHEP
126
const
GeoTrf::Transform3D& transform = child->getDefAbsoluteTransform(alignStore);
127
extXF->
alignableTransform
()->setDelta(transform.inverse() * delta * transform, alignStore);
128
return
true
;
129
}
else
{
130
return
false
;
131
}
132
}
133
134
const
SiDetectorDesign
*
SiDetectorManager::addDesign
(std::unique_ptr<const SiDetectorDesign>&& design)
135
{
136
m_designs
.push_back(std::move(design));
137
return
m_designs
.back().get();
138
}
139
140
int
SiDetectorManager::numDesigns
()
const
141
{
142
return
m_designs
.size();
143
}
144
145
146
const
SiDetectorDesign
*
SiDetectorManager::getDesign
(
int
i)
const
147
{
148
return
m_designs
[i].get();
149
}
150
151
void
SiDetectorManager::setCommonItems
(std::unique_ptr<const SiCommonItems>&& commonItems)
152
{
153
m_commonItems
= std::move(commonItems);
154
}
155
156
}
// namespace InDetDD
AlignableTransformContainer.h
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
CLHEPtoEigenConverter.h
ExtendedAlignableTransform.h
IdDictManager.h
SiCommonItems.h
SiDetectorElementCollection.h
SiDetectorElement.h
SiDetectorManager.h
StoreGateSvc.h
DataVector< SiDetectorElement >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector< SiDetectorElement >::iterator
DataModel_detail::iterator< DataVector > iterator
Definition
DataVector.h:842
InDetDD::ExtendedAlignableTransform
Class to hold alignable transform plus a pointer to the child volume and optionally a frame volume.
Definition
ExtendedAlignableTransform.h:31
InDetDD::ExtendedAlignableTransform::child
const GeoVFullPhysVol * child()
Definition
ExtendedAlignableTransform.h:44
InDetDD::ExtendedAlignableTransform::alignableTransform
GeoAlignableTransform * alignableTransform()
Definition
ExtendedAlignableTransform.h:43
InDetDD::InDetDetectorManager::InDetDetectorManager
InDetDetectorManager(StoreGateSvc *detStore, const std::string &name)
Definition
InDetDetectorManager.cxx:20
InDetDD::SiDetectorDesign
Base class for the detector design classes for Pixel and SCT.
Definition
SiDetectorDesign.h:50
InDetDD::SiDetectorManager::updateAll
virtual void updateAll() const
Update all caches.
Definition
SiDetectorManager.cxx:51
InDetDD::SiDetectorManager::invalidateAll
virtual void invalidateAll()
Invalidate cache for all detector elements.
Definition
SiDetectorManager.cxx:39
InDetDD::SiDetectorManager::tag
const std::string & tag() const
Get tag used in dictionary.
Definition
SiDetectorManager.cxx:34
InDetDD::SiDetectorManager::SiDetectorManager
SiDetectorManager(StoreGateSvc *detStore, const std::string &name)
Definition
SiDetectorManager.cxx:27
InDetDD::SiDetectorManager::setCommonItems
void setCommonItems(std::unique_ptr< const SiCommonItems > &&commonItems)
Set SiCommonItems.
Definition
SiDetectorManager.cxx:151
InDetDD::SiDetectorManager::getDesign
const SiDetectorDesign * getDesign(int i) const
Definition
SiDetectorManager.cxx:146
InDetDD::SiDetectorManager::m_designs
std::vector< std::unique_ptr< const SiDetectorDesign > > m_designs
Definition
SiDetectorManager.h:150
InDetDD::SiDetectorManager::addDesign
const SiDetectorDesign * addDesign(std::unique_ptr< const SiDetectorDesign > &&)
Access to module design; returns an observer pointer.
Definition
SiDetectorManager.cxx:134
InDetDD::SiDetectorManager::m_tag
std::string m_tag
Definition
SiDetectorManager.h:148
InDetDD::SiDetectorManager::getDetectorElementEnd
virtual SiDetectorElementCollection::const_iterator getDetectorElementEnd() const =0
InDetDD::SiDetectorManager::getDetectorElementBegin
virtual SiDetectorElementCollection::const_iterator getDetectorElementBegin() const =0
InDetDD::SiDetectorManager::m_commonItems
std::unique_ptr< const SiCommonItems > m_commonItems
Definition
SiDetectorManager.h:151
InDetDD::SiDetectorManager::~SiDetectorManager
virtual ~SiDetectorManager()
InDetDD::SiDetectorManager::setAlignableTransformGlobalDelta
static bool setAlignableTransformGlobalDelta(ExtendedAlignableTransform *extXF, const Amg::Transform3D &delta, GeoVAlignmentStore *alignStore=nullptr)
Helper method to set delta transform from a global delta - Amg interface.
Definition
SiDetectorManager.cxx:101
InDetDD::SiDetectorManager::numDesigns
int numDesigns() const
Definition
SiDetectorManager.cxx:140
InDetDD::SiDetectorManager::setAlignableTransformLocalDelta
static bool setAlignableTransformLocalDelta(ExtendedAlignableTransform *extXF, const Amg::Transform3D &localToGlobalXF, const Amg::Transform3D &delta, GeoVAlignmentStore *alignStore=nullptr)
Helper method to set delta transform from a local delta - Amg interface.
Definition
SiDetectorManager.cxx:62
StoreGateSvc
The Athena Transient Store API.
Definition
StoreGateSvc.h:120
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition
GeoPrimitives.h:46
InDetDD
Message Stream Member.
Definition
FakeTrackBuilder.h:8
Generated on
for ATLAS Offline Software by
1.17.0