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-2018 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
15
16class CaloNoise {
18
19 public:
20
24
25 CaloNoise() =delete;
26
27 ~CaloNoise();
28
30 CaloNoise(const size_t nLArCells, const size_t nLArGains, const size_t nTileCells, const size_t nTileGains,
31 const CaloCell_Base_ID* caloCellId, const NOISETYPE noisetype);
32
34 float getNoise(const IdentifierHash h, const int gain) const {
35 if (h<m_tileHashOffset) {
36 return m_larNoise[gain][h];
37 }
38 else {
39 const unsigned int dbGain = CaloCondUtils::getDbCaloGain(gain);
40 return m_tileNoise[dbGain][h-m_tileHashOffset];
41 }
42 }
43
45 float getNoise(const Identifier id, const int gain) const {
46 IdentifierHash h=m_caloCellId->calo_cell_hash(id);
47 return getNoise(h,gain);
48 }
49
50
52 float getNoise(const HWIdentifier /*hwid*/, const int /*gain*/) const = delete;
53
54
55 float getEffectiveSigma(const Identifier id, const int gain, const float energy) const {
56 IdentifierHash h=m_caloCellId->calo_cell_hash(id);
57 return getEffectiveSigma(h,gain,energy);
58 }
59
60
61 float getEffectiveSigma(const IdentifierHash h, const int gain, const float energy) const {
62 if (h<m_tileHashOffset) {
63 return m_larNoise[gain][h];
64 }
65 else {
66 return getTileEffSigma(h-m_tileHashOffset,gain,energy);
67 }
68 }
69
71 boost::multi_array<float, 2>& larStorage() {return m_larNoise;}
72 boost::multi_array<float, 2>& tileStorage() {return m_tileNoise;}
73
75 const boost::multi_array<float, 2>& larStorage() const {return m_larNoise;}
76 const boost::multi_array<float, 2>& tileStorage() const {return m_tileNoise;}
77
78
79 void setTileBlob(const CaloCondBlobFlt* flt, const float lumi);
80
81 //Those are needed for the GPU data conversions.
82
83 const CaloCondBlobFlt * getTileBlob() const { return m_tileBlob; }
84
85 float getLumi() const { return m_lumi; }
86
88
89 private:
90 float calcSig(const IdentifierHash tilehash, const int gain, const float energy) const;
91 float getTileEffSigma(const IdentifierHash subHash, const int gain, const float e) const;
92
94
95 //Flat structure, choosen based on profiling done by Scott in Nov 2013
96 boost::multi_array<float, 2> m_larNoise;
97 boost::multi_array<float, 2> m_tileNoise;
99
100
101 //For double-gaussian noise:
103 float m_lumi=0;
105};
106
108CLASS_DEF( CaloNoise , 16721262 , 1 )
109#include "AthenaKernel/CondCont.h"
111#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:42
const CaloCondBlobFlt * m_tileBlob
Definition CaloNoise.h:102
const CaloCondBlobFlt * getTileBlob() const
Definition CaloNoise.h:83
boost::multi_array< float, 2 > m_tileNoise
Definition CaloNoise.h:97
float getEffectiveSigma(const IdentifierHash h, const int gain, const float energy) const
Definition CaloNoise.h:61
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition CaloNoise.h:34
boost::multi_array< float, 2 > & larStorage()
Non-const accessor to underlying storage for filling:
Definition CaloNoise.h:71
const CaloCell_Base_ID * m_caloCellId
Definition CaloNoise.h:93
NOISETYPE getNoiseType() const
Definition CaloNoise.h:87
float getLumi() const
Definition CaloNoise.h:85
boost::multi_array< float, 2 > m_larNoise
Definition CaloNoise.h:96
float getNoise(const Identifier id, const int gain) const
Accessor by Identifier and gain.
Definition CaloNoise.h:45
unsigned m_tileHashOffset
Definition CaloNoise.h:98
float getEffectiveSigma(const Identifier id, const int gain, const float energy) const
Definition CaloNoise.h:55
float m_lumi
Definition CaloNoise.h:103
float getTileEffSigma(const IdentifierHash subHash, const int gain, const float e) const
Definition CaloNoise.cxx:77
NOISETYPE m_noiseType
Definition CaloNoise.h:104
CaloNoise()=delete
void setTileBlob(const CaloCondBlobFlt *flt, const float lumi)
Definition CaloNoise.cxx:31
boost::multi_array< float, 2 > & tileStorage()
Definition CaloNoise.h:72
const boost::multi_array< float, 2 > & larStorage() const
Const accessor to underlying storage for GPU data structures.
Definition CaloNoise.h:75
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:21
const boost::multi_array< float, 2 > & tileStorage() const
Definition CaloNoise.h:76
This is a "hash" representation of an Identifier.