ATLAS Offline Software
Loading...
Searching...
No Matches
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 ();
14 uint8_t chan_type = Muon::nsw::OFFLINE_CHANNEL_TYPE_STRIP;
15
16 if (det_id == eformat::MUON_STGC_ENDCAP_A_SIDE || det_id == eformat::MUON_STGC_ENDCAP_C_SIDE)
17 if (m_elinkId->resourceType () == Muon::nsw::NSW_RESOURCE_PAD)
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//=====================================================================
47Muon::nsw::helper::NSWOfflineRobId::NSWOfflineRobId (const std::string &station_name, int8_t station_eta, uint8_t station_phi)
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
58 for(uint8_t splitConfig = 0; splitConfig<4; splitConfig++){
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}
Muon::nsw::NSWResourceId * m_elinkId
std::vector< uint32_t > m_sourceIds
NSWOfflineRobId(const std::string &station_name, int8_t station_eta, uint8_t station_phi)
@ OFFLINE_CHANNEL_TYPE_STRIP
@ OFFLINE_CHANNEL_TYPE_PAD
@ OFFLINE_CHANNEL_TYPE_WIRE