Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MMT_Hit.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 
9 #include <cmath>
10 
11 MMT_Hit::MMT_Hit(const hitData_entry &entry, const MuonGM::MuonDetectorManager* detManager, const std::string_view stName, const std::vector<ROOT::Math::XYZVector> &planeCoordinates)
12  : m_station_name(stName)
13  {
14  m_sector = stName[2];
15  m_VMM_chip = entry.VMM_chip;
16  m_MMFE_VMM = entry.MMFE_VMM;
17  m_ART_ASIC = std::ceil(1.*entry.MMFE_VMM/2);
18  m_station_eta = entry.station_eta;
19  m_station_phi = entry.station_phi;
20  m_multiplet = entry.multiplet;
21  m_gasgap = entry.gasgap;
22  m_plane = entry.plane;
23  m_strip = entry.strip;
24  m_localX = entry.localX;
25  m_BC_time = entry.BC_time;
26  m_age = entry.BC_time;
27  m_Z = -1.;
28  m_R = -1.;
29  m_Rp = -1.;
30  m_isNoise = false;
31  m_time = entry.gtime;
32  m_RZslope = -1.;
33  m_PitchOverZ = -1.;
34  m_shift = -1.;
35 
36  if(m_strip > 8191 || m_strip<0){
37  m_strip = 0;
38  }
39  int istrip = (std::abs(m_station_eta)-1) * (64*8*10) + m_strip; //here needed the absolute index of the strip on the sector layer (m_strip is only up to 5119)
40 
41  // region represent the index of the mmfe8 in the plane
42  int region = int(float(istrip)/(64*8));
43  // map of mmfe8s layer,radius(MMFE8 index on sector)
44  unsigned int mmfe8s[8][16];
45  // loop on layers
46  for( unsigned int L=0; L<8; L++){
47  // loop on pcbs
48  for(unsigned int p=1; p<9; p++){
49  // loop on sides
50  for(unsigned int s=0; s<2; s++){ //loop on 0 (Left) and 1 (Right), same convention used also later
51  unsigned int R = (L%2==s) ? (p-1)*2 : (p-1)*2+1;
52  mmfe8s[L][R]=s;
53  }
54  }
55  }
56  // re-assigning as seems not to work with new stand-alone run with RecoTf from HITS samples
57  m_MMFE_VMM = region; // index of the MMFE8 board on the layer
58  m_VMM_chip = int(1. *istrip /64.); // index of the VMM chip on the layer
59  // art asic id
60  if(!int(m_plane/2.)%2){
61  if (mmfe8s[m_plane][region]==1){ //Right
62  m_ART_ASIC = 1-int(region/8);
63  }else{
64  m_ART_ASIC = int(region/8);
65  }
66  }else{
67  if (mmfe8s[m_plane][region]==0){ //Left
68  m_ART_ASIC = 1-int(region/8);
69  }else{
70  m_ART_ASIC = int(region/8);
71  }
72  }
73 
74  // if Right side add 2 to the ART Asic Index
75  if(mmfe8s[m_plane][region]==0){
76  m_ART_ASIC+=2;
77  }
78 
80  const MuonGM::MMReadoutElement* readout = detManager->getMMReadoutElement(strip_id);
81  Amg::Vector3D globalPos(0.0, 0.0, 0.0);
82  if(readout->stripGlobalPosition(strip_id, globalPos)) {
83 
84  m_R = globalPos.perp();
85  m_Z = globalPos.z();
86  const double stripPitch{readout->getDesign(strip_id)->inputPitch};
87  m_PitchOverZ = stripPitch/m_Z;
88  m_RZslope = m_R / m_Z;
89 
90  double index = std::round((std::abs(m_RZslope)-0.1)/5e-04); // 0.0005 is approx. the step in slope achievable with a road size of 8 strips
91  double roundedSlope = 0.1 + index*((0.6 - 0.1)/1000.);
92  const double distanceFromZAxis = readout->absTransform().translation().perp() - 0.5*readout->getRsize();
93  m_Rp = distanceFromZAxis + roundedSlope*(planeCoordinates[m_plane].Z() - planeCoordinates[0].Z());
94  m_shift = m_Rp / m_Z;
95  }
96 }
97 
99  : m_sector (hit->m_sector),
100  m_station_name (hit->m_station_name),
101  m_VMM_chip (hit->m_VMM_chip),
102  m_MMFE_VMM (hit->m_MMFE_VMM),
103  m_ART_ASIC (hit->m_ART_ASIC),
104  m_plane (hit->m_plane),
105  m_station_eta (hit->m_station_eta),
106  m_station_phi (hit->m_station_phi),
107  m_multiplet (hit->m_multiplet),
108  m_gasgap (hit->m_gasgap),
109  m_strip (hit->m_strip),
110  m_localX (hit->m_localX),
111  m_RZslope (hit->m_RZslope),
112  m_BC_time (hit->m_BC_time),
113  m_age (hit->m_age),
114  m_Z (hit->m_Z),
115  m_PitchOverZ (hit->m_PitchOverZ),
116  m_R (hit->m_R),
117  m_Rp (hit->m_Rp),
118  m_isNoise (hit->m_isNoise),
119  m_time (hit->m_time),
120  m_shift (hit->m_shift)
121 {
122 }
123 
124 bool MMT_Hit::isX() const {
125  int id = this->getPlane();
126  return (id == 0 || id == 1 || id == 6 || id == 7);
127 }
128 
129 bool MMT_Hit::isU() const {
130  int id = this->getPlane();
131  return (id == 2 || id == 4);
132 }
133 
134 bool MMT_Hit::isV() const {
135  int id = this->getPlane();
136  return (id == 3 || id == 5);
137 }
138 
139 bool MMT_Hit::verifyHit() const {
140  /*
141  * Put here all Hit checks, probably redundant if digitization is ok
142  */
143  if (this->getBC() < 0.) return false;
144  else if (std::isinf(this->getRZSlope())) return false;
145  else if (this->getChannel() < 1 || this->getChannel() > 8192) return false;
146  else return true;
147 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
MMT_Hit::m_station_eta
int m_station_eta
Definition: MMT_Hit.h:55
MuonGM::MuonChannelDesign::inputPitch
double inputPitch
Definition: MuonChannelDesign.h:35
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
MuonGM::MuonReadoutElement::absTransform
const Amg::Transform3D & absTransform() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:210
MMT_Hit::m_sector
char m_sector
Definition: MMT_Hit.h:49
MMT_Hit::m_R
double m_R
Definition: MMT_Hit.h:64
index
Definition: index.py:1
MMT_Hit::m_RZslope
double m_RZslope
Definition: MMT_Hit.h:61
MMT_Hit::m_Rp
double m_Rp
Definition: MMT_Hit.h:64
MuonGM::MMReadoutElement::getDesign
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
Definition: MMReadoutElement.h:191
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
MMT_Hit.h
MMT_Hit::m_ART_ASIC
int m_ART_ASIC
Definition: MMT_Hit.h:53
MuonGM::MuonDetectorManager::mmIdHelper
const MmIdHelper * mmIdHelper() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:241
MMT_Hit
Definition: MMT_Hit.h:10
MMT_Hit::isV
bool isV() const
Definition: MMT_Hit.cxx:134
MMT_Hit::m_Z
double m_Z
Definition: MMT_Hit.h:63
MMT_Hit::verifyHit
bool verifyHit() const
Definition: MMT_Hit.cxx:139
MMT_Hit::m_age
int m_age
Definition: MMT_Hit.h:62
MMT_Hit::m_shift
float m_shift
Definition: MMT_Hit.h:66
MMT_Hit::m_PitchOverZ
double m_PitchOverZ
Definition: MMT_Hit.h:63
MMReadoutElement.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MMT_Hit::m_gasgap
int m_gasgap
Definition: MMT_Hit.h:58
MMT_Hit::m_plane
int m_plane
Definition: MMT_Hit.h:54
MMT_Hit::m_VMM_chip
int m_VMM_chip
Definition: MMT_Hit.h:51
MMT_Hit::getChannel
int getChannel() const
Definition: MMT_Hit.h:19
MuonGM::MMReadoutElement::stripGlobalPosition
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
Definition: MMReadoutElement.h:280
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
MMT_Hit::isU
bool isU() const
Definition: MMT_Hit.cxx:129
MMT_Hit::m_station_phi
int m_station_phi
Definition: MMT_Hit.h:56
MMT_Hit::m_MMFE_VMM
int m_MMFE_VMM
Definition: MMT_Hit.h:52
AnalysisUtils::Delta::R
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Definition: AnalysisMisc.h:49
MMT_Hit::m_multiplet
int m_multiplet
Definition: MMT_Hit.h:57
MMT_Hit::m_station_name
std::string m_station_name
Definition: MMT_Hit.h:50
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
MMT_Hit::m_time
float m_time
Definition: MMT_Hit.h:66
MMT_Hit::getBC
int getBC() const
Definition: MMT_Hit.h:18
MMT_Hit::isX
bool isX() const
Definition: MMT_Hit.cxx:124
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonDetectorManager.h
MuonChannelDesign.h
MMT_Hit::m_BC_time
int m_BC_time
Definition: MMT_Hit.h:62
MuonGM::MuonReadoutElement::getRsize
double getRsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:197
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
MMT_Hit::getRZSlope
double getRZSlope() const
Definition: MMT_Hit.h:24
MuonGM::MuonDetectorManager::getMMReadoutElement
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:255
MMT_Hit::m_strip
int m_strip
Definition: MMT_Hit.h:59
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition: MMReadoutElement.h:25
MMT_Hit::MMT_Hit
MMT_Hit(const hitData_entry &entry, const MuonGM::MuonDetectorManager *detManager, const std::string_view stName, const std::vector< ROOT::Math::XYZVector > &planeCoordinates)
Definition: MMT_Hit.cxx:11
hitData_entry
Definition: MMT_struct.h:70
MMT_Hit::getPlane
int getPlane() const
Definition: MMT_Hit.h:22
MMT_Hit::m_localX
double m_localX
Definition: MMT_Hit.h:60
MMT_Hit::m_isNoise
bool m_isNoise
Definition: MMT_Hit.h:65
MmIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
Definition: MmIdHelper.cxx:736
Identifier
Definition: IdentifierFieldParser.cxx:14