ATLAS Offline Software
TileDigitFillerTool.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: TileDigitFillerTool.cxx
7  * Author: Stephen Cole <scole@niu.edu>
8  *
9  * Created on February 22, 2011, 4:06 PM
10  */
11 
12 #include "TileDigitFillerTool.h"
14 #include "CaloIdentifier/TileID.h"
15 #include "GaudiKernel/ISvcLocator.h"
16 #include "GaudiKernel/StatusCode.h"
17 #include "GaudiKernel/MsgStream.h"
18 #include "StoreGate/StoreGateSvc.h"
20 
21 
22 namespace D3PD{
23 
25  const std::string& name,
26  const IInterface* parent):
28  m_tileid(0),
29  m_tilehwid(0)
30  {
31  declareProperty("SaveOfflineInfo", m_SaveOffId=false);
32  declareProperty("SaveHardwareInfo", m_SaveHWid=true);
33 
34  m_section = 0;
35  m_side = 0;
36  m_tower = 0;
37  TileDigitFillerTool::book().ignore(); // Avoid coverity warnings
38  }
39 
40 
45  {
48  return StatusCode::SUCCESS;
49  }
50 
51 
52 
54  if(m_SaveHWid){
55  CHECK(addVariable("ros",m_ros));
56  CHECK(addVariable("drawer",m_drawer));
57  CHECK(addVariable("channel",m_channel));
58  CHECK(addVariable("gain",m_gain));
59  CHECK(addVariable("samples",m_samples));
60  }
61 
62  if(m_SaveOffId){
63  CHECK(addVariable("section",m_section));
64  CHECK(addVariable("side",m_side));
65  CHECK(addVariable("tower",m_tower));
66  }
67  return StatusCode::SUCCESS;
68  }
69 
71  const TileDigits* tileD=&p;
72  HWIdentifier hwid=tileD->adc_HWID();
73 
74  if(m_SaveHWid){
75  *m_ros=(char)m_tilehwid->ros(hwid);
76  *m_drawer=(char)m_tilehwid->drawer(hwid);
78  *m_gain=(char)m_tilehwid->adc(hwid);
79 
80  const std::vector<float>& Samples=tileD->samples();
81  m_samples->assign (Samples.begin(), Samples.end());
82  }
83 
84  if(m_SaveOffId){
85  Identifier digID=tileD->adc_ID();
86  *m_section=(char)m_tileid->section(digID);
87  *m_side=(char)m_tileid->side(digID);
88  *m_tower=(char)m_tileid->tower(digID);
89  }
90 
91  return StatusCode::SUCCESS;
92  }
93 
94 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
D3PD::TileDigitFillerTool::m_ros
char * m_ros
Definition: TileDigitFillerTool.h:66
D3PD::TileDigitFillerTool::m_side
char * m_side
Definition: TileDigitFillerTool.h:63
D3PD::TileDigitFillerTool::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
Definition: TileDigitFillerTool.cxx:44
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
Tile_Base_ID::side
int side(const Identifier &id) const
Definition: Tile_Base_ID.cxx:153
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
Tile_Base_ID::tower
int tower(const Identifier &id) const
Definition: Tile_Base_ID.cxx:165
TileRawData::adc_HWID
HWIdentifier adc_HWID(void) const
Definition: TileRawData.h:53
HWIdentifier
Definition: HWIdentifier.h:13
TileDigitFillerTool.h
D3PD::TileDigitFillerTool::m_channel
char * m_channel
Definition: TileDigitFillerTool.h:68
D3PD::TileDigitFillerTool::m_SaveOffId
bool m_SaveOffId
Definition: TileDigitFillerTool.h:60
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
TileID.h
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
D3PD::TileDigitFillerTool::m_section
char * m_section
Definition: TileDigitFillerTool.h:62
D3PD
Block filler tool for noisy FEB information.
Definition: CaloCellDetailsFillerTool.cxx:29
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TileHWID.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
D3PD::TileDigitFillerTool::m_drawer
char * m_drawer
Definition: TileDigitFillerTool.h:67
test_pyathena.parent
parent
Definition: test_pyathena.py:15
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition: BlockFillerTool.h:68
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
D3PD::TileDigitFillerTool::m_samples
std::vector< short > * m_samples
Definition: TileDigitFillerTool.h:70
TileDigits::samples
const std::vector< float > & samples() const
Definition: TileDigits.h:58
D3PD::TileDigitFillerTool::TileDigitFillerTool
TileDigitFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: TileDigitFillerTool.cxx:24
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
D3PD::TileDigitFillerTool::m_tower
char * m_tower
Definition: TileDigitFillerTool.h:64
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TileDigits
Definition: TileDigits.h:30
errorcheck.h
Helpers for checking error return status codes and reporting errors.
D3PD::TileDigitFillerTool::m_tileid
const TileID * m_tileid
Definition: TileDigitFillerTool.h:56
D3PD::TileDigitFillerTool::book
virtual StatusCode book()
Declare tuple variables.
Definition: TileDigitFillerTool.cxx:53
TileRawData::adc_ID
Identifier adc_ID(void) const
Definition: TileRawData.cxx:53
D3PD::TileDigitFillerTool::m_SaveHWid
bool m_SaveHWid
Definition: TileDigitFillerTool.h:59
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::TileDigitFillerTool::m_tilehwid
const TileHWID * m_tilehwid
Definition: TileDigitFillerTool.h:57
D3PD::TileDigitFillerTool::m_gain
char * m_gain
Definition: TileDigitFillerTool.h:69
Tile_Base_ID::section
int section(const Identifier &id) const
Definition: Tile_Base_ID.cxx:147
D3PD::TileDigitFillerTool::fill
virtual StatusCode fill(const TileDigits &p)
Fill one block — type-safe version.
Definition: TileDigitFillerTool.cxx:70
StoreGateSvc.h
Identifier
Definition: IdentifierFieldParser.cxx:14