|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "Identifier/Identifier.h"
17 const double &thickness,
18 const int &readoutSide,
21 const std::vector<int> &
nStrips,
22 const std::vector<double> &pitch,
23 const std::vector<double> &stripStartRadius,
24 const std::vector<double> &stripEndRadius,
25 const double &stereoAngle,
26 const double ¢reR,
27 const double &waferCentreR,
30 SCT_ModuleSideDesign(thickness, false, false, true, 1, 0, 0, 0, false, carrier,
31 readoutSide, stripDirection, thicknessDirection),
35 m_stripStartRadius(stripStartRadius),
36 m_stripEndRadius(stripEndRadius),
37 m_stereo(stereoAngle),
39 m_waferCentreR(waferCentreR),
40 m_lengthBF(2. * waferCentreR * std::
sin(stereoAngle*0.5)),
41 m_sinStereo(std::
sin(m_stereo)),
42 m_cosStereo(std::
cos(m_stereo)),
43 m_sinNegStereo(-m_sinStereo),
44 m_cosNegStereo(m_cosStereo),
51 throw std::runtime_error(
52 "ERROR: StripStereoAnnulusDesign called with negative number of rows");
56 throw std::runtime_error(
57 "ERROR: StripStereoAnnulusDesign called with insufficiant pitch values for no. of rows");
60 if (stripStartRadius.size() != (
unsigned)
nRows) {
61 throw std::runtime_error(
62 "ERROR: StripStereoAnnulusDesign called with insufficiant strip start-positions for no. of rows");
65 if (stripEndRadius.size() != (
unsigned)
nRows) {
66 throw std::runtime_error(
67 "ERROR: StripStereoAnnulusDesign called with insufficiant strip end-positions for no. of rows");
75 int totalStrips = startStrip;
92 m_bounds = std::make_unique<Trk::AnnulusBoundsPC>(
100 m_bounds = std::make_unique<Trk::AnnulusBounds>(
111 const double &thickness,
112 const int &readoutSide,
115 const std::vector<int> &
nStrips,
116 const std::vector<double> &pitch,
117 const std::vector<double> &stripStartRadius,
118 const std::vector<double> &stripEndRadius,
119 const double &stereoAngle,
120 const double ¢reR,
124 pitch,stripStartRadius,stripEndRadius,stereoAngle,centreR,centreR,usePC,detectorType){
131 const double x_beam =
pos.xEta();
132 const double y_beam =
pos.xPhi();
142 return {x_strip, y_strip};
146 const double phi_beam =
pos.xPhi();
147 const double rad_beam =
pos.xEta();
150 const double x_beam = rad_beam *
std::cos(phi_beam);
151 const double y_beam = rad_beam *
std::sin(phi_beam);
161 const double phi_strip = std::atan2(y_strip, x_strip);
162 const double rad_strip = std::hypot(x_strip, y_strip);
164 return {rad_strip, phi_strip};
176 const double phi_beam =
pos.xPhi();
177 const double rad_beam =
pos.xEta();
181 const double stereo_2 =
m_stereo*0.5;
182 const double cosStereo_2 =
std::cos(stereo_2);
183 const double sin_plus_stereo_2 =
std::sin(stereo_2);
186 const double rad_conv = 2.0*
m_waferCentreR*std::abs(sin_plus_stereo_2);
187 const double rad_strip = std::sqrt(
std::pow(rad_beam,2.0) +
std::pow(rad_conv,2.0) + 2.0*rad_beam*rad_conv*cosStereo_2);
190 const double phi_strip = M_PI_2 - stereo_2 - std::asin((rad_beam*
std::sin(
M_PI + phi_beam - stereo_2))/rad_strip);
192 return {rad_strip, phi_strip};
198 const double x_strip =
pos.xEta();
199 const double y_strip =
pos.xPhi();
209 return {x_beam, y_beam};
213 const double phi_strip =
pos.xPhi();
214 const double rad_strip =
pos.xEta();
217 const double x_strip = rad_strip *
std::cos(phi_strip);
218 const double y_strip = rad_strip *
std::sin(phi_strip);
228 const double phi_beam = std::atan2(y_beam, x_beam);
229 const double rad_beam = std::hypot(x_beam, y_beam);
231 return {rad_beam, phi_beam};
243 const double phi_strip =
pos.xPhi();
244 const double rad_strip =
pos.xEta();
248 const double stereo_2 =
m_stereo*0.5;
249 const double sin_plus_stereo_2 =
std::sin(stereo_2);
252 const double rad_conv = 2.0*
m_waferCentreR*std::abs(sin_plus_stereo_2);
253 const double rad_beam = std::sqrt(
std::pow(rad_strip,2.0) +
std::pow(rad_conv,2.0) + 2.0*rad_strip*rad_conv*
std::cos(M_PI_2 - stereo_2 - phi_strip));
256 const double phi_beam = stereo_2 - M_PI_2 + std::asin((rad_strip*
std::sin(M_PI_2 - stereo_2 - phi_strip))/rad_beam);
258 return {rad_beam, phi_beam};
272 double phi_strip = (
m_usePC) ? pos_strip.
xPhi() : std::atan2(pos_strip.
xPhi(), pos_strip.
xEta());
289 int rowNum =
row(strip1D);
291 return {strip2D,rowNum};
309 int stripM =
strip - 1;
310 int stripP =
strip + 1;
313 neighbours.emplace_back(stripM);
316 neighbours.emplace_back(stripP);
343 if (row < 0 || row >=
m_nRows) {
349 double phi_strip = (
m_usePC) ? pos_strip.
xPhi() : std::atan2(pos_strip.
xPhi(), pos_strip.
xEta());
373 double rad_strip = (-
b + std::sqrt(
b *
b - 4. *
c))/2.;
378 double x_strip = rad_strip *
std::cos(phi_strip);
379 double y_strip = rad_strip *
std::sin(phi_strip);
391 double rad_strip = (-
b + std::sqrt(
b *
b - 4. *
c))*0.5;
395 double x_strip = rad_strip *
std::cos(phi_strip);
396 double y_strip = rad_strip *
std::sin(phi_strip);
408 if (clusterSize <= 1) {
413 int stripEnd =
strip + clusterSize - 1;
417 return (startPos + endPos)*0.5;
440 double rPrime = (-
b + std::sqrt(
b *
b - 4. *
c))*0.5;
443 double phi = -1*phiPrime;
461 if (clusterSize <= 1) {
466 int stripEnd =
strip + clusterSize - 1;
470 return (startPos + endPos)*0.5;
484 return std::pair<SiLocalPosition, SiLocalPosition>(innerEnd, outerEnd);
490 bool inside =
id.isValid();
501 double pos_phi_stripframe = (
m_usePC) ? pos_stripframe.
xPhi() : std::atan2(pos_stripframe.
xPhi(),pos_stripframe.
xEta());
507 double strip_phi_stripframe = (
m_usePC) ? stripPos_stripframe.
xPhi() : std::atan2(stripPos_stripframe.
xPhi(),stripPos_stripframe.
xEta());
510 return std::abs(pos_phi_stripframe - strip_phi_stripframe) /
m_pitch[
row];
515 throw std::runtime_error(
"Call to StripStereoAnnulusDesign::parameters; not yet implemented");
576 throw std::runtime_error(
"Call to phiMeasureSegment, DEPRECATED, not implemented.");
585 double rad_beam = (
m_usePC) ?
pos.xEta() : std::hypot(
pos.xEta(),
pos.xPhi());
587 if (rad_beam < rInner)
588 etaDist = rad_beam - rInner;
589 else if (rad_beam > rOuter)
590 etaDist = rOuter - rad_beam;
592 etaDist =
std::min(rOuter - rad_beam, rad_beam - rInner);
598 double rad_strip = (
m_usePC) ? pos_strip.
xEta() : std::hypot(pos_strip.
xEta(), pos_strip.
xPhi());
599 double phi_strip = (
m_usePC) ? pos_strip.
xPhi() : std::atan2(pos_strip.
xPhi(), pos_strip.
xEta());
602 double phiAngleMin = -phiAngleMax;
604 if (phi_strip < phiAngleMin)
605 phiDist = rad_strip * (phi_strip - phiAngleMin);
606 else if (phi_strip > phiAngleMax)
607 phiDist = rad_strip * (phiAngleMax - phi_strip);
609 phiDist = rad_strip *
std::min(phiAngleMax - phi_strip, phi_strip - phiAngleMin);
621 std::pair<SiLocalPosition, SiLocalPosition>
end =
endsOfStrip(lpoc);
622 double dx =
end.second.xEta() -
end.first.xEta();
623 double dy =
end.second.xPhi() -
end.first.xPhi();
624 return std::sqrt(
dx *
dx +
dy *
dy);
virtual double width() const override
Method to calculate average width of a module.
const std::vector< double > m_pitch
virtual double length() const override
Method to calculate length of a module.
virtual double scaledDistanceToNearestDiode(const SiLocalPosition &chargePos) const override
give distance to the nearest diode in units of pitch, from 0.0 to 0.5, this method should be fast as ...
SiLocalPosition localPositionOfClusterPC(const SiCellId &cellId, int clusterSize) const
This is for debugging only.
SiLocalPosition positionFromStrip(const SiCellId &cellId) const
SiLocalPosition stripToBeamPC(const SiLocalPosition &pos) const
virtual SiDiodesParameters parameters(const SiCellId &cellId) const override
Return strip width, centre, length etc. Hard to find if this is used or not.
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
virtual SiCellId cellIdInRange(const SiCellId &) const override
DEPRECATED: only used in a stupid example (2014) Check if cell is in range.
Eigen::Matrix< double, 2, 1 > Vector2D
SiLocalPosition beamToStripPC(const SiLocalPosition &pos) const
bool isValid() const
Test if its in a valid state.
virtual bool inActiveArea(const SiLocalPosition &chargePos, bool checkBondGap=true) const override
check if the position is in active area
const std::vector< double > m_stripEndRadius
int phiIndex() const
Get phi index. Equivalent to strip().
virtual const Trk::SurfaceBounds & bounds() const override
Get a reference to the module bounds object.
StripStereoAnnulusDesign(const SiDetectorDesign::Axis &stripDirection, const SiDetectorDesign::Axis &thicknessDirection, const double &thickness, const int &readoutSide, const InDetDD::CarrierType &carrier, const int &nRows, const std::vector< int > &nStrips, const std::vector< double > &pitch, const std::vector< double > &stripStart, const std::vector< double > &stripEnd, const double &stereoAngle, const double ¢reR, const bool &usePC, InDetDD::DetectorType detectorType=InDetDD::Undefined)
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const override
Returns distance to nearest detector active edge +ve = inside -ve = outside.
double xPhi() const
position along phi direction:
SiLocalPosition beamToStripPCpolar(const SiLocalPosition &pos) const
Version of StripStereoAnnulusDesign::beamToStripPC transform based exclusively in a polar system.
virtual double minWidth() const override
Method to calculate minimum width of a module.
SiLocalPosition stripPosAtR(int strip, int row, double r) const
int etaIndex() const
Get eta index.
const std::vector< double > m_stripStartRadius
InDetDD::DetectorType m_detectorType
double pitch(const SiCellId &cellId) const
double xEta() const
position along eta direction:
Class that implements the asymmetric shape of the ITk strip endcap modules.
virtual void neighboursOfCell(const SiCellId &cellId, std::vector< SiCellId > &neighbours) const override
Get the neighbouring diodes of a given diode: Cell for which the neighbours must be found List of cel...
SCT_ReadoutScheme m_scheme
virtual SiLocalPosition localPositionOfCluster(const SiCellId &cellId, int clusterSize) const override
const double m_waferCentreR
const double m_sinNegStereo
virtual int strip(int stripId1Dim) const override
std::unique_ptr< Trk::SurfaceBounds > m_bounds
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override
Give end points of the strip that covers the given position.
virtual int row(int stripId1Dim) const override
SiLocalPosition stripToBeamPCpolar(const SiLocalPosition &pos) const
Version of StripStereoAnnulusDesign::stripToBeamPC transform based exclusively in a polar system.
std::pair< int, int > getStripRow(SiCellId cellId) const final
Get the strip and row number of the cell.
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
virtual Amg::Vector3D sensorCenter() const override
Return the centre of a sensor in the local reference frame.
std::vector< int > m_firstStrip
const double m_cosNegStereo
virtual double etaPitch() const override
Eigen::Matrix< double, 3, 1 > Vector3D
void setCells(int numReadoutCells)
virtual DetectorShape shape() const override
Shape of element.
SiLocalPosition stripToBeam(const SiLocalPosition &pos) const
virtual SiCellId cellIdOfPosition(const SiLocalPosition &localPos) const override
position -> id
SiLocalPosition beamToStrip(const SiLocalPosition &pos) const
virtual double maxWidth() const override
Method to calculate maximum width of a module.
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override
id -> position
unsigned constexpr int nRows
SiLocalPosition localPositionOfCellPC(const SiCellId &cellId) const
This is for debugging only.
constexpr int pow(int base, int exp) noexcept
const std::vector< int > m_nStrips
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
virtual HepGeom::Vector3D< double > phiMeasureSegment(const SiLocalPosition &position) const override
Helper method for stereo angle computation, DEPRECATED.
void setDiodes(int numDiodes)
double stripLength(const SiCellId &cellId) const
virtual double sinStripAngleReco(double phiCoord, double etaCoord) const override
Give strip angle in the reco frame.