ATLAS Offline Software
Loading...
Searching...
No Matches
runMmGeoComparison.cxx
Go to the documentation of this file.
1
2/*
3 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4*/
14#include <GaudiKernel/SystemOfUnits.h>
16#include <string>
17#include <set>
18#include <vector>
19#include <map>
20#include <iostream>
21#include <cmath>
22
24#include <TFile.h>
25#include <TTreeReader.h>
26
27#include "Acts/Utilities/UnitVectors.hpp"
28#include "Acts/Definitions/Units.hpp"
29
30using namespace MuonGMR4;
31using namespace ActsTrk;
32
33constexpr double tolerance = 0.003*Gaudi::Units::millimeter;
34
35Amg::Vector3D makeDir(const double theta, const double phi) {
36 using namespace Acts::UnitLiterals;
37 return Acts::makeDirectionFromPhiTheta(phi *1._degree, theta* 1._degree);
38}
39
41struct MmChamber{
43 MmChamber() = default;
44
47 int stationEta{0};
48 int stationPhi{0};
49 int multilayer{0};
50 std::string design{};
51
53 Amg::Transform3D alignableTransform{Amg::Transform3D::Identity()};
54
56 bool operator<(const MmChamber& other) const {
57 if (stationIndex != other.stationIndex) return stationIndex < other.stationIndex;
58 if (stationEta != other.stationEta) return stationEta < other.stationEta;
59 if (stationPhi != other.stationPhi) return stationPhi < other.stationPhi;
60 return multilayer < other.multilayer;
61 }
62
64 Amg::Transform3D geoModelTransform{Amg::Transform3D::Identity()};
65
67 unsigned int nGasGaps{0};
68
70 double ActiveWidthS{0.};
71 double ActiveWidthL{0.};
72 double ActiveHeightR{0.};
73 double stripPitch{0.};
74
75 double moduleHeight{0.};
76 double moduleWidthS{0.};
77 double moduleWidthL{0.};
78
79
80 struct MmChannel{
82 Amg::Vector2D locCenter{Amg::Vector2D::Zero()};
84 Amg::Vector3D globCenter{Amg::Vector3D::Zero()};
86 Amg::Vector3D leftEdge{Amg::Vector3D::Zero()};
88 Amg::Vector3D rightEdge{Amg::Vector3D::Zero()};
90 double stripLength{0.};
92 unsigned int channel{0};
94 unsigned int gasGap{0};
96 bool isStereo{false};
98 bool operator<(const MmChannel& other) const {
99 if (gasGap != other.gasGap) return gasGap < other.gasGap;
100 return channel < other.channel;
101 }
102
103 };
104
106 struct MmLayer {
108 unsigned int gasGap{0};
110 Amg::Transform3D transform{Amg::Transform3D::Identity()};
112 Amg::Vector2D firstStripPos{Amg::Vector2D::Zero()};
114 unsigned int firstStrip{0};
116 unsigned int nStrips{0};
120 bool operator<(const MmLayer& other) const {
121 return gasGap < other.gasGap;
122 }
123 };
124 std::set<MmChannel> channels{};
125 std::set<MmLayer> layers{};
126
127};
128
129
132std::ostream& operator<<(std::ostream& ostr, const MmChamber& chamb) {
133 static const std::map<int, std::string> stationDict{
134 {55, "MMS"}, {56, "MML"}
135 };
136 ostr<<"MicroMegas chamber "<<stationDict.at(chamb.stationIndex)<<std::abs(chamb.stationEta)<<
137 (chamb.stationEta>0 ? "A" : "C")<<chamb.stationPhi<<"-"<<chamb.multilayer<<" ";
138 return ostr;
139}
140
141std::ostream& operator<<(std::ostream& ostr,const MmChamber::MmChannel & channel) {
142 ostr<<"channel (gasGap/number): ";
143 ostr<<channel.gasGap<<"/";
144 ostr<<std::setfill('0')<<std::setw(4)<<channel.channel<<", ";
145 ostr<<"center: "<<Amg::toString(channel.globCenter, 2);
146 return ostr;
147}
148
149
150std::ostream& operator<<(std::ostream& ostr,const MmChamber::MmLayer & layer) {
151 ostr<<"Mmlayer (gasGap): ";
152 ostr<<layer.gasGap<<", ";
153 // ostr<<"transform: "<<Amg::toString(layer.transform);
154 return ostr;
155}
156
157std::set<MmChamber> readTreeDump(const std::string& inputFile) {
158 std::set<MmChamber> to_ret{};
159 std::cout<<"Read the MicroMegas geometry tree dump from "<<inputFile<<std::endl;
160 std::unique_ptr<TFile> inFile{TFile::Open(inputFile.c_str())};
161 if (!inFile || !inFile->IsOpen()) {
162 std::cerr<<__FILE__<<":"<<__LINE__<<" Failed to open "<<inputFile<<std::endl;
163 return to_ret;
164 }
165 TTreeReader treeReader("MmGeoModelTree", inFile.get());
166 if (treeReader.IsInvalid()){
167 std::cerr<<__FILE__<<":"<<__LINE__<<" The file "<<inputFile<<" does not contain the 'MmGeoModelTree'"<<std::endl;
168 return to_ret;
169 }
170
172 TTreeReaderValue<unsigned short> stationIndex{treeReader, "stationIndex"};
173 TTreeReaderValue<short> stationEta{treeReader, "stationEta"};
174 TTreeReaderValue<short> stationPhi{treeReader, "stationPhi"};
175 TTreeReaderValue<short> multilayer{treeReader, "multilayer"};
176
178 TTreeReaderValue<std::vector<uint>> channel{treeReader, "channel"};
179 TTreeReaderValue<std::vector<short>> gasGap{treeReader, "gasGap"};
180 TTreeReaderValue<std::vector<float>> stripLength{treeReader, "stripLength"};
181
182 TTreeReaderValue<std::vector<bool>> isStereo{treeReader, "isStereo"};
183 TTreeReaderValue<std::vector<float>> locStripCenterX{treeReader, "locStripCenterX"};
184 TTreeReaderValue<std::vector<float>> locStripCenterY{treeReader, "locStripCenterY"};
185
186 TTreeReaderValue<std::vector<float>> stripCenterX{treeReader, "stripCenterX"};
187 TTreeReaderValue<std::vector<float>> stripCenterY{treeReader, "stripCenterY"};
188 TTreeReaderValue<std::vector<float>> stripCenterZ{treeReader, "stripCenterZ"};
189 TTreeReaderValue<std::vector<float>> stripLeftEdgeX{treeReader, "stripLeftEdgeX"};
190 TTreeReaderValue<std::vector<float>> stripLeftEdgeY{treeReader, "stripLeftEdgeY"};
191 TTreeReaderValue<std::vector<float>> stripLeftEdgeZ{treeReader, "stripLeftEdgeZ"};
192 TTreeReaderValue<std::vector<float>> stripRightEdgeX{treeReader, "stripRightEdgeX"};
193 TTreeReaderValue<std::vector<float>> stripRightEdgeY{treeReader, "stripRightEdgeY"};
194 TTreeReaderValue<std::vector<float>> stripRightEdgeZ{treeReader, "stripRightEdgeZ"};
195
197 TTreeReaderValue<float> ActiveHeightR{treeReader, "ActiveHeightR"};
198 TTreeReaderValue<float> ActiveWidthS{treeReader, "ActiveWidthS"};
199 TTreeReaderValue<float> ActiveWidthL{treeReader, "ActiveWidthL"};
200
201
202 TTreeReaderValue<float> moduleHeight{treeReader, "moduleHeight"};
203 TTreeReaderValue<float> moduleWidthS{treeReader, "moduleWidthS"};
204 TTreeReaderValue<float> moduleWidthL{treeReader, "moduleWidthL"};
205
206 TTreeReaderValue<float> stripPitch{treeReader, "stripPitch"};
207
209 TTreeReaderValue<std::vector<float>> geoModelTransformX{treeReader, "GeoModelTransformX"};
210 TTreeReaderValue<std::vector<float>> geoModelTransformY{treeReader, "GeoModelTransformY"};
211 TTreeReaderValue<std::vector<float>> geoModelTransformZ{treeReader, "GeoModelTransformZ"};
212
213 TTreeReaderValue<std::vector<float>> alignableNodeX{treeReader, "AlignableNodeX"};
214 TTreeReaderValue<std::vector<float>> alignableNodeY{treeReader, "AlignableNodeY"};
215 TTreeReaderValue<std::vector<float>> alignableNodeZ{treeReader, "AlignableNodeZ"};
216
217 TTreeReaderValue<std::vector<float>> stripRotCol0Theta{treeReader, "stripRotLinearCol0Theta"};
218 TTreeReaderValue<std::vector<float>> stripRotCol0Phi{treeReader, "stripRotLinearCol0Phi"};
219
220 TTreeReaderValue<std::vector<float>> stripRotCol1Theta{treeReader, "stripRotLinearCol1Theta"};
221 TTreeReaderValue<std::vector<float>> stripRotCol1Phi{treeReader, "stripRotLinearCol1Phi"};
222
223 TTreeReaderValue<std::vector<float>> stripRotCol2Theta{treeReader, "stripRotLinearCol2Theta"};
224 TTreeReaderValue<std::vector<float>> stripRotCol2Phi{treeReader, "stripRotLinearCol2Phi"};
225
226
227 TTreeReaderValue<std::vector<float>> stripRotTransX{treeReader, "stripRotTranslationX"};
228 TTreeReaderValue<std::vector<float>> stripRotTransY{treeReader, "stripRotTranslationY"};
229 TTreeReaderValue<std::vector<float>> stripRotTransZ{treeReader, "stripRotTranslationZ"};
230
231 TTreeReaderValue<std::vector<uint8_t>> stripRotGasGap{treeReader, "stripRotGasGap"};
232
233 TTreeReaderValue<std::vector<float>> firstStripPosX{treeReader, "firstStripPosX"};
234 TTreeReaderValue<std::vector<float>> firstStripPosY{treeReader, "firstStripPosY"};
235
236 TTreeReaderValue<std::vector<int>> readoutSide{treeReader, "stripReadoutSide"};
237 TTreeReaderValue<std::vector<unsigned int>> firstStrip{treeReader, "firstStrip"};
238 TTreeReaderValue<std::vector<unsigned int>> nStrips{treeReader, "nStrips"};
239
240
241
242 while (treeReader.Next()) {
243 MmChamber newchamber{};
244
246 newchamber.stationIndex = (*stationIndex);
247 newchamber.stationEta = (*stationEta);
248 newchamber.stationPhi = (*stationPhi);
249 newchamber.multilayer = (*multilayer);
250
252 newchamber.ActiveHeightR = (*ActiveHeightR);
253 newchamber.ActiveWidthS = (*ActiveWidthS);
254 newchamber.ActiveWidthL = (*ActiveWidthL);
255 newchamber.stripPitch = (*stripPitch);
256 newchamber.moduleHeight = (*moduleHeight);
257 newchamber.moduleWidthS = (*moduleWidthS);
258 newchamber.moduleWidthL = (*moduleWidthL);
259
260 Amg::Vector3D geoTrans{(*geoModelTransformX)[0], (*geoModelTransformY)[0], (*geoModelTransformZ)[0]};
261 Amg::RotationMatrix3D geoRot{Amg::RotationMatrix3D::Identity()};
262 geoRot.col(0) = Amg::Vector3D((*geoModelTransformX)[1], (*geoModelTransformY)[1], (*geoModelTransformZ)[1]);
263 geoRot.col(1) = Amg::Vector3D((*geoModelTransformX)[2], (*geoModelTransformY)[2], (*geoModelTransformZ)[2]);
264 geoRot.col(2) = Amg::Vector3D((*geoModelTransformX)[3], (*geoModelTransformY)[3], (*geoModelTransformZ)[3]);
265 newchamber.geoModelTransform = Amg::getTransformFromRotTransl(std::move(geoRot), std::move(geoTrans));
266
267 geoRot.col(0) = Amg::Vector3D((*alignableNodeX)[1], (*alignableNodeY)[1], (*alignableNodeZ)[1]);
268 geoRot.col(1) = Amg::Vector3D((*alignableNodeX)[2], (*alignableNodeY)[2], (*alignableNodeZ)[2]);
269 geoRot.col(2) = Amg::Vector3D((*alignableNodeX)[3], (*alignableNodeY)[3], (*alignableNodeZ)[3]);
270 geoTrans = Amg::Vector3D{(*alignableNodeX)[0], (*alignableNodeY)[0], (*alignableNodeZ)[0]};
271 newchamber.alignableTransform = Amg::getTransformFromRotTransl(std::move(geoRot), std::move(geoTrans));
272 //Strips
273 for (size_t s = 0; s < stripCenterX->size(); ++s){
274 MmChamber::MmChannel newStrip{};
275 newStrip.globCenter = Amg::Vector3D{(*stripCenterX)[s], (*stripCenterY)[s], (*stripCenterZ)[s]};
276 newStrip.locCenter = Amg::Vector2D{(*locStripCenterX)[s], (*locStripCenterY)[s]};
277 newStrip.leftEdge = Amg::Vector3D{(*stripLeftEdgeX)[s], (*stripLeftEdgeY)[s], (*stripLeftEdgeZ)[s]};
278 newStrip.rightEdge = Amg::Vector3D{(*stripRightEdgeX)[s], (*stripRightEdgeY)[s], (*stripRightEdgeZ)[s]};
279
280 newStrip.gasGap = (*gasGap)[s];
281 newStrip.channel = (*channel)[s];
282 newStrip.isStereo = (*isStereo)[s];
283 newStrip.stripLength = (*stripLength)[s];
284 newchamber.channels.insert(std::move(newStrip));
285 }
286
287 for (size_t l = 0; l < stripRotGasGap->size(); ++l){
288 MmChamber::MmLayer newLayer{};
289 newLayer.gasGap = (*stripRotGasGap)[l];
290 Amg::RotationMatrix3D stripRot{Amg::RotationMatrix3D::Identity()};
291 stripRot.col(0) = makeDir((*stripRotCol0Theta)[l], (*stripRotCol0Phi)[l]);
292 stripRot.col(1) = makeDir((*stripRotCol1Theta)[l], (*stripRotCol1Phi)[l]);
293 stripRot.col(2) = makeDir((*stripRotCol2Theta)[l], (*stripRotCol2Phi)[l]);
294 Amg::Vector3D layTrans{(*stripRotTransX)[l], (*stripRotTransY)[l], (*stripRotTransZ)[l]};
295 newLayer.transform = Amg::getTransformFromRotTransl(std::move(stripRot), std::move(layTrans));
296 newLayer.firstStripPos = Amg::Vector2D{(*firstStripPosX)[l], (*firstStripPosY)[l]};
297 newLayer.readoutSide = (*readoutSide)[l];
298 newLayer.firstStrip = (*firstStrip)[l];
299 newLayer.nStrips = (*nStrips)[l];
300
301 newchamber.layers.insert(std::move(newLayer));
302 }
303
304 auto insert_itr = to_ret.insert(std::move(newchamber));
305 if (!insert_itr.second) {
306 std::stringstream err{};
307 err<<__FILE__<<":"<<__LINE__<<" The chamber "<<(*insert_itr.first).stationIndex
308 <<" has already been inserted. "<<std::endl;
309 throw std::runtime_error(err.str());
310 }
311 }
312 std::cout<<"File parsing is finished. Found in total "<<to_ret.size()<<" readout element dumps "<<std::endl;
313 return to_ret;
314}
315
316#define TEST_BASICPROP(attribute, propName) \
317 if (std::abs(1.*test.attribute - 1.*reference.attribute) > tolerance) { \
318 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": The chamber "<<reference \
319 <<" differs w.r.t "<<propName<<" "<< reference.attribute \
320 <<" (ref) vs. " <<test.attribute << " (test)" \
321 <<", delta: "<<reference.attribute - test.attribute << std::endl; \
322 chamberOkay = false; \
323 }
324
325int main1( int argc, char** argv ) {
326 std::string refFile{}, testFile{};
327
328 for (int arg = 1; arg < argc; ++arg) {
329 std::string the_arg{argv[arg]};
330 if (the_arg == "--refFile" && arg +1 < argc) {
331 refFile = std::string{argv[arg+1]};
332 ++arg;
333 } else if (the_arg == "--testFile" && arg + 1 < argc) {
334 testFile = std::string{argv[arg+1]};
335 ++arg;
336 }
337 }
338 if (refFile.empty()) {
339 std::cerr<<"Please parse the path of the reference file via --refFile "<<std::endl;
340 return EXIT_FAILURE;
341 }
342 if (testFile.empty()) {
343 std::cerr<<"Please parse the path of the test file via --testFile "<<std::endl;
344 return EXIT_FAILURE;
345 }
347 if (!refFile.starts_with ("root://")) refFile = PathResolver::FindCalibFile(refFile);
348 if (!testFile.starts_with ("root://")) testFile = PathResolver::FindCalibFile(testFile);
350 std::set<MmChamber> refChambers = readTreeDump(refFile);
351 if (refChambers.empty()) {
352 std::cerr<<"The file "<<refFile<<" should contain at least one chamber "<<std::endl;
353 return EXIT_FAILURE;
354 }
355 std::set<MmChamber> testChambers = readTreeDump(testFile);
356 if (testChambers.empty()) {
357 std::cerr<<"The file "<<testFile<<" should contain at least one chamber "<<std::endl;
358 return EXIT_FAILURE;
359 }
360 int return_code = EXIT_SUCCESS;
362 for (const MmChamber& reference : refChambers) {
363 std::set<MmChamber>::const_iterator test_itr = testChambers.find(reference);
364
365 if (test_itr == testChambers.end()) {
366 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": The chamber "<<reference
367 <<" is not part of the testing "<<std::endl;
368 return_code = EXIT_FAILURE;
369 continue;
370 }
371 bool chamberOkay{true};
372 const MmChamber& test = {*test_itr};
373
374 const Amg::Transform3D alignableDistort = test.alignableTransform.inverse()*(reference.alignableTransform );
375 if (!Amg::doesNotDeform(alignableDistort) || alignableDistort.translation().mag() > tolerance) {
376 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": The alignable nodes are at differnt places for "
377 <<test<<". " <<Amg::toString(alignableDistort, 3)<<std::endl;
378 chamberOkay = false;
379 }
380
382
383 {
384 constexpr double tolerance = 3. * Gaudi::Units::mm;
385 TEST_BASICPROP(ActiveWidthS, "GasGap length on the short side");
386 TEST_BASICPROP(ActiveWidthL, "GasGap length on the long side");
387
388 }
389 TEST_BASICPROP(moduleWidthL, "Long module width");
390 TEST_BASICPROP(moduleWidthS, "Short module width");
391 TEST_BASICPROP(moduleHeight, "Module height ");
392
393 TEST_BASICPROP(ActiveHeightR, "GasGap Height");
394 TEST_BASICPROP(stripPitch, "Strip pitch");
395 // if (!chamberOkay) continue;
396 using MmLayer = MmChamber::MmLayer;
397 for (const MmLayer& refLayer : reference.layers) {
398 std::set<MmLayer>::const_iterator lay_itr = test.layers.find(refLayer);
399 if (lay_itr == test.layers.end()) {
400 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
401 <<refLayer<<" is not found. "<<std::endl;
402 chamberOkay = false;
403 continue;
404 }
405 const MmLayer& testLayer{*lay_itr};
406 if (!Amg::isIdentity(refLayer.transform.inverse()* testLayer.transform)){
407 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
408 <<testLayer<<" differs w.r.t. reference. delta: "
409 <<Amg::toString(refLayer.transform.inverse()*testLayer.transform)<<std::endl;
410 chamberOkay = false;
411 }
412 if (refLayer.firstStrip != testLayer.firstStrip) {
413 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
414 <<testLayer.gasGap<<" starts from different strip "<<refLayer.firstStrip<<" vs. "
415 <<testLayer.firstStrip<<std::endl;
416 chamberOkay = false;
417 }
418 if (refLayer.nStrips != testLayer.nStrips) {
419 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
420 <<testLayer.gasGap<<" has different number of strips "<<refLayer.nStrips<<" vs. "
421 <<testLayer.nStrips<<std::endl;
422 chamberOkay = false;
423 }
425 if (false && (refLayer.firstStripPos- testLayer.firstStripPos).mag() > tolerance) {
426 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
427 <<testLayer.gasGap<<" has different starting position "
428 <<Amg::toString(refLayer.firstStripPos, 2) <<" vs. "
429 <<Amg::toString(testLayer.firstStripPos, 2)
430 <<"difference: "<<Amg::toString(refLayer.firstStripPos- testLayer.firstStripPos, 2)
431 <<" / "<<(refLayer.firstStripPos- testLayer.firstStripPos).mag()/reference.stripPitch
432 <<std::endl;
433 chamberOkay = false;
434 }
435 }
436 if (!chamberOkay) continue;
437 unsigned int failedEta{0}, lastGap{0};
438 for (const MmChamber::MmChannel& refStrip : reference.channels) {
439 std::set<MmChamber::MmChannel>::const_iterator strip_itr = test.channels.find(refStrip);
440 if (strip_itr == test.channels.end()) {
441 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
442 <<refStrip<<" is not found. "<<std::endl;
443 chamberOkay = false;
444 continue;
445 }
446 if (lastGap != refStrip.gasGap) {
447 lastGap = refStrip.gasGap;
448 failedEta = 0;
449 }
450 const MmChamber::MmChannel& testStrip{*strip_itr};
457 if (failedEta <= 10) {
458 const Amg::Vector3D stripDir{Amg::getRotateZ3D(90*Gaudi::Units::deg)*
459 (refStrip.rightEdge - refStrip.leftEdge).unit()};
460 const Amg::Vector3D testDir{Amg::getRotateZ3D(90*Gaudi::Units::deg)*
461 (testStrip.rightEdge - testStrip.leftEdge).unit()};
462 const double centerDist = stripDir.dot(testStrip.globCenter - refStrip.globCenter);
463 const double leftDist = stripDir.dot(testStrip.leftEdge -refStrip.globCenter);
464 const double rightDist = stripDir.dot(testStrip.rightEdge - refStrip.globCenter);
465 if ( std::abs(centerDist) > tolerance || std::abs(leftDist) > tolerance || std::abs(rightDist) > tolerance) {
466 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": In "
467 <<test<<" " <<testStrip <<" + mu "<<Amg::toString(testDir,2)
468 <<"/local: "<<Amg::toString(testStrip.locCenter, 2)
469 <<" does not describe the same stereo strip as "
470 <<Amg::toString(refStrip.globCenter, 2)<<"/local:"
471 <<Amg::toString(refStrip.locCenter,2)<<" + lambda "<<Amg::toString(stripDir,2)
472 <<". Distances to the left-edge/center/right-edge: "
473 <<leftDist<<"/"<<centerDist<<"/"<<rightDist<<", dot: "
474 <<std::acos(std::clamp(stripDir.dot(testDir),- 1., 1.)) / Gaudi::Units::deg<<std::endl;
475 chamberOkay = false;
476 }
477 ++failedEta;
478 }
479 }
480
481 if (!chamberOkay) {
482 return_code = EXIT_FAILURE;
483 }
484 }
485 return return_code;
486
487}
488
489
490int main (int argc, char** argv )
491{
492 int ret = 1;
493 try {
494 ret = main1 (argc, argv);
495 }
496 catch (const std::exception& e) {
497 std::cerr << e.what() << "\n";
498 }
499 return ret;
500}
Scalar phi() const
phi method
Scalar theta() const
theta method
Scalar mag() const
mag method
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
static std::string FindCalibFile(const std::string &logical_file_name)
int main()
Definition hello.cxx:18
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
bool isIdentity(const Amg::Transform3D &trans)
Checks whether the transformation is the Identity transformation.
bool doesNotDeform(const Amg::Transform3D &trans)
Checks whether the linear part of the transformation rotates or stetches any of the basis vectors.
Amg::Transform3D getTransformFromRotTransl(Amg::RotationMatrix3D rot, Amg::Vector3D transl_vec)
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
std::ostream & operator<<(std::ostream &ostr, const MmChamber &chamb)
Translation of the station Index -> station Name.
std::set< MmChamber > readTreeDump(const std::string &inputFile)
#define TEST_BASICPROP(attribute, propName)
Amg::Vector3D makeDir(const double theta, const double phi)
Amg::Vector3D rightEdge
Right edge of the strip.
bool operator<(const MmChannel &other) const
Odering operator to use the strip with set.
Amg::Vector3D globCenter
Global center of the micromega strip.
unsigned int channel
strip number
Amg::Vector2D locCenter
Local center of the micromega strip.
double stripLength
length of the strip
bool isStereo
Short flag whether the angle is stereo.
unsigned int gasGap
Gas gap of the strip.
Amg::Vector3D leftEdge
Left edge of the strip.
Helper struct to assess that the layers are properly oriented.
bool operator<(const MmLayer &other) const
Ordering operator.
Amg::Transform3D transform
@ transformation
int readoutSide
@ Readout side on the detector
Amg::Vector2D firstStripPos
@ Reference position of the first strip
unsigned int gasGap
Gas gap number of the layer.
unsigned int firstStrip
@ Reference number of the first strip
unsigned int nStrips
@Reference number of all strips
Helper struct to represent a full MicroMegas chamber.
std::set< MmLayer > layers
std::string design
std::set< MmChannel > channels
Amg::Transform3D geoModelTransform
Transformation of the underlying GeoModel element.
MmChamber()=default
Default constructor.
bool operator<(const MmChamber &other) const
Sorting operator to insert the object into std::set.
unsigned int nGasGaps
Amg::Transform3D alignableTransform
Transformation of the underlying Alignable node.
int main1()
Definition testRead.cxx:68