ATLAS Offline Software
MuonStripDesign.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  properties of a plane based strip detector with equidistant parallel strips
7  -----------------------------------------
8 ***************************************************************************/
9 
10 #ifndef MUONREADOUTGEOMETRY_MUONSTRIPDESIGN_H
11 #define MUONREADOUTGEOMETRY_MUONSTRIPDESIGN_H
13 
14 #include <algorithm>
15 #include <cstdint>
16 namespace MuonGM {
17 
18  struct MuonStripDesign {
19  public:
20  int nstrips{0};
21  double stripPitch{0.};
22  double invStripPitch{0.};
23  double stripLength{0.};
24  double stripWidth;
25  double readoutLocY{0.};
26  double signY{0.};
28 
30  double distanceToReadout(const Amg::Vector2D& pos) const;
31  double distanceToReadout(double locY) const;
32 
34  int stripNumber(const Amg::Vector2D& pos) const;
35  int stripNumber(double locX) const;
36 
38  bool stripPosition(int strip, Amg::Vector2D& pos) const;
39  };
40 
41  inline double MuonStripDesign::distanceToReadout(const Amg::Vector2D& pos) const { return distanceToReadout(pos.y()); }
42 
43  inline double MuonStripDesign::distanceToReadout(double locY) const {
44  return std::clamp(locY - readoutLocY, 0., stripLength);
45  }
46 
47  inline int MuonStripDesign::stripNumber(const Amg::Vector2D& pos) const { return stripNumber(pos.x()); }
48 
49  inline int MuonStripDesign::stripNumber(double locX) const {
50  int st = (locX - firstStripPos.x()) * invStripPitch + 1.5;
51  if (st < 1) return -1;
52  if (st > nstrips) return -1;
53  return st;
54  }
55 
56  inline bool MuonStripDesign::stripPosition(int st, Amg::Vector2D& pos) const {
57  if (st < 1 || st > nstrips) return false;
58  pos[0] = firstStripPos.x() + stripPitch * (st - 1);
59  pos[1] = firstStripPos.y();
60  return true;
61  }
62 
63 } // namespace MuonGM
64 #endif // MUONREADOUTGEOMETRY_MUONSTRIPDESIGN_H
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
Trk::locX
@ locX
Definition: ParamDefs.h:43
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:44
MuonGM::MuonStripDesign::stripPitch
double stripPitch
Definition: MuonStripDesign.h:27
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
MuonGM::MuonStripDesign::nstrips
int nstrips
Definition: MuonStripDesign.h:26
MuonGM::MuonStripDesign::invStripPitch
double invStripPitch
Definition: MuonStripDesign.h:28
GeoPrimitives.h
MuonGM::MuonStripDesign::readoutLocY
double readoutLocY
Definition: MuonStripDesign.h:31
MuonGM::MuonStripDesign::firstStripPos
Amg::Vector2D firstStripPos
Definition: MuonStripDesign.h:33
MuonGM::MuonStripDesign::distanceToReadout
double distanceToReadout(const Amg::Vector2D &pos) const
distance to readout
Definition: MuonStripDesign.h:44
MuonGM::MuonStripDesign::stripNumber
int stripNumber(const Amg::Vector2D &pos) const
calculate local strip number, range 1=nstrips like identifiers.
Definition: MuonStripDesign.h:50
MuonGM::MuonStripDesign::stripPosition
bool stripPosition(int strip, Amg::Vector2D &pos) const
calculate local strip position for a given strip number
Definition: MuonStripDesign.h:59
MuonGM::MuonStripDesign::signY
double signY
Definition: MuonStripDesign.h:32
MuonGM::MuonStripDesign::stripWidth
double stripWidth
Definition: MuonStripDesign.h:30
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
MuonGM::MuonStripDesign::stripLength
double stripLength
Definition: MuonStripDesign.h:29
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32