ATLAS Offline Software
Loading...
Searching...
No Matches
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
10
11#include <array>
12#include <vector>
13
14class CaloCell_ID;
15
17
18 public:
19 CaloCellPedShift(const CaloCell_ID* cellid);
20
21 //Getter:
22 float pedShift(const IdentifierHash hash, const int gain) const;
23
24 //Setter:
25 void setPedShift(const IdentifierHash hash, const int gain, const float value);
26
27
28 private:
29 //Underlying data structure:
30 //LAr has 3 gains:
31 std::array<std::vector<float>,3> m_larValues;
32 //Tile has 4 gains:
33 std::array<std::vector<float>,4> m_tileValues;
34
36
37};
38
39
40inline
41float CaloCellPedShift::pedShift(const IdentifierHash hash, const int gain) const {
42 if (hash<m_tileMinHash) {
43 return m_larValues[gain][hash];
44 }
45 else {
46 return m_tileValues[gain][hash-m_tileMinHash];
47 }
48}
49
51CLASS_DEF( CaloCellPedShift, 196920958, 1 )
52#include "AthenaKernel/CondCont.h"
54#endif
55
#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
std::array< std::vector< float >, 3 > m_larValues
CaloCellPedShift(const CaloCell_ID *cellid)
float pedShift(const IdentifierHash hash, const int gain) const
std::array< std::vector< float >, 4 > m_tileValues
void setPedShift(const IdentifierHash hash, const int gain, const float value)
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
This is a "hash" representation of an Identifier.