ATLAS Offline Software
Loading...
Searching...
No Matches
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
12EMECDetectorRegion::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
26EMECCellConstLink EMECDetectorRegion::getEMECCell (unsigned int ieta, unsigned int iphi) const
27{
28 return {new EMECCell(m_endcapIndex,m_descriptor,ieta,iphi)};
29}
30
31HepGeom::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
44HepGeom::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}
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