ATLAS Offline Software
Loading...
Searching...
No Matches
runRpcGeoComparison.cxx File Reference
#include <algorithm>
#include <GeoPrimitives/GeoPrimitives.h>
#include <GeoPrimitives/GeoPrimitivesHelpers.h>
#include <GeoPrimitives/GeoPrimitivesToStringConverter.h>
#include <GeoModelHelpers/TransformToStringConverter.h>
#include <MuonCablingData/RpcCablingData.h>
#include <MuonReadoutGeometryR4/MuonDetectorDefs.h>
#include <GaudiKernel/SystemOfUnits.h>
#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  RpcChamber
 Helper struct to represent a full Rpc chamber. More...
struct  RpcChamber::RpcStrip
struct  RpcChamber::RpcLayer
 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)
 Helper macro to compare the output from the readout geometry dumps: python -m MuonGeoModelTest.runGeoModelTest python -m MuonGeoModelTestR4.runGeoModelTest.
std::ostream & operator<< (std::ostream &ostr, const RpcChamber &chamb)
 Translation of the station Index -> station Name.
std::ostream & operator<< (std::ostream &ostr, const RpcChamber::RpcStrip &strip)
std::ostream & operator<< (std::ostream &ostr, const RpcChamber::RpcLayer &layer)
std::set< RpcChamberreadTreeDump (const std::string &inputFile)
int main1 (int argc, char **argv)
int main (int argc, char **argv)

Variables

constexpr double tolerance = 0.005*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<<"RpcGeoModelComparison() "<<__LINE__<<": The chamber "<<test \
<<" differs w.r.t "<<propName<<" "<< reference.attribute \
<<" (ref) vs. " <<test.attribute << " (test)" << std::endl; \
chamberOkay = false; \
}

Definition at line 306 of file runRpcGeoComparison.cxx.

306#define TEST_BASICPROP(attribute, propName) \
307 if (std::abs(1.*test.attribute - 1.*reference.attribute) > tolerance) { \
308 std::cerr<<"RpcGeoModelComparison() "<<__LINE__<<": The chamber "<<test \
309 <<" differs w.r.t "<<propName<<" "<< reference.attribute \
310 <<" (ref) vs. " <<test.attribute << " (test)" << std::endl; \
311 chamberOkay = false; \
312 }

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 489 of file runRpcGeoComparison.cxx.

490{
491 int ret = 1;
492 try {
493 ret = main1 (argc, argv);
494 }
495 catch (const std::exception& e) {
496 std::cerr << e.what() << "\n";
497 }
498 return ret;
499}
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

Definition at line 314 of file runRpcGeoComparison.cxx.

314 {
315 std::string refFile{}, testFile{};
316
317 for (int arg = 1; arg < argc; ++arg) {
318 std::string the_arg{argv[arg]};
319 if (the_arg == "--refFile" && arg +1 < argc) {
320 refFile = std::string{argv[arg+1]};
321 ++arg;
322 } else if (the_arg == "--testFile" && arg + 1 < argc) {
323 testFile = std::string{argv[arg+1]};
324 ++arg;
325 }
326 }
327 if (refFile.empty()) {
328 std::cerr<<"Please parse the path of the reference file via --refFile "<<std::endl;
329 return EXIT_FAILURE;
330 }
331 if (testFile.empty()) {
332 std::cerr<<"Please parse the path of the test file via --testFile "<<std::endl;
333 return EXIT_FAILURE;
334 }
336 if (!refFile.starts_with( "root://")) refFile = PathResolver::FindCalibFile(refFile);
337 if (!testFile.starts_with( "root://")) testFile = PathResolver::FindCalibFile(testFile);
339 std::set<RpcChamber> refChambers = readTreeDump(refFile);
340 if (refChambers.empty()) {
341 std::cerr<<"The file "<<refFile<<" should contain at least one chamber "<<std::endl;
342 return EXIT_FAILURE;
343 }
344 std::set<RpcChamber> testChambers = readTreeDump(testFile);
345 if (testChambers.empty()) {
346 std::cerr<<"The file "<<testFile<<" should contain at least one chamber "<<std::endl;
347 return EXIT_FAILURE;
348 }
349 std::cout<<"Read "<<refChambers.size()<<" chambers from reference: "<<refFile
350 <<" & "<<testChambers.size()<<" from "<<testFile<<std::endl;
351 int return_code = EXIT_SUCCESS;
352 unsigned int goodChambers{0};
354 for (const RpcChamber& reference : refChambers) {
355 std::set<RpcChamber>::const_iterator test_itr = testChambers.find(reference);
356
357 if (test_itr == testChambers.end()) {
358 std::cerr<<"runRpcGeoComparison() "<<__LINE__<<": The chamber "<<reference<<" is not part of the testing "<<std::endl;
359 return_code = EXIT_FAILURE;
360 continue;
361 }
362 bool chamberOkay = true;
363 const RpcChamber& test = {*test_itr};
364
365 TEST_BASICPROP(numLayers, "number of rpc singlets");
366 TEST_BASICPROP(numGasGapsPhi, "number of phi gas gaps");
367 TEST_BASICPROP(numPhiPanels, "number of phi readout panels");
368
369
370 TEST_BASICPROP(numStripsEta, "number of eta strips");
371 TEST_BASICPROP(numStripsPhi, "number of phi strips");
372
373 TEST_BASICPROP(stripPitchEta, "eta strip pitch");
374 TEST_BASICPROP(stripPitchPhi, "phi strip pitch");
375
376 TEST_BASICPROP(stripWidthEta, "eta strip width");
377 TEST_BASICPROP(stripWidthPhi, "phi strip width");
378
379 TEST_BASICPROP(stripLengthEta, "eta strip length");
380 TEST_BASICPROP(stripLengthPhi, "phi strip length");
381 if (!chamberOkay) continue;
382
383 Amg::Transform3D moduleDiff = reference.geoModelTransform.inverse() *
384 test.geoModelTransform;
385
386 if (false && !Amg::doesNotDeform(moduleDiff)){
387 std::cerr<<"runRpcGeoComparison() "<<__LINE__<<": "<<test<<" is displaced by "
388 <<Amg::toString(moduleDiff)<<std::endl;
389 continue;
390 }
391
392
393 using RpcLayer = RpcChamber::RpcLayer;
394 for (const RpcLayer& refLayer : reference.layers) {
395 break;
396 std::set<RpcLayer>::const_iterator lay_itr = test.layers.find(refLayer);
397 if (lay_itr == test.layers.end()) {
398 std::cerr<<"runRpcGeoComparison() "<<__LINE__<<": "<<test<<" "
399 <<refLayer<<" is not found. "<<std::endl;
400 chamberOkay = false;
401 continue;
402 }
403 // break;
404 const RpcLayer& testLayer{*lay_itr};
405 const Amg::Transform3D layAlignment = testLayer.transform.inverse() *
406 refLayer.transform;
407 if (layAlignment.translation().mag() > tolerance) {
408 std::cerr<<"runRpcGeoComparison() "<<__LINE__<<": "<<test<<" "
409 <<"the layer "<<testLayer<<" is misplaced w.r.t. reference by "
410 <<Amg::toString(testLayer.transform.translation())<<" vs. "
411 <<Amg::toString(refLayer.transform.translation()) <<" delta : "
412 <<Amg::toString(layAlignment.translation())
413 <<", perp: "<<layAlignment.translation().perp()
414 <<", mag: "<<layAlignment.translation().mag()<<std::endl;
415 chamberOkay = false;
416 }
417 if (!Amg::doesNotDeform(layAlignment) &&
418 !Amg::doesNotDeform(layAlignment * Amg::getRotateX3D(180*Gaudi::Units::deg)) &&
419 !Amg::doesNotDeform(layAlignment * Amg::getRotateZ3D(180*Gaudi::Units::deg))) {
420 std::cerr<<"runRpcGeoComparison() "<<__LINE__<<": "<<test<<" "
421 <<"the layer "<<testLayer<<" is misaligned w.r.t. reference by "
422 <<GeoTrf::toString(layAlignment, true)<<std::endl;
423 chamberOkay = false;
424 }
425 }
427 if (!chamberOkay) continue;
428 unsigned int failedEta{0}, failedPhi{0};
429 for (const RpcStrip& refStrip : reference.strips) {
430 std::set<RpcStrip>::const_iterator strip_itr = test.strips.find(refStrip);
431 if (strip_itr == test.strips.end()) {
432 std::cerr<<"runRpcGeoComparison() "<<__LINE__<<": "<<test<<" "
433 <<refStrip<<" is not found. "<<std::endl;
434 chamberOkay = false;
435 continue;
436 }
437 const RpcStrip& testStrip{*strip_itr};
438 const Amg::Vector3D diffStrip{testStrip.position - refStrip.position};
439 if (diffStrip.mag() > tolerance) {
440 constexpr unsigned int maxFail = 3;
441 if ( (!refStrip.measPhi && ( (++failedEta) <= maxFail || refStrip.strip <= 3)) ||
442 (refStrip.measPhi && ( (++failedPhi) <= maxFail || refStrip.strip <= 3)) ) {
443 std::cerr<<"runRpcGeoComparison() "<<__LINE__<<": "<<test<<" "
444 <<testStrip<<" should be located at "<<Amg::toString(refStrip.position, 2)
445 <<" displacement: "<<Amg::toString(diffStrip,2)<<", perp: "
446 <<diffStrip.perp()<<", mag: "<<diffStrip.mag()<<std::endl;
447 } else if (failedEta > maxFail && failedPhi > maxFail) {
448 break;
449 }
450 chamberOkay = false;
451 }
452 continue;
453 const Amg::Vector2D diffLocStrip{testStrip.locPos - refStrip.locPos};
454 if (diffStrip.mag() > tolerance) {
455 std::cerr<<"runRpcGeoComparison() "<<__LINE__<<": "<<test<<" "
456 <<testStrip<<" should be located at "<<Amg::toString(refStrip.locPos, 2)
457 <<" displacement: "<<Amg::toString(diffLocStrip,2)<<", mag: "<<diffLocStrip.mag()<<std::endl;
458 chamberOkay = false;
459 }
460 }
461 if (!chamberOkay) {
462 return_code = EXIT_FAILURE;
463 continue;
464 }
465
466 const Amg::Transform3D alignableDistort = test.alignableTransform.inverse()*(reference.alignableTransform );
467 if (!Amg::doesNotDeform(alignableDistort) || alignableDistort.translation().mag() > tolerance) {
468 std::cerr<<"runRpcGeoComparison() "<<__LINE__<<": The alignable nodes are at differnt places for "
469 <<test<<". " <<Amg::toString(alignableDistort, true)<<std::endl;
470 return_code = EXIT_FAILURE;
471 } else {
472 ++goodChambers;
473 }
474
475 }
476 for (const RpcChamber& test : testChambers){
477 if (refChambers.find(test) == refChambers.end()) {
478 std::cerr<<"runRpcGeoComparison() "<<__LINE__<<": The chamber "<<test<<" is not in the references."<<std::endl;
479 return_code = EXIT_FAILURE;
480 }
481 }
482 std::cout<<"runRpcGeoComparison() "<<__LINE__<<": "<<
483 goodChambers<<"/"<<refChambers.size()<<" chambers are in complete agreement. "<<std::endl;
484 return return_code;
485
486}
static std::string FindCalibFile(const std::string &logical_file_name)
Amg::Transform3D getRotateX3D(double angle)
get a rotation transformation around X-axis
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
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, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
RpcStrip_v1 RpcStrip
Definition RpcStripFwd.h:11
#define TEST_BASICPROP(attribute, propName)
std::set< RpcChamber > readTreeDump(const std::string &inputFile)
Helper struct to assess that the layers are properly oriented.
Helper struct to represent a full Rpc chamber.

◆ makeDir()

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

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

Definition at line 28 of file runRpcGeoComparison.cxx.

28 {
29 using namespace Acts::UnitLiterals;
30 return Acts::makeDirectionFromPhiTheta(phi *1._degree, theta* 1._degree);
31}
Scalar phi() const
phi method
Scalar theta() const
theta method

◆ operator<<() [1/3]

std::ostream & operator<< ( std::ostream & ostr,
const RpcChamber & 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 121 of file runRpcGeoComparison.cxx.

121 {
122 static const std::map<int, std::string> stationDict{
123 {0, "BIL"}, {1, "BIS"}, {7, "BIR"},
124 {2, "BML"}, {3, "BMS"}, {8, "BMF"}, {53, "BME"}, {54, "BMG"}, {52, "BIM"},
125 {4, "BOL"}, {5, "BOS"}, {9, "BOF"}, {10, "BOG"},
126 {6, "BEE"}, {14, "EEL"}, {15, "EES"},
127 {13, "EIL"},
128 {17, "EML"}, {18, "EMS"},
129 {20, "EOL"}, {21, "EOS"}
130 };
131 ostr<<"Rpc chamber "<<stationDict.at(chamb.id.stationIndex) <<"("<<chamb.design<<") "<<chamb.id;
132 return ostr;
133}
chamberIdentifier id

◆ operator<<() [2/3]

std::ostream & operator<< ( std::ostream & ostr,
const RpcChamber::RpcLayer & layer )

Definition at line 142 of file runRpcGeoComparison.cxx.

142 {
143 ostr<<"rpclayer (gasGap/phiPanel/isPhiLayer): ";
144 ostr<<layer.gasGap<<"/"<<layer.doubletPhi<<"/";
145 ostr<<(layer.measPhi ? "si" : "no")<<", ";
146 // ostr<<"transform: "<<Amg::toString(layer.transform);
147 return ostr;
148}
@ layer
Definition HitInfo.h:79

◆ operator<<() [3/3]

std::ostream & operator<< ( std::ostream & ostr,
const RpcChamber::RpcStrip & strip )

Definition at line 135 of file runRpcGeoComparison.cxx.

135 {
136 ostr<<"strip (gasGap/phiPanel/isPhiStrip/number): ";
137 ostr<<strip.gasGap<<"/"<<strip.doubletPhi<<"/";
138 ostr<<(strip.measPhi ? "si" : "no")<<"/"<<strip.strip<<", ";
139 // ostr<<"position: "<<Amg::toString(strip.position, 2);
140 return ostr;
141}

◆ readTreeDump()

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

Number of strips, strip pitch in eta & phi direction

Number of eta & phi gas gaps

Strip dimensions

Geo Model transformation

Definition at line 150 of file runRpcGeoComparison.cxx.

150 {
151 std::set<RpcChamber> to_ret{};
152 std::cout<<"Read the Rpc geometry tree dump from "<<inputFile<<std::endl;
153 std::unique_ptr<TFile> inFile{TFile::Open(inputFile.c_str())};
154 if (!inFile || !inFile->IsOpen()) {
155 std::cerr<<__FILE__<<":"<<__LINE__<<" Failed to open "<<inputFile<<std::endl;
156 return to_ret;
157 }
158 TTreeReader treeReader("RpcGeoModelTree", inFile.get());
159 if (treeReader.IsInvalid()){
160 std::cerr<<__FILE__<<":"<<__LINE__<<" The file "<<inputFile<<" does not contain the 'RpcGeoModelTree'"<<std::endl;
161 return to_ret;
162 }
163
164 TTreeReaderValue<unsigned short> stationIndex{treeReader, "stationIndex"};
165 TTreeReaderValue<short> stationEta{treeReader, "stationEta"};
166 TTreeReaderValue<short> stationPhi{treeReader, "stationPhi"};
167 TTreeReaderValue<uint8_t> stationDoubletR{treeReader, "stationDoubletR"};
168 TTreeReaderValue<uint8_t> stationDoubletZ{treeReader,"stationDoubletZ"};
169 TTreeReaderValue<uint8_t> stationDoubletPhi{treeReader,"stationDoubletPhi"};
170 TTreeReaderValue<std::string> chamberDesign{treeReader,"chamberDesign"};
171
172
174 TTreeReaderValue<uint8_t> numStripsEta{treeReader, "numEtaStrips"};
175 TTreeReaderValue<uint8_t> numStripsPhi{treeReader, "numPhiStrips"};
177 // TTreeReaderValue<uint8_t> numGasGapsPhi{treeReader, "numPhiGasGaps"};
178 TTreeReaderValue<uint8_t> numPhiPanels{treeReader, "numPhiPanels"};
179 TTreeReaderValue<uint8_t> numLayers{treeReader, "numRpcLayers"};
180
182 TTreeReaderValue<float> stripEtaPitch{treeReader, "stripEtaPitch"};
183 TTreeReaderValue<float> stripPhiPitch{treeReader, "stripPhiPitch"};
184 TTreeReaderValue<float> stripEtaWidth{treeReader, "stripEtaWidth"};
185 TTreeReaderValue<float> stripPhiWidth{treeReader, "stripPhiWidth"};
186 TTreeReaderValue<float> stripEtaLength{treeReader, "stripEtaLength"};
187 TTreeReaderValue<float> stripPhiLength{treeReader, "stripPhiLength"};
188
190 TTreeReaderValue<std::vector<float>> geoModelTransformX{treeReader, "GeoModelTransformX"};
191 TTreeReaderValue<std::vector<float>> geoModelTransformY{treeReader, "GeoModelTransformY"};
192 TTreeReaderValue<std::vector<float>> geoModelTransformZ{treeReader, "GeoModelTransformZ"};
193
194 TTreeReaderValue<std::vector<float>> alignableNodeX{treeReader, "AlignableNodeX"};
195 TTreeReaderValue<std::vector<float>> alignableNodeY{treeReader, "AlignableNodeY"};
196 TTreeReaderValue<std::vector<float>> alignableNodeZ{treeReader, "AlignableNodeZ"};
197
198
199
200 TTreeReaderValue<std::vector<float>> stripRotTranslationX{treeReader, "stripRotTranslationX"};
201 TTreeReaderValue<std::vector<float>> stripRotTranslationY{treeReader, "stripRotTranslationY"};
202 TTreeReaderValue<std::vector<float>> stripRotTranslationZ{treeReader, "stripRotTranslationZ"};
203
204 TTreeReaderValue<std::vector<float>> stripRotCol0Theta{treeReader, "stripRotLinearCol0Theta"};
205 TTreeReaderValue<std::vector<float>> stripRotCol0Phi{treeReader, "stripRotLinearCol0Phi"};
206
207 TTreeReaderValue<std::vector<float>> stripRotCol1Theta{treeReader, "stripRotLinearCol1Theta"};
208 TTreeReaderValue<std::vector<float>> stripRotCol1Phi{treeReader, "stripRotLinearCol1Phi"};
209
210 TTreeReaderValue<std::vector<float>> stripRotCol2Theta{treeReader, "stripRotLinearCol2Theta"};
211 TTreeReaderValue<std::vector<float>> stripRotCol2Phi{treeReader, "stripRotLinearCol2Phi"};
212
213 TTreeReaderValue<std::vector<uint8_t>> stripRotGasGap{treeReader, "stripRotGasGap"};
214 TTreeReaderValue<std::vector<uint8_t>> stripRotDblPhi{treeReader, "stripRotDoubletPhi"};
215 TTreeReaderValue<std::vector<bool>> stripRotMeasPhi{treeReader, "stripRotMeasPhi"};
216
217 TTreeReaderValue<std::vector<float>> stripPosX{treeReader, "stripPosX"};
218 TTreeReaderValue<std::vector<float>> stripPosY{treeReader, "stripPosY"};
219 TTreeReaderValue<std::vector<float>> stripPosZ{treeReader, "stripPosZ"};
220
221 TTreeReaderValue<std::vector<float>> stripLocPosX{treeReader, "stripLocPosX"};
222 TTreeReaderValue<std::vector<float>> stripLocPosY{treeReader, "stripLocPosY"};
223
224
225 TTreeReaderValue<std::vector<bool>> stripPosMeasPhi{treeReader, "stripPosMeasPhi"};
226 TTreeReaderValue<std::vector<uint8_t>> stripPosGasGap{treeReader, "stripPosGasGap"};
227 TTreeReaderValue<std::vector<uint8_t>> stripPosNum{treeReader, "stripPosNum"};
228 TTreeReaderValue<std::vector<uint8_t>> stripDblPhi{treeReader, "stripPosDoubletPhi"};
229
230 while (treeReader.Next()) {
231 RpcChamber newchamber{};
232
233 newchamber.id.stationIndex = (*stationIndex);
234 newchamber.design = (*chamberDesign);
235 newchamber.id.eta = (*stationEta);
236 newchamber.id.phi = (*stationPhi);
237 newchamber.id.doubletPhi = (*stationDoubletPhi);
238 newchamber.id.doubletR = (*stationDoubletR);
239 newchamber.id.doubletZ = (*stationDoubletZ);
240
241 newchamber.stripPitchEta = (*stripEtaPitch);
242 newchamber.stripPitchPhi = (*stripPhiPitch);
243 newchamber.stripWidthEta = (*stripEtaWidth);
244 newchamber.stripWidthPhi = (*stripPhiWidth);
245 newchamber.stripLengthEta = (*stripEtaLength);
246 newchamber.stripLengthPhi = (*stripPhiLength);
247
248 newchamber.numStripsEta = (*numStripsEta);
249 newchamber.numStripsPhi = (*numStripsPhi);
250 // newchamber.numGasGapsPhi = (*numGasGapsPhi);
251 newchamber.numPhiPanels = (*numPhiPanels);
252 newchamber.numLayers = (*numLayers);
253
254
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 //strips
269 for (size_t s = 0; s < stripPosX->size(); ++s){
270 RpcChamber::RpcStrip newStrip{};
271 newStrip.position = Amg::Vector3D{(*stripPosX)[s], (*stripPosY)[s], (*stripPosZ)[s]};
272 newStrip.locPos = Amg::Vector2D{(*stripLocPosX)[s], (*stripLocPosY)[s]};
273
274 newStrip.gasGap = (*stripPosGasGap)[s];
275 newStrip.doubletPhi = (*stripDblPhi)[s];
276 newStrip.measPhi = (*stripPosMeasPhi)[s];
277 newStrip.strip = (*stripPosNum)[s];
278 newchamber.strips.insert(std::move(newStrip));
279 }
280 for (size_t l = 0; l < stripRotMeasPhi->size(); ++l){
281 RpcChamber::RpcLayer newLayer{};
282 newLayer.measPhi = (*stripRotMeasPhi)[l];
283 newLayer.gasGap = (*stripRotGasGap)[l];
284 newLayer.doubletPhi = (*stripRotDblPhi)[l];
285 Amg::RotationMatrix3D stripRot{Amg::RotationMatrix3D::Identity()};
286 Amg::Vector3D translation{(*stripRotTranslationX)[l],(*stripRotTranslationY)[l],(*stripRotTranslationZ)[l]};
287 stripRot.col(0) = makeDir((*stripRotCol0Theta)[l], (*stripRotCol0Phi)[l]);
288 stripRot.col(1) = makeDir((*stripRotCol1Theta)[l], (*stripRotCol1Phi)[l]);
289 stripRot.col(2) = makeDir((*stripRotCol2Theta)[l], (*stripRotCol2Phi)[l]);
290 newLayer.transform = Amg::getTransformFromRotTransl(std::move(stripRot), std::move(translation));
291 newchamber.layers.insert(std::move(newLayer));
292 }
293
294 auto insert_itr = to_ret.insert(std::move(newchamber));
295 if (!insert_itr.second) {
296 std::stringstream err{};
297 err<<__FILE__<<":"<<__LINE__<<" The chamber "<<(*insert_itr.first).id
298 <<" has already been inserted. "<<std::endl;
299 throw std::runtime_error(err.str());
300 }
301 }
302 std::cout<<"File parsing is finished. Found in total "<<to_ret.size()<<" readout element dumps "<<std::endl;
303 return to_ret;
304}
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Amg::Transform3D getTransformFromRotTransl(Amg::RotationMatrix3D rot, Amg::Vector3D transl_vec)
constexpr unsigned int numLayers()
Definition HIEventDefs.h:23
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)
Helper macro to compare the output from the readout geometry dumps: python -m MuonGeoModelTest....
int8_t & phi
Eta index of the RPC station.
int8_t & eta
Station of the chamber (i.e, BIL,BIS,etc.).
int8_t & doubletZ
doublet Phi -> 1,2
int8_t & doubletPhi
doublet R -> 1,2
int8_t & doubletR
Station phi of the RPC station.
unsigned int gasGap
Gas gap of the strip.
Amg::Transform3D transform
@ transformation
bool measPhi
flag whether the strip measures phi
unsigned int doubletPhi
Phi panel of the strip.
unsigned int strip
Strip number.
unsigned int gasGap
Gas gap of the strip.
bool measPhi
flag whether the strip measures phi
Amg::Vector3D position
global position of the strip
Amg::Vector2D locPos
local position w.r.t tracking plane
unsigned int doubletPhi
Phi panel of the strip.
unsigned int numStripsEta
std::set< RpcStrip > strips
unsigned int numPhiPanels
Number of rpc readout panels along the phi direction.
std::set< RpcLayer > layers
unsigned int numLayers
Number of rpc singlets along the radial direction.
Amg::Transform3D alignableTransform
Transformation of the underlying Alignable node.
unsigned int numStripsPhi
Amg::Transform3D geoModelTransform
Transformation of the underlying GeoModel element.

Variable Documentation

◆ tolerance

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

Definition at line 36 of file runRpcGeoComparison.cxx.