ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellPedShift Class Reference

#include <CaloCellPedShift.h>

Collaboration diagram for CaloCellPedShift:

Public Member Functions

 CaloCellPedShift (const CaloCell_ID *cellid)
float pedShift (const IdentifierHash hash, const int gain) const
void setPedShift (const IdentifierHash hash, const int gain, const float value)

Private Attributes

std::array< std::vector< float >, 3 > m_larValues
std::array< std::vector< float >, 4 > m_tileValues
size_t m_tileMinHash {}

Detailed Description

Definition at line 17 of file CaloCellPedShift.h.

Constructor & Destructor Documentation

◆ CaloCellPedShift()

CaloCellPedShift::CaloCellPedShift ( const CaloCell_ID * cellid)

Definition at line 4 of file CaloCellPedShift.cxx.

4 {
5
6 IdentifierHash tileMinHash, tileMaxHash;
7 cellid->calo_cell_hash_range (CaloCell_ID::TILE,tileMinHash,tileMaxHash);
8
9 for (auto& vec : m_larValues) {
10 vec.resize(tileMinHash,0.0);
11 }
12
13 for (auto& vec : m_tileValues) {
14 vec.resize(tileMaxHash-tileMinHash,0.0);
15 }
16
17 m_tileMinHash=tileMinHash;
18}
std::vector< size_t > vec
std::array< std::vector< float >, 3 > m_larValues
std::array< std::vector< float >, 4 > m_tileValues
void calo_cell_hash_range(const Identifier id, IdentifierHash &caloCellMin, IdentifierHash &caloCellMax) const
to loop on 'global' cell hashes of one sub-calorimeter alone

Member Function Documentation

◆ pedShift()

float CaloCellPedShift::pedShift ( const IdentifierHash hash,
const int gain ) const
inline

Definition at line 41 of file CaloCellPedShift.h.

41 {
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}

◆ setPedShift()

void CaloCellPedShift::setPedShift ( const IdentifierHash hash,
const int gain,
const float value )

Member Data Documentation

◆ m_larValues

std::array<std::vector<float>,3> CaloCellPedShift::m_larValues
private

Definition at line 32 of file CaloCellPedShift.h.

◆ m_tileMinHash

size_t CaloCellPedShift::m_tileMinHash {}
private

Definition at line 35 of file CaloCellPedShift.h.

35{};

◆ m_tileValues

std::array<std::vector<float>,4> CaloCellPedShift::m_tileValues
private

Definition at line 34 of file CaloCellPedShift.h.


The documentation for this class was generated from the following files: