ATLAS Offline Software
Loading...
Searching...
No Matches
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$
12
13
14#include "MBTSFillerTool.h"
15#include "TileEvent/TileCell.h"
18#include "math.h"
19
20
21namespace D3PD {
22
23
31 (const std::string& type,
32 const std::string& name,
33 const IInterface* parent)
34 : BlockFillerTool<TileCell> (type, name, 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
71StatusCode MBTSFillerTool::fill (const TileCell& c) {
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
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Block filler tool for MBTS information.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Type-safe wrapper for block filler tools.
float * m_time
Variable: Counter time.
int * m_channel
Variable: Counter channel.
float * m_eta
Variable: Counter eta.
int * m_type
Variable: Counter type. +-1, depending on side.
float * m_phi
Variable: Counter phi.
int * m_quality
Variable: Counter quality.
MBTSFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
int * m_module
Variable: Counter module. 0-7, depending on phi.
virtual StatusCode fill(const TileCell &c) override
Fill one block — type-safe version.
virtual StatusCode book() final
Book variables for this block.
float * m_E
Variable: Counter energy.
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
int type(const Identifier &id) const
extract type field from TileTB identifier
int channel(const Identifier &id) const
extract channel field from TileTB identifier
Block filler tool for noisy FEB information.