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 &pos) 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 21 of file MuonChannelDesign.h.

Member Enumeration Documentation

◆ ChannelType

Enumerator
etaStrip 
phiStrip 

Definition at line 24 of file MuonChannelDesign.h.

24{ etaStrip, phiStrip };

◆ DetType

Enumerator
MM 
STGC 
Other 

Definition at line 25 of file MuonChannelDesign.h.

25{ 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 78 of file MuonChannelDesign.h.

78{ return m_rotMat; }

◆ AmgSymMatrix() [2/2]

MuonGM::MuonChannelDesign::AmgSymMatrix ( 2 )
inlineprivate

Definition at line 168 of file MuonChannelDesign.h.

168{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 476 of file MuonChannelDesign.h.

476 {
477 if (!geomCenter(channel, pos)) return false;
478 pos = m_rotMat * pos;
479 return true;
480 }
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 373 of file MuonChannelDesign.h.

373 {
374 Amg::Vector2D cen{Amg::Vector2D::Zero()}, side{Amg::Vector2D::Zero()};
375 if (!geomCenter(st,cen) || (left&& !leftInterSect(st, side)) || (!left && !rightInterSect(st, side))) return -0.5;
376 if (type == ChannelType::etaStrip && detType == DetType::MM && (st < 1 || st > totalStrips)) return -0.5;
377 // default case:
378 return (cen - side).mag();
379 }
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 383 of file MuonChannelDesign.h.

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

◆ 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 195 of file MuonChannelDesign.h.

195 {
196
197 int chNum{-1};
199 // ** MM strips: keeping cases outside the active area, but within the envelope,
200 // to avoid warnings from MuonPRDTest. Those channels are removed from digitization.
201 const Amg::Vector2D posInEta = m_rotMat.inverse()*pos;
202 const double xMid = (posInEta - firstPos()*Amg::Vector2D::UnitX()).dot(m_stereoNormal) / m_stereoNormal.x();
203 const int missedBottom = numberOfMissingBottomStrips();
204
205 // first position is always 1/2 pitch above the center of the first active strip
206 chNum = static_cast<int>(std::floor( xMid / inputPitch)) + missedBottom + 2;
207 if (chNum < 1 || chNum > totalStrips) chNum = -1;
208
209 } else if (type == ChannelType::phiStrip && detType == DetType::STGC) {
210
211 // ** sTGC wires: return the wire group
212 chNum = wireGroupNumber(pos);
213
214 } else {
215
216 // ** All other cases
217 chNum = (int)std::floor( (pos.x() - firstPos()) / inputPitch ) + 2;
218 if (chNum < 1 || chNum > nch) chNum = -1;
219 }
220
221 return chNum;
222 }
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 308 of file MuonChannelDesign.h.

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

◆ channelWidth()

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

calculate local channel width

Definition at line 391 of file MuonChannelDesign.h.

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

◆ 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 }
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
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 178 of file MuonChannelDesign.h.

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

◆ distanceToReadout()

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

distance to readout

Definition at line 187 of file MuonChannelDesign.h.

187 {
188 throw std::runtime_error("MuonChannelDesign::distanceToReadout() - is not properly defined");
189 return pos.dot(pos);
190 }

◆ firstPos()

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

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

Definition at line 473 of file MuonChannelDesign.h.

473{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 87 of file MuonChannelDesign.h.

◆ geomCenter()

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

Returns the geometrical strip center.

Definition at line 403 of file MuonChannelDesign.h.

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

◆ hasStereoAngle()

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

returns whether the stereo angle is non-zero

Definition at line 72 of file MuonChannelDesign.h.

◆ isDiamondShape()

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

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

Definition at line 75 of file MuonChannelDesign.h.

75{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 483 of file MuonChannelDesign.h.

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

◆ 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 411 of file MuonChannelDesign.h.

411 {
413 Amg::Vector2D chanPos{Amg::Vector2D::Zero()};
414 if (!channelPosition(channel, chanPos)) return false;
415
417 if (!uncapped && m_isDiamond && chanPos.x() > 0) {
418 pos = Amg::Vector2D(chanPos.x(), -0.5*m_maxYSize);
419 return true;
420 }
421
422 std::optional<double> lambda = Amg::intersect<2>(chanPos, m_stereoDir, m_bottomLeft, m_bottomEdge);
423 if (!lambda) return false;
426 if (!uncapped && m_hasStereo && ( (*lambda) < 0. || (*lambda) > m_maxHorSize)) {
427 const Amg::Vector2D e_y{0., 1.};
428 const std::optional<double> bottom_line = Amg::intersect<2>(m_stereoDir.x() > 0.? m_bottomLeft: m_bottomRight, e_y, chanPos, m_stereoDir);
429 if (bottom_line) {
430 pos = chanPos + (*bottom_line)* m_stereoDir;
431 return true;
432 }
433 }
434 pos = (m_bottomLeft + (*lambda) * m_bottomEdge);
435 return true;
436 }
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 471 of file MuonChannelDesign.h.

471{return m_maxYSize;}

◆ minYSize()

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

Definition at line 472 of file MuonChannelDesign.h.

472{return m_minYSize;}

◆ numberOfMissingBottomStrips()

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

Returns the number of missing bottom strips.

Definition at line 469 of file MuonChannelDesign.h.

◆ numberOfMissingTopStrips()

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

Returns the number of missing top strips.

Definition at line 468 of file MuonChannelDesign.h.

◆ passivatedHeight()

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

Passivation is applied parallel to.

Definition at line 505 of file MuonChannelDesign.h.

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

◆ 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 499 of file MuonChannelDesign.h.

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

◆ 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 279 of file MuonChannelDesign.h.

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

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

◆ 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 439 of file MuonChannelDesign.h.

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

◆ 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 67 of file MuonChannelDesign.h.

67{ 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 226 of file MuonChannelDesign.h.

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

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

◆ xSize()

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

Definition at line 470 of file MuonChannelDesign.h.

470{return m_xSize;}

◆ yCutout()

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

Definition at line 69 of file MuonChannelDesign.h.

69{ return m_yCutout; }

Member Data Documentation

◆ detType

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

◆ firstPitch

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

Definition at line 32 of file MuonChannelDesign.h.

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

◆ groupWidth

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

Definition at line 33 of file MuonChannelDesign.h.

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

◆ inputLength

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

Definition at line 31 of file MuonChannelDesign.h.

31{0.};

◆ inputPitch

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

Definition at line 29 of file MuonChannelDesign.h.

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

◆ inputWidth

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

Definition at line 30 of file MuonChannelDesign.h.

30{0.};

◆ isConvertedFromPhaseII

bool MuonGM::MuonChannelDesign::isConvertedFromPhaseII {false}

Definition at line 42 of file MuonChannelDesign.h.

42{false};

◆ m_bottomEdge

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

Vector describing the left edge of the trapezoid.

Definition at line 158 of file MuonChannelDesign.h.

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

◆ m_bottomLeft

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

Bottom left point of the trapezoid.

Definition at line 160 of file MuonChannelDesign.h.

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

◆ m_bottomRight

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

Bottom right point of the trapezoid.

Definition at line 162 of file MuonChannelDesign.h.

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

◆ m_firstPos

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

Position of the first measurement.

Definition at line 154 of file MuonChannelDesign.h.

154{0.};

◆ m_hasStereo

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

Definition at line 145 of file MuonChannelDesign.h.

145{false};

◆ m_isDiamond

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

Definition at line 146 of file MuonChannelDesign.h.

146{false};

◆ m_maxHorSize

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

Definition at line 170 of file MuonChannelDesign.h.

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

◆ m_maxYSize

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

Definition at line 173 of file MuonChannelDesign.h.

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

◆ m_minYSize

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

Definition at line 172 of file MuonChannelDesign.h.

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

◆ m_sAngle

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

Definition at line 147 of file MuonChannelDesign.h.

147{0.}; // stereo angle

◆ m_stereoDir

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

Direction of the strips.

Definition at line 150 of file MuonChannelDesign.h.

150{0,1};

◆ m_stereoNormal

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

Direction pointing to the next strips.

Definition at line 152 of file MuonChannelDesign.h.

152{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 156 of file MuonChannelDesign.h.

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

◆ m_topLeft

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

Top right point of the trapezoid.

Definition at line 164 of file MuonChannelDesign.h.

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

◆ m_topRight

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

Bottom right point of the trapezoid.

Definition at line 166 of file MuonChannelDesign.h.

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

◆ m_xSize

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

Definition at line 171 of file MuonChannelDesign.h.

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

◆ m_yCutout

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

Definition at line 148 of file MuonChannelDesign.h.

148{0.};

◆ nch

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

Definition at line 28 of file MuonChannelDesign.h.

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

◆ nGroups

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

Definition at line 34 of file MuonChannelDesign.h.

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

◆ nMissedBottomEta

int MuonGM::MuonChannelDesign::nMissedBottomEta {0}

Definition at line 38 of file MuonChannelDesign.h.

38{0};

◆ nMissedBottomStereo

int MuonGM::MuonChannelDesign::nMissedBottomStereo {0}

Definition at line 40 of file MuonChannelDesign.h.

40{0};

◆ nMissedTopEta

int MuonGM::MuonChannelDesign::nMissedTopEta {0}

Definition at line 37 of file MuonChannelDesign.h.

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

◆ nMissedTopStereo

int MuonGM::MuonChannelDesign::nMissedTopStereo {0}

Definition at line 39 of file MuonChannelDesign.h.

39{0};

◆ thickness

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

Definition at line 36 of file MuonChannelDesign.h.

36{0.}; // gas thickness

◆ totalStrips

int MuonGM::MuonChannelDesign::totalStrips {0}

Definition at line 41 of file MuonChannelDesign.h.

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

◆ type

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

Definition at line 26 of file MuonChannelDesign.h.

◆ wireCutout

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

Definition at line 35 of file MuonChannelDesign.h.

35{0.};

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