ATLAS Offline Software
MBTSFillerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id$
14 #include "MBTSFillerTool.h"
15 #include "TileEvent/TileCell.h"
18 #include "math.h"
19 
20 
21 namespace D3PD {
22 
23 
31  (const std::string& type,
32  const std::string& name,
33  const IInterface* parent)
35 {
36  declareProperty("SaveEtaPhiInfo", m_saveEtaPhi = true );
37  book().ignore(); // Avoid coverity warnings
38 }
39 
40 
45 {
46  CHECK( addVariable ("E", m_E, "MBTS counter energy.") );
47 
48  if (m_saveEtaPhi) {
49  CHECK( addVariable ("eta", m_eta, "MBTS counter eta.") );
50  CHECK( addVariable ("phi", m_phi, "MBTS counter phi.") );
51  }
52 
53  CHECK( addVariable ("time", m_time, "MBTS counter time.") );
54  CHECK( addVariable ("quality", m_quality, "MBTS counter quality.") );
55  CHECK( addVariable ("type", m_type, "MBTS counter type. +-1, depending on side.") );
56  CHECK( addVariable ("module", m_module, "MBTS counter module. 0-7, depending on phi.") );
57  CHECK( addVariable ("channel", m_channel, "MBTS counter channel. 0-1, depending on eta. " "Zero is closer to the beam pipe.") );
58 
59  return StatusCode::SUCCESS;
60 }
61 
62 
72  const TileTBID* tileid = 0;
73  CHECK( detStore()->retrieve (tileid) );
74 
75  *m_E = c.energy();
76 
77  if (m_saveEtaPhi) {
78  *m_eta = c.eta();
79  *m_phi = c.phi();
80  }
81 
82  *m_time = c.time();
83  *m_quality = c.quality();
84 
85  Identifier id = c.ID();
86  int module = tileid->module(id);
87 
88  *m_type = tileid->type(id);
89  *m_module = module;
90  *m_channel = tileid->channel(id);
91 
92  return StatusCode::SUCCESS;
93 }
94 
95 
96 } // namespace D3PD
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TileCell
Definition: TileCell.h:57
D3PD::MBTSFillerTool::m_quality
int * m_quality
Variable: Counter quality.
Definition: MBTSFillerTool.h:70
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
D3PD::MBTSFillerTool::m_phi
float * m_phi
Variable: Counter phi.
Definition: MBTSFillerTool.h:64
TileTBID::type
int type(const Identifier &id) const
extract type field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:146
D3PD::MBTSFillerTool::m_E
float * m_E
Variable: Counter energy.
Definition: MBTSFillerTool.h:58
TileTBID::module
int module(const Identifier &id) const
extract module field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:150
D3PD::MBTSFillerTool::m_time
float * m_time
Variable: Counter time.
Definition: MBTSFillerTool.h:67
D3PD::MBTSFillerTool::fill
virtual StatusCode fill(const TileCell &c) override
Fill one block — type-safe version.
Definition: MBTSFillerTool.cxx:71
D3PD::MBTSFillerTool::m_saveEtaPhi
bool m_saveEtaPhi
Definition: MBTSFillerTool.h:82
python.PyAthena.module
module
Definition: PyAthena.py:134
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
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::MBTSFillerTool::m_module
int * m_module
Variable: Counter module. 0-7, depending on phi.
Definition: MBTSFillerTool.h:76
TileCell.h
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::MBTSFillerTool::book
virtual StatusCode book() final
Book variables for this block.
Definition: MBTSFillerTool.cxx:44
TileTBID::channel
int channel(const Identifier &id) const
extract channel field from TileTB identifier
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:154
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.
MBTSFillerTool.h
Block filler tool for MBTS information.
D3PD::MBTSFillerTool::MBTSFillerTool
MBTSFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: MBTSFillerTool.cxx:31
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
TileTBID
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:65
TileTBID.h
D3PD::MBTSFillerTool::m_eta
float * m_eta
Variable: Counter eta.
Definition: MBTSFillerTool.h:61
D3PD::MBTSFillerTool::m_channel
int * m_channel
Variable: Counter channel.
Definition: MBTSFillerTool.h:80
python.compressB64.c
def c
Definition: compressB64.py:93
D3PD::MBTSFillerTool::m_type
int * m_type
Variable: Counter type. +-1, depending on side.
Definition: MBTSFillerTool.h:73