ATLAS Offline Software
Loading...
Searching...
No Matches
CaloNoise.h
Go to the documentation of this file.
1//Dear emacs, this is -*-c++-*-
2/*
3 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
4*/
5
6#ifndef CALOCONDITIONS_CALONOISE_H
7#define CALOCONDITIONS_CALONOISE_H
8
9#include <boost/multi_array.hpp>
14#include <memory>
15
16
17class CaloNoise {
19
20 public:
21
25
26 CaloNoise() =delete;
27
28 ~CaloNoise();
29
31 CaloNoise(const size_t nLArCells, const size_t nLArGains, const size_t nTileCells, const size_t nTileGains,
32 const CaloCell_Base_ID* caloCellId, const NOISETYPE noisetype);
33
35 float getNoise(const IdentifierHash h, const int gain) const {
36 if (h<m_tileHashOffset) {
37 return m_larNoise[gain][h];
38 }
39 else {
40 const unsigned int dbGain = CaloCondUtils::getDbCaloGain(gain);
41 return m_tileNoise[dbGain][h-m_tileHashOffset];
42 }
43 }
44
46 float getNoise(const Identifier id, const int gain) const {
47 IdentifierHash h=m_caloCellId->calo_cell_hash(id);
48 return getNoise(h,gain);
49 }
50
51
53 float getNoise(const HWIdentifier /*hwid*/, const int /*gain*/) const = delete;
54
55
56 float getEffectiveSigma(const Identifier id, const int gain, const float energy) const {
57 IdentifierHash h=m_caloCellId->calo_cell_hash(id);
58 return getEffectiveSigma(h,gain,energy);
59 }
60
61
62 float getEffectiveSigma(const IdentifierHash h, const int gain, const float energy) const {
63 if (h<m_tileHashOffset) {
64 return m_larNoise[gain][h];
65 }
66 else {
67 return getTileEffSigma(h-m_tileHashOffset,gain,energy);
68 }
69 }
70
72 boost::multi_array<float, 2>& larStorage() {return m_larNoise;}
73 boost::multi_array<float, 2>& tileStorage() {return m_tileNoise;}
74
76 const boost::multi_array<float, 2>& larStorage() const {return m_larNoise;}
77 const boost::multi_array<float, 2>& tileStorage() const {return m_tileNoise;}
78
79
80 void setTileBlob(std::unique_ptr<const CaloCondBlobFlt> flt, const float lumi);
81
82 //Those are needed for the GPU data conversions.
83
84 const CaloCondBlobFlt * getTileBlob() const { return m_tileBlob.get(); }
85
86 float getLumi() const { return m_lumi; }
87
89
90 private:
91 float calcSig(const IdentifierHash tilehash, const int gain, const float energy) const;
92 float getTileEffSigma(const IdentifierHash subHash, const int gain, const float e) const;
93
95
96 //Flat structure, choosen based on profiling done by Scott in Nov 2013
97 boost::multi_array<float, 2> m_larNoise;
98 boost::multi_array<float, 2> m_tileNoise;
100
101
102 //For double-gaussian noise:
103 std::unique_ptr<const CaloCondBlobFlt> m_tileBlob;
104 float m_lumi=0;
106};
107
109CLASS_DEF( CaloNoise , 16721262 , 1 )
110#include "AthenaKernel/CondCont.h"
112#endif
#define CONDCONT_MIXED_DEF(...)
Definition CondCont.h:1446
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Header file for AthHistogramAlgorithm.
Helper base class for offline cell identifiers.
Class for storing a number of floats (Flt) and functions on those.
static unsigned int getDbCaloGain(int caloGain)
Returns the non-negative gainId to be used with the COOL DB.
float calcSig(const IdentifierHash tilehash, const int gain, const float energy) const
Definition CaloNoise.cxx:41
const CaloCondBlobFlt * getTileBlob() const
Definition CaloNoise.h:84
boost::multi_array< float, 2 > m_tileNoise
Definition CaloNoise.h:98
float getEffectiveSigma(const IdentifierHash h, const int gain, const float energy) const
Definition CaloNoise.h:62
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition CaloNoise.h:35
boost::multi_array< float, 2 > & larStorage()
Non-const accessor to underlying storage for filling:
Definition CaloNoise.h:72
const CaloCell_Base_ID * m_caloCellId
Definition CaloNoise.h:94
NOISETYPE getNoiseType() const
Definition CaloNoise.h:88
float getLumi() const
Definition CaloNoise.h:86
boost::multi_array< float, 2 > m_larNoise
Definition CaloNoise.h:97
float getNoise(const Identifier id, const int gain) const
Accessor by Identifier and gain.
Definition CaloNoise.h:46
unsigned m_tileHashOffset
Definition CaloNoise.h:99
float getEffectiveSigma(const Identifier id, const int gain, const float energy) const
Definition CaloNoise.h:56
float m_lumi
Definition CaloNoise.h:104
float getTileEffSigma(const IdentifierHash subHash, const int gain, const float e) const
Definition CaloNoise.cxx:76
NOISETYPE m_noiseType
Definition CaloNoise.h:105
std::unique_ptr< const CaloCondBlobFlt > m_tileBlob
Definition CaloNoise.h:103
CaloNoise()=delete
void setTileBlob(std::unique_ptr< const CaloCondBlobFlt > flt, const float lumi)
Definition CaloNoise.cxx:31
boost::multi_array< float, 2 > & tileStorage()
Definition CaloNoise.h:73
const boost::multi_array< float, 2 > & larStorage() const
Const accessor to underlying storage for GPU data structures.
Definition CaloNoise.h:76
float getNoise(const HWIdentifier, const int) const =delete
Safety net: Disallow access by HWIdentifier.
NOISETYPE
Conditions Data Object holding the calorimeter noise per cell and per gain.
Definition CaloNoise.h:22
const boost::multi_array< float, 2 > & tileStorage() const
Definition CaloNoise.h:77
This is a "hash" representation of an Identifier.