ATLAS Offline Software
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 
11 HECDetectorRegion::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 
26 HECCellConstLink 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 
60 HepGeom::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 
76 HepGeom::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 
GeoAlignmentStore
Ensure that the extensions for the Vector3D are properly loaded.
Definition: GeoAlignmentStore.h:24
HECDetectorRegion::getFocalPointPosAmg
Amg::Vector3D getFocalPointPosAmg() const
Returns the position of the focal point of the HEC.
Definition: HECDetectorRegion.cxx:53
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
HECDetectorRegion::getRefPlanePosAmg
Amg::Vector3D getRefPlanePosAmg() const
Returns the position of the center of the reference plane of the HEC (front face of the HEC volume).
Definition: HECDetectorRegion.cxx:32
HECDetectorRegion.h
HECDetectorRegion::m_endcapIndex
HECDetectorRegion::DetectorSide m_endcapIndex
Definition: HECDetectorRegion.h:146
HECDetectorRegion::getRefPlanePos
HepGeom::Point3D< double > getRefPlanePos() const
Returns the position of the center of the reference plane of the HEC (front face of the HEC volume).
Definition: HECDetectorRegion.cxx:60
HECDetectorRegion::DetectorSide
DetectorSide
Definition: HECDetectorRegion.h:34
HECDetDescr
Descriptor for regions of the hadronic endcap calorimeter.
Definition: HECDetDescr.h:30
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
HECCell
A cell of the hadronic endcap calorimeter readout geometry.
Definition: HECCell.h:31
HECDetectorRegion::HECDetectorRegion
HECDetectorRegion(const GeoVFullPhysVol *physVol, const HECDetDescr *hecDescriptor, DetectorSide endcap, double projectivityDisplacement=4 *Gaudi::Units::cm)
Constructor.
Definition: HECDetectorRegion.cxx:11
CLHEPtoEigenConverter.h
HECDetectorRegion::getAbsoluteTransform
const Amg::Transform3D & getAbsoluteTransform(const GeoAlignmentStore *alignStore=nullptr) const
Returns the absolute transform of this element.
Definition: HECDetectorRegion.cxx:37
GeoAlignmentStore.h
HECDetectorRegion::m_descriptor
GeoIntrusivePtr< const HECDetDescr > m_descriptor
Definition: HECDetectorRegion.h:145
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
HECDetectorRegion::getDefAbsoluteTransform
const Amg::Transform3D & getDefAbsoluteTransform(const GeoAlignmentStore *alignStore=nullptr) const
Returns the absolute transform of this element.
Definition: HECDetectorRegion.cxx:45
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
HECDetectorRegion::getHECCell
HECCellConstLink getHECCell(unsigned int ieta, unsigned int iphi) const
Retrieve a cell with eta index and phi index.
Definition: HECDetectorRegion.cxx:26
HECDetectorRegion::getFocalPointPos
HepGeom::Point3D< double > getFocalPointPos() const
Returns the position of the focal point of the HEC.
Definition: HECDetectorRegion.cxx:76
HECDetectorRegion::~HECDetectorRegion
~HECDetectorRegion()
Destructor.