ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::MbtsToVectorsTool Class Reference

#include <MbtsToVectorsTool.h>

Inheritance diagram for DerivationFramework::MbtsToVectorsTool:
Collaboration diagram for DerivationFramework::MbtsToVectorsTool:

Public Member Functions

virtual StatusCode addBranches (const EventContext &ctx) const override final
virtual StatusCode initialize () override final

Private Attributes

Gaudi::Property< bool > m_saveEtaPhi {this, "SaveEtaPhiInfo", true}
SG::ReadHandleKey< TileCellContainerm_cellContainerKey {this, "CellContainer", "MBTSContainer"}
SG::WriteHandleKey< std::vector< float > > m_energyKey {this, "Energy", "energy"}
SG::WriteHandleKey< std::vector< float > > m_timeKey {this, "Time", "time"}
SG::WriteHandleKey< std::vector< float > > m_etaKey {this, "Eta", "eta"}
SG::WriteHandleKey< std::vector< float > > m_phiKey {this, "Phi", "phi"}
SG::WriteHandleKey< std::vector< int > > m_qualityKey {this, "Quality", "quality"}
SG::WriteHandleKey< std::vector< int > > m_typeKey {this, "Type", "type"}
SG::WriteHandleKey< std::vector< int > > m_moduleKey {this, "Module", "module"}
SG::WriteHandleKey< std::vector< int > > m_channelKey {this, "Channel", "channel"}
const TileTBIDm_tileTBID {}

Static Private Attributes

static const unsigned int MAX_MBTS_COUNTER {32}

Detailed Description

Definition at line 31 of file MbtsToVectorsTool.h.

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::MbtsToVectorsTool::addBranches ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 43 of file MbtsToVectorsTool.cxx.

43 {
44
45
46 SG::WriteHandle<std::vector<float> > energy(m_energyKey, ctx);
47 ATH_CHECK( energy.record(std::make_unique<std::vector<float> >()) );
48 energy->reserve(MAX_MBTS_COUNTER);
49
50 SG::WriteHandle<std::vector<float> > time(m_timeKey, ctx);
51 ATH_CHECK( time.record(std::make_unique<std::vector<float> >()) );
52 time->reserve(MAX_MBTS_COUNTER);
53
54 SG::WriteHandle<std::vector<int> > quality(m_qualityKey, ctx);
55 ATH_CHECK( quality.record(std::make_unique<std::vector<int> >()) );
56 quality->reserve(MAX_MBTS_COUNTER);
57
58 SG::WriteHandle<std::vector<int> > module(m_moduleKey, ctx);
59 ATH_CHECK( module.record(std::make_unique<std::vector<int> >()) );
60 module->reserve(MAX_MBTS_COUNTER);
61
62 SG::WriteHandle<std::vector<int> > type(m_typeKey, ctx);
63 ATH_CHECK( type.record(std::make_unique<std::vector<int> >()) );
64 type->reserve(MAX_MBTS_COUNTER);
65
66 SG::WriteHandle<std::vector<int> > channel(m_channelKey, ctx);
67 ATH_CHECK( channel.record(std::make_unique<std::vector<int> >()) );
68 channel->reserve(MAX_MBTS_COUNTER);
69
70 SG::ReadHandle<TileCellContainer> tileCells(m_cellContainerKey, ctx);
71 ATH_CHECK( tileCells.isValid() );
72
73 if (m_saveEtaPhi) {
74 SG::WriteHandle<std::vector<float> > eta(m_etaKey, ctx);
75 ATH_CHECK( eta.record(std::make_unique<std::vector<float> >()) );
76 eta->reserve(MAX_MBTS_COUNTER);
77
78 SG::WriteHandle<std::vector<float> > phi(m_phiKey, ctx);
79 ATH_CHECK( phi.record(std::make_unique<std::vector<float> >()) );
80 phi->reserve(MAX_MBTS_COUNTER);
81
82 for ( const TileCell* cell : *tileCells ){
83 energy->push_back( cell->energy() );
84 eta->push_back( cell->eta() );
85 phi->push_back( cell->phi() );
86 time->push_back( cell->time() );
87 quality->push_back(cell->quality() );
88 module->push_back(m_tileTBID->module( cell->ID() ) );
89 type->push_back(m_tileTBID->type( cell->ID() ) );
90 channel->push_back(m_tileTBID->channel( cell->ID() ) );
91 }
92
93 } else {
94
95 for ( const TileCell* cell : *tileCells ){
96 energy->push_back( cell->energy() );
97 time->push_back( cell->time() );
98 quality->push_back(cell->quality() );
99 module->push_back(m_tileTBID->module( cell->ID() ) );
100 type->push_back(m_tileTBID->type( cell->ID() ) );
101 channel->push_back(m_tileTBID->channel( cell->ID() ) );
102 }
103
104 }
105
106 return StatusCode::SUCCESS;
107 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::WriteHandleKey< std::vector< int > > m_typeKey
SG::WriteHandleKey< std::vector< int > > m_moduleKey
SG::WriteHandleKey< std::vector< int > > m_qualityKey
SG::WriteHandleKey< std::vector< float > > m_etaKey
SG::ReadHandleKey< TileCellContainer > m_cellContainerKey
SG::WriteHandleKey< std::vector< float > > m_energyKey
SG::WriteHandleKey< std::vector< float > > m_phiKey
SG::WriteHandleKey< std::vector< int > > m_channelKey
SG::WriteHandleKey< std::vector< float > > m_timeKey
static const unsigned int MAX_MBTS_COUNTER
time(flags, cells_name, *args, **kw)

◆ initialize()

StatusCode DerivationFramework::MbtsToVectorsTool::initialize ( )
finaloverridevirtual

Definition at line 25 of file MbtsToVectorsTool.cxx.

25 {
26
27 ATH_CHECK( m_cellContainerKey.initialize() );
28 ATH_CHECK( m_energyKey.initialize() );
29 ATH_CHECK( m_timeKey.initialize() );
30 ATH_CHECK( m_qualityKey.initialize() );
31 ATH_CHECK( m_typeKey.initialize() );
32 ATH_CHECK( m_moduleKey.initialize() );
33 ATH_CHECK( m_channelKey.initialize() );
34 ATH_CHECK( m_etaKey.initialize(m_saveEtaPhi) );
35 ATH_CHECK( m_phiKey.initialize(m_saveEtaPhi) );
36
37 ATH_CHECK( detStore()->retrieve (m_tileTBID) );
38
39 return StatusCode::SUCCESS;
40 }

Member Data Documentation

◆ m_cellContainerKey

SG::ReadHandleKey<TileCellContainer> DerivationFramework::MbtsToVectorsTool::m_cellContainerKey {this, "CellContainer", "MBTSContainer"}
private

Definition at line 45 of file MbtsToVectorsTool.h.

45{this, "CellContainer", "MBTSContainer"};

◆ m_channelKey

SG::WriteHandleKey<std::vector<int> > DerivationFramework::MbtsToVectorsTool::m_channelKey {this, "Channel", "channel"}
private

Definition at line 54 of file MbtsToVectorsTool.h.

54{this, "Channel", "channel"};

◆ m_energyKey

SG::WriteHandleKey<std::vector<float> > DerivationFramework::MbtsToVectorsTool::m_energyKey {this, "Energy", "energy"}
private

Definition at line 47 of file MbtsToVectorsTool.h.

47{this, "Energy", "energy"};

◆ m_etaKey

SG::WriteHandleKey<std::vector<float> > DerivationFramework::MbtsToVectorsTool::m_etaKey {this, "Eta", "eta"}
private

Definition at line 49 of file MbtsToVectorsTool.h.

49{this, "Eta", "eta"};

◆ m_moduleKey

SG::WriteHandleKey<std::vector<int> > DerivationFramework::MbtsToVectorsTool::m_moduleKey {this, "Module", "module"}
private

Definition at line 53 of file MbtsToVectorsTool.h.

53{this, "Module", "module"};

◆ m_phiKey

SG::WriteHandleKey<std::vector<float> > DerivationFramework::MbtsToVectorsTool::m_phiKey {this, "Phi", "phi"}
private

Definition at line 50 of file MbtsToVectorsTool.h.

50{this, "Phi", "phi"};

◆ m_qualityKey

SG::WriteHandleKey<std::vector<int> > DerivationFramework::MbtsToVectorsTool::m_qualityKey {this, "Quality", "quality"}
private

Definition at line 51 of file MbtsToVectorsTool.h.

51{this, "Quality", "quality"};

◆ m_saveEtaPhi

Gaudi::Property<bool> DerivationFramework::MbtsToVectorsTool::m_saveEtaPhi {this, "SaveEtaPhiInfo", true}
private

Definition at line 43 of file MbtsToVectorsTool.h.

43{this, "SaveEtaPhiInfo", true};

◆ m_tileTBID

const TileTBID* DerivationFramework::MbtsToVectorsTool::m_tileTBID {}
private

Definition at line 56 of file MbtsToVectorsTool.h.

56{};

◆ m_timeKey

SG::WriteHandleKey<std::vector<float> > DerivationFramework::MbtsToVectorsTool::m_timeKey {this, "Time", "time"}
private

Definition at line 48 of file MbtsToVectorsTool.h.

48{this, "Time", "time"};

◆ m_typeKey

SG::WriteHandleKey<std::vector<int> > DerivationFramework::MbtsToVectorsTool::m_typeKey {this, "Type", "type"}
private

Definition at line 52 of file MbtsToVectorsTool.h.

52{this, "Type", "type"};

◆ MAX_MBTS_COUNTER

const unsigned int DerivationFramework::MbtsToVectorsTool::MAX_MBTS_COUNTER {32}
staticprivate

Definition at line 58 of file MbtsToVectorsTool.h.

58{32};

The documentation for this class was generated from the following files: