ATLAS Offline Software
Loading...
Searching...
No Matches
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>
16namespace MuonGM {
17
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.};
27 Amg::Vector2D firstStripPos{Amg::Vector2D::Zero()};
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
Eigen::Matrix< double, 2, 1 > Vector2D
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27
bool stripPosition(int strip, Amg::Vector2D &pos) const
calculate local strip position for a given strip number
double distanceToReadout(const Amg::Vector2D &pos) const
distance to readout
int stripNumber(const Amg::Vector2D &pos) const
calculate local strip number, range 1=nstrips like identifiers.