ATLAS Offline Software
Loading...
Searching...
No Matches
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:
50 const size_t m_oflHashMax;
52};
53
54
56CLASS_DEF(CaloBCIDAverage, 141052237, 1)
57
58#endif // NOT GENERATIONBASE
59
60#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
std::vector with extra alignment.
Header file for AthHistogramAlgorithm.
CaloBCIDAverage()=delete
const LArMCSym * m_mcSym
CxxUtils::vec_aligned_vector< float > m_avg
const size_t m_oflHashMax
float average(const Identifier &id) const
float average(const HWIdentifier &id) const
float averageOflHash(const IdentifierHash h) const
float average(size_t idx) const
This is a "hash" representation of an Identifier.
Helper class to handle z-phi symmetry of calibration constants in MC.
Definition LArMCSym.h:19
static constexpr size_t NO_INDEX
Return for an index if there's no valid symmetric identifier.
Definition LArMCSym.h:41
aligned_vector< T, 64 > vec_aligned_vector
A std::vector with alignment sufficient for any vector instructions on this platform.