ATLAS Offline Software
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 
6 
7 MMT_Hit::MMT_Hit(const Identifier &id, const std::string& stationName,
8  const int stEta, const int stPhi, const int sectorPhi,
9  const int multiplet, const int gasGap, const int channel,
10  const float stripTime, const int BC,
11  const MuonGM::MuonDetectorManager* detManager)
12  : m_time(stripTime),
13  m_station_eta(stEta), m_station_phi(stPhi), m_sector_phi(sectorPhi),
14  m_strip(channel),
15  m_BC_time(BC), m_age(BC),
16  m_sector(stationName[2])
17  {
18  m_plane = (multiplet-1)*4 + gasGap-1;
19 
20  switch (m_plane) {
21  case 0:
22  case 1:
23  case 6:
24  case 7:
25  m_isX = true;
26  break;
27  case 2:
28  case 4:
29  m_isU = true;
30  break;
31  case 3:
32  case 5:
33  m_isV = true;
34  break;
35  }
36 
37  // here needed the absolute index of the strip on the sector layer (m_strip is only up to 5119)
38  const int istrip = (std::abs(m_station_eta)-1) * (64*8*10) + m_strip;
39 
40  // region represent the index of the MMFE8 board in the plane
41  const int region = int(float(istrip)/(64*8));
42 
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 
57  m_VMM_chip = int(1. *istrip /64.); // index of the VMM chip on the layer
58  // art asic id
59  if(!(int(m_plane/2.)%2)){
60  if (mmfe8s[m_plane][region]==1){ //Right
61  m_ART_ASIC = 1-int(region/8);
62  }else{
63  m_ART_ASIC = int(region/8);
64  }
65  }else{
66  if (mmfe8s[m_plane][region]==0){ //Left
67  m_ART_ASIC = 1-int(region/8);
68  }else{
69  m_ART_ASIC = int(region/8);
70  }
71  }
72 
73  // if Left side add 2 to the ART Asic Index
74  if(mmfe8s[m_plane][region]==0){
75  m_ART_ASIC+=2;
76  }
77 
78  const MuonGM::MMReadoutElement* readout = detManager->getMMReadoutElement(id);
79  Amg::Vector3D globalPos(0.0, 0.0, 0.0);
80  if(readout->stripGlobalPosition(id, globalPos)) {
81  m_R = globalPos.perp();
82  m_Z = globalPos.z();
83  m_PitchOverZ = (readout->getDesign(id))->inputPitch/m_Z;
84  m_RZslope = m_R / m_Z;
85  const double distanceFromZAxis = readout->absTransform().translation().perp() - 0.5*readout->getRsize();
86 
87  Identifier tmpId = detManager->mmIdHelper()->channelID(stationName, 1, 1, 1, 1, 1);
88  const MuonGM::MMReadoutElement* roEl = detManager->getMMReadoutElement(tmpId);
89  int tmpStrip = (roEl->getDesign(tmpId))->nMissedBottomEta + 1;
90  tmpId = detManager->mmIdHelper()->channelID(stationName, 1, 1, 1, 1, tmpStrip);
91  globalPos = Amg::Vector3D::Zero();
92  if(roEl->stripGlobalPosition(tmpId, globalPos)) {
93  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
94  m_Rp = distanceFromZAxis + (0.1 + index*((0.6 - 0.1)/1000.))*(std::abs(m_Z) - globalPos.z());
95  m_shift = m_Rp / m_Z;
96  }
97  }
98 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
MMT_Hit::m_station_eta
int m_station_eta
Definition: MMT_Hit.h:59
MMT_Hit::m_isX
bool m_isX
Definition: MMT_Hit.h:67
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
MuonGM::MuonReadoutElement::absTransform
const Amg::Transform3D & absTransform() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:210
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
MMT_Hit::m_R
double m_R
Definition: MMT_Hit.h:53
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
index
Definition: index.py:1
MMT_Hit::m_RZslope
double m_RZslope
Definition: MMT_Hit.h:52
MMT_Hit::m_Rp
double m_Rp
Definition: MMT_Hit.h:52
MuonGM::MMReadoutElement::getDesign
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
Definition: MMReadoutElement.h:190
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:57
MuonGM::MuonDetectorManager::mmIdHelper
const MmIdHelper * mmIdHelper() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:247
MMT_Hit::m_Z
double m_Z
Definition: MMT_Hit.h:53
MMT_Hit::m_PitchOverZ
double m_PitchOverZ
Definition: MMT_Hit.h:54
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
MMT_Hit::m_plane
int m_plane
Definition: MMT_Hit.h:58
MMT_Hit::m_VMM_chip
int m_VMM_chip
Definition: MMT_Hit.h:56
MMT_Hit::m_isV
bool m_isV
Definition: MMT_Hit.h:69
MuonGM::MMReadoutElement::stripGlobalPosition
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
Definition: MMReadoutElement.h:277
MMT_Hit::MMT_Hit
MMT_Hit(const Identifier &id, const std::string &stationName, const int stEta, const int stPhi, const int sectorPhi, const int multiplet, const int gasGap, const int channel, const float stripTime, const int BC, const MuonGM::MuonDetectorManager *detManager)
Definition: MMT_Hit.cxx:7
AnalysisUtils::Delta::R
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Definition: AnalysisMisc.h:49
MMT_Hit::m_isU
bool m_isU
Definition: MMT_Hit.h:68
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Muon::EnumDefs::BC
@ BC
Definition: MuonEnumDefs.h:13
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
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:51
MuonGM::MuonDetectorManager::getMMReadoutElement
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:257
MMT_Hit::m_strip
int m_strip
Definition: MMT_Hit.h:62
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition: MMReadoutElement.h:25
python.SystemOfUnits.s
float s
Definition: SystemOfUnits.py:147
MmIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
Definition: MmIdHelper.cxx:736
MMT_Hit::m_shift
double m_shift
Definition: MMT_Hit.h:54
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32
python.SystemOfUnits.L
float L
Definition: SystemOfUnits.py:92
Identifier
Definition: IdentifierFieldParser.cxx:14