ATLAS Offline Software
MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  The Mdt detector = a multilayer = MDT in amdb
7  ----------------------------------------------------
8  ***************************************************************************/
9 
11 
12 #include <limits>
13 #include <utility>
14 
15 #include "GeoModelKernel/GeoDefinitions.h"
16 #include "GeoModelKernel/GeoTube.h"
20 #include "GeoModelHelpers/throwExcept.h"
21 #include "GeoModelHelpers/TransformToStringConverter.h"
22 
30 
31 #include "CxxUtils/inline_hints.h"
32 // From Dan Levin: MDT
33 // linear density of wire: lambda=wireLinearDensity=19.3 [gm/cm^3] * PI*
34 //(25 *10^-4 )^2 [CLHEP::cm^2] = 378.954 microgram/CLHEP::cm
35 // From Dan Levin: MDT
36 // wireTen=350 for most chambers, 285 gm for some NIKHEF chambers (BOL ?),
37 
38 #define verbose_Bline false
39 // Typical b-line par values
40 // m_bz = 0.01; // 10 microns
41 // m_bp = 0.1; // 100 microns
42 // m_bn = 0.1; // 100 microns
43 // m_sp = 0.001; // 1 micron
44 // m_sn = 0.001; // 1 micron
45 // m_tw = 0.1; // 100 microns
46 // m_pg = 0.1; // 100 microns
47 // m_tr = 0.1; // 100 microns
48 // m_eg = 1.0e-4; // 100 ppm
49 // m_ep = 1.0e-5; // 10 ppm
50 // m_en = 1.0e-5; // 10 ppm
51 
52 namespace {
53  // the tube number of a tube in a tubeLayer in encoded in the GeoSerialIdentifier (modulo maxNTubesPerLayer)
54  constexpr unsigned int const maxNTubesPerLayer = MdtIdHelper::maxNTubesPerLayer;
55  constexpr double linearDensity = 378.954;
56 } // namespace
57 
58 namespace MuonGM {
59 
60  MdtReadoutElement::MdtReadoutElement(GeoVFullPhysVol* pv, const std::string& stName, MuonDetectorManager* mgr) :
62  // get the setting of the caching flag from the manager
63  m_inBarrel = stName[0]== 'B';
64 
65  setStationName(stName);
66  }
67  void MdtReadoutElement::setMultilayer(const int ml) { m_multilayer = ml; }
68  void MdtReadoutElement::setNLayers(const int nl) { m_nlayers = nl; }
70  std::vector<const Trk::Surface*> MdtReadoutElement::surfaces() const {
71  std::vector<const Trk::Surface*> elementSurfaces;
72  elementSurfaces.reserve(m_tubeSurfaces.size() + 1);
73  if (m_associatedSurface) { elementSurfaces.push_back(m_associatedSurface.get()); }
74  for (const auto& s : m_tubeSurfaces) {
75  if (s) elementSurfaces.push_back(s.get());
76  }
77  return elementSurfaces;
78  }
79 
80  bool MdtReadoutElement::getWireFirstLocalCoordAlongZ(int tubeLayer, double& coord) const {
81  coord = -9999.;
82  if (tubeLayer > getNLayers() || tubeLayer < 1) return false;
83  coord = m_firstwire_x[tubeLayer - 1];
84  return true;
85  }
86  bool MdtReadoutElement::getWireFirstLocalCoordAlongR(int tubeLayer, double& coord) const {
87  coord = -9999.;
88  if (tubeLayer > getNLayers() || tubeLayer < 1) return false;
89  coord = m_firstwire_y[tubeLayer - 1];
90  return true;
91  }
92 
97 
98  int ntot_steps = m_nsteps;
99  if (hasCutouts() && manager()->MinimalGeoFlag() == 0) { ntot_steps = m_nlayers * m_ntubesperlayer; }
100  m_tubeBounds.resize(ntot_steps);
101  }
102 
103  double MdtReadoutElement::getTubeLengthForCaching(const int tubeLayer, const int tube) const {
104  double nominalTubeLength = 0.;
105  if (barrel())
106  nominalTubeLength = m_Ssize;
107  else {
108  int istep = int((tube - 1) / m_ntubesinastep);
109  if (istep < 0 || istep >= m_nsteps) {
110  ATH_MSG_WARNING( "getTubeLenght for Element with tech. " << getTechnologyType()
111  << " DEid = " << idHelperSvc()->toStringDetEl(identify()) << " called with: tubeL, tube " << tubeLayer << " " << tube
112  << "; step " << istep << " out of range 0-" << m_nsteps - 1 << " m_ntubesinastep " << m_ntubesinastep );
113  istep = 0;
114  }
115  nominalTubeLength = m_tubelength[istep];
116  }
117 
118  double tlength = nominalTubeLength;
119 
120  if (hasCutouts()) {
121  if (manager()->MinimalGeoFlag() == 0) {
122  ATH_MSG_VERBOSE( " MdtReadoutElement " <<idHelperSvc()->toStringDetEl(identify())
123  << " has cutouts, check for real tube length for tubeLayer, tube " << tubeLayer << " " << tube );
124  PVConstLink cv = getMaterialGeom(); // it is "Multilayer"
125  int nGrandchildren = cv->getNChildVols();
126  if (nGrandchildren <= 0) return tlength;
127  // child vol 0 is foam; 1 to (nGrandchildren-1) should be tubes
128  int ii = (tubeLayer - 1) * m_ntubesperlayer + tube;
129  // BIS78 only (the BIS7 of Run1/2 has no cutouts, thus, this block won't be reached)
130  if ((getStationIndex() == m_stIdx_BIS && std::abs(getStationEta()) == 7)) --ii;
131  if (m_idHelper.isBMG(identify())) {
132  // usually the tube number corresponds to the child number, however for
133  // BMG chambers full tubes are skipped during the building process
134  // therefore the matching needs to be done via the volume ID
135  int packed_id = tube + maxNTubesPerLayer * tubeLayer;
136  int kk = 0;
137  bool found = false;
138  geoGetIds(
139  [&](int id) {
140  if (!found && id == packed_id) {
141  ii = kk;
142  found = true;
143  }
144  ++kk;
145  }, cv);
146  if (found) {
147  ATH_MSG_DEBUG( " MdtReadoutElement tube match found for BMG - input : tube(" << tube << "), layer("
148  << tubeLayer << ") - output match : tube(" << ii % maxNTubesPerLayer << "), layer(" << ii / maxNTubesPerLayer
149  << ")" );
150  }
151  }
152  if (ii >= nGrandchildren) {
153  ATH_MSG_WARNING( " MdtReadoutElement " << idHelperSvc()->toStringDetEl(identify()) << " has cutouts, nChild = " << nGrandchildren
154  << " --- getTubeLength is looking for child with index ii=" << ii << " for tubeL and tube = " << tubeLayer << " "
155  << tube );
156  ATH_MSG_WARNING( "returning nominalTubeLength " );
157  return tlength;
158  }
159  if (ii < 0) {
160  ATH_MSG_WARNING( " MdtReadoutElement " << idHelperSvc()->toStringDetEl(identify()) << " has cutouts, nChild = " << nGrandchildren
161  << " --- getTubeLength is looking for child with index ii=" << ii << " for tubeL and tube = " << tubeLayer << " "
162  << tube );
163  ATH_MSG_WARNING( "returning nominalTubeLength " );
164  return tlength;
165  }
166  PVConstLink physChild = cv->getChildVol(ii);
167  const GeoShape* shape = physChild->getLogVol()->getShape();
168  if (shape == nullptr) return tlength;
169  const GeoTube* theTube = dynamic_cast<const GeoTube*>(shape);
170  if (theTube != nullptr)
171  tlength = 2. * theTube->getZHalfLength();
172  else
173  ATH_MSG_WARNING( "PhysChild with index " << ii
174  << " out of (tubeLayer-1)*m_ntubesperlayer+tube with tl=" << tubeLayer << " tubes/lay=" << m_ntubesperlayer
175  << " t=" << tube << " for MdtReadoutElement " << idHelperSvc()->toStringDetEl(identify()) );
176  }
177  if (std::abs(tlength - nominalTubeLength) > 0.1) {
178  ATH_MSG_VERBOSE( "Tube " << tube << " in tubeLayer = " << tubeLayer
179  << " is affected by a cutout: eff. length = " << tlength << " while nominal = " << nominalTubeLength
180  << " in station " << idHelperSvc()->toStringDetEl(identify()));
181  } else {
182  ATH_MSG_VERBOSE( "Tube " << tube << " in tubeLayer = " << tubeLayer
183  << " is NOT affected by the cutout: eff. length = " << tlength << " while nominal = " << nominalTubeLength);
184  }
185  }
186  return tlength;
187  }
188 
189  double MdtReadoutElement::distanceFromRO(const Amg::Vector3D& x, int tubeLayer, int tube) const {
190  // x is given in the global reference frame
191  const Amg::Vector3D cPos = center(tubeLayer, tube);
192  const Amg::Vector3D roPos = ROPos(tubeLayer, tube);
193  const Amg::Vector3D c_ro = cPos - roPos;
194  const Amg::Vector3D x_ro = x - roPos;
195 
196  double scalprod = c_ro.dot(x_ro);
197  double wlen = getWireLength(tubeLayer, tube);
198  if (wlen > 10. * CLHEP::mm)
199  scalprod = std::abs(2. * scalprod / getWireLength(tubeLayer, tube));
200  else {
201  ATH_MSG_WARNING( " Distance of Point " <<Amg::toString(x) << " from RO side cannot be calculated (=0) since wirelength = " << wlen );
202  scalprod = 0.;
203  }
204  return scalprod;
205  }
206 
207  int MdtReadoutElement::isAtReadoutSide(const Amg::Vector3D& GlobalHitPosition, int tubeLayer, int tube) const {
208  double distance = distanceFromRO(GlobalHitPosition, tubeLayer, tube);
209  if (distance < 0) {
210  ATH_MSG_WARNING( "isAtReadoutSide() - GlobalHitPosition appears to be outside the tube volume " << distance );
211  return 1;
212  } else if (distance <= getWireLength(tubeLayer, tube) / 2.)
213  return 1;
214  else if (distance < getWireLength(tubeLayer, tube))
215  return -1;
216  else {
217  ATH_MSG_WARNING( "isAtReadoutSide() - GlobalHitPosition appears to be outside the tube volume " << distance );
218  return -1;
219  }
220  }
221  double MdtReadoutElement::RODistanceFromTubeCentre(const int tubeLayer, const int tube) const {
222  return getWireLength(tubeLayer, tube) / 2.;
223  }
224  double MdtReadoutElement::signedRODistanceFromTubeCentre(const int tubeLayer, const int tube) const {
225  // it is a signed quantity:
226  // the sign corresponds to the sign of the z coordinate of the RO endplug in the tube
227  // reference frame
228  int amdb_plus_minus1 = 1;
229  if (!m_zsignRO_tubeFrame.isValid()) {
230  const MuonStation* ms = parentMuonStation();
231  if (std::abs(ms->xAmdbCRO()) > 10.) {
232  Amg::Vector3D tem = ms->xAmdbCRO()* Amg::Vector3D::UnitX();
233  Amg::Transform3D amdbToGlobal{ms->getAmdbLRSToGlobal()};
234  Amg::Vector3D temGlo = amdbToGlobal * tem;
235  Amg::Vector3D ROtubeFrame = nodeform_globalToLocalTransf(tubeLayer, tube) * temGlo;
236  if (ROtubeFrame.z() < 0)
238  else
240  }
241  }
242  // if no CRO in a chamber in AMDB (BIS in layout R), use the standard convention for RO-HV side
243  if (!m_zsignRO_tubeFrame.isValid()) {
244  int sign = 0;
245  if (barrel()) {
246  if (sideA()) {
247  if (largeSector())
248  sign = -1;
249  else
250  sign = 1;
251  } else {
252  if (largeSector())
253  sign = 1;
254  else
255  sign = -1;
256  }
257  // a special case is BIS in sector 12
258  if (getStationName().substr(0, 3) == "BIS" && getStationPhi() == 6) sign = -sign;
259  } else {
260  if (sideA()) {
261  if (largeSector())
262  sign = 1;
263  else
264  sign = -1;
265  } else {
266  if (largeSector())
267  sign = -1;
268  else
269  sign = 1;
270  }
271  }
273  }
274  amdb_plus_minus1 = *m_zsignRO_tubeFrame.ptr();
275  if (amdb_plus_minus1 == 0) {
276  ATH_MSG_WARNING( "Unable to get the sign of RO side; signedRODistancefromTubeCenter returns 0" );
277  }
278 
279  return amdb_plus_minus1 * getWireLength(tubeLayer, tube) / 2.;
280  }
281 
282  Amg::Vector3D MdtReadoutElement::tubeFrame_localROPos(const int tubeLayer, const int tube) const {
283  return signedRODistanceFromTubeCentre(tubeLayer, tube) * Amg::Vector3D::UnitZ();
284  }
285  Amg::Vector3D MdtReadoutElement::localROPos(const int tubeLayer, const int tube) const {
286  return tubeToMultilayerTransf(tubeLayer, tube) * tubeFrame_localROPos(tubeLayer, tube);
287  }
288  Amg::Vector3D MdtReadoutElement::ROPos(const int tubeLayer, const int tube) const {
289  return transform(tubeLayer, tube) * tubeFrame_localROPos(tubeLayer, tube);
290  }
291  Amg::Vector3D MdtReadoutElement::localTubePos(const int tubeLayer, const int tube) const {
292  return fromIdealToDeformed(tubeLayer, tube) * nodeform_localTubePos(tubeLayer, tube);
293  }
294 
295  Amg::Vector3D MdtReadoutElement::nodeform_localTubePos(const int tubeLayer, const int tube) const {
296  ATH_MSG_VERBOSE( " Computing LocalTubePos for "<< idHelperSvc()->toStringDetEl(identify())
297  << "/" << tubeLayer << "/" << tube );
298  double xtube{0.}, ytube{0.}, ztube{0.};
299  if (barrel()) {
300  xtube = -m_Rsize / 2. + m_firstwire_y[tubeLayer - 1];
301  ztube = -m_Zsize / 2. + m_firstwire_x[tubeLayer - 1] + (tube - 1) * m_tubepitch;
302  } else {
303  xtube = -m_Zsize / 2. + m_firstwire_y[tubeLayer - 1];
304  ztube = -m_Rsize / 2. + m_firstwire_x[tubeLayer - 1] + (tube - 1) * m_tubepitch;
305  }
306  Amg::Vector3D tubePos{xtube, ytube, ztube};
307  if (hasCutouts()) {
308  if (manager()->MinimalGeoFlag() == 0) {
309  ATH_MSG_DEBUG( " MdtReadoutElement " << idHelperSvc()->toStringDetEl(identify()) << " has cutouts, check for real position of tubes " );
310  PVConstLink cv = getMaterialGeom(); // it is "Multilayer"
311  int nGrandchildren = cv->getNChildVols();
312  // child vol 0 is foam; 1 to (nGrandchildren-1) should be tubes
313  int ii = (tubeLayer - 1) * m_ntubesperlayer + tube;
314 
315  // BIS78 only (the BIS7 of Run1/2 has no cutouts, thus, this block won't be reached)
316  if ((getStationIndex() == m_stIdx_BIS && std::abs(getStationEta()) == 7)) --ii;
317  if (m_idHelper.isBMG(identify())) {
318  // usually the tube number corresponds to the child number, however for
319  // BMG chambers full tubes are skipped during the building process
320  // therefore the matching needs to be done via the volume ID
321  int packed_id = tube + maxNTubesPerLayer * tubeLayer;
322  int kk = 0;
323  bool found = false;
324  geoGetIds(
325  [&](int id) {
326  if (!found && id == packed_id) {
327  ii = kk;
328  found = true;
329  }
330  ++kk;
331  },
332  &*cv);
333  if (found) {
334  ATH_MSG_DEBUG( " MdtReadoutElement tube match found for BMG - input : tube(" << tube << "), layer("
335  << tubeLayer << ") - output match : tube(" << ii % maxNTubesPerLayer << "), layer(" << ii / maxNTubesPerLayer
336  << ")" );
337  }
338  }
339  GeoTrf::Transform3D tubeTrans = cv->getXToChildVol(ii);
340  PVConstLink tv = cv->getChildVol(ii);
341  constexpr double maxtol = 0.0000001;
342 
343  if (std::abs(xtube - tubeTrans(0, 3)) > maxtol || std::abs(ztube - tubeTrans(2, 3)) > maxtol) {
344  THROW_EXCEPTION(__func__<<"("<<tubeLayer<<","<<tube<<")"<<" - mismatch between local from tube-id/pitch/cutout position"<<
345  Amg::toString(tubePos)<<" and GeoModel "<< Amg::toString(tubeTrans.linear().col(3))<<" for detector element "<<
346  idHelperSvc()->toStringDetEl(identify()) <<"There are "<<nGrandchildren<<" child volumes and "<<
347  (m_ntubesperlayer * m_nlayers)<<" are expected. There should be "<<m_nlayers<<" and "<<
348  m_ntubesperlayer<<" tubes per layer");
349  }
350  if (tubeTrans(1, 3) > maxtol) {
351 
352  ATH_MSG_DEBUG( "This a tube with cutout stName/Eta/Phi/ml/tl/t = " << idHelperSvc()->toStringDetEl(identify())
353  << "/" << tubeLayer << "/" << tube);
354  // check only for tubes actually shifted
355  if (std::abs(m_cutoutShift - tubeTrans(1, 3)) > maxtol) {
356  THROW_EXCEPTION(__func__<<"("<<tubeLayer<<","<<tube<<")"<<" - mismatch between local from tube-id/pitch/cutout position"<<
357  Amg::toString(tubePos)<<" and GeoModel "<< Amg::toString(tubeTrans.linear().col(3))<<" for detector element "<<
358  idHelperSvc()->toStringDetEl(identify()) <<"There are "<<nGrandchildren<<" child volumes and "<<
359  (m_ntubesperlayer * m_nlayers)<<" are expected. There should be "<<m_nlayers<<" and "<<
360  m_ntubesperlayer<<" tubes per layer");
361  }
362  }
363 
364  Amg::Vector3D x = tubeTrans.translation();
365  if (tube > m_ntubesperlayer || tubeLayer > m_nlayers) { x = tubePos; }
366  return x;
367  }
368  }
369  return tubePos;
370  }
371 
373  return transform() * nodeform_localTubePos(tubeLayer, tube);
374  }
375  Amg::Vector3D MdtReadoutElement::tubePos(int tubeLayer, int tube) const {
376  return transform() * localTubePos(tubeLayer, tube);
377  }
378  Amg::Transform3D MdtReadoutElement::tubeToMultilayerTransf(const int tubeLayer, const int tube) const {
380  fromIdealToDeformed(tubeLayer, tube));
381  }
382 #if defined(FLATTEN)
383  // We compile this package with optimization, even in debug builds; otherwise,
384  // the heavy use of Eigen makes it too slow. However, from here we may call
385  // to out-of-line Eigen code that is linked from other DSOs; in that case,
386  // it would not be optimized. Avoid this by forcing all Eigen code
387  // to be inlined here if possible.
389 #endif
390 
392  return transform() * tubeToMultilayerTransf(tubePos, toDeform);
393  }
395  return toDeform * Amg::Translation3D{tubePos} * Amg::getRotateX3D(90. * CLHEP::deg);
396  }
398  return globalTransform(nodeform_localTubePos(tubeLayer, tube), Amg::Transform3D::Identity());
399  }
400  Amg::Transform3D MdtReadoutElement::globalToLocalTransf(const int tubeLayer, const int tube) const {
401  return transform(tubeLayer, tube).inverse();
402  }
403 
405  return nodeform_localToGlobalTransf(tubeLayer, tube).inverse();
406  }
407  double MdtReadoutElement::getNominalTubeLengthWoCutouts(const int tubeLayer, const int tube) const {
408  if (barrel())
409  return m_Ssize;
410  else {
411  int istep = int((tube - 1) / m_ntubesinastep);
412  if (istep < 0 || istep >= m_nsteps) {
413  ATH_MSG_WARNING( "getNominalTubeLengthWoCutouts for Element named " << idHelperSvc()->toStringDetEl(identify())
414  << " called with: tubeL, tube " << tubeLayer
415  << " " << tube << "; step " << istep << " out of range 0-" << m_nsteps - 1 << " m_ntubesinastep " << m_ntubesinastep);
416  istep = 0;
417  }
418  return m_tubelength[istep];
419  }
420  }
422  double xtube{0.}, ztube{0.};
423  if (barrel()) {
424  xtube = -m_Rsize / 2. + m_firstwire_y[tubeLayer - 1];
425  ztube = -m_Zsize / 2. + m_firstwire_x[tubeLayer - 1] + (tube - 1) * m_tubepitch;
426  } else {
427  xtube = -m_Zsize / 2. + m_firstwire_y[tubeLayer - 1];
428  ztube = -m_Rsize / 2. + m_firstwire_x[tubeLayer - 1] + (tube - 1) * m_tubepitch;
429  }
430  return Amg::Vector3D{xtube, 0., ztube};
431  }
432 
433  const Amg::Transform3D& MdtReadoutElement::fromIdealToDeformed(const int tubeLayer, const int tube) const {
434  size_t itube = (tubeLayer - 1) * m_ntubesperlayer + tube - 1;
435  if (itube >= m_deformTransf.size()) {
436  ATH_MSG_WARNING(__func__<<"() :"<<__LINE__<< " called with tubeLayer or tube out of range in chamber "
437  << idHelperSvc()->toStringDetEl(identify()) << " : layer " << tubeLayer << " max " << m_nlayers << " tube " << tube
438  << " max " << m_ntubesperlayer << " will compute deformation for first tube in this chamber" );
439  ATH_MSG_WARNING( "Please run in DEBUG mode to get extra diagnostic" );
440  itube = 0;
441  }
442 
444  if (!ptr) {
445  Amg::Transform3D trans = deformedTransform(tubeLayer, tube);
446  ptr.set(std::make_unique<Amg::Transform3D>(std::move(trans)));
448  }
449  return *ptr;
450  }
451 
452 #if defined(FLATTEN)
453  // We compile this package with optimization, even in debug builds; otherwise,
454  // the heavy use of Eigen makes it too slow. However, from here we may call
455  // to out-of-line Eigen code that is linked from other DSOs; in that case,
456  // it would not be optimized. Avoid this by forcing all Eigen code
457  // to be inlined here if possible.
459 #endif
461  MdtReadoutElement::deformedTransform(int tubeLayer, int tube) const {
462 
463  const MuonStation* ms = parentMuonStation();
464  if ( !ms->hasBLines() && !ms->hasMdtAsBuiltParams()) {
465  return Amg::Transform3D::Identity();
466  }
467 
468  const Amg::Vector3D fixedPoint = ms->getUpdatedBlineFixedPointInAmdbLRS();
469 
470  int ntot_tubes = m_nlayers * m_ntubesperlayer;
471  int itube = (tubeLayer - 1) * m_ntubesperlayer + tube - 1;
472  if (itube >= ntot_tubes) {
473  ATH_MSG_WARNING( "global index for tubeLayer/tube = " << tubeLayer << "/" << tube << " is " << itube
474  << " >=ntot_tubes =" << ntot_tubes << " RESETTING global index to 0" );
475  itube = 0;
476  }
477 
478  // Chamber parameters
479  double width_narrow = m_Ssize;
480  double width_wide = m_LongSsize;
481  double height = barrel() ? ms->ZsizeMdtStation() : ms->RsizeMdtStation();
482  double thickness = barrel() ? ms->RsizeMdtStation() : ms->ZsizeMdtStation();
483 #ifndef NDEBUG
484  double heightML = barrel() ? m_Zsize : m_Rsize;
485  double thicknessML = barrel() ? m_Rsize : m_Zsize;
486  if (std::abs(height - heightML) > 10.) {
487  ATH_MSG_DEBUG( "RE " << idHelperSvc()->toStringDetEl(identify())
488  << "Different ML and MDTStation length in the precision coord.direction --- MultiLayerHeight, MDTstationHeigh "
489  << heightML << " " << height << " MultiLayerThickness, MDTstationThickness " << thicknessML << " " << thickness);
490  }
491 #endif
492  // Chamber dimension in Z is defined with extraneous glue width. Correct for it
493  double glue = (tubePitch() - 2. * outerTubeRadius());
494  height -= glue;
495 
496  // Calculate transformation from native to AMDB.
497  const Amg::Transform3D toAMDB = ms->getNativeToAmdbLRS() * toParentStation();
498  const Amg::Transform3D fromAMDB = toAMDB.inverse();
499 
500  // Get positions of the wire center and end without deformations
501  Amg::Vector3D pt_center = localNominalTubePosWoCutouts(tubeLayer, tube);
502  double halftubelen = 0.5 * getNominalTubeLengthWoCutouts(tubeLayer, tube);
503 
504  // Compute tube ends in AMDB coordinates
505  Amg::Vector3D pt_end1 = toAMDB * pt_center + halftubelen * Amg::Vector3D::UnitX(); // s>0 side
506  Amg::Vector3D pt_end2 = toAMDB * pt_center - halftubelen * Amg::Vector3D::UnitX(); // s>0 side
507 
508  Amg::Vector3D pt_end1_new = pt_end1;
509  Amg::Vector3D pt_end2_new = pt_end2;
510 
511  // if there are as built parameters ... apply them here
512  if (ms->hasMdtAsBuiltParams()) {
513  wireEndpointsAsBuilt(pt_end1_new, pt_end2_new, tubeLayer, tube);
514  }
515 
516  // if there are deformation parameters ... apply them here
517  if (ms->hasBLines()) {
518 
519  // Get positions after the deformations applied
520  // first wire end point
521  pt_end1_new = posOnDefChamWire(pt_end1_new, width_narrow, width_wide, height, thickness, fixedPoint);
522 
523  // second wire end point
524  pt_end2_new = posOnDefChamWire(pt_end2_new, width_narrow, width_wide, height, thickness, fixedPoint);
525  }
526 
527  // Switch tube ends back to MGM coordinates
528  pt_end1 = fromAMDB * pt_end1;
529  pt_end2 = fromAMDB * pt_end2;
530  pt_end1_new = fromAMDB * pt_end1_new;
531  pt_end2_new = fromAMDB * pt_end2_new;
532 
533  // Calculate deformation. Make sure that the wire length stays the same.
534  // Code in positionOnDeformedChamber does not provide this by default.
535  // Break transformation into translation of the wire center and the rotation of the wire
536  // Move to the coordinate system originated at the wire center, then rotate the wire, then
537  // move wire center to the new position
538  const Amg::Vector3D pt_center_new = 0.5 * (pt_end1_new + pt_end2_new);
539  const Amg::Translation3D to_center{-pt_center};
540  const Amg::Translation3D from_center{pt_center_new};
541  const Amg::Vector3D old_direction = (pt_end2 - pt_end1).unit();
542  const Amg::Vector3D new_direction = (pt_end2_new - pt_end1_new).unit();
543  const Amg::Vector3D rotation_vector = old_direction.cross(new_direction);
544  if (rotation_vector.mag() > 10. * std::numeric_limits<double>::epsilon()) {
545  const Amg::AngleAxis3D wire_rotation(std::asin(rotation_vector.mag()), rotation_vector.unit());
546  return Amg::Transform3D{from_center * wire_rotation * to_center};
547  }
548  return Amg::Transform3D{from_center * Amg::getRotateX3D(std::asin(rotation_vector.mag())) * to_center};
549  }
550 
551  // //Correspondence to AMDB parameters -TBM
552  // //cpl_x is tr "trapezoidal effect"
553  // //cpl_y is sy "Longbeam vertical sagitta"
554  // //cpl_z is sz "Longbeam horizontal sagitta"
555  // //sag_x is ?? "shearing deformation"
556  // //sag_y is so,sv "RO crossplate sag, HV crossplate sag"
557  // //sag_z is ?? "different long-beam bow for short/long side"
558  // //the_g is tw "common twist angle for HV and RO side"
559  // //the_c is tw "torsion along tube axis"
560  // //the_m is tw "torsion along tube axis"
561  // //tem_g is T, "temperature"
562  // //tem_c is ev "HV elongation"
563  // //tem_m is eo "RO elongation"
564 
565  // /*
566  // CPM: mask-side cross plate (=readout side in endcap)
567  // CPC: CCD-side cross plate (=HV side in endcap)
568  // CPL: lens cross plate (=central cross plate)
569 
570  // note that nearly all deformation parameter names are meaningless
571  // */
573  const double width_narrow,
574  const double width_wide,
575  const double height,
576  const double thickness,
577  const Amg::Vector3D& fixedPoint) const {
578 
579  using Parameter = BLinePar::Parameter;
580  const double sp = m_BLinePar->getParameter(Parameter::sp);
581  const double sn = m_BLinePar->getParameter(Parameter::sn);
582  const double tw = m_BLinePar->getParameter(Parameter::tw);
583  const double eg = m_BLinePar->getParameter(Parameter::eg);
584  double ep = m_BLinePar->getParameter(Parameter::ep);
586  // S.Spagnolo Feb.6, 2011, modified by P.F Giraud, 2015-01-17
587  // This version does not implement deformations modifying only the second
588  // coordinate, or leaving the end-plug positions unchanged.
589  // This version should be called only with the coordinates of the end-plugs
590  // as argument, as is done in fromIdealToDeformed
591 
592  // MDT deformations like tube bow: bz,bp,bn bend the tube while the wire endpoints are not affected
593  // => the wire keeps it's nominal straight line trajectory but it is not concentric to the tube
594  // ==> in this function bz, bp and bn are ignored or set to 0
595  // MDT deformations that extend/contract the wire longitudinally (while keeping it straight):
596  // delta_s from eg and tr are irrelevant for the tube geometry
597  // and for the wire trajectory => set to 0 here
598  // (should be applied as a correction to the
599  // tube lenght => tube surface bounds
600  // =++>>>> effect in tracking just through the gravitational sagging TOTALLY NEGLIGIBLE=> ignore)
601  // pg is irrelevant for tracking purposes and (at least for the endcaps) is applies to the internal bars only, not to the tubes !!!
602  // =++>>>> IGNORE IT
603  // ep,en: bend the tube by moving (differently) the endplugs ===> the wire straight trajectory is moved w.r.t. the nominal one
604  // in addition the tubes keep their nominal position at the center => the wire is not concentric to
605  // the tube delta_s from ep,en must also be considered for the implementation of the realistic tube
606  // trajectory induced by ep,en
607  // tw,sp,sn,pg (for deltaT and deltaZ) are geometrical effects, that impact on tracking and keep the wire straight.
608 
609 
610 
611  Amg::Vector3D deformPos(locAMDBPos);
612 
613  // NOTE s0,z0,t0 are the coord. in the amdb frame of this point: the origin of the frame can be different than the fixed point for
614  // deformations s0mdt,z0mdt,t0mdt
615  // (always equal to the point at lowest t,z and s=0 of the MDT stack)
616  double s0 = locAMDBPos.x();
617  double z0 = locAMDBPos.y();
618  double t0 = locAMDBPos.z();
619  ATH_MSG_VERBOSE( "** In "<<__func__<<" - width_narrow, width_wide, length, thickness, " << width_narrow << " " << width_wide
620  << " " << height << " " << thickness << " " );
621  ATH_MSG_VERBOSE( "** In "<<__func__<<" - going to correct for B-line the position of Point at " << s0 << " " << z0 << " "
622  << t0 << " in the amdb-szt frame" );
623 
624  double s0mdt = s0; // always I think !
625  if (std::abs(fixedPoint.x()) > 0.01) s0mdt = s0 - fixedPoint.x();
626  double z0mdt = z0; // unless in the D section of this station there's a dy diff. from 0 for the innermost MDT multilayer (sometimes
627  // in the barrel)
628  if (std::abs(fixedPoint.y()) > 0.01) z0mdt = z0 - fixedPoint.y();
629  double t0mdt =
630  t0; // unless in the D section of this station there's a dz diff. from 0 for the innermost MDT multilayer (often in barrel)
631  if (std::abs(fixedPoint.z()) > 0.01) t0mdt = t0 - fixedPoint.z();
632  if (z0mdt < 0 || t0mdt < 0) {
633  ATH_MSG_WARNING(""<<__func__<<": correcting the local position of a point outside the mdt station (2 multilayers) volume -- RE "
634  << idHelperSvc()->toStringDetEl(identify()) << " local point: szt=" << s0 << " " << z0 << " " << t0
635  << " fixedPoint " << fixedPoint );
636  }
637  ATH_MSG_VERBOSE( "** In "<<__func__<<" - correct for offset of B-line fixed point " << s0mdt << " " << z0mdt << " " << t0mdt);
638 
639  double ds{0.},dz{0.},dt{0.};
640  double width_actual = width_narrow + (width_wide - width_narrow) * (z0mdt / height);
641  double s_rel = s0mdt / (width_actual / 2.);
642  double z_rel = (z0mdt - height / 2.) / (height / 2.);
643  double t_rel = (t0mdt - thickness / 2.) / (thickness / 2.);
644 
645  ATH_MSG_VERBOSE( "** In "<<__func__<<" - width_actual, s_rel, z_rel, t_rel " << width_actual << " " << s_rel << " "
646  << z_rel << " " << t_rel );
647 
648  // sp, sn - cross plate sag out of plane
649  if ((sp != 0) || (sn != 0)) {
650  double ztmp = z_rel * z_rel - 1;
651  dt += 0.5 * (sp + sn) * ztmp + 0.5 * (sp - sn) * ztmp * s_rel;
652  }
653 
654  // tw - twist
655  if (tw != 0) {
656  dt -= tw * s_rel * z_rel;
657  dz += tw * s_rel * t_rel * thickness / height;
658  ATH_MSG_VERBOSE( "** In "<<__func__<<": tw=" << tw << " dt, dz " << dt << " " << dz );
659  }
660 
661  // eg - global expansion
662  if (eg != 0) {
663  double egppm = eg / 1000.;
664  ds += 0.;
665  dz += z0mdt * egppm;
666  dt += t0mdt * egppm;
667  }
668 
669  // ep, en - local expansion
670  //
671  // Imporant note: the chamber height and length, as they denoted in Christoph's talk,
672  // correspond to thickness and height parameters of this function;
673  //
674 
675  if ((ep != 0) || (en != 0)) {
676  ep = ep / 1000.;
677  en = en / 1000.;
678  double phi = 0.5 * (ep + en) * s_rel * s_rel + 0.5 * (ep - en) * s_rel;
679  double localDt = phi * (t0mdt - thickness / 2.);
680  double localDz = phi * (z0mdt - height / 2.);
681  dt += localDt;
682  dz += localDz;
683  }
684 
685  ATH_MSG_VERBOSE( "posOnDefChamStraighWire: ds,z,t = " << ds << " " << dz << " " << dt );
686  deformPos[0] = s0 + ds;
687  deformPos[1] = z0 + dz;
688  deformPos[2] = t0 + dt;
689 
690  return deformPos;
691  }
692 
693 // Function to apply AsBuilt parameter correction to wire center and end position
694 // For definitions of AsBuilt parameters see Florian Bauer's talk:
695 // http://atlas-muon-align.web.cern.ch/atlas-muon-align/endplug/asbuilt.pdf
696 #if defined(FLATTEN)
697  // We compile this package with optimization, even in debug builds; otherwise,
698  // the heavy use of Eigen makes it too slow. However, from here we may call
699  // to out-of-line Eigen code that is linked from other DSOs; in that case,
700  // it would not be optimized. Avoid this by forcing all Eigen code
701  // to be inlined here if possible.
703 #endif
704  void
706  const int tubeLayer, const int tube) const {
708  if (!params) {
709  ATH_MSG_WARNING( "Cannot find Mdt AsBuilt parameters for chamber " << idHelperSvc()->toStringDetEl(identify()) );
710  return;
711  }
712 
713  ATH_MSG_VERBOSE( "Applying as-built parameters for chamber " << idHelperSvc()->toStringDetEl(identify())
714  << " tubeLayer=" << tubeLayer << " tube=" << tube);
715 
716  constexpr int nsid = 2;
717  using tubeSide_t = MdtAsBuiltPar::tubeSide_t;
718  using multilayer_t = MdtAsBuiltPar::multilayer_t;
719  std::array<MdtAsBuiltPar::tubeSide_t, nsid> tubeSide{tubeSide_t::POS, tubeSide_t::NEG};
720  std::array<Amg::Vector3D, nsid> wireEnd{locAMDBWireEndP, locAMDBWireEndN};
721  multilayer_t ml = (getMultilayer() == 1) ? multilayer_t::ML1 : multilayer_t::ML2;
722 
723  for (int isid = 0; isid < nsid; ++isid) { // first s>0 then s<0
724  // Compute the reference for the as-built parameters
725  double xref{0.}, yref{0.}, zref{0.};
726  int ref_layer = (ml == multilayer_t::ML1) ? m_nlayers : 1;
727  double y_offset = (ml == multilayer_t::ML1) ? outerTubeRadius() : -outerTubeRadius();
728  double xmin = *std::min_element(m_firstwire_x.begin(), m_firstwire_x.begin() + m_nlayers) - outerTubeRadius();
729  if (barrel()) {
730  xref = -m_Rsize / 2. + m_firstwire_y[ref_layer - 1] + y_offset;
731  zref = -m_Zsize / 2. + xmin;
732  } else {
733  xref = -m_Zsize / 2. + m_firstwire_y[ref_layer - 1] + y_offset;
734  zref = -m_Rsize / 2. + xmin;
735  }
737  Amg::Vector3D reference_point{xref, yref, zref};
738  ATH_MSG_VERBOSE("AMDB transform "<<" "<<idHelperSvc()->toStringDetEl(identify())<<
739  " "<<GeoTrf::toString(toAMDB, true)<<", reference point: "<<Amg::toString(reference_point));
740 
741  reference_point = toAMDB * reference_point;
742 
743  if (isid == 0)
744  reference_point = reference_point + 0.5 * getNominalTubeLengthWoCutouts(ref_layer, 1) * Amg::Vector3D::UnitX();
745  else
746  reference_point = reference_point -0.5 * getNominalTubeLengthWoCutouts(ref_layer, 1) * Amg::Vector3D::UnitX();
747  int layer_delta = tubeLayer;
748  if (ml == multilayer_t::ML1) layer_delta = m_nlayers + 1 - tubeLayer;
749 
750  // Get the As-Built parameters for this ML and side of the chamber
751  double zpitch = params->zpitch(ml, tubeSide[isid]);
752  double ypitch = params->ypitch(ml, tubeSide[isid]);
753  double stagg = (double)params->stagg(ml, tubeSide[isid]);
754  double alpha = params->alpha(ml, tubeSide[isid]);
755  double y0 = params->y0(ml, tubeSide[isid]);
756  double z0 = params->z0(ml, tubeSide[isid]);
757 
758  // Find the vector from the reference_point to the endplug
759  int do_stagg = (layer_delta - 1) % 2; // 0 for layer 1 and 3, 1 for layer 2 and 4
760  double offset_stagg = ((double)do_stagg) * 0.5 * zpitch * stagg;
761  Amg::Vector3D end_plug(0., (tube - 1.0) * zpitch + offset_stagg, (layer_delta - 1) * ypitch);
762 
763  const Amg::Transform3D amgTransf{Amg::getRotateX3D(-alpha)};
764  end_plug = amgTransf * end_plug;
765 
766  // Calculate x position, which varies for endcap chambers
767  double xshift = 0.;
768  if (isid == 0)
769  xshift = 0.5 * getNominalTubeLengthWoCutouts(tubeLayer, tube) - 0.5 * getNominalTubeLengthWoCutouts(ref_layer, 1);
770  else
771  xshift = -0.5 * getNominalTubeLengthWoCutouts(tubeLayer, tube) + 0.5 * getNominalTubeLengthWoCutouts(ref_layer, 1);
772 
773  Amg::Vector3D ret(reference_point.x() + xshift, reference_point.y() + z0 + end_plug.y(),
774  reference_point.z() + y0 + end_plug.z());
775 
776  // Warn if result of calculation is too far off
777  // BIL1A13 has as-built parameters up to 3mm off, giving the size of the cut
778  if ((ret - wireEnd[isid]).mag() > 3. * CLHEP::mm) {
779  ATH_MSG_WARNING( "Large as-built correction for chamber " << idHelperSvc()->toStringDetEl(identify()) << ", side "
780  << isid << ", Delta " << Amg::toString(ret - wireEnd[isid]) );
781  }
782 
783  // Save the result
784  if (tubeSide[isid] == tubeSide_t::POS)
785  locAMDBWireEndP = ret;
786  else
787  locAMDBWireEndN = ret;
788  }
789  }
790  std::unique_ptr<MdtReadoutElement::GeoInfo> MdtReadoutElement::makeGeoInfo(const int tubeLayer, const int tube) const {
792  return std::make_unique<GeoInfo>(std::move(transform));
793  }
794 
795  const MdtReadoutElement::GeoInfo& MdtReadoutElement::geoInfo(const int tubeLayer, const int tube) const {
796  size_t itube = (tubeLayer - 1) * m_ntubesperlayer + tube - 1;
797  if (itube >= m_tubeGeo.size()) {
798  ATH_MSG_WARNING(__func__<<"() :"<<__LINE__<<" called with tubeLayer or tube out of range in chamber "
799  << idHelperSvc()->toStringDetEl(identify()) << " : layer " << tubeLayer << " max " << m_nlayers << " tube " << tube
800  << " max " << m_ntubesperlayer << " will compute transform for first tube in this chamber" );
801  ATH_MSG_WARNING( "Please run in DEBUG mode to get extra diagnostic" );
802  itube = 0;
803  }
804 
805  const CxxUtils::CachedUniquePtr<GeoInfo>& ptr = m_tubeGeo.at(itube);
806  if (!ptr) {
807  ptr.set(makeGeoInfo(tubeLayer, tube));
808  if (!m_haveTubeGeo) m_haveTubeGeo = true;
809  }
810  return *ptr;
811  }
812 
813  const Amg::Transform3D& MdtReadoutElement::transform(const int tubeLayer, const int tube) const {
814  return geoInfo(tubeLayer, tube).m_transform;
815  }
816 
817  const Trk::SaggedLineSurface& MdtReadoutElement::surface(const int tubeLayer, const int tube) const {
818 
819  int ntot_tubes = m_nlayers * m_ntubesperlayer;
820  int itube = (tubeLayer - 1) * m_ntubesperlayer + tube - 1;
821  // consistency checks
822  if (itube >= ntot_tubes) {
823  ATH_MSG_WARNING( "surface called with tubeLayer or tube out of range in chamber "
824  << idHelperSvc()->toStringDetEl(identify()) << " : layer " << tubeLayer << " max " << m_nlayers << " tube " << tube
825  << " max " << m_ntubesperlayer << " will compute surface for first tube in this chamber" );
826  ATH_MSG_WARNING( "Please run in DEBUG mode to get extra diagnostic" );
827  itube = 0;
828  }
829 
831  if (!ptr) {
832  double wireTension = 350;
833  if (getStationIndex() == m_stIdx_BOL) wireTension = 285;
834  Identifier id = m_idHelper.channelID(identify(), getMultilayer(), tubeLayer, tube);
835  ptr.set(std::make_unique<Trk::SaggedLineSurface>(*this, id, getWireLength(tubeLayer, tube), wireTension, linearDensity));
837  }
838  return *ptr;
839  }
840  const Trk::CylinderBounds& MdtReadoutElement::bounds(const int tubeLayer, const int tube) const {
841  int istep = 0;
842  int ntot_steps = m_nsteps;
843 
844  if (hasCutouts() && manager()->MinimalGeoFlag() == 0) {
845  ntot_steps = m_nlayers * m_ntubesperlayer;
846  istep = (tubeLayer - 1) * m_ntubesperlayer + tube - 1;
847  } else {
848  if (endcap()) istep = int((tube - 1) / m_ntubesinastep);
849 
850  if (istep < 0 || istep >= ntot_steps) {
851  ATH_MSG_WARNING( "bounds for Element named "<< " with tech. " << getTechnologyType()
852  << " DEid = " << idHelperSvc()->toStringDetEl(identify()) << " called with: tubeL, tube " << tubeLayer << " " << tube
853  << "; step " << istep << " out of range 0-" << m_nsteps - 1 << " m_ntubesinastep " << m_ntubesinastep );
854  ATH_MSG_WARNING( "Please run in DEBUG mode to get extra diagnostic; setting istep = 0" );
855  }
856  }
857  if ((unsigned int)istep >= m_tubeBounds.size()) {
858  THROW_EXCEPTION(__func__<<"("<<tubeLayer<<","<<tube<<") but m_tubeBounds.size()="<<m_tubeBounds.size()<<" for "<<
859  idHelperSvc()->toStringDetEl(identify()));
860  }
862  if (!ptr) {
863  double tubelength = getTubeLengthForCaching(tubeLayer, tube);
864  ptr.set(std::make_unique<Trk::CylinderBounds>(innerTubeRadius(), 0.5 * tubelength - m_deadlength));
865  if (!m_haveTubeBounds) m_haveTubeBounds = true;
866  }
867  return *ptr;
868  }
869  const Amg::Vector3D& MdtReadoutElement::center(const int tubeLayer, const int tube) const { return geoInfo(tubeLayer, tube).m_center; }
871  if (!m_elemNormal.isValid()) { m_elemNormal.set(transform().linear() * Amg::Vector3D::UnitX()); }
872  return *m_elemNormal.ptr();
873  }
874 
876  if (!m_associatedSurface) {
877  Amg::RotationMatrix3D muonTRotation(transform().rotation());
878  Amg::RotationMatrix3D surfaceTRotation;
879  surfaceTRotation.col(0) = muonTRotation.col(1);
880  surfaceTRotation.col(1) = muonTRotation.col(2);
881  surfaceTRotation.col(2) = muonTRotation.col(0);
882 
883  Amg::Transform3D trans3D(surfaceTRotation);
884  trans3D.pretranslate(transform().translation());
885 
886  if (barrel()) {
887  m_associatedSurface.set(std::make_unique<Trk::PlaneSurface>(Amg::Transform3D(trans3D), getSsize() * 0.5,
888  getZsize() * 0.5));
889  } else {
890  m_associatedSurface.set(std::make_unique<Trk::PlaneSurface>(Amg::Transform3D(trans3D), getSsize() * 0.5,
891  getLongSsize() * 0.5,
892  getRsize() * 0.5));
893  }
894  }
895  return *m_associatedSurface;
896  }
897 
898  const Amg::Vector3D& MdtReadoutElement::center() const { return surface().center(); }
899 
901  if (!m_associatedBounds) {
902  if (barrel()) {
903  m_associatedBounds.set(
904  std::make_unique<Trk::RectangleBounds>(getSsize() / 2., getZsize() / 2.));
905  } else {
906  m_associatedBounds.set(std::make_unique<Trk::TrapezoidBounds>(
907  getSsize() / 2., getLongSsize() / 2., getRsize() / 2.));
908  }
909  }
910  return *m_associatedBounds;
911  }
913  ATH_MSG_DEBUG( "Clearing cache for ReadoutElement " << idHelperSvc()->toStringDetEl(identify()) );
914  if (m_associatedSurface) {
915  m_associatedSurface.release();
916  }
917  else ATH_MSG_VERBOSE( "no associated surface to be deleted" );
918 
919  if (m_associatedBounds) {
920  m_associatedBounds.release();
921  } ATH_MSG_VERBOSE( "no associated bounds to be deleted" );
923  if (m_haveTubeSurfaces) {
924  m_haveTubeSurfaces = false;
925  for (auto& s : m_tubeSurfaces) { s.release(); }
926  }
927  if (m_haveTubeGeo) {
928  m_haveTubeGeo = false;
929  for (auto& g : m_tubeGeo) { g.release(); }
930  }
931  if (m_haveTubeBounds) {
932  m_haveTubeBounds = false;
933  for (auto& b : m_tubeBounds) { b.release(); }
934  }
935  // reset here the deform-related transforms
936  if (m_haveDeformTransf) {
937  m_haveDeformTransf = false;
938  for (auto& d : m_deformTransf) { d.release(); }
939  }
940  }
941 
943  ATH_MSG_DEBUG( "Setting B-line for " << idHelperSvc()->toStringDetEl(identify()) );
944  if (m_BLinePar == bLine) {
945  return;
946  }
947  m_BLinePar = bLine;
948  refreshCache();
949  }
950 
952  ATH_MSG_DEBUG( "Filling cache for ReadoutElement " << idHelperSvc()->toStringDetEl(identify()));
953 
954  const Trk::PlaneSurface* tmpSurface = dynamic_cast<const Trk::PlaneSurface*>(&surface()); //<! filling m_associatedSurface
955  const Trk::SurfaceBounds* tmpBounds = nullptr; //<! filling m_associatedBounds
956  if (barrel())
957  tmpBounds = dynamic_cast<const Trk::RectangleBounds*>(&bounds());
958  else
959  tmpBounds = dynamic_cast<const Trk::TrapezoidBounds*>(&bounds());
960  ATH_MSG_VERBOSE( "global Surface / Bounds pointers " << tmpSurface << " " << tmpBounds );
961  ATH_MSG_VERBOSE( "global Normal " << normal() );
962 
963  const Trk::CylinderBounds* tmpCil = nullptr;
964  const Trk::SaggedLineSurface* tmpSaggL = nullptr;
966  Amg::Transform3D myTransform{Amg::Transform3D::Identity()};
967  for (int tl = 1; tl <= getNLayers(); ++tl) {
968  for (int tube = 1; tube <= getNtubesperlayer(); ++tube) {
969  // in case of BMG chambers, do not check the 'dead' tubes
970  // (the tubes are numbered from 1-54 for each however there are cutouts for the
971  // alignment system where no tubes are built-in, meaning, those tubes do not exist/are 'dead')
972  if (manager()->mdtIdHelper()->isBMG(identify())) {
973  PVConstLink cv = getMaterialGeom();
974  // usually the tube number corresponds to the child number, however for
975  // BMG chambers full tubes are skipped during the building process
976  // therefore the matching needs to be done via the volume ID
977  int packed_id = tube + maxNTubesPerLayer * tl;
978  bool found = false;
979  geoGetIds(
980  [&](int id) {
981  if (!found && id == packed_id) {
982  myTransform = transform(tl, tube); //<! filling m_tubeTransf
983  myPoint = center(tl, tube); //<! filling m_tubeCenter
984  tmpCil = dynamic_cast<const Trk::CylinderBounds*>(&bounds(tl, tube)); //<! filling m_tubeBounds
985  tmpSaggL = dynamic_cast<const Trk::SaggedLineSurface*>(&surface(tl, tube)); //<! filling m_tubeSurfaces
986  found = true;
987  }
988  },
989  &*cv);
990  if (found) {
991  ATH_MSG_VERBOSE( "tubeLayer/tube " << tl << " " << tube << " transform at origin "
992  << Amg::toString(myTransform.linear()) );
993  ATH_MSG_VERBOSE( "tubeLayer/tube " << tl << " " << tube << " tube center " << myPoint );
994  ATH_MSG_VERBOSE( "tubeLayer/tube " << tl << " " << tube << " tube bounds pointer " << tmpCil );
995  ATH_MSG_VERBOSE( "tubeLayer/tube " << tl << " " << tube << " tube surface pointer " << tmpSaggL );
996  }
997  } else {
998  // print in order to compute !!!
999  myTransform = transform(tl, tube); //<! filling m_tubeTransf
1000  myPoint = center(tl, tube); //<! filling m_tubeCenter
1001  tmpCil = dynamic_cast<const Trk::CylinderBounds*>(&bounds(tl, tube)); //<! filling m_tubeBounds
1002  tmpSaggL = dynamic_cast<const Trk::SaggedLineSurface*>(&surface(tl, tube)); //<! filling m_tubeSurfaces
1003  ATH_MSG_VERBOSE( "tubeLayer/tube " << tl << " " << tube << " transform at origin "
1004  << Amg::toString(myTransform.translation()) );
1005  ATH_MSG_VERBOSE( "tubeLayer/tube " << tl << " " << tube << " tube center " << myPoint );
1006  ATH_MSG_VERBOSE( "tubeLayer/tube " << tl << " " << tube << " tube bounds pointer " << tmpCil );
1007  ATH_MSG_VERBOSE( "tubeLayer/tube " << tl << " " << tube << " tube surface pointer " << tmpSaggL );
1008  }
1009  }
1010  }
1011  }
1012 
1014  if (idHelperSvc()->detElId(id) != identify()) return false;
1015  int layer = m_idHelper.tubeLayer(id);
1016  if (layer < 1 || layer > getNLayers()) return false;
1017  int tube = m_idHelper.tube(id);
1018  return tube >= 1 && tube <= getNtubesperlayer();
1019  }
1020 
1021  // **************************** interfaces related to Tracking *****************************************************)
1022 
1023 } // namespace MuonGM
MdtIdHelper::isBMG
bool isBMG(const Identifier &id) const
is this a BMG chamber
Definition: MdtIdHelper.cxx:734
TrapezoidBounds.h
MuonGM::MdtReadoutElement::wireEndpointsAsBuilt
void wireEndpointsAsBuilt(Amg::Vector3D &locAMDBWireEndP, Amg::Vector3D &locAMDBWireEndN, const int tubelayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:705
Trk::RectangleBounds
Definition: RectangleBounds.h:38
MuonGM::MdtReadoutElement::geoInitDone
void geoInitDone()
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:93
MdtReadoutElement.h
MuonGM::MdtReadoutElement::m_firstwire_x
std::array< double, maxnlayers > m_firstwire_x
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:228
CxxUtils::CachedValue::reset
void reset()
Reset the value to invalid.
checkxAOD.ds
ds
Definition: Tools/PyUtils/bin/checkxAOD.py:257
MuonGM::MdtReadoutElement::getNLayers
int getNLayers() const
Returns the number of tube layers inside the multilayer.
MuonGM::MuonDetectorManager::MinimalGeoFlag
int MinimalGeoFlag() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:242
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CxxUtils::CachedValue::ptr
const T * ptr() const
Return a pointer to the cached value.
MuonGM::MdtReadoutElement::m_ntubesinastep
int m_ntubesinastep
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:221
inline_hints.h
MuonGM::MdtReadoutElement::center
virtual const Amg::Vector3D & center() const override final
Return the center of the element.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:898
MuonGM::MdtReadoutElement::m_stIdx_BOL
const int m_stIdx_BOL
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:212
MuonGM::MuonReadoutElement::m_Zsize
double m_Zsize
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:145
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
MuonGM::MdtReadoutElement::m_deformTransf
std::vector< CxxUtils::CachedUniquePtr< Amg::Transform3D > > m_deformTransf
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:253
MuonGM::MdtReadoutElement::geoInfo
const GeoInfo & geoInfo(const int tubeLayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:795
RectangleBounds.h
ParticleTest.eg
eg
Definition: ParticleTest.py:29
MuonGM::MdtReadoutElement::MdtReadoutElement
MdtReadoutElement(GeoVFullPhysVol *pv, const std::string &stName, MuonDetectorManager *mgr)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:60
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
MuonGM::MdtReadoutElement::innerTubeRadius
double innerTubeRadius() const
Returns the inner tube radius excluding the aluminium walls.
MuonGM::MdtReadoutElement::makeGeoInfo
std::unique_ptr< GeoInfo > makeGeoInfo(const int tubelayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:790
MuonGM::MdtReadoutElement::localROPos
Amg::Vector3D localROPos(const Identifier &id) const
MuonGM::MdtReadoutElement::isAtReadoutSide
int isAtReadoutSide(const Amg::Vector3D &GlobalHitPosition, const Identifier &id) const
MuonGM::MdtReadoutElement::m_ntubesperlayer
int m_ntubesperlayer
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:219
hist_file_dump.d
d
Definition: hist_file_dump.py:137
Trk::SurfaceBounds
Definition: SurfaceBounds.h:47
CxxUtils::CachedValue::isValid
bool isValid() const
Test to see if the value is valid.
MuonGM::MdtReadoutElement::localNominalTubePosWoCutouts
Amg::Vector3D localNominalTubePosWoCutouts(const int tubelayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:421
MuonGM::MdtReadoutElement::m_haveTubeBounds
std::atomic< bool > m_haveTubeBounds
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:266
MuonGM::MdtReadoutElement::tubePitch
double tubePitch() const
Returns the distance between 2 tubes in a tube layer.
CxxUtils::CachedUniquePtrT
Cached pointer with atomic update.
Definition: CachedUniquePtr.h:54
MuonGM::MdtReadoutElement::globalTransform
Amg::Transform3D globalTransform(const Amg::Vector3D &tubePos, const Amg::Transform3D &toDeform) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:391
MuonGM::MuonReadoutElement::largeSector
bool largeSector() const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:49
MuonGM::MdtReadoutElement::getWireFirstLocalCoordAlongZ
bool getWireFirstLocalCoordAlongZ(int tubeLayer, double &coord) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:80
MuonGM::MdtReadoutElement::m_haveTubeGeo
std::atomic< bool > m_haveTubeGeo
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:265
MuonGM::MdtReadoutElement::RODistanceFromTubeCentre
double RODistanceFromTubeCentre(const Identifier &id) const
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
MuonGM::MuonReadoutElement::m_Ssize
double m_Ssize
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:143
MuonGM::MuonReadoutElement::getZsize
double getZsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:198
MuonGM::MdtReadoutElement::bounds
virtual const Trk::SurfaceBounds & bounds() const override final
Return the boundaries of the element.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:900
MuonGM::MdtReadoutElement::nodeform_localTubePos
Amg::Vector3D nodeform_localTubePos(const Identifier &id) const
MuonGM::MdtReadoutElement::nodeform_localToGlobalTransf
Amg::Transform3D nodeform_localToGlobalTransf(const Identifier &id) const
MuonGM::MdtReadoutElement::m_idHelper
const MdtIdHelper & m_idHelper
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:210
deg
#define deg
Definition: SbPolyhedron.cxx:17
MdtAsBuiltPar::multilayer_t
multilayer_t
MDT multi-layer index.
Definition: MdtAsBuiltPar.h:28
MdtIdHelper::tubeLayer
int tubeLayer(const Identifier &id) const
Definition: MdtIdHelper.cxx:724
MuonGM::MdtReadoutElement::getTubeLengthForCaching
double getTubeLengthForCaching(const int tubeLayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:103
CxxUtils::CachedUniquePtrT::set
T * set(std::unique_ptr< T > elt) const
Atomically set the element.
MuonGM::MdtReadoutElement::barrel
bool barrel() const
Returns whether the chamber is in the barrel (Assement on first later in stationName)
MuonGM::MdtReadoutElement::transform
virtual const Amg::Transform3D & transform() const override final
Return local to global transform.
MuonGM::MdtReadoutElement::m_tubeBounds
std::vector< CxxUtils::CachedUniquePtr< Trk::CylinderBounds > > m_tubeBounds
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:258
MuonGM::MdtReadoutElement::m_zsignRO_tubeFrame
CxxUtils::CachedValue< int > m_zsignRO_tubeFrame
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:232
BLinePar::getParameter
float getParameter(const Parameter p) const
Returns a given parameter.
Definition: BLinePar.h:39
MuonGM::MdtReadoutElement::normal
virtual const Amg::Vector3D & normal() const override final
Return the normal of the element.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:870
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition: MMReadoutElement.cxx:48
Trk::Surface::center
const Amg::Vector3D & center() const
Returns the center position of the Surface.
MuonGM::MuonReadoutElement::getLongSsize
double getLongSsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:199
GeoGetIds.h
Visitor to collect all IDs under a GeoModel node.
x
#define x
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
MuonGM::MdtReadoutElement::GeoInfo
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:242
MuonGM::MdtReadoutElement::m_cutoutShift
double m_cutoutShift
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:223
MuonGM::MdtReadoutElement::surfaces
std::vector< const Trk::Surface * > surfaces() const
returns all the surfaces contained in this detector element
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:70
MuonGM::MdtReadoutElement::m_firstwire_y
std::array< double, maxnlayers > m_firstwire_y
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:229
MuonGM::MdtReadoutElement::distanceFromRO
double distanceFromRO(const Amg::Vector3D &GlobalHitPosition, const Identifier &id) const
MuonGM::MuonReadoutElement
Base class for the XxxReadoutElement, with Xxx = Mdt, Rpc, Tgc, Csc.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:40
MuonGM::MdtReadoutElement::deformedTransform
Amg::Transform3D deformedTransform(const int tubelayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:461
MuonGM::MuonReadoutElement::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:136
MuonGM::MdtReadoutElement::globalToLocalTransf
Amg::Transform3D globalToLocalTransf(const int tubeLayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:400
MuonGM::MuonReadoutElement::getSsize
double getSsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:196
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
MuonGM::MdtReadoutElement::getWireLength
double getWireLength(const int tubeLayer, const int tube) const
python.changerun.kk
list kk
Definition: changerun.py:41
MuonGM::MdtReadoutElement::nodeform_tubePos
Amg::Vector3D nodeform_tubePos(const Identifier &id) const
Returns the global position of the tube excluding the B-line & As-built corrections.
MuonGM::MuonReadoutElement::refreshCache
void refreshCache()
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:177
Amg::getRotateX3D
Amg::Transform3D getRotateX3D(double angle)
get a rotation transformation around X-axis
Definition: GeoPrimitivesHelpers.h:252
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MuonGM::MdtReadoutElement::clearCache
void clearCache() override final
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:912
MuonGM::MuonReadoutElement::getStationName
const std::string & getStationName() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:190
MuonGM::MdtReadoutElement::fromIdealToDeformed
const Amg::Transform3D & fromIdealToDeformed(const int tubelayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:433
MuonGM::MdtReadoutElement::m_haveTubeSurfaces
std::atomic< bool > m_haveTubeSurfaces
Flag whether any elements have been inserted into the corresponding vectors.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:264
MuonGM::MdtReadoutElement::m_haveDeformTransf
std::atomic< bool > m_haveDeformTransf
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:267
MuonGM::MdtReadoutElement::localTubePos
Amg::Vector3D localTubePos(const Identifier &id) const
xmin
double xmin
Definition: listroot.cxx:60
MuonGM::MdtReadoutElement::clearBLinePar
void clearBLinePar()
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:69
MuonGM::Mdt
Definition: Mdt.h:23
MuonGM::MuonReadoutElement::m_Rsize
double m_Rsize
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:144
MuonGM::MdtReadoutElement::GeoInfo::m_transform
Amg::Transform3D m_transform
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:244
ATH_FLATTEN
#define ATH_FLATTEN
Definition: inline_hints.h:52
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
ret
T ret(T t)
Definition: rootspy.cxx:260
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonGM::MdtReadoutElement::m_tubeSurfaces
std::vector< CxxUtils::CachedUniquePtr< Trk::SaggedLineSurface > > m_tubeSurfaces
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:257
CaloNoise_fillDB.dt
dt
Definition: CaloNoise_fillDB.py:58
xAOD::rotation
rotation
Definition: TrackSurface_v1.cxx:15
Trk::CylinderBounds
Definition: CylinderBounds.h:46
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MuonGM::MuonReadoutElement::parentMuonStation
const MuonStation * parentMuonStation() const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:135
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
dumpNswErrorDb.linear
def linear
Definition: dumpNswErrorDb.py:23
MuonGM::MuonStation
Definition: MuonStation.h:51
MuonGM::MdtReadoutElement::m_stIdx_BIS
const int m_stIdx_BIS
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:211
MuonGM::MdtReadoutElement::outerTubeRadius
double outerTubeRadius() const
Returns the tube radius taking the thickness of the tubes into account.
MuonGM::MdtReadoutElement::setNLayers
void setNLayers(const int nl)
Sets the number of layers.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:68
MdtIdHelper::tube
int tube(const Identifier &id) const
Definition: MdtIdHelper.cxx:726
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:127
MuonGM::MdtReadoutElement::m_elemNormal
CxxUtils::CachedValue< Amg::Vector3D > m_elemNormal
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:256
MdtIdHelper.h
MuonGM::MuonStation::getNativeToAmdbLRS
const Amg::Transform3D & getNativeToAmdbLRS() const
Definition: MuonStation.h:182
Trk::DetectorElemType
DetectorElemType
Definition: TrkDetElementBase.h:39
MuonGM::MdtReadoutElement::getMultilayer
int getMultilayer() const
Returns the multilayer represented by the readout element.
MuonGM::MuonReadoutElement::manager
const MuonDetectorManager * manager() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:204
MuonGM::MuonReadoutElement::getTechnologyType
std::string getTechnologyType() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:187
MuonGM::MuonDetectorManager::mdtIdHelper
const MdtIdHelper * mdtIdHelper() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:221
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
MuonGM::MdtReadoutElement::m_deadlength
double m_deadlength
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:225
MuonGM::MdtReadoutElement::m_inBarrel
bool m_inBarrel
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:226
MuonGM::MdtReadoutElement::signedRODistanceFromTubeCentre
double signedRODistanceFromTubeCentre(const Identifier &id) const
BLinePar
Definition: BLinePar.h:14
MuonGM::MdtReadoutElement::fillCache
void fillCache() override final
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:951
MuonGM::MuonReadoutElement::setStationName
void setStationName(const std::string &)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:169
MuonGM::MuonReadoutElement::m_LongSsize
double m_LongSsize
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:146
MdtAsBuiltPar::tubeSide_t
tubeSide_t
MDT tube side.
Definition: MdtAsBuiltPar.h:33
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
MuonGM::MdtReadoutElement::posOnDefChamWire
Amg::Vector3D posOnDefChamWire(const Amg::Vector3D &locAMDBPos, const double width_narrow, const double width_wide, const double height, const double thickness, const Amg::Vector3D &fixedPoint) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:572
MuonGM::MdtReadoutElement::m_BLinePar
const BLinePar * m_BLinePar
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:255
MdtIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
Definition: MdtIdHelper.cxx:659
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
PlotCalibFromCool.en
en
Definition: PlotCalibFromCool.py:399
MuonGM::MdtReadoutElement::getNominalTubeLengthWoCutouts
double getNominalTubeLengthWoCutouts(const int tubeLayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:407
MuonGM::MdtReadoutElement::m_tubeGeo
std::vector< CxxUtils::CachedUniquePtr< GeoInfo > > m_tubeGeo
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:251
MuonGM::MdtReadoutElement::setBLinePar
void setBLinePar(const BLinePar *bLine)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:942
MuonGM::MdtReadoutElement::endcap
bool endcap() const
Returns whether the chamber is in the endcap.
CxxUtils::CachedValue::set
void set(const T &val) const
Set the value, assuming it is currently invalid.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGM::MdtReadoutElement::tubeToMultilayerTransf
Amg::Transform3D tubeToMultilayerTransf(const Identifier &id) const
MuonGM::MdtReadoutElement::nodeform_globalToLocalTransf
Amg::Transform3D nodeform_globalToLocalTransf(const Identifier &id) const
JetVoronoiDiagramHelpers::coord
double coord
Definition: JetVoronoiDiagramHelpers.h:45
Trk::TrapezoidBounds
Definition: TrapezoidBounds.h:43
MuonGM::MdtReadoutElement::m_associatedBounds
CxxUtils::CachedUniquePtr< Trk::SurfaceBounds > m_associatedBounds
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:271
MuonGM::MdtReadoutElement::ROPos
Amg::Vector3D ROPos(const int tubelayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:288
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
MuonGM::MdtReadoutElement::tubeFrame_localROPos
Amg::Vector3D tubeFrame_localROPos(const int tubelayer, const int tube) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:282
CylinderBounds.h
BLinePar::Parameter
Parameter
Definition: BLinePar.h:21
MuonGM::MuonReadoutElement::toParentStation
Amg::Transform3D toParentStation() const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:117
geoGetIds
void geoGetIds(FUNCTION f, const GeoGraphNode *node, int depthLimit=1)
Template helper for running the visitor.
Definition: GeoGetIds.h:82
BLinePar.h
MuonGM::MuonReadoutElement::getStationIndex
int getStationIndex() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:192
MdtAsBuiltPar
Container classifier the MDT as-built parameters See parameter description in http://atlas-muon-align...
Definition: MdtAsBuiltPar.h:18
MuonGM::MdtReadoutElement::tubePos
Amg::Vector3D tubePos(const Identifier &id) const
Returns the global position of the given tube.
MuonGM::MdtReadoutElement::getWireFirstLocalCoordAlongR
bool getWireFirstLocalCoordAlongR(int tubeLayer, double &coord) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:86
MuonGM::MuonReadoutElement::getRsize
double getRsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:197
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
MuonGM::MdtReadoutElement::m_tubelength
std::array< double, maxnsteps > m_tubelength
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:227
MuonGM::MdtReadoutElement::m_multilayer
int m_multilayer
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:215
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::PlaneSurface
Definition: PlaneSurface.h:64
MuonGM::MdtReadoutElement::setMultilayer
void setMultilayer(const int ml)
Sets the multilayer number.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:67
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
PlaneSurface.h
GeoPrimitivesHelpers.h
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:20
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
MuonGM::MuonReadoutElement::identify
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:184
MuonGM::MuonStation::getMdtAsBuiltParams
const MdtAsBuiltPar * getMdtAsBuiltParams() const
Definition: MuonStation.cxx:371
MuonGM::MdtReadoutElement::surface
virtual const Trk::Surface & surface() const override final
Return surface associated with this detector element.
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:875
python.changerun.pv
pv
Definition: changerun.py:81
GeoPrimitivesToStringConverter.h
MuonGM::MdtReadoutElement::m_nsteps
int m_nsteps
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:220
MuonGM::MdtReadoutElement::GeoInfo::m_center
Amg::Vector3D m_center
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:245
Trk::SaggedLineSurface
Definition: SaggedLineSurface.h:35
Amg::AngleAxis3D
Eigen::AngleAxisd AngleAxis3D
Definition: GeoPrimitives.h:45
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
MuonGM::MdtReadoutElement::containsId
bool containsId(const Identifier &id) const override
Definition: MuonDetDescr/MuonReadoutGeometry/src/MdtReadoutElement.cxx:1013
MuonGM::MuonReadoutElement::sideA
bool sideA() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:207
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
MdtIdHelper::maxNTubesPerLayer
static constexpr int maxNTubesPerLayer
The maxNTubesPerLayer represents the absolute maximum of tubes which are built into a single multilay...
Definition: MdtIdHelper.h:68
MuonGM::MdtReadoutElement::m_tubepitch
double m_tubepitch
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:217
MuonGM::MdtReadoutElement::getNtubesperlayer
int getNtubesperlayer() const
Returns the number of tubes in each tube layer.
MuonStation.h
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
MuonGM::MuonReadoutElement::hasCutouts
bool hasCutouts() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:126
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:25
MuonGM::MdtReadoutElement::m_associatedSurface
CxxUtils::CachedUniquePtr< Trk::Surface > m_associatedSurface
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:270
calibdata.tube
tube
Definition: calibdata.py:31
MuonGM::MdtReadoutElement::m_nlayers
int m_nlayers
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:216
MuonGM::MuonReadoutElement::getStationPhi
int getStationPhi() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:194
MuonGM::MuonReadoutElement::getStationEta
int getStationEta() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:193
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32