ATLAS Offline Software
Loading...
Searching...
No Matches
TileCondToolNoiseSample.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Tile includes
7
8// Athena includes
11
12//
13//____________________________________________________________________
14static const InterfaceID IID_TileCondToolNoiseSample("TileCondToolNoiseSample", 1, 0);
18
19//
20//____________________________________________________________________
21TileCondToolNoiseSample::TileCondToolNoiseSample(const std::string& type, const std::string& name, const IInterface* parent)
22 : AthAlgTool(type, name, parent)
23{
24 declareInterface<ITileCondToolNoise>(this);
25 declareInterface<TileCondToolNoiseSample>(this);
26}
27
28//
29//____________________________________________________________________
32
33//
34//____________________________________________________________________
36
37 ATH_MSG_DEBUG( "In initialize()" );
38
39 //=== retrieve proxy
40 ATH_CHECK( m_sampleNoiseKey.initialize() );
41
43
44 ATH_CHECK( m_emScaleKey.initialize() );
45
46 return StatusCode::SUCCESS;
47}
48
49//
50//____________________________________________________________________
52 ATH_MSG_DEBUG( "finalize called" );
53
54 return StatusCode::SUCCESS;
55}
56
57//
58//____________________________________________________________________
59float TileCondToolNoiseSample::getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc,
60 TileRawChannelUnit::UNIT unit, const EventContext &ctx) const {
61
63 float ped = sampleNoise->getPed(drawerIdx, channel, adc);
64
67 ped = emScale->calibrateChannel(drawerIdx, channel, adc, ped, TileRawChannelUnit::ADCcounts, unit);
68 }
69
70 return ped;
71
72}
73
74//
75//____________________________________________________________________
76float TileCondToolNoiseSample::getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc,
77 TileRawChannelUnit::UNIT unit, const EventContext &ctx) const {
78
80 float hfn = sampleNoise->getHfn(drawerIdx, channel, adc);
81
84 hfn = emScale->calibrateChannel(drawerIdx, channel, adc, hfn, TileRawChannelUnit::ADCcounts, unit);
85 }
86
87 return hfn;
88
89}
90
91//
92//____________________________________________________________________
93float TileCondToolNoiseSample::getLfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc,
94 TileRawChannelUnit::UNIT unit, const EventContext &ctx) const {
95
97 float lfn = sampleNoise->getLfn(drawerIdx, channel, adc);
98
101 lfn = emScale->calibrateChannel(drawerIdx, channel, adc, lfn, TileRawChannelUnit::ADCcounts, unit);
102 }
103
104 return lfn;
105}
106
107//
108//____________________________________________________________________
109float TileCondToolNoiseSample::getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc,
110 const EventContext &ctx) const {
111
113 float hfn1 = sampleNoise->getHfn1(drawerIdx, channel, adc);
114
115 return hfn1;
116
117}
118
119//
120//____________________________________________________________________
121float TileCondToolNoiseSample::getHfn2(unsigned int drawerIdx, unsigned int channel, unsigned int adc,
122 const EventContext &ctx) const {
123
125 float hfn2 = sampleNoise->getHfn2(drawerIdx, channel, adc);
126
127 return hfn2;
128}
129
130//
131//____________________________________________________________________
132float TileCondToolNoiseSample::getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc,
133 const EventContext &ctx) const {
134
136 float hfnNorm = sampleNoise->getHfnNorm(drawerIdx, channel, adc);
137
138 return hfnNorm;
139}
140
141
142float TileCondToolNoiseSample::getOnlinePedestalDifference(unsigned int drawerIdx, unsigned int channel,
143 unsigned int adc, TileRawChannelUnit::UNIT onlineUnit,
144 const EventContext &ctx) const {
145
146 float pedestalDifference(0.0);
147
148 if (!m_onlineSampleNoiseKey.empty()) {
151
152 float pedestal = sampleNoise->getPed(drawerIdx, channel, adc);
153 float onlinePedestal = onlineSampleNoise->getPed(drawerIdx, channel, adc);
154
156 pedestalDifference = emScale->calibrateOnlineChannel(drawerIdx, channel, adc, (onlinePedestal - pedestal), onlineUnit);
157 }
158
159 return pedestalDifference;
160}
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Helpers for checking error return status codes and reporting errors.
static const InterfaceID IID_TileCondToolNoiseSample("TileCondToolNoiseSample", 1, 0)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
virtual StatusCode initialize() override
float getOnlinePedestalDifference(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT onlineUnit, const EventContext &ctx) const
float getHfn2(unsigned int drawerIdx, unsigned int channel, unsigned int adc, const EventContext &ctx) const
TileCondToolNoiseSample(const std::string &type, const std::string &name, const IInterface *parent)
float getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc, const EventContext &ctx) const
float getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc, const EventContext &ctx) const
float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT unit, const EventContext &ctx) const
float getLfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT unit, const EventContext &ctx) const
virtual StatusCode finalize() override
float getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT unit, const EventContext &ctx) const
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
SG::ReadCondHandleKey< TileSampleNoise > m_onlineSampleNoiseKey
static const InterfaceID & interfaceID()
SG::ReadCondHandleKey< TileSampleNoise > m_sampleNoiseKey