ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonNSWCommonDecode
src
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
5
#include "
MuonNSWCommonDecode/NSWOfflineHelper.h
"
6
#include "
MuonNSWCommonDecode/NSWResourceId.h
"
7
#include "
MuonNSWCommonDecode/MapperSTG.h
"
8
#include "
MuonNSWCommonDecode/MapperMMG.h
"
9
10
//=====================================================================
11
uint8_t
Muon::nsw::helper::NSWOfflineHelper::channel_type
()
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
)
18
chan_type =
m_vmm
== 0 ?
Muon::nsw::OFFLINE_CHANNEL_TYPE_WIRE
:
Muon::nsw::OFFLINE_CHANNEL_TYPE_PAD
;
19
20
return
chan_type;
21
}
22
23
24
//=====================================================================
25
uint16_t
Muon::nsw::helper::NSWOfflineHelper::channel_number
()
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
//=====================================================================
47
Muon::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
}
MapperMMG.h
MapperSTG.h
NSWOfflineHelper.h
NSWResourceId.h
Muon::nsw::MapperMMG
Definition
MapperMMG.h:15
Muon::nsw::MapperSTG
Definition
MapperSTG.h:18
Muon::nsw::helper::NSWOfflineHelper::channel_type
uint8_t channel_type()
Definition
NSWOfflineHelper.cxx:11
Muon::nsw::helper::NSWOfflineHelper::m_elinkId
Muon::nsw::NSWResourceId * m_elinkId
Definition
NSWOfflineHelper.h:42
Muon::nsw::helper::NSWOfflineHelper::m_chan
uint16_t m_chan
Definition
NSWOfflineHelper.h:45
Muon::nsw::helper::NSWOfflineHelper::m_vmm
uint16_t m_vmm
Definition
NSWOfflineHelper.h:44
Muon::nsw::helper::NSWOfflineHelper::channel_number
uint16_t channel_number()
Definition
NSWOfflineHelper.cxx:25
Muon::nsw::helper::NSWOfflineRobId::m_sourceIds
std::vector< uint32_t > m_sourceIds
Definition
NSWOfflineHelper.h:57
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::helper::s_station_to_detector_map
static const std::map< const std::pair< std::string, bool >, const uint32_t > s_station_to_detector_map
Definition
NSWOfflineHelper.h:60
Muon::nsw::NSW_RESOURCE_PAD
@ NSW_RESOURCE_PAD
Definition
NSWResourceId.h:19
Muon::nsw::channel_type
channel_type
Definition
NSWDecodeHelper.h:21
Muon::nsw::OFFLINE_CHANNEL_TYPE_STRIP
@ OFFLINE_CHANNEL_TYPE_STRIP
Definition
NSWDecodeHelper.h:23
Muon::nsw::OFFLINE_CHANNEL_TYPE_PAD
@ OFFLINE_CHANNEL_TYPE_PAD
Definition
NSWDecodeHelper.h:22
Muon::nsw::OFFLINE_CHANNEL_TYPE_WIRE
@ OFFLINE_CHANNEL_TYPE_WIRE
Definition
NSWDecodeHelper.h:24
Generated on
for ATLAS Offline Software by
1.17.0