ATLAS Offline Software
Loading...
Searching...
No Matches
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//____________________________________________________________________
15TileCondToolOfcCool::TileCondToolOfcCool(const std::string& type, const std::string& name,
16 const IInterface* parent)
17 : base_class(type, name, parent)
18{
19}
20
21//
22//____________________________________________________________________
26
27//
28//____________________________________________________________________
30 ATH_MSG_DEBUG( "In initialize()" );
31
32 ATH_CHECK( m_calibOfcKey.initialize() );
33
34 return StatusCode::SUCCESS;
35}
36
37//
38//____________________________________________________________________
40 ATH_MSG_DEBUG( "finalize called" );
41
42 return StatusCode::SUCCESS;
43}
44
45//
46//____________________________________________________________________
47StatusCode
49 unsigned int channel,
50 unsigned int adc,
51 float& phase,
52 bool /*of2*/,
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//____________________________________________________________________
74int 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//____________________________________________________________________
90void 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
#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 Double_t a
#define PHASE_PRECISION
Class for storing Optimal Filtering Coefficients (OFCs) in a coral::Blob.
virtual StatusCode initialize() override
virtual StatusCode getOfcWeights(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float &phase, bool of2, TileOfcWeightsStruct &weights, const EventContext &ctx) const override
SG::ReadCondHandleKey< TileCalibData< TileCalibDrawerOfc > > m_calibOfcKey
void getOfcParams(unsigned int drawerIdx, int &NPhases, int &NFields, int &Phamin, int &Phamax, int &NSamples, const EventContext &ctx)
TileCondToolOfcCool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode finalize() override