ATLAS Offline Software
Loading...
Searching...
No Matches
LArOnOffIdMapping.h
Go to the documentation of this file.
1//Dear emacs, this is -*-c++-*-
2
3/*
4 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef LARONOFFIDMAPPING_H
8#define LARONOFFIDMAPPING_H
9
11#include "Identifier/Identifier.h"
13
16
17#include <vector>
18#include <assert.h>
19
21
22 friend class LArOnOffMappingAlg; //The conditions alg filling this object
23
24 public:
26
28
34
35
41
46 Identifier cnvToIdentifier(const HWIdentifier & sid) const;
47
53
58
62 bool isOnlineConnectedFromHash(const IdentifierHash & sid_hash ) const;
63
67 bool isOnlineConnected(const HWIdentifier & sid ) const;
68
69
73 std::vector<Identifier>& getOnlHash2OflId();
74 std::vector<HWIdentifier>& getOflHash2OnId();
75
76
77 private:
80
81 std::vector<Identifier> m_onlHashToOffline;
82 std::vector<HWIdentifier> m_oflHashToOnline;
83 std::vector<IdentifierHash> m_onlHashToOflHash;
84
87
90
91};
92
93
94//Inline methods:
95
97 if (sid_hash <m_onlHashToOffline.size())
98 return (m_idEmpty!=m_onlHashToOffline[sid_hash]);
99
100 return false;
101}
102
103
107
108
110 if (sid_hash <m_onlHashToOffline.size())
111 return m_onlHashToOffline[sid_hash];
112
113 return m_idEmpty;
114}
115
117 const IdentifierHash sid_hash=m_onlineId->channel_Hash(sid);
118 return this->cnvToIdentifierFromHash(sid_hash);
119 }
120
121inline bool LArOnOffIdMapping::isOnlineConnected(const HWIdentifier & sid ) const {
122 const IdentifierHash sid_hash=m_onlineId->channel_Hash(sid);
123 return this->isOnlineConnectedFromHash(sid_hash);
124}
125
127 const IdentifierHash id_hash=m_caloId->calo_cell_hash(id);
128 return this->createSignalChannelIDFromHash(id_hash);
129}
130
131inline std::vector<Identifier>& LArOnOffIdMapping::getOnlHash2OflId() {
132 return m_onlHashToOffline;
133}
134
135inline std::vector<HWIdentifier>& LArOnOffIdMapping::getOflHash2OnId() {
136 return m_oflHashToOnline;
137}
138
140 assert(onlHash < m_onlHashToOflHash.size());
141 return m_onlHashToOflHash[onlHash];
142}
143
144
146CLASS_DEF( LArOnOffIdMapping,148608605 , 1)
147#include "AthenaKernel/CondCont.h"
149
150#endif
Helper base class for offline cell identifiers.
#define CONDCONT_DEF(...)
Definition CondCont.h:1413
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Helper base class for offline cell identifiers.
This is a "hash" representation of an Identifier.
const LArOnlineID_Base * m_onlineId
std::vector< Identifier > m_onlHashToOffline
std::vector< Identifier > & getOnlHash2OflId()
Access to underlying storage (not-const only!)
Identifier cnvToIdentifierFromHash(const IdentifierHash &sid_hash) const
create an Identifier from a HWIdentifier (from hash) (inline)
const CaloCell_Base_ID * m_caloId
const Identifier m_idEmpty
Invalid default instance of Identifier.
std::vector< HWIdentifier > & getOflHash2OnId()
std::vector< HWIdentifier > m_oflHashToOnline
const HWIdentifier m_hwidEmpty
Invalid default instance of HWIdentifier.
bool isOnlineConnectedFromHash(const IdentifierHash &sid_hash) const
Test whether a HWIdentifier is connected of not (by online hash) (inline)
IdentifierHash oflHashFromOnlHash(const IdentifierHash &onlHash) const
Offline identifier hash from online.
HWIdentifier createSignalChannelIDFromHash(const IdentifierHash &id_hash) const
create a HWIdentifier from an Identifier (from hash) (inline)
Identifier cnvToIdentifier(const HWIdentifier &sid) const
create an Identifier from a HWIdentifier (inline)
LArOnOffIdMapping()=delete
HWIdentifier createSignalChannelID(const Identifier &id) const
create a HWIdentifier from an Identifier (not inline)
friend class LArOnOffMappingAlg
std::vector< IdentifierHash > m_onlHashToOflHash
bool isOnlineConnected(const HWIdentifier &sid) const
Test whether a HWIdentifier is connected of not (inline)
Helper for the Liquid Argon Calorimeter cell identifiers.