ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD_DetectorElement.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8#include "GeoModelKernel/GeoVFullPhysVol.h"
11
13
14namespace InDetDD {
15
16// Constructor with parameters:
19 const GeoVFullPhysVol *geophysvol,
20 const SiCommonItems * commonItems,
21 const GeoAlignmentStore* geoAlignStore) :
22 SolidStateDetectorElementBase(id, design, geophysvol, commonItems, geoAlignStore)
23{
24 const HGTD_ID* hgtdId = dynamic_cast<const HGTD_ID *>(getIdHelper());
25 m_idHash = hgtdId->wafer_hash(m_id);
26
27 if (!m_idHash.is_valid()) throw std::runtime_error("HGTD_DetectorElement: Unable to set IdentifierHash");
28}
29
30// Destructor:
34
37{
38 Identifier id; // Will be initialized in an invalid state.
39 // If something fails it returns the id in an invalid state.
40 if (cellId.isValid()) {
41 const HGTD_ID * hgtdIdHelper = static_cast<const HGTD_ID *>(getIdHelper());
42 if (hgtdIdHelper) {
43 id = hgtdIdHelper->pixel_id(m_id, cellId.phiIndex(), cellId.etaIndex());
44 }
45 }
46
47 return id;
48}
49
52{
53 SiCellId cellId; // Initialized in invalid state.
54 // If something fails it returns the cellId in an invalid state.
55 if (identifier.is_valid()) {
56 const HGTD_ID * hgtdIdHelper = static_cast<const HGTD_ID *>(getIdHelper());
57 if (hgtdIdHelper) {
58 cellId = SiCellId(hgtdIdHelper->phi_index(identifier), hgtdIdHelper->eta_index(identifier));
59 }
60 }
61
62 return cellId;
63}
64
65const std::vector<const Trk::Surface*>& HGTD_DetectorElement::surfaces() const
66{
67 // This method is needed to satisfy inheritance from TrkDetElementBase
68 // so just return the one surface
69 if (!m_surfaces.isValid()) {
70 std::vector<const Trk::Surface*> s;
71 // get this surface
72 s.push_back(&surface());
73 m_surfaces.set (std::move (s));
74 }
75
76 // return the surfaces
77 return *m_surfaces.ptr();
78}
79
81{
82 // Calculate z (endcap)
83 // Use center of sensor ((0,0,0) in local coordinates) for determining this.
84 return center().z();
85}
86
87} // namespace InDetDD
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Ensure that the extensions for the Vector3D are properly loaded.
This is an Identifier helper class for the HGTD subdetector.
Definition HGTD_ID.h:47
int eta_index(const Identifier &id) const
Definition HGTD_ID.h:503
Identifier pixel_id(int endcap, int layer, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
Definition HGTD_ID.h:331
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition HGTD_ID.h:404
int phi_index(const Identifier &id) const
Definition HGTD_ID.h:496
Identifier identifierFromCellId(const SiCellId &cellId) const override final
Identifier from SiCellId (ie pixel eta_index,phi_index)
SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
const HGTD_ModuleDesign & design() const override final
access to the local description:
HGTD_DetectorElement(const Identifier &id, const HGTD_ModuleDesign *design, const GeoVFullPhysVol *geophysvol, const SiCommonItems *commonItems, const GeoAlignmentStore *geoAlignStore=nullptr)
Constructor:
virtual ~HGTD_DetectorElement()
Destructor:
virtual const std::vector< const Trk::Surface * > & surfaces() const
Returns the full list of surfaces associated to this detector element.
double get_rz() const override final
CxxUtils::CachedValue< std::vector< const Trk::Surface * > > m_surfaces
Class used to describe the design of a module (diode segmentation and readout scheme)
Identifier for the strip or pixel cell.
Definition SiCellId.h:29
int phiIndex() const
Get phi index. Equivalent to strip().
Definition SiCellId.h:122
bool isValid() const
Test if its in a valid state.
Definition SiCellId.h:136
int etaIndex() const
Get eta index.
Definition SiCellId.h:114
Helper class to concentrate common items, such as the pointer to the IdHelper, the lorentzAngle tool ...
virtual const Amg::Vector3D & center() const override final
Center in global coordinates.
SolidStateDetectorElementBase(const Identifier &id, const DetectorDesign *design, const GeoVFullPhysVol *geophysvol, const SiCommonItems *commonItems, const GeoAlignmentStore *geoAlignStore=nullptr)
Constructor with parameters.
IdentifierHash m_idHash
hash id of this detector element
const AtlasDetectorID * getIdHelper() const
Returns the id helper (inline)
Trk::Surface & surface()
Element Surface.
Identifier m_id
identifier of this detector element
Message Stream Member.