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

Go to the source code of this file.

Classes

struct  sTgcChamber
 Helper struct to represent a full sTgc chamber. More...
 
struct  sTgcChamber::sTgcChannel
 
struct  sTgcChamber::sTgcPad
 
struct  sTgcChamber::sTgcLayer
 Helper struct to assess that the layers are properly oriented. More...
 

Macros

#define TEST_BASICPROP(attribute, propName)
 

Functions

std::ostream & operator<< (std::ostream &ostr, const sTgcChamber &chamb)
 Translation of the station Index -> station Name. More...
 
std::ostream & operator<< (std::ostream &ostr, const sTgcChamber::sTgcChannel &channel)
 
std::ostream & operator<< (std::ostream &ostr, const sTgcChamber::sTgcPad &pad)
 
std::ostream & operator<< (std::ostream &ostr, const sTgcChamber::sTgcLayer &layer)
 
std::set< sTgcChamberreadTreeDump (const std::string &inputFile)
 
int main (int argc, char **argv)
 

Variables

constexpr double tolerance = 100.*Gaudi::Units::micrometer
 

Macro Definition Documentation

◆ TEST_BASICPROP

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

Definition at line 568 of file runsTgcGeoComparison.cxx.

Function Documentation

◆ main()

int main ( 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

Chamber and GasGap Lengths for debug

Testing Wire Vectors

Testing Pad Vectors

Uncomment to dump the local to global layer transformation

Local Pad position dump

bottom-left pad Corner

bottom-right pad corner

top-left pad corner

top-right pad corner

Global Pad position dump

bottom-left pad Corner

bottom-right pad corner

top-left pad corner

top-right pad corner

Hit Position used to evaluate padNumber

padNumber given the hit position

Definition at line 575 of file runsTgcGeoComparison.cxx.

575  {
576  std::string refFile{}, testFile{};
577 
578  for (int arg = 1; arg < argc; ++arg) {
579  std::string the_arg{argv[arg]};
580  if (the_arg == "--refFile" && arg +1 < argc) {
581  refFile = std::string{argv[arg+1]};
582  ++arg;
583  } else if (the_arg == "--testFile" && arg + 1 < argc) {
584  testFile = std::string{argv[arg+1]};
585  ++arg;
586  }
587  }
588  if (refFile.empty()) {
589  std::cerr<<"Please parse the path of the reference file via --refFile "<<std::endl;
590  return EXIT_FAILURE;
591  }
592  if (testFile.empty()) {
593  std::cerr<<"Please parse the path of the test file via --testFile "<<std::endl;
594  return EXIT_FAILURE;
595  }
597  if (!CxxUtils::starts_with (refFile, "root://")) refFile = PathResolver::FindCalibFile(refFile);
600  std::set<sTgcChamber> refChambers = readTreeDump(refFile);
601  if (refChambers.empty()) {
602  std::cerr<<"The file "<<refFile<<" should contain at least one chamber "<<std::endl;
603  return EXIT_FAILURE;
604  }
605  std::set<sTgcChamber> testChambers = readTreeDump(testFile);
606  if (testChambers.empty()) {
607  std::cerr<<"The file "<<testFile<<" should contain at least one chamber "<<std::endl;
608  return EXIT_FAILURE;
609  }
610  int return_code = EXIT_SUCCESS;
612  for (const sTgcChamber& reference : refChambers) {
613  std::set<sTgcChamber>::const_iterator test_itr = testChambers.find(reference);
614 
615  if (test_itr == testChambers.end()) {
616  std::cerr<<"The chamber "<<reference<<" is not part of the testing "<<std::endl;
617  return_code = EXIT_FAILURE;
618  continue;
619  }
620  bool chamberOkay = true;
621  const sTgcChamber& test = {*test_itr};
622 
623  TEST_BASICPROP(numLayers, "number of gas gaps");
624  TEST_BASICPROP(yCutout, "yCutout of the Chamber");
625  TEST_BASICPROP(gasTck, "thickness of the gas gap");
626 
628  TEST_BASICPROP(sChamberLength, "Chamber length on the short side");
629  TEST_BASICPROP(lChamberLength, "Chamber length on the long side");
630  TEST_BASICPROP(chamberHeight, "Chamber height");
631  TEST_BASICPROP(sGapLength, "GasGap length on the short side");
632  TEST_BASICPROP(lGapLength, "GasGap length on the long side");
633  TEST_BASICPROP(gapHeight, "GasGap Height");
634 
635  TEST_BASICPROP(wirePitch, "pitch of a single wire");
636  TEST_BASICPROP(wireWidth, "width of a single wire");
637  TEST_BASICPROP(wireGroupWidth, "number of wires in a normal wiregroup");
638 
639  TEST_BASICPROP(numStrips, "number of strips in a chamber");
640  TEST_BASICPROP(stripPitch, "pitch of a normal strip");
641  TEST_BASICPROP(stripWidth, "width of a normal strip");
642  TEST_BASICPROP(sPadLength, "gasGap length on the short side for pads and wires");
643  TEST_BASICPROP(lPadLength, "gasGap length on the long side for pads and wires");
644  TEST_BASICPROP(anglePadPhi, "angular width of a pad in phi direction");
645  TEST_BASICPROP(beamlineRadius, "distance from the gapCenter to beamline");
646 
647  int c = 0;
648  using sTgcLayer = sTgcChamber::sTgcLayer;
649  for (const sTgcLayer& refLayer : reference.layers) {
650  std::set<sTgcLayer>::const_iterator lay_itr = test.layers.find(refLayer);
651  if (lay_itr == test.layers.end()) {
652  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
653  <<refLayer<<" is not found. "<<std::endl;
654  chamberOkay = false;
655  continue;
656  }
657  const sTgcLayer& testLayer{*lay_itr};
658  const Amg::Transform3D layAlignment = testLayer.transform.inverse() *
659  refLayer.transform;
661  TEST_BASICPROP(numWires[c], "number of wires in the layer "<< c + 1 << " are ");
662  TEST_BASICPROP(firstWireGroupWidth[c], "number of wires in first wire group in the layer "<< c + 1 << " are ");
664  TEST_BASICPROP(numPads[c], "number of pads in the layer "<< c + 1 << " are ");
665  TEST_BASICPROP(numPadEta[c], "number of pads in the eta direction in the layer "<< c + 1 << " are ");
666  TEST_BASICPROP(numPadPhi[c], "number of in the phi direction in the layer "<< c + 1 << " are ");
667  TEST_BASICPROP(firstPadHeight[c], "height of the first pad row in the layer "<< c + 1 << " are ");
668  TEST_BASICPROP(padHeight[c], "height of pads in the rest of the rows in the layer "<< c + 1 << " are ");
669  TEST_BASICPROP(padPhiShift[c], "shift of inner pad edges in phi direction in the layer "<< c + 1 << " are ");
670  TEST_BASICPROP(firstPadPhiDiv[c], "angular position of the outer edge of the first pad in the layer "<< c + 1 << " are ");
671  ++c;
672 
674  std::cout <<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
675  << "The test layer transform for layer "<< c << " is: " << Amg::toString(testLayer.transform)
676  << " and the reference layer transform is: " << Amg::toString(refLayer.transform) <<std::endl;
677 
678  if (!Amg::doesNotDeform(layAlignment)) {
679  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
680  <<"the layer "<<testLayer<<" is misaligned w.r.t. reference by "
681  <<Amg::toString(layAlignment)<<std::endl;
682  chamberOkay = false;
683  continue;
684  }
685  }
686 
687  using sTgcChannel = sTgcChamber::sTgcChannel;
688  for (const sTgcChannel& refChannel : reference.channels) {
689  std::set<sTgcChannel>::const_iterator channel_itr = test.channels.find(refChannel);
690  if (channel_itr == test.channels.end()) {
691  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
692  <<refChannel<<" is not found. "<<std::endl;
693  chamberOkay = false;
694  continue;
695  }
696  const sTgcChannel& testChannel{*channel_itr};
697 
698  const Amg::Vector3D diffGlobalPos{testChannel.globalPosition - refChannel.globalPosition};
699  const Amg::Vector2D diffLocalPos{testChannel.localPosition - refChannel.localPosition};
700  if (diffGlobalPos.mag() > tolerance) {
701  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"channel (gasGap/number): "
702  <<testChannel.gasGap<<"/"<<testChannel.channelNumber<<", chType: "<<testChannel.channelType<<", "<< " global position: "
703  <<Amg::toString(testChannel.globalPosition, 2)<<" should be located at "<<Amg::toString(refChannel.globalPosition, 2)
704  <<" displacement: "<<Amg::toString(diffGlobalPos,2)<<std::endl;
705  chamberOkay = false;
706  }
707  if (diffLocalPos.mag() > tolerance) {
708  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"channel (gasGap/number): "
709  <<testChannel.gasGap<<"/"<<testChannel.channelNumber<<", chType: "<<testChannel.channelType<<", "<< " local position: "
710  <<Amg::toString(testChannel.localPosition, 2)<<" should be located at "<<Amg::toString(refChannel.localPosition, 2)
711  <<" displacement: "<<Amg::toString(diffLocalPos,2)<<std::endl;
712  chamberOkay = false;
713  }
714  const double diffChannelLen{testChannel.channelLen - refChannel.channelLen};
715  if (std::abs(diffChannelLen) > tolerance) {
716  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"channel (gasGap/number): "
717  <<testChannel.gasGap<<"/"<<testChannel.channelNumber<<", chType: "<<testChannel.channelType<<", "<< " Run 4 strip Length: "
718  <<testChannel.channelLen<<" Run 3 strip Length "<<refChannel.channelLen
719  <<" displacement: "<<diffChannelLen<<std::endl;
720  chamberOkay = false;
721  }
722  }
723 
724  using sTgcPad = sTgcChamber::sTgcPad;
725  for (const sTgcPad& refPad : reference.pads) {
726  std::set<sTgcPad>::const_iterator pad_itr = test.pads.find(refPad);
727  if (pad_itr == test.pads.end()) {
728  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
729  <<refPad<<" is not found. "<<std::endl;
730  chamberOkay = false;
731  continue;
732  }
733  const sTgcPad& testPad{*pad_itr};
735  const Amg::Vector2D diffLocalPadPos{testPad.localPosition - refPad.localPosition};
736  if (diffLocalPadPos.mag() > tolerance) {
737  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
738  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " local position: "
739  <<Amg::toString(testPad.localPosition, 2)<<" should be located at "<<Amg::toString(refPad.localPosition, 2)
740  <<" displacement: "<<Amg::toString(diffLocalPadPos,2)<<std::endl;
741  chamberOkay = false;
742  }
744  const Amg::Vector2D diffLocalPadCornerBL{testPad.localPadCornerBL - refPad.localPadCornerBL};
745  if (diffLocalPadCornerBL.mag() > tolerance) {
746  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
747  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " bottom-left corner: "
748  <<Amg::toString(testPad.localPadCornerBL, 2)<<" should be located at "<<Amg::toString(refPad.localPadCornerBL, 2)
749  <<" displacement: "<<Amg::toString(diffLocalPadCornerBL,2)<<std::endl;
750  chamberOkay = false;
751  }
753  const Amg::Vector2D diffLocalPadCornerBR{testPad.localPadCornerBR - refPad.localPadCornerBR};
754  if (diffLocalPadCornerBR.mag() > tolerance) {
755  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
756  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " bottom-right corner: "
757  <<Amg::toString(testPad.localPadCornerBR, 2)<<" should be located at "<<Amg::toString(refPad.localPadCornerBR, 2)
758  <<" displacement: "<<Amg::toString(diffLocalPadCornerBR,2)<<std::endl;
759  chamberOkay = false;
760  }
762  const Amg::Vector2D diffLocalPadCornerTL{testPad.localPadCornerTL - refPad.localPadCornerTL};
763  if (diffLocalPadCornerTL.mag() > tolerance) {
764  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
765  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " top-left corner: "
766  <<Amg::toString(testPad.localPadCornerTL, 2)<<" should be located at "<<Amg::toString(refPad.localPadCornerTL, 2)
767  <<" displacement: "<<Amg::toString(diffLocalPadCornerTL,2)<<std::endl;
768  chamberOkay = false;
769  }
771  const Amg::Vector2D diffLocalPadCornerTR{testPad.localPadCornerTR - refPad.localPadCornerTR};
772  if (diffLocalPadCornerTR.mag() > tolerance) {
773  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
774  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " top-right corner: "
775  <<Amg::toString(testPad.localPadCornerTR, 2)<<" should be located at "<<Amg::toString(refPad.localPadCornerTR, 2)
776  <<" displacement: "<<Amg::toString(diffLocalPadCornerTR,2)<<std::endl;
777  chamberOkay = false;
778  }
779 
781  const Amg::Vector3D diffGlobalPadPos{testPad.globalPosition - refPad.globalPosition};
782  if (diffGlobalPadPos.mag() > tolerance) {
783  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
784  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " global position: "
785  <<Amg::toString(testPad.globalPosition, 2)<<" should be located at "<<Amg::toString(refPad.globalPosition, 2)
786  <<" displacement: "<<Amg::toString(diffGlobalPadPos,2)<<std::endl;
787  chamberOkay = false;
788  }
790  const Amg::Vector3D diffGlobalPadCornerBL{testPad.globalPadCornerBL - refPad.globalPadCornerBL};
791  if (diffGlobalPadCornerBL.mag() > tolerance) {
792  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
793  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " bottom-left corner: "
794  <<Amg::toString(testPad.globalPadCornerBL, 2)<<" should be located at "<<Amg::toString(refPad.globalPadCornerBL, 2)
795  <<" displacement: "<<Amg::toString(diffGlobalPadCornerBL,2)<<std::endl;
796  chamberOkay = false;
797  }
798 
800  const Amg::Vector3D diffGlobalPadCornerBR{testPad.globalPadCornerBR - refPad.globalPadCornerBR};
801  if (diffGlobalPadCornerBR.mag() > tolerance) {
802  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
803  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " bottom-right corner: "
804  <<Amg::toString(testPad.globalPadCornerBR, 2)<<" should be located at "<<Amg::toString(refPad.globalPadCornerBR, 2)
805  <<" displacement: "<<Amg::toString(diffGlobalPadCornerBR,2)<<std::endl;
806  chamberOkay = false;
807  }
809  const Amg::Vector3D diffGlobalPadCornerTL{testPad.globalPadCornerTL - refPad.globalPadCornerTL};
810  if (diffGlobalPadCornerTL.mag() > tolerance) {
811  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
812  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " top-left corner: "
813  <<Amg::toString(testPad.globalPadCornerTL, 2)<<" should be located at "<<Amg::toString(refPad.globalPadCornerTL, 2)
814  <<" displacement: "<<Amg::toString(diffGlobalPadCornerTL,2)<<std::endl;
815  chamberOkay = false;
816  }
818  const Amg::Vector3D diffGlobalPadCornerTR{testPad.globalPadCornerTR - refPad.globalPadCornerTR};
819  if (diffGlobalPadCornerTR.mag() > tolerance) {
820  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
821  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " top-right corner: "
822  <<Amg::toString(testPad.globalPadCornerTR, 2)<<" should be located at "<<Amg::toString(refPad.globalPadCornerTR, 2)
823  <<" displacement: "<<Amg::toString(diffGlobalPadCornerTR,2)<<std::endl;
824  chamberOkay = false;
825  }
827  const Amg::Vector2D diffHitPosition{testPad.hitPosition - refPad.hitPosition};
828  if (diffHitPosition.mag() > tolerance) {
829  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
830  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " Hit Position: "
831  <<Amg::toString(testPad.hitPosition, 2) <<" should be "<<Amg::toString(refPad.hitPosition, 2) <<" displacement: "<< Amg::toString(diffHitPosition, 2) <<std::endl;
832  chamberOkay = false;
833  }
835  const int diffPadNumber{testPad.padNumber - refPad.padNumber};
836  if (std::abs(diffPadNumber) > 0 || testPad.padNumber < 0 || refPad.padNumber < 0) {
837  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
838  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " padNumber: "
839  <<testPad.padNumber <<" should be "<<refPad.padNumber <<" displacement: "<< diffPadNumber
840  << " Hit Position: "<< Amg::toString(testPad.hitPosition, 2) << " BL Corner: "
841  << Amg::toString(testPad.localPadCornerBL, 2) << std::endl;
842  chamberOkay = false;
843  }
844 
845  if (!chamberOkay) {
846  return_code = EXIT_FAILURE;
847  }
848  }
849  }
850  return return_code;
851 }

◆ operator<<() [1/4]

std::ostream& operator<< ( std::ostream &  ostr,
const sTgcChamber 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 178 of file runsTgcGeoComparison.cxx.

178  {
179  static const std::map<int, std::string> stationDict{
180  {57, "STS"}, {58, "STL"}
181  };
182  ostr<<"sTgc chamber "<<stationDict.at(chamb.stationIndex)<<"("<<chamb.design<<") "<<chamb.stationName;
183  return ostr;
184 }

◆ operator<<() [2/4]

std::ostream& operator<< ( std::ostream &  ostr,
const sTgcChamber::sTgcChannel channel 
)

Definition at line 186 of file runsTgcGeoComparison.cxx.

186  {
187  ostr<<"channel (gasGap/number): ";
188  ostr<<channel.gasGap<<"/";
189  ostr<<channel.channelNumber<<", ";
190  ostr<<channel.channelType<<", ";
191  ostr<<" global Position: "<<Amg::toString(channel.globalPosition, 2)<<", ";
192  ostr<<" local Position: "<<Amg::toString(channel.localPosition, 2);
193  return ostr;
194 }

◆ operator<<() [3/4]

std::ostream& operator<< ( std::ostream &  ostr,
const sTgcChamber::sTgcLayer layer 
)

Definition at line 214 of file runsTgcGeoComparison.cxx.

214  {
215  ostr<<"stgclayer (gasGap/channelType): ";
216  ostr<<layer.gasGap<<", ";
217  ostr<<"transform: "<<Amg::toString(layer.transform);
218  return ostr;
219 }

◆ operator<<() [4/4]

std::ostream& operator<< ( std::ostream &  ostr,
const sTgcChamber::sTgcPad pad 
)

Definition at line 196 of file runsTgcGeoComparison.cxx.

196  {
197  ostr<<"pad (gasGap/padEta/padPhi): ";
198  ostr<<pad.gasGap<<"/";
199  ostr<<pad.padEta<<"/"<<pad.padPhi<<", ";
200  ostr<<"global position: "<<Amg::toString(pad.globalPosition, 2);
201  ostr<<"Bottom-left globalPadCorner: "<<Amg::toString(pad.globalPadCornerBL, 2);
202  ostr<<"Bottom-right globalpadCorner: "<<Amg::toString(pad.globalPadCornerBR, 2);
203  ostr<<"Top-left globalpadCorner: "<<Amg::toString(pad.globalPadCornerTL, 2);
204  ostr<<"Top-right globalpadCorner: "<<Amg::toString(pad.globalPadCornerTR, 2);
205 
206  ostr<<"local position: "<<Amg::toString(pad.localPosition, 2);
207  ostr<<"Bottom-left localPadCorner: "<<Amg::toString(pad.localPadCornerBL, 2);
208  ostr<<"Bottom-right localpadCorner: "<<Amg::toString(pad.localPadCornerBR, 2);
209  ostr<<"Top-left localpadCorner: "<<Amg::toString(pad.localPadCornerTL, 2);
210  ostr<<"Top-right localpadCorner: "<<Amg::toString(pad.localPadCornerTR, 2);
211  return ostr;
212 }

◆ readTreeDump()

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

Identifier of the readout element

Chamber Length for debug

GasGap Lengths for debug

Strip dimensions

Pad dimensions

Geo Model transformation

Local to Global Strip Transformation

Local to Global wire Group Transformation

Local to Global pad Transformation

Identifier of the readout element

Gas Gap lengths for debug

Uncomment to avoid wireGroupPositions dump

Uncomment to avoid stripPositions dump

Uncomment to avoid padPositions dump

Definition at line 221 of file runsTgcGeoComparison.cxx.

221  {
222  std::set<sTgcChamber> to_ret{};
223  std::cout<<"Read the sTgc geometry tree dump from "<<inputFile<<std::endl;
224  std::unique_ptr<TFile> inFile{TFile::Open(inputFile.c_str())};
225  if (!inFile || !inFile->IsOpen()) {
226  std::cerr<<__FILE__<<":"<<__LINE__<<" Failed to open "<<inputFile<<std::endl;
227  return to_ret;
228  }
229  TTreeReader treeReader("sTgcGeoModelTree", inFile.get());
230  if (treeReader.IsInvalid()){
231  std::cerr<<__FILE__<<":"<<__LINE__<<" The file "<<inputFile<<" does not contain the 'sTgcGeoModelTree'"<<std::endl;
232  return to_ret;
233  }
234 
236  TTreeReaderValue<short> stationIndex{treeReader, "stationIndex"};
237  TTreeReaderValue<short> stationEta{treeReader, "stationEta"};
238  TTreeReaderValue<short> stationPhi{treeReader, "stationPhi"};
239  TTreeReaderValue<short> stationMultilayer{treeReader, "stationMultilayer"};
240  TTreeReaderValue<std::string> chamberDesign{treeReader,"chamberDesign"};
241 
243  TTreeReaderValue<short> numLayers{treeReader, "numLayers"};
244  TTreeReaderValue<float> yCutout{treeReader, "yCutout"};
245  TTreeReaderValue<float> gasTck{treeReader, "gasTck"};
247  TTreeReaderValue<float> sChamberLength{treeReader, "sChamberLength"};
248  TTreeReaderValue<float> lChamberLength{treeReader, "lChamberLength"};
249  TTreeReaderValue<float> chamberHeight{treeReader, "chamberHeight"};
251  TTreeReaderValue<float> sGapLength{treeReader, "sGapLength"};
252  TTreeReaderValue<float> lGapLength{treeReader, "lGapLength"};
253  TTreeReaderValue<float> gapHeight{treeReader, "gapHeight"};
254 
256  TTreeReaderValue<std::vector<uint>> numWires{treeReader, "numWires"};
257  TTreeReaderValue<std::vector<uint>> firstWireGroupWidth{treeReader, "firstWireGroupWidth"};
258  TTreeReaderValue<std::vector<uint>> numWireGroups{treeReader, "numWireGroups"};
259  TTreeReaderValue<std::vector<float>> wireCutout{treeReader, "wireCutout"};
260  TTreeReaderValue<float> wirePitch{treeReader, "wirePitch"};
261  TTreeReaderValue<float> wireWidth{treeReader, "wireWidth"};
262  TTreeReaderValue<uint> wireGroupWidth{treeReader, "wireGroupWidth"};
263 
264  TTreeReaderValue<std::vector<float>> globalWireGroupPosX{treeReader, "globalWireGroupPosX"};
265  TTreeReaderValue<std::vector<float>> globalWireGroupPosY{treeReader, "globalWireGroupPosY"};
266  TTreeReaderValue<std::vector<float>> globalWireGroupPosZ{treeReader, "globalWireGroupPosZ"};
267 
268  TTreeReaderValue<std::vector<float>> localWireGroupPosX{treeReader, "localWireGroupPosX"};
269  TTreeReaderValue<std::vector<float>> localWireGroupPosY{treeReader, "localWireGroupPosY"};
270 
271  TTreeReaderValue<std::vector<uint8_t>> wireGroupNum{treeReader, "wireGroupNum"};
272  TTreeReaderValue<std::vector<uint8_t>> wireGroupGasGap{treeReader, "wireGroupGasGap"};
273 
275  TTreeReaderValue<uint> numStrips{treeReader, "numStrips"};
276  TTreeReaderValue<float> stripPitch{treeReader, "stripPitch"};
277  TTreeReaderValue<float> stripWidth{treeReader, "stripWidth"};
278 
279  TTreeReaderValue<std::vector<float>> globalStripPosX{treeReader, "globalStripPosX"};
280  TTreeReaderValue<std::vector<float>> globalStripPosY{treeReader, "globalStripPosY"};
281  TTreeReaderValue<std::vector<float>> globalStripPosZ{treeReader, "globalStripPosZ"};
282 
283  TTreeReaderValue<std::vector<float>> localStripPosX{treeReader, "localStripPosX"};
284  TTreeReaderValue<std::vector<float>> localStripPosY{treeReader, "localStripPosY"};
285 
286  TTreeReaderValue<std::vector<uint>> stripNum{treeReader, "stripNumber"};
287  TTreeReaderValue<std::vector<uint8_t>> stripGasGap{treeReader, "stripGasGap"};
288  TTreeReaderValue<std::vector<float>> stripLengths{treeReader, "stripLengths"};
289 
291  TTreeReaderValue<float> sPadLength{treeReader, "sPadLength"};
292  TTreeReaderValue<float> lPadLength{treeReader, "lPadLength"};
293  TTreeReaderValue<float> anglePadPhi{treeReader, "anglePadPhi"};
294  TTreeReaderValue<float> beamlineRadius{treeReader, "beamlineRadius"};
295  TTreeReaderValue<std::vector<uint>> numPads{treeReader, "numPads"};
296  TTreeReaderValue<std::vector<uint>> numPadEta{treeReader, "numPadEta"};
297  TTreeReaderValue<std::vector<uint>> numPadPhi{treeReader, "numPadPhi"};
298  TTreeReaderValue<std::vector<float>> firstPadHeight{treeReader, "firstPadHeight"};
299  TTreeReaderValue<std::vector<float>> padHeight{treeReader, "padHeight"};
300  TTreeReaderValue<std::vector<float>> padPhiShift{treeReader, "padPhiShift"};
301  TTreeReaderValue<std::vector<float>> firstPadPhiDiv{treeReader, "firstPadPhiDiv"};
302 
303  TTreeReaderValue<std::vector<float>> globalPadCornerBRX{treeReader, "globalPadCornerBRX"};
304  TTreeReaderValue<std::vector<float>> globalPadCornerBRY{treeReader, "globalPadCornerBRY"};
305  TTreeReaderValue<std::vector<float>> globalPadCornerBRZ{treeReader, "globalPadCornerBRZ"};
306 
307  TTreeReaderValue<std::vector<float>> globalPadCornerBLX{treeReader, "globalPadCornerBLX"};
308  TTreeReaderValue<std::vector<float>> globalPadCornerBLY{treeReader, "globalPadCornerBLY"};
309  TTreeReaderValue<std::vector<float>> globalPadCornerBLZ{treeReader, "globalPadCornerBLZ"};
310 
311  TTreeReaderValue<std::vector<float>> globalPadCornerTRX{treeReader, "globalPadCornerTRX"};
312  TTreeReaderValue<std::vector<float>> globalPadCornerTRY{treeReader, "globalPadCornerTRY"};
313  TTreeReaderValue<std::vector<float>> globalPadCornerTRZ{treeReader, "globalPadCornerTRZ"};
314 
315  TTreeReaderValue<std::vector<float>> globalPadCornerTLX{treeReader, "globalPadCornerTLX"};
316  TTreeReaderValue<std::vector<float>> globalPadCornerTLY{treeReader, "globalPadCornerTLY"};
317  TTreeReaderValue<std::vector<float>> globalPadCornerTLZ{treeReader, "globalPadCornerTLZ"};
318 
319  TTreeReaderValue<std::vector<float>> globalPadPosX{treeReader, "globalPadPosX"};
320  TTreeReaderValue<std::vector<float>> globalPadPosY{treeReader, "globalPadPosY"};
321  TTreeReaderValue<std::vector<float>> globalPadPosZ{treeReader, "globalPadPosZ"};
322 
323  TTreeReaderValue<std::vector<float>> localPadCornerBRX{treeReader, "localPadCornerBRX"};
324  TTreeReaderValue<std::vector<float>> localPadCornerBRY{treeReader, "localPadCornerBRY"};
325 
326  TTreeReaderValue<std::vector<float>> localPadCornerBLX{treeReader, "localPadCornerBLX"};
327  TTreeReaderValue<std::vector<float>> localPadCornerBLY{treeReader, "localPadCornerBLY"};
328 
329  TTreeReaderValue<std::vector<float>> localPadCornerTRX{treeReader, "localPadCornerTRX"};
330  TTreeReaderValue<std::vector<float>> localPadCornerTRY{treeReader, "localPadCornerTRY"};
331 
332  TTreeReaderValue<std::vector<float>> localPadCornerTLX{treeReader, "localPadCornerTLX"};
333  TTreeReaderValue<std::vector<float>> localPadCornerTLY{treeReader, "localPadCornerTLY"};
334 
335  TTreeReaderValue<std::vector<float>> localPadPosX{treeReader, "localPadPosX"};
336  TTreeReaderValue<std::vector<float>> localPadPosY{treeReader, "localPadPosY"};
337 
338  TTreeReaderValue<std::vector<float>> hitPositionX{treeReader, "hitPositionX"};
339  TTreeReaderValue<std::vector<float>> hitPositionY{treeReader, "hitPositionY"};
340  TTreeReaderValue<std::vector<int>> padNumber{treeReader, "padNumber"};
341 
342  TTreeReaderValue<std::vector<uint8_t>> padGasGap{treeReader, "padGasGap"};
343  TTreeReaderValue<std::vector<uint>> padEta{treeReader, "padEtaNumber"};
344  TTreeReaderValue<std::vector<uint>> padPhi{treeReader, "padPhiNumber"};
345 
347  TTreeReaderValue<std::vector<float>> geoModelTransformX{treeReader, "GeoModelTransformX"};
348  TTreeReaderValue<std::vector<float>> geoModelTransformY{treeReader, "GeoModelTransformY"};
349  TTreeReaderValue<std::vector<float>> geoModelTransformZ{treeReader, "GeoModelTransformZ"};
351  TTreeReaderValue<std::vector<float>> stripRotCol1X{treeReader, "stripRotLinearCol1X"};
352  TTreeReaderValue<std::vector<float>> stripRotCol1Y{treeReader, "stripRotLinearCol1Y"};
353  TTreeReaderValue<std::vector<float>> stripRotCol1Z{treeReader, "stripRotLinearCol1Z"};
354 
355  TTreeReaderValue<std::vector<float>> stripRotCol2X{treeReader, "stripRotLinearCol2X"};
356  TTreeReaderValue<std::vector<float>> stripRotCol2Y{treeReader, "stripRotLinearCol2Y"};
357  TTreeReaderValue<std::vector<float>> stripRotCol2Z{treeReader, "stripRotLinearCol2Z"};
358 
359  TTreeReaderValue<std::vector<float>> stripRotCol3X{treeReader, "stripRotLinearCol3X"};
360  TTreeReaderValue<std::vector<float>> stripRotCol3Y{treeReader, "stripRotLinearCol3Y"};
361  TTreeReaderValue<std::vector<float>> stripRotCol3Z{treeReader, "stripRotLinearCol3Z"};
362 
363  TTreeReaderValue<std::vector<float>> stripRotTransX{treeReader, "stripRotTranslationX"};
364  TTreeReaderValue<std::vector<float>> stripRotTransY{treeReader, "stripRotTranslationY"};
365  TTreeReaderValue<std::vector<float>> stripRotTransZ{treeReader, "stripRotTranslationZ"};
366 
367  TTreeReaderValue<std::vector<uint8_t>> stripRotGasGap{treeReader, "stripRotGasGap"};
368 
370  TTreeReaderValue<std::vector<float>> wireGroupRotCol1X{treeReader, "wireGroupRotLinearCol1X"};
371  TTreeReaderValue<std::vector<float>> wireGroupRotCol1Y{treeReader, "wireGroupRotLinearCol1Y"};
372  TTreeReaderValue<std::vector<float>> wireGroupRotCol1Z{treeReader, "wireGroupRotLinearCol1Z"};
373 
374  TTreeReaderValue<std::vector<float>> wireGroupRotCol2X{treeReader, "wireGroupRotLinearCol2X"};
375  TTreeReaderValue<std::vector<float>> wireGroupRotCol2Y{treeReader, "wireGroupRotLinearCol2Y"};
376  TTreeReaderValue<std::vector<float>> wireGroupRotCol2Z{treeReader, "wireGroupRotLinearCol2Z"};
377 
378  TTreeReaderValue<std::vector<float>> wireGroupRotCol3X{treeReader, "wireGroupRotLinearCol3X"};
379  TTreeReaderValue<std::vector<float>> wireGroupRotCol3Y{treeReader, "wireGroupRotLinearCol3Y"};
380  TTreeReaderValue<std::vector<float>> wireGroupRotCol3Z{treeReader, "wireGroupRotLinearCol3Z"};
381 
382  TTreeReaderValue<std::vector<float>> wireGroupRotTransX{treeReader, "wireGroupRotTranslationX"};
383  TTreeReaderValue<std::vector<float>> wireGroupRotTransY{treeReader, "wireGroupRotTranslationY"};
384  TTreeReaderValue<std::vector<float>> wireGroupRotTransZ{treeReader, "wireGroupRotTranslationZ"};
385 
386  TTreeReaderValue<std::vector<uint8_t>> wireGroupRotGasGap{treeReader, "wireGroupRotGasGap"};
387 
389  TTreeReaderValue<std::vector<float>> padRotCol1X{treeReader, "padRotLinearCol1X"};
390  TTreeReaderValue<std::vector<float>> padRotCol1Y{treeReader, "padRotLinearCol1Y"};
391  TTreeReaderValue<std::vector<float>> padRotCol1Z{treeReader, "padRotLinearCol1Z"};
392 
393  TTreeReaderValue<std::vector<float>> padRotCol2X{treeReader, "padRotLinearCol2X"};
394  TTreeReaderValue<std::vector<float>> padRotCol2Y{treeReader, "padRotLinearCol2Y"};
395  TTreeReaderValue<std::vector<float>> padRotCol2Z{treeReader, "padRotLinearCol2Z"};
396 
397  TTreeReaderValue<std::vector<float>> padRotCol3X{treeReader, "padRotLinearCol3X"};
398  TTreeReaderValue<std::vector<float>> padRotCol3Y{treeReader, "padRotLinearCol3Y"};
399  TTreeReaderValue<std::vector<float>> padRotCol3Z{treeReader, "padRotLinearCol3Z"};
400 
401  TTreeReaderValue<std::vector<float>> padRotTransX{treeReader, "padRotTranslationX"};
402  TTreeReaderValue<std::vector<float>> padRotTransY{treeReader, "padRotTranslationY"};
403  TTreeReaderValue<std::vector<float>> padRotTransZ{treeReader, "padRotTranslationZ"};
404 
405  TTreeReaderValue<std::vector<uint8_t>> padRotGasGap{treeReader, "padRotGasGap"};
406 
407  while (treeReader.Next()) {
408  sTgcChamber newchamber{};
409 
411  newchamber.stationIndex = (*stationIndex);
412  newchamber.stationEta = (*stationEta);
413  newchamber.stationPhi = (*stationPhi);
414  newchamber.stationMultilayer = (*stationMultilayer);
415  newchamber.design = (*chamberDesign);
416 
418  newchamber.numLayers = (*numLayers);
419  newchamber.yCutout = (*yCutout);
420  newchamber.gasTck = (*gasTck);
421 
423  newchamber.sGapLength = (*sGapLength);
424  newchamber.lGapLength = (*lGapLength);
425  newchamber.gapHeight = (*gapHeight);
427  newchamber.sChamberLength = (*sChamberLength);
428  newchamber.lChamberLength = (*lChamberLength);
429  newchamber.chamberHeight = (*chamberHeight);
430 
432  newchamber.numWires = (*numWires);
433  newchamber.firstWireGroupWidth = (*firstWireGroupWidth);
434  newchamber.numWireGroups = (*numWireGroups);
435  newchamber.wireCutout = (*wireCutout);
436  newchamber.wirePitch = (*wirePitch);
437  newchamber.wireWidth = (*wireWidth);
438  newchamber.wireGroupWidth = (*wireGroupWidth);
439 
441  newchamber.numStrips = (*numStrips);
442  newchamber.stripPitch = (*stripPitch);
443  newchamber.stripWidth = (*stripWidth);
444 
446  newchamber.sPadLength = (*sPadLength);
447  newchamber.lPadLength = (*lPadLength);
448  newchamber.anglePadPhi = (*anglePadPhi);
449  newchamber.beamlineRadius = (*beamlineRadius);
450  newchamber.numPads = (*numPads);
451  newchamber.numPadEta = (*numPadEta);
452  newchamber.numPadPhi = (*numPadPhi);
453  newchamber.firstPadHeight = (*firstPadHeight);
454  newchamber.padHeight = (*padHeight);
455  newchamber.padPhiShift = (*padPhiShift);
456  newchamber.firstPadPhiDiv = (*firstPadPhiDiv);
457 
458  Amg::Vector3D geoTrans{(*geoModelTransformX)[0], (*geoModelTransformY)[0], (*geoModelTransformZ)[0]};
459  Amg::RotationMatrix3D geoRot{Amg::RotationMatrix3D::Identity()};
460  geoRot.col(0) = Amg::Vector3D((*geoModelTransformX)[1], (*geoModelTransformY)[1], (*geoModelTransformZ)[1]);
461  geoRot.col(1) = Amg::Vector3D((*geoModelTransformX)[2], (*geoModelTransformY)[2], (*geoModelTransformZ)[2]);
462  geoRot.col(2) = Amg::Vector3D((*geoModelTransformX)[3], (*geoModelTransformY)[3], (*geoModelTransformZ)[3]);
463  newchamber.geoModelTransform = Amg::getTransformFromRotTransl(std::move(geoRot), std::move(geoTrans));
464 
465  //WireGroups
466  for (size_t wg = 0; wg < globalWireGroupPosX->size(); ++wg){
467  sTgcChamber::sTgcChannel newWireGroup{};
468  newWireGroup.localPosition = Amg::Vector2D{(*localWireGroupPosX)[wg], (*localWireGroupPosY)[wg]};
469  newWireGroup.globalPosition = Amg::Vector3D{(*globalWireGroupPosX)[wg], (*globalWireGroupPosY)[wg], (*globalWireGroupPosZ)[wg]};
470  newWireGroup.gasGap = (*wireGroupGasGap)[wg];
471  newWireGroup.channelNumber = (*wireGroupNum)[wg];
472  newWireGroup.channelType = 2;
474  if (newWireGroup.channelNumber > 0) continue;
475  newchamber.channels.insert(std::move(newWireGroup));
476  }
477 
478  //Strips Filling in global positions
479  for (size_t s = 0; s < globalStripPosX->size(); ++s){
480  sTgcChamber::sTgcChannel newStrip{};
481  newStrip.localPosition = Amg::Vector2D{(*localStripPosX)[s], (*localStripPosY)[s]};
482  newStrip.globalPosition = Amg::Vector3D{(*globalStripPosX)[s], (*globalStripPosY)[s], (*globalStripPosZ)[s]};
483  newStrip.gasGap = (*stripGasGap)[s];
484  newStrip.channelNumber = (*stripNum)[s];
485  newStrip.channelType = 1;
486  newStrip.channelLen = (*stripLengths)[s];
488  if (newStrip.channelNumber > 0) continue;
489  newchamber.channels.insert(std::move(newStrip));
490  }
491 
492 
493  //Pads
494  for (size_t p = 0; p < globalPadPosX->size(); ++p){
495  sTgcChamber::sTgcPad newPad{};
496 
497  newPad.globalPosition = Amg::Vector3D{(*globalPadPosX)[p], (*globalPadPosY)[p], (*globalPadPosZ)[p]};
498  newPad.globalPadCornerBR = Amg::Vector3D{(*globalPadCornerBRX)[p], (*globalPadCornerBRY)[p], (*globalPadCornerBRZ)[p]};
499  newPad.globalPadCornerBL = Amg::Vector3D{(*globalPadCornerBLX)[p], (*globalPadCornerBLY)[p], (*globalPadCornerBLZ)[p]};
500  newPad.globalPadCornerTR = Amg::Vector3D{(*globalPadCornerTRX)[p], (*globalPadCornerTRY)[p], (*globalPadCornerTRZ)[p]};
501  newPad.globalPadCornerTL = Amg::Vector3D{(*globalPadCornerTLX)[p], (*globalPadCornerTLY)[p], (*globalPadCornerTLZ)[p]};
502 
503  newPad.localPosition = Amg::Vector2D{(*localPadPosX)[p], (*localPadPosY)[p]};
504  newPad.localPadCornerBR = Amg::Vector2D{(*localPadCornerBRX)[p], (*localPadCornerBRY)[p]};
505  newPad.localPadCornerBL = Amg::Vector2D{(*localPadCornerBLX)[p], (*localPadCornerBLY)[p]};
506  newPad.localPadCornerTR = Amg::Vector2D{(*localPadCornerTRX)[p], (*localPadCornerTRY)[p]};
507  newPad.localPadCornerTL = Amg::Vector2D{(*localPadCornerTLX)[p], (*localPadCornerTLY)[p]};
508 
509  newPad.hitPosition = Amg::Vector2D{(*hitPositionX)[p], (*hitPositionY)[p]};
510  newPad.padNumber = (*padNumber)[p];
511  newPad.gasGap = (*padGasGap)[p];
512  newPad.padEta = (*padEta)[p];
513  newPad.padPhi = (*padPhi)[p];
515  if (newPad.padEta > 1 || newPad.padPhi > 6) continue;
516  newchamber.pads.insert(std::move(newPad));
517  }
518 
519  for (size_t l = 0; l < stripRotGasGap->size(); ++l){
520  sTgcChamber::sTgcLayer stripLayer{};
521  stripLayer.gasGap = (*stripRotGasGap)[l];
522  Amg::RotationMatrix3D stripRot{Amg::RotationMatrix3D::Identity()};
523  stripRot.col(0) = Amg::Vector3D((*stripRotCol1X)[l],(*stripRotCol1Y)[l], (*stripRotCol1Z)[l]);
524  stripRot.col(1) = Amg::Vector3D((*stripRotCol2X)[l],(*stripRotCol2Y)[l], (*stripRotCol2Z)[l]);
525  stripRot.col(2) = Amg::Vector3D((*stripRotCol3X)[l],(*stripRotCol3Y)[l], (*stripRotCol3Z)[l]);
526  Amg::Vector3D layTrans{(*stripRotTransX)[l], (*stripRotTransY)[l], (*stripRotTransZ)[l]};
527  stripLayer.transform = Amg::getTransformFromRotTransl(std::move(stripRot), std::move(layTrans));
528  newchamber.layers.insert(std::move(stripLayer));
529  }
530 
531  for (size_t l = 0; l < wireGroupRotGasGap->size(); ++l){
532  sTgcChamber::sTgcLayer wireGroupLayer{};
533  wireGroupLayer.gasGap = (*wireGroupRotGasGap)[l];
534  Amg::RotationMatrix3D wireGroupRot{Amg::RotationMatrix3D::Identity()};
535  wireGroupRot.col(0) = Amg::Vector3D((*wireGroupRotCol1X)[l],(*wireGroupRotCol1Y)[l], (*wireGroupRotCol1Z)[l]);
536  wireGroupRot.col(1) = Amg::Vector3D((*wireGroupRotCol2X)[l],(*wireGroupRotCol2Y)[l], (*wireGroupRotCol2Z)[l]);
537  wireGroupRot.col(2) = Amg::Vector3D((*wireGroupRotCol3X)[l],(*wireGroupRotCol3Y)[l], (*wireGroupRotCol3Z)[l]);
538  Amg::Vector3D layTrans{(*wireGroupRotTransX)[l], (*wireGroupRotTransY)[l], (*wireGroupRotTransZ)[l]};
539  wireGroupLayer.transform = Amg::getTransformFromRotTransl(std::move(wireGroupRot), std::move(layTrans));
540  newchamber.layers.insert(std::move(wireGroupLayer));
541  }
542 
543  for (size_t l = 0; l < padRotGasGap->size(); ++l){
544  sTgcChamber::sTgcLayer padLayer{};
545  padLayer.gasGap = (*padRotGasGap)[l];
546  Amg::RotationMatrix3D padRot{Amg::RotationMatrix3D::Identity()};
547  padRot.col(0) = Amg::Vector3D((*padRotCol1X)[l],(*padRotCol1Y)[l], (*padRotCol1Z)[l]);
548  padRot.col(1) = Amg::Vector3D((*padRotCol2X)[l],(*padRotCol2Y)[l], (*padRotCol2Z)[l]);
549  padRot.col(2) = Amg::Vector3D((*padRotCol3X)[l],(*padRotCol3Y)[l], (*padRotCol3Z)[l]);
550  Amg::Vector3D layTrans{(*padRotTransX)[l], (*padRotTransY)[l], (*padRotTransZ)[l]};
551  padLayer.transform = Amg::getTransformFromRotTransl(std::move(padRot), std::move(layTrans));
552  newchamber.layers.insert(std::move(padLayer));
553  }
554 
555  auto insert_itr = to_ret.insert(std::move(newchamber));
556  if (!insert_itr.second) {
557  std::stringstream err{};
558  err<<__FILE__<<":"<<__LINE__<<" The chamber "<<(*insert_itr.first).stationIndex
559  <<" has already been inserted. "<<std::endl;
560  throw std::runtime_error(err.str());
561  }
562  }
563  std::cout<<"File parsing is finished. Found in total "<<to_ret.size()<<" readout element dumps "<<std::endl;
564  return to_ret;
565 }

Variable Documentation

◆ tolerance

constexpr double tolerance = 100.*Gaudi::Units::micrometer
constexpr

Definition at line 31 of file runsTgcGeoComparison.cxx.

Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:129
sTgcChamber::sTgcLayer
Helper struct to assess that the layers are properly oriented.
Definition: runsTgcGeoComparison.cxx:159
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CxxUtils::starts_with
bool starts_with(const char *s, const char *prefix)
Test whether one null-terminated byte string starts with another.
PathResolver::FindCalibFile
static std::string FindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.h:108
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
readTreeDump
std::set< sTgcChamber > readTreeDump(const std::string &inputFile)
Definition: runsTgcGeoComparison.cxx:221
makeTOC.inFile
string inFile
Definition: makeTOC.py:5
sTgcChamber::sTgcPad::globalPadCornerBL
Amg::Vector3D globalPadCornerBL
global pad corner positions
Definition: runsTgcGeoComparison.cxx:135
sTgcChamber::sTgcPad::localPadCornerBR
Amg::Vector2D localPadCornerBR
Definition: runsTgcGeoComparison.cxx:131
TEST_BASICPROP
#define TEST_BASICPROP(attribute, propName)
Definition: runsTgcGeoComparison.cxx:567
plotIsoValidation.treeReader
treeReader
Definition: plotIsoValidation.py:127
sTgcChamber::sTgcPad
Definition: runsTgcGeoComparison.cxx:124
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
reference
Definition: hcg.cxx:437
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:144
LArCellConditions.argv
argv
Definition: LArCellConditions.py:112
sTgcChamber::sTgcPad::localPadCornerBL
Amg::Vector2D localPadCornerBL
local pad corner positions
Definition: runsTgcGeoComparison.cxx:130
sTgcChamber::sTgcPad::padEta
short padEta
Pad Eta number.
Definition: runsTgcGeoComparison.cxx:144
sTgcChamber::sTgcPad::padPhi
short padPhi
Pad Phi number.
Definition: runsTgcGeoComparison.cxx:146
sTgcChamber::sTgcPad::gasGap
unsigned int gasGap
Gas gap of the Pad.
Definition: runsTgcGeoComparison.cxx:148
sTgcChamber::sTgcPad::localPadCornerTR
Amg::Vector2D localPadCornerTR
Definition: runsTgcGeoComparison.cxx:133
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
sTgcChamber::design
std::string design
Definition: runsTgcGeoComparison.cxx:44
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
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:338
sTgcChamber::sTgcPad::localPosition
Amg::Vector2D localPosition
local pad postion
Definition: runsTgcGeoComparison.cxx:126
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
sTgcChamber::sTgcPad::globalPadCornerBR
Amg::Vector3D globalPadCornerBR
Definition: runsTgcGeoComparison.cxx:136
L1CaloPhase1Monitoring.propName
propName
Definition: L1CaloPhase1Monitoring.py:349
sTgcChamber::sTgcPad::globalPadCornerTL
Amg::Vector3D globalPadCornerTL
Definition: runsTgcGeoComparison.cxx:137
sTgcChamber
Helper struct to represent a full sTgc chamber.
Definition: runsTgcGeoComparison.cxx:34
sTgcChamber::sTgcChannel
Definition: runsTgcGeoComparison.cxx:87
HI::TowerBins::numLayers
constexpr unsigned int numLayers()
Definition: HIEventDefs.h:23
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
sTgcChamber::sTgcPad::localPadCornerTL
Amg::Vector2D localPadCornerTL
Definition: runsTgcGeoComparison.cxx:132
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
sTgcChamber::stationIndex
int stationIndex
Definition: runsTgcGeoComparison.cxx:40
sTgcChamber::stationName
std::string stationName
Definition: runsTgcGeoComparison.cxx:39
CscCalibQuery.testFile
testFile
Definition: CscCalibQuery.py:274
sTgcChamber::sTgcLayer::gasGap
unsigned int gasGap
Gas gap number of the layer.
Definition: runsTgcGeoComparison.cxx:161
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:127
sTgcChamber::sTgcPad::globalPosition
Amg::Vector3D globalPosition
global pad postion
Definition: runsTgcGeoComparison.cxx:128
sTgcChamber::sTgcChannel::localPosition
Amg::Vector2D localPosition
local strip postion
Definition: runsTgcGeoComparison.cxx:89
python.compressB64.c
def c
Definition: compressB64.py:93
sTgcChamber::sTgcPad::globalPadCornerTR
Amg::Vector3D globalPadCornerTR
Definition: runsTgcGeoComparison.cxx:138