ATLAS Offline Software
CaloBCIDAverage.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef CALOEVENT_CALOBCIDAVERAGE_H
5 #define CALOEVENT_CALOBCIDAVERAGE_H
6 #ifndef GENERATIONBASE
7 
8 #include <unordered_map>
9 #include "Identifier/Identifier.h"
11 
14 
15 
17  public:
18  CaloBCIDAverage() = delete;
20 
21  float averageOflHash(const IdentifierHash h) const {
22  if (h>=m_oflHashMax) return 0.0; //Catches the tile-case
23  const size_t idx = m_mcSym->ZPhiSymOflIndex(h);
24  return m_avg[idx];
25  }
26 
27  float average(const Identifier& id) const {
28  if (!id.is_valid()) return 0;
29  const size_t idx = m_mcSym->ZPhiSymOflIndex(id);
30  if (idx == LArMCSym::NO_INDEX) return 0; //Catches the tile-case
31  return m_avg[idx];
32  }
33 
34 
35  float average(const HWIdentifier& id) const {
36  if (!id.is_valid()) return 0;
37  const size_t idx = m_mcSym->ZPhiSymOnlIndex(id);
38  if (idx == LArMCSym::NO_INDEX) return 0; //Catches the tile-case
39  return m_avg[idx];
40  }
41 
42 
43  float average(size_t idx) const {
44  return m_avg.at(idx);
45  }
46 
47 
48  private:
49  const LArMCSym* m_mcSym;
50  const size_t m_oflHashMax;
52 };
53 
54 
55 #include "AthenaKernel/CLASS_DEF.h"
56 CLASS_DEF(CaloBCIDAverage, 141052237, 1)
57 
58 #endif // NOT GENERATIONBASE
59 
60 #endif
CxxUtils::vec_aligned_vector
aligned_vector< T, 64 > vec_aligned_vector
A std::vector with alignment sufficient for any vector instructions on this platform.
Definition: aligned_vector.h:51
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
CaloBCIDAverage::average
float average(size_t idx) const
Definition: CaloBCIDAverage.h:43
LArMCSym::ZPhiSymOnlIndex
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
CaloBCIDAverage::CaloBCIDAverage
CaloBCIDAverage()=delete
HWIdentifier
Definition: HWIdentifier.h:13
CaloBCIDAverage::averageOflHash
float averageOflHash(const IdentifierHash h) const
Definition: CaloBCIDAverage.h:21
LArMCSym
Helper class to handle z-phi symmetry of calibration constants in MC.
Definition: LArMCSym.h:19
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
CaloBCIDAverage
Definition: CaloBCIDAverage.h:16
HWIdentifier.h
aligned_vector.h
std::vector with extra alignment.
CaloBCIDAverage::average
float average(const Identifier &id) const
Definition: CaloBCIDAverage.h:27
CaloBCIDAverage::m_avg
CxxUtils::vec_aligned_vector< float > m_avg
Definition: CaloBCIDAverage.h:51
CaloBCIDAverage::m_oflHashMax
const size_t m_oflHashMax
Definition: CaloBCIDAverage.h:50
h
LArMCSym::NO_INDEX
static constexpr size_t NO_INDEX
Return for an index if there's no valid symmetric identifier.
Definition: LArMCSym.h:41
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:64
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
LArMCSym::ZPhiSymOflIndex
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
CaloBCIDAverage::m_mcSym
const LArMCSym * m_mcSym
Definition: CaloBCIDAverage.h:49
IdentifierHash
Definition: IdentifierHash.h:38
CLASS_DEF.h
macros to associate a CLID to a type
LArMCSym.h
CaloBCIDAverage::average
float average(const HWIdentifier &id) const
Definition: CaloBCIDAverage.h:35