250 std::set<sTgcChamber> to_ret{};
251 std::cout<<
"Read the sTgc geometry tree dump from "<<inputFile<<std::endl;
252 std::unique_ptr<TFile> inFile{TFile::Open(inputFile.c_str())};
253 if (!inFile || !inFile->IsOpen()) {
254 std::cerr<<__FILE__<<
":"<<__LINE__<<
" Failed to open "<<inputFile<<std::endl;
257 TTreeReader treeReader(
"sTgcGeoModelTree", inFile.get());
258 if (treeReader.IsInvalid()){
259 std::cerr<<__FILE__<<
":"<<__LINE__<<
" The file "<<inputFile<<
" does not contain the 'sTgcGeoModelTree'"<<std::endl;
264 TTreeReaderValue<short> stationIndex{treeReader,
"stationIndex"};
265 TTreeReaderValue<short> stationEta{treeReader,
"stationEta"};
266 TTreeReaderValue<short> stationPhi{treeReader,
"stationPhi"};
267 TTreeReaderValue<short> stationMultilayer{treeReader,
"stationMultilayer"};
268 TTreeReaderValue<std::string> chamberDesign{treeReader,
"chamberDesign"};
271 TTreeReaderValue<short> numLayers{treeReader,
"numLayers"};
272 TTreeReaderValue<float> yCutout{treeReader,
"yCutout"};
273 TTreeReaderValue<float> gasTck{treeReader,
"gasTck"};
275 TTreeReaderValue<float> sChamberLength{treeReader,
"sChamberLength"};
276 TTreeReaderValue<float> lChamberLength{treeReader,
"lChamberLength"};
277 TTreeReaderValue<float> chamberHeight{treeReader,
"chamberHeight"};
279 TTreeReaderValue<float> sGapLength{treeReader,
"sGapLength"};
280 TTreeReaderValue<float> lGapLength{treeReader,
"lGapLength"};
281 TTreeReaderValue<float> gapHeight{treeReader,
"gapHeight"};
284 TTreeReaderValue<std::vector<uint>> numWires{treeReader,
"numWires"};
285 TTreeReaderValue<std::vector<uint>> firstWireGroupWidth{treeReader,
"firstWireGroupWidth"};
286 TTreeReaderValue<std::vector<uint>> numWireGroups{treeReader,
"numWireGroups"};
287 TTreeReaderValue<std::vector<float>> wireCutout{treeReader,
"wireCutout"};
288 TTreeReaderValue<float> wirePitch{treeReader,
"wirePitch"};
289 TTreeReaderValue<float> wireWidth{treeReader,
"wireWidth"};
290 TTreeReaderValue<uint> wireGroupWidth{treeReader,
"wireGroupWidth"};
292 TTreeReaderValue<std::vector<float>> globalWireGroupPosX{treeReader,
"globalWireGroupPosX"};
293 TTreeReaderValue<std::vector<float>> globalWireGroupPosY{treeReader,
"globalWireGroupPosY"};
294 TTreeReaderValue<std::vector<float>> globalWireGroupPosZ{treeReader,
"globalWireGroupPosZ"};
296 TTreeReaderValue<std::vector<float>> localWireGroupPosX{treeReader,
"localWireGroupPosX"};
297 TTreeReaderValue<std::vector<float>> localWireGroupPosY{treeReader,
"localWireGroupPosY"};
299 TTreeReaderValue<std::vector<uint8_t>> wireGroupNum{treeReader,
"wireGroupNum"};
300 TTreeReaderValue<std::vector<uint8_t>> wireGroupGasGap{treeReader,
"wireGroupGasGap"};
303 TTreeReaderValue<uint> numStrips{treeReader,
"numStrips"};
304 TTreeReaderValue<float> stripPitch{treeReader,
"stripPitch"};
305 TTreeReaderValue<float> stripWidth{treeReader,
"stripWidth"};
307 TTreeReaderValue<std::vector<float>> globalStripPosX{treeReader,
"globalStripPosX"};
308 TTreeReaderValue<std::vector<float>> globalStripPosY{treeReader,
"globalStripPosY"};
309 TTreeReaderValue<std::vector<float>> globalStripPosZ{treeReader,
"globalStripPosZ"};
311 TTreeReaderValue<std::vector<float>> localStripPosX{treeReader,
"localStripPosX"};
312 TTreeReaderValue<std::vector<float>> localStripPosY{treeReader,
"localStripPosY"};
314 TTreeReaderValue<std::vector<uint>> stripNum{treeReader,
"stripNumber"};
315 TTreeReaderValue<std::vector<uint8_t>> stripGasGap{treeReader,
"stripGasGap"};
316 TTreeReaderValue<std::vector<float>> stripLengths{treeReader,
"stripLengths"};
319 TTreeReaderValue<float> sPadLength{treeReader,
"sPadLength"};
320 TTreeReaderValue<float> lPadLength{treeReader,
"lPadLength"};
321 TTreeReaderValue<float> anglePadPhi{treeReader,
"anglePadPhi"};
322 TTreeReaderValue<float> beamlineRadius{treeReader,
"beamlineRadius"};
323 TTreeReaderValue<std::vector<uint>> numPads{treeReader,
"numPads"};
324 TTreeReaderValue<std::vector<uint>> numPadEta{treeReader,
"numPadEta"};
325 TTreeReaderValue<std::vector<uint>> numPadPhi{treeReader,
"numPadPhi"};
326 TTreeReaderValue<std::vector<float>> firstPadHeight{treeReader,
"firstPadHeight"};
327 TTreeReaderValue<std::vector<float>> padHeight{treeReader,
"padHeight"};
328 TTreeReaderValue<std::vector<float>> padPhiShift{treeReader,
"padPhiShift"};
329 TTreeReaderValue<std::vector<float>> firstPadPhiDiv{treeReader,
"firstPadPhiDiv"};
331 TTreeReaderValue<std::vector<float>> globalPadCornerBRX{treeReader,
"globalPadCornerBRX"};
332 TTreeReaderValue<std::vector<float>> globalPadCornerBRY{treeReader,
"globalPadCornerBRY"};
333 TTreeReaderValue<std::vector<float>> globalPadCornerBRZ{treeReader,
"globalPadCornerBRZ"};
335 TTreeReaderValue<std::vector<float>> globalPadCornerBLX{treeReader,
"globalPadCornerBLX"};
336 TTreeReaderValue<std::vector<float>> globalPadCornerBLY{treeReader,
"globalPadCornerBLY"};
337 TTreeReaderValue<std::vector<float>> globalPadCornerBLZ{treeReader,
"globalPadCornerBLZ"};
339 TTreeReaderValue<std::vector<float>> globalPadCornerTRX{treeReader,
"globalPadCornerTRX"};
340 TTreeReaderValue<std::vector<float>> globalPadCornerTRY{treeReader,
"globalPadCornerTRY"};
341 TTreeReaderValue<std::vector<float>> globalPadCornerTRZ{treeReader,
"globalPadCornerTRZ"};
343 TTreeReaderValue<std::vector<float>> globalPadCornerTLX{treeReader,
"globalPadCornerTLX"};
344 TTreeReaderValue<std::vector<float>> globalPadCornerTLY{treeReader,
"globalPadCornerTLY"};
345 TTreeReaderValue<std::vector<float>> globalPadCornerTLZ{treeReader,
"globalPadCornerTLZ"};
347 TTreeReaderValue<std::vector<float>> globalPadPosX{treeReader,
"globalPadPosX"};
348 TTreeReaderValue<std::vector<float>> globalPadPosY{treeReader,
"globalPadPosY"};
349 TTreeReaderValue<std::vector<float>> globalPadPosZ{treeReader,
"globalPadPosZ"};
351 TTreeReaderValue<std::vector<float>> localPadCornerBRX{treeReader,
"localPadCornerBRX"};
352 TTreeReaderValue<std::vector<float>> localPadCornerBRY{treeReader,
"localPadCornerBRY"};
354 TTreeReaderValue<std::vector<float>> localPadCornerBLX{treeReader,
"localPadCornerBLX"};
355 TTreeReaderValue<std::vector<float>> localPadCornerBLY{treeReader,
"localPadCornerBLY"};
357 TTreeReaderValue<std::vector<float>> localPadCornerTRX{treeReader,
"localPadCornerTRX"};
358 TTreeReaderValue<std::vector<float>> localPadCornerTRY{treeReader,
"localPadCornerTRY"};
360 TTreeReaderValue<std::vector<float>> localPadCornerTLX{treeReader,
"localPadCornerTLX"};
361 TTreeReaderValue<std::vector<float>> localPadCornerTLY{treeReader,
"localPadCornerTLY"};
363 TTreeReaderValue<std::vector<float>> localPadPosX{treeReader,
"localPadPosX"};
364 TTreeReaderValue<std::vector<float>> localPadPosY{treeReader,
"localPadPosY"};
366 TTreeReaderValue<std::vector<float>> hitPositionX{treeReader,
"hitPositionX"};
367 TTreeReaderValue<std::vector<float>> hitPositionY{treeReader,
"hitPositionY"};
368 TTreeReaderValue<std::vector<int>> padNumber{treeReader,
"padNumber"};
370 TTreeReaderValue<std::vector<uint8_t>> padGasGap{treeReader,
"padGasGap"};
371 TTreeReaderValue<std::vector<uint>> padEta{treeReader,
"padEtaNumber"};
372 TTreeReaderValue<std::vector<uint>> padPhi{treeReader,
"padPhiNumber"};
375 TTreeReaderValue<std::vector<float>> geoModelTransformX{treeReader,
"GeoModelTransformX"};
376 TTreeReaderValue<std::vector<float>> geoModelTransformY{treeReader,
"GeoModelTransformY"};
377 TTreeReaderValue<std::vector<float>> geoModelTransformZ{treeReader,
"GeoModelTransformZ"};
379 TTreeReaderValue<std::vector<float>> alignableNodeX{treeReader,
"AlignableNodeX"};
380 TTreeReaderValue<std::vector<float>> alignableNodeY{treeReader,
"AlignableNodeY"};
381 TTreeReaderValue<std::vector<float>> alignableNodeZ{treeReader,
"AlignableNodeZ"};
383 TTreeReaderValue<std::vector<float>> stripRotCol0Theta{treeReader,
"stripRotLinearCol0Theta"};
384 TTreeReaderValue<std::vector<float>> stripRotCol0Phi{treeReader,
"stripRotLinearCol0Phi"};
386 TTreeReaderValue<std::vector<float>> stripRotCol1Theta{treeReader,
"stripRotLinearCol1Theta"};
387 TTreeReaderValue<std::vector<float>> stripRotCol1Phi{treeReader,
"stripRotLinearCol1Phi"};
389 TTreeReaderValue<std::vector<float>> stripRotCol2Theta{treeReader,
"stripRotLinearCol2Theta"};
390 TTreeReaderValue<std::vector<float>> stripRotCol2Phi{treeReader,
"stripRotLinearCol2Phi"};
392 TTreeReaderValue<std::vector<float>> stripRotTransX{treeReader,
"stripRotTranslationX"};
393 TTreeReaderValue<std::vector<float>> stripRotTransY{treeReader,
"stripRotTranslationY"};
394 TTreeReaderValue<std::vector<float>> stripRotTransZ{treeReader,
"stripRotTranslationZ"};
396 TTreeReaderValue<std::vector<uint8_t>> stripRotGasGap{treeReader,
"stripRotGasGap"};
399 TTreeReaderValue<std::vector<float>> wireGroupRotCol1X{treeReader,
"wireGroupRotLinearCol1X"};
400 TTreeReaderValue<std::vector<float>> wireGroupRotCol1Y{treeReader,
"wireGroupRotLinearCol1Y"};
401 TTreeReaderValue<std::vector<float>> wireGroupRotCol1Z{treeReader,
"wireGroupRotLinearCol1Z"};
403 TTreeReaderValue<std::vector<float>> wireGroupRotCol2X{treeReader,
"wireGroupRotLinearCol2X"};
404 TTreeReaderValue<std::vector<float>> wireGroupRotCol2Y{treeReader,
"wireGroupRotLinearCol2Y"};
405 TTreeReaderValue<std::vector<float>> wireGroupRotCol2Z{treeReader,
"wireGroupRotLinearCol2Z"};
407 TTreeReaderValue<std::vector<float>> wireGroupRotCol3X{treeReader,
"wireGroupRotLinearCol3X"};
408 TTreeReaderValue<std::vector<float>> wireGroupRotCol3Y{treeReader,
"wireGroupRotLinearCol3Y"};
409 TTreeReaderValue<std::vector<float>> wireGroupRotCol3Z{treeReader,
"wireGroupRotLinearCol3Z"};
411 TTreeReaderValue<std::vector<float>> wireGroupRotTransX{treeReader,
"wireGroupRotTranslationX"};
412 TTreeReaderValue<std::vector<float>> wireGroupRotTransY{treeReader,
"wireGroupRotTranslationY"};
413 TTreeReaderValue<std::vector<float>> wireGroupRotTransZ{treeReader,
"wireGroupRotTranslationZ"};
415 TTreeReaderValue<std::vector<uint8_t>> wireGroupRotGasGap{treeReader,
"wireGroupRotGasGap"};
418 TTreeReaderValue<std::vector<float>> padRotCol1X{treeReader,
"padRotLinearCol1X"};
419 TTreeReaderValue<std::vector<float>> padRotCol1Y{treeReader,
"padRotLinearCol1Y"};
420 TTreeReaderValue<std::vector<float>> padRotCol1Z{treeReader,
"padRotLinearCol1Z"};
422 TTreeReaderValue<std::vector<float>> padRotCol2X{treeReader,
"padRotLinearCol2X"};
423 TTreeReaderValue<std::vector<float>> padRotCol2Y{treeReader,
"padRotLinearCol2Y"};
424 TTreeReaderValue<std::vector<float>> padRotCol2Z{treeReader,
"padRotLinearCol2Z"};
426 TTreeReaderValue<std::vector<float>> padRotCol3X{treeReader,
"padRotLinearCol3X"};
427 TTreeReaderValue<std::vector<float>> padRotCol3Y{treeReader,
"padRotLinearCol3Y"};
428 TTreeReaderValue<std::vector<float>> padRotCol3Z{treeReader,
"padRotLinearCol3Z"};
430 TTreeReaderValue<std::vector<float>> padRotTransX{treeReader,
"padRotTranslationX"};
431 TTreeReaderValue<std::vector<float>> padRotTransY{treeReader,
"padRotTranslationY"};
432 TTreeReaderValue<std::vector<float>> padRotTransZ{treeReader,
"padRotTranslationZ"};
434 TTreeReaderValue<std::vector<uint8_t>> padRotGasGap{treeReader,
"padRotGasGap"};
436 while (treeReader.Next()) {
444 newchamber.
design = (*chamberDesign);
448 newchamber.
yCutout = (*yCutout);
449 newchamber.
gasTck = (*gasTck);
479 newchamber.
numPads = (*numPads);
487 Amg::Vector3D geoTrans{(*geoModelTransformX)[0], (*geoModelTransformY)[0], (*geoModelTransformZ)[0]};
489 geoRot.col(0) =
Amg::Vector3D((*geoModelTransformX)[1], (*geoModelTransformY)[1], (*geoModelTransformZ)[1]);
490 geoRot.col(1) =
Amg::Vector3D((*geoModelTransformX)[2], (*geoModelTransformY)[2], (*geoModelTransformZ)[2]);
491 geoRot.col(2) =
Amg::Vector3D((*geoModelTransformX)[3], (*geoModelTransformY)[3], (*geoModelTransformZ)[3]);
494 geoRot.col(0) =
Amg::Vector3D((*alignableNodeX)[1], (*alignableNodeY)[1], (*alignableNodeZ)[1]);
495 geoRot.col(1) =
Amg::Vector3D((*alignableNodeX)[2], (*alignableNodeY)[2], (*alignableNodeZ)[2]);
496 geoRot.col(2) =
Amg::Vector3D((*alignableNodeX)[3], (*alignableNodeY)[3], (*alignableNodeZ)[3]);
497 geoTrans =
Amg::Vector3D{(*alignableNodeX)[0], (*alignableNodeY)[0], (*alignableNodeZ)[0]};
500 for (
size_t wg = 0; wg < globalWireGroupPosX->size(); ++wg){
504 newWireGroup.
gasGap = (*wireGroupGasGap)[wg];
509 newchamber.
channels.insert(std::move(newWireGroup));
513 for (
size_t s = 0; s < globalStripPosX->size(); ++s){
517 newStrip.
gasGap = (*stripGasGap)[s];
523 newchamber.
channels.insert(std::move(newStrip));
528 for (
size_t p = 0; p < globalPadPosX->size(); ++p){
545 newPad.
gasGap = (*padGasGap)[p];
546 newPad.
padEta = (*padEta)[p];
547 newPad.
padPhi = (*padPhi)[p];
550 newchamber.
pads.insert(std::move(newPad));
553 for (
size_t l = 0; l < stripRotGasGap->size(); ++l){
556 stripLayer.
gasGap = (*stripRotGasGap)[l];
558 stripRot.col(0) =
makeDir((*stripRotCol0Theta)[l], (*stripRotCol0Phi)[l]);
559 stripRot.col(1) =
makeDir((*stripRotCol1Theta)[l], (*stripRotCol1Phi)[l]);
560 stripRot.col(2) =
makeDir((*stripRotCol2Theta)[l], (*stripRotCol2Phi)[l]);
561 Amg::Vector3D layTrans{(*stripRotTransX)[l], (*stripRotTransY)[l], (*stripRotTransZ)[l]};
563 newchamber.
layers.insert(std::move(stripLayer));
566 for (
size_t l = 0; l < wireGroupRotGasGap->size(); ++l){
569 wireGroupLayer.
gasGap = (*wireGroupRotGasGap)[l];
571 wireGroupRot.col(0) =
Amg::Vector3D((*wireGroupRotCol1X)[l],(*wireGroupRotCol1Y)[l], (*wireGroupRotCol1Z)[l]);
572 wireGroupRot.col(1) =
Amg::Vector3D((*wireGroupRotCol2X)[l],(*wireGroupRotCol2Y)[l], (*wireGroupRotCol2Z)[l]);
573 wireGroupRot.col(2) =
Amg::Vector3D((*wireGroupRotCol3X)[l],(*wireGroupRotCol3Y)[l], (*wireGroupRotCol3Z)[l]);
574 Amg::Vector3D layTrans{(*wireGroupRotTransX)[l], (*wireGroupRotTransY)[l], (*wireGroupRotTransZ)[l]};
576 newchamber.
layers.insert(std::move(wireGroupLayer));
579 for (
size_t l = 0; l < padRotGasGap->size(); ++l){
582 padLayer.
gasGap = (*padRotGasGap)[l];
584 padRot.col(0) =
Amg::Vector3D((*padRotCol1X)[l],(*padRotCol1Y)[l], (*padRotCol1Z)[l]);
585 padRot.col(1) =
Amg::Vector3D((*padRotCol2X)[l],(*padRotCol2Y)[l], (*padRotCol2Z)[l]);
586 padRot.col(2) =
Amg::Vector3D((*padRotCol3X)[l],(*padRotCol3Y)[l], (*padRotCol3Z)[l]);
587 Amg::Vector3D layTrans{(*padRotTransX)[l], (*padRotTransY)[l], (*padRotTransZ)[l]};
589 newchamber.
layers.insert(std::move(padLayer));
592 auto insert_itr = to_ret.insert(std::move(newchamber));
593 if (!insert_itr.second) {
594 std::stringstream err{};
595 err<<__FILE__<<
":"<<__LINE__<<
" The chamber "<<(*insert_itr.first).stationIndex
596 <<
" has already been inserted. "<<std::endl;
597 throw std::runtime_error(err.str());
600 std::cout<<
"File parsing is finished. Found in total "<<to_ret.size()<<
" readout element dumps "<<std::endl;
613 std::string refFile{}, testFile{};
615 for (
int arg = 1; arg < argc; ++arg) {
616 std::string the_arg{argv[arg]};
617 if (the_arg ==
"--refFile" && arg +1 < argc) {
618 refFile = std::string{argv[arg+1]};
620 }
else if (the_arg ==
"--testFile" && arg + 1 < argc) {
621 testFile = std::string{argv[arg+1]};
625 if (refFile.empty()) {
626 std::cerr<<
"Please parse the path of the reference file via --refFile "<<std::endl;
629 if (testFile.empty()) {
630 std::cerr<<
"Please parse the path of the test file via --testFile "<<std::endl;
637 std::set<sTgcChamber> refChambers =
readTreeDump(refFile);
638 if (refChambers.empty()) {
639 std::cerr<<
"The file "<<refFile<<
" should contain at least one chamber "<<std::endl;
642 std::set<sTgcChamber> testChambers =
readTreeDump(testFile);
643 if (testChambers.empty()) {
644 std::cerr<<
"The file "<<testFile<<
" should contain at least one chamber "<<std::endl;
647 int return_code = EXIT_SUCCESS;
650 std::set<sTgcChamber>::const_iterator test_itr = testChambers.find(
reference);
652 if (test_itr == testChambers.end()) {
653 std::cerr<<
"The chamber "<<
reference<<
" is not part of the testing "<<std::endl;
654 return_code = EXIT_FAILURE;
657 bool chamberOkay =
true;
662 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": The alignable nodes are at differnt places for "
663 <<test<<
". " <<
Amg::toString(alignableDistort,
true)<<std::endl;
672 TEST_BASICPROP(sChamberLength,
"Chamber length on the short side");
673 TEST_BASICPROP(lChamberLength,
"Chamber length on the long side");
681 TEST_BASICPROP(wireGroupWidth,
"number of wires in a normal wiregroup");
686 TEST_BASICPROP(sPadLength,
"gasGap length on the short side for pads and wires");
687 TEST_BASICPROP(lPadLength,
"gasGap length on the long side for pads and wires");
688 TEST_BASICPROP(anglePadPhi,
"angular width of a pad in phi direction");
689 TEST_BASICPROP(beamlineRadius,
"distance from the gapCenter to beamline");
693 for (
const sTgcLayer& refLayer :
reference.layers) {
694 std::set<sTgcLayer>::const_iterator lay_itr = test.layers.find(refLayer);
695 if (lay_itr == test.layers.end()) {
696 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "
697 <<refLayer<<
" is not found. "<<std::endl;
701 const sTgcLayer& testLayer{*lay_itr};
706 std::cout <<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "
707 <<
"The test layer transform for layer "<< c <<
" is: " <<
Amg::toString(testLayer.transform)
708 <<
" and the reference layer transform is: " <<
Amg::toString(refLayer.transform)
712 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "
713 <<
"the layer "<<testLayer<<
" is misaligned w.r.t. reference by "
719 TEST_BASICPROP(numWires[c],
"number of wires in the layer "<< c + 1 <<
" are ");
720 TEST_BASICPROP(firstWireGroupWidth[c],
"number of wires in first wire group in the layer "<< c + 1 <<
" are ");
722 TEST_BASICPROP(numPads[c],
"number of pads in the layer "<< c + 1 <<
" are ");
723 TEST_BASICPROP(numPadEta[c],
"number of pads in the eta direction in the layer "<< c + 1 <<
" are ");
724 TEST_BASICPROP(numPadPhi[c],
"number of in the phi direction in the layer "<< c + 1 <<
" are ");
725 TEST_BASICPROP(firstPadHeight[c],
"height of the first pad row in the layer "<< c + 1 <<
" are ");
726 TEST_BASICPROP(padHeight[c],
"height of pads in the rest of the rows in the layer "<< c + 1 <<
" are ");
727 TEST_BASICPROP(padPhiShift[c],
"shift of inner pad edges in phi direction in the layer "<< c + 1 <<
" are ");
728 TEST_BASICPROP(firstPadPhiDiv[c],
"angular position of the outer edge of the first pad in the layer "<< c + 1 <<
" are ");
733 for (
const sTgcChannel& refChannel :
reference.channels) {
734 std::set<sTgcChannel>::const_iterator channel_itr = test.channels.find(refChannel);
735 if (channel_itr == test.channels.end()) {
736 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "
737 <<refChannel<<
" is not found. "<<std::endl;
741 const sTgcChannel& testChannel{*channel_itr};
743 const Amg::Vector3D diffGlobalPos{testChannel.globalPosition - refChannel.globalPosition};
744 const Amg::Vector2D diffLocalPos{testChannel.localPosition - refChannel.localPosition};
746 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"channel (gasGap/number): "
747 <<testChannel.gasGap<<
"/"<<testChannel.channelNumber<<
", chType: "<<testChannel.channelType<<
", "<<
" global position: "
749 <<
" displacement: "<<
Amg::toString(diffGlobalPos,2)<<std::endl;
753 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"channel (gasGap/number): "
754 <<testChannel.gasGap<<
"/"<<testChannel.channelNumber<<
", chType: "<<testChannel.channelType<<
", "<<
" local position: "
756 <<
" displacement: "<<
Amg::toString(diffLocalPos,2)<<std::endl;
759 const double diffChannelLen{testChannel.channelLen - refChannel.channelLen};
760 if (std::abs(diffChannelLen) >
tolerance) {
761 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"channel (gasGap/number): "
762 <<testChannel.gasGap<<
"/"<<testChannel.channelNumber<<
", chType: "<<testChannel.channelType<<
", "<<
" Run 4 strip Length: "
763 <<testChannel.channelLen<<
" Run 3 strip Length "<<refChannel.channelLen
764 <<
" displacement: "<<diffChannelLen<<std::endl;
770 for (
const sTgcPad& refPad :
reference.pads) {
771 std::set<sTgcPad>::const_iterator pad_itr = test.pads.find(refPad);
772 if (pad_itr == test.pads.end()) {
773 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "
774 <<refPad<<
" is not found. "<<std::endl;
778 const sTgcPad& testPad{*pad_itr};
780 const Amg::Vector2D diffLocalPadPos{testPad.localPosition - refPad.localPosition};
782 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
783 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" local position: "
785 <<
" displacement: "<<
Amg::toString(diffLocalPadPos,2)<<std::endl;
789 const Amg::Vector2D diffLocalPadCornerBL{testPad.localPadCornerBL - refPad.localPadCornerBL};
790 if (diffLocalPadCornerBL.mag() >
tolerance) {
791 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
792 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" bottom-left corner: "
794 <<
" displacement: "<<
Amg::toString(diffLocalPadCornerBL,2)<<std::endl;
798 const Amg::Vector2D diffLocalPadCornerBR{testPad.localPadCornerBR - refPad.localPadCornerBR};
799 if (diffLocalPadCornerBR.mag() >
tolerance) {
800 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
801 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" bottom-right corner: "
803 <<
" displacement: "<<
Amg::toString(diffLocalPadCornerBR,2)<<std::endl;
807 const Amg::Vector2D diffLocalPadCornerTL{testPad.localPadCornerTL - refPad.localPadCornerTL};
808 if (diffLocalPadCornerTL.mag() >
tolerance) {
809 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
810 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" top-left corner: "
812 <<
" displacement: "<<
Amg::toString(diffLocalPadCornerTL,2)<<std::endl;
816 const Amg::Vector2D diffLocalPadCornerTR{testPad.localPadCornerTR - refPad.localPadCornerTR};
817 if (diffLocalPadCornerTR.mag() >
tolerance) {
818 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
819 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" top-right corner: "
821 <<
" displacement: "<<
Amg::toString(diffLocalPadCornerTR,2)<<std::endl;
826 const Amg::Vector3D diffGlobalPadPos{testPad.globalPosition - refPad.globalPosition};
827 if (diffGlobalPadPos.mag() >
tolerance) {
828 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
829 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" global position: "
831 <<
" displacement: "<<
Amg::toString(diffGlobalPadPos,2)<<std::endl;
835 const Amg::Vector3D diffGlobalPadCornerBL{testPad.globalPadCornerBL - refPad.globalPadCornerBL};
836 if (diffGlobalPadCornerBL.mag() >
tolerance) {
837 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
838 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" bottom-left corner: "
840 <<
" displacement: "<<
Amg::toString(diffGlobalPadCornerBL,2)<<std::endl;
845 const Amg::Vector3D diffGlobalPadCornerBR{testPad.globalPadCornerBR - refPad.globalPadCornerBR};
846 if (diffGlobalPadCornerBR.mag() >
tolerance) {
847 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
848 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" bottom-right corner: "
850 <<
" displacement: "<<
Amg::toString(diffGlobalPadCornerBR,2)<<std::endl;
854 const Amg::Vector3D diffGlobalPadCornerTL{testPad.globalPadCornerTL - refPad.globalPadCornerTL};
855 if (diffGlobalPadCornerTL.mag() >
tolerance) {
856 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
857 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" top-left corner: "
859 <<
" displacement: "<<
Amg::toString(diffGlobalPadCornerTL,2)<<std::endl;
863 const Amg::Vector3D diffGlobalPadCornerTR{testPad.globalPadCornerTR - refPad.globalPadCornerTR};
864 if (diffGlobalPadCornerTR.mag() >
tolerance) {
865 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
866 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" top-right corner: "
868 <<
" displacement: "<<
Amg::toString(diffGlobalPadCornerTR,2)<<std::endl;
872 const Amg::Vector2D diffHitPosition{testPad.hitPosition - refPad.hitPosition};
874 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
875 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" Hit Position: "
880 const int diffPadNumber{testPad.padNumber - refPad.padNumber};
881 if (std::abs(diffPadNumber) > 0 || testPad.padNumber < 0 || refPad.padNumber < 0) {
882 std::cerr<<
"runsTgcGeoComparison() "<<__LINE__<<
": in chamber "<<test<<
" "<<
"pad (gasGap/(padEta, padPhi)): "
883 <<testPad.gasGap<<
"/("<<testPad.padEta<<
", "<<testPad.padPhi<<
"), "<<
" padNumber: "
884 <<testPad.padNumber <<
" should be "<<refPad.padNumber <<
" displacement: "<< diffPadNumber
885 <<
" Hit Position: "<<
Amg::toString(testPad.hitPosition, 2) <<
" BL Corner: "
891 return_code = EXIT_FAILURE;