ATLAS Offline Software
Loading...
Searching...
No Matches
RoiB2TopoInputDataCnv.cxx
Go to the documentation of this file.
1/*//////////////////////// -*- C++ -*- ///////////////////////////// */
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7/*
8 RoiB2TopoInputDataCnv.cxx
9 Implementation file for class RoiB2TopoInputDataCnv
10*/
11
14
15#include "Gaudi/Property.h"
16
18
19
20// Constructor
22 ISvcLocator* pSvcLocator ) :
23 ::AthReentrantAlgorithm( name, pSvcLocator ),
25 m_roibLocation( "RoIBResult" ),
26 m_emTauLocation( TrigT1CaloDefs::EmTauTopoTobLocation ),
27 m_jetLocation(TrigT1CaloDefs::JetTopoTobLocation),
28 m_energyLocation(TrigT1CaloDefs::EnergyTopoDataLocation)
29{
30 declareProperty( "ROIBResultLocation", m_roibLocation, "Storegate key for the reading the ROIBResult" );
31 declareProperty( "EmTauROILocation", m_emTauLocation, "Storegate key for the writing EMTAU info" );
32 declareProperty( "JetROILocation", m_jetLocation, "Storegate key for writing the Jet ROIs" );
33 declareProperty( "EnergyROILocation", m_energyLocation, "Storegate key for writing the Topo Energy ROI" );
34}
35
36
37// Destructor
42
43StatusCode
45{
46 ATH_CHECK(m_roibLocation.initialize());
47 ATH_CHECK(m_emTauLocation.initialize());
48 ATH_CHECK(m_jetLocation.initialize());
49 ATH_CHECK(m_energyLocation.initialize());
50
51 return StatusCode::SUCCESS;
52}
53
54StatusCode
55LVL1::RoiB2TopoInputDataCnv::execute (const EventContext& ctx) const
56{
57 ATH_MSG_DEBUG ("Executing " << name() << "...");
58
60
61 if( !roibResult.isValid() ) {
62 ATH_MSG_WARNING("No RoIBResults with SG key '" << m_roibLocation.key() << "' found in the event. Can not create any information needed for L1Topo simulation.");
63 return StatusCode::RECOVERABLE;
64 }
65
67 // emtau
68 if(emtauTopoData.isPresent()) {
69 ATH_MSG_WARNING("DataVector<CPCMXTopoData> with SG key '" << m_emTauLocation.key() << "' already exists in SG, will not create a new one.");
70 } else {
71 ATH_MSG_DEBUG("Recording DataVector<CPCMXTopoData> with SG key '" << m_emTauLocation.key() << "'.");
72 ATH_CHECK(emtauTopoData.record(std::make_unique< DataVector<CPCMXTopoData> >()));
73 m_datamaker->makeCPCMXTopoData(roibResult.cptr(), emtauTopoData.ptr());
74 }
75
76 // jet
78 if(jetTopoData.isPresent()) {
79 ATH_MSG_WARNING("DataVector<JetCMXTopoData> with SG key '" << m_jetLocation.key() << "' already exists in SG, will not create a new one.");
80 } else {
81 ATH_MSG_DEBUG("Recording DataVector<JetCMXTopoData> with SG key '" << m_jetLocation.key() << "'.");
82 ATH_CHECK(jetTopoData.record(std::make_unique<DataVector<JetCMXTopoData>>()));
83 m_datamaker->makeJetCMXTopoData(roibResult.cptr(), jetTopoData.ptr());
84 }
85
86 // energy
88 if(energyTopoData.isPresent()) {
89 ATH_MSG_WARNING("EnergyTopoData with SG key '" << m_energyLocation.key() << "' already exists in SG, will not create a new one.");
90 } else {
91 ATH_MSG_DEBUG("Recording EnergyTopoData with SG key '" << m_energyLocation.key() << "'.");
92 ATH_CHECK(energyTopoData.record(std::make_unique<EnergyTopoData>()));
93 m_datamaker->makeEnergyTopoData(roibResult.cptr(), energyTopoData.ptr());
94 }
95
96 return StatusCode::SUCCESS;
97}
98
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
An algorithm that can be simultaneously executed in multiple threads.
Derived DataVector<T>.
Definition DataVector.h:795
This is a tool to reconstruct the CMX -> Topo simulation objects from the RoIBResult.
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< DataVector< CPCMXTopoData > > m_emTauLocation
virtual StatusCode initialize() override
SG::ReadHandleKey< ROIB::RoIBResult > m_roibLocation
SG::WriteHandleKey< DataVector< JetCMXTopoData > > m_jetLocation
SG::WriteHandleKey< EnergyTopoData > m_energyLocation
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
bool isPresent() const
Is the referenced object present in SG?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...