ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileConditions
src
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
6
#include "
TileConditions/TileCondToolOfcCool.h
"
7
#include "
TileCalibBlobObjs/TileCalibDrawerOfc.h
"
8
9
10
// Athena includes
11
#include "
AthenaKernel/errorcheck.h
"
12
#include "
StoreGate/ReadCondHandle.h
"
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
//____________________________________________________________________
23
TileCondToolOfcCool::~TileCondToolOfcCool
() {
24
25
}
26
27
//
28
//____________________________________________________________________
29
StatusCode
TileCondToolOfcCool::initialize
() {
30
ATH_MSG_DEBUG
(
"In initialize()"
);
31
32
ATH_CHECK
(
m_calibOfcKey
.initialize() );
33
34
return
StatusCode::SUCCESS;
35
}
36
37
//
38
//____________________________________________________________________
39
StatusCode
TileCondToolOfcCool::finalize
() {
40
ATH_MSG_DEBUG
(
"finalize called"
);
41
42
return
StatusCode::SUCCESS;
43
}
44
45
//
46
//____________________________________________________________________
47
StatusCode
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
62
SG::ReadCondHandle<TileCalibData<TileCalibDrawerOfc>
> calibOFC(
m_calibOfcKey
, ctx);
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
81
SG::ReadCondHandle<TileCalibData<TileCalibDrawerOfc>
> calibOFC(
m_calibOfcKey
, ctx);
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
98
SG::ReadCondHandle<TileCalibData<TileCalibDrawerOfc>
> calibOFC(
m_calibOfcKey
, ctx);
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
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.
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
ReadCondHandle.h
TileCalibDrawerOfc.h
PHASE_PRECISION
#define PHASE_PRECISION
Class for storing Optimal Filtering Coefficients (OFCs) in a coral::Blob.
Definition
TileCalibDrawerOfc.h:37
TileCondToolOfcCool.h
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
TileCondToolOfcCool::initialize
virtual StatusCode initialize() override
Definition
TileCondToolOfcCool.cxx:29
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
TileCondToolOfcCool::m_calibOfcKey
SG::ReadCondHandleKey< TileCalibData< TileCalibDrawerOfc > > m_calibOfcKey
Definition
TileCondToolOfcCool.h:55
TileCondToolOfcCool::~TileCondToolOfcCool
virtual ~TileCondToolOfcCool()
Definition
TileCondToolOfcCool.cxx:23
TileCondToolOfcCool::getOfcParams
void getOfcParams(unsigned int drawerIdx, int &NPhases, int &NFields, int &Phamin, int &Phamax, int &NSamples, const EventContext &ctx)
Definition
TileCondToolOfcCool.cxx:90
TileCondToolOfcCool::TileCondToolOfcCool
TileCondToolOfcCool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TileCondToolOfcCool.cxx:15
TileCondToolOfcCool::finalize
virtual StatusCode finalize() override
Definition
TileCondToolOfcCool.cxx:39
type
TileOfcWeightsStruct
Definition
ITileCondToolOfc.h:13
weights
Definition
herwig7_interface.h:38
Generated on
for ATLAS Offline Software by
1.17.0