ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileConditions
src
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
6
#include "
TileConditions/TileCondToolNoiseSample.h
"
7
8
// Athena includes
9
#include "
AthenaKernel/errorcheck.h
"
10
#include "
StoreGate/ReadCondHandle.h
"
11
12
//
13
//____________________________________________________________________
14
static
const
InterfaceID
IID_TileCondToolNoiseSample
(
"TileCondToolNoiseSample"
, 1, 0);
15
const
InterfaceID&
TileCondToolNoiseSample::interfaceID
() {
16
return
IID_TileCondToolNoiseSample
;
17
}
18
19
//
20
//____________________________________________________________________
21
TileCondToolNoiseSample::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
//____________________________________________________________________
30
TileCondToolNoiseSample::~TileCondToolNoiseSample
() {
31
}
32
33
//
34
//____________________________________________________________________
35
StatusCode
TileCondToolNoiseSample::initialize
() {
36
37
ATH_MSG_DEBUG
(
"In initialize()"
);
38
39
//=== retrieve proxy
40
ATH_CHECK
(
m_sampleNoiseKey
.initialize() );
41
42
ATH_CHECK
(
m_onlineSampleNoiseKey
.initialize (
SG::AllowEmpty
));
43
44
ATH_CHECK
(
m_emScaleKey
.initialize() );
45
46
return
StatusCode::SUCCESS;
47
}
48
49
//
50
//____________________________________________________________________
51
StatusCode
TileCondToolNoiseSample::finalize
() {
52
ATH_MSG_DEBUG
(
"finalize called"
);
53
54
return
StatusCode::SUCCESS;
55
}
56
57
//
58
//____________________________________________________________________
59
float
TileCondToolNoiseSample::getPed
(
unsigned
int
drawerIdx,
unsigned
int
channel,
unsigned
int
adc,
60
TileRawChannelUnit::UNIT
unit
,
const
EventContext &ctx)
const
{
61
62
SG::ReadCondHandle<TileSampleNoise>
sampleNoise(
m_sampleNoiseKey
, ctx);
63
float
ped = sampleNoise->getPed(drawerIdx, channel, adc);
64
65
if
(
unit
>
TileRawChannelUnit::ADCcounts
) {
66
SG::ReadCondHandle<TileEMScale>
emScale(
m_emScaleKey
, ctx);
67
ped = emScale->calibrateChannel(drawerIdx, channel, adc, ped,
TileRawChannelUnit::ADCcounts
,
unit
);
68
}
69
70
return
ped;
71
72
}
73
74
//
75
//____________________________________________________________________
76
float
TileCondToolNoiseSample::getHfn
(
unsigned
int
drawerIdx,
unsigned
int
channel,
unsigned
int
adc,
77
TileRawChannelUnit::UNIT
unit
,
const
EventContext &ctx)
const
{
78
79
SG::ReadCondHandle<TileSampleNoise>
sampleNoise(
m_sampleNoiseKey
, ctx);
80
float
hfn = sampleNoise->getHfn(drawerIdx, channel, adc);
81
82
if
(
unit
>
TileRawChannelUnit::ADCcounts
) {
83
SG::ReadCondHandle<TileEMScale>
emScale(
m_emScaleKey
, ctx);
84
hfn = emScale->calibrateChannel(drawerIdx, channel, adc, hfn,
TileRawChannelUnit::ADCcounts
,
unit
);
85
}
86
87
return
hfn;
88
89
}
90
91
//
92
//____________________________________________________________________
93
float
TileCondToolNoiseSample::getLfn
(
unsigned
int
drawerIdx,
unsigned
int
channel,
unsigned
int
adc,
94
TileRawChannelUnit::UNIT
unit
,
const
EventContext &ctx)
const
{
95
96
SG::ReadCondHandle<TileSampleNoise>
sampleNoise(
m_sampleNoiseKey
, ctx);
97
float
lfn = sampleNoise->getLfn(drawerIdx, channel, adc);
98
99
if
(
unit
>
TileRawChannelUnit::ADCcounts
) {
100
SG::ReadCondHandle<TileEMScale>
emScale(
m_emScaleKey
, ctx);
101
lfn = emScale->calibrateChannel(drawerIdx, channel, adc, lfn,
TileRawChannelUnit::ADCcounts
,
unit
);
102
}
103
104
return
lfn;
105
}
106
107
//
108
//____________________________________________________________________
109
float
TileCondToolNoiseSample::getHfn1
(
unsigned
int
drawerIdx,
unsigned
int
channel,
unsigned
int
adc,
110
const
EventContext &ctx)
const
{
111
112
SG::ReadCondHandle<TileSampleNoise>
sampleNoise(
m_sampleNoiseKey
, ctx);
113
float
hfn1 = sampleNoise->getHfn1(drawerIdx, channel, adc);
114
115
return
hfn1;
116
117
}
118
119
//
120
//____________________________________________________________________
121
float
TileCondToolNoiseSample::getHfn2
(
unsigned
int
drawerIdx,
unsigned
int
channel,
unsigned
int
adc,
122
const
EventContext &ctx)
const
{
123
124
SG::ReadCondHandle<TileSampleNoise>
sampleNoise(
m_sampleNoiseKey
, ctx);
125
float
hfn2 = sampleNoise->getHfn2(drawerIdx, channel, adc);
126
127
return
hfn2;
128
}
129
130
//
131
//____________________________________________________________________
132
float
TileCondToolNoiseSample::getHfnNorm
(
unsigned
int
drawerIdx,
unsigned
int
channel,
unsigned
int
adc,
133
const
EventContext &ctx)
const
{
134
135
SG::ReadCondHandle<TileSampleNoise>
sampleNoise(
m_sampleNoiseKey
, ctx);
136
float
hfnNorm = sampleNoise->getHfnNorm(drawerIdx, channel, adc);
137
138
return
hfnNorm;
139
}
140
141
142
float
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()) {
149
SG::ReadCondHandle<TileSampleNoise>
sampleNoise(
m_sampleNoiseKey
, ctx);
150
SG::ReadCondHandle<TileSampleNoise>
onlineSampleNoise(
m_onlineSampleNoiseKey
, ctx);
151
152
float
pedestal = sampleNoise->getPed(drawerIdx, channel, adc);
153
float
onlinePedestal = onlineSampleNoise->getPed(drawerIdx, channel, adc);
154
155
SG::ReadCondHandle<TileEMScale>
emScale(
m_emScaleKey
, ctx);
156
pedestalDifference = emScale->calibrateOnlineChannel(drawerIdx, channel, adc, (onlinePedestal - pedestal), onlineUnit);
157
}
158
159
return
pedestalDifference;
160
}
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition
AmgMatrixBasePlugin.h:21
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
errorcheck.h
Helpers for checking error return status codes and reporting errors.
ReadCondHandle.h
IID_TileCondToolNoiseSample
static const InterfaceID IID_TileCondToolNoiseSample("TileCondToolNoiseSample", 1, 0)
TileCondToolNoiseSample.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
TileCondToolNoiseSample::initialize
virtual StatusCode initialize() override
Definition
TileCondToolNoiseSample.cxx:35
TileCondToolNoiseSample::getOnlinePedestalDifference
float getOnlinePedestalDifference(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT onlineUnit, const EventContext &ctx) const
Definition
TileCondToolNoiseSample.cxx:142
TileCondToolNoiseSample::getHfn2
float getHfn2(unsigned int drawerIdx, unsigned int channel, unsigned int adc, const EventContext &ctx) const
Definition
TileCondToolNoiseSample.cxx:121
TileCondToolNoiseSample::TileCondToolNoiseSample
TileCondToolNoiseSample(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TileCondToolNoiseSample.cxx:21
TileCondToolNoiseSample::getHfn1
float getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc, const EventContext &ctx) const
Definition
TileCondToolNoiseSample.cxx:109
TileCondToolNoiseSample::getHfnNorm
float getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc, const EventContext &ctx) const
Definition
TileCondToolNoiseSample.cxx:132
TileCondToolNoiseSample::getHfn
float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT unit, const EventContext &ctx) const
Definition
TileCondToolNoiseSample.cxx:76
TileCondToolNoiseSample::getLfn
float getLfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT unit, const EventContext &ctx) const
Definition
TileCondToolNoiseSample.cxx:93
TileCondToolNoiseSample::finalize
virtual StatusCode finalize() override
Definition
TileCondToolNoiseSample.cxx:51
TileCondToolNoiseSample::getPed
float getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT unit, const EventContext &ctx) const
Definition
TileCondToolNoiseSample.cxx:59
TileCondToolNoiseSample::~TileCondToolNoiseSample
virtual ~TileCondToolNoiseSample()
Definition
TileCondToolNoiseSample.cxx:30
TileCondToolNoiseSample::m_emScaleKey
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Definition
TileCondToolNoiseSample.h:68
TileCondToolNoiseSample::m_onlineSampleNoiseKey
SG::ReadCondHandleKey< TileSampleNoise > m_onlineSampleNoiseKey
Definition
TileCondToolNoiseSample.h:65
TileCondToolNoiseSample::interfaceID
static const InterfaceID & interfaceID()
Definition
TileCondToolNoiseSample.cxx:15
TileCondToolNoiseSample::m_sampleNoiseKey
SG::ReadCondHandleKey< TileSampleNoise > m_sampleNoiseKey
Definition
TileCondToolNoiseSample.h:62
TileRawChannelUnit::UNIT
UNIT
Definition
TileRawChannelUnit.h:16
TileRawChannelUnit::ADCcounts
@ ADCcounts
Definition
TileRawChannelUnit.h:17
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
type
Generated on
for ATLAS Offline Software by
1.17.0