ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloEvent
CaloEvent
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"
10
#include "
Identifier/HWIdentifier.h
"
11
12
#include "
LArRawConditions/LArMCSym.h
"
13
#include "
CxxUtils/aligned_vector.h
"
14
15
16
class
CaloBCIDAverage
{
17
public
:
18
CaloBCIDAverage
() =
delete
;
19
CaloBCIDAverage
(
const
LArMCSym
* mcSym,
CxxUtils::vec_aligned_vector<float>
&& data);
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
;
51
CxxUtils::vec_aligned_vector<float>
m_avg
;
52
};
53
54
55
#include "
AthenaKernel/CLASS_DEF.h
"
56
CLASS_DEF
(
CaloBCIDAverage
, 141052237, 1)
57
58
#endif
// NOT GENERATIONBASE
59
60
#endif
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
LArMCSym.h
aligned_vector.h
std::vector with extra alignment.
h
Header file for AthHistogramAlgorithm.
CaloBCIDAverage
Definition
CaloBCIDAverage.h:16
CaloBCIDAverage::CaloBCIDAverage
CaloBCIDAverage()=delete
CaloBCIDAverage::m_mcSym
const LArMCSym * m_mcSym
Definition
CaloBCIDAverage.h:49
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
CaloBCIDAverage::average
float average(const Identifier &id) const
Definition
CaloBCIDAverage.h:27
CaloBCIDAverage::average
float average(const HWIdentifier &id) const
Definition
CaloBCIDAverage.h:35
CaloBCIDAverage::averageOflHash
float averageOflHash(const IdentifierHash h) const
Definition
CaloBCIDAverage.h:21
CaloBCIDAverage::average
float average(size_t idx) const
Definition
CaloBCIDAverage.h:43
HWIdentifier
Definition
HWIdentifier.h:13
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
LArMCSym
Helper class to handle z-phi symmetry of calibration constants in MC.
Definition
LArMCSym.h:19
LArMCSym::NO_INDEX
static constexpr size_t NO_INDEX
Return for an index if there's no valid symmetric identifier.
Definition
LArMCSym.h:41
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
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0