Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MMT_struct.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 MMT_Parameters::MMT_Parameters(const std::string& layerSetup, char wedgeSize, const MuonGM::MuonDetectorManager* detManager)
10  : AthMessaging(Athena::getMessageSvc(), "MMT_Parameters") {
11 
12  // Get the modules for each multiplet, the sector and side arguement (third and fifth argument, respectively) shouldn't matter
13  // since the algorithm computes locally
14  std::string wedgeString = (wedgeSize=='L' ? "MML" : "MMS");
15  m_sector = wedgeSize;
16 
17  Identifier mm_top_ele_id = detManager->mmIdHelper()->elementID(wedgeString, 2, 5);
18  Identifier mm_bottom_ele_id = detManager->mmIdHelper()->elementID(wedgeString, 1, 5);
19 
20  const MuonGM::MMReadoutElement* mm_ReadOut_top = detManager->getMMReadoutElement(mm_top_ele_id);
21  const MuonGM::MMReadoutElement* mm_ReadOut_bottom = detManager->getMMReadoutElement(mm_bottom_ele_id);
22 
23  m_lWidth = mm_ReadOut_top->getLongSsize();
24  m_pitch = mm_ReadOut_top->getDesign(mm_top_ele_id)->inputPitch;
25 
26  //Needed to get the max channels for the deadZone in the x planes... a little annoying...
27  //Only changes for small or large and per module. Phi, layer, etc don't matter (just set to 1)
28 
29  m_innerRadiusEta1 = mm_ReadOut_bottom->absTransform().translation().perp() - 0.5*mm_ReadOut_bottom->getRsize();
30  m_innerRadiusEta2 = mm_ReadOut_top->absTransform().translation().perp() - 0.5*mm_ReadOut_top->getRsize();
31 
32  const auto design = mm_ReadOut_bottom->getDesign(mm_bottom_ele_id);
33  m_missedBottomEta = design->nMissedBottomEta;
34  m_missedBottomStereo = design->nMissedBottomStereo;
35 
36  // retrieve the z-position of the planes
37  std::vector<double> z_nominal;
38  int eta = 1;
39  for (const auto& pos: MM_firststrip_positions(detManager, wedgeString, eta)) z_nominal.push_back(pos.Z());
40 
41  if(z_nominal.size() != layerSetup.size()){
42  ATH_MSG_WARNING("Number of planes in setup is "<< layerSetup.size() << ", but we have a nominal " << z_nominal.size() << " planes.");
43  throw std::runtime_error("MMT_Parameters: Invalid number of planes");
44  }
45 }
46 
47 std::vector<ROOT::Math::XYZVector> MMT_Parameters::MM_firststrip_positions(const MuonGM::MuonDetectorManager* detManager, const std::string& wedge, int eta) const {
48 
49  std::vector<ROOT::Math::XYZVector> positions;
50  positions.reserve(8);
51 
52  Identifier strip_id;
53  int phi = 1;
54  int strip = 200;
55  unsigned int n_multiplets = 2;
56  unsigned int n_layers = 4;
57 
58  for (unsigned int mult = 1; mult <= n_multiplets; mult++) {
59  for (unsigned int layer = 1; layer <= n_layers; layer++) {
60 
61  Amg::Vector3D pos(0.0, 0.0, 0.0);
62  strip_id = detManager->mmIdHelper()->channelID(wedge, eta, phi, mult, layer, strip);
63  const MuonGM::MMReadoutElement* readout = detManager->getMMReadoutElement(strip_id);
64  ROOT::Math::XYZVector coordinates(0.,0.,0.);
65  if (readout->stripGlobalPosition(strip_id, pos)) coordinates.SetXYZ(pos.x(), pos.y(), pos.z());
66  else ATH_MSG_WARNING("Wedge " << wedge << " phi " << phi << " multiplet " << mult << " layer " << layer << " | Unable to retrieve global positions");
67  positions.push_back(coordinates);
68 
69  ATH_MSG_DEBUG( "global z-pos. (using MMReadoutElement) for"
70  << " wedge size " << wedge
71  << " multiplet " << mult
72  << " layer " << layer
73  << " | z = " << coordinates.Z() );
74  }
75  }
76 
77  return positions;
78 }
79 
80 evInf_entry::evInf_entry(uint64_t event,int pdg,double e,double p,double ieta,double peta,double eeta,double iphi,double pphi,double ephi,double ithe,double pthe,double ethe,double dth,
81  int trn,int mun,const ROOT::Math::XYZVector& tex):
82  athena_event(event),pdg_id(pdg),E(e),pt(p),eta_ip(ieta),eta_pos(peta),eta_ent(eeta),phi_ip(iphi),phi_pos(pphi),phi_ent(ephi),theta_ip(ithe),theta_pos(pthe),theta_ent(ethe),
83  dtheta(dth),truth_n(trn),mu_n(mun),vertex(tex) {}
84 
85 
86 hitData_entry::hitData_entry(uint64_t ev, double gt, double q, int vmm, int mmfe, int pl, int st, int est, int phi, int mult, int gg, double locX, double tr_the, double tru_phi,
87  bool q_tbg, int bct, const ROOT::Math::XYZVector& tru, const ROOT::Math::XYZVector& rec):
88  event(ev),gtime(gt),charge(q),VMM_chip(vmm),MMFE_VMM(mmfe),plane(pl),strip(st),station_eta(est),station_phi(phi),multiplet(mult),gasgap(gg),localX(locX),tru_theta_ip(tr_the),tru_phi_ip(tru_phi),truth_nbg(q_tbg),BC_time(bct),truth(tru),recon(rec) {}
89 
91  const std::string &stationName,
92  double tmpGTime,
93  const ROOT::Math::XYZVector& truthLPos,
94  const ROOT::Math::XYZVector& stripLPos,
95  const ROOT::Math::XYZVector& stripGPos
96  ):
97  digit(digit),
98  stName(stationName),
99  gTime(tmpGTime),
100  truth_lpos(truthLPos),
101  strip_lpos(stripLPos),
102  strip_gpos(stripGPos){}
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
MuonGM::MuonChannelDesign::inputPitch
double inputPitch
Definition: MuonChannelDesign.h:35
MuonGM::MuonReadoutElement::absTransform
const Amg::Transform3D & absTransform() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:210
SiliconTech::strip
@ strip
digitWrapper::digitWrapper
digitWrapper(const MmDigit *digit=0, const std::string &stationName=std::string(), double tmpGTime=0, const ROOT::Math::XYZVector &truthLPos=ROOT::Math::XYZVector(), const ROOT::Math::XYZVector &stripLPos=ROOT::Math::XYZVector(), const ROOT::Math::XYZVector &stripGPos=ROOT::Math::XYZVector())
Definition: MMT_struct.cxx:90
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
Trk::locX
@ locX
Definition: ParamDefs.h:37
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
MMT_Parameters::m_sector
char m_sector
Definition: MMT_struct.h:54
MuonGM::MMReadoutElement::getDesign
const MuonChannelDesign * getDesign(const Identifier &id) const
returns the MuonChannelDesign class for the given identifier
Definition: MMReadoutElement.h:191
MMT_Parameters::m_missedBottomEta
double m_missedBottomEta
Definition: MMT_struct.h:56
test_pyathena.pt
pt
Definition: test_pyathena.py:11
MMT_Parameters::MMT_Parameters
MMT_Parameters(const std::string &layerSetup, char wedgeSize, const MuonGM::MuonDetectorManager *detManager)
Definition: MMT_struct.cxx:9
MmDigit
Definition: MmDigit.h:20
evInf_entry::evInf_entry
evInf_entry(uint64_t event=0, int pdg=0, double e=0, double p=0, double ieta=0, double peta=0, double eeta=0, double iphi=0, double pphi=0, double ephi=0, double ithe=0, double pthe=0, double ethe=0, double dth=0, int trn=0, int mun=0, const ROOT::Math::XYZVector &tex=ROOT::Math::XYZVector())
Definition: MMT_struct.cxx:80
hitData_entry::hitData_entry
hitData_entry(uint64_t ev=0, double gt=0, double q=0, int vmm=0, int mmfe=0, int pl=0, int st=0, int est=0, int phi=0, int mult=0, int gg=0, double locX=0, double tr_the=0, double tru_phi=0, bool q_tbg=0, int bct=0, const ROOT::Math::XYZVector &tru=ROOT::Math::XYZVector(), const ROOT::Math::XYZVector &rec=ROOT::Math::XYZVector())
Definition: MMT_struct.cxx:86
MuonGM::MuonDetectorManager::mmIdHelper
const MmIdHelper * mmIdHelper() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:241
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
MuonGM::MuonReadoutElement::getLongSsize
double getLongSsize() const
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:199
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MMT_Parameters::m_pitch
double m_pitch
Definition: MMT_struct.h:55
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ev
int ev
Definition: globals.cxx:25
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MMT_Parameters::m_missedBottomStereo
double m_missedBottomStereo
Definition: MMT_struct.h:56
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MuonGM::MMReadoutElement::stripGlobalPosition
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
Definition: MMReadoutElement.h:280
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
MMT_Parameters::m_lWidth
double m_lWidth
Definition: MMT_struct.h:55
MMT_struct.h
MmIdHelper::elementID
Identifier elementID(int stationName, int stationEta, int stationPhi) const
Definition: MmIdHelper.cxx:706
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
charge
double charge(const T &p)
Definition: AtlasPID.h:931
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonDetectorManager.h
MMT_Parameters::MM_firststrip_positions
std::vector< ROOT::Math::XYZVector > MM_firststrip_positions(const MuonGM::MuonDetectorManager *detManager, const std::string &wedge, int eta) const
Definition: MMT_struct.cxx:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CalibCoolCompareRT.station_eta
station_eta
Definition: CalibCoolCompareRT.py:88
MuonChannelDesign.h
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
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
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MuonGM::MuonDetectorManager::getMMReadoutElement
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:255
MMT_Parameters::m_innerRadiusEta2
double m_innerRadiusEta2
Definition: MMT_struct.h:55
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition: MMReadoutElement.h:25
MMT_Parameters::m_innerRadiusEta1
double m_innerRadiusEta1
Definition: MMT_struct.h:55
extractSporadic.q
list q
Definition: extractSporadic.py:98
MmIdHelper::channelID
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
Definition: MmIdHelper.cxx:736
CalibCoolCompareRT.station_phi
station_phi
Definition: CalibCoolCompareRT.py:87
Identifier
Definition: IdentifierFieldParser.cxx:14