ATLAS Offline Software
Loading...
Searching...
No Matches
LArMCSym.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef LARRAWCONDITIONS_LARMCSYM_H
6#define LARRAWCONDITIONS_LARMCSYM_H
7
8
11
17
19{
20public:
21 LArMCSym() = delete;
22
23
32 LArMCSym(const LArOnlineID_Base* onlId,
33 const CaloCell_Base_ID* caloId,
34 std::vector<HWIdentifier>&& oflHashtoSymOnl,
35 std::vector<HWIdentifier>&& onlHashtoSymOnl,
36 std::vector<HWIdentifier>&& symIds
37 );
38
39
41 static constexpr size_t NO_INDEX = static_cast<size_t> (-1);
42
43
48 HWIdentifier ZPhiSymOfl(const Identifier notSymOffId) const {
49 if (m_caloCellID->is_tile(notSymOffId)) return HWIdentifier();
50 const IdentifierHash h=m_caloCellID->calo_cell_hash(notSymOffId);
51 return ZPhiSymOfl(h);
52 }
53
54
59 HWIdentifier ZPhiSymOfl(const IdentifierHash notSymOffHash) const {
60 assert(notSymOffHash < m_oflHashtoSymOnl.size());
61 return HWIdentifier (m_oflHashtoSymOnl[notSymOffHash].first);
62 }
63
64
70 size_t ZPhiSymOflIndex(const Identifier notSymOffId) const {
71 if (m_caloCellID->is_tile(notSymOffId)) return NO_INDEX;
72 const IdentifierHash h=m_caloCellID->calo_cell_hash(notSymOffId);
73 return ZPhiSymOflIndex(h);
74 }
75
81 size_t ZPhiSymOflIndex(const IdentifierHash notSymOffHash) const {
82 assert(notSymOffHash < m_oflHashtoSymOnl.size());
83 return m_oflHashtoSymOnl[notSymOffHash].second;
84 }
85
86
91 HWIdentifier ZPhiSymOnl(const HWIdentifier notSymOnlId) const {
92 const IdentifierHash h=m_onlineID->channel_Hash(notSymOnlId);
93 return ZPhiSymOnl(h);
94 }
95
96
101 HWIdentifier ZPhiSymOnl(const IdentifierHash notSymOnlHash) const {
102 assert(notSymOnlHash < m_onlHashtoSymOnl.size());
103 return HWIdentifier (m_onlHashtoSymOnl[notSymOnlHash].first);
104 }
105
106
112 size_t ZPhiSymOnlIndex(const HWIdentifier notSymOnlId) const {
113 const IdentifierHash h=m_onlineID->channel_Hash(notSymOnlId);
114 return ZPhiSymOnlIndex(h);
115 }
116
117
123 size_t ZPhiSymOnlIndex(const IdentifierHash notSymOnlHash) const {
124 assert(notSymOnlHash < m_onlHashtoSymOnl.size());
125 return m_onlHashtoSymOnl[notSymOnlHash].second;
126 }
127
128
132 const std::vector<HWIdentifier>& symIds() const {
133 return m_symIds;
134 }
135
139 std::pair<size_t,size_t> hashMax() const {
140 return std::make_pair(m_onlHashtoSymOnl.size(),m_oflHashtoSymOnl.size());
141 }
142
143
144
145 private:
146 typedef std::pair<Identifier32::value_type, uint32_t> IdPair_t;
147 std::vector<IdPair_t>
148 initIndices (const std::vector<HWIdentifier>& ids,
149 const std::vector<HWIdentifier>& symIds) const;
150
151
154 const std::vector<IdPair_t> m_oflHashtoSymOnl;
155 const std::vector<IdPair_t> m_onlHashtoSymOnl;
156 const std::vector<HWIdentifier> m_symIds;
157
158};
159
161CLASS_DEF( LArMCSym , 33771274 , 1 )
162#include "AthenaKernel/CondCont.h"
163CONDCONT_DEF( LArMCSym, 159334782 );
164
165#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
Header file for AthHistogramAlgorithm.
Helper base class for offline cell identifiers.
This is a "hash" representation of an Identifier.
Helper class to handle z-phi symmetry of calibration constants in MC.
Definition LArMCSym.h:19
HWIdentifier ZPhiSymOfl(const Identifier notSymOffId) const
Find the symmetric HWID for an offline cell identifier.
Definition LArMCSym.h:48
const std::vector< HWIdentifier > & symIds() const
Return the list of symmetric hashes.
Definition LArMCSym.h:132
size_t ZPhiSymOflIndex(const IdentifierHash notSymOffHash) const
Find the index in symIds() of the symmetric HWID for an offline cell hash.
Definition LArMCSym.h:81
const LArOnlineID_Base * m_onlineID
Definition LArMCSym.h:152
std::pair< Identifier32::value_type, uint32_t > IdPair_t
Definition LArMCSym.h:146
HWIdentifier ZPhiSymOnl(const IdentifierHash notSymOnlHash) const
Find the symmetric HWID for an online channel hash.
Definition LArMCSym.h:101
size_t ZPhiSymOnlIndex(const HWIdentifier notSymOnlId) const
Find the index in symIds() of the symmetric HWID for an online channel identifier.
Definition LArMCSym.h:112
const std::vector< IdPair_t > m_oflHashtoSymOnl
Definition LArMCSym.h:154
const std::vector< HWIdentifier > m_symIds
Definition LArMCSym.h:156
HWIdentifier ZPhiSymOfl(const IdentifierHash notSymOffHash) const
Find the symmetric HWID for an offline cell hash.
Definition LArMCSym.h:59
size_t ZPhiSymOflIndex(const Identifier notSymOffId) const
Find the index in symIds() of the symmetric HWID for an offline cell identifier.
Definition LArMCSym.h:70
LArMCSym()=delete
size_t ZPhiSymOnlIndex(const IdentifierHash notSymOnlHash) const
Find the index in symIds() of the symmetric HWID for an online channel hash.
Definition LArMCSym.h:123
std::pair< size_t, size_t > hashMax() const
Return the hash-max as pair<onlHashMax,oflHashMax>
Definition LArMCSym.h:139
std::vector< IdPair_t > initIndices(const std::vector< HWIdentifier > &ids, const std::vector< HWIdentifier > &symIds) const
Definition LArMCSym.cxx:33
static constexpr size_t NO_INDEX
Return for an index if there's no valid symmetric identifier.
Definition LArMCSym.h:41
const std::vector< IdPair_t > m_onlHashtoSymOnl
Definition LArMCSym.h:155
HWIdentifier ZPhiSymOnl(const HWIdentifier notSymOnlId) const
Find the symmetric HWID for an online channel identifier.
Definition LArMCSym.h:91
const CaloCell_Base_ID * m_caloCellID
Definition LArMCSym.h:153
Helper for the Liquid Argon Calorimeter cell identifiers.