ATLAS Offline Software
Loading...
Searching...
No Matches
HECDetectorRegion.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include "GeoModelKernel/GeoVFullPhysVol.h"
7#include "GeoModelKernel/GeoPcon.h"
10
11HECDetectorRegion::HECDetectorRegion (const GeoVFullPhysVol *physVol
12 , const HECDetDescr *hecDescriptor
13 , DetectorSide endcap
14 , double projectivityDisplacement)
15 : GeoVDetectorElement(physVol)
16 , m_descriptor(hecDescriptor)
17 , m_endcapIndex(endcap)
18 , m_projectivityDisplacement(projectivityDisplacement)
19{
20
21}
22
23
25
26HECCellConstLink HECDetectorRegion::getHECCell (unsigned int ieta, unsigned int iphi) const
27{
28 HECCell *cell = new HECCell(m_endcapIndex,m_descriptor,ieta,iphi);
29 return {cell};
30}
31
33{
34 HepGeom::Point3D<double> clhepPoint = getRefPlanePos();
35 return Amg::Vector3D(clhepPoint.x(), clhepPoint.y(), clhepPoint.z());
36}
38{
39 const GeoVFullPhysVol *fullPhysVol = getMaterialGeom();
40 return alignStore
41 ? fullPhysVol->getCachedAbsoluteTransform(alignStore)
42 : fullPhysVol->getAbsoluteTransform();
43}
44
46{
47 const GeoVFullPhysVol *fullPhysVol = getMaterialGeom();
48 return alignStore
49 ? fullPhysVol->getCachedDefAbsoluteTransform(alignStore)
50 : fullPhysVol->getDefAbsoluteTransform();
51}
52
54{
55 HepGeom::Point3D<double> clhepPoint = getFocalPointPos();
56 return Amg::Vector3D(clhepPoint.x(), clhepPoint.y(), clhepPoint.z());
57}
58
59
60HepGeom::Point3D<double> HECDetectorRegion::getRefPlanePos () const
61{
62
63 // Get the material geometry:
64
65 const GeoVFullPhysVol *physVol = getMaterialGeom();
66 const GeoLogVol *logVol = physVol->getLogVol();
67 const GeoShape *shape = logVol->getShape();
68 if (shape->typeID()!=GeoPcon::getClassTypeID()) {
69 throw std::runtime_error ("HECDetectorRegion cannot compute absolute position of reference plane");
70 }
71 const GeoPcon *pcon = static_cast<const GeoPcon *> (shape);
72 HepGeom::Point3D<double> center(0,0,pcon->getZPlane(0));
73 return (Amg::EigenTransformToCLHEP(physVol->getAbsoluteTransform())*center);
74}
75
76HepGeom::Point3D<double> HECDetectorRegion::getFocalPointPos () const
77{
78 HepGeom::Point3D<double> zRef = getRefPlanePos();
79 int sgn = m_endcapIndex==0 ? -1 : +1;
80 bool hec2 = m_descriptor->getSamplingIndex()>1;
81 HepGeom::Point3D<double> focalPos = hec2 ?
82 HepGeom::Point3D<double>(0,0,sgn*m_descriptor->getManager()->getFocalToRef2()):
83 HepGeom::Point3D<double>(0,0,sgn*m_descriptor->getManager()->getFocalToRef1());
84 return zRef - focalPos;
85}
86
Ensure that the extensions for the Vector3D are properly loaded.
A cell of the hadronic endcap calorimeter readout geometry.
Definition HECCell.h:31
Descriptor for regions of the hadronic endcap calorimeter.
Definition HECDetDescr.h:30
HECCellConstLink getHECCell(unsigned int ieta, unsigned int iphi) const
Retrieve a cell with eta index and phi index.
~HECDetectorRegion()
Destructor.
HepGeom::Point3D< double > getFocalPointPos() const
Returns the position of the focal point of the HEC.
HECDetectorRegion::DetectorSide m_endcapIndex
const Amg::Transform3D & getDefAbsoluteTransform(const GeoAlignmentStore *alignStore=nullptr) const
Returns the absolute transform of this element.
GeoIntrusivePtr< const HECDetDescr > m_descriptor
const Amg::Transform3D & getAbsoluteTransform(const GeoAlignmentStore *alignStore=nullptr) const
Returns the absolute transform of this element.
Amg::Vector3D getFocalPointPosAmg() const
Returns the position of the focal point of the HEC.
HECDetectorRegion(const GeoVFullPhysVol *physVol, const HECDetDescr *hecDescriptor, DetectorSide endcap, double projectivityDisplacement=4 *Gaudi::Units::cm)
Constructor.
HepGeom::Point3D< double > getRefPlanePos() const
Returns the position of the center of the reference plane of the HEC (front face of the HEC volume).
Amg::Vector3D getRefPlanePosAmg() const
Returns the position of the center of the reference plane of the HEC (front face of the HEC volume).
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