ATLAS Offline Software
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 
16 class CaloNoise {
18 
19  public:
20 
21  enum NOISETYPE{ELEC=0,
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 {
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 {
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 {
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 
87  NOISETYPE getNoiseType() const { return m_noiseType; }
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;
98  unsigned m_tileHashOffset;
99 
100 
101  //For double-gaussian noise:
102  const CaloCondBlobFlt* m_tileBlob=nullptr;
103  float m_lumi=0;
105 };
106 
107 #include "AthenaKernel/CLASS_DEF.h"
108 CLASS_DEF( CaloNoise , 16721262 , 1 )
109 #include "AthenaKernel/CondCont.h"
111 #endif
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CaloNoise::NOISETYPE
NOISETYPE
Conditions Data Object holding the calorimeter noise per cell and per gain.
Definition: CaloNoise.h:21
CaloNoise::getEffectiveSigma
float getEffectiveSigma(const Identifier id, const int gain, const float energy) const
Definition: CaloNoise.h:55
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
CaloNoise::~CaloNoise
~CaloNoise()
Definition: CaloNoise.cxx:36
CaloNoise::TOTAL
@ TOTAL
Definition: CaloNoise.h:23
CaloCondBlobFlt
Class for storing a number of floats (Flt) and functions on those.
Definition: CaloCondBlobFlt.h:29
CaloNoise::larStorage
const boost::multi_array< float, 2 > & larStorage() const
Const accessor to underlying storage for GPU data structures.
Definition: CaloNoise.h:75
CaloNoise::tileStorage
const boost::multi_array< float, 2 > & tileStorage() const
Definition: CaloNoise.h:76
CaloNoise::setTileBlob
void setTileBlob(const CaloCondBlobFlt *flt, const float lumi)
Definition: CaloNoise.cxx:31
CaloNoise::calcSig
float calcSig(const IdentifierHash tilehash, const int gain, const float energy) const
Definition: CaloNoise.cxx:42
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
CaloNoise::ELEC
@ ELEC
Definition: CaloNoise.h:21
CaloNoise::getNoiseType
NOISETYPE getNoiseType() const
Definition: CaloNoise.h:87
CaloNoise::getNoise
float getNoise(const Identifier id, const int gain) const
Accessor by Identifier and gain.
Definition: CaloNoise.h:45
CaloNoise::m_larNoise
boost::multi_array< float, 2 > m_larNoise
Definition: CaloNoise.h:96
HWIdentifier
Definition: HWIdentifier.h:13
CaloNoise::getNoise
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition: CaloNoise.h:34
CaloCondUtils.h
CaloNoise::m_tileNoise
boost::multi_array< float, 2 > m_tileNoise
Definition: CaloNoise.h:97
CaloCell_ID.h
CaloNoise::m_noiseType
NOISETYPE m_noiseType
Definition: CaloNoise.h:104
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
extractSporadic.h
list h
Definition: extractSporadic.py:97
CaloNoise::m_caloCellId
const CaloCell_Base_ID * m_caloCellId
Definition: CaloNoise.h:93
CaloNoise::m_lumi
float m_lumi
Definition: CaloNoise.h:103
CaloCondBlobAlgs_fillNoiseFromASCII.flt
flt
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:97
CaloNoise
Definition: CaloNoise.h:16
HWIdentifier.h
CaloNoise::getEffectiveSigma
float getEffectiveSigma(const IdentifierHash h, const int gain, const float energy) const
Definition: CaloNoise.h:61
CaloNoise::getTileEffSigma
float getTileEffSigma(const IdentifierHash subHash, const int gain, const float e) const
Definition: CaloNoise.cxx:77
CaloCondUtils::getDbCaloGain
static unsigned int getDbCaloGain(int caloGain)
Returns the non-negative gainId to be used with the COOL DB.
Definition: CaloCondUtils.cxx:86
CaloNoise::PILEUP
@ PILEUP
Definition: CaloNoise.h:22
CaloNoise::tileStorage
boost::multi_array< float, 2 > & tileStorage()
Definition: CaloNoise.h:72
CaloCondBlobFlt.h
lumiFormat.lumi
lumi
Definition: lumiFormat.py:106
h
CaloNoise::m_tileHashOffset
unsigned m_tileHashOffset
Definition: CaloNoise.h:98
CaloNoise::larStorage
boost::multi_array< float, 2 > & larStorage()
Non-const accessor to underlying storage for filling:
Definition: CaloNoise.h:71
CONDCONT_MIXED_DEF
CONDCONT_MIXED_DEF(CaloNoise, 51500196)
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:64
CaloNoise::getNoise
float getNoise(const HWIdentifier, const int) const =delete
Safety net: Disallow access by HWIdentifier.
CaloNoise::getTileBlob
const CaloCondBlobFlt * getTileBlob() const
Definition: CaloNoise.h:83
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
CaloCell_Base_ID
Helper base class for offline cell identifiers.
Definition: CaloCell_Base_ID.h:41
CaloNoise::m_tileBlob
const CaloCondBlobFlt * m_tileBlob
Definition: CaloNoise.h:102
CLASS_DEF.h
macros to associate a CLID to a type
CaloNoise::getLumi
float getLumi() const
Definition: CaloNoise.h:85
CaloNoise::CaloNoise
CaloNoise()=delete
Identifier
Definition: IdentifierFieldParser.cxx:14