23{
25
26
27 StoredAlignX *hec1AlxPos{nullptr};
28 StoredAlignX *hec2AlxPos{nullptr};
29 StoredAlignX *hec1AlxNeg{nullptr};
30 StoredAlignX *hec2AlxNeg{nullptr};
31 if (
detStore->contains<StoredAlignX> (
"HEC1_POS")) {
32 if (
detStore->retrieve(hec1AlxPos,
"HEC1_POS")!=StatusCode::SUCCESS) {
33 ATH_MSG_WARNING(
" Unable to retrieve StoredAlignX for the key HEC1_POS");
34 }
35 }
36 if (
detStore->contains<StoredAlignX> (
"HEC1_NEG")) {
37 if (
detStore->retrieve(hec1AlxNeg,
"HEC1_NEG")!=StatusCode::SUCCESS) {
38 ATH_MSG_WARNING(
" Unable to retrieve StoredAlignX for the key HEC1_NEG");
39 }
40 }
41 if (
detStore->contains<StoredAlignX> (
"HEC2_POS")) {
42 if (
detStore->retrieve(hec2AlxPos,
"HEC2_POS")!=StatusCode::SUCCESS) {
43 ATH_MSG_WARNING(
" Unable to retrieve StoredAlignX for the key HEC2_POS");
44 }
45 }
46 if (
detStore->contains<StoredAlignX> (
"HEC2_NEG")) {
47 if (
detStore->retrieve(hec2AlxNeg,
"HEC2_NEG")!=StatusCode::SUCCESS) {
48 ATH_MSG_WARNING(
" Unable to retrieve StoredAlignX for the key HEC2_NEG");
49 }
50 }
51 GeoAlignableTransform *hec1GatPos = hec1AlxPos ? hec1AlxPos->
getAlignX():
nullptr;
52 GeoAlignableTransform *hec1GatNeg = hec1AlxPos ? hec1AlxNeg->
getAlignX():
nullptr;
53 GeoAlignableTransform *hec2GatPos = hec2AlxPos ? hec2AlxPos->
getAlignX():
nullptr;
54 GeoAlignableTransform *hec2GatNeg = hec2AlxPos ? hec2AlxNeg->
getAlignX():
nullptr;
55
56
59 HepGeom::Transform3D newDelta;
60
61 if(
detStore->contains<StoredAlignX>(alignName)) {
62 StoredAlignX* alignX{nullptr};
63 if(
detStore->retrieve(alignX,alignName).isFailure()) {
64 ATH_MSG_ERROR(
" Unable to retrieve StoredAlignX for the key " << alignName);
65 return StatusCode::FAILURE;
66 }
67
68 if(!alignX) {
69 ATH_MSG_ERROR(
"Null pointer to StoredAlignX for the key " << alignName);
70 return StatusCode::FAILURE;
71 }
72
73 GeoAlignableTransform* gat = alignX->
getAlignX();
74 if(!gat) {
75 ATH_MSG_ERROR(
"Null pointer to GeoAlignableTransform for the key " << alignName);
76 return StatusCode::FAILURE;
77 }
78
79
82 }
83 else {
84 gat->clearDelta(alignmentStore);
85 }
86 }
87 else if (alignName=="HEC_POS") {
88 if (hec1GatPos) {
91 }
92 else {
93 hec1GatPos->clearDelta(alignmentStore);
94 }
95 }
96 if (hec2GatPos) {
99 }
100 else {
101 hec2GatPos->clearDelta(alignmentStore);
102 }
103 }
104 }
105 else if (alignName=="HEC_NEG") {
106 if (hec1GatNeg) {
109 }
110 else {
111 hec1GatNeg->clearDelta(alignmentStore);
112 }
113 }
114 if (hec2GatNeg) {
117 }
118 else {
119 hec2GatNeg->clearDelta(alignmentStore);
120 }
121 }
122 }
123 else {
125 }
126 }
127
128
129
130
131
132
133 std::vector<std::string>
keys;
135 for(const std::string& key : keys) {
136 StoredPhysVol* storedPV =
detStore->tryRetrieve<StoredPhysVol>(
key);
137 ATH_MSG_DEBUG(
"Building position caches for StoredPhysVol :" << key);
138 if(storedPV) {
139 storedPV->
getPhysVol()->getAbsoluteTransform(alignmentStore);
140 storedPV->
getPhysVol()->getDefAbsoluteTransform(alignmentStore);
141 }
142 }
143
144
145 if (
msgLvl (MSG::DEBUG)) {
147 if(
detStore->contains<StoredPhysVol>(alignName)) {
148 StoredPhysVol* storedPV{nullptr};
149 if(
detStore->retrieve(storedPV,alignName).isSuccess()) {
150 const GeoIntrusivePtr<GeoFullPhysVol> fullPV = storedPV->
getPhysVol();
151 const GeoTrf::Transform3D& xf = fullPV->getAbsoluteTransform(alignmentStore);
152 GeoTrf::Vector3D trans=xf.translation();
153 GeoTrf::RotationMatrix3D rot=xf.rotation();
155 << " translation [" << trans.x() << "," << trans.y() << "," << trans.z()
156 << "] rotation (" << rot(0,0) << "," << rot(0,1) << "," << rot(0,2)
157 << "," << rot(1,0) << "," << rot(1,1) << "," << rot(1,2)
158 << "," << rot(2,0) << "," << rot(2,1) << "," << rot(2,2) << ")");
159 }
160 }
161 }
162 }
163
164 return StatusCode::SUCCESS;
165}
#define ATH_MSG_WARNING(x)
bool msgLvl(const MSG::Level lvl) const
Test the output level.
bool getTransform(const std::string &key, HepGeom::Transform3D &result) const
std::vector< std::string > m_alignNames
GeoAlignableTransform * getAlignX()
GeoFullPhysVol * getPhysVol()
Destructor.
Amg::Transform3D CLHEPTransformToEigen(const HepGeom::Transform3D &CLHEPtransf)
Converts a CLHEP-based HepGeom::Transform3D into an Eigen Amg::Transform3D.