ATLAS Offline Software
TileRawChannelFillerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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  CHECK( service("DetectorStore",detStore) );
40  CHECK( detStore->retrieve(m_tilehwid) );
41  return StatusCode::SUCCESS;
42  }
43 
45  if(m_SaveHWid){
46  CHECK(addVariable("ros",m_ros));
47  CHECK(addVariable("drawer",m_drawer));
48  CHECK(addVariable("channel",m_channel));
49  CHECK(addVariable("gain",m_gain));
50  }
51 
52  if(m_SaveRawCh){
53  CHECK(addVariable("amplitude",m_amplitude));
54  CHECK(addVariable("time",m_time));
55  CHECK(addVariable("quality",m_quality));
56  CHECK(addVariable("pedestal",m_ped));
57  }
58 
59  return StatusCode::SUCCESS;
60  }
61 
63  const TileRawChannel* tileR=&p;
64  if(m_SaveHWid){
65  HWIdentifier hwid=tileR->adc_HWID();
66  *m_ros=(char)m_tilehwid->ros(hwid);
67  *m_drawer=(char)m_tilehwid->drawer(hwid);
69  *m_gain=(char)m_tilehwid->adc(hwid);
70  }
71  if(m_SaveRawCh){
72  *m_ped=tileR->pedestal();
73  size_t nentry=tileR->size();
74  m_amplitude->reserve(nentry);
75  for(unsigned int n=0;n<nentry;++n){
76  m_amplitude->push_back(tileR->amplitude(n));
77  }
78  m_quality->reserve(nentry);
79  for(unsigned int n=0;n<nentry;++n){
80  m_quality->push_back(tileR->quality(n));
81  }
82  nentry=tileR->sizeTime();
83  m_time->reserve(nentry);
84  for(unsigned int n=0;n<nentry;++n){
85  m_time->push_back(tileR->time(n));
86  }
87  }
88  return StatusCode::SUCCESS;
89  }
90 
91 }
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
D3PD::TileRawChannelFillerTool::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
Definition: TileRawChannelFillerTool.cxx:36
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
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:44
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:62
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
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
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
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