ATLAS Offline Software
runsTgcGeoComparison.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 */
14 #include <GaudiKernel/SystemOfUnits.h>
16 #include <string>
17 #include <set>
18 #include <vector>
19 #include <map>
20 #include <iostream>
21 #include <cmath>
22 
24 #include <TFile.h>
25 #include <TTreeReader.h>
26 
27 using namespace MuonGMR4;
28 using namespace ActsTrk;
29 
30 constexpr double tolerance = 100.*Gaudi::Units::micrometer;
31 
33 struct sTgcChamber{
35  sTgcChamber() = default;
36 
38  std::string stationName{};
39  int stationIndex{0};
40  int stationEta{0};
41  int stationPhi{0};
42  int stationMultilayer{0};
43  std::string design{};
44 
46  bool operator<(const sTgcChamber& other) const {
47  if (stationIndex != other.stationIndex) return stationIndex < other.stationIndex;
48  if (stationEta != other.stationEta) return stationEta < other.stationEta;
49  if (stationPhi != other.stationPhi) return stationPhi < other.stationPhi;
50  return stationMultilayer < other.stationMultilayer;
51  }
52 
54  Amg::Transform3D geoModelTransform{Amg::Transform3D::Identity()};
55 
57  unsigned int numLayers{0};
58  double yCutout{0.f};
59  double gasTck{0.f};
60 
62  double sChamberLength{0.f};
63  double lChamberLength{0.f};
64  double chamberHeight{0.f};
65  double sGapLength{0.f};
66  double lGapLength{0.f};
67  double gapHeight{0.f};
68 
69 
71  std::vector<unsigned int> numWires;
72  std::vector<uint> firstWireGroupWidth;
73  std::vector<uint> numWireGroups;
74  std::vector<float> wireCutout;
75  double wirePitch{0.f};
76  double wireWidth{0.f};
77  uint wireGroupWidth{0};
78 
80  unsigned int numStrips{0};
81  double stripPitch{0.f};
82  double stripWidth{0.f};
83  std::vector<float> firstStripPitch;
84 
86  struct sTgcChannel{
92  unsigned int channelNumber{0};
94  unsigned int gasGap{0};
96  unsigned int channelType{0};
98  double channelLen{0};
100  bool operator<(const sTgcChannel& other) const {
101  if (gasGap != other.gasGap) return gasGap < other.gasGap;
102  if (channelType != other.channelType) return channelType < other.channelType;
103  return channelNumber < other.channelNumber;
104  }
105  };
106 
108  double sPadLength{0.f};
109  double lPadLength{0.f};
110  double anglePadPhi{0.f};
111  double beamlineRadius{0.f};
112 
113  std::vector<int> padNumber;
114  std::vector<uint> numPads;
115  std::vector<uint> numPadEta;
116  std::vector<uint> numPadPhi;
117  std::vector<float> firstPadHeight;
118  std::vector<float> padHeight;
119  std::vector<float> padPhiShift;
120  std::vector<float> firstPadPhiDiv;
121 
123  struct sTgcPad{
129  Amg::Vector2D localPadCornerBL{Amg::Vector2D::Zero()};
130  Amg::Vector2D localPadCornerBR{Amg::Vector2D::Zero()};
131  Amg::Vector2D localPadCornerTL{Amg::Vector2D::Zero()};
132  Amg::Vector2D localPadCornerTR{Amg::Vector2D::Zero()};
134  Amg::Vector3D globalPadCornerBL{Amg::Vector3D::Zero()};
135  Amg::Vector3D globalPadCornerBR{Amg::Vector3D::Zero()};
136  Amg::Vector3D globalPadCornerTL{Amg::Vector3D::Zero()};
137  Amg::Vector3D globalPadCornerTR{Amg::Vector3D::Zero()};
141  int padNumber{0};
143  short padEta{0};
145  short padPhi{0};
147  unsigned int gasGap{0};
148 
150  bool operator<(const sTgcPad& other) const {
151  if (gasGap != other.gasGap) return gasGap < other.gasGap;
152  if (padPhi != other.padPhi) return padPhi < other.padPhi;
153  return padEta < other.padEta;
154  }
155  };
156 
158  struct sTgcLayer {
160  unsigned int gasGap{0};
162  Amg::Transform3D transform{Amg::Transform3D::Identity()};
164  bool operator<(const sTgcLayer& other) const {
165  return gasGap < other.gasGap;
166  }
167  };
168  std::set<sTgcChannel> channels{};
169  std::set<sTgcPad> pads{};
170  std::set<sTgcLayer> layers{};
171 
172 };
173 
174 
177 std::ostream& operator<<(std::ostream& ostr, const sTgcChamber& chamb) {
178  static const std::map<int, std::string> stationDict{
179  {57, "STS"}, {58, "STL"}
180  };
181  ostr<<"sTgc chamber "<<stationDict.at(chamb.stationIndex)<<"("<<chamb.design<<") "<<chamb.stationName;
182  return ostr;
183 }
184 
185 std::ostream& operator<<(std::ostream& ostr,const sTgcChamber::sTgcChannel & channel) {
186  ostr<<"channel (gasGap/number): ";
187  ostr<<channel.gasGap<<"/";
188  ostr<<channel.channelNumber<<", ";
189  ostr<<channel.channelType<<", ";
190  ostr<<" global Position: "<<Amg::toString(channel.globalPosition, 2)<<", ";
191  ostr<<" local Position: "<<Amg::toString(channel.localPosition, 2);
192  return ostr;
193 }
194 
195 std::ostream& operator<<(std::ostream& ostr,const sTgcChamber::sTgcPad & pad) {
196  ostr<<"pad (gasGap/padEta/padPhi): ";
197  ostr<<pad.gasGap<<"/";
198  ostr<<pad.padEta<<"/"<<pad.padPhi<<", ";
199  ostr<<"global position: "<<Amg::toString(pad.globalPosition, 2);
200  ostr<<"Bottom-left globalPadCorner: "<<Amg::toString(pad.globalPadCornerBL, 2);
201  ostr<<"Bottom-right globalpadCorner: "<<Amg::toString(pad.globalPadCornerBR, 2);
202  ostr<<"Top-left globalpadCorner: "<<Amg::toString(pad.globalPadCornerTL, 2);
203  ostr<<"Top-right globalpadCorner: "<<Amg::toString(pad.globalPadCornerTR, 2);
204 
205  ostr<<"local position: "<<Amg::toString(pad.localPosition, 2);
206  ostr<<"Bottom-left localPadCorner: "<<Amg::toString(pad.localPadCornerBL, 2);
207  ostr<<"Bottom-right localpadCorner: "<<Amg::toString(pad.localPadCornerBR, 2);
208  ostr<<"Top-left localpadCorner: "<<Amg::toString(pad.localPadCornerTL, 2);
209  ostr<<"Top-right localpadCorner: "<<Amg::toString(pad.localPadCornerTR, 2);
210  return ostr;
211 }
212 
213 std::ostream& operator<<(std::ostream& ostr,const sTgcChamber::sTgcLayer & layer) {
214  ostr<<"stgclayer (gasGap/channelType): ";
215  ostr<<layer.gasGap<<", ";
216  ostr<<"transform: "<<Amg::toString(layer.transform);
217  return ostr;
218 }
219 
220 std::set<sTgcChamber> readTreeDump(const std::string& inputFile) {
221  std::set<sTgcChamber> to_ret{};
222  std::cout<<"Read the sTgc geometry tree dump from "<<inputFile<<std::endl;
223  std::unique_ptr<TFile> inFile{TFile::Open(inputFile.c_str())};
224  if (!inFile || !inFile->IsOpen()) {
225  std::cerr<<__FILE__<<":"<<__LINE__<<" Failed to open "<<inputFile<<std::endl;
226  return to_ret;
227  }
228  TTreeReader treeReader("sTgcGeoModelTree", inFile.get());
229  if (treeReader.IsInvalid()){
230  std::cerr<<__FILE__<<":"<<__LINE__<<" The file "<<inputFile<<" does not contain the 'sTgcGeoModelTree'"<<std::endl;
231  return to_ret;
232  }
233 
235  TTreeReaderValue<short> stationIndex{treeReader, "stationIndex"};
236  TTreeReaderValue<short> stationEta{treeReader, "stationEta"};
237  TTreeReaderValue<short> stationPhi{treeReader, "stationPhi"};
238  TTreeReaderValue<short> stationMultilayer{treeReader, "stationMultilayer"};
239  TTreeReaderValue<std::string> chamberDesign{treeReader,"chamberDesign"};
240 
242  TTreeReaderValue<short> numLayers{treeReader, "numLayers"};
243  TTreeReaderValue<float> yCutout{treeReader, "yCutout"};
244  TTreeReaderValue<float> gasTck{treeReader, "gasTck"};
246  TTreeReaderValue<float> sChamberLength{treeReader, "sChamberLength"};
247  TTreeReaderValue<float> lChamberLength{treeReader, "lChamberLength"};
248  TTreeReaderValue<float> chamberHeight{treeReader, "chamberHeight"};
250  TTreeReaderValue<float> sGapLength{treeReader, "sGapLength"};
251  TTreeReaderValue<float> lGapLength{treeReader, "lGapLength"};
252  TTreeReaderValue<float> gapHeight{treeReader, "gapHeight"};
253 
255  TTreeReaderValue<std::vector<uint>> numWires{treeReader, "numWires"};
256  TTreeReaderValue<std::vector<uint>> firstWireGroupWidth{treeReader, "firstWireGroupWidth"};
257  TTreeReaderValue<std::vector<uint>> numWireGroups{treeReader, "numWireGroups"};
258  TTreeReaderValue<std::vector<float>> wireCutout{treeReader, "wireCutout"};
259  TTreeReaderValue<float> wirePitch{treeReader, "wirePitch"};
260  TTreeReaderValue<float> wireWidth{treeReader, "wireWidth"};
261  TTreeReaderValue<uint> wireGroupWidth{treeReader, "wireGroupWidth"};
262 
263  TTreeReaderValue<std::vector<float>> globalWireGroupPosX{treeReader, "globalWireGroupPosX"};
264  TTreeReaderValue<std::vector<float>> globalWireGroupPosY{treeReader, "globalWireGroupPosY"};
265  TTreeReaderValue<std::vector<float>> globalWireGroupPosZ{treeReader, "globalWireGroupPosZ"};
266 
267  TTreeReaderValue<std::vector<float>> localWireGroupPosX{treeReader, "localWireGroupPosX"};
268  TTreeReaderValue<std::vector<float>> localWireGroupPosY{treeReader, "localWireGroupPosY"};
269 
270  TTreeReaderValue<std::vector<uint8_t>> wireGroupNum{treeReader, "wireGroupNum"};
271  TTreeReaderValue<std::vector<uint8_t>> wireGroupGasGap{treeReader, "wireGroupGasGap"};
272 
274  TTreeReaderValue<uint> numStrips{treeReader, "numStrips"};
275  TTreeReaderValue<float> stripPitch{treeReader, "stripPitch"};
276  TTreeReaderValue<float> stripWidth{treeReader, "stripWidth"};
277 
278  TTreeReaderValue<std::vector<float>> globalStripPosX{treeReader, "globalStripPosX"};
279  TTreeReaderValue<std::vector<float>> globalStripPosY{treeReader, "globalStripPosY"};
280  TTreeReaderValue<std::vector<float>> globalStripPosZ{treeReader, "globalStripPosZ"};
281 
282  TTreeReaderValue<std::vector<float>> localStripPosX{treeReader, "localStripPosX"};
283  TTreeReaderValue<std::vector<float>> localStripPosY{treeReader, "localStripPosY"};
284 
285  TTreeReaderValue<std::vector<uint>> stripNum{treeReader, "stripNumber"};
286  TTreeReaderValue<std::vector<uint8_t>> stripGasGap{treeReader, "stripGasGap"};
287  TTreeReaderValue<std::vector<float>> stripLengths{treeReader, "stripLengths"};
288 
290  TTreeReaderValue<float> sPadLength{treeReader, "sPadLength"};
291  TTreeReaderValue<float> lPadLength{treeReader, "lPadLength"};
292  TTreeReaderValue<float> anglePadPhi{treeReader, "anglePadPhi"};
293  TTreeReaderValue<float> beamlineRadius{treeReader, "beamlineRadius"};
294  TTreeReaderValue<std::vector<uint>> numPads{treeReader, "numPads"};
295  TTreeReaderValue<std::vector<uint>> numPadEta{treeReader, "numPadEta"};
296  TTreeReaderValue<std::vector<uint>> numPadPhi{treeReader, "numPadPhi"};
297  TTreeReaderValue<std::vector<float>> firstPadHeight{treeReader, "firstPadHeight"};
298  TTreeReaderValue<std::vector<float>> padHeight{treeReader, "padHeight"};
299  TTreeReaderValue<std::vector<float>> padPhiShift{treeReader, "padPhiShift"};
300  TTreeReaderValue<std::vector<float>> firstPadPhiDiv{treeReader, "firstPadPhiDiv"};
301 
302  TTreeReaderValue<std::vector<float>> globalPadCornerBRX{treeReader, "globalPadCornerBRX"};
303  TTreeReaderValue<std::vector<float>> globalPadCornerBRY{treeReader, "globalPadCornerBRY"};
304  TTreeReaderValue<std::vector<float>> globalPadCornerBRZ{treeReader, "globalPadCornerBRZ"};
305 
306  TTreeReaderValue<std::vector<float>> globalPadCornerBLX{treeReader, "globalPadCornerBLX"};
307  TTreeReaderValue<std::vector<float>> globalPadCornerBLY{treeReader, "globalPadCornerBLY"};
308  TTreeReaderValue<std::vector<float>> globalPadCornerBLZ{treeReader, "globalPadCornerBLZ"};
309 
310  TTreeReaderValue<std::vector<float>> globalPadCornerTRX{treeReader, "globalPadCornerTRX"};
311  TTreeReaderValue<std::vector<float>> globalPadCornerTRY{treeReader, "globalPadCornerTRY"};
312  TTreeReaderValue<std::vector<float>> globalPadCornerTRZ{treeReader, "globalPadCornerTRZ"};
313 
314  TTreeReaderValue<std::vector<float>> globalPadCornerTLX{treeReader, "globalPadCornerTLX"};
315  TTreeReaderValue<std::vector<float>> globalPadCornerTLY{treeReader, "globalPadCornerTLY"};
316  TTreeReaderValue<std::vector<float>> globalPadCornerTLZ{treeReader, "globalPadCornerTLZ"};
317 
318  TTreeReaderValue<std::vector<float>> globalPadPosX{treeReader, "globalPadPosX"};
319  TTreeReaderValue<std::vector<float>> globalPadPosY{treeReader, "globalPadPosY"};
320  TTreeReaderValue<std::vector<float>> globalPadPosZ{treeReader, "globalPadPosZ"};
321 
322  TTreeReaderValue<std::vector<float>> localPadCornerBRX{treeReader, "localPadCornerBRX"};
323  TTreeReaderValue<std::vector<float>> localPadCornerBRY{treeReader, "localPadCornerBRY"};
324 
325  TTreeReaderValue<std::vector<float>> localPadCornerBLX{treeReader, "localPadCornerBLX"};
326  TTreeReaderValue<std::vector<float>> localPadCornerBLY{treeReader, "localPadCornerBLY"};
327 
328  TTreeReaderValue<std::vector<float>> localPadCornerTRX{treeReader, "localPadCornerTRX"};
329  TTreeReaderValue<std::vector<float>> localPadCornerTRY{treeReader, "localPadCornerTRY"};
330 
331  TTreeReaderValue<std::vector<float>> localPadCornerTLX{treeReader, "localPadCornerTLX"};
332  TTreeReaderValue<std::vector<float>> localPadCornerTLY{treeReader, "localPadCornerTLY"};
333 
334  TTreeReaderValue<std::vector<float>> localPadPosX{treeReader, "localPadPosX"};
335  TTreeReaderValue<std::vector<float>> localPadPosY{treeReader, "localPadPosY"};
336 
337  TTreeReaderValue<std::vector<float>> hitPositionX{treeReader, "hitPositionX"};
338  TTreeReaderValue<std::vector<float>> hitPositionY{treeReader, "hitPositionY"};
339  TTreeReaderValue<std::vector<int>> padNumber{treeReader, "padNumber"};
340 
341  TTreeReaderValue<std::vector<uint8_t>> padGasGap{treeReader, "padGasGap"};
342  TTreeReaderValue<std::vector<uint>> padEta{treeReader, "padEtaNumber"};
343  TTreeReaderValue<std::vector<uint>> padPhi{treeReader, "padPhiNumber"};
344 
346  TTreeReaderValue<std::vector<float>> geoModelTransformX{treeReader, "GeoModelTransformX"};
347  TTreeReaderValue<std::vector<float>> geoModelTransformY{treeReader, "GeoModelTransformY"};
348  TTreeReaderValue<std::vector<float>> geoModelTransformZ{treeReader, "GeoModelTransformZ"};
350  TTreeReaderValue<std::vector<float>> stripRotCol1X{treeReader, "stripRotLinearCol1X"};
351  TTreeReaderValue<std::vector<float>> stripRotCol1Y{treeReader, "stripRotLinearCol1Y"};
352  TTreeReaderValue<std::vector<float>> stripRotCol1Z{treeReader, "stripRotLinearCol1Z"};
353 
354  TTreeReaderValue<std::vector<float>> stripRotCol2X{treeReader, "stripRotLinearCol2X"};
355  TTreeReaderValue<std::vector<float>> stripRotCol2Y{treeReader, "stripRotLinearCol2Y"};
356  TTreeReaderValue<std::vector<float>> stripRotCol2Z{treeReader, "stripRotLinearCol2Z"};
357 
358  TTreeReaderValue<std::vector<float>> stripRotCol3X{treeReader, "stripRotLinearCol3X"};
359  TTreeReaderValue<std::vector<float>> stripRotCol3Y{treeReader, "stripRotLinearCol3Y"};
360  TTreeReaderValue<std::vector<float>> stripRotCol3Z{treeReader, "stripRotLinearCol3Z"};
361 
362  TTreeReaderValue<std::vector<float>> stripRotTransX{treeReader, "stripRotTranslationX"};
363  TTreeReaderValue<std::vector<float>> stripRotTransY{treeReader, "stripRotTranslationY"};
364  TTreeReaderValue<std::vector<float>> stripRotTransZ{treeReader, "stripRotTranslationZ"};
365 
366  TTreeReaderValue<std::vector<uint8_t>> stripRotGasGap{treeReader, "stripRotGasGap"};
367 
369  TTreeReaderValue<std::vector<float>> wireGroupRotCol1X{treeReader, "wireGroupRotLinearCol1X"};
370  TTreeReaderValue<std::vector<float>> wireGroupRotCol1Y{treeReader, "wireGroupRotLinearCol1Y"};
371  TTreeReaderValue<std::vector<float>> wireGroupRotCol1Z{treeReader, "wireGroupRotLinearCol1Z"};
372 
373  TTreeReaderValue<std::vector<float>> wireGroupRotCol2X{treeReader, "wireGroupRotLinearCol2X"};
374  TTreeReaderValue<std::vector<float>> wireGroupRotCol2Y{treeReader, "wireGroupRotLinearCol2Y"};
375  TTreeReaderValue<std::vector<float>> wireGroupRotCol2Z{treeReader, "wireGroupRotLinearCol2Z"};
376 
377  TTreeReaderValue<std::vector<float>> wireGroupRotCol3X{treeReader, "wireGroupRotLinearCol3X"};
378  TTreeReaderValue<std::vector<float>> wireGroupRotCol3Y{treeReader, "wireGroupRotLinearCol3Y"};
379  TTreeReaderValue<std::vector<float>> wireGroupRotCol3Z{treeReader, "wireGroupRotLinearCol3Z"};
380 
381  TTreeReaderValue<std::vector<float>> wireGroupRotTransX{treeReader, "wireGroupRotTranslationX"};
382  TTreeReaderValue<std::vector<float>> wireGroupRotTransY{treeReader, "wireGroupRotTranslationY"};
383  TTreeReaderValue<std::vector<float>> wireGroupRotTransZ{treeReader, "wireGroupRotTranslationZ"};
384 
385  TTreeReaderValue<std::vector<uint8_t>> wireGroupRotGasGap{treeReader, "wireGroupRotGasGap"};
386 
388  TTreeReaderValue<std::vector<float>> padRotCol1X{treeReader, "padRotLinearCol1X"};
389  TTreeReaderValue<std::vector<float>> padRotCol1Y{treeReader, "padRotLinearCol1Y"};
390  TTreeReaderValue<std::vector<float>> padRotCol1Z{treeReader, "padRotLinearCol1Z"};
391 
392  TTreeReaderValue<std::vector<float>> padRotCol2X{treeReader, "padRotLinearCol2X"};
393  TTreeReaderValue<std::vector<float>> padRotCol2Y{treeReader, "padRotLinearCol2Y"};
394  TTreeReaderValue<std::vector<float>> padRotCol2Z{treeReader, "padRotLinearCol2Z"};
395 
396  TTreeReaderValue<std::vector<float>> padRotCol3X{treeReader, "padRotLinearCol3X"};
397  TTreeReaderValue<std::vector<float>> padRotCol3Y{treeReader, "padRotLinearCol3Y"};
398  TTreeReaderValue<std::vector<float>> padRotCol3Z{treeReader, "padRotLinearCol3Z"};
399 
400  TTreeReaderValue<std::vector<float>> padRotTransX{treeReader, "padRotTranslationX"};
401  TTreeReaderValue<std::vector<float>> padRotTransY{treeReader, "padRotTranslationY"};
402  TTreeReaderValue<std::vector<float>> padRotTransZ{treeReader, "padRotTranslationZ"};
403 
404  TTreeReaderValue<std::vector<uint8_t>> padRotGasGap{treeReader, "padRotGasGap"};
405 
406  while (treeReader.Next()) {
407  sTgcChamber newchamber{};
408 
410  newchamber.stationIndex = (*stationIndex);
411  newchamber.stationEta = (*stationEta);
412  newchamber.stationPhi = (*stationPhi);
413  newchamber.stationMultilayer = (*stationMultilayer);
414  newchamber.design = (*chamberDesign);
415 
417  newchamber.numLayers = (*numLayers);
418  newchamber.yCutout = (*yCutout);
419  newchamber.gasTck = (*gasTck);
420 
422  newchamber.sGapLength = (*sGapLength);
423  newchamber.lGapLength = (*lGapLength);
424  newchamber.gapHeight = (*gapHeight);
426  newchamber.sChamberLength = (*sChamberLength);
427  newchamber.lChamberLength = (*lChamberLength);
428  newchamber.chamberHeight = (*chamberHeight);
429 
431  newchamber.numWires = (*numWires);
432  newchamber.firstWireGroupWidth = (*firstWireGroupWidth);
433  newchamber.numWireGroups = (*numWireGroups);
434  newchamber.wireCutout = (*wireCutout);
435  newchamber.wirePitch = (*wirePitch);
436  newchamber.wireWidth = (*wireWidth);
437  newchamber.wireGroupWidth = (*wireGroupWidth);
438 
440  newchamber.numStrips = (*numStrips);
441  newchamber.stripPitch = (*stripPitch);
442  newchamber.stripWidth = (*stripWidth);
443 
445  newchamber.sPadLength = (*sPadLength);
446  newchamber.lPadLength = (*lPadLength);
447  newchamber.anglePadPhi = (*anglePadPhi);
448  newchamber.beamlineRadius = (*beamlineRadius);
449  newchamber.numPads = (*numPads);
450  newchamber.numPadEta = (*numPadEta);
451  newchamber.numPadPhi = (*numPadPhi);
452  newchamber.firstPadHeight = (*firstPadHeight);
453  newchamber.padHeight = (*padHeight);
454  newchamber.padPhiShift = (*padPhiShift);
455  newchamber.firstPadPhiDiv = (*firstPadPhiDiv);
456 
457  Amg::Vector3D geoTrans{(*geoModelTransformX)[0], (*geoModelTransformY)[0], (*geoModelTransformZ)[0]};
458  Amg::RotationMatrix3D geoRot{Amg::RotationMatrix3D::Identity()};
459  geoRot.col(0) = Amg::Vector3D((*geoModelTransformX)[1], (*geoModelTransformY)[1], (*geoModelTransformZ)[1]);
460  geoRot.col(1) = Amg::Vector3D((*geoModelTransformX)[2], (*geoModelTransformY)[2], (*geoModelTransformZ)[2]);
461  geoRot.col(2) = Amg::Vector3D((*geoModelTransformX)[3], (*geoModelTransformY)[3], (*geoModelTransformZ)[3]);
462  newchamber.geoModelTransform = Amg::getTransformFromRotTransl(std::move(geoRot), std::move(geoTrans));
463 
464  //WireGroups
465  for (size_t wg = 0; wg < globalWireGroupPosX->size(); ++wg){
466  sTgcChamber::sTgcChannel newWireGroup{};
467  newWireGroup.localPosition = Amg::Vector2D{(*localWireGroupPosX)[wg], (*localWireGroupPosY)[wg]};
468  newWireGroup.globalPosition = Amg::Vector3D{(*globalWireGroupPosX)[wg], (*globalWireGroupPosY)[wg], (*globalWireGroupPosZ)[wg]};
469  newWireGroup.gasGap = (*wireGroupGasGap)[wg];
470  newWireGroup.channelNumber = (*wireGroupNum)[wg];
471  newWireGroup.channelType = 2;
473  if (newWireGroup.channelNumber > 0) continue;
474  newchamber.channels.insert(std::move(newWireGroup));
475  }
476 
477  //Strips Filling in global positions
478  for (size_t s = 0; s < globalStripPosX->size(); ++s){
479  sTgcChamber::sTgcChannel newStrip{};
480  newStrip.localPosition = Amg::Vector2D{(*localStripPosX)[s], (*localStripPosY)[s]};
481  newStrip.globalPosition = Amg::Vector3D{(*globalStripPosX)[s], (*globalStripPosY)[s], (*globalStripPosZ)[s]};
482  newStrip.gasGap = (*stripGasGap)[s];
483  newStrip.channelNumber = (*stripNum)[s];
484  newStrip.channelType = 1;
485  newStrip.channelLen = (*stripLengths)[s];
487  if (newStrip.channelNumber > 0) continue;
488  newchamber.channels.insert(std::move(newStrip));
489  }
490 
491 
492  //Pads
493  for (size_t p = 0; p < globalPadPosX->size(); ++p){
494  sTgcChamber::sTgcPad newPad{};
495 
496  newPad.globalPosition = Amg::Vector3D{(*globalPadPosX)[p], (*globalPadPosY)[p], (*globalPadPosZ)[p]};
497  newPad.globalPadCornerBR = Amg::Vector3D{(*globalPadCornerBRX)[p], (*globalPadCornerBRY)[p], (*globalPadCornerBRZ)[p]};
498  newPad.globalPadCornerBL = Amg::Vector3D{(*globalPadCornerBLX)[p], (*globalPadCornerBLY)[p], (*globalPadCornerBLZ)[p]};
499  newPad.globalPadCornerTR = Amg::Vector3D{(*globalPadCornerTRX)[p], (*globalPadCornerTRY)[p], (*globalPadCornerTRZ)[p]};
500  newPad.globalPadCornerTL = Amg::Vector3D{(*globalPadCornerTLX)[p], (*globalPadCornerTLY)[p], (*globalPadCornerTLZ)[p]};
501 
502  newPad.localPosition = Amg::Vector2D{(*localPadPosX)[p], (*localPadPosY)[p]};
503  newPad.localPadCornerBR = Amg::Vector2D{(*localPadCornerBRX)[p], (*localPadCornerBRY)[p]};
504  newPad.localPadCornerBL = Amg::Vector2D{(*localPadCornerBLX)[p], (*localPadCornerBLY)[p]};
505  newPad.localPadCornerTR = Amg::Vector2D{(*localPadCornerTRX)[p], (*localPadCornerTRY)[p]};
506  newPad.localPadCornerTL = Amg::Vector2D{(*localPadCornerTLX)[p], (*localPadCornerTLY)[p]};
507 
508  newPad.hitPosition = Amg::Vector2D{(*hitPositionX)[p], (*hitPositionY)[p]};
509  newPad.padNumber = (*padNumber)[p];
510  newPad.gasGap = (*padGasGap)[p];
511  newPad.padEta = (*padEta)[p];
512  newPad.padPhi = (*padPhi)[p];
514  if (newPad.padEta > 1 || newPad.padPhi > 6) continue;
515  newchamber.pads.insert(std::move(newPad));
516  }
517 
518  for (size_t l = 0; l < stripRotGasGap->size(); ++l){
519  sTgcChamber::sTgcLayer stripLayer{};
520  stripLayer.gasGap = (*stripRotGasGap)[l];
521  Amg::RotationMatrix3D stripRot{Amg::RotationMatrix3D::Identity()};
522  stripRot.col(0) = Amg::Vector3D((*stripRotCol1X)[l],(*stripRotCol1Y)[l], (*stripRotCol1Z)[l]);
523  stripRot.col(1) = Amg::Vector3D((*stripRotCol2X)[l],(*stripRotCol2Y)[l], (*stripRotCol2Z)[l]);
524  stripRot.col(2) = Amg::Vector3D((*stripRotCol3X)[l],(*stripRotCol3Y)[l], (*stripRotCol3Z)[l]);
525  Amg::Vector3D layTrans{(*stripRotTransX)[l], (*stripRotTransY)[l], (*stripRotTransZ)[l]};
526  stripLayer.transform = Amg::getTransformFromRotTransl(std::move(stripRot), std::move(layTrans));
527  newchamber.layers.insert(std::move(stripLayer));
528  }
529 
530  for (size_t l = 0; l < wireGroupRotGasGap->size(); ++l){
531  sTgcChamber::sTgcLayer wireGroupLayer{};
532  wireGroupLayer.gasGap = (*wireGroupRotGasGap)[l];
533  Amg::RotationMatrix3D wireGroupRot{Amg::RotationMatrix3D::Identity()};
534  wireGroupRot.col(0) = Amg::Vector3D((*wireGroupRotCol1X)[l],(*wireGroupRotCol1Y)[l], (*wireGroupRotCol1Z)[l]);
535  wireGroupRot.col(1) = Amg::Vector3D((*wireGroupRotCol2X)[l],(*wireGroupRotCol2Y)[l], (*wireGroupRotCol2Z)[l]);
536  wireGroupRot.col(2) = Amg::Vector3D((*wireGroupRotCol3X)[l],(*wireGroupRotCol3Y)[l], (*wireGroupRotCol3Z)[l]);
537  Amg::Vector3D layTrans{(*wireGroupRotTransX)[l], (*wireGroupRotTransY)[l], (*wireGroupRotTransZ)[l]};
538  wireGroupLayer.transform = Amg::getTransformFromRotTransl(std::move(wireGroupRot), std::move(layTrans));
539  newchamber.layers.insert(std::move(wireGroupLayer));
540  }
541 
542  for (size_t l = 0; l < padRotGasGap->size(); ++l){
543  sTgcChamber::sTgcLayer padLayer{};
544  padLayer.gasGap = (*padRotGasGap)[l];
545  Amg::RotationMatrix3D padRot{Amg::RotationMatrix3D::Identity()};
546  padRot.col(0) = Amg::Vector3D((*padRotCol1X)[l],(*padRotCol1Y)[l], (*padRotCol1Z)[l]);
547  padRot.col(1) = Amg::Vector3D((*padRotCol2X)[l],(*padRotCol2Y)[l], (*padRotCol2Z)[l]);
548  padRot.col(2) = Amg::Vector3D((*padRotCol3X)[l],(*padRotCol3Y)[l], (*padRotCol3Z)[l]);
549  Amg::Vector3D layTrans{(*padRotTransX)[l], (*padRotTransY)[l], (*padRotTransZ)[l]};
550  padLayer.transform = Amg::getTransformFromRotTransl(std::move(padRot), std::move(layTrans));
551  newchamber.layers.insert(std::move(padLayer));
552  }
553 
554  auto insert_itr = to_ret.insert(std::move(newchamber));
555  if (!insert_itr.second) {
556  std::stringstream err{};
557  err<<__FILE__<<":"<<__LINE__<<" The chamber "<<(*insert_itr.first).stationIndex
558  <<" has already been inserted. "<<std::endl;
559  throw std::runtime_error(err.str());
560  }
561  }
562  std::cout<<"File parsing is finished. Found in total "<<to_ret.size()<<" readout element dumps "<<std::endl;
563  return to_ret;
564 }
565 
566 #define TEST_BASICPROP(attribute, propName) \
567  if (std::abs(1.*test.attribute - 1.*reference.attribute) > tolerance) { \
568  std::cerr<<"sTgcGeoModelComparison() "<<__LINE__<<": The chamber "<<reference \
569  <<" differs w.r.t "<<propName<<" "<< reference.attribute \
570  <<" (ref) vs. " <<test.attribute << " (test)" << std::endl; \
571  chamberOkay = false; \
572  }
573 
574 int main( int argc, char** argv ) {
575  std::string refFile{}, testFile{};
576 
577  for (int arg = 1; arg < argc; ++arg) {
578  std::string the_arg{argv[arg]};
579  if (the_arg == "--refFile" && arg +1 < argc) {
580  refFile = std::string{argv[arg+1]};
581  ++arg;
582  } else if (the_arg == "--testFile" && arg + 1 < argc) {
583  testFile = std::string{argv[arg+1]};
584  ++arg;
585  }
586  }
587  if (refFile.empty()) {
588  std::cerr<<"Please parse the path of the reference file via --refFile "<<std::endl;
589  return EXIT_FAILURE;
590  }
591  if (testFile.empty()) {
592  std::cerr<<"Please parse the path of the test file via --testFile "<<std::endl;
593  return EXIT_FAILURE;
594  }
596  if (!refFile.starts_with( "root://")) refFile = PathResolver::FindCalibFile(refFile);
597  if (!testFile.starts_with( "root://")) testFile = PathResolver::FindCalibFile(testFile);
599  std::set<sTgcChamber> refChambers = readTreeDump(refFile);
600  if (refChambers.empty()) {
601  std::cerr<<"The file "<<refFile<<" should contain at least one chamber "<<std::endl;
602  return EXIT_FAILURE;
603  }
604  std::set<sTgcChamber> testChambers = readTreeDump(testFile);
605  if (testChambers.empty()) {
606  std::cerr<<"The file "<<testFile<<" should contain at least one chamber "<<std::endl;
607  return EXIT_FAILURE;
608  }
609  int return_code = EXIT_SUCCESS;
611  for (const sTgcChamber& reference : refChambers) {
612  std::set<sTgcChamber>::const_iterator test_itr = testChambers.find(reference);
613 
614  if (test_itr == testChambers.end()) {
615  std::cerr<<"The chamber "<<reference<<" is not part of the testing "<<std::endl;
616  return_code = EXIT_FAILURE;
617  continue;
618  }
619  bool chamberOkay = true;
620  const sTgcChamber& test = {*test_itr};
621 
622  TEST_BASICPROP(numLayers, "number of gas gaps");
623  TEST_BASICPROP(yCutout, "yCutout of the Chamber");
624  TEST_BASICPROP(gasTck, "thickness of the gas gap");
625 
627  TEST_BASICPROP(sChamberLength, "Chamber length on the short side");
628  TEST_BASICPROP(lChamberLength, "Chamber length on the long side");
629  TEST_BASICPROP(chamberHeight, "Chamber height");
630  TEST_BASICPROP(sGapLength, "GasGap length on the short side");
631  TEST_BASICPROP(lGapLength, "GasGap length on the long side");
632  TEST_BASICPROP(gapHeight, "GasGap Height");
633 
634  TEST_BASICPROP(wirePitch, "pitch of a single wire");
635  TEST_BASICPROP(wireWidth, "width of a single wire");
636  TEST_BASICPROP(wireGroupWidth, "number of wires in a normal wiregroup");
637 
638  TEST_BASICPROP(numStrips, "number of strips in a chamber");
639  TEST_BASICPROP(stripPitch, "pitch of a normal strip");
640  TEST_BASICPROP(stripWidth, "width of a normal strip");
641  TEST_BASICPROP(sPadLength, "gasGap length on the short side for pads and wires");
642  TEST_BASICPROP(lPadLength, "gasGap length on the long side for pads and wires");
643  TEST_BASICPROP(anglePadPhi, "angular width of a pad in phi direction");
644  TEST_BASICPROP(beamlineRadius, "distance from the gapCenter to beamline");
645 
646  int c = 0;
647  using sTgcLayer = sTgcChamber::sTgcLayer;
648  for (const sTgcLayer& refLayer : reference.layers) {
649  std::set<sTgcLayer>::const_iterator lay_itr = test.layers.find(refLayer);
650  if (lay_itr == test.layers.end()) {
651  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
652  <<refLayer<<" is not found. "<<std::endl;
653  chamberOkay = false;
654  continue;
655  }
656  const sTgcLayer& testLayer{*lay_itr};
657  const Amg::Transform3D layAlignment = testLayer.transform.inverse() *
658  refLayer.transform;
660  TEST_BASICPROP(numWires[c], "number of wires in the layer "<< c + 1 << " are ");
661  TEST_BASICPROP(firstWireGroupWidth[c], "number of wires in first wire group in the layer "<< c + 1 << " are ");
663  TEST_BASICPROP(numPads[c], "number of pads in the layer "<< c + 1 << " are ");
664  TEST_BASICPROP(numPadEta[c], "number of pads in the eta direction in the layer "<< c + 1 << " are ");
665  TEST_BASICPROP(numPadPhi[c], "number of in the phi direction in the layer "<< c + 1 << " are ");
666  TEST_BASICPROP(firstPadHeight[c], "height of the first pad row in the layer "<< c + 1 << " are ");
667  TEST_BASICPROP(padHeight[c], "height of pads in the rest of the rows in the layer "<< c + 1 << " are ");
668  TEST_BASICPROP(padPhiShift[c], "shift of inner pad edges in phi direction in the layer "<< c + 1 << " are ");
669  TEST_BASICPROP(firstPadPhiDiv[c], "angular position of the outer edge of the first pad in the layer "<< c + 1 << " are ");
670  ++c;
671 
673  std::cout <<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
674  << "The test layer transform for layer "<< c << " is: " << Amg::toString(testLayer.transform)
675  << " and the reference layer transform is: " << Amg::toString(refLayer.transform) <<std::endl;
676 
677  if (!Amg::doesNotDeform(layAlignment)) {
678  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
679  <<"the layer "<<testLayer<<" is misaligned w.r.t. reference by "
680  <<Amg::toString(layAlignment)<<std::endl;
681  chamberOkay = false;
682  continue;
683  }
684  }
685 
686  using sTgcChannel = sTgcChamber::sTgcChannel;
687  for (const sTgcChannel& refChannel : reference.channels) {
688  std::set<sTgcChannel>::const_iterator channel_itr = test.channels.find(refChannel);
689  if (channel_itr == test.channels.end()) {
690  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
691  <<refChannel<<" is not found. "<<std::endl;
692  chamberOkay = false;
693  continue;
694  }
695  const sTgcChannel& testChannel{*channel_itr};
696 
697  const Amg::Vector3D diffGlobalPos{testChannel.globalPosition - refChannel.globalPosition};
698  const Amg::Vector2D diffLocalPos{testChannel.localPosition - refChannel.localPosition};
699  if (diffGlobalPos.mag() > tolerance) {
700  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"channel (gasGap/number): "
701  <<testChannel.gasGap<<"/"<<testChannel.channelNumber<<", chType: "<<testChannel.channelType<<", "<< " global position: "
702  <<Amg::toString(testChannel.globalPosition, 2)<<" should be located at "<<Amg::toString(refChannel.globalPosition, 2)
703  <<" displacement: "<<Amg::toString(diffGlobalPos,2)<<std::endl;
704  chamberOkay = false;
705  }
706  if (diffLocalPos.mag() > tolerance) {
707  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"channel (gasGap/number): "
708  <<testChannel.gasGap<<"/"<<testChannel.channelNumber<<", chType: "<<testChannel.channelType<<", "<< " local position: "
709  <<Amg::toString(testChannel.localPosition, 2)<<" should be located at "<<Amg::toString(refChannel.localPosition, 2)
710  <<" displacement: "<<Amg::toString(diffLocalPos,2)<<std::endl;
711  chamberOkay = false;
712  }
713  const double diffChannelLen{testChannel.channelLen - refChannel.channelLen};
714  if (std::abs(diffChannelLen) > tolerance) {
715  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"channel (gasGap/number): "
716  <<testChannel.gasGap<<"/"<<testChannel.channelNumber<<", chType: "<<testChannel.channelType<<", "<< " Run 4 strip Length: "
717  <<testChannel.channelLen<<" Run 3 strip Length "<<refChannel.channelLen
718  <<" displacement: "<<diffChannelLen<<std::endl;
719  chamberOkay = false;
720  }
721  }
722 
723  using sTgcPad = sTgcChamber::sTgcPad;
724  for (const sTgcPad& refPad : reference.pads) {
725  std::set<sTgcPad>::const_iterator pad_itr = test.pads.find(refPad);
726  if (pad_itr == test.pads.end()) {
727  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "
728  <<refPad<<" is not found. "<<std::endl;
729  chamberOkay = false;
730  continue;
731  }
732  const sTgcPad& testPad{*pad_itr};
734  const Amg::Vector2D diffLocalPadPos{testPad.localPosition - refPad.localPosition};
735  if (diffLocalPadPos.mag() > tolerance) {
736  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
737  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " local position: "
738  <<Amg::toString(testPad.localPosition, 2)<<" should be located at "<<Amg::toString(refPad.localPosition, 2)
739  <<" displacement: "<<Amg::toString(diffLocalPadPos,2)<<std::endl;
740  chamberOkay = false;
741  }
743  const Amg::Vector2D diffLocalPadCornerBL{testPad.localPadCornerBL - refPad.localPadCornerBL};
744  if (diffLocalPadCornerBL.mag() > tolerance) {
745  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
746  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " bottom-left corner: "
747  <<Amg::toString(testPad.localPadCornerBL, 2)<<" should be located at "<<Amg::toString(refPad.localPadCornerBL, 2)
748  <<" displacement: "<<Amg::toString(diffLocalPadCornerBL,2)<<std::endl;
749  chamberOkay = false;
750  }
752  const Amg::Vector2D diffLocalPadCornerBR{testPad.localPadCornerBR - refPad.localPadCornerBR};
753  if (diffLocalPadCornerBR.mag() > tolerance) {
754  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
755  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " bottom-right corner: "
756  <<Amg::toString(testPad.localPadCornerBR, 2)<<" should be located at "<<Amg::toString(refPad.localPadCornerBR, 2)
757  <<" displacement: "<<Amg::toString(diffLocalPadCornerBR,2)<<std::endl;
758  chamberOkay = false;
759  }
761  const Amg::Vector2D diffLocalPadCornerTL{testPad.localPadCornerTL - refPad.localPadCornerTL};
762  if (diffLocalPadCornerTL.mag() > tolerance) {
763  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
764  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " top-left corner: "
765  <<Amg::toString(testPad.localPadCornerTL, 2)<<" should be located at "<<Amg::toString(refPad.localPadCornerTL, 2)
766  <<" displacement: "<<Amg::toString(diffLocalPadCornerTL,2)<<std::endl;
767  chamberOkay = false;
768  }
770  const Amg::Vector2D diffLocalPadCornerTR{testPad.localPadCornerTR - refPad.localPadCornerTR};
771  if (diffLocalPadCornerTR.mag() > tolerance) {
772  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
773  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " top-right corner: "
774  <<Amg::toString(testPad.localPadCornerTR, 2)<<" should be located at "<<Amg::toString(refPad.localPadCornerTR, 2)
775  <<" displacement: "<<Amg::toString(diffLocalPadCornerTR,2)<<std::endl;
776  chamberOkay = false;
777  }
778 
780  const Amg::Vector3D diffGlobalPadPos{testPad.globalPosition - refPad.globalPosition};
781  if (diffGlobalPadPos.mag() > tolerance) {
782  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
783  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " global position: "
784  <<Amg::toString(testPad.globalPosition, 2)<<" should be located at "<<Amg::toString(refPad.globalPosition, 2)
785  <<" displacement: "<<Amg::toString(diffGlobalPadPos,2)<<std::endl;
786  chamberOkay = false;
787  }
789  const Amg::Vector3D diffGlobalPadCornerBL{testPad.globalPadCornerBL - refPad.globalPadCornerBL};
790  if (diffGlobalPadCornerBL.mag() > tolerance) {
791  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
792  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " bottom-left corner: "
793  <<Amg::toString(testPad.globalPadCornerBL, 2)<<" should be located at "<<Amg::toString(refPad.globalPadCornerBL, 2)
794  <<" displacement: "<<Amg::toString(diffGlobalPadCornerBL,2)<<std::endl;
795  chamberOkay = false;
796  }
797 
799  const Amg::Vector3D diffGlobalPadCornerBR{testPad.globalPadCornerBR - refPad.globalPadCornerBR};
800  if (diffGlobalPadCornerBR.mag() > tolerance) {
801  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
802  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " bottom-right corner: "
803  <<Amg::toString(testPad.globalPadCornerBR, 2)<<" should be located at "<<Amg::toString(refPad.globalPadCornerBR, 2)
804  <<" displacement: "<<Amg::toString(diffGlobalPadCornerBR,2)<<std::endl;
805  chamberOkay = false;
806  }
808  const Amg::Vector3D diffGlobalPadCornerTL{testPad.globalPadCornerTL - refPad.globalPadCornerTL};
809  if (diffGlobalPadCornerTL.mag() > tolerance) {
810  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
811  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " top-left corner: "
812  <<Amg::toString(testPad.globalPadCornerTL, 2)<<" should be located at "<<Amg::toString(refPad.globalPadCornerTL, 2)
813  <<" displacement: "<<Amg::toString(diffGlobalPadCornerTL,2)<<std::endl;
814  chamberOkay = false;
815  }
817  const Amg::Vector3D diffGlobalPadCornerTR{testPad.globalPadCornerTR - refPad.globalPadCornerTR};
818  if (diffGlobalPadCornerTR.mag() > tolerance) {
819  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
820  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " top-right corner: "
821  <<Amg::toString(testPad.globalPadCornerTR, 2)<<" should be located at "<<Amg::toString(refPad.globalPadCornerTR, 2)
822  <<" displacement: "<<Amg::toString(diffGlobalPadCornerTR,2)<<std::endl;
823  chamberOkay = false;
824  }
826  const Amg::Vector2D diffHitPosition{testPad.hitPosition - refPad.hitPosition};
827  if (diffHitPosition.mag() > tolerance) {
828  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
829  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " Hit Position: "
830  <<Amg::toString(testPad.hitPosition, 2) <<" should be "<<Amg::toString(refPad.hitPosition, 2) <<" displacement: "<< Amg::toString(diffHitPosition, 2) <<std::endl;
831  chamberOkay = false;
832  }
834  const int diffPadNumber{testPad.padNumber - refPad.padNumber};
835  if (std::abs(diffPadNumber) > 0 || testPad.padNumber < 0 || refPad.padNumber < 0) {
836  std::cerr<<"runsTgcGeoComparison() "<<__LINE__<<": in chamber "<<test<<" "<<"pad (gasGap/(padEta, padPhi)): "
837  <<testPad.gasGap<<"/("<<testPad.padEta<<", "<<testPad.padPhi<<"), "<< " padNumber: "
838  <<testPad.padNumber <<" should be "<<refPad.padNumber <<" displacement: "<< diffPadNumber
839  << " Hit Position: "<< Amg::toString(testPad.hitPosition, 2) << " BL Corner: "
840  << Amg::toString(testPad.localPadCornerBL, 2) << std::endl;
841  chamberOkay = false;
842  }
843 
844  if (!chamberOkay) {
845  return_code = EXIT_FAILURE;
846  }
847  }
848  }
849  return return_code;
850 }
851 
852 
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
sTgcChamber::sTgcLayer
Helper struct to assess that the layers are properly oriented.
Definition: runsTgcGeoComparison.cxx:158
sTgcChamber::wireCutout
std::vector< float > wireCutout
Definition: runsTgcGeoComparison.cxx:74
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
PathResolver::FindCalibFile
static std::string FindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.h:108
sTgcChamber::padHeight
std::vector< float > padHeight
Definition: runsTgcGeoComparison.cxx:118
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
sTgcChamber::operator<
bool operator<(const sTgcChamber &other) const
Sorting operator to insert the object into std::set.
Definition: runsTgcGeoComparison.cxx:46
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
readTreeDump
std::set< sTgcChamber > readTreeDump(const std::string &inputFile)
Definition: runsTgcGeoComparison.cxx:220
makeTOC.inFile
string inFile
Definition: makeTOC.py:5
sTgcChamber::sTgcLayer::operator<
bool operator<(const sTgcLayer &other) const
Ordering operator.
Definition: runsTgcGeoComparison.cxx:164
sTgcChamber::sTgcPad::globalPadCornerBL
Amg::Vector3D globalPadCornerBL
global pad corner positions
Definition: runsTgcGeoComparison.cxx:134
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
sTgcChamber::sTgcPad::localPadCornerBR
Amg::Vector2D localPadCornerBR
Definition: runsTgcGeoComparison.cxx:130
sTgcChamber::sTgcChannel::operator<
bool operator<(const sTgcChannel &other) const
Ordering operator to use the wireGroup with set.
Definition: runsTgcGeoComparison.cxx:100
TEST_BASICPROP
#define TEST_BASICPROP(attribute, propName)
Definition: runsTgcGeoComparison.cxx:566
plotIsoValidation.treeReader
treeReader
Definition: plotIsoValidation.py:127
sTgcChamber::sTgcPad
Definition: runsTgcGeoComparison.cxx:123
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
sTgcChamber::numPadPhi
std::vector< uint > numPadPhi
Definition: runsTgcGeoComparison.cxx:116
reference
Definition: hcg.cxx:437
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:147
sTgcChamber::sTgcPad::localPadCornerBL
Amg::Vector2D localPadCornerBL
local pad corner positions
Definition: runsTgcGeoComparison.cxx:129
sTgcChamber::sTgcPad::padEta
short padEta
Pad Eta number.
Definition: runsTgcGeoComparison.cxx:143
sTgcChamber::sTgcPad::padPhi
short padPhi
Pad Phi number.
Definition: runsTgcGeoComparison.cxx:145
dq_defect_copy_defect_database.channels
def channels
Definition: dq_defect_copy_defect_database.py:56
sTgcChamber::sTgcPad::gasGap
unsigned int gasGap
Gas gap of the Pad.
Definition: runsTgcGeoComparison.cxx:147
sTgcChamber::sTgcPad::localPadCornerTR
Amg::Vector2D localPadCornerTR
Definition: runsTgcGeoComparison.cxx:132
sTgcChamber::numPadEta
std::vector< uint > numPadEta
Definition: runsTgcGeoComparison.cxx:115
Amg::getTransformFromRotTransl
Amg::Transform3D getTransformFromRotTransl(Amg::RotationMatrix3D rot, Amg::Vector3D transl_vec)
Definition: GeoPrimitivesHelpers.h:172
GeoPrimitives.h
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
sTgcChamber::firstPadHeight
std::vector< float > firstPadHeight
Definition: runsTgcGeoComparison.cxx:117
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
sTgcChamber::firstWireGroupWidth
std::vector< uint > firstWireGroupWidth
Definition: runsTgcGeoComparison.cxx:72
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:20
sTgcChamber::design
std::string design
Definition: runsTgcGeoComparison.cxx:43
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
sTgcChamber::firstPadPhiDiv
std::vector< float > firstPadPhiDiv
Definition: runsTgcGeoComparison.cxx:120
sTgcChamber::numPads
std::vector< uint > numPads
Definition: runsTgcGeoComparison.cxx:114
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:383
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
sTgcChamber::sTgcPad::localPosition
Amg::Vector2D localPosition
local pad postion
Definition: runsTgcGeoComparison.cxx:125
sTgcChamber::numWires
std::vector< unsigned int > numWires
Definition: runsTgcGeoComparison.cxx:71
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
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:135
sTgcChamber::sTgcChamber
sTgcChamber()=default
Default constructor.
PathResolver.h
sTgcChamber::sTgcPad::operator<
bool operator<(const sTgcPad &other) const
Ordering operator to use the Pad with set.
Definition: runsTgcGeoComparison.cxx:150
sTgcChamber::sTgcPad::globalPadCornerTL
Amg::Vector3D globalPadCornerTL
Definition: runsTgcGeoComparison.cxx:136
sTgcChamber
Helper struct to represent a full sTgc chamber.
Definition: runsTgcGeoComparison.cxx:33
sTgcChamber::sTgcChannel
Definition: runsTgcGeoComparison.cxx:86
HI::TowerBins::numLayers
constexpr unsigned int numLayers()
Definition: HIEventDefs.h:23
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
main
int main(int argc, char **argv)
Definition: runsTgcGeoComparison.cxx:574
sTgcChamber::sTgcPad::localPadCornerTL
Amg::Vector2D localPadCornerTL
Definition: runsTgcGeoComparison.cxx:131
sTgcChamber::numWireGroups
std::vector< uint > numWireGroups
Definition: runsTgcGeoComparison.cxx:73
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
GeoPrimitivesHelpers.h
sTgcChamber::stationIndex
int stationIndex
Definition: runsTgcGeoComparison.cxx:39
GeoPrimitivesToStringConverter.h
sTgcChamber::padNumber
std::vector< int > padNumber
Definition: runsTgcGeoComparison.cxx:113
sTgcChamber::padPhiShift
std::vector< float > padPhiShift
Definition: runsTgcGeoComparison.cxx:119
sTgcChamber::stationName
std::string stationName
Definition: runsTgcGeoComparison.cxx:38
MuonDetectorDefs.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:54
CscCalibQuery.testFile
testFile
Definition: CscCalibQuery.py:274
sTgcChamber::sTgcLayer::gasGap
unsigned int gasGap
Gas gap number of the layer.
Definition: runsTgcGeoComparison.cxx:160
sTgcChamber::sTgcPad::globalPosition
Amg::Vector3D globalPosition
global pad postion
Definition: runsTgcGeoComparison.cxx:127
sTgcChamber::firstStripPitch
std::vector< float > firstStripPitch
Definition: runsTgcGeoComparison.cxx:83
sTgcChamber::sTgcChannel::localPosition
Amg::Vector2D localPosition
local strip postion
Definition: runsTgcGeoComparison.cxx:88
python.compressB64.c
def c
Definition: compressB64.py:93
MuonGMR4::operator<<
std::ostream & operator<<(std::ostream &ostr, const Chamber::defineArgs &args)
Definition: Chamber.cxx:14
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
sTgcChamber::sTgcPad::globalPadCornerTR
Amg::Vector3D globalPadCornerTR
Definition: runsTgcGeoComparison.cxx:137