ATLAS Offline Software
Loading...
Searching...
No Matches
runMmGeoComparison.cxx
Go to the documentation of this file.
1
2/*
3 Copyright (C) 2002-2025 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
27using namespace MuonGMR4;
28using namespace ActsTrk;
29
30constexpr double tolerance = 0.003*Gaudi::Units::millimeter;
31
33struct MmChamber{
35 MmChamber() = default;
36
39 int stationEta{0};
40 int stationPhi{0};
41 int multilayer{0};
42 std::string design{};
43
45 Amg::Transform3D alignableTransform{Amg::Transform3D::Identity()};
46
48 bool operator<(const MmChamber& other) const {
49 if (stationIndex != other.stationIndex) return stationIndex < other.stationIndex;
50 if (stationEta != other.stationEta) return stationEta < other.stationEta;
51 if (stationPhi != other.stationPhi) return stationPhi < other.stationPhi;
52 return multilayer < other.multilayer;
53 }
54
56 Amg::Transform3D geoModelTransform{Amg::Transform3D::Identity()};
57
59 unsigned int nGasGaps{0};
60
62 double ActiveWidthS{0.};
63 double ActiveWidthL{0.};
64 double ActiveHeightR{0.};
65 double stripPitch{0.};
66
67 double moduleHeight{0.};
68 double moduleWidthS{0.};
69 double moduleWidthL{0.};
70
71
72 struct MmChannel{
74 Amg::Vector2D locCenter{Amg::Vector2D::Zero()};
76 Amg::Vector3D globCenter{Amg::Vector3D::Zero()};
78 Amg::Vector3D leftEdge{Amg::Vector3D::Zero()};
80 Amg::Vector3D rightEdge{Amg::Vector3D::Zero()};
82 double stripLength{0.};
84 unsigned int channel{0};
86 unsigned int gasGap{0};
88 bool isStereo{false};
90 bool operator<(const MmChannel& other) const {
91 if (gasGap != other.gasGap) return gasGap < other.gasGap;
92 return channel < other.channel;
93 }
94
95 };
96
98 struct MmLayer {
100 unsigned int gasGap{0};
102 Amg::Transform3D transform{Amg::Transform3D::Identity()};
104 Amg::Vector2D firstStripPos{Amg::Vector2D::Zero()};
106 unsigned int firstStrip{0};
108 unsigned int nStrips{0};
112 bool operator<(const MmLayer& other) const {
113 return gasGap < other.gasGap;
114 }
115 };
116 std::set<MmChannel> channels{};
117 std::set<MmLayer> layers{};
118
119};
120
121
124std::ostream& operator<<(std::ostream& ostr, const MmChamber& chamb) {
125 static const std::map<int, std::string> stationDict{
126 {55, "MMS"}, {56, "MML"}
127 };
128 ostr<<"MicroMegas chamber "<<stationDict.at(chamb.stationIndex)<<std::abs(chamb.stationEta)<<
129 (chamb.stationEta>0 ? "A" : "C")<<chamb.stationPhi<<"-"<<chamb.multilayer<<" ";
130 return ostr;
131}
132
133std::ostream& operator<<(std::ostream& ostr,const MmChamber::MmChannel & channel) {
134 ostr<<"channel (gasGap/number): ";
135 ostr<<channel.gasGap<<"/";
136 ostr<<std::setfill('0')<<std::setw(4)<<channel.channel<<", ";
137 ostr<<"center: "<<Amg::toString(channel.globCenter, 2);
138 return ostr;
139}
140
141
142std::ostream& operator<<(std::ostream& ostr,const MmChamber::MmLayer & layer) {
143 ostr<<"Mmlayer (gasGap): ";
144 ostr<<layer.gasGap<<", ";
145 // ostr<<"transform: "<<Amg::toString(layer.transform);
146 return ostr;
147}
148
149std::set<MmChamber> readTreeDump(const std::string& inputFile) {
150 std::set<MmChamber> to_ret{};
151 std::cout<<"Read the MicroMegas geometry tree dump from "<<inputFile<<std::endl;
152 std::unique_ptr<TFile> inFile{TFile::Open(inputFile.c_str())};
153 if (!inFile || !inFile->IsOpen()) {
154 std::cerr<<__FILE__<<":"<<__LINE__<<" Failed to open "<<inputFile<<std::endl;
155 return to_ret;
156 }
157 TTreeReader treeReader("MmGeoModelTree", inFile.get());
158 if (treeReader.IsInvalid()){
159 std::cerr<<__FILE__<<":"<<__LINE__<<" The file "<<inputFile<<" does not contain the 'MmGeoModelTree'"<<std::endl;
160 return to_ret;
161 }
162
164 TTreeReaderValue<unsigned short> stationIndex{treeReader, "stationIndex"};
165 TTreeReaderValue<short> stationEta{treeReader, "stationEta"};
166 TTreeReaderValue<short> stationPhi{treeReader, "stationPhi"};
167 TTreeReaderValue<short> multilayer{treeReader, "multilayer"};
168
170 TTreeReaderValue<std::vector<uint>> channel{treeReader, "channel"};
171 TTreeReaderValue<std::vector<short>> gasGap{treeReader, "gasGap"};
172 TTreeReaderValue<std::vector<float>> stripLength{treeReader, "stripLength"};
173
174 TTreeReaderValue<std::vector<bool>> isStereo{treeReader, "isStereo"};
175 TTreeReaderValue<std::vector<float>> locStripCenterX{treeReader, "locStripCenterX"};
176 TTreeReaderValue<std::vector<float>> locStripCenterY{treeReader, "locStripCenterY"};
177
178 TTreeReaderValue<std::vector<float>> stripCenterX{treeReader, "stripCenterX"};
179 TTreeReaderValue<std::vector<float>> stripCenterY{treeReader, "stripCenterY"};
180 TTreeReaderValue<std::vector<float>> stripCenterZ{treeReader, "stripCenterZ"};
181 TTreeReaderValue<std::vector<float>> stripLeftEdgeX{treeReader, "stripLeftEdgeX"};
182 TTreeReaderValue<std::vector<float>> stripLeftEdgeY{treeReader, "stripLeftEdgeY"};
183 TTreeReaderValue<std::vector<float>> stripLeftEdgeZ{treeReader, "stripLeftEdgeZ"};
184 TTreeReaderValue<std::vector<float>> stripRightEdgeX{treeReader, "stripRightEdgeX"};
185 TTreeReaderValue<std::vector<float>> stripRightEdgeY{treeReader, "stripRightEdgeY"};
186 TTreeReaderValue<std::vector<float>> stripRightEdgeZ{treeReader, "stripRightEdgeZ"};
187
189 TTreeReaderValue<float> ActiveHeightR{treeReader, "ActiveHeightR"};
190 TTreeReaderValue<float> ActiveWidthS{treeReader, "ActiveWidthS"};
191 TTreeReaderValue<float> ActiveWidthL{treeReader, "ActiveWidthL"};
192
193
194 TTreeReaderValue<float> moduleHeight{treeReader, "moduleHeight"};
195 TTreeReaderValue<float> moduleWidthS{treeReader, "moduleWidthS"};
196 TTreeReaderValue<float> moduleWidthL{treeReader, "moduleWidthL"};
197
198 TTreeReaderValue<float> stripPitch{treeReader, "stripPitch"};
199
201 TTreeReaderValue<std::vector<float>> geoModelTransformX{treeReader, "GeoModelTransformX"};
202 TTreeReaderValue<std::vector<float>> geoModelTransformY{treeReader, "GeoModelTransformY"};
203 TTreeReaderValue<std::vector<float>> geoModelTransformZ{treeReader, "GeoModelTransformZ"};
204
205 TTreeReaderValue<std::vector<float>> alignableNodeX{treeReader, "AlignableNodeX"};
206 TTreeReaderValue<std::vector<float>> alignableNodeY{treeReader, "AlignableNodeY"};
207 TTreeReaderValue<std::vector<float>> alignableNodeZ{treeReader, "AlignableNodeZ"};
208
209 TTreeReaderValue<std::vector<float>> stripRotCol1X{treeReader, "stripRotLinearCol1X"};
210 TTreeReaderValue<std::vector<float>> stripRotCol1Y{treeReader, "stripRotLinearCol1Y"};
211 TTreeReaderValue<std::vector<float>> stripRotCol1Z{treeReader, "stripRotLinearCol1Z"};
212
213 TTreeReaderValue<std::vector<float>> stripRotCol2X{treeReader, "stripRotLinearCol2X"};
214 TTreeReaderValue<std::vector<float>> stripRotCol2Y{treeReader, "stripRotLinearCol2Y"};
215 TTreeReaderValue<std::vector<float>> stripRotCol2Z{treeReader, "stripRotLinearCol2Z"};
216
217 TTreeReaderValue<std::vector<float>> stripRotCol3X{treeReader, "stripRotLinearCol3X"};
218 TTreeReaderValue<std::vector<float>> stripRotCol3Y{treeReader, "stripRotLinearCol3Y"};
219 TTreeReaderValue<std::vector<float>> stripRotCol3Z{treeReader, "stripRotLinearCol3Z"};
220
221 TTreeReaderValue<std::vector<float>> stripRotTransX{treeReader, "stripRotTranslationX"};
222 TTreeReaderValue<std::vector<float>> stripRotTransY{treeReader, "stripRotTranslationY"};
223 TTreeReaderValue<std::vector<float>> stripRotTransZ{treeReader, "stripRotTranslationZ"};
224
225 TTreeReaderValue<std::vector<uint8_t>> stripRotGasGap{treeReader, "stripRotGasGap"};
226
227 TTreeReaderValue<std::vector<float>> firstStripPosX{treeReader, "firstStripPosX"};
228 TTreeReaderValue<std::vector<float>> firstStripPosY{treeReader, "firstStripPosY"};
229
230 TTreeReaderValue<std::vector<int>> readoutSide{treeReader, "stripReadoutSide"};
231 TTreeReaderValue<std::vector<unsigned int>> firstStrip{treeReader, "firstStrip"};
232 TTreeReaderValue<std::vector<unsigned int>> nStrips{treeReader, "nStrips"};
233
234
235
236 while (treeReader.Next()) {
237 MmChamber newchamber{};
238
240 newchamber.stationIndex = (*stationIndex);
241 newchamber.stationEta = (*stationEta);
242 newchamber.stationPhi = (*stationPhi);
243 newchamber.multilayer = (*multilayer);
244
246 newchamber.ActiveHeightR = (*ActiveHeightR);
247 newchamber.ActiveWidthS = (*ActiveWidthS);
248 newchamber.ActiveWidthL = (*ActiveWidthL);
249 newchamber.stripPitch = (*stripPitch);
250 newchamber.moduleHeight = (*moduleHeight);
251 newchamber.moduleWidthS = (*moduleWidthS);
252 newchamber.moduleWidthL = (*moduleWidthL);
253
254 Amg::Vector3D geoTrans{(*geoModelTransformX)[0], (*geoModelTransformY)[0], (*geoModelTransformZ)[0]};
255 Amg::RotationMatrix3D geoRot{Amg::RotationMatrix3D::Identity()};
256 geoRot.col(0) = Amg::Vector3D((*geoModelTransformX)[1], (*geoModelTransformY)[1], (*geoModelTransformZ)[1]);
257 geoRot.col(1) = Amg::Vector3D((*geoModelTransformX)[2], (*geoModelTransformY)[2], (*geoModelTransformZ)[2]);
258 geoRot.col(2) = Amg::Vector3D((*geoModelTransformX)[3], (*geoModelTransformY)[3], (*geoModelTransformZ)[3]);
259 newchamber.geoModelTransform = Amg::getTransformFromRotTransl(std::move(geoRot), std::move(geoTrans));
260
261 geoRot.col(0) = Amg::Vector3D((*alignableNodeX)[1], (*alignableNodeY)[1], (*alignableNodeZ)[1]);
262 geoRot.col(1) = Amg::Vector3D((*alignableNodeX)[2], (*alignableNodeY)[2], (*alignableNodeZ)[2]);
263 geoRot.col(2) = Amg::Vector3D((*alignableNodeX)[3], (*alignableNodeY)[3], (*alignableNodeZ)[3]);
264 geoTrans = Amg::Vector3D{(*alignableNodeX)[0], (*alignableNodeY)[0], (*alignableNodeZ)[0]};
265 newchamber.alignableTransform = Amg::getTransformFromRotTransl(std::move(geoRot), std::move(geoTrans));
266 //Strips
267 for (size_t s = 0; s < stripCenterX->size(); ++s){
268 MmChamber::MmChannel newStrip{};
269 newStrip.globCenter = Amg::Vector3D{(*stripCenterX)[s], (*stripCenterY)[s], (*stripCenterZ)[s]};
270 newStrip.locCenter = Amg::Vector2D{(*locStripCenterX)[s], (*locStripCenterY)[s]};
271 newStrip.leftEdge = Amg::Vector3D{(*stripLeftEdgeX)[s], (*stripLeftEdgeY)[s], (*stripLeftEdgeZ)[s]};
272 newStrip.rightEdge = Amg::Vector3D{(*stripRightEdgeX)[s], (*stripRightEdgeY)[s], (*stripRightEdgeZ)[s]};
273
274 newStrip.gasGap = (*gasGap)[s];
275 newStrip.channel = (*channel)[s];
276 newStrip.isStereo = (*isStereo)[s];
277 newStrip.stripLength = (*stripLength)[s];
278 newchamber.channels.insert(std::move(newStrip));
279 }
280
281 for (size_t l = 0; l < stripRotGasGap->size(); ++l){
282 MmChamber::MmLayer newLayer{};
283 newLayer.gasGap = (*stripRotGasGap)[l];
284 Amg::RotationMatrix3D stripRot{Amg::RotationMatrix3D::Identity()};
285 stripRot.col(0) = Amg::Vector3D((*stripRotCol1X)[l],(*stripRotCol1Y)[l], (*stripRotCol1Z)[l]);
286 stripRot.col(1) = Amg::Vector3D((*stripRotCol2X)[l],(*stripRotCol2Y)[l], (*stripRotCol2Z)[l]);
287 stripRot.col(2) = Amg::Vector3D((*stripRotCol3X)[l],(*stripRotCol3Y)[l], (*stripRotCol3Z)[l]);
288 Amg::Vector3D layTrans{(*stripRotTransX)[l], (*stripRotTransY)[l], (*stripRotTransZ)[l]};
289 newLayer.transform = Amg::getTransformFromRotTransl(std::move(stripRot), std::move(layTrans));
290 newLayer.firstStripPos = Amg::Vector2D{(*firstStripPosX)[l], (*firstStripPosY)[l]};
291 newLayer.readoutSide = (*readoutSide)[l];
292 newLayer.firstStrip = (*firstStrip)[l];
293 newLayer.nStrips = (*nStrips)[l];
294
295 newchamber.layers.insert(std::move(newLayer));
296 }
297
298 auto insert_itr = to_ret.insert(std::move(newchamber));
299 if (!insert_itr.second) {
300 std::stringstream err{};
301 err<<__FILE__<<":"<<__LINE__<<" The chamber "<<(*insert_itr.first).stationIndex
302 <<" has already been inserted. "<<std::endl;
303 throw std::runtime_error(err.str());
304 }
305 }
306 std::cout<<"File parsing is finished. Found in total "<<to_ret.size()<<" readout element dumps "<<std::endl;
307 return to_ret;
308}
309
310#define TEST_BASICPROP(attribute, propName) \
311 if (std::abs(1.*test.attribute - 1.*reference.attribute) > tolerance) { \
312 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": The chamber "<<reference \
313 <<" differs w.r.t "<<propName<<" "<< reference.attribute \
314 <<" (ref) vs. " <<test.attribute << " (test)" \
315 <<", delta: "<<reference.attribute - test.attribute << std::endl; \
316 chamberOkay = false; \
317 }
318
319int main( int argc, char** argv ) {
320 std::string refFile{}, testFile{};
321
322 for (int arg = 1; arg < argc; ++arg) {
323 std::string the_arg{argv[arg]};
324 if (the_arg == "--refFile" && arg +1 < argc) {
325 refFile = std::string{argv[arg+1]};
326 ++arg;
327 } else if (the_arg == "--testFile" && arg + 1 < argc) {
328 testFile = std::string{argv[arg+1]};
329 ++arg;
330 }
331 }
332 if (refFile.empty()) {
333 std::cerr<<"Please parse the path of the reference file via --refFile "<<std::endl;
334 return EXIT_FAILURE;
335 }
336 if (testFile.empty()) {
337 std::cerr<<"Please parse the path of the test file via --testFile "<<std::endl;
338 return EXIT_FAILURE;
339 }
341 if (!refFile.starts_with ("root://")) refFile = PathResolver::FindCalibFile(refFile);
342 if (!testFile.starts_with ("root://")) testFile = PathResolver::FindCalibFile(testFile);
344 std::set<MmChamber> refChambers = readTreeDump(refFile);
345 if (refChambers.empty()) {
346 std::cerr<<"The file "<<refFile<<" should contain at least one chamber "<<std::endl;
347 return EXIT_FAILURE;
348 }
349 std::set<MmChamber> testChambers = readTreeDump(testFile);
350 if (testChambers.empty()) {
351 std::cerr<<"The file "<<testFile<<" should contain at least one chamber "<<std::endl;
352 return EXIT_FAILURE;
353 }
354 int return_code = EXIT_SUCCESS;
356 for (const MmChamber& reference : refChambers) {
357 std::set<MmChamber>::const_iterator test_itr = testChambers.find(reference);
358
359 if (test_itr == testChambers.end()) {
360 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": The chamber "<<reference
361 <<" is not part of the testing "<<std::endl;
362 return_code = EXIT_FAILURE;
363 continue;
364 }
365 bool chamberOkay{true};
366 const MmChamber& test = {*test_itr};
367
368 const Amg::Transform3D alignableDistort = test.alignableTransform.inverse()*(reference.alignableTransform );
369 if (!Amg::doesNotDeform(alignableDistort) || alignableDistort.translation().mag() > tolerance) {
370 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": The alignable nodes are at differnt places for "
371 <<test<<". " <<Amg::toString(alignableDistort, 3)<<std::endl;
372 chamberOkay = false;
373 }
374
376
377 {
378 constexpr double tolerance = 3. * Gaudi::Units::mm;
379 TEST_BASICPROP(ActiveWidthS, "GasGap length on the short side");
380 TEST_BASICPROP(ActiveWidthL, "GasGap length on the long side");
381
382 }
383 TEST_BASICPROP(moduleWidthL, "Long module width");
384 TEST_BASICPROP(moduleWidthS, "Short module width");
385 TEST_BASICPROP(moduleHeight, "Module height ");
386
387 TEST_BASICPROP(ActiveHeightR, "GasGap Height");
388 TEST_BASICPROP(stripPitch, "Strip pitch");
389 // if (!chamberOkay) continue;
390 using MmLayer = MmChamber::MmLayer;
391 for (const MmLayer& refLayer : reference.layers) {
392 std::set<MmLayer>::const_iterator lay_itr = test.layers.find(refLayer);
393 if (lay_itr == test.layers.end()) {
394 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
395 <<refLayer<<" is not found. "<<std::endl;
396 chamberOkay = false;
397 continue;
398 }
399 const MmLayer& testLayer{*lay_itr};
400 if (!Amg::isIdentity(refLayer.transform.inverse()* testLayer.transform)){
401 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
402 <<testLayer<<" differs w.r.t. reference. delta: "
403 <<Amg::toString(refLayer.transform.inverse()*testLayer.transform)<<std::endl;
404 chamberOkay = false;
405 }
406 if (refLayer.firstStrip != testLayer.firstStrip) {
407 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
408 <<testLayer.gasGap<<" starts from different strip "<<refLayer.firstStrip<<" vs. "
409 <<testLayer.firstStrip<<std::endl;
410 chamberOkay = false;
411 }
412 if (refLayer.nStrips != testLayer.nStrips) {
413 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
414 <<testLayer.gasGap<<" has different number of strips "<<refLayer.nStrips<<" vs. "
415 <<testLayer.nStrips<<std::endl;
416 chamberOkay = false;
417 }
419 if (false && (refLayer.firstStripPos- testLayer.firstStripPos).mag() > tolerance) {
420 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
421 <<testLayer.gasGap<<" has different starting position "
422 <<Amg::toString(refLayer.firstStripPos, 2) <<" vs. "
423 <<Amg::toString(testLayer.firstStripPos, 2)
424 <<"difference: "<<Amg::toString(refLayer.firstStripPos- testLayer.firstStripPos, 2)
425 <<" / "<<(refLayer.firstStripPos- testLayer.firstStripPos).mag()/reference.stripPitch
426 <<std::endl;
427 chamberOkay = false;
428 }
429 }
430 if (!chamberOkay) continue;
431 unsigned int failedEta{0}, lastGap{0};
432 for (const MmChamber::MmChannel& refStrip : reference.channels) {
433 std::set<MmChamber::MmChannel>::const_iterator strip_itr = test.channels.find(refStrip);
434 if (strip_itr == test.channels.end()) {
435 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": in "<<test<<" "
436 <<refStrip<<" is not found. "<<std::endl;
437 chamberOkay = false;
438 continue;
439 }
440 if (lastGap != refStrip.gasGap) {
441 lastGap = refStrip.gasGap;
442 failedEta = 0;
443 }
444 const MmChamber::MmChannel& testStrip{*strip_itr};
451 if (failedEta <= 10) {
452 const Amg::Vector3D stripDir{Amg::getRotateZ3D(90*Gaudi::Units::deg)*
453 (refStrip.rightEdge - refStrip.leftEdge).unit()};
454 const Amg::Vector3D testDir{Amg::getRotateZ3D(90*Gaudi::Units::deg)*
455 (testStrip.rightEdge - testStrip.leftEdge).unit()};
456 const double centerDist = stripDir.dot(testStrip.globCenter - refStrip.globCenter);
457 const double leftDist = stripDir.dot(testStrip.leftEdge -refStrip.globCenter);
458 const double rightDist = stripDir.dot(testStrip.rightEdge - refStrip.globCenter);
459 if ( std::abs(centerDist) > tolerance || std::abs(leftDist) > tolerance || std::abs(rightDist) > tolerance) {
460 std::cerr<<"runMmGeoComparison() "<<__LINE__<<": In "
461 <<test<<" " <<testStrip <<" + mu "<<Amg::toString(testDir,2)
462 <<"/local: "<<Amg::toString(testStrip.locCenter, 2)
463 <<" does not describe the same stereo strip as "
464 <<Amg::toString(refStrip.globCenter, 2)<<"/local:"
465 <<Amg::toString(refStrip.locCenter,2)<<" + lambda "<<Amg::toString(stripDir,2)
466 <<". Distances to the left-edge/center/right-edge: "
467 <<leftDist<<"/"<<centerDist<<"/"<<rightDist<<", dot: "
468 <<std::acos(std::clamp(stripDir.dot(testDir),- 1., 1.)) / Gaudi::Units::deg<<std::endl;
469 chamberOkay = false;
470 }
471 ++failedEta;
472 }
473 }
474
475 if (!chamberOkay) {
476 return_code = EXIT_FAILURE;
477 }
478 }
479 return return_code;
480
481}
482
483
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 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.