16#include "GeoModelKernel/GeoVFullPhysVol.h"
25#include "CLHEP/Geometry/Vector3D.h"
26#include "CLHEP/Units/SystemOfUnits.h"
27#include "CLHEP/Vector/ThreeVector.h"
40 const GeoVFullPhysVol* geophysvol,
99 const PixelID* pixelIdHelper =
static_cast<const PixelID*
>(pAtlasHelper);
102 }
else if (
isSCT()) {
105 const SCT_ID* sctIdHelper =
static_cast<const SCT_ID*
>(pAtlasHelper);
108 }
else if (
isPLR()) {
110 const PLR_ID* plrIdHelper =
static_cast<const PLR_ID*
>(pAtlasHelper);
126 if (identifier.is_valid()) {
129 const auto *
const pixelIdHelper =
static_cast<const PixelID*
>(pAtlasHelper);
130 cellId =
SiCellId(pixelIdHelper->phi_index(identifier), pixelIdHelper->eta_index(identifier));
132 const SCT_ID* sctIdHelper =
static_cast<const SCT_ID*
>(pAtlasHelper);
138 int row = sctIdHelper->
row(identifier);
148 const PLR_ID* plrIdHelper =
static_cast<const PLR_ID*
>(pAtlasHelper);
156 const std::vector<const Trk::Surface*>&
160 std::vector<const Trk::Surface*> s;
195 return localTransform;
265 return (globalPos.x() *
normal.y() - globalPos.y() *
normal.x()) / globalPos.perp();
338 std::pair<Amg::Vector3D,Amg::Vector3D>
342 const std::pair<Amg::Vector2D,Amg::Vector2D> localEnds=
344 return std::pair<Amg::Vector3D,Amg::Vector3D >(
globalPosition(localEnds.first),
351 if (!
m_id.is_valid())
throw std::runtime_error(
"SiDetectorElement: Invalid identifier");
389 if (!
m_idHash.is_valid())
throw std::runtime_error(
"SiDetectorElement: Unable to set IdentifierHash");
392 m_surface = std::make_unique<Trk::PlaneSurface>(*
this);
401 double sinStereoOther = std::abs(
m_otherSide->sinStereo());
402 if (std::abs(sinStereoThis - sinStereoOther) < 1e-5) {
411 return (sinStereoThis > sinStereoOther);
453 double sinStereoReco = - (
m_siDesign->sinStripAngleReco(sensorCenter[1], sensorCenter[0]));
454 double cosStereoReco = sqrt(1-sinStereoReco*sinStereoReco);
455 double radialShift = sensorCenter[0];
457 Amg::Vector2D localfocus(-radialShift*sinStereoReco, radialShift - radialShift*cosStereoReco);
498 sinStereo = (globalPos.y() *
etaAxis.x() - globalPos.x() *
etaAxis.y()) / globalPos.perp();
505 double stripAxisX = globalPos.x() -
center.x() +
etaAxis.x()*radius;
506 double stripAxisY = globalPos.y() -
center.y() +
etaAxis.y()*radius;
507 double norm = 1./(radius*sqrt(stripAxisX*stripAxisX + stripAxisY*stripAxisY));
508 sinStereo = norm * (stripAxisX * globalPos.y() - stripAxisY * globalPos.x());
#define ATH_MSG_WARNING(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
bool is_sct(Identifier id) const
bool is_pixel(Identifier id) const
bool is_lumi(Identifier id) const
virtual HelperType helper() const
Type of helper, defaulted to 'Unimplemented'.
Ensure that the extensions for the Vector3D are properly loaded.
Identifier for the strip or pixel cell.
int strip() const
Get strip number. Equivalent to phiIndex().
int phiIndex() const
Get phi index. Equivalent to strip().
bool isValid() const
Test if its in a valid state.
int etaIndex() const
Get eta index.
Helper class to concentrate common items, such as the pointer to the IdHelper, the lorentzAngle tool ...
Base class for the detector design classes for Pixel and SCT.
virtual int strip1Dim(int strip, int row) const
only relevant for SCT.
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
bool isInnermostPixelLayer() const
bool nearBondGap(const Amg::Vector2D &localPosition, double etaTol) const
Test if near bond gap within tolerances.
virtual double get_rz() const override final
bool isStereo() const
Check if it is the stereo side (useful for SCT)
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...
Amg::Transform3D localToModuleFrame(const Amg::Transform3D &localTransform) const
Take a transform of the local element frame and return its equivalent in the module frame.
double sinStereoImpl() const
Private implementation method with no lock at center.
CxxUtils::CachedValue< bool > m_isStereo
double sinStereo() const
Compute sin(stereo angle) at a given position: at center.
void commonConstructor()
Common code for constructors.
Amg::Transform3D defModuleTransform() const
Default module to global frame transform, ie with no misalignment.
const SiDetectorElement * otherSide() const
Useful for SCT only.
double sinStereoLocal(const Amg::Vector2D &localPos) const
Angle of strip in local frame with respect to the etaAxis.
const SiDetectorElement * m_otherSide
double sinTilt() const
Compute sin(tilt angle) at a given position: at center.
virtual ~SiDetectorElement()
Destructor.
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...
const SiDetectorDesign * m_siDesign
Amg::Transform3D localToModuleTransform() const
Transformation from local element to module frame.
const Amg::Transform3D & moduleTransform() const
Module to global frame transform.
const std::vector< const Trk::Surface * > & surfaces() const
Returns the full list of surfaces associated to this detector element.
bool isModuleFrame() const
Check if the element and module frame are the same.
bool isNextToInnermostPixelLayer() const
SiDetectorElement()=delete
Don't allow no-argument constructor.
CxxUtils::CachedValue< std::vector< const Trk::Surface * > > m_surfaces
bool determineStereo() const
Find isStereo.
const Amg::Transform3D defTransform() const
double length() const
Length in eta direction (z - barrel, r - endcap)
std::unique_ptr< Trk::Surface > m_surface
const Amg::Vector3D & etaAxis() const
Amg::Vector2D localPosition(const HepGeom::Point3D< double > &globalPosition) const
transform a global position into a 2D local position (reconstruction frame) (inline)
const DetectorDesign * m_design
local description of this detector element
double width() const
Methods from design (inline)
virtual const Amg::Vector3D & normal() const override final
Get reconstruction local normal axes in global frame.
virtual const Amg::Transform3D & transform() const override final
Return local to global transform.
double maxWidth() const
Max width.
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
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.
const Amg::Vector3D & phiAxis() const
double minWidth() const
Min width.
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
This is a Identifier helper class for the PLR subdetector.
This is an Identifier helper class for the Pixel subdetector.
bool is_dbm(const Identifier &id) const
Test for dbm - WARNING: id MUST be pixel id, otherwise answer is not accurate. Use SiliconID for gene...
int eta_index(const Identifier &id) const
int layer_disk(const Identifier &id) const
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
int phi_index(const Identifier &id) const
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be pixel id, otherwise answer is not accurate. Use SiliconID for g...
This is an Identifier helper class for the SCT subdetector.
int side(const Identifier &id) const
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
int row(const Identifier &id) const
int strip(const Identifier &id) const
Identifier strip_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side, int strip) const
For an individual strip.
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be sct id, otherwise answer is not accurate. Use SiliconID for gen...
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
@ distEta
readout for silicon