ATLAS Offline Software
Loading...
Searching...
No Matches
TileSampleNoise.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TILECONDITIONS_TILESAMPLENOISE_H
6#define TILECONDITIONS_TILESAMPLENOISE_H
7
8// Tile includes
10
13
19
20 public:
21
22 TileSampleNoise(std::unique_ptr<TileCalibDataFlt> sampleNoise) : m_sampleNoise{std::move(sampleNoise)} {};
23
24 virtual ~TileSampleNoise() = default;
25
26 float getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const;
27
28 float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const;
29
30 float getLfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const;
31
32 float getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const;
33
34 float getHfn2(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const;
35
36 float getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const;
37
38 private:
39
40 std::unique_ptr<TileCalibDataFlt> m_sampleNoise;
41};
42
43
44// inlines
45inline
46float TileSampleNoise::getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const {
47 return m_sampleNoise->getCalibDrawer(drawerIdx)->getData(channel, adc, 0);
48}
49
50inline
51float TileSampleNoise::getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const {
52 return m_sampleNoise->getCalibDrawer(drawerIdx)->getData(channel, adc, 1);
53}
54
55inline
56float TileSampleNoise::getLfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const {
57 const TileCalibDrawerFlt* calibDrawer = m_sampleNoise->getCalibDrawer(drawerIdx);
58 //=== check if Lfn is stored already if not - return zero
59 return (calibDrawer->getObjSizeUint32() < 3) ? 0. : calibDrawer->getData(channel, adc, 2);
60}
61
62inline
63float TileSampleNoise::getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const {
64 const TileCalibDrawerFlt* calibDrawer = m_sampleNoise->getCalibDrawer(drawerIdx);
65 //=== check if Hfn1 is stored already, if not - return old Hfn
66 return (calibDrawer->getObjSizeUint32() < 4) ? calibDrawer->getData(channel, adc, 1)
67 : calibDrawer->getData(channel, adc, 3);
68}
69
70inline
71float TileSampleNoise::getHfn2(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const {
72 const TileCalibDrawerFlt* calibDrawer = m_sampleNoise->getCalibDrawer(drawerIdx);
73 //=== check if Hfn2 is stored already, if not - return zero
74 return (calibDrawer->getObjSizeUint32() < 5) ? 0.0 : calibDrawer->getData(channel, adc, 4);
75}
76
77inline
78float TileSampleNoise::getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const {
79 const TileCalibDrawerFlt* calibDrawer = m_sampleNoise->getCalibDrawer(drawerIdx);
80 //=== check if HfnNorm is stored already, if not - return zero
81 return (calibDrawer->getObjSizeUint32() < 6) ? 0.0 : calibDrawer->getData(channel, adc, 5);
82}
83
84// Set up the ClassID of this class (obtained using 'clid -s TileSampleNoise')
85CLASS_DEF(TileSampleNoise, 197315591, 0)
86// Set up the ClassID of the container (obtained using 'clid -cs TileSampleNoise')
88
89#endif
Hold mappings of ranges to condition objects.
#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
Generic class for storing a number of floats (Flt) for each channel or ADC.
Condition object to keep and provide Tile sample noise.
float getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
float getLfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
std::unique_ptr< TileCalibDataFlt > m_sampleNoise
float getHfn2(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
virtual ~TileSampleNoise()=default
float getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
TileSampleNoise(std::unique_ptr< TileCalibDataFlt > sampleNoise)
float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
float getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
STL namespace.