ATLAS Offline Software
Loading...
Searching...
No Matches
runMmGeoComparison.cxx File Reference
#include <GeoPrimitives/GeoPrimitives.h>
#include <GeoPrimitives/GeoPrimitivesHelpers.h>
#include <GeoPrimitives/GeoPrimitivesToStringConverter.h>
#include <GaudiKernel/SystemOfUnits.h>
#include <MuonReadoutGeometryR4/MuonDetectorDefs.h>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <iostream>
#include <cmath>
#include <PathResolver/PathResolver.h>
#include <TFile.h>
#include <TTreeReader.h>
#include "Acts/Utilities/UnitVectors.hpp"
#include "Acts/Definitions/Units.hpp"

Go to the source code of this file.

Classes

struct  MmChamber
 Helper struct to represent a full MicroMegas chamber. More...
struct  MmChamber::MmChannel
struct  MmChamber::MmLayer
 Helper struct to assess that the layers are properly oriented. More...

Macros

#define TEST_BASICPROP(attribute, propName)

Functions

Amg::Vector3D makeDir (const double theta, const double phi)
std::ostream & operator<< (std::ostream &ostr, const MmChamber &chamb)
 Translation of the station Index -> station Name.
std::ostream & operator<< (std::ostream &ostr, const MmChamber::MmChannel &channel)
std::ostream & operator<< (std::ostream &ostr, const MmChamber::MmLayer &layer)
std::set< MmChamberreadTreeDump (const std::string &inputFile)
int main1 (int argc, char **argv)
int main (int argc, char **argv)

Variables

constexpr double tolerance = 0.003*Gaudi::Units::millimeter

Macro Definition Documentation

◆ TEST_BASICPROP

#define TEST_BASICPROP ( attribute,
propName )
Value:
if (std::abs(1.*test.attribute - 1.*reference.attribute) > tolerance) { \
std::cerr<<"runMmGeoComparison() "<<__LINE__<<": The chamber "<<reference \
<<" differs w.r.t "<<propName<<" "<< reference.attribute \
<<" (ref) vs. " <<test.attribute << " (test)" \
<<", delta: "<<reference.attribute - test.attribute << std::endl; \
chamberOkay = false; \
}

Definition at line 316 of file runMmGeoComparison.cxx.

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 }

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 490 of file runMmGeoComparison.cxx.

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}
int main1()
Definition testRead.cxx:68

◆ main1()

int main1 ( int argc,
char ** argv )

check whether the files are xroot d -> otherwise call path resovler

Parse the tree dump

Start to loop over the chambers

GasGap Dimensions for debugging

Gnarf the channel design shifts by 1.5 pitches

The centres of the Stereo layers are defined as the bisector of the line between the two frame edges. However, thus far the parameter book deviates from the legacy Run-3 implementation. --> Cannot compare the absolute position of the stereo layers. Instead check that the left edge, right edge and center point in the new geometry are on the same line as defined by the reference system.

Definition at line 325 of file runMmGeoComparison.cxx.

325 {
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}
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)
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
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 getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
std::set< MmChamber > readTreeDump(const std::string &inputFile)
#define TEST_BASICPROP(attribute, propName)
Amg::Vector3D rightEdge
Right edge of the strip.
Amg::Vector3D globCenter
Global center of the micromega strip.
Amg::Vector2D locCenter
Local center of the micromega strip.
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.
Helper struct to represent a full MicroMegas chamber.

◆ makeDir()

Amg::Vector3D makeDir ( const double theta,
const double phi )

Definition at line 35 of file runMmGeoComparison.cxx.

35 {
36 using namespace Acts::UnitLiterals;
37 return Acts::makeDirectionFromPhiTheta(phi *1._degree, theta* 1._degree);
38}
Scalar phi() const
phi method
Scalar theta() const
theta method

◆ operator<<() [1/3]

std::ostream & operator<< ( std::ostream & ostr,
const MmChamber & chamb )

Translation of the station Index -> station Name.

Dictionary taken from https://gitlab.cern.ch/atlas/athena/-/blob/main/DetectorDescription/IdDictParser/data/IdDictMuonSpectrometer_R.09.03.xml

Definition at line 132 of file runMmGeoComparison.cxx.

132 {
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}

◆ operator<<() [2/3]

std::ostream & operator<< ( std::ostream & ostr,
const MmChamber::MmChannel & channel )

Definition at line 141 of file runMmGeoComparison.cxx.

141 {
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}

◆ operator<<() [3/3]

std::ostream & operator<< ( std::ostream & ostr,
const MmChamber::MmLayer & layer )

Definition at line 150 of file runMmGeoComparison.cxx.

150 {
151 ostr<<"Mmlayer (gasGap): ";
152 ostr<<layer.gasGap<<", ";
153 // ostr<<"transform: "<<Amg::toString(layer.transform);
154 return ostr;
155}
@ layer
Definition HitInfo.h:79

◆ readTreeDump()

std::set< MmChamber > readTreeDump ( const std::string & inputFile)

Identifier of the readout element

Strip Length and Positions

GasGap Dimensions for debugging

Geo Model transformation

Identifier of the readout element

Gas Gap lengths for debug

Definition at line 157 of file runMmGeoComparison.cxx.

157 {
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}
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Amg::Transform3D getTransformFromRotTransl(Amg::RotationMatrix3D rot, Amg::Vector3D transl_vec)
Eigen::Matrix< double, 2, 1 > Vector2D
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
constexpr uint8_t stationPhi
station Phi 1 to 8
l
Printing final latex table to .tex output file.
str inFile
Definition makeTOC.py:5
Amg::Vector3D makeDir(const double theta, const double phi)
unsigned int channel
strip number
double stripLength
length of the strip
bool isStereo
Short flag whether the angle is stereo.
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
std::set< MmLayer > layers
std::set< MmChannel > channels
Amg::Transform3D geoModelTransform
Transformation of the underlying GeoModel element.
Amg::Transform3D alignableTransform
Transformation of the underlying Alignable node.

Variable Documentation

◆ tolerance

double tolerance = 0.003*Gaudi::Units::millimeter
constexpr

Definition at line 33 of file runMmGeoComparison.cxx.