ATLAS Offline Software
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 //____________________________________________________________________
14 static const InterfaceID IID_TileCondToolNoiseSample("TileCondToolNoiseSample", 1, 0);
16  return IID_TileCondToolNoiseSample;
17 }
18 
19 //
20 //____________________________________________________________________
21 TileCondToolNoiseSample::TileCondToolNoiseSample(const std::string& type, const std::string& name, const IInterface* parent)
23 {
24  declareInterface<ITileCondToolNoise>(this);
25  declareInterface<TileCondToolNoiseSample>(this);
26 }
27 
28 //
29 //____________________________________________________________________
31 }
32 
33 //
34 //____________________________________________________________________
36 
37  ATH_MSG_DEBUG( "In initialize()" );
38 
39  //=== retrieve proxy
41 
43 
45 
46  return StatusCode::SUCCESS;
47 }
48 
49 //
50 //____________________________________________________________________
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 
63  float ped = sampleNoise->getPed(drawerIdx, channel, adc);
64 
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 
80  float hfn = sampleNoise->getHfn(drawerIdx, channel, adc);
81 
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 
97  float lfn = sampleNoise->getLfn(drawerIdx, channel, adc);
98 
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 
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 
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 
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()) {
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 }
Example_ReadSampleNoise.hfn
hfn
Definition: Example_ReadSampleNoise.py:46
TileSampleNoise::getHfn2
float getHfn2(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
Definition: TileSampleNoise.h:71
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
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::getHfn
float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT unit, const EventContext &ctx) const
Definition: TileCondToolNoiseSample.cxx:76
TileCondToolNoiseSample::m_emScaleKey
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Definition: TileCondToolNoiseSample.h:68
TileSampleNoise::getHfn
float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
Definition: TileSampleNoise.h:51
TileCondToolNoiseSample::getHfn1
float getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc, const EventContext &ctx) const
Definition: TileCondToolNoiseSample.cxx:109
TileCondToolNoiseSample::getHfn2
float getHfn2(unsigned int drawerIdx, unsigned int channel, unsigned int adc, const EventContext &ctx) const
Definition: TileCondToolNoiseSample.cxx:121
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
TileCondToolNoiseSample::~TileCondToolNoiseSample
virtual ~TileCondToolNoiseSample()
Definition: TileCondToolNoiseSample.cxx:30
ReadCondHandle.h
TileCondToolNoiseSample::m_sampleNoiseKey
SG::ReadCondHandleKey< TileSampleNoise > m_sampleNoiseKey
Definition: TileCondToolNoiseSample.h:62
TileEMScale::calibrateChannel
float calibrateChannel(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude, TileRawChannelUnit::UNIT rawDataUnitIn, TileRawChannelUnit::UNIT rawDataUnitOut) const
Calibrate a Tile channel.
Definition: TileEMScale.cxx:136
TileCondToolNoiseSample::m_onlineSampleNoiseKey
SG::ReadCondHandleKey< TileSampleNoise > m_onlineSampleNoiseKey
Definition: TileCondToolNoiseSample.h:65
TileCondToolNoiseSample::interfaceID
static const InterfaceID & interfaceID()
Definition: TileCondToolNoiseSample.cxx:15
TileCondToolNoiseSample.h
rerun_display.lfn
lfn
Definition: rerun_display.py:60
TileCondToolNoiseSample::TileCondToolNoiseSample
TileCondToolNoiseSample(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TileCondToolNoiseSample.cxx:21
TileCondToolNoiseSample::getOnlinePedestalDifference
float getOnlinePedestalDifference(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT onlineUnit, const EventContext &ctx) const
Definition: TileCondToolNoiseSample.cxx:142
TileSampleNoise::getHfn1
float getHfn1(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
Definition: TileSampleNoise.h:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TileCondToolNoiseSample::getPed
float getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc, TileRawChannelUnit::UNIT unit, const EventContext &ctx) const
Definition: TileCondToolNoiseSample.cxx:59
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TileSampleNoise::getHfnNorm
float getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
Definition: TileSampleNoise.h:78
TileRawChannelUnit::UNIT
UNIT
Definition: TileRawChannelUnit.h:16
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TileCondToolNoiseSample::getHfnNorm
float getHfnNorm(unsigned int drawerIdx, unsigned int channel, unsigned int adc, const EventContext &ctx) const
Definition: TileCondToolNoiseSample.cxx:132
errorcheck.h
Helpers for checking error return status codes and reporting errors.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
TileCondToolNoiseSample::finalize
virtual StatusCode finalize() override
Definition: TileCondToolNoiseSample.cxx:51
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:20
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TileEMScale::calibrateOnlineChannel
float calibrateOnlineChannel(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude, TileRawChannelUnit::UNIT onlUnit) const
Calibrate an online Tile channel from OnlineADCcounts to an arbitrary Online unit,...
Definition: TileEMScale.cxx:292
AthAlgTool
Definition: AthAlgTool.h:26
TileSampleNoise::getPed
float getPed(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
Definition: TileSampleNoise.h:46
TileSampleNoise::getLfn
float getLfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const
Definition: TileSampleNoise.h:56
TileCondToolNoiseSample::initialize
virtual StatusCode initialize() override
Definition: TileCondToolNoiseSample.cxx:35
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
TileRawChannelUnit::ADCcounts
@ ADCcounts
Definition: TileRawChannelUnit.h:17