ATLAS Offline Software
Classes | Macros | Functions | Variables
runTgcGeoComparison.cxx File Reference
#include <MuonReadoutGeometryR4/MuonDetectorDefs.h>
#include <MuonReadoutGeometryR4/StripDesign.h>
#include <GeoPrimitives/GeoPrimitives.h>
#include <GeoPrimitives/GeoPrimitivesHelpers.h>
#include <GeoPrimitives/GeoPrimitivesToStringConverter.h>
#include <GaudiKernel/SystemOfUnits.h>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <iostream>
#include <PathResolver/PathResolver.h>
#include <TFile.h>
#include <TTreeReader.h>
#include "GeoModelHelpers/TransformToStringConverter.h"

Go to the source code of this file.

Classes

struct  TgcChamber
 Helper struct to represent a full Rpc chamber. More...
 
struct  TgcChamber::WireGang
 
struct  TgcChamber::LayerTrans
 
struct  TgcChamber::RadialStrip
 

Macros

#define TEST_BASICPROP(attribute, propName)
 
#define TEST_LAYPROP(attribute, propName)
 

Functions

std::ostream & operator<< (std::ostream &ostr, const TgcChamber::WireGang &gang)
 
std::ostream & operator<< (std::ostream &ostr, const TgcChamber::RadialStrip &strip)
 
std::ostream & operator<< (std::ostream &ostr, const TgcChamber::LayerTrans &lTrans)
 
std::ostream & operator<< (std::ostream &ostr, const TgcChamber &chamb)
 
std::set< TgcChamberreadTreeDump (const std::string &inputFile)
 
int main (int argc, char **argv)
 

Variables

constexpr double tolerance = 10 * Gaudi::Units::micrometer
 Helper macro to compare the output from the readout geometry dumps: python -m MuonGeoModelTest.runGeoModelTest python -m MuonGeoModelTestR4.runGeoModelTest. More...
 

Macro Definition Documentation

◆ TEST_BASICPROP

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

Definition at line 343 of file runTgcGeoComparison.cxx.

◆ TEST_LAYPROP

#define TEST_LAYPROP (   attribute,
  propName 
)
Value:
if (std::abs(1.*refTrans.attribute - 1.*testTrans.attribute) > tolerance) { \
std::cerr<<"runTgcComparison() "<<__LINE__<<": The chamber "<<test \
<<" differs in "<<refTrans<<" w.r.t. "<<propName<<". " \
<<refTrans.attribute<<" (ref) vs. "<<testTrans.attribute \
<<" (test), delta: "<<(refTrans.attribute - testTrans.attribute) \
<<std::endl; \
chambOk = false; \
}

Definition at line 351 of file runTgcGeoComparison.cxx.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

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

Check the chamber dimensions

Check the orientation of the layers

check whether the transformations lead to the same point

TEST_LAYPROP(shortWidth, "short width"); TEST_LAYPROP(longWidth, "long width"); TEST_LAYPROP(height, "height");

Let's take a look at the wire gang positions

Definition at line 360 of file runTgcGeoComparison.cxx.

360  {
361  std::string refFile{}, testFile{};
362 
363  for (int arg = 1; arg < argc; ++arg) {
364  std::string the_arg{argv[arg]};
365  if (the_arg == "--refFile" && arg +1 < argc) {
366  refFile = std::string{argv[arg+1]};
367  ++arg;
368  } else if (the_arg == "--testFile" && arg + 1 < argc) {
369  testFile = std::string{argv[arg+1]};
370  ++arg;
371  }
372  }
373  if (refFile.empty()) {
374  std::cerr<<"Please parse the path of the reference file via --refFile "<<std::endl;
375  return EXIT_FAILURE;
376  }
377  if (testFile.empty()) {
378  std::cerr<<"Please parse the path of the test file via --testFile "<<std::endl;
379  return EXIT_FAILURE;
380  }
382  if (!refFile.starts_with( "root://")) refFile = PathResolver::FindCalibFile(refFile);
383  if (!testFile.starts_with( "root://")) testFile = PathResolver::FindCalibFile(testFile);
384 
385  const std::set<TgcChamber> refChambers = readTreeDump(refFile);
386  if (refChambers.empty()) {
387  std::cerr<<"runTgcComparison() "<<__LINE__<<": No chambers in reference file."<<std::endl;
388  return EXIT_FAILURE;
389  }
390  const std::set<TgcChamber> testChambers = readTreeDump(testFile);
391  if (testChambers.empty()) {
392  std::cerr<<"runTgcComparison() "<<__LINE__<<": No chambers in test file."<<std::endl;
393  return EXIT_FAILURE;
394  }
395 
396  int retCode{EXIT_SUCCESS};
397  for (const TgcChamber& ref : refChambers) {
398  std::set<TgcChamber>::const_iterator test_itr = testChambers.find(ref);
399  if (test_itr == testChambers.end()) {
400  std::cerr<<"runTgcComparison() "<<__LINE__<<": The chamber "<<ref<<" is not in the test geometry. "<<std::endl;
401  retCode = EXIT_FAILURE;
402  continue;
403  }
404  const TgcChamber& test{*test_itr};
405  bool chambOk{true};
407  TEST_BASICPROP(nGasGaps, "number of gasgaps");
408  TEST_BASICPROP(thickness, "chamber thickness");
409  TEST_BASICPROP(shortWidth, "chamber short width");
410  TEST_BASICPROP(longWidth, "chamber long width");
411  TEST_BASICPROP(height, "chamber height");
412 
413  const Amg::Transform3D alignableDistort = test.alignableTransform.inverse()*(ref.alignableTransform );
414  if (!Amg::doesNotDeform(alignableDistort) || alignableDistort.translation().mag() > tolerance) {
415  std::cerr<<"runTgcComparison() "<<__LINE__<<": The alignable nodes are at differnt places for "
416  <<ref<<". " <<GeoTrf::toString(alignableDistort, true)<<std::endl;
417  chambOk = false;
418  }
419 
420  chambOk = true;
422  for (const TgcChamber::LayerTrans& refTrans : ref.transforms) {
423  std::set<TgcChamber::LayerTrans>::const_iterator l_test_itr = test.transforms.find(refTrans);
424  if (l_test_itr == test.transforms.end()) {
425  std::cerr<<"runTgcComparison() "<<__LINE__<<": The layer "<<refTrans
426  <<" in chamber "<<ref <<" is not part of the test geometry. "<<std::endl;
427  chambOk = false;
428  break;
429  }
430  const TgcChamber::LayerTrans& testTrans{*l_test_itr};
432  const Amg::Transform3D layTest = testTrans.trans.inverse() * refTrans.trans;
433  if (!Amg::doesNotDeform(layTest)) {
434  std::cerr<<"runTgcComparison() "<<__LINE__<<": In "<<ref<<" "<<refTrans
435  <<", the transformations are orientated diffrently "<<Amg::toString(layTest)<<std::endl;
436  chambOk = false;
437  break;
438  }
439  if (layTest.translation().mag() > tolerance) {
440  std::cerr<<"runTgcComparison() "<<__LINE__<<": The transformations in layer "<<refTrans<<", "
441  <<ref<<" are pointing to different reference points "<<Amg::toString(layTest.translation(),2)<<std::endl;
442  chambOk = false;
443  break;
444  }
445  TEST_LAYPROP(numWires, "number of wires");
449  }
450  if (!chambOk) continue;
451  for (const TgcChamber::RadialStrip& refStrip : ref.strips) {
452  std::set<TgcChamber::RadialStrip>::const_iterator s_test_itr = test.strips.find(refStrip);
453  if (s_test_itr == test.strips.end()) {
454  std::cerr<<"runTgcComparison() "<<__LINE__<<": In chamber "<<ref
455  <<" "<<refStrip<<" is not part of the test geometry. "<<std::endl;
456  chambOk = false;
457  continue;
458  }
459  const TgcChamber::RadialStrip& testStrip{*s_test_itr};
460  if ( (testStrip.locCenter - refStrip.locCenter).mag() > tolerance) {
461  std::cerr<<"runTgcComparison() "<<__LINE__<<": In "<<ref<<", "
462  <<refStrip<<" should be located at "<<Amg::toString(refStrip.locCenter, 1)<<
463  ". Currently, it is at "<<Amg::toString(testStrip.locCenter, 1)<<std::endl;
464  chambOk = false;
465  continue;
466  }
467 
468  if ( (testStrip.globCenter - refStrip.globCenter).mag() > tolerance) {
469  std::cerr<<"runTgcComparison() "<<__LINE__<<": In "<<ref
470  <<" " <<refStrip<<" should be located at "<<Amg::toString(refStrip.globCenter, 1)<<
471  ". Currently, it is at "<<Amg::toString(testStrip.globCenter, 1)<<std::endl;
472  chambOk = false;
473  }
474  }
475  if (!chambOk) {
476  retCode = EXIT_FAILURE;
477  continue;
478  }
480  for (const TgcChamber::WireGang& refGang : ref.etaWires) {
481  std::set<TgcChamber::WireGang>::const_iterator test_itr = test.etaWires.find(refGang);
482  if (test_itr == test.etaWires.end()) {
483  std::cerr<<"runTgcComparison() "<<__LINE__<<": "<<refGang<<" is not part of "
484  <<ref<<std::endl;
485  retCode = EXIT_FAILURE;
486  continue;
487  }
488  const TgcChamber::WireGang& testGang{*test_itr};
489  if (testGang.numWires != refGang.numWires) {
490  std::cerr<<"runTgcComparison() "<<__LINE__<<": "<<refGang<<" in "<<ref
491  <<" has different wires. "<<refGang.numWires<<" vs. "
492  <<testGang.numWires<<std::endl;
493  chambOk = false;
494  }
495 
496  const Amg::Vector2D lDiffPos = refGang.localPos - testGang.localPos;
497  constexpr double halfPitch = 0.9 * Gaudi::Units::mm;
498  if (lDiffPos.mag() - halfPitch > tolerance) {
499  std::cerr<<"runTgcComparison() "<<__LINE__<<": In "<<ref<<" "<<testGang
500  <<" should be located at "<<Amg::toString(refGang.localPos,2)
501  <<" but is found at "<<Amg::toString(testGang.localPos, 2)
502  <<", mag="<<lDiffPos.mag()
503  <<" "<<lDiffPos.mag() / 1.8 <<std::endl;
504  chambOk = false;
505  continue;
506  }
507 
508 
509  const Amg::Vector3D diffPos = refGang.position - testGang.position;
510  if (diffPos.mag() - halfPitch > tolerance) {
511  std::cerr<<"runTgcComparison() "<<__LINE__<<": In "<<ref<<" "<<testGang
512  <<" is displaced by "<<Amg::toString(diffPos, 2)<<", mag="<<diffPos.mag()<<std::endl;
513  chambOk = false;
514  continue;
515  }
516 
517  if (false && std::abs(refGang.length - testGang.length) > tolerance) {
518  std::cerr<<"runTgcComparison() "<<__LINE__<<": In "<<ref<<" "<<testGang<<" different length detected "
519  <<refGang.length<<" (ref) vs. "<<testGang.length<<" (test). Delta: "
520  <<(refGang.length - testGang.length) <<std::endl;
521  chambOk = false;
522  }
523  }
524  if (!chambOk) {
525  retCode = EXIT_FAILURE;
526  } else {
527  std::cout<<"runTgcComparison() "<<__LINE__<<": Agreement between ref & test for "<<ref<<std::endl;
528  }
529  }
530  return retCode;
531 }

◆ operator<<() [1/4]

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

Definition at line 133 of file runTgcGeoComparison.cxx.

133  {
134  static const std::map<int, std::string> stationDict{
135  {41, "T1F"}, {42, "T1E"},
136  {43, "T2F"}, {44, "T2E"},
137  {45, "T3F"}, {46, "T3E"},
138  {47, "T4F"}, {48, "T4E"},
139  };
140  ostr<<"tech: "<<chamb.techName<<", ";
141  ostr<<"eta: "<<std::setfill(' ')<<std::setw(2)<<chamb.eta<<", ";
142  ostr<<"phi: "<<std::setfill('0')<<std::setw(2)<<chamb.phi<<", ";
143  ostr<<"stName: "<<stationDict.at(chamb.stIdx);
144  ostr<<std::setw(-1);
145  return ostr;
146 }

◆ operator<<() [2/4]

std::ostream& operator<< ( std::ostream &  ostr,
const TgcChamber::LayerTrans lTrans 
)

Definition at line 128 of file runTgcGeoComparison.cxx.

128  {
129  ostr<<"layer transform (gap/measPhi) "<<lTrans.gasGap<<"/"<<(lTrans.measPhi ? "si" : "no");
130  // ostr<<" "<<Amg::toString(lTrans.trans);
131  return ostr;
132 }

◆ operator<<() [3/4]

std::ostream& operator<< ( std::ostream &  ostr,
const TgcChamber::RadialStrip strip 
)

Definition at line 124 of file runTgcGeoComparison.cxx.

124  {
125  ostr<<"strip (gap/number): "<<strip.gasGap<<"/"<<std::setfill('0')<<std::setw(2)<<strip.number<<std::setw(-1);
126  return ostr;
127 }

◆ operator<<() [4/4]

std::ostream& operator<< ( std::ostream &  ostr,
const TgcChamber::WireGang gang 
)

Definition at line 119 of file runTgcGeoComparison.cxx.

119  {
120  ostr<<"wire gang (gap/number/n-Wires/length): "<<gang.gasGap<<"/"<<std::setfill('0')<<std::setw(2)<<gang.number<<"/"<<std::setfill('0')<<std::setw(3)<<gang.numWires<<std::setw(-1)<<"/"<<gang.length;
121  // ostr<<" position: "<<Amg::toString(gang.position,2 );
122  return ostr;
123 }

◆ readTreeDump()

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

Identifier

Geo Model transformation

Definition at line 149 of file runTgcGeoComparison.cxx.

149  {
150  std::set<TgcChamber> to_ret{};
151  std::cout<<"Read the Tgc 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<<"runTgcComparison() "<<__LINE__<<": Failed to open "<<inputFile<<std::endl;
155  return to_ret;
156  }
157  TTreeReader treeReader("TgcGeoModelTree", inFile.get());
158  if (treeReader.IsInvalid()) {
159  std::cerr<<"runTgcComparison() "<<__LINE__<<": The file "<<inputFile<<" does not contain the 'TgcGeoModelTree'"<<std::endl;
160  return to_ret;
161  }
163  TTreeReaderValue<unsigned short> stationIndex{treeReader, "stationIndex"};
164  TTreeReaderValue<short> stationEta{treeReader, "stationEta"};
165  TTreeReaderValue<short> stationPhi{treeReader, "stationPhi"};
166  TTreeReaderValue<std::string> stationDesign{treeReader, "stationDesign"};
167  TTreeReaderValue<uint8_t> nGasGaps{treeReader, "nGasGaps"};
168 
169  TTreeReaderValue<float> shortWidth{treeReader, "ChamberWidthS"};
170  TTreeReaderValue<float> longWidth{treeReader, "ChamberWidthL"};
171  TTreeReaderValue<float> height{treeReader, "ChamberHeight"};
172  TTreeReaderValue<float> thickness{treeReader, "ChamberThickness"};
174  TTreeReaderValue<std::vector<float>> geoModelTransformX{treeReader, "GeoModelTransformX"};
175  TTreeReaderValue<std::vector<float>> geoModelTransformY{treeReader, "GeoModelTransformY"};
176  TTreeReaderValue<std::vector<float>> geoModelTransformZ{treeReader, "GeoModelTransformZ"};
177 
178  TTreeReaderValue<std::vector<float>> alignableNodeX{treeReader, "AlignableNodeX"};
179  TTreeReaderValue<std::vector<float>> alignableNodeY{treeReader, "AlignableNodeY"};
180  TTreeReaderValue<std::vector<float>> alignableNodeZ{treeReader, "AlignableNodeZ"};
181 
182 
183  TTreeReaderValue<std::vector<float>> gangCenterX{treeReader, "gangCenterX"};
184  TTreeReaderValue<std::vector<float>> gangCenterY{treeReader, "gangCenterY"};
185  TTreeReaderValue<std::vector<float>> gangCenterZ{treeReader, "gangCenterZ"};
186 
187  TTreeReaderValue<std::vector<float>> gangLocalPosX{treeReader, "gangLocalPosX"};
188  TTreeReaderValue<std::vector<float>> gangLocalPosY{treeReader, "gangLocalPosY"};
189 
190 
191  TTreeReaderValue<std::vector<float>> stripCenterX{treeReader, "stripCenterX"};
192  TTreeReaderValue<std::vector<float>> stripCenterY{treeReader, "stripCenterY"};
193  TTreeReaderValue<std::vector<float>> stripCenterZ{treeReader, "stripCenterZ"};
194 
195  TTreeReaderValue<std::vector<float>> stripBottomX{treeReader, "stripBottomX"};
196  TTreeReaderValue<std::vector<float>> stripBottomY{treeReader, "stripBottomY"};
197  TTreeReaderValue<std::vector<float>> stripBottomZ{treeReader, "stripBottomZ"};
198 
199  TTreeReaderValue<std::vector<float>> stripTopX{treeReader, "stripTopX"};
200  TTreeReaderValue<std::vector<float>> stripTopY{treeReader, "stripTopY"};
201  TTreeReaderValue<std::vector<float>> stripTopZ{treeReader, "stripTopZ"};
202 
203  TTreeReaderValue<std::vector<float>> stripLocalCenterX{treeReader, "stripLocalCenterX"};
204  TTreeReaderValue<std::vector<float>> stripLocalCenterY{treeReader, "stripLocalCenterY"};
205  TTreeReaderValue<std::vector<float>> stripLocalBottomX{treeReader, "stripLocalBottomX"};
206  TTreeReaderValue<std::vector<float>> stripLocalBottomY{treeReader, "stripLocalBottomY"};
207  TTreeReaderValue<std::vector<float>> stripLocalTopX{treeReader, "stripLocalTopX"};
208  TTreeReaderValue<std::vector<float>> stripLocalTopY{treeReader, "stripLocalTopY"};
209 
210  TTreeReaderValue<std::vector<uint8_t>> stripGasGap{treeReader, "stripGasGap"};
211  TTreeReaderValue<std::vector<unsigned int>> stripNum{treeReader, "stripNumber"};
212 
213 
214  TTreeReaderValue<std::vector<uint8_t>> gangGasGap{treeReader, "gangGasGap"};
215  TTreeReaderValue<std::vector<unsigned int>> gangNum{treeReader, "gangNumber"};
216  TTreeReaderValue<std::vector<uint8_t>> gangNumWires{treeReader, "gangNumWires"};
217  TTreeReaderValue<std::vector<float>> gangLength{treeReader, "gangLength"};
218 
219  TTreeReaderValue<std::vector<float>> layerCol1X{treeReader, "layerLinearCol1X"};
220  TTreeReaderValue<std::vector<float>> layerCol1Y{treeReader, "layerLinearCol1Y"};
221  TTreeReaderValue<std::vector<float>> layerCol1Z{treeReader, "layerLinearCol1Z"};
222 
223  TTreeReaderValue<std::vector<float>> layerCol2X{treeReader, "layerLinearCol2X"};
224  TTreeReaderValue<std::vector<float>> layerCol2Y{treeReader, "layerLinearCol2Y"};
225  TTreeReaderValue<std::vector<float>> layerCol2Z{treeReader, "layerLinearCol2Z"};
226 
227  TTreeReaderValue<std::vector<float>> layerCol3X{treeReader, "layerLinearCol3X"};
228  TTreeReaderValue<std::vector<float>> layerCol3Y{treeReader, "layerLinearCol3Y"};
229  TTreeReaderValue<std::vector<float>> layerCol3Z{treeReader, "layerLinearCol3Z"};
230 
231  TTreeReaderValue<std::vector<float>> layerTransX{treeReader, "layerTranslationX"};
232  TTreeReaderValue<std::vector<float>> layerTransY{treeReader, "layerTranslationY"};
233  TTreeReaderValue<std::vector<float>> layerTransZ{treeReader, "layerTranslationZ"};
234 
235  TTreeReaderValue<std::vector<bool>> layerMeasPhi{treeReader,"layerMeasPhi"};
236  TTreeReaderValue<std::vector<uint8_t>> layerNumber{treeReader,"layerNumber"};
237 
238  TTreeReaderValue<std::vector<float>> layShortWidth{treeReader,"layerWidthS"};
239  TTreeReaderValue<std::vector<float>> layLongWidth{treeReader,"layerWidthL"};
240  TTreeReaderValue<std::vector<float>> layHeight{treeReader, "layerHeight"};
241  TTreeReaderValue<std::vector<uint16_t>> layerNumWires{treeReader, "layerNumWires"};
242 
243  while (treeReader.Next()) {
244  TgcChamber newchamber{};
245 
246  newchamber.stIdx = (*stationIndex);
247  newchamber.eta = (*stationEta);
248  newchamber.phi = (*stationPhi);
249  newchamber.techName = (*stationDesign);
250  newchamber.shortWidth = (*shortWidth);
251  newchamber.longWidth= (*longWidth);
252  newchamber.height = (*height);
253  newchamber.thickness = (*thickness);
254  newchamber.nGasGaps = (*nGasGaps);
255  Amg::Vector3D geoTrans{(*geoModelTransformX)[0], (*geoModelTransformY)[0], (*geoModelTransformZ)[0]};
256  Amg::RotationMatrix3D geoRot{Amg::RotationMatrix3D::Identity()};
257  geoRot.col(0) = Amg::Vector3D((*geoModelTransformX)[1], (*geoModelTransformY)[1], (*geoModelTransformZ)[1]);
258  geoRot.col(1) = Amg::Vector3D((*geoModelTransformX)[2], (*geoModelTransformY)[2], (*geoModelTransformZ)[2]);
259  geoRot.col(2) = Amg::Vector3D((*geoModelTransformX)[3], (*geoModelTransformY)[3], (*geoModelTransformZ)[3]);
260  newchamber.geoModelTransform = Amg::getTransformFromRotTransl(std::move(geoRot), std::move(geoTrans));
261 
262  geoRot.col(0) = Amg::Vector3D((*alignableNodeX)[1], (*alignableNodeY)[1], (*alignableNodeZ)[1]);
263  geoRot.col(1) = Amg::Vector3D((*alignableNodeX)[2], (*alignableNodeY)[2], (*alignableNodeZ)[2]);
264  geoRot.col(2) = Amg::Vector3D((*alignableNodeX)[3], (*alignableNodeY)[3], (*alignableNodeZ)[3]);
265  geoTrans = Amg::Vector3D{(*alignableNodeX)[0], (*alignableNodeY)[0], (*alignableNodeZ)[0]};
266  newchamber.alignableTransform = Amg::getTransformFromRotTransl(std::move(geoRot), std::move(geoTrans));
267 
268 
269  for (size_t g = 0; g < gangGasGap->size(); ++g) {
270  TgcChamber::WireGang newGang{};
271  newGang.gasGap = (*gangGasGap)[g];
272  newGang.number = (*gangNum)[g];
273  newGang.numWires =(*gangNumWires)[g];
274  newGang.position = Amg::Vector3D{(*gangCenterX)[g], (*gangCenterY)[g], (*gangCenterZ)[g]};
275  newGang.localPos = Amg::Vector2D{(*gangLocalPosX)[g], (*gangLocalPosY)[g]};
276  newGang.length = (*gangLength)[g];
277  auto insert_itr = newchamber.etaWires.insert(std::move(newGang));
278  if (!insert_itr.second) {
279  std::stringstream err{};
280  err<<"runTgcComparison() "<<__LINE__<<": The wire "<<(*insert_itr.first)
281  <<" has already been inserted. "<<std::endl;
282  throw std::runtime_error(err.str());
283  }
284  }
285 
286  for (size_t s = 0; s < stripNum->size(); ++s) {
288  strip.gasGap = (*stripGasGap)[s];
289  strip.number = (*stripNum) [s];
290 
291  strip.globCenter = Amg::Vector3D{(*stripCenterX)[s], (*stripCenterY)[s], (*stripCenterZ)[s]};
292  strip.locCenter = Amg::Vector2D{(*stripLocalCenterX)[s], (*stripLocalCenterY)[s]};
293 
294  strip.globBottom = Amg::Vector3D{(*stripBottomX)[s], (*stripBottomY)[s], (*stripBottomZ)[s]};
295  strip.locBottom = Amg::Vector2D{(*stripLocalBottomX)[s], (*stripLocalBottomY)[s]};
296 
297  strip.globTop = Amg::Vector3D{(*stripTopX)[s], (*stripTopY)[s], (*stripTopZ)[s]};
298  strip.locTop = Amg::Vector2D{(*stripLocalTopX)[s], (*stripLocalTopY)[s]};
299 
300  auto insert_itr = newchamber.strips.insert(std::move(strip));
301  if (!insert_itr.second) {
302  std::stringstream err{};
303  err<<"runTgcComparison() "<<__LINE__<<": The strip "<<(*insert_itr.first)
304  <<" has already been inserted. "<<std::endl;
305  throw std::runtime_error(err.str());
306  }
307  }
308  for (size_t l = 0 ; l < layerMeasPhi->size(); ++l) {
309  Amg::RotationMatrix3D layRot{Amg::RotationMatrix3D::Identity()};
310  layRot.col(0) = Amg::Vector3D{(*layerCol1X)[l], (*layerCol1Y)[l], (*layerCol1Z)[l]};
311  layRot.col(1) = Amg::Vector3D{(*layerCol2X)[l], (*layerCol2Y)[l], (*layerCol2Z)[l]};
312  layRot.col(2) = Amg::Vector3D{(*layerCol3X)[l], (*layerCol3Y)[l], (*layerCol3Z)[l]};
313  Amg::Vector3D trans{(*layerTransX)[l],(*layerTransY)[l],(*layerTransZ)[l]};
314  TgcChamber::LayerTrans layTrans{};
315  layTrans.trans = Amg::getTransformFromRotTransl(std::move(layRot), std::move(trans));
316  layTrans.gasGap = (*layerNumber)[l];
317  layTrans.measPhi = (*layerMeasPhi)[l];
318  layTrans.shortWidth = (*layShortWidth)[l];
319  layTrans.longWidth = (*layLongWidth)[l];
320  layTrans.height = (*layHeight)[l];
321  layTrans.numWires = (*layerNumWires)[l];
322  auto insert_itr = newchamber.transforms.insert(std::move(layTrans));
323  if (!insert_itr.second) {
324  std::stringstream err{};
325  err<<"runTgcComparison() "<<__LINE__<<": The layer transformation "<<(*insert_itr.first)
326  <<" has already been inserted. "<<std::endl;
327  throw std::runtime_error(err.str());
328  }
329  }
330 
331  auto insert_itr = to_ret.insert(std::move(newchamber));
332  if (!insert_itr.second) {
333  std::stringstream err{};
334  err<<"runTgcComparison() "<<__LINE__<<": The chamber "<<(*insert_itr.first)
335  <<" has already been inserted. "<<std::endl;
336  throw std::runtime_error(err.str());
337  }
338  }
339  return to_ret;
340 }

Variable Documentation

◆ tolerance

constexpr double tolerance = 10 * Gaudi::Units::micrometer
constexpr

Helper macro to compare the output from the readout geometry dumps: python -m MuonGeoModelTest.runGeoModelTest python -m MuonGeoModelTestR4.runGeoModelTest.

Definition at line 30 of file runTgcGeoComparison.cxx.

Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:161
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TgcChamber::LayerTrans::trans
Amg::Transform3D trans
Definition: runTgcGeoComparison.cxx:79
PathResolver::FindCalibFile
static std::string FindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.h:108
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
TgcChamber::WireGang::length
float length
Definition: runTgcGeoComparison.cxx:68
makeTOC.inFile
string inFile
Definition: makeTOC.py:5
TgcChamber
Helper struct to represent a full Rpc chamber.
Definition: runTgcGeoComparison.cxx:35
TgcChamber::eta
int eta
Definition: runTgcGeoComparison.cxx:41
TgcChamber::techName
std::string techName
Definition: runTgcGeoComparison.cxx:44
TgcChamber::RadialStrip
Definition: runTgcGeoComparison.cxx:93
plotIsoValidation.treeReader
treeReader
Definition: plotIsoValidation.py:127
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
TgcChamber::LayerTrans::gasGap
unsigned int gasGap
Definition: runTgcGeoComparison.cxx:77
TgcChamber::RadialStrip::globCenter
Amg::Vector3D globCenter
Strip center.
Definition: runTgcGeoComparison.cxx:98
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:147
tolerance
constexpr double tolerance
Helper macro to compare the output from the readout geometry dumps: python -m MuonGeoModelTest....
Definition: runTgcGeoComparison.cxx:30
TEST_BASICPROP
#define TEST_BASICPROP(attribute, propName)
Definition: runTgcGeoComparison.cxx:342
keylayer_zslicemap.strip
strip
Definition: keylayer_zslicemap.py:151
Amg::getTransformFromRotTransl
Amg::Transform3D getTransformFromRotTransl(Amg::RotationMatrix3D rot, Amg::Vector3D transl_vec)
Definition: GeoPrimitivesHelpers.h:172
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Amg::doesNotDeform
bool doesNotDeform(const Amg::Transform3D &trans)
Checks whether the linear part of the transformation rotates or stetches any of the basis vectors.
Definition: GeoPrimitivesHelpers.h:383
TgcChamber::WireGang::number
unsigned int number
Definition: runTgcGeoComparison.cxx:65
TgcChamber::WireGang::position
Amg::Vector3D position
Definition: runTgcGeoComparison.cxx:66
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
create_dcsc_inputs_sqlite.arg
list arg
Definition: create_dcsc_inputs_sqlite.py:48
tolerance
Definition: suep_shower.h:17
readTreeDump
std::set< TgcChamber > readTreeDump(const std::string &inputFile)
Definition: runTgcGeoComparison.cxx:149
TgcChamber::WireGang::gasGap
unsigned int gasGap
Definition: runTgcGeoComparison.cxx:64
TgcChamber::WireGang::numWires
unsigned int numWires
Definition: runTgcGeoComparison.cxx:63
L1CaloPhase1Monitoring.propName
propName
Definition: L1CaloPhase1Monitoring.py:451
TEST_LAYPROP
#define TEST_LAYPROP(attribute, propName)
Definition: runTgcGeoComparison.cxx:350
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
TgcChamber::RadialStrip::locCenter
Amg::Vector2D locCenter
Definition: runTgcGeoComparison.cxx:99
ref
const boost::regex ref(r_ef)
TgcChamber::WireGang
Definition: runTgcGeoComparison.cxx:62
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
TgcChamber::LayerTrans::measPhi
bool measPhi
Definition: runTgcGeoComparison.cxx:78
TgcChamber::WireGang::localPos
Amg::Vector2D localPos
Definition: runTgcGeoComparison.cxx:67
CscCalibQuery.testFile
testFile
Definition: CscCalibQuery.py:274
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:159
TgcChamber::phi
unsigned phi
Definition: runTgcGeoComparison.cxx:42
TgcChamber::stIdx
unsigned stIdx
Identifier fields stationIndex / stationEta / stationPhi.
Definition: runTgcGeoComparison.cxx:40
TgcChamber::LayerTrans
Definition: runTgcGeoComparison.cxx:76