ATLAS Offline Software
EMECDetectorRegion.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "GeoModelKernel/GeoVFullPhysVol.h"
6 
8 #include "GeoModelKernel/GeoPcon.h"
11 
12 EMECDetectorRegion::EMECDetectorRegion (const GeoVFullPhysVol *physVol
13  , const EMECDetDescr *emecDescriptor
14  , DetectorSide endcap
15  , double projectivityDisplacement)
16  : GeoVDetectorElement(physVol)
17  , m_descriptor(emecDescriptor)
18  , m_endcapIndex(endcap)
19  , m_projectivityDisplacement(projectivityDisplacement)
20 {
21 
22 }
23 
25 
26 EMECCellConstLink EMECDetectorRegion::getEMECCell (unsigned int ieta, unsigned int iphi) const
27 {
28  return {new EMECCell(m_endcapIndex,m_descriptor,ieta,iphi)};
29 }
30 
31 HepGeom::Point3D<double> EMECDetectorRegion::getRefPlanePos () const
32 {
33  const GeoVFullPhysVol *physVol = getMaterialGeom();
34  const GeoLogVol *logVol = physVol->getLogVol();
35  const GeoShape *shape = logVol->getShape();
36  if (shape->typeID()!=GeoPcon::getClassTypeID()) {
37  throw std::runtime_error ("EMECDetectorRegion cannot compute absolute position of reference plane");
38  }
39  const GeoPcon *pcon = static_cast<const GeoPcon *> (shape);
40  HepGeom::Point3D<double> center(0,0,pcon->getZPlane(0)-m_descriptor->getManager()->getRefToActive());
41  return (Amg::EigenTransformToCLHEP(physVol->getAbsoluteTransform())*center);
42 }
43 
44 HepGeom::Point3D<double> EMECDetectorRegion::getFocalPointPos () const
45 {
46  HepGeom::Point3D<double> zRef = getRefPlanePos();
47  int sgn = m_endcapIndex==0 ? -1 : +1;
48  HepGeom::Point3D<double> focalPos = HepGeom::Point3D<double>(0,0,sgn*m_descriptor->getManager()->getFocalToRef());
49  return zRef - focalPos;
50 }
51 
53 {
54  const GeoVFullPhysVol *fullPhysVol = getMaterialGeom();
55  return alignStore
56  ? fullPhysVol->getCachedAbsoluteTransform(alignStore)
57  : fullPhysVol->getAbsoluteTransform();
58 }
59 
61 {
62  const GeoVFullPhysVol *fullPhysVol = getMaterialGeom();
63  return alignStore
64  ? fullPhysVol->getCachedDefAbsoluteTransform(alignStore)
65  : fullPhysVol->getDefAbsoluteTransform();
66 }
67 
69 {
70  const HepGeom::Point3D<double> point = getRefPlanePos();
71  return Amg::Vector3D(point.x(), point.y(), point.z());
72 }
73 
75 {
76  const HepGeom::Point3D<double> point = getFocalPointPos();
77  return Amg::Vector3D(point.x(),point.y(),point.z());
78 }
GeoAlignmentStore
Ensure that the extensions for the Vector3D are properly loaded.
Definition: GeoAlignmentStore.h:24
EMECDetectorRegion::m_descriptor
GeoIntrusivePtr< const EMECDetDescr > m_descriptor
Definition: EMECDetectorRegion.h:149
EMECDetectorRegion::getRefPlanePos
HepGeom::Point3D< double > getRefPlanePos() const
Returns the position of the center of the reference plane of the EMEC (back of front tranverse bars).
Definition: EMECDetectorRegion.cxx:31
EMECDetectorRegion::DetectorSide
DetectorSide
Definition: EMECDetectorRegion.h:33
EMECDetectorRegion::EMECDetectorRegion
EMECDetectorRegion(const GeoVFullPhysVol *physVol, const EMECDetDescr *emecDescriptor, DetectorSide endcap, double projectivityDisplacement=4 *Gaudi::Units::cm)
Constructor.
Definition: EMECDetectorRegion.cxx:12
EMECCell
A Cell of the electromagnetic endcap calorimeter readout geometry This class represents a single EMEC...
Definition: EMECCell.h:32
EMECDetectorRegion::getRefPlanePosAmg
Amg::Vector3D getRefPlanePosAmg() const
Returns the position of the center of the reference plane of the EMEC (back of front tranverse bars).
Definition: EMECDetectorRegion.cxx:68
EMECDetectorRegion::getAbsoluteTransform
const Amg::Transform3D & getAbsoluteTransform(const GeoAlignmentStore *alignStore=nullptr) const
Returns the absolute transform of this element.
Definition: EMECDetectorRegion.cxx:52
EMECDetDescr
Descriptor for regions of the electromagnetic endcap calorimeter.
Definition: EMECDetDescr.h:27
EMECDetectorRegion::getFocalPointPos
HepGeom::Point3D< double > getFocalPointPos() const
Returns the position of the focal point of the EMEC.
Definition: EMECDetectorRegion.cxx:44
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CLHEPtoEigenConverter.h
GeoAlignmentStore.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
EMECDetectorRegion::getDefAbsoluteTransform
const Amg::Transform3D & getDefAbsoluteTransform(const GeoAlignmentStore *alignStore=nullptr) const
Returns the absolute transform of this element.
Definition: EMECDetectorRegion.cxx:60
EMECDetectorRegion::getEMECCell
EMECCellConstLink getEMECCell(unsigned int ieta, unsigned int iphi) const
Access to Cells.
Definition: EMECDetectorRegion.cxx:26
Amg::EigenTransformToCLHEP
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
Definition: CLHEPtoEigenConverter.h:120
EMECDetectorRegion::m_endcapIndex
EMECDetectorRegion::DetectorSide m_endcapIndex
Definition: EMECDetectorRegion.h:150
EMECDetectorRegion::getFocalPointPosAmg
Amg::Vector3D getFocalPointPosAmg() const
Returns the position of the focal point of the EMEC.
Definition: EMECDetectorRegion.cxx:74
EMECDetectorRegion.h
EMECDetectorRegion::~EMECDetectorRegion
~EMECDetectorRegion()
Destructor