ATLAS Offline Software
Loading...
Searching...
No Matches
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
5#include "MMT_Hit.h"
6
7MMT_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}
int m_BC_time
Definition MMT_Hit.h:63
int m_plane
Definition MMT_Hit.h:58
int m_station_eta
Definition MMT_Hit.h:59
double m_Rp
Definition MMT_Hit.h:52
float m_time
Definition MMT_Hit.h:55
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
int m_VMM_chip
Definition MMT_Hit.h:56
double m_RZslope
Definition MMT_Hit.h:52
int m_sector_phi
Definition MMT_Hit.h:61
double m_shift
Definition MMT_Hit.h:54
int m_strip
Definition MMT_Hit.h:62
char m_sector
Definition MMT_Hit.h:65
double m_Z
Definition MMT_Hit.h:53
double m_PitchOverZ
Definition MMT_Hit.h:54
bool m_isX
Definition MMT_Hit.h:67
bool m_isV
Definition MMT_Hit.h:69
bool m_isU
Definition MMT_Hit.h:68
int m_station_phi
Definition MMT_Hit.h:60
int m_age
Definition MMT_Hit.h:64
double m_R
Definition MMT_Hit.h:53
int m_ART_ASIC
Definition MMT_Hit.h:57
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Eigen::Matrix< double, 3, 1 > Vector3D
Definition index.py:1