ATLAS Offline Software
TileRawChannelFillerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*
6  * File: TileRawChannelFillerTool.cxx
7  * Author: Stephen Cole <scole@niu.edu>
8  *
9  * Created on March 1, 2011, 9:27 AM
10  */
11 
14 #include "GaudiKernel/ISvcLocator.h"
15 #include "GaudiKernel/StatusCode.h"
16 #include "GaudiKernel/MsgStream.h"
17 #include "StoreGate/StoreGateSvc.h"
19 
20 namespace D3PD {
21 
23  const std::string& name,
24  const IInterface* parent):
25  Base(type, name,parent),
26  m_tilehwid(0)
27  {
28  m_SaveHWid = true;
29  m_SaveRawCh = false;
30  TileRawChannelFillerTool::book().ignore(); // Avoid coverity warnings
31 
32  declareProperty("SaveHardwareInfo", m_SaveHWid=true);
33  declareProperty("SaveRawChannel", m_SaveRawCh=false);
34  }
35 
37  {
39  return StatusCode::SUCCESS;
40  }
41 
43  if(m_SaveHWid){
44  CHECK(addVariable("ros",m_ros));
45  CHECK(addVariable("drawer",m_drawer));
46  CHECK(addVariable("channel",m_channel));
47  CHECK(addVariable("gain",m_gain));
48  }
49 
50  if(m_SaveRawCh){
51  CHECK(addVariable("amplitude",m_amplitude));
52  CHECK(addVariable("time",m_time));
53  CHECK(addVariable("quality",m_quality));
54  CHECK(addVariable("pedestal",m_ped));
55  }
56 
57  return StatusCode::SUCCESS;
58  }
59 
61  const TileRawChannel* tileR=&p;
62  if(m_SaveHWid){
63  HWIdentifier hwid=tileR->adc_HWID();
64  *m_ros=(char)m_tilehwid->ros(hwid);
65  *m_drawer=(char)m_tilehwid->drawer(hwid);
67  *m_gain=(char)m_tilehwid->adc(hwid);
68  }
69  if(m_SaveRawCh){
70  *m_ped=tileR->pedestal();
71  size_t nentry=tileR->size();
72  m_amplitude->reserve(nentry);
73  for(unsigned int n=0;n<nentry;++n){
74  m_amplitude->push_back(tileR->amplitude(n));
75  }
76  m_quality->reserve(nentry);
77  for(unsigned int n=0;n<nentry;++n){
78  m_quality->push_back(tileR->quality(n));
79  }
80  nentry=tileR->sizeTime();
81  m_time->reserve(nentry);
82  for(unsigned int n=0;n<nentry;++n){
83  m_time->push_back(tileR->time(n));
84  }
85  }
86  return StatusCode::SUCCESS;
87  }
88 
89 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileRawChannel::pedestal
float pedestal(void) const
Definition: TileRawChannel.h:106
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
D3PD::TileRawChannelFillerTool::m_amplitude
std::vector< float > * m_amplitude
Definition: TileRawChannelFillerTool.h:67
D3PD::TileRawChannelFillerTool::m_ped
float * m_ped
Definition: TileRawChannelFillerTool.h:66
D3PD::TileRawChannelFillerTool::TileRawChannelFillerTool
TileRawChannelFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: TileRawChannelFillerTool.cxx:22
TileRawChannelFillerTool.h
D3PD::AddVariable::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Definition: AddVariable.cxx:85
TileRawData::adc_HWID
HWIdentifier adc_HWID(void) const
Definition: TileRawData.h:53
HWIdentifier
Definition: HWIdentifier.h:13
TileRawChannel::time
float time(int ind=0) const
Definition: TileRawChannel.h:103
D3PD::TileRawChannelFillerTool::m_ros
char * m_ros
Definition: TileRawChannelFillerTool.h:61
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
TileRawChannel::quality
float quality(int ind=0) const
Definition: TileRawChannel.h:105
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
D3PD::TileRawChannelFillerTool::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
Definition: TileRawChannelFillerTool.cxx:36
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TileRawChannel::amplitude
float amplitude(int ind=0) const
Definition: TileRawChannel.h:101
TileHWID.h
D3PD::TileRawChannelFillerTool::book
virtual StatusCode book()
Declare tuple variables.
Definition: TileRawChannelFillerTool.cxx:42
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TileRawChannel::size
int size() const
Definition: TileRawChannel.h:108
D3PD::TileRawChannelFillerTool::m_tilehwid
const TileHWID * m_tilehwid
Definition: TileRawChannelFillerTool.h:56
TileRawChannel
Definition: TileRawChannel.h:35
test_pyathena.parent
parent
Definition: test_pyathena.py:15
D3PD::TileRawChannelFillerTool::m_channel
char * m_channel
Definition: TileRawChannelFillerTool.h:63
D3PD::BlockFillerTool< TileRawChannel >
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
D3PD::TileRawChannelFillerTool::fill
virtual StatusCode fill(const TileRawChannel &p)
Fill one block — type-safe version.
Definition: TileRawChannelFillerTool.cxx:60
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
errorcheck.h
Helpers for checking error return status codes and reporting errors.
D3PD::TileRawChannelFillerTool::m_SaveHWid
bool m_SaveHWid
Definition: TileRawChannelFillerTool.h:58
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
D3PD::TileRawChannelFillerTool::m_quality
std::vector< float > * m_quality
Definition: TileRawChannelFillerTool.h:69
D3PD::TileRawChannelFillerTool::m_SaveRawCh
bool m_SaveRawCh
Definition: TileRawChannelFillerTool.h:59
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::TileRawChannelFillerTool::m_gain
char * m_gain
Definition: TileRawChannelFillerTool.h:64
TileRawChannel::sizeTime
int sizeTime() const
Definition: TileRawChannel.h:109
D3PD::TileRawChannelFillerTool::m_drawer
char * m_drawer
Definition: TileRawChannelFillerTool.h:62
StoreGateSvc.h
D3PD::TileRawChannelFillerTool::m_time
std::vector< float > * m_time
Definition: TileRawChannelFillerTool.h:68