ATLAS Offline Software
TileDigitFillerTool.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: 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  {
47  CHECK( service("DetectorStore",detStore) );
48  CHECK( detStore->retrieve(m_tileid) );
49  CHECK( detStore->retrieve(m_tilehwid) );
50  return StatusCode::SUCCESS;
51  }
52 
53 
54 
56  if(m_SaveHWid){
57  CHECK(addVariable("ros",m_ros));
58  CHECK(addVariable("drawer",m_drawer));
59  CHECK(addVariable("channel",m_channel));
60  CHECK(addVariable("gain",m_gain));
61  CHECK(addVariable("samples",m_samples));
62  }
63 
64  if(m_SaveOffId){
65  CHECK(addVariable("section",m_section));
66  CHECK(addVariable("side",m_side));
67  CHECK(addVariable("tower",m_tower));
68  }
69  return StatusCode::SUCCESS;
70  }
71 
73  const TileDigits* tileD=&p;
74  HWIdentifier hwid=tileD->adc_HWID();
75 
76  if(m_SaveHWid){
77  *m_ros=(char)m_tilehwid->ros(hwid);
78  *m_drawer=(char)m_tilehwid->drawer(hwid);
80  *m_gain=(char)m_tilehwid->adc(hwid);
81 
82  const std::vector<float>& Samples=tileD->samples();
83  m_samples->assign (Samples.begin(), Samples.end());
84  }
85 
86  if(m_SaveOffId){
87  Identifier digID=tileD->adc_ID();
88  *m_section=(char)m_tileid->section(digID);
89  *m_side=(char)m_tileid->side(digID);
90  *m_tower=(char)m_tileid->tower(digID);
91  }
92 
93  return StatusCode::SUCCESS;
94  }
95 
96 }
D3PD::TileDigitFillerTool::m_ros
char * m_ros
Definition: TileDigitFillerTool.h:66
D3PD::TileDigitFillerTool::m_side
char * m_side
Definition: TileDigitFillerTool.h:63
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
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
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
TileHWID.h
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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:195
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:55
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
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
D3PD::TileDigitFillerTool::m_gain
char * m_gain
Definition: TileDigitFillerTool.h:69
python.grid.Samples
def Samples(names)
Definition: grid.py:48
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:72
StoreGateSvc.h