ATLAS Offline Software
Loading...
Searching...
No Matches
Muon/L1MuonNSW/src/MMT_Hit.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3 */
4
5#include "MMT_Hit.h"
6
7#include <array>
8#include <string>
9
10namespace L1Muon::L1MM {
11
12MMT_Hit::MMT_Hit(const Identifier& id, const float stripTime, const int BC,
13 const MuonGMR4::MuonDetectorManager* detManager,
14 const ActsTrk::GeometryContext& gctx)
15 : m_time(stripTime),
16 m_BC_time(BC), m_age(BC)
17 {
18 const Muon::IMuonIdHelperSvc* idHelperSvc = detManager->idHelperSvc();
19 const MmIdHelper& idHelper = idHelperSvc->mmIdHelper();
20 const std::string stationName = idHelperSvc->chamberNameString(id);
21 m_station_eta = idHelperSvc->stationEta(id);
22 m_station_phi = idHelperSvc->stationPhi(id);
23 m_sector_phi = idHelperSvc->sector(id);
24 m_strip = idHelper.channel(id);
25 m_sector = stationName[2]; // 'L' for MML, 'S' for MMS
26 m_plane = (idHelper.multilayer(id)-1)*4 + idHelper.gasGap(id)-1;
27
28 const MuonGMR4::MmReadoutElement* readout = detManager->getMmReadoutElement(id);
29 const MuonGMR4::StripDesign& design = readout->stripLayer(id).design();
30
31 // Layer type from the strip design: X layers have no stereo angle, U layers +1.5 deg, V layers -1.5 deg
32 if (!design.hasStereoAngle()) m_type = LayerType::X;
33 else m_type = (design.stereoAngle() > 0.) ? LayerType::U : LayerType::V;
34
35 // Strip index on the sector layer (the channel restarts at each module, up to 5120 for |stationEta| = 1)
37
38 // region represent the index of the MMFE8 board in the plane
39 const int region = m_globalStrip / kStripsPerMMFE8;
40
41 // map of mmfe8s layer,radius(MMFE8 index on sector)
42 std::array<std::array<unsigned int, kMMFE8sPerLayer>, kPlanes> mmfe8s{};
43 // loop on layers
44 for( unsigned int L=0; L<kPlanes; L++){
45 // loop on pcbs
46 for(unsigned int p=1; p<=kPCBsPerLayer; p++){
47 // loop on sides
48 for(unsigned int s=0; s<2; s++){ //loop on 0 (Left) and 1 (Right), same convention used also later
49 unsigned int R = (L%2==s) ? (p-1)*2 : (p-1)*2+1;
50 mmfe8s[L][R]=s;
51 }
52 }
53 }
54
55 m_VMM_chip = m_globalStrip / kStripsPerVMM; // index of the VMM chip on the layer
56 // art asic id: radial half of the layer (0 inner, 1 outer), swapped on the second gas-gap pair
57 const int half = region / kMMFE8sPerHalfLayer;
58 if(!((m_plane/2)%2)){
59 if (mmfe8s[m_plane][region]==1){ //Right
60 m_ART_ASIC = 1-half;
61 }else{
62 m_ART_ASIC = half;
63 }
64 }else{
65 if (mmfe8s[m_plane][region]==0){ //Left
66 m_ART_ASIC = 1-half;
67 }else{
68 m_ART_ASIC = half;
69 }
70 }
71
72 // if Left side add 2 to the ART Asic Index
73 if(mmfe8s[m_plane][region]==0){
74 m_ART_ASIC+=2;
75 }
76
77 // Geometry: global position of the strip centre, with the alignment of the geometry context
78 const Amg::Vector3D globalPos = readout->stripPosition(gctx, id);
79 m_R = globalPos.perp();
80 m_Z = globalPos.z();
81 m_PitchOverZ = design.stripPitch()/m_Z;
82 m_RZslope = m_R / m_Z;
83
84 // Reference: the eta=1 module of this sector type (MML/MMS), phi=1, side A, multilayer 1, gas gap 1
85 const Identifier refId = idHelper.channelID(stationName, 1, 1, 1, 1, 1);
86 const MuonGMR4::MmReadoutElement* roEl = detManager->getMmReadoutElement(refId);
87 const double distanceFromZAxis = roEl->center(gctx).perp() - 0.5*roEl->moduleHeight();
88 const int firstActiveStrip = roEl->firstStrip(roEl->layerHash(refId));
89 const Identifier refStripId = idHelper.channelID(stationName, 1, 1, 1, 1, firstActiveStrip);
90 const Amg::Vector3D refPos = roEl->stripPosition(gctx, refStripId);
91
92 m_refR0 = distanceFromZAxis;
93 m_refZ0 = refPos.z();
94
95 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
96 m_Rp = distanceFromZAxis + (0.1 + index*((0.6 - 0.1)/1000.))*(std::abs(m_Z) - refPos.z());
97 m_shift = m_Rp / m_Z;
98}
99
100} // namespace L1Muon::L1MM
Scalar perp() const
perp method - perpendicular length
if(pathvar)
MMT_Hit(const Identifier &id, const float stripTime, const int BC, const MuonGMR4::MuonDetectorManager *detManager, const ActsTrk::GeometryContext &gctx)
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
int multilayer(const Identifier &id) const
double moduleHeight() const
Returns the height along the z-axis.
IdentifierHash layerHash(const Identifier &measId) const override final
The layer hash removes the bits from the IdentifierHash corresponding to the measurement's channel nu...
unsigned int firstStrip(const IdentifierHash &layerHash) const
Returns the first active strip.
Amg::Vector3D stripPosition(const ActsTrk::GeometryContext &ctx, const Identifier &measId) const
Returns the position of the strip center.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns a pointer to the central MuonIdHelperSvc.
Amg::Vector3D center(const ActsTrk::GeometryContext &ctx) const
Returns the geometrical center point of the readout element.
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
virtual const MmIdHelper & mmIdHelper() const =0
access to CscIdHelper
virtual int stationPhi(const Identifier &id) const =0
Return stationPhi for all technologies.
virtual int stationEta(const Identifier &id) const =0
Return stationEta for all technologies.
virtual std::string chamberNameString(const Identifier &id) const =0
print chamber name to string
virtual int sector(const Identifier &id) const =0
return sector number 1-16, odd=large, even=small
Eigen::Matrix< double, 3, 1 > Vector3D
Definitions shared by the classes of the MM trigger processor emulation.
constexpr int kStripsEta1
Nominal strips of one layer of the |stationEta| = 1 module (5120).
constexpr int kStripsPerVMM
Strips read out by one VMM.
constexpr int kStripsPerMMFE8
Strips read out by one MMFE8 board.
constexpr int kPlanes
Planes of the MM octuplet (2 multilayers x 4 gas gaps).
constexpr int kMMFE8sPerHalfLayer
MMFE8 boards in each radial half of the layer (inner: 0-7, outer: 8-15).