ATLAS Offline Software
NSWOfflineHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 
10 //=====================================================================
12 {
13  uint8_t det_id = m_elinkId->detId ();
15 
16  if (det_id == eformat::MUON_STGC_ENDCAP_A_SIDE || det_id == eformat::MUON_STGC_ENDCAP_C_SIDE)
19 
20  return chan_type;
21 }
22 
23 
24 //=====================================================================
26 {
27  uint8_t det_id = m_elinkId->detId ();
28  uint8_t radius = m_elinkId->radius();
29 
30  if (det_id == eformat::MUON_MMEGA_ENDCAP_A_SIDE || det_id == eformat::MUON_MMEGA_ENDCAP_C_SIDE) {
31  static const Muon::nsw::MapperMMG m;
32  return m.channel_number (radius, m_vmm, m_chan);
33 
34  } else if (det_id == eformat::MUON_STGC_ENDCAP_A_SIDE || det_id == eformat::MUON_STGC_ENDCAP_C_SIDE) {
35 
36  static const Muon::nsw::MapperSTG m;
37  uint8_t is_large = m_elinkId->is_large_station () ? 1 : 0;
38  uint8_t layer = m_elinkId->layer (); // in [0, 7]
39  return m.channel_number (this->channel_type(), is_large, radius, layer, m_vmm, m_chan);
40  }
41 
42  return 0;
43 }
44 
45 
46 //=====================================================================
48 {
49  bool is_large = station_name.substr (2, 1) == "L";
50  std::string detectorString = station_name.substr(0,2);
51  const std::pair <std::string, bool> name_and_side = {detectorString, station_eta > 0};
52 
53  uint8_t detId = Muon::nsw::helper::s_station_to_detector_map.at (name_and_side);
54  uint8_t sector = (station_phi - 1) * 2 + (is_large ? 0 : 1);
55 
56  // for now lets build all possible ROB ids for all readout configurations
57  // reference: slide 6 of https://indico.cern.ch/event/1260377/contributions/5294286/attachments/2603399/4495810/NSW-SwRod-Felix-v3.pdf
59  if( detectorString=="MM" && splitConfig == 3) continue; // MM does not have spare devices
60  uint32_t sourceId = (detId << 16) | (splitConfig << 8) | sector;
61  m_sourceIds.push_back(sourceId);
62  }
63 
64 }
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Muon::nsw::NSWResourceId::detId
uint8_t detId() const
Definition: NSWResourceId.h:71
Muon::nsw::helper::NSWOfflineRobId::NSWOfflineRobId
NSWOfflineRobId(const std::string &station_name, int8_t station_eta, uint8_t station_phi)
Definition: NSWOfflineHelper.cxx:47
Muon::nsw::NSW_RESOURCE_PAD
@ NSW_RESOURCE_PAD
Definition: NSWResourceId.h:19
MapperMMG.h
Muon::nsw::OFFLINE_CHANNEL_TYPE_PAD
@ OFFLINE_CHANNEL_TYPE_PAD
Definition: NSWDecodeHelper.h:22
MapperSTG.h
Muon::nsw::helper::NSWOfflineHelper::channel_number
uint16_t channel_number()
Definition: NSWOfflineHelper.cxx:25
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
Muon::nsw::NSWResourceId::resourceType
uint8_t resourceType() const
Definition: NSWResourceId.h:68
Pythia8_A14_NNPDF23LO_SSM_Zprime.splitConfig
splitConfig
Definition: Pythia8_A14_NNPDF23LO_SSM_Zprime.py:3
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Muon::nsw::helper::NSWOfflineHelper::m_vmm
uint16_t m_vmm
Definition: NSWOfflineHelper.h:44
Muon::nsw::MapperMMG
Definition: MapperMMG.h:15
Muon::nsw::OFFLINE_CHANNEL_TYPE_WIRE
@ OFFLINE_CHANNEL_TYPE_WIRE
Definition: NSWDecodeHelper.h:24
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
NSWOfflineHelper.h
NSWResourceId.h
CalibCoolCompareRT.station_eta
station_eta
Definition: CalibCoolCompareRT.py:88
Muon::nsw::helper::NSWOfflineHelper::channel_type
uint8_t channel_type()
Definition: NSWOfflineHelper.cxx:11
Muon::nsw::channel_type
channel_type
Definition: NSWDecodeHelper.h:21
Muon::nsw::OFFLINE_CHANNEL_TYPE_STRIP
@ OFFLINE_CHANNEL_TYPE_STRIP
Definition: NSWDecodeHelper.h:23
CalibCoolCompareRT.station_phi
station_phi
Definition: CalibCoolCompareRT.py:87
createCablingJSON.station_name
string station_name
Simple script to generate a BIS78 cabling map as used for the Monte Carlo processing.
Definition: createCablingJSON.py:8
Muon::nsw::helper::NSWOfflineHelper::m_elinkId
Muon::nsw::NSWResourceId * m_elinkId
Definition: NSWOfflineHelper.h:42
Muon::nsw::MapperSTG
Definition: MapperSTG.h:18