ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloConditions
CaloConditions
CaloCellPedShift.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef CALOCONDITIONS_CALOCELLPEDSHIFT
6
#define CALOCONDITIONS_CALOCELLPEDSHIFT
7
8
#include "
Identifier/IdentifierHash.h
"
9
10
#include <array>
11
#include <vector>
12
#include <format>
13
#include <stdexcept>
14
15
class
CaloCell_ID
;
16
17
class
CaloCellPedShift
{
18
19
public
:
20
CaloCellPedShift
(
const
CaloCell_ID
* cellid);
21
22
//Getter:
23
float
pedShift
(
const
IdentifierHash
hash,
const
int
gain)
const
;
24
25
//Setter:
26
void
setPedShift
(
const
IdentifierHash
hash,
const
int
gain,
const
float
value);
27
28
29
private
:
30
//Underlying data structure:
31
//LAr has 3 gains:
32
std::array<std::vector<float>,3>
m_larValues
;
33
//Tile has 4 gains:
34
std::array<std::vector<float>,4>
m_tileValues
;
35
size_t
m_tileMinHash
{};
36
37
};
38
39
40
inline
41
float
CaloCellPedShift::pedShift
(
const
IdentifierHash
hash,
const
int
gain)
const
{
42
try
{
43
if
(hash<
m_tileMinHash
) {
44
return
m_larValues
.at(gain)[hash];
45
}
else
{
46
return
m_tileValues
.at(gain)[hash-
m_tileMinHash
];
47
}
48
}
catch
(
const
std::out_of_range & e){
49
throw
std::out_of_range(std::format (
"CaloCellPedShift::pedShift: {} is out of the array range."
, gain));
50
}
51
}
52
53
#include "
AthenaKernel/CLASS_DEF.h
"
54
CLASS_DEF
(
CaloCellPedShift
, 196920958, 1 )
55
#include "AthenaKernel/CondCont.h"
56
CONDCONT_DEF
(
CaloCellPedShift
,56606546 );
57
#endif
58
CONDCONT_DEF
#define CONDCONT_DEF(...)
Definition
CondCont.h:1413
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
IdentifierHash.h
CaloCellPedShift
Definition
CaloCellPedShift.h:17
CaloCellPedShift::m_tileMinHash
size_t m_tileMinHash
Definition
CaloCellPedShift.h:35
CaloCellPedShift::m_larValues
std::array< std::vector< float >, 3 > m_larValues
Definition
CaloCellPedShift.h:32
CaloCellPedShift::CaloCellPedShift
CaloCellPedShift(const CaloCell_ID *cellid)
Definition
CaloCellPedShift.cxx:4
CaloCellPedShift::pedShift
float pedShift(const IdentifierHash hash, const int gain) const
Definition
CaloCellPedShift.h:41
CaloCellPedShift::m_tileValues
std::array< std::vector< float >, 4 > m_tileValues
Definition
CaloCellPedShift.h:34
CaloCellPedShift::setPedShift
void setPedShift(const IdentifierHash hash, const int gain, const float value)
Definition
CaloCellPedShift.cxx:21
CaloCell_ID
Helper class for offline cell identifiers.
Definition
CaloCell_ID.h:34
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
Generated on
for ATLAS Offline Software by
1.17.0