ATLAS Offline Software
Loading...
Searching...
No Matches
MuonGM::MuonChannelDesign Struct Reference

#include <MuonChannelDesign.h>

Collaboration diagram for MuonGM::MuonChannelDesign:

Public Types

enum class  ChannelType { etaStrip , phiStrip }
enum class  DetType { MM , STGC , Other }

Public Member Functions

 MuonChannelDesign ()
double distanceToReadout (const Amg::Vector2D &) const
 distance to readout
double distanceToChannel (const Amg::Vector2D &pos, int nChannel) const
 distance to channel - residual
int channelNumber (const Amg::Vector2D &pos) const
 calculate local channel number, range 1=nstrips like identifiers. Returns -1 if out of range
int wireGroupNumber (const Amg::Vector2D &pos) const
 calculate local wire group number, range 1=64 like identifiers. Returns -1 if out of range
int wireNumber (const Amg::Vector2D &pos) const
 calculate the sTGC wire number. The method can return a value outside the range [1, nch].
double channelWidth () const
 calculate local channel width
void defineTrapezoid (double HalfShortY, double HalfLongY, double HalfHeight)
 set the trapezoid dimensions
void defineTrapezoid (double HalfShortY, double HalfLongY, double HalfHeight, double sAngle)
void defineDiamond (double HalfShortY, double HalfLongY, double HalfHeight, double ycutout)
double stereoAngle () const
 returns the stereo angle
double yCutout () const
double hasStereoAngle () const
 returns whether the stereo angle is non-zero
double isDiamondShape () const
 returns whether it's a diamond shape (sTGC QL3)
const AmgSymMatrix (2) &rotation() const
 returns the rotation matrix between eta <-> phi layer
double channelLength (int channel) const
 STRIPS ONLY: calculate channel length for a given strip number.
double channelHalfLength (int st, bool left) const
 STRIPS ONLY: calculate channel length on the given side of the x axis (for MM stereo strips).
double gasGapThickness () const
 thickness of gas gap
bool center (int channel, Amg::Vector2D &pos) const
 STRIPS ONLY: Returns the center on the strip.
bool leftEdge (int channel, Amg::Vector2D &pos) const
 STRIPS ONLY: Returns the left edge of the strip.
bool rightEdge (int channel, Amg::Vector2D &pos) const
 STRIPS ONLY: Returns the right edge of the strip.
int numberOfMissingTopStrips () const
 Returns the number of missing top strips.
int numberOfMissingBottomStrips () const
 Returns the number of missing bottom strips.
double xSize () const
double maxYSize () const
double minYSize () const
double passivatedLength (double passivWidth, bool left) const
 top edge -> left edge bottom edge -> right edge a rectangle with height H parallel to the inclined edges is passivated
double passivatedHeight (double passivHeight, bool edge) const
 Passivation is applied parallel to.
void setFirstPos (const double pos)
 Set the position of the first strip along the x-axis.
double firstPos () const
 Returns the position of the first strip along the x-axis.
int positionRelativeToStrip (const Amg::Vector2D &lpos, Amg::Vector2D &rel_pos) const
 STRIPS ONLY.

Public Attributes

ChannelType type { ChannelType::etaStrip }
DetType detType { DetType::Other }
int nch {-1}
double inputPitch {0.}
double inputWidth {0.}
double inputLength {0.}
double firstPitch {0.}
double groupWidth {0.}
double nGroups {0.}
double wireCutout {0.}
double thickness {0.}
int nMissedTopEta {0}
int nMissedBottomEta {0}
int nMissedTopStereo {0}
int nMissedBottomStereo {0}
int totalStrips {0}
bool isConvertedFromPhaseII {false}

Private Member Functions

bool channelPosition (int channel, Amg::Vector2D &pos) const
 calculate local channel position for a given channel number
bool leftInterSect (int channel, Amg::Vector2D &pos, bool uncapped=false) const
 Returns the intersection of the strip with the left edge of the trapezoid. Special cases:
bool rightInterSect (int channel, Amg::Vector2D &pos, bool uncapped=false) const
 Returns the right edge of the strip.
bool geomCenter (int channel, Amg::Vector2D &pos) const
 Returns the geometrical strip center.
void setStereoAngle (double sAngle)
 calculate local stereo angle
 AmgSymMatrix (2) m_rotMat

Private Attributes

bool m_hasStereo {false}
bool m_isDiamond {false}
double m_sAngle {0.}
double m_yCutout {0.}
Amg::Vector2D m_stereoDir {0,1}
 Direction of the strips.
Amg::Vector2D m_stereoNormal {1.,0.}
 Direction pointing to the next strips.
double m_firstPos {0.}
 Position of the first measurement.
Amg::Vector2D m_topEdge {Amg::Vector2D::Zero()}
 Vector describing the right edge of the trapzoid.
Amg::Vector2D m_bottomEdge {Amg::Vector2D::Zero()}
 Vector describing the left edge of the trapezoid.
Amg::Vector2D m_bottomLeft {Amg::Vector2D::Zero()}
 Bottom left point of the trapezoid.
Amg::Vector2D m_bottomRight {Amg::Vector2D::Zero()}
 Bottom right point of the trapezoid.
Amg::Vector2D m_topLeft {Amg::Vector2D::Zero()}
 Top right point of the trapezoid.
Amg::Vector2D m_topRight {Amg::Vector2D::Zero()}
 Bottom right point of the trapezoid.
double m_maxHorSize {0.}
double m_xSize {0.}
double m_minYSize {0.}
double m_maxYSize {0.}

Detailed Description

Definition at line 22 of file MuonChannelDesign.h.

Member Enumeration Documentation

◆ ChannelType

Enumerator
etaStrip 
phiStrip 

Definition at line 25 of file MuonChannelDesign.h.

25{ etaStrip, phiStrip };

◆ DetType

Enumerator
MM 
STGC 
Other 

Definition at line 26 of file MuonChannelDesign.h.

26{ MM, STGC, Other };
@ STGC
Definition RegSelEnums.h:39
@ MM
Definition RegSelEnums.h:38

Constructor & Destructor Documentation

◆ MuonChannelDesign()

MuonGM::MuonChannelDesign::MuonChannelDesign ( )

Definition at line 6 of file MuonChannelDesign.cxx.

6 {
7 m_rotMat.setIdentity();
8 }

Member Function Documentation

◆ AmgSymMatrix() [1/2]

const MuonGM::MuonChannelDesign::AmgSymMatrix ( 2 ) const &
inline

returns the rotation matrix between eta <-> phi layer

Definition at line 79 of file MuonChannelDesign.h.

79{ return m_rotMat; }

◆ AmgSymMatrix() [2/2]

MuonGM::MuonChannelDesign::AmgSymMatrix ( 2 )
inlineprivate

Definition at line 169 of file MuonChannelDesign.h.

169{AmgSymMatrix(2)::Identity()};
#define AmgSymMatrix(dim)

◆ center()

bool MuonGM::MuonChannelDesign::center ( int channel,
Amg::Vector2D & pos ) const
inline

STRIPS ONLY: Returns the center on the strip.

Definition at line 477 of file MuonChannelDesign.h.

477 {
478 if (!geomCenter(channel, pos)) return false;
479 pos = m_rotMat * pos;
480 return true;
481 }
bool geomCenter(int channel, Amg::Vector2D &pos) const
Returns the geometrical strip center.

◆ channelHalfLength()

double MuonGM::MuonChannelDesign::channelHalfLength ( int st,
bool left ) const
inline

STRIPS ONLY: calculate channel length on the given side of the x axis (for MM stereo strips).

Definition at line 374 of file MuonChannelDesign.h.

374 {
375 Amg::Vector2D cen{Amg::Vector2D::Zero()}, side{Amg::Vector2D::Zero()};
376 if (!geomCenter(st,cen) || (left&& !leftInterSect(st, side)) || (!left && !rightInterSect(st, side))) return -0.5;
377 if (type == ChannelType::etaStrip && detType == DetType::MM && (st < 1 || st > totalStrips)) return -0.5;
378 // default case:
379 return (cen - side).mag();
380 }
Eigen::Matrix< double, 2, 1 > Vector2D
bool rightInterSect(int channel, Amg::Vector2D &pos, bool uncapped=false) const
Returns the right edge of the strip.
bool leftInterSect(int channel, Amg::Vector2D &pos, bool uncapped=false) const
Returns the intersection of the strip with the left edge of the trapezoid. Special cases:

◆ channelLength()

double MuonGM::MuonChannelDesign::channelLength ( int channel) const
inline

STRIPS ONLY: calculate channel length for a given strip number.

Definition at line 384 of file MuonChannelDesign.h.

384 {
385 Amg::Vector2D left{Amg::Vector2D::Zero()}, right{Amg::Vector2D::Zero()};
386 if(!leftInterSect(st,left)|| !rightInterSect(st, right)) return -0.5;
387 return (left - right).mag();
388 }

◆ channelNumber()

int MuonGM::MuonChannelDesign::channelNumber ( const Amg::Vector2D & pos) const
inline

calculate local channel number, range 1=nstrips like identifiers. Returns -1 if out of range

Definition at line 196 of file MuonChannelDesign.h.

196 {
197
198 int chNum{-1};
200 // ** MM strips: keeping cases outside the active area, but within the envelope,
201 // to avoid warnings from MuonPRDTest. Those channels are removed from digitization.
202 const Amg::Vector2D posInEta = m_rotMat.inverse()*pos;
203 const double xMid = (posInEta - firstPos()*Amg::Vector2D::UnitX()).dot(m_stereoNormal) / m_stereoNormal.x();
204 const int missedBottom = numberOfMissingBottomStrips();
205
206 // first position is always 1/2 pitch above the center of the first active strip
207 chNum = static_cast<int>(std::floor( xMid / inputPitch)) + missedBottom + 2;
208 if (chNum < 1 || chNum > totalStrips) chNum = -1;
209
210 } else if (type == ChannelType::phiStrip && detType == DetType::STGC) {
211
212 // ** sTGC wires: return the wire group
213 chNum = wireGroupNumber(pos);
214
215 } else {
216
217 // ** All other cases
218 chNum = (int)std::floor( (pos.x() - firstPos()) / inputPitch ) + 2;
219 if (chNum < 1 || chNum > nch) chNum = -1;
220 }
221
222 return chNum;
223 }
dot(G, fn, nodesToHighlight=[])
Definition dot.py:5
int numberOfMissingBottomStrips() const
Returns the number of missing bottom strips.
int wireGroupNumber(const Amg::Vector2D &pos) const
calculate local wire group number, range 1=64 like identifiers. Returns -1 if out of range
double firstPos() const
Returns the position of the first strip along the x-axis.
Amg::Vector2D m_stereoNormal
Direction pointing to the next strips.

◆ channelPosition()

bool MuonGM::MuonChannelDesign::channelPosition ( int channel,
Amg::Vector2D & pos ) const
inlineprivate

calculate local channel position for a given channel number

sTGC Wires: return the center of the wire group (not the wire)

MM eta strips (strip numbering starts at 1)

sTGC and default case for eta strips

Definition at line 309 of file MuonChannelDesign.h.

309 {
310
312
313 if (st < 1 || st > nch) return false;
314
315 if (detType == DetType::STGC) {
316
318 if (st > nGroups || st == 63) return false; // 63 is defined as an unactive digit
319
320 // calculate the end of the first wire group (accounts for staggering).
321 // for wires, firstPitch is the number of wires in the first group
322 double firstX = firstPos() + (firstPitch - 1) * inputPitch;
323 double locX{0.};
324
325 if (st == 1) {
326 // first group: average the starting and ending x of the group
327 locX = 0.5 * (-0.5 * m_maxYSize + firstX);
328 } else if (st == nGroups) {
329 // last group: average the starting and ending x of the group
330 locX = 0.5 * (0.5 * m_maxYSize + firstX + (nGroups - 2) * groupWidth * inputPitch);
331 } else {
332 // For the R3 geometry converted from Phase II, we are redefining the center of the wiregroup
333 // to be between the 10th and the 11th wire of the group, originally defined on the 10th wire.
334 // Hence, we are defining an offset, wireOffset to be used in the defining the local x of the wiregroup center.
335 double wireOffset{0.};
337 wireOffset = 0.5 * inputPitch;
338 }
339 locX = firstX + wireOffset + groupWidth * inputPitch * (st - 1.5);
340 }
341
342 pos[0] = locX;
343 pos[1] = 0.;
344
345 }
346
347 } else if (detType == DetType::MM) {
348
350 const int nMissedBottom = numberOfMissingBottomStrips();
351 if (st <= nMissedBottom || st > nMissedBottom + nch) return false;
352
353 // firstPos is 1/2 pitch above the center of the first active strip.
354 pos = (firstPos() + inputPitch* (st - nMissedBottom - 1.5)) * Amg::Vector2D::UnitX();
355 } else {
356
358 if (st < 1 || st > nch) return false;
359
360 double x = firstPos() + (st - 1.5)*inputPitch;
361 if (detType == DetType::STGC) {
362 if (firstPitch == inputPitch && st == nch) x -= inputWidth/4.; // case last strip is a half-strip
363 if (firstPitch < inputPitch && st == 1) x += inputWidth/4.; // case first strip is a half-strip
364 }
365
366 pos[0] = x;
367 pos[1] = 0;
368 }
369
370 return true;
371 }
#define x
@ locX
Definition ParamDefs.h:37

◆ channelWidth()

double MuonGM::MuonChannelDesign::channelWidth ( ) const
inline

calculate local channel width

Definition at line 392 of file MuonChannelDesign.h.

392 {
393
394 if (detType == DetType::STGC) {
395 // eta strips: return the pitch (3.2mm), not the width (2.7mm)
396 // phi wires: return width of full wire group
398 }
399
400 return inputWidth;
401 }

◆ defineDiamond()

void MuonGM::MuonChannelDesign::defineDiamond ( double HalfShortY,
double HalfLongY,
double HalfHeight,
double ycutout )

Definition at line 42 of file MuonChannelDesign.cxx.

42 {
43
44 // define a trapezoid region
45 double HalfLongY_uncut = HalfLongY + ycutout * (HalfLongY - HalfShortY)/(2*HalfHeight - ycutout);
46 defineTrapezoid(HalfShortY, HalfLongY_uncut, HalfHeight);
47
48 // move the origin to the cutout base
49 Amg::Vector2D offset(ycutout - HalfHeight, 0.);
54
55 m_isDiamond = true;
56 m_yCutout = ycutout;
57 m_maxYSize = 2*HalfLongY;
58 }
Amg::Vector2D m_bottomLeft
Bottom left point of the trapezoid.
Amg::Vector2D m_bottomRight
Bottom right point of the trapezoid.
Amg::Vector2D m_topLeft
Top right point of the trapezoid.
void defineTrapezoid(double HalfShortY, double HalfLongY, double HalfHeight)
set the trapezoid dimensions
Amg::Vector2D m_topRight
Bottom right point of the trapezoid.

◆ defineTrapezoid() [1/2]

void MuonGM::MuonChannelDesign::defineTrapezoid ( double HalfShortY,
double HalfLongY,
double HalfHeight )

set the trapezoid dimensions

Definition at line 25 of file MuonChannelDesign.cxx.

25 {
26 m_bottomLeft = Amg::Vector2D{-HalfHeight, -HalfShortY};
27 m_bottomRight = Amg::Vector2D{HalfHeight, -HalfLongY};
28 m_topLeft = Amg::Vector2D{-HalfHeight, HalfShortY};
29 m_topRight = Amg::Vector2D{HalfHeight, HalfLongY};
30
33 m_maxHorSize = std::hypot(m_topEdge.x(), m_topEdge.y());
34 m_topEdge = m_topEdge.unit();
35
36 m_xSize = 2.*HalfHeight; // radial length (active area)
37 m_minYSize = 2.*HalfShortY; // bottom length (active area)
38 m_maxYSize = 2.*HalfLongY; // top length (active area)
40 }
detray::unit< scalar_t > unit
Amg::Vector2D m_topEdge
Vector describing the right edge of the trapzoid.
Amg::Vector2D m_bottomEdge
Vector describing the left edge of the trapezoid.

◆ defineTrapezoid() [2/2]

void MuonGM::MuonChannelDesign::defineTrapezoid ( double HalfShortY,
double HalfLongY,
double HalfHeight,
double sAngle )

Definition at line 10 of file MuonChannelDesign.cxx.

10 {
11 defineTrapezoid(HalfShortY,HalfLongY, HalfHeight);
12 setStereoAngle(sAngle);
13 }
void setStereoAngle(double sAngle)
calculate local stereo angle

◆ distanceToChannel()

double MuonGM::MuonChannelDesign::distanceToChannel ( const Amg::Vector2D & pos,
int nChannel ) const
inline

distance to channel - residual

Definition at line 179 of file MuonChannelDesign.h.

179 {
180 Amg::Vector2D cen{Amg::Vector2D::Zero()};
181 if (!center(chNum, cen)) return std::numeric_limits<float>::max();
182
183 return (pos - cen).x();
184 }
bool center(int channel, Amg::Vector2D &pos) const
STRIPS ONLY: Returns the center on the strip.

◆ distanceToReadout()

double MuonGM::MuonChannelDesign::distanceToReadout ( const Amg::Vector2D & ) const
inline

distance to readout

Definition at line 189 of file MuonChannelDesign.h.

189 {
190 throw std::runtime_error("MuonChannelDesign::distanceToReadout() - is not properly defined");
191 }

◆ firstPos()

double MuonGM::MuonChannelDesign::firstPos ( ) const
inline

Returns the position of the first strip along the x-axis.

Definition at line 474 of file MuonChannelDesign.h.

474{return m_firstPos;}
double m_firstPos
Position of the first measurement.

◆ gasGapThickness()

double MuonGM::MuonChannelDesign::gasGapThickness ( ) const
inline

thickness of gas gap

Definition at line 88 of file MuonChannelDesign.h.

◆ geomCenter()

bool MuonGM::MuonChannelDesign::geomCenter ( int channel,
Amg::Vector2D & pos ) const
inlineprivate

Returns the geometrical strip center.

Definition at line 404 of file MuonChannelDesign.h.

404 {
405 Amg::Vector2D l_pos{Amg::Vector2D::Zero()}, r_pos{Amg::Vector2D::Zero()};
406 if (!leftInterSect(channel,l_pos) || !rightInterSect(channel,r_pos)) return false;
407 pos = 0.5 * (l_pos + r_pos);
408 return true;
409 }

◆ hasStereoAngle()

double MuonGM::MuonChannelDesign::hasStereoAngle ( ) const
inline

returns whether the stereo angle is non-zero

Definition at line 73 of file MuonChannelDesign.h.

◆ isDiamondShape()

double MuonGM::MuonChannelDesign::isDiamondShape ( ) const
inline

returns whether it's a diamond shape (sTGC QL3)

Definition at line 76 of file MuonChannelDesign.h.

76{return m_isDiamond;}

◆ leftEdge()

bool MuonGM::MuonChannelDesign::leftEdge ( int channel,
Amg::Vector2D & pos ) const
inline

STRIPS ONLY: Returns the left edge of the strip.

Definition at line 484 of file MuonChannelDesign.h.

484 {
485 if (!leftInterSect(channel, pos)) return false;
486 pos = m_rotMat * pos;
487 return true;
488 }

◆ leftInterSect()

bool MuonGM::MuonChannelDesign::leftInterSect ( int channel,
Amg::Vector2D & pos,
bool uncapped = false ) const
inlineprivate

Returns the intersection of the strip with the left edge of the trapezoid. Special cases:

Nominal channel position

Return immediately for a strip in the cutout region of QL3

If the channel is a stereo channel && lamda is either smaller 0 or longer then the bottom edge, then it's a routed strip

Definition at line 412 of file MuonChannelDesign.h.

412 {
414 Amg::Vector2D chanPos{Amg::Vector2D::Zero()};
415 if (!channelPosition(channel, chanPos)) return false;
416
418 if (!uncapped && m_isDiamond && chanPos.x() > 0) {
419 pos = Amg::Vector2D(chanPos.x(), -0.5*m_maxYSize);
420 return true;
421 }
422
423 std::optional<double> lambda = Amg::intersect<2>(chanPos, m_stereoDir, m_bottomLeft, m_bottomEdge);
424 if (!lambda) return false;
427 if (!uncapped && m_hasStereo && ( (*lambda) < 0. || (*lambda) > m_maxHorSize)) {
428 const Amg::Vector2D e_y{0., 1.};
429 const std::optional<double> bottom_line = Amg::intersect<2>(m_stereoDir.x() > 0.? m_bottomLeft: m_bottomRight, e_y, chanPos, m_stereoDir);
430 if (bottom_line) {
431 pos = chanPos + (*bottom_line)* m_stereoDir;
432 return true;
433 }
434 }
435 pos = (m_bottomLeft + (*lambda) * m_bottomEdge);
436 return true;
437 }
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the point B' along the line B that's closest to a second line A.
bool channelPosition(int channel, Amg::Vector2D &pos) const
calculate local channel position for a given channel number
Amg::Vector2D m_stereoDir
Direction of the strips.

◆ maxYSize()

double MuonGM::MuonChannelDesign::maxYSize ( ) const
inline

Definition at line 472 of file MuonChannelDesign.h.

472{return m_maxYSize;}

◆ minYSize()

double MuonGM::MuonChannelDesign::minYSize ( ) const
inline

Definition at line 473 of file MuonChannelDesign.h.

473{return m_minYSize;}

◆ numberOfMissingBottomStrips()

int MuonGM::MuonChannelDesign::numberOfMissingBottomStrips ( ) const
inline

Returns the number of missing bottom strips.

Definition at line 470 of file MuonChannelDesign.h.

◆ numberOfMissingTopStrips()

int MuonGM::MuonChannelDesign::numberOfMissingTopStrips ( ) const
inline

Returns the number of missing top strips.

Definition at line 469 of file MuonChannelDesign.h.

◆ passivatedHeight()

double MuonGM::MuonChannelDesign::passivatedHeight ( double passivHeight,
bool edge ) const
inline

Passivation is applied parallel to.

Definition at line 506 of file MuonChannelDesign.h.

506 {
507 return passivHeight*std::abs(edge_pcb? m_stereoDir.x() : 1.);
508 }

◆ passivatedLength()

double MuonGM::MuonChannelDesign::passivatedLength ( double passivWidth,
bool left ) const
inline

top edge -> left edge bottom edge -> right edge a rectangle with height H parallel to the inclined edges is passivated

Definition at line 500 of file MuonChannelDesign.h.

500 {
501 const Amg::Vector2D& edge = (left ? m_bottomEdge : m_topEdge);
502 return passivWidth * std::abs(m_stereoDir.x() *edge.y() - m_stereoDir.y()* edge.x());
503 }

◆ positionRelativeToStrip()

int MuonGM::MuonChannelDesign::positionRelativeToStrip ( const Amg::Vector2D & lpos,
Amg::Vector2D & rel_pos ) const
inline

STRIPS ONLY.

Given a local position falling on strip #i, this function expresses it w.r.t. the center of the strip (intersection for stereo strips): relative x within [-0.5, 0.5] (*pitch), relative y within [-1, 1]. These coordinates can be fed to the NswAsBuilt::StripCalculator

Definition at line 280 of file MuonChannelDesign.h.

280 {
281
282 if (type != ChannelType::etaStrip) return -1;
283
284 // if the lpos is out of bounds, express it w.r.t. the nearest active strip.
285 // it's not our job to boundary check.
286 int istrip = channelNumber(lpos);
287 if (istrip < 0) return istrip;
288 istrip = std::max (istrip, numberOfMissingBottomStrips() + 1);
289 istrip = std::min (istrip, numberOfMissingBottomStrips() + nch);
290
291 // get the intersection of the eta and stereo strips in the local reference frame
292 Amg::Vector2D chan_pos{Amg::Vector2D::Zero()};
293 channelPosition(istrip, chan_pos);
294 chan_pos = rotation() * chan_pos;
295
296 // strip edge in the local reference frame (note that the uncapped option is set to true)
297 Amg::Vector2D edge_pos{Amg::Vector2D::Zero()};
298 (lpos.y() > 0) ? rightInterSect(istrip, edge_pos, true) : leftInterSect(istrip, edge_pos, true);
299 edge_pos = rotation() * edge_pos;
300
301 rel_pos[0] = (lpos - chan_pos).x() / channelWidth();
302 rel_pos[1] = (lpos - chan_pos).y() / std::abs( edge_pos.y() - chan_pos.y() );
303
304 return istrip;
305 }
#define y
double channelWidth() const
calculate local channel width
int channelNumber(const Amg::Vector2D &pos) const
calculate local channel number, range 1=nstrips like identifiers. Returns -1 if out of range

◆ rightEdge()

bool MuonGM::MuonChannelDesign::rightEdge ( int channel,
Amg::Vector2D & pos ) const
inline

STRIPS ONLY: Returns the right edge of the strip.

Definition at line 491 of file MuonChannelDesign.h.

491 {
492 if (!rightInterSect(channel, pos)) return false;
493 pos = m_rotMat * pos;
494 return true;
495 }

◆ rightInterSect()

bool MuonGM::MuonChannelDesign::rightInterSect ( int channel,
Amg::Vector2D & pos,
bool uncapped = false ) const
inlineprivate

Returns the right edge of the strip.

Nominal channel position

Return immediately for a strip in the cutout region of QL3

We expect lambda to be positive

If the channel is a stereo channel && lamda is either smaller 0 or longer then the bottom edge, then it's a routed strip

Definition at line 440 of file MuonChannelDesign.h.

440 {
442 Amg::Vector2D chanPos{Amg::Vector2D::Zero()};
443 if (!channelPosition(channel, chanPos)) return false;
444
446 if (!uncapped && m_isDiamond && chanPos.x() > 0) {
447 pos = Amg::Vector2D(chanPos.x(), 0.5*m_maxYSize);
448 return true;
449 }
450
452 const std::optional<double> lambda =Amg::intersect<2>(chanPos, m_stereoDir, m_topRight, m_topEdge);
453 if (!lambda) return false;
456 if (!uncapped && m_hasStereo&& ( (*lambda) < 0 || (*lambda) > m_maxHorSize)) {
457 const Amg::Vector2D e_y{0., 1.};
458 const std::optional<double> top_line =Amg::intersect<2>(m_stereoDir.x() > 0. ? m_topRight: m_topLeft, e_y, chanPos, m_stereoDir);
459 if (top_line) {
460 pos = chanPos + (*top_line) * m_stereoDir;
461 return true;
462 }
463 }
464 pos = (m_topRight + (*lambda) * m_topEdge);
465 return true;
466 }

◆ setFirstPos()

void MuonGM::MuonChannelDesign::setFirstPos ( const double pos)

Set the position of the first strip along the x-axis.

Definition at line 60 of file MuonChannelDesign.cxx.

60 {
62 }

◆ setStereoAngle()

void MuonGM::MuonChannelDesign::setStereoAngle ( double sAngle)
private

calculate local stereo angle

Definition at line 15 of file MuonChannelDesign.cxx.

15 {
16 if (m_isDiamond) return; // forbid diamond shape with stereo strips
17 m_sAngle = sAngle;
18 m_hasStereo = (sAngle !=0.);
19 Eigen::Rotation2D rot{sAngle};
22 m_rotMat = Eigen::Rotation2D{-sAngle};
23 }

◆ stereoAngle()

double MuonGM::MuonChannelDesign::stereoAngle ( ) const
inline

returns the stereo angle

Definition at line 68 of file MuonChannelDesign.h.

68{ return m_sAngle; }

◆ wireGroupNumber()

int MuonGM::MuonChannelDesign::wireGroupNumber ( const Amg::Vector2D & pos) const
inline

calculate local wire group number, range 1=64 like identifiers. Returns -1 if out of range

Definition at line 227 of file MuonChannelDesign.h.

227 {
228
229 // The wires in the 1st gas volume of QL1, QS1 can not be read for digits
230 if (type != ChannelType::phiStrip || detType != DetType::STGC) return -1;
231
232 // Get the wire number associated to the position
233 int wire_number = wireNumber(pos);
234
235 // Find the wire group associated to the wire number.
236 // For wires, firstPitch is the number of wires in the 1st group.
237 int grNumber{-1};
238 if (wire_number <= firstPitch) {
239 grNumber = 1;
240 } else {
241 grNumber = (wire_number - 1 - firstPitch) / groupWidth + 2; // 20 wires per group,
242 // Case a hit is positionned after the last wire but inside the gas volume.
243 // Especially important for QL3. We still consider the digit active.
244 if (grNumber > nGroups && pos.x() < 0.5 * m_maxYSize) grNumber = nGroups;
245 }
246
247 // If hit is in an inactive wire region of QL1/QS1, return 63 (invalid).
248 // This allows better tracking of hits.
249 if (wireCutout != 0. && pos.y() < 0.5 * m_xSize - wireCutout) return 63;
250 if (grNumber < 1 || grNumber > nGroups) return -1;
251
252 return grNumber;
253 }
int wireNumber(const Amg::Vector2D &pos) const
calculate the sTGC wire number. The method can return a value outside the range [1,...

◆ wireNumber()

int MuonGM::MuonChannelDesign::wireNumber ( const Amg::Vector2D & pos) const
inline

calculate the sTGC wire number. The method can return a value outside the range [1, nch].

Definition at line 257 of file MuonChannelDesign.h.

257 {
258
259 // Only determine wire number for sTGC wire surfaces
260 int wire_number{-1};
262 if ((pos.x() > -0.5 * m_maxYSize) && (pos.x() < firstPos())) { // before first wire
263 wire_number = 1;
264 } else {
265 wire_number = (pos.x() - firstPos()) / inputPitch + 1;
266 if (wire_number < 1 || wire_number > nch) {
267 MsgStream log(Athena::getMessageSvc(), "MuonChannelDesign");
268 if (log.level() <= MSG::DEBUG) {
269 log << MSG::DEBUG << "sTGC wire number out of range: wire number = " << wire_number << " local pos = (" << pos.x() << ", " << pos.y() << ")" << endmsg;
270 }
271 }
272 }
273 }
274
275 return wire_number;
276 }
#define endmsg
IMessageSvc * getMessageSvc(bool quiet=false)

◆ xSize()

double MuonGM::MuonChannelDesign::xSize ( ) const
inline

Definition at line 471 of file MuonChannelDesign.h.

471{return m_xSize;}

◆ yCutout()

double MuonGM::MuonChannelDesign::yCutout ( ) const
inline

Definition at line 70 of file MuonChannelDesign.h.

70{ return m_yCutout; }

Member Data Documentation

◆ detType

DetType MuonGM::MuonChannelDesign::detType { DetType::Other }

◆ firstPitch

double MuonGM::MuonChannelDesign::firstPitch {0.}

Definition at line 33 of file MuonChannelDesign.h.

33{0.}; // Pitch of 1st strip or number of wires in 1st group

◆ groupWidth

double MuonGM::MuonChannelDesign::groupWidth {0.}

Definition at line 34 of file MuonChannelDesign.h.

34{0.}; // Number of Wires per group

◆ inputLength

double MuonGM::MuonChannelDesign::inputLength {0.}

Definition at line 32 of file MuonChannelDesign.h.

32{0.};

◆ inputPitch

double MuonGM::MuonChannelDesign::inputPitch {0.}

Definition at line 30 of file MuonChannelDesign.h.

30{0.}; // we use this param to define the pitch for MM

◆ inputWidth

double MuonGM::MuonChannelDesign::inputWidth {0.}

Definition at line 31 of file MuonChannelDesign.h.

31{0.};

◆ isConvertedFromPhaseII

bool MuonGM::MuonChannelDesign::isConvertedFromPhaseII {false}

Definition at line 43 of file MuonChannelDesign.h.

43{false};

◆ m_bottomEdge

Amg::Vector2D MuonGM::MuonChannelDesign::m_bottomEdge {Amg::Vector2D::Zero()}
private

Vector describing the left edge of the trapezoid.

Definition at line 159 of file MuonChannelDesign.h.

159{Amg::Vector2D::Zero()};

◆ m_bottomLeft

Amg::Vector2D MuonGM::MuonChannelDesign::m_bottomLeft {Amg::Vector2D::Zero()}
private

Bottom left point of the trapezoid.

Definition at line 161 of file MuonChannelDesign.h.

161{Amg::Vector2D::Zero()};

◆ m_bottomRight

Amg::Vector2D MuonGM::MuonChannelDesign::m_bottomRight {Amg::Vector2D::Zero()}
private

Bottom right point of the trapezoid.

Definition at line 163 of file MuonChannelDesign.h.

163{Amg::Vector2D::Zero()};

◆ m_firstPos

double MuonGM::MuonChannelDesign::m_firstPos {0.}
private

Position of the first measurement.

Definition at line 155 of file MuonChannelDesign.h.

155{0.};

◆ m_hasStereo

bool MuonGM::MuonChannelDesign::m_hasStereo {false}
private

Definition at line 146 of file MuonChannelDesign.h.

146{false};

◆ m_isDiamond

bool MuonGM::MuonChannelDesign::m_isDiamond {false}
private

Definition at line 147 of file MuonChannelDesign.h.

147{false};

◆ m_maxHorSize

double MuonGM::MuonChannelDesign::m_maxHorSize {0.}
private

Definition at line 171 of file MuonChannelDesign.h.

171{0.}; // Maximum length of the horizontal edges

◆ m_maxYSize

double MuonGM::MuonChannelDesign::m_maxYSize {0.}
private

Definition at line 174 of file MuonChannelDesign.h.

174{0.}; // top length (active area)

◆ m_minYSize

double MuonGM::MuonChannelDesign::m_minYSize {0.}
private

Definition at line 173 of file MuonChannelDesign.h.

173{0.}; // bottom length (active area)

◆ m_sAngle

double MuonGM::MuonChannelDesign::m_sAngle {0.}
private

Definition at line 148 of file MuonChannelDesign.h.

148{0.}; // stereo angle

◆ m_stereoDir

Amg::Vector2D MuonGM::MuonChannelDesign::m_stereoDir {0,1}
private

Direction of the strips.

Definition at line 151 of file MuonChannelDesign.h.

151{0,1};

◆ m_stereoNormal

Amg::Vector2D MuonGM::MuonChannelDesign::m_stereoNormal {1.,0.}
private

Direction pointing to the next strips.

Definition at line 153 of file MuonChannelDesign.h.

153{1.,0.};

◆ m_topEdge

Amg::Vector2D MuonGM::MuonChannelDesign::m_topEdge {Amg::Vector2D::Zero()}
private

Vector describing the right edge of the trapzoid.

Definition at line 157 of file MuonChannelDesign.h.

157{Amg::Vector2D::Zero()};

◆ m_topLeft

Amg::Vector2D MuonGM::MuonChannelDesign::m_topLeft {Amg::Vector2D::Zero()}
private

Top right point of the trapezoid.

Definition at line 165 of file MuonChannelDesign.h.

165{Amg::Vector2D::Zero()};

◆ m_topRight

Amg::Vector2D MuonGM::MuonChannelDesign::m_topRight {Amg::Vector2D::Zero()}
private

Bottom right point of the trapezoid.

Definition at line 167 of file MuonChannelDesign.h.

167{Amg::Vector2D::Zero()};

◆ m_xSize

double MuonGM::MuonChannelDesign::m_xSize {0.}
private

Definition at line 172 of file MuonChannelDesign.h.

172{0.}; // radial distance (active area)

◆ m_yCutout

double MuonGM::MuonChannelDesign::m_yCutout {0.}
private

Definition at line 149 of file MuonChannelDesign.h.

149{0.};

◆ nch

int MuonGM::MuonChannelDesign::nch {-1}

Definition at line 29 of file MuonChannelDesign.h.

29{-1}; // total #of active strips

◆ nGroups

double MuonGM::MuonChannelDesign::nGroups {0.}

Definition at line 35 of file MuonChannelDesign.h.

35{0.}; // Number of Wire groups

◆ nMissedBottomEta

int MuonGM::MuonChannelDesign::nMissedBottomEta {0}

Definition at line 39 of file MuonChannelDesign.h.

39{0};

◆ nMissedBottomStereo

int MuonGM::MuonChannelDesign::nMissedBottomStereo {0}

Definition at line 41 of file MuonChannelDesign.h.

41{0};

◆ nMissedTopEta

int MuonGM::MuonChannelDesign::nMissedTopEta {0}

Definition at line 38 of file MuonChannelDesign.h.

38{0}; // #of strips that are not connected to any FE boards (MM)

◆ nMissedTopStereo

int MuonGM::MuonChannelDesign::nMissedTopStereo {0}

Definition at line 40 of file MuonChannelDesign.h.

40{0};

◆ thickness

double MuonGM::MuonChannelDesign::thickness {0.}

Definition at line 37 of file MuonChannelDesign.h.

37{0.}; // gas thickness

◆ totalStrips

int MuonGM::MuonChannelDesign::totalStrips {0}

Definition at line 42 of file MuonChannelDesign.h.

42{0}; // total strips per MM module

◆ type

ChannelType MuonGM::MuonChannelDesign::type { ChannelType::etaStrip }

Definition at line 27 of file MuonChannelDesign.h.

◆ wireCutout

double MuonGM::MuonChannelDesign::wireCutout {0.}

Definition at line 36 of file MuonChannelDesign.h.

36{0.};

The documentation for this struct was generated from the following files: