ATLAS Offline Software
MuonChamberProjectionHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 // //
8 // Implementation of class MuonChamberProjectionHelper //
9 // //
10 // Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
11 // Initial version: January 2008 //
12 // //
14 
18 #include "VP1Base/IVP1System.h"
19 
20 #include "GeoModelKernel/GeoVolumeCursor.h"
21 #include "GeoModelKernel/GeoLogVol.h"
22 #include "GeoModelKernel/GeoTrd.h"
23 #include "GeoModelKernel/GeoShapeShift.h"
24 #include "GeoModelKernel/GeoShapeUnion.h"
25 #include "GeoModelKernel/GeoShapeIntersection.h"
26 #include "GeoModelKernel/GeoShapeSubtraction.h"
28 
29 #include <map>
30 
31 //____________________________________________________________________
33 public:
35  StoreGateSvc * ds ) : theclass(tc),
37  initattempted(false),
38  initsucceeded(false) {}
43  bool ensureInited();//Returns false if can't init.
44  bool init();//Returns false if can't init.
45 
46  //MDT chambers:
48  public:
49  MDTChamberInfo(const Amg::Transform3D& l2g, const GeoTrd* t)
50  : localToGlobal(l2g), globalToLocal(0), trd(t) {}
52  Amg::Transform3D * globalToLocal;//Only created on demand - saving ~100KB in a typical job.
53  const GeoTrd * trd;
56  };
58  std::map<GeoPVConstLink,MDTChamberInfo> mdtchambervolinfo;//Map typically has around 1124 entries.
60  inline bool nameIsMDTChamber( const std::string& n );
61  bool getMDTChamberVolInfo(const GeoPVConstLink& mdtChamber,ChamberInfoMapItr& itChamberInfo, bool silent = false );
62  void getMDTChamberXAndZ(ChamberInfoMapItr& itChamberInfo, double & trdX, double & trdZ );
63 
64  //Todo: CSC and TGC chambers also.
65 
66 
67  //Utility:
68  inline double pointToPlaneDistAlongLine( const Amg::Vector3D& point, const Amg::Vector3D& lineDirection,
69  const Amg::Vector3D& planePoint, const Amg::Vector3D& planeNormal );
70  void projectXZPointToTrdAlongYAxis( const double& x, const double& z,const GeoTrd* trd,
71  Amg::Vector3D & firstEndWall_point, Amg::Vector3D & secondEndWall_point );
72 
73  static bool constrainPointToRectangleAlongLine( const double& trdX, const double& trdZ, const double& x0, const double& z0,
74  double& x1, double& z1 );//Moves x1,z1 towards x0,z0 so (x1,z1) ends up on edge of
75  //rectangle defined by |x|<=trdX && |z|<=trdZ. Returns false if
76  //not possible (i.e. line segment doesn't cross rectangle edges).
77  bool clip2DLineSegmentToRectangle( const double& rectX, const double& rectY,
78  double& x0, double& y0, double& x1, double& y1 );
79  //Given P0 = (x0,y0) and P1 = (x1,y1), we have to constrain the line
80  //segment P0-P1 to the rectangle R given by x<|rectX|, y<|rectY|.
81  //
82  //Returns false if length of clipped line segment is not positive
83  //(in that case, don't trust the returned values of the parameters).
84 
85  const GeoTrd * findTRDInShape(const GeoShape * shape)
86  {
87  if (shape->typeID()==GeoTrd::getClassTypeID())
88  return static_cast<const GeoTrd*>(shape);
89  if (shape->typeID() == GeoShapeShift::getClassTypeID() ) {
90  const GeoShapeShift* theShift = static_cast<const GeoShapeShift*>(shape);
91  return findTRDInShape(theShift->getOp());
92  }
93  if (shape->typeID() == GeoShapeSubtraction::getClassTypeID() ) {
94  const GeoShapeSubtraction* theSubtraction = static_cast<const GeoShapeSubtraction*>(shape);
95  const GeoTrd * trd = findTRDInShape(theSubtraction->getOpA());
96  return trd ? trd : findTRDInShape(theSubtraction->getOpB());
97  }
98  if (shape->typeID() == GeoShapeUnion::getClassTypeID() ) {
99  const GeoShapeUnion* theUnion = static_cast<const GeoShapeUnion*>(shape);
100  const GeoTrd * trd = findTRDInShape(theUnion->getOpA());
101  return trd ? trd : findTRDInShape(theUnion->getOpB());
102  }
103  if (shape->typeID() == GeoShapeIntersection::getClassTypeID() ) {
104  const GeoShapeIntersection* theIntersection = static_cast<const GeoShapeIntersection*>(shape);
105  const GeoTrd * trd = findTRDInShape(theIntersection->getOpA());
106  return trd ? trd : findTRDInShape(theIntersection->getOpB());
107  }
108  return 0;
109  }
110 
111 };
112 
113 
114 
115 //____________________________________________________________________
117 : VP1HelperClassBase(0,"MuonChamberProjectionHelper"), m_d(new Imp(this,detectorStore))
118 {
119  if (!detectorStore)
120  message("ERROR: Received NULL detectorstore");
121 }
122 
123 //____________________________________________________________________
125  : VP1HelperClassBase(0,"MuonChamberProjectionHelper"), m_d(new Imp(this,(sys?sys->detectorStore():0)))
126 {
127  if (!sys)
128  message("ERROR: Received NULL system pointer (and thus can't get detector store pointer");
129  else if (!m_d->detectorStore)
130  message("ERROR: Could not get detectorStore pointer from system pointer");
131 }
132 
133 //____________________________________________________________________
135 {
136  Imp::ChamberInfoMapItr itMDT, itMDTE(m_d->mdtchambervolinfo.end());
137  for ( itMDT = m_d->mdtchambervolinfo.begin(); itMDT!=itMDTE; ++itMDT )
138  itMDT->second.trd->unref();
139  delete m_d;
140 }
141 
142 //____________________________________________________________________
144 {
145  //It is a vector, so we apply the rotation part only:
146  double vx = v.x(), vy = v.y(), vz = v.z();
147 // v.set(m.xx()*vx + m.xy()*vy + m.xz()*vz,
148 // m.yx()*vx + m.yy()*vy + m.yz()*vz,
149 // m.zx()*vx + m.zy()*vy + m.zz()*vz);
151  m(0,0)*vx + m(0,1)*vy + m(0,2)*vz,
152  m(1,0)*vx + m(1,1)*vy + m(1,2)*vz,
153  m(2,0)*vx + m(2,1)*vy + m(2,2)*vz);
154  return v;
155 }
156 
157 //____________________________________________________________________
159 {
160  if (initattempted)
161  return initsucceeded;
162  initattempted = true;
163  initsucceeded = init();
164  return initsucceeded;
165 }
166 
167 //____________________________________________________________________
168 inline bool MuonChamberProjectionHelper::Imp::nameIsMDTChamber( const std::string& n )
169 {
170  //MDT chamber volumes starts with:
171  // Endcap: EI, EM, EO or EE
172  // Inner barrel: BI or BEE
173  // Middle barrel: BM
174  // Outer barrel:BO
175  if (n.size()<3)
176  return false;
177  if (n[0]=='E')
178  return n[1]=='I' || n[1]=='M' || n[1]=='O' || n[1]=='E';
179  if (n[0]=='B')
180  return n[1]=='I' || n[1]=='M' || n[1]=='O' || (n[1]=='E'&&n[2]=='E');
181  return false;
182 }
183 
184 //____________________________________________________________________
186 {
188  theclass->messageDebug("Warning: Can't init since muon geometry information is not present." );
189  return false;
190  }
191 
192  VP1SGAccessHelper * sgaccess(0);
193  if (theclass->systemBase())
194  sgaccess = new VP1SGAccessHelper(theclass->systemBase());
195  else
196  sgaccess = new VP1SGAccessHelper(detectorStore);
197 
198  //Locate the world volume if possible:
199  const GeoModelExperiment * theExpt;
200  if (!sgaccess->retrieve( theExpt, "ATLAS" )) {
201  theclass->message("MuonChamberProjectionHelper Error: Can't retrieve"
202  " the ATLAS GeoModelExperiment from detector store.");
203  delete sgaccess;
204  return false;
205  }
206  delete sgaccess;
207 
208  PVConstLink world(theExpt->getPhysVol());
209  GeoVolumeCursor av(world);
210  const GeoLogVol * logvol(0);
211  const GeoShape * shape(0);
212  while (!av.atEnd()) {
213 
214  if (av.getName()!="Muon") {
215  av.next();
216  continue;
217  }
218  Amg::Transform3D toptransform = av.getTransform();
219  GeoVolumeCursor av2(av.getVolume());
220  while (!av2.atEnd()) {
221  if (nameIsMDTChamber(av2.getName())) {
222  logvol = av2.getVolume()->getLogVol();
223  if (!logvol) {
224  theclass->message("MuonChamberProjectionHelper Error: Chamber has null logvol");
225  av2.next(); // increment volume cursor.
226  continue;
227  }
228  shape = logvol->getShape();
229  if (!shape) {
230  theclass->message("MuonChamberProjectionHelper Error: Chamber has null shape");
231  av2.next(); // increment volume cursor.
232  continue;
233  }
234  const GeoTrd * trd = findTRDInShape(shape);
235  if (trd) {
236  //Fixme: Test for nan's and clearly crazy numbers (if more than 1km for instance).
237  if ( trd->getZHalfLength()>0.0
238  && trd->getXHalfLength1() > 0.0
239  && trd->getXHalfLength2() > 0.0
240  && trd->getYHalfLength1() > 0.0
241  && trd->getYHalfLength2() > 0.0 ) {
242  trd->ref();
243  Amg::Transform3D geovolume_transf = av2.getTransform();
244  mdtchambervolinfo.insert(std::pair<const GeoPVConstLink,MDTChamberInfo>( av2.getVolume(), Imp::MDTChamberInfo(toptransform * geovolume_transf, trd) ));
245  } else {
246  theclass->message("MuonChamberProjectionHelper Error: Chamber trd has non-positive shape parameters!");
247  }
248  } else {
249  theclass->message("MuonChamberProjectionHelper Error: Chamber shape is not a GeoTrd, and is not a boolean with a Trd somewhere");
250  }
251  }
252  av2.next(); // increment volume cursor.
253  }
254  av.next(); // increment volume cursor.
255  }
256 
257  if (mdtchambervolinfo.empty()) {
258  theclass->message("MuonChamberProjectionHelper Error: Found no MDT chambers");
259  return false;
260  }
261 
262  itLastMDTChamberLookedUp = mdtchambervolinfo.begin();
263 
264  return true;
265 }
266 
267 //____________________________________________________________________
268 bool MuonChamberProjectionHelper::isKnownMDTChamber( const GeoPVConstLink& mdtChamber )
269 {
270  Imp::ChamberInfoMapItr itChamberInfo;
271  return m_d->getMDTChamberVolInfo( mdtChamber, itChamberInfo, true );
272 }
273 
274 //____________________________________________________________________
276  const Amg::Vector3D & point, const Amg::Vector3D& lineDirection,
277  double& distanceToFirstEndPlane, double& distanceToSecondEndPlane,
278  const double& radius )
279 {
280  Imp::ChamberInfoMapItr itChamberInfo;
281  if (!m_d->getMDTChamberVolInfo( mdtChamber, itChamberInfo ))
282  return false;
283 
284  const GeoTrd * trd = itChamberInfo->second.trd;
285  double y1(trd->getYHalfLength1()), y2(trd->getYHalfLength2()), z(trd->getZHalfLength());
286 
287  //Normals and points on ends (transformed from local to global coords):
288 
289  Amg::Vector3D n1(0,+2*z,-(y2-y1));
290  Amg::Vector3D n2(0,-2*z,-(y2-y1));
291  applyTransformToVector(itChamberInfo->second.localToGlobal,n1);
292  applyTransformToVector(itChamberInfo->second.localToGlobal,n2);
293  const Amg::Vector3D p1(itChamberInfo->second.localToGlobal * Amg::Vector3D(0,y1,-z) );
294  const Amg::Vector3D p2(itChamberInfo->second.localToGlobal * Amg::Vector3D(0,-y1,-z) );
295 
296  distanceToFirstEndPlane = m_d->pointToPlaneDistAlongLine(point,lineDirection,p1,n1);
297  if (distanceToFirstEndPlane < 0.0 )
298  return false;
299 
300  distanceToSecondEndPlane = m_d->pointToPlaneDistAlongLine(point,lineDirection,p2,n2);
301  if (distanceToSecondEndPlane < 0.0 )
302  return false;
303 
304  if (radius!=0.0) {
305  double r(fabs(radius)); //Map negative radii to positive.
306  Amg::Vector3D unitdir(lineDirection.unit());
307  double costheta1 = unitdir.dot(n1.unit());
308  double costheta2 = unitdir.dot(n2.unit());
309  //remember that tan(theta) = sqrt((1-cos^2(theta))/cos(theta))
310  distanceToFirstEndPlane += r*sqrt(fabs((1-costheta1*costheta1)/costheta1));
311  distanceToSecondEndPlane += r*sqrt(fabs((1-costheta2*costheta2)/costheta2));
312  }
313 
314  return true;
315 }
316 //____________________________________________________________________
318  const Amg::Vector3D& planePoint, const Amg::Vector3D& planeNormal )
319 {
320 
321  double denominator(planeNormal.dot(lineDirection)*lineDirection.mag());
322  if (denominator==0.0) {
323  theclass->message("MuonChamberProjectionHelper Error: pointToPlaneDistAlongLine is undefined!");
324  return -1.0;
325  }
326  double numerator(planeNormal.x() * (planePoint.x() - point.x())
327  + planeNormal.y() * (planePoint.y() - point.y())
328  + planeNormal.z() * (planePoint.z() - point.z()));
329  return fabs(numerator/denominator);
330 }
331 
332 //____________________________________________________________________
333 bool MuonChamberProjectionHelper::Imp::getMDTChamberVolInfo( const GeoPVConstLink& mdtChamber,
335  bool silent ) {
336 
337  if (!ensureInited())
338  return false;
339 
340  if (itLastMDTChamberLookedUp->first == mdtChamber) {
341  itChamberInfo = itLastMDTChamberLookedUp;
342  return true;
343  }
344 
345  itChamberInfo = mdtchambervolinfo.find(mdtChamber);
346  if (itChamberInfo == mdtchambervolinfo.end()) {
347  if (!silent)
348  theclass->message("MuonChamberProjectionHelper Error: Can't find MDT chamber among the "
349  +QString::number(mdtchambervolinfo.size())+" registered");
350  return false;
351  }
352 
353  itLastMDTChamberLookedUp = itChamberInfo;
354 
355  return true;
356 }
357 
358 //____________________________________________________________________
359 void MuonChamberProjectionHelper::Imp::getMDTChamberXAndZ(ChamberInfoMapItr& itChamberInfo, double & trdX, double & trdZ )
360 {
361  const GeoTrd * trd = itChamberInfo->second.trd;
362  trdX = trd->getXHalfLength1();
363  trdZ = trd->getZHalfLength();
364  if ( trdX != trd->getXHalfLength2() ) {
365  theclass->message("MuonChamberProjectionHelper Warning: x1!=x2 in GeoTrd shape. Clippings etc. will be to a too large surface.");
366  if ( trdX < trd->getXHalfLength2() )
367  trdX = trd->getXHalfLength2();
368  }
369 
370 }
371 
372 //____________________________________________________________________
374  const Amg::Vector3D & pointA, const Amg::Vector3D & pointB,
375  Amg::Vector3D & firstEndWall_pointA, Amg::Vector3D & firstEndWall_pointB,
376  Amg::Vector3D & secondEndWall_pointA, Amg::Vector3D & secondEndWall_pointB,
377  bool& outsidechamber )
378 {
379  Imp::ChamberInfoMapItr itChamberInfo;
380  if (!m_d->getMDTChamberVolInfo( mdtChamber, itChamberInfo ))
381  return false;
382 
383  double trdX, trdZ;
384  m_d->getMDTChamberXAndZ(itChamberInfo, trdX, trdZ );
385 
386  //Get local chamber coordinates, A and B, of pointA and pointB:
387  itChamberInfo->second.ensureInitGlobalToLocal();
388  Amg::Vector3D A((*(itChamberInfo->second.globalToLocal))*pointA), B((*(itChamberInfo->second.globalToLocal))*pointB);
389  double ax(A.x()), az(A.z()), bx(B.x()), bz(B.z());
390 
391  //We basically have to project the line segment AB to the
392  //(x,z)-plane, and then constrain it to the rectangle given by
393  //x_i<|trdX|, z_i<|trdZ|.
394 
395  outsidechamber = !(m_d->clip2DLineSegmentToRectangle( trdX, trdZ, ax, az, bx, bz ));
396  if (outsidechamber)
397  return true;
398 
399  //Project the points to the end of the Trd:
400  m_d->projectXZPointToTrdAlongYAxis( ax, az,itChamberInfo->second.trd, firstEndWall_pointA, secondEndWall_pointA );
401  m_d->projectXZPointToTrdAlongYAxis( bx, bz,itChamberInfo->second.trd, firstEndWall_pointB, secondEndWall_pointB );
402 
403  //Put points in global coordinates:
404 // firstEndWall_pointA.transform(itChamberInfo->second.localToGlobal);
405 // secondEndWall_pointA.transform(itChamberInfo->second.localToGlobal);
406 // firstEndWall_pointB.transform(itChamberInfo->second.localToGlobal);
407 // secondEndWall_pointB.transform(itChamberInfo->second.localToGlobal);
408  Amg::transform(firstEndWall_pointA, itChamberInfo->second.localToGlobal);
409  Amg::transform(secondEndWall_pointA, itChamberInfo->second.localToGlobal);
410  Amg::transform(firstEndWall_pointB, itChamberInfo->second.localToGlobal);
411  Amg::transform(secondEndWall_pointB, itChamberInfo->second.localToGlobal);
412 
413  outsidechamber = false;
414  return true;
415 }
416 
417 //____________________________________________________________________
418 void MuonChamberProjectionHelper::Imp::projectXZPointToTrdAlongYAxis(const double& x, const double& z,const GeoTrd* trd,
419  Amg::Vector3D & firstEndWall_point, Amg::Vector3D & secondEndWall_point )
420 {
421  const double epsilon(0.1);//100micron
422  const double trdY1(trd->getYHalfLength1()), trdY2(trd->getYHalfLength2());
423  const double y( trdY1 + 0.5*(1.0+z/trd->getZHalfLength())*(trdY2-trdY1) );
424  Amg::setVector3DCartesian(firstEndWall_point, x,y+epsilon,z);
425  Amg::setVector3DCartesian(secondEndWall_point, x,-y-epsilon,z);
426 }
427 
428 //____________________________________________________________________
429 bool MuonChamberProjectionHelper::Imp::constrainPointToRectangleAlongLine( const double& trdX, const double& trdZ,
430  const double& x0, const double& z0,
431  double& x1, double& z1 )
432 {
433  //rectangle R : { (x,z) | abs(x)<=trdX && abs(z)<=trdZ }
434  //
435  //Returns false if segment from (x0,z0) to (x1,z1) doesn't cross R.
436 
437  if ( x1 < -trdX ) {
438  if ( x0 < -trdX )
439  return false;
440  //Move (x1,z1) to x == -trdX line:
441  z1 += (-trdX-x1)*(z1-z0)/(x1-x0);
442  x1 = -trdX;
443  if (fabs(z1)>trdZ)
444  return constrainPointToRectangleAlongLine(trdX,trdZ,x0,z0,x1,z1);
445  }
446 
447  if ( x1 > trdX ) {
448  if ( x0 > trdX )
449  return false;
450  //Move (x1,z1) to x == trdX line:
451  z1 += (trdX-x1)*(z1-z0)/(x1-x0);
452  x1 = trdX;
453  if (fabs(z1)>trdZ)
454  return constrainPointToRectangleAlongLine(trdX,trdZ,x0,z0,x1,z1);
455  }
456 
457  if ( z1 < -trdZ ) {
458  if ( z0 < -trdZ )
459  return false;
460  //Move (x1,z1) to z == -trdZ line:
461  x1 += (-trdZ-z1)*(x1-x0)/(z1-z0);
462  z1 = -trdZ;
463  if (fabs(x1)>trdX)
464  return constrainPointToRectangleAlongLine(trdX,trdZ,x0,z0,x1,z1);
465  }
466 
467  if ( z1 > trdZ ) {
468  if ( z0 > trdZ )
469  return false;
470  //Move (x1,z1) to z == trdZ line:
471  x1 += (trdZ-z1)*(x1-x0)/(z1-z0);
472  z1 = trdZ;
473  if (fabs(x1)>trdX)
474  return constrainPointToRectangleAlongLine(trdX,trdZ,x0,z0,x1,z1);
475  }
476 
477  //We were actually inside all along:
478  return true;
479 }
480 
481 //____________________________________________________________________
482 bool MuonChamberProjectionHelper::clipLineSegmentToMDTChamber( const GeoPVConstLink& mdtChamber,
483  Amg::Vector3D & pointA, Amg::Vector3D & pointB, bool& outsidechamber,
484  const double & extradist )
485 {
486  Imp::ChamberInfoMapItr itChamberInfo;
487  if (!m_d->getMDTChamberVolInfo( mdtChamber, itChamberInfo ))
488  return false;
489 
490  double trdX, trdZ;
491  m_d->getMDTChamberXAndZ(itChamberInfo, trdX, trdZ );
492 
493  trdX += extradist;
494  trdZ += extradist;
495 
496  if (trdX<=0.0||trdZ<=0.0)//Extradist must have been negative - and so much that effective chamber dimensions are collapsed.
497  return false;
498 
499  //Get local chamber coordinates, A and B, of pointA and pointB:
500  itChamberInfo->second.ensureInitGlobalToLocal();
501  Amg::Vector3D A((*(itChamberInfo->second.globalToLocal))*pointA), B((*(itChamberInfo->second.globalToLocal))*pointB);
502  double ax(A.x()), az(A.z()), bx(B.x()), bz(B.z());
503 
504  //Clip x and z dimensions:
505  outsidechamber = !(m_d->clip2DLineSegmentToRectangle( trdX, trdZ, ax, az, bx, bz ));
506  if (outsidechamber)
507  return true;
508 
509  double ay(A.y()), by(B.y());
510  //Fixme: We must also clip y dimensions!!
511 
512  //Put results back into points and in global coordinates:
513  Amg::setVector3DCartesian(pointA, ax,ay,az);
515  Amg::transform(pointA, itChamberInfo->second.localToGlobal);
516  Amg::transform(pointB, itChamberInfo->second.localToGlobal);
517  outsidechamber = false;
518  return true;
519 
520 }
521 
522 //____________________________________________________________________
523 bool MuonChamberProjectionHelper::Imp::clip2DLineSegmentToRectangle( const double& rectX, const double& rectY,
524  double& x0, double& y0, double& x1, double& y1 )
525 {
526  if ( fabs(x0)<=rectX && fabs(y0)<=rectY ) {
527  if ( fabs(x1)>rectX || fabs(y1)>rectY ) {
528  //P0 inside R, P1 outside R. We must change (x1,y1) so P0-P1 is inside R.
529  if (!constrainPointToRectangleAlongLine( rectX, rectY, x0, y0, x1, y1 ))
530  theclass->message("MuonChamberProjectionHelper Error: Should never happen (1)");
531  }
532  } else {
533  if ( fabs(x1)<=rectX && fabs(y1)<=rectY ) {
534  //Point P1 inside R, P0 outside R. We must change (x0,y0) so P0-P1 is inside R.
535  if (!constrainPointToRectangleAlongLine( rectX, rectY, x1, y1, x0, y0 ))
536  theclass->message("MuonChamberProjectionHelper Error: Should never happen (2)");
537  } else {
538  //Both points outside - but the line might still R!
539 
540  //First attempt to put (x1,y1) on edge of R, by sliding towards P0
541  if (!constrainPointToRectangleAlongLine( rectX, rectY, x0, y0, x1, y1 )) {
542  //failed - thus P0-P1 doesn't intersect target rectangle.
543  return false;
544  }
545 
546  //Now change (x0,y0) so P0-P1 is inside the target rectangle.
547  if (!constrainPointToRectangleAlongLine( rectX, rectY, x1, y1, x0, y0 ))
548  theclass->message("MuonChamberProjectionHelper Error: Should never happen (3)");
549  }
550  }
551 
552  return true;
553 
554 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
MuonChamberProjectionHelper::Imp::MDTChamberInfo::MDTChamberInfo
MDTChamberInfo(const Amg::Transform3D &l2g, const GeoTrd *t)
Definition: MuonChamberProjectionHelper.cxx:49
beamspotman.r
def r
Definition: beamspotman.py:676
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition: GeoModelExperiment.cxx:21
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
checkxAOD.ds
ds
Definition: Tools/PyUtils/bin/checkxAOD.py:257
MuonChamberProjectionHelper
Definition: MuonChamberProjectionHelper.h:32
MuonChamberProjectionHelper::Imp::init
bool init()
Definition: MuonChamberProjectionHelper.cxx:185
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
fitman.ax
ax
Definition: fitman.py:522
MuonChamberProjectionHelper::Imp::MDTChamberInfo
Definition: MuonChamberProjectionHelper.cxx:47
MuonChamberProjectionHelper::Imp::MDTChamberInfo::~MDTChamberInfo
~MDTChamberInfo()
Definition: MuonChamberProjectionHelper.cxx:55
MuonChamberProjectionHelper::Imp::constrainPointToRectangleAlongLine
static bool constrainPointToRectangleAlongLine(const double &trdX, const double &trdZ, const double &x0, const double &z0, double &x1, double &z1)
Definition: MuonChamberProjectionHelper.cxx:429
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
GeoModelExperiment
Definition: GeoModelExperiment.h:32
MuonChamberProjectionHelper::Imp::getMDTChamberVolInfo
bool getMDTChamberVolInfo(const GeoPVConstLink &mdtChamber, ChamberInfoMapItr &itChamberInfo, bool silent=false)
Definition: MuonChamberProjectionHelper.cxx:333
MuonChamberProjectionHelper::Imp::ensureInited
bool ensureInited()
Definition: MuonChamberProjectionHelper.cxx:158
MuonChamberProjectionHelper::Imp::itLastMDTChamberLookedUp
std::map< GeoPVConstLink, MDTChamberInfo >::iterator itLastMDTChamberLookedUp
Definition: MuonChamberProjectionHelper.cxx:57
MuonChamberProjectionHelper::Imp::initattempted
bool initattempted
Definition: MuonChamberProjectionHelper.cxx:41
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MuonChamberProjectionHelper::~MuonChamberProjectionHelper
~MuonChamberProjectionHelper()
Definition: MuonChamberProjectionHelper.cxx:134
x
#define x
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
dqt_zlumi_alleff_HIST.A
A
Definition: dqt_zlumi_alleff_HIST.py:110
MuonChamberProjectionHelper::Imp::ChamberInfoMapItr
std::map< GeoPVConstLink, MDTChamberInfo >::iterator ChamberInfoMapItr
Definition: MuonChamberProjectionHelper.cxx:59
GeoModelExperiment.h
MuonChamberProjectionHelper::Imp::Imp
Imp(MuonChamberProjectionHelper *tc, StoreGateSvc *ds)
Definition: MuonChamberProjectionHelper.cxx:34
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
IVP1System
Definition: IVP1System.h:36
MuonChamberProjectionHelper::clipLineSegmentToMDTChamber
bool clipLineSegmentToMDTChamber(const GeoPVConstLink &mdtChamber, Amg::Vector3D &pointA, Amg::Vector3D &pointB, bool &outsidechamber, const double &extradist=0.0)
Definition: MuonChamberProjectionHelper.cxx:482
MuonChamberProjectionHelper::Imp::MDTChamberInfo::localToGlobal
Amg::Transform3D localToGlobal
Definition: MuonChamberProjectionHelper.cxx:51
fitman.bz
bz
Definition: fitman.py:412
z
#define z
MuonChamberProjectionHelper::Imp::projectXZPointToTrdAlongYAxis
void projectXZPointToTrdAlongYAxis(const double &x, const double &z, const GeoTrd *trd, Amg::Vector3D &firstEndWall_point, Amg::Vector3D &secondEndWall_point)
Definition: MuonChamberProjectionHelper.cxx:418
beamspotman.n
n
Definition: beamspotman.py:731
MuonChamberProjectionHelper::MuonChamberProjectionHelper
MuonChamberProjectionHelper(StoreGateSvc *detectorStore)
Definition: MuonChamberProjectionHelper.cxx:116
fitman.bx
bx
Definition: fitman.py:410
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonChamberProjectionHelper::Imp::detectorStore
StoreGateSvc * detectorStore
Definition: MuonChamberProjectionHelper.cxx:40
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
Amg::setVector3DCartesian
void setVector3DCartesian(Amg::Vector3D &v1, double x1, double y1, double z1)
Sets components in cartesian coordinate system.
Definition: GeoPrimitivesHelpers.h:136
MuonChamberProjectionHelper::Imp::MDTChamberInfo::globalToLocal
Amg::Transform3D * globalToLocal
Definition: MuonChamberProjectionHelper.cxx:52
MuonChamberProjectionHelper::projectAndConstrainLineSegmentToMDTChamberEndWalls
bool projectAndConstrainLineSegmentToMDTChamberEndWalls(const GeoPVConstLink &mdtChamber, const Amg::Vector3D &pointA, const Amg::Vector3D &pointB, Amg::Vector3D &firstEndWall_pointA, Amg::Vector3D &firstEndWall_pointB, Amg::Vector3D &secondEndWall_pointA, Amg::Vector3D &secondEndWall_pointB, bool &outsidechamber)
Definition: MuonChamberProjectionHelper.cxx:373
fitman.by
by
Definition: fitman.py:411
MuonChamberProjectionHelper::Imp::clip2DLineSegmentToRectangle
bool clip2DLineSegmentToRectangle(const double &rectX, const double &rectY, double &x0, double &y0, double &x1, double &y1)
Definition: MuonChamberProjectionHelper.cxx:523
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
MuonChamberProjectionHelper::Imp::pointToPlaneDistAlongLine
double pointToPlaneDistAlongLine(const Amg::Vector3D &point, const Amg::Vector3D &lineDirection, const Amg::Vector3D &planePoint, const Amg::Vector3D &planeNormal)
Definition: MuonChamberProjectionHelper.cxx:317
ReadTripsProbsFromCool.denominator
denominator
Definition: ReadTripsProbsFromCool.py:96
VP1HelperClassBase
Definition: VP1HelperClassBase.h:28
VP1SGAccessHelper::retrieve
bool retrieve(const T *&, const QString &key) const
python.selection.number
number
Definition: selection.py:20
MuonChamberProjectionHelper::Imp
Definition: MuonChamberProjectionHelper.cxx:32
MuonChamberProjectionHelper::Imp::MDTChamberInfo::trd
const GeoTrd * trd
Definition: MuonChamberProjectionHelper.cxx:53
MuonChamberProjectionHelper::Imp::nameIsMDTChamber
bool nameIsMDTChamber(const std::string &n)
Definition: MuonChamberProjectionHelper.cxx:168
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
MuonChamberProjectionHelper::Imp::getMDTChamberXAndZ
void getMDTChamberXAndZ(ChamberInfoMapItr &itChamberInfo, double &trdX, double &trdZ)
Definition: MuonChamberProjectionHelper.cxx:359
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonChamberProjectionHelper.h
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
Rtt_histogram.n1
n1
Definition: Rtt_histogram.py:21
MuonChamberProjectionHelper::isKnownMDTChamber
bool isKnownMDTChamber(const GeoPVConstLink &mdtChamber)
Definition: MuonChamberProjectionHelper.cxx:268
python.PyAthena.v
v
Definition: PyAthena.py:157
MuonChamberProjectionHelper::getDistancesToMDTChamberWallsAlongLine
bool getDistancesToMDTChamberWallsAlongLine(const GeoPVConstLink &mdtChamber, const Amg::Vector3D &point, const Amg::Vector3D &lineDirection, double &distanceToFirstEndPlane, double &distanceToSecondEndPlane, const double &radius=0.0)
Definition: MuonChamberProjectionHelper.cxx:275
y
#define y
python.trfDecorators.silent
def silent(func)
Redirect stdout/err to /dev/null Useful wrapper to get rid of ROOT verbosity...
Definition: trfDecorators.py:24
MuonChamberProjectionHelper::Imp::MDTChamberInfo::ensureInitGlobalToLocal
void ensureInitGlobalToLocal()
Definition: MuonChamberProjectionHelper.cxx:54
MuonChamberProjectionHelper::Imp::theclass
MuonChamberProjectionHelper * theclass
Definition: MuonChamberProjectionHelper.cxx:39
MuonChamberProjectionHelper::Imp::findTRDInShape
const GeoTrd * findTRDInShape(const GeoShape *shape)
Definition: MuonChamberProjectionHelper.cxx:85
VP1HelperClassBase::message
void message(const QString &) const
Definition: VP1HelperClassBase.cxx:49
VP1JobConfigInfo.h
MuonChamberProjectionHelper::Imp::initsucceeded
bool initsucceeded
Definition: MuonChamberProjectionHelper.cxx:42
VP1SGAccessHelper
Definition: VP1SGAccessHelper.h:25
VP1JobConfigInfo::hasMuonGeometry
static bool hasMuonGeometry()
Definition: VP1JobConfigInfo.cxx:134
VP1SGAccessHelper.h
MuonChamberProjectionHelper::applyTransformToVector
static Amg::Vector3D & applyTransformToVector(const Amg::Transform3D &m, Amg::Vector3D &v)
Definition: MuonChamberProjectionHelper.cxx:143
IVP1System.h
MuonChamberProjectionHelper::Imp::mdtchambervolinfo
std::map< GeoPVConstLink, MDTChamberInfo > mdtchambervolinfo
Definition: MuonChamberProjectionHelper.cxx:58
MuonChamberProjectionHelper::m_d
Imp * m_d
Definition: MuonChamberProjectionHelper.h:99
fitman.ay
ay
Definition: fitman.py:525