ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonPrepRawDataProviderTools
MuonPrepRawDataProviderTools
MuonLayerHashProviderTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef MUON_MUONLAYERHASHPROVIDERTOOL_H
6
#define MUON_MUONLAYERHASHPROVIDERTOOL_H
7
8
#include "
AthenaBaseComps/AthAlgTool.h
"
9
10
#include "
MuonIdHelpers/IMuonIdHelperSvc.h
"
11
#include "
MuonReadoutGeometry/MuonDetectorManager.h
"
12
#include "
StoreGate/ReadCondHandleKey.h
"
13
14
#include <mutex>
15
#include <string>
16
#include <vector>
17
#include <array>
18
19
20
namespace
Muon
{
21
22
class
MuonLayerHashProviderTool
:
public
AthAlgTool
{
23
public
:
29
using
HashVec
= std::vector<IdentifierHash>;
30
31
using
RegionHashVec
= std::array<
HashVec
,
MuonStationIndex::sectorLayerHashMax
()>;
32
using
TechnologyIndex
=
MuonStationIndex::TechnologyIndex
;
33
static
constexpr
unsigned
techMax
=
MuonStationIndex::toInt
(TechnologyIndex::TechnologyIndexMax);
34
using
TechnologyRegionHashVec
= std::array< RegionHashVec, techMax>;
35
36
struct
RegionHashesPerSector
{
37
int
sector
{-1};
38
TechnologyRegionHashVec
technologyRegionHashVecs
{};
39
};
40
using
RegionHashesPerSectorVec
= std::array<
RegionHashesPerSector
,
MuonStationIndex::numberOfSectors
()>;
41
43
const
HashVec
&
getHashes
(
int
sector,
TechnologyIndex
technologyIndex,
unsigned
int
sectorLayerHash
)
const
;
44
46
MuonLayerHashProviderTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent);
47
virtual
~MuonLayerHashProviderTool
()=
default
;
48
StatusCode
initialize
()
override
;
49
51
static
const
InterfaceID&
interfaceID
() {
52
static
const
InterfaceID IID_MuonLayerHashProviderTool(
"Muon::MuonLayerHashProviderTool"
,1,0);
53
return
IID_MuonLayerHashProviderTool;
54
}
55
56
57
private
:
58
60
void
insertTechnology
(
const
MuonIdHelper
& idHelper );
61
63
void
insertTgcs
()
const
;
64
66
void
insertHash
(
const
IdentifierHash
& hash,
const
Identifier
&
id
)
const
;
67
69
void
insertHash
(
int
sector,
const
IdentifierHash
& hash,
const
Identifier
&
id
)
const
;
70
72
bool
initializeSectorMapping
();
73
75
mutable
RegionHashesPerSectorVec
m_regionHashesPerSector
ATLAS_THREAD_SAFE
{};
76
mutable
std::atomic<bool> m_hashLoaded
ATLAS_THREAD_SAFE
{
false
};
77
mutable
std::mutex
m_tgcHash
{};
78
79
ServiceHandle<Muon::IMuonIdHelperSvc>
m_idHelperSvc
{
this
,
"MuonIdHelperSvc"
,
"Muon::MuonIdHelperSvc/MuonIdHelperSvc"
};
80
81
SG::ReadCondHandleKey<MuonGM::MuonDetectorManager>
m_detMgrKey
{
this
,
"DetMgr"
,
"MuonDetectorManager"
,
82
"MuonManager ReadKey for IOV Range intersection"
};
83
84
85
};
86
87
88
inline
const
std::vector<IdentifierHash>&
MuonLayerHashProviderTool::getHashes
(
int
sector,
TechnologyIndex
technologyIndex,
89
unsigned
int
sectorLayerHash
)
const
{
90
if
(!m_hashLoaded){
91
insertTgcs
();
92
}
93
using namespace
MuonStationIndex
;
94
return
m_regionHashesPerSector[sector-1].technologyRegionHashVecs[
toInt
(technologyIndex)][
sectorLayerHash
];
95
}
96
}
97
98
99
100
#endif
AthAlgTool.h
IMuonIdHelperSvc.h
MuonDetectorManager.h
ReadCondHandleKey.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
MuonIdHelper
Definition
MuonIdHelper.h:77
Muon::MuonLayerHashProviderTool::m_detMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
Definition
MuonLayerHashProviderTool.h:81
Muon::MuonLayerHashProviderTool::TechnologyIndex
MuonStationIndex::TechnologyIndex TechnologyIndex
Definition
MuonLayerHashProviderTool.h:32
Muon::MuonLayerHashProviderTool::ATLAS_THREAD_SAFE
RegionHashesPerSectorVec m_regionHashesPerSector ATLAS_THREAD_SAFE
cachaed hash data structure
Definition
MuonLayerHashProviderTool.h:75
Muon::MuonLayerHashProviderTool::initialize
StatusCode initialize() override
Definition
MuonLayerHashProviderTool.cxx:21
Muon::MuonLayerHashProviderTool::MuonLayerHashProviderTool
MuonLayerHashProviderTool(const std::string &type, const std::string &name, const IInterface *parent)
Default AlgTool functions.
Definition
MuonLayerHashProviderTool.cxx:15
Muon::MuonLayerHashProviderTool::RegionHashesPerSectorVec
std::array< RegionHashesPerSector, MuonStationIndex::numberOfSectors()> RegionHashesPerSectorVec
Definition
MuonLayerHashProviderTool.h:40
Muon::MuonLayerHashProviderTool::getHashes
const HashVec & getHashes(int sector, TechnologyIndex technologyIndex, unsigned int sectorLayerHash) const
access hashes for a given sector, technology and layer hash
Definition
MuonLayerHashProviderTool.h:88
Muon::MuonLayerHashProviderTool::RegionHashVec
std::array< HashVec, MuonStationIndex::sectorLayerHashMax()> RegionHashVec
Definition
MuonLayerHashProviderTool.h:31
Muon::MuonLayerHashProviderTool::techMax
static constexpr unsigned techMax
Definition
MuonLayerHashProviderTool.h:33
Muon::MuonLayerHashProviderTool::insertHash
void insertHash(const IdentifierHash &hash, const Identifier &id) const
insert a single hash for a given identifier
Definition
MuonLayerHashProviderTool.cxx:35
Muon::MuonLayerHashProviderTool::~MuonLayerHashProviderTool
virtual ~MuonLayerHashProviderTool()=default
Muon::MuonLayerHashProviderTool::insertTgcs
void insertTgcs() const
insert hashes for the tgcs
Definition
MuonLayerHashProviderTool.cxx:58
Muon::MuonLayerHashProviderTool::HashVec
std::vector< IdentifierHash > HashVec
define data structure
Definition
MuonLayerHashProviderTool.h:29
Muon::MuonLayerHashProviderTool::insertTechnology
void insertTechnology(const MuonIdHelper &idHelper)
insert hashes of a given technology
Definition
MuonLayerHashProviderTool.cxx:45
Muon::MuonLayerHashProviderTool::initializeSectorMapping
bool initializeSectorMapping()
initialize the mapping structure
Definition
MuonLayerHashProviderTool.cxx:103
Muon::MuonLayerHashProviderTool::interfaceID
static const InterfaceID & interfaceID()
access to tool interface
Definition
MuonLayerHashProviderTool.h:51
Muon::MuonLayerHashProviderTool::TechnologyRegionHashVec
std::array< RegionHashVec, techMax > TechnologyRegionHashVec
Definition
MuonLayerHashProviderTool.h:34
Muon::MuonLayerHashProviderTool::m_tgcHash
std::mutex m_tgcHash
Definition
MuonLayerHashProviderTool.h:77
Muon::MuonLayerHashProviderTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition
MuonLayerHashProviderTool.h:79
SG::ReadCondHandleKey
Definition
ReadCondHandleKey.h:21
ServiceHandle
Definition
ClusterMakerTool.h:36
Identifier
Definition
IdentifierFieldParser.cxx:14
Muon::MuonStationIndex
Definition
MuonStationIndex.h:14
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition
MuonStationIndex.h:55
Muon::MuonStationIndex::numberOfSectors
constexpr unsigned numberOfSectors()
return total number of sectors
Definition
MuonStationIndex.h:132
Muon::MuonStationIndex::toInt
constexpr int toInt(const EnumType enumVal)
Definition
MuonStationIndex.h:62
Muon::MuonStationIndex::sectorLayerHashMax
constexpr unsigned int sectorLayerHashMax()
maximum create a hash out of region and layer
Definition
MuonStationIndex.h:117
Muon::MuonStationIndex::sectorLayerHash
unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
type
Muon::MuonLayerHashProviderTool::RegionHashesPerSector
Definition
MuonLayerHashProviderTool.h:36
Muon::MuonLayerHashProviderTool::RegionHashesPerSector::technologyRegionHashVecs
TechnologyRegionHashVec technologyRegionHashVecs
Definition
MuonLayerHashProviderTool.h:38
Muon::MuonLayerHashProviderTool::RegionHashesPerSector::sector
int sector
Definition
MuonLayerHashProviderTool.h:37
Generated on
for ATLAS Offline Software by
1.17.0