ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCabling
LArCabling
LArLATOMEMapping.h
Go to the documentation of this file.
1
//Dear emacs, this is -*-c++-*-
2
3
/*
4
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
#ifndef LARLATOMEMAPPING_H
8
#define LARLATOMEMAPPING_H
9
10
#include "
Identifier/HWIdentifier.h
"
11
#include "Identifier/Identifier.h"
12
#include "
Identifier/IdentifierHash.h
"
13
14
#include <vector>
15
//#include <algorithm>
16
#include <unordered_map>
21
#define N_LATOME_CHANNELS 320
22
26
27
class
LArLATOMEMapping
{
28
33
friend
class
LArLATOMEMappingAlg
;
//The conditions alg filling this object
34
35
public
:
36
LArLATOMEMapping
(
unsigned
nLatomes=0);
37
42
HWIdentifier
getChannelID
(
const
unsigned
int
sourceID,
const
unsigned
int
chan)
const
;
43
44
45
46
private
:
47
49
const
HWIdentifier
m_hwidEmpty
;
50
51
std::vector<unsigned int>
m_sourceID
;
52
std::vector<std::vector< HWIdentifier> >
m_onlineID
;
53
std::unordered_map<unsigned,std::vector< HWIdentifier> >
m_map
;
54
55
};
56
57
58
//Inline methods:
59
inline
HWIdentifier
LArLATOMEMapping::getChannelID
(
const
unsigned
int
sourceID,
const
unsigned
int
chan)
const
{
60
auto
it =
m_map
.find(sourceID);
61
if
(it ==
m_map
.end()) [[
unlikely
]] {
62
return
m_hwidEmpty
;
63
}
64
const
std::vector<HWIdentifier>& chanVec = it->second;
65
if
(chan >= chanVec.size()) [[
unlikely
]] {
66
return
m_hwidEmpty
;
67
}
68
return
chanVec[chan];
69
}
70
71
#include "
AthenaKernel/CLASS_DEF.h
"
72
CLASS_DEF
(
LArLATOMEMapping
, 219977637 , 1)
73
#include "AthenaKernel/CondCont.h"
74
CONDCONT_DEF
(
LArLATOMEMapping
, 84043487 );
75
76
#endif
CONDCONT_DEF
#define CONDCONT_DEF(...)
Definition
CondCont.h:1413
CLASS_DEF.h
macros to associate a CLID to a type
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition
Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
HWIdentifier.h
IdentifierHash.h
HWIdentifier
Definition
HWIdentifier.h:13
LArLATOMEMapping
class to provide SC mapping
Definition
LArLATOMEMapping.h:27
LArLATOMEMapping::m_onlineID
std::vector< std::vector< HWIdentifier > > m_onlineID
Definition
LArLATOMEMapping.h:52
LArLATOMEMapping::LArLATOMEMapping
LArLATOMEMapping(unsigned nLatomes=0)
Definition
LArLATOMEMapping.cxx:8
LArLATOMEMapping::m_hwidEmpty
const HWIdentifier m_hwidEmpty
Invalid default instance of HWIdentifier.
Definition
LArLATOMEMapping.h:49
LArLATOMEMapping::m_map
std::unordered_map< unsigned, std::vector< HWIdentifier > > m_map
Definition
LArLATOMEMapping.h:53
LArLATOMEMapping::LArLATOMEMappingAlg
friend class LArLATOMEMappingAlg
class which fills object from conditions DB
Definition
LArLATOMEMapping.h:33
LArLATOMEMapping::getChannelID
HWIdentifier getChannelID(const unsigned int sourceID, const unsigned int chan) const
create a HWIdentifier from an Identifier
Definition
LArLATOMEMapping.h:59
LArLATOMEMapping::m_sourceID
std::vector< unsigned int > m_sourceID
Definition
LArLATOMEMapping.h:51
unlikely
#define unlikely(x)
Definition
pythonic_coracool.cxx:9
Generated on
for ATLAS Offline Software by
1.17.0