ATLAS Offline Software
SiDetectorElement.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 #ifndef INDETREADOUTGEOMETRY_SIDETECTORELEMENT_H
10 #define INDETREADOUTGEOMETRY_SIDETECTORELEMENT_H
11 
17 #include "CxxUtils/CachedValue.h"
18 
19 namespace InDetDD {
20 
110 
111  public:
112 
116  SiDetectorElement(const Identifier& id,
117  const SiDetectorDesign* design,
118  const GeoVFullPhysVol* geophysvol,
119  const SiCommonItems* commonItems,
120  const GeoAlignmentStore* geoAlignStore=nullptr);
121 
126 
130  SiDetectorElement() = delete;
131 
136 
141 
146 
151 
152 
159  void setNextInEta(const SiDetectorElement* element);
160  void setPrevInEta(const SiDetectorElement* element);
161  void setNextInPhi(const SiDetectorElement* element);
162  void setPrevInPhi(const SiDetectorElement* element);
166  void setOtherSide(const SiDetectorElement* element);
168 
174  const SiDetectorElement* nextInEta() const;
175  const SiDetectorElement* prevInEta() const;
176  const SiDetectorElement* nextInPhi() const;
177  const SiDetectorElement* prevInPhi() const;
181  const SiDetectorElement* otherSide() const;
183 
189 
190  bool isPixel() const;
191  bool isSCT() const;
192  bool isPLR() const;
193  bool isDBM() const;
194  bool isBarrel() const;
195  bool isEndcap() const; // inline
196  bool isBlayer() const;
197  bool isInnermostPixelLayer() const;
198  bool isNextToInnermostPixelLayer() const;
199 
204  virtual Identifier identifierFromCellId(const SiCellId &cellId) const override final;
208  virtual SiCellId cellIdFromIdentifier(const Identifier& identifier) const override final;
209 
211 
216 
220  const std::vector<const Trk::Surface*>& surfaces() const;
222 
242  const Amg::Transform3D& moduleTransform() const;
243 
251 
255  Amg::Transform3D localToModuleFrame(const Amg::Transform3D& localTransform) const;
256 
264 
268  bool isModuleFrame() const;
270 
275  virtual double get_rz() const override final;
277 
286  double sinTilt() const;
290  double sinTilt(const Amg::Vector2D& localPos) const;
295 
299  double sinStereo() const;
303  double sinStereo(const Amg::Vector2D& localPos) const;
308 
313  double sinStereoLocal(const Amg::Vector2D& localPos) const;
317  double sinStereoLocal(const Amg::Vector3D& globalPos) const;
318 
322  bool isStereo() const;
323 
325 
326 
331 
335  virtual const SiDetectorDesign& design() const override final;
336 
351  double phiPitch() const;
356 
361 
372 
374 
382  bool nearBondGap(const Amg::Vector2D& localPosition, double etaTol) const;
383  bool nearBondGap(const Amg::Vector3D& globalPosition, double etaTol) const;
384 
393 
395 
404  std::pair<Amg::Vector3D,Amg::Vector3D> endsOfStrip(const Amg::Vector2D& position) const;
406 
409  virtual Trk::DetectorElemType detectorType() const override final;
410 
411  private:
421  void commonConstructor();
422 
426  virtual void updateCache() const override final;
427 
431  bool determineStereo() const;
432 
436  double sinStereoImpl() const;
441 
445  protected:
446 
451 
456  CxxUtils::CachedValue<std::vector<const Trk::Surface*> > m_surfaces;
458 
464 
469 
470  bool m_isPixel{false};
471  bool m_isSCT{false};
472  bool m_isPLR{false};
473  bool m_isDBM{false};
474  bool m_isBarrel{false};
476 
481  const SiDetectorElement* m_nextInEta{nullptr}; // set by setNextInEta
482  const SiDetectorElement* m_prevInEta{nullptr}; // set by setPrevInEta
483  const SiDetectorElement* m_nextInPhi{nullptr}; // set by setNextInPhi
484  const SiDetectorElement* m_prevInPhi{nullptr}; // set by setPrevInPhi
485  const SiDetectorElement* m_otherSide{nullptr}; // set by setOtherSide
487 
494 
498  MsgStream& msg(MSG::Level lvl) const;
499 
503  bool msgLvl(MSG::Level lvl) const;
505 
506  };
507 
508 } // namespace InDetDD
509 
514 
515 #endif // INDETREADOUTGEOMETRY_SIDETECTORELEMENT_H
InDetDD::SiDetectorElement::gangedCell
SiCellId gangedCell(const SiCellId &cellId) const
If cell is ganged return the id of the other cell which shares the readout for this cell,...
InDetDD::SiDetectorElement::operator=
SiDetectorElement & operator=(const SiDetectorElement &)=delete
Don't allow assignment operator.
GeoAlignmentStore
Ensure that the extensions for the Vector3D are properly loaded.
Definition: GeoAlignmentStore.h:24
InDetDD::SiDetectorElement::isEndcap
bool isEndcap() const
SolidStateDetectorElementBase.h
InDetDD::SiDetectorElement::localToModuleTransform
Amg::Transform3D localToModuleTransform() const
Transformation from local element to module frame.
Definition: SiDetectorElement.cxx:202
InDetDD::SiDetectorElement::setOtherSide
void setOtherSide(const SiDetectorElement *element)
For SCT only.
InDetDD::SiDetectorElement::m_prevInEta
const SiDetectorElement * m_prevInEta
Definition: SiDetectorElement.h:482
InDetDD::SiDetectorElement::setPrevInEta
void setPrevInEta(const SiDetectorElement *element)
InDetDD::SolidStateDetectorElementBase
Definition: SolidStateDetectorElementBase.h:132
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
InDetDD::SiDetectorElement::surfaces
const std::vector< const Trk::Surface * > & surfaces() const
Returns the full list of surfaces associated to this detector element.
Definition: SiDetectorElement.cxx:157
InDetDD::SiDetectorElement::localToModuleFrame
Amg::Transform3D localToModuleFrame(const Amg::Transform3D &localTransform) const
Take a transform of the local element frame and return its equivalent in the module frame.
Definition: SiDetectorElement.cxx:192
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:7
InDetDD::SiDetectorElement::setPrevInPhi
void setPrevInPhi(const SiDetectorElement *element)
InDetDD::SiDetectorElement::setNextInEta
void setNextInEta(const SiDetectorElement *element)
InDetDD::SiDetectorElement::SiDetectorElement
SiDetectorElement(const SiDetectorElement &)=delete
Don't allow copy constructor.
InDetDD::SiDetectorElement::m_isDBM
bool m_isDBM
Definition: SiDetectorElement.h:473
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
InDetDD::SiDetectorElement::m_surfaces
CxxUtils::CachedValue< std::vector< const Trk::Surface * > > m_surfaces
Definition: SiDetectorElement.h:456
InDetDD::SiDetectorElement::SiDetectorElement
SiDetectorElement()=delete
Don't allow no-argument constructor.
InDetDD::SiDetectorElement::m_isStereo
CxxUtils::CachedValue< bool > m_isStereo
Definition: SiDetectorElement.h:492
protected
#define protected
Definition: DetDescrConditionsDict_dict_fixes.cxx:14
InDetDD::SiDetectorElement::swapEtaReadoutDirection
bool swapEtaReadoutDirection() const
For eta_index (only relevant for pixel) (inline)
InDetDD::SiDetectorElement::commonConstructor
void commonConstructor()
Common code for constructors.
Definition: SiDetectorElement.cxx:349
InDetDD::SiDetectorElement::sinTilt
double sinTilt() const
Compute sin(tilt angle) at a given position: at center.
Definition: SiDetectorElement.cxx:223
InDetDD::SiDetectorElement::m_siDesign
const SiDetectorDesign * m_siDesign
Definition: SiDetectorElement.h:463
InDetDD::SiDetectorElement::phiPitch
double phiPitch() const
Pitch (inline methods)
InDetDD::SiDetectorElement::cellIdFromIdentifier
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
Definition: SiDetectorElement.cxx:120
InDetDD::SiDetectorElement::prevInEta
const SiDetectorElement * prevInEta() const
InDetDD::SiDetectorElement::~SiDetectorElement
virtual ~SiDetectorElement()
Destructor.
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
InDetDD::SiDetectorElement::moduleTransform
const Amg::Transform3D & moduleTransform() const
Module to global frame transform.
Definition: SiDetectorElement.cxx:173
InDetDD::SiDetectorElement::isModuleFrame
bool isModuleFrame() const
Check if the element and module frame are the same.
Definition: SiDetectorElement.cxx:212
InDetDD::SiDetectorElement::detectorType
virtual Trk::DetectorElemType detectorType() const override final
TrkDetElementBase interface detectorType.
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
InDetDD::SiDetectorElement::updateCache
virtual void updateCache() const override final
Recalculate cached values.
Definition: SiDetectorElement.cxx:402
InDetDD::SiDetectorElement::swapPhiReadoutDirection
bool swapPhiReadoutDirection() const
Determine if readout direction between online and offline needs swapping.
vector
Definition: MultiHisto.h:13
InDetDD::SiDetectorElement::nextInPhi
const SiDetectorElement * nextInPhi() const
InDetDD::SiDetectorElement::identifierFromCellId
virtual Identifier identifierFromCellId(const SiCellId &cellId) const override final
Identifier <-> SiCellId (ie strip number or pixel eta_index,phi_index) Identifier from SiCellId (ie s...
Definition: SiDetectorElement.cxx:89
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CxxUtils
Definition: aligned_vector.h:29
CxxUtils::CachedValue< bool >
InDetDD::SiDetectorElement::m_nextInPhi
const SiDetectorElement * m_nextInPhi
Definition: SiDetectorElement.h:483
Trk::DetectorElemType
DetectorElemType
Definition: TrkDetElementBase.h:39
InDetDD::SiDetectorElement::isBlayer
bool isBlayer() const
Definition: SiDetectorElement.cxx:53
InDetDD::SiDetectorElement::msgLvl
bool msgLvl(MSG::Level lvl) const
Declaring the Method providing Verbosity Level (inline)
InDetDD::SiDetectorElement::m_isSCT
bool m_isSCT
Definition: SiDetectorElement.h:471
InDetDD::SiDetectorElement::isInnermostPixelLayer
bool isInnermostPixelLayer() const
Definition: SiDetectorElement.cxx:65
InDetDD::SiDetectorElement::prevInPhi
const SiDetectorElement * prevInPhi() const
InDetDD::SiDetectorElement::isPixel
bool isPixel() const
InDetDD::SiDetectorElement::sinStereo
double sinStereo() const
Compute sin(stereo angle) at a given position: at center.
Definition: SiDetectorElement.cxx:269
InDetDD::SiDetectorElement::endsOfStrip
std::pair< Amg::Vector3D, Amg::Vector3D > endsOfStrip(const Amg::Vector2D &position) const
Special method for SCT to retrieve the two ends of a "strip" Returned coordinates are in global frame...
Definition: SiDetectorElement.cxx:339
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
CachedValue.h
Cached value with atomic update.
InDetDD::SiDetectorElement::SiDetectorElement
SiDetectorElement(SiDetectorElement &&)=delete
Don't allow move constructor.
InDetDD::SiDetectorElement::otherSide
const SiDetectorElement * otherSide() const
Useful for SCT only.
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
InDetDD::SiCommonItems
Definition: SiCommonItems.h:45
InDetDD::SiDetectorElement::m_isPixel
bool m_isPixel
Definition: SiDetectorElement.h:470
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDetDD::SiDetectorElement::isBarrel
bool isBarrel() const
InDetDD::SiDetectorElement::defModuleTransform
Amg::Transform3D defModuleTransform() const
Default module to global frame transform, ie with no misalignment.
Definition: SiDetectorElement.cxx:179
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDetDD::SiCellId
Definition: SiCellId.h:29
InDetDD::SiDetectorElement::m_otherSide
const SiDetectorElement * m_otherSide
Definition: SiDetectorElement.h:485
InDetDD::SiDetectorElement::setNextInPhi
void setNextInPhi(const SiDetectorElement *element)
InDetDD::SiDetectorElement::nextInEta
const SiDetectorElement * nextInEta() const
InDetDD::CarrierType
CarrierType
Definition: InDetDD_Defs.h:17
InDetDD::SiDetectorElement::operator=
SiDetectorElement & operator=(SiDetectorElement &&)=delete
Don't allow move assignment operator.
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::SiDetectorElement::isDBM
bool isDBM() const
InDetDD::SolidStateDetectorElementBase::globalPosition
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
InDetDD::SiDetectorElement::sinStereoLocal
double sinStereoLocal(const Amg::Vector2D &localPos) const
Angle of strip in local frame with respect to the etaAxis.
Definition: SiDetectorElement.cxx:288
InDetDD::SiDetectorElement::m_prevInPhi
const SiDetectorElement * m_prevInPhi
Definition: SiDetectorElement.h:484
InDetDD::SiDetectorElement::m_nextInEta
const SiDetectorElement * m_nextInEta
Definition: SiDetectorElement.h:481
InDetDD::SiDetectorElement::get_rz
virtual double get_rz() const override final
Definition: SiDetectorElement.cxx:309
SiDetectorElement.icc
InDetDD::SiDetectorElement::carrierType
InDetDD::CarrierType carrierType() const
carrier type for readout.
InDetDD::SiDetectorElement::isSCT
bool isSCT() const
InDetDD::SiDetectorElement::sinStereoImpl
double sinStereoImpl() const
Private implementation method with no lock at center.
Definition: SiDetectorElement.cxx:439
InDetDD::SiDetectorElement::nearBondGap
bool nearBondGap(const Amg::Vector2D &localPosition, double etaTol) const
Test if near bond gap within tolerances.
Definition: SiDetectorElement.cxx:323
InDetDD::SolidStateDetectorElementBase::localPosition
Amg::Vector2D localPosition(const HepGeom::Point3D< double > &globalPosition) const
transform a global position into a 2D local position (reconstruction frame) (inline)
InDetDD::SiDetectorDesign
Definition: SiDetectorDesign.h:50
InDetDD::SiDetectorElement::determineStereo
bool determineStereo() const
Find isStereo.
Definition: SiDetectorElement.cxx:417
InDetDD::SiDetectorElement::isStereo
bool isStereo() const
Check if it is the stereo side (useful for SCT)
Definition: SiDetectorElement.cxx:300
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
InDetDD::SiDetectorElement::m_isBarrel
bool m_isBarrel
Definition: SiDetectorElement.h:474
InDetDD::SiDetectorElement::isPLR
bool isPLR() const
SiDetectorDesign.h
InDetDD::SiDetectorElement::isNextToInnermostPixelLayer
bool isNextToInnermostPixelLayer() const
Definition: SiDetectorElement.cxx:77
InDetDD::SiDetectorElement::msg
MsgStream & msg(MSG::Level lvl) const
Declaring the Message method for further use (inline)
InDetDD::SiDetectorElement::m_isPLR
bool m_isPLR
Definition: SiDetectorElement.h:472