ATLAS Offline Software
TileCondToolOfcCool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Tile includes
8 
9 
10 // Athena includes
13 
14 //____________________________________________________________________
15 TileCondToolOfcCool::TileCondToolOfcCool(const std::string& type, const std::string& name,
16  const IInterface* parent)
17  : base_class(type, name, parent)
18 {
19 }
20 
21 //
22 //____________________________________________________________________
24 
25 }
26 
27 //
28 //____________________________________________________________________
30  ATH_MSG_DEBUG( "In initialize()" );
31 
33 
34  return StatusCode::SUCCESS;
35 }
36 
37 //
38 //____________________________________________________________________
40  ATH_MSG_DEBUG( "finalize called" );
41 
42  return StatusCode::SUCCESS;
43 }
44 
45 //
46 //____________________________________________________________________
48 TileCondToolOfcCool::getOfcWeights(unsigned int drawerIdx,
49  unsigned int channel,
50  unsigned int adc,
51  float& phase,
52  bool /*of2*/,
53  TileOfcWeightsStruct& weights,
54  const EventContext& ctx) const
55 {
56  std::fill (std::begin(weights.g), std::end(weights.g), 0);
57  std::fill (std::begin(weights.dg), std::end(weights.dg), 0);
58  std::fill (std::begin(weights.w_a), std::end(weights.w_a), 0);
59  std::fill (std::begin(weights.w_b), std::end(weights.w_b), 0);
60  std::fill (std::begin(weights.w_c), std::end(weights.w_c), 0);
61 
63 
64  calibOFC->getCalibDrawer(drawerIdx)->fillOfc(channel, adc, phase, weights.w_a, weights.w_b,
65  weights.w_c, weights.g, weights.dg);
66 
67  weights.n_samples = calibOFC->getCalibDrawer(drawerIdx)->getNSamples();
68 
69  return StatusCode::SUCCESS;
70 }
71 
72 //
73 //____________________________________________________________________
74 int TileCondToolOfcCool::getOfcWeights(unsigned int drawerIdx,
75  unsigned int channel,
76  unsigned int adc,
77  float& phase,
78  float *a, float *b, float *c, float *g, float *dg,
79  const EventContext& ctx) {
80 
82 
83  calibOFC->getCalibDrawer(drawerIdx)->fillOfc(channel, adc, phase, a, b, c, g, dg);
84 
85  return calibOFC->getCalibDrawer(drawerIdx)->getNSamples();
86 }
87 
88 //
89 //____________________________________________________________________
90 void TileCondToolOfcCool::getOfcParams(unsigned int drawerIdx
91  , int &NPhases
92  , int &NFields
93  , int &Phamin
94  , int &Phamax
95  , int &NSamples
96  , const EventContext& ctx) {
97 
99 
100  NPhases = calibOFC->getCalibDrawer(drawerIdx)->getNPhases();
101  NFields = calibOFC->getCalibDrawer(drawerIdx)->getNFields();
102  Phamin = round(calibOFC->getCalibDrawer(drawerIdx)->getPhase(0, 0, 0) * (1 / PHASE_PRECISION));
103  Phamax = round(calibOFC->getCalibDrawer(drawerIdx)->getPhase(0, 0, abs(NPhases) - 1) * (1 / PHASE_PRECISION));
104  NSamples = calibOFC->getCalibDrawer(drawerIdx)->getNSamples();
105 }
106 
107 //
108 //____________________________________________________________________
109 
ReadOfcFromCool.phase
phase
Definition: ReadOfcFromCool.py:127
checkCoolLatestUpdate.dg
dg
Definition: checkCoolLatestUpdate.py:9
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
TileCondToolOfcCool::m_calibOfcKey
SG::ReadCondHandleKey< TileCalibData< TileCalibDrawerOfc > > m_calibOfcKey
Definition: TileCondToolOfcCool.h:55
TileOfcWeightsStruct::g
float g[99]
Definition: ITileCondToolOfc.h:14
TileOfcWeightsStruct::w_c
float w_c[99]
Definition: ITileCondToolOfc.h:14
PHASE_PRECISION
#define PHASE_PRECISION
Class for storing Optimal Filtering Coefficients (OFCs) in a coral::Blob.
Definition: TileCalibDrawerOfc.h:38
StateLessPT_NewConfig.NSamples
int NSamples
Definition: StateLessPT_NewConfig.py:94
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
TileCondToolOfcCool::initialize
virtual StatusCode initialize() override
Definition: TileCondToolOfcCool.cxx:29
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
TileCondToolOfcCool::finalize
virtual StatusCode finalize() override
Definition: TileCondToolOfcCool.cxx:39
TileCondToolOfcCool::TileCondToolOfcCool
TileCondToolOfcCool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TileCondToolOfcCool.cxx:15
ReadCondHandle.h
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
TileOfcWeightsStruct::n_samples
int n_samples
Definition: ITileCondToolOfc.h:15
TileCondToolOfcCool.h
TileOfcWeightsStruct::dg
float dg[99]
Definition: ITileCondToolOfc.h:14
TileCondToolOfcCool::getOfcParams
void getOfcParams(unsigned int drawerIdx, int &NPhases, int &NFields, int &Phamin, int &Phamax, int &NSamples, const EventContext &ctx)
Definition: TileCondToolOfcCool.cxx:90
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
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
TileOfcWeightsStruct
Definition: ITileCondToolOfc.h:13
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TileCondToolOfcCool::~TileCondToolOfcCool
virtual ~TileCondToolOfcCool()
Definition: TileCondToolOfcCool.cxx:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
errorcheck.h
Helpers for checking error return status codes and reporting errors.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TileCondToolOfcCool::getOfcWeights
virtual StatusCode getOfcWeights(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float &phase, bool of2, TileOfcWeightsStruct &weights, const EventContext &ctx) const override
Definition: TileCondToolOfcCool.cxx:48
a
TList * a
Definition: liststreamerinfos.cxx:10
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
lumiFormat.fill
fill
Definition: lumiFormat.py:111
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TileOfcWeightsStruct::w_a
float w_a[99]
Definition: ITileCondToolOfc.h:14
TileCalibDrawerOfc.h
python.compressB64.c
def c
Definition: compressB64.py:93
TileOfcWeightsStruct::w_b
float w_b[99]
Definition: ITileCondToolOfc.h:14