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*/,
54  const EventContext& ctx) const
55 {
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:24
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
TileCondToolOfcCool::m_calibOfcKey
SG::ReadCondHandleKey< TileCalibData< TileCalibDrawerOfc > > m_calibOfcKey
Definition: TileCondToolOfcCool.h:55
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
TileCondToolOfcCool.h
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
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
TileCondToolOfcCool::~TileCondToolOfcCool
virtual ~TileCondToolOfcCool()
Definition: TileCondToolOfcCool.cxx:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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)
weights
Definition: herwig7_interface.h:44
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TileCalibDrawerOfc.h
python.compressB64.c
def c
Definition: compressB64.py:93