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