ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoSimulation
src
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
12
#include "
RoiB2TopoInputDataCnv.h
"
13
#include "
TrigT1CaloUtils/L1TopoDataMaker.h
"
14
15
#include "Gaudi/Property.h"
16
17
#include "
TrigT1Interfaces/TrigT1CaloDefs.h
"
18
19
20
// Constructor
21
LVL1::RoiB2TopoInputDataCnv::RoiB2TopoInputDataCnv
(
const
std::string&
name
,
22
ISvcLocator* pSvcLocator ) :
23
::
AthReentrantAlgorithm
(
name
, pSvcLocator ),
24
m_datamaker
( new
LVL1
::
L1TopoDataMaker
() ),
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
38
LVL1::RoiB2TopoInputDataCnv::~RoiB2TopoInputDataCnv
()
39
{
40
delete
m_datamaker
;
41
}
42
43
StatusCode
44
LVL1::RoiB2TopoInputDataCnv::initialize
()
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
54
StatusCode
55
LVL1::RoiB2TopoInputDataCnv::execute
(
const
EventContext& ctx)
const
56
{
57
ATH_MSG_DEBUG
(
"Executing "
<<
name
() <<
"..."
);
58
59
SG::ReadHandle<ROIB::RoIBResult>
roibResult(
m_roibLocation
, ctx);
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
66
SG::WriteHandle<DataVector<CPCMXTopoData>
> emtauTopoData(
m_emTauLocation
, ctx);
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
77
SG::WriteHandle<DataVector<JetCMXTopoData>
> jetTopoData(
m_jetLocation
, ctx);
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
87
SG::WriteHandle<EnergyTopoData>
energyTopoData(
m_energyLocation
, ctx);
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
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
L1TopoDataMaker.h
RoiB2TopoInputDataCnv.h
TrigT1CaloDefs.h
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
DataVector
Derived DataVector<T>.
Definition
DataVector.h:795
LVL1::L1TopoDataMaker
This is a tool to reconstruct the CMX -> Topo simulation objects from the RoIBResult.
Definition
L1TopoDataMaker.h:34
LVL1::RoiB2TopoInputDataCnv::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
RoiB2TopoInputDataCnv.cxx:55
LVL1::RoiB2TopoInputDataCnv::m_emTauLocation
SG::WriteHandleKey< DataVector< CPCMXTopoData > > m_emTauLocation
Definition
RoiB2TopoInputDataCnv.h:50
LVL1::RoiB2TopoInputDataCnv::initialize
virtual StatusCode initialize() override
Definition
RoiB2TopoInputDataCnv.cxx:44
LVL1::RoiB2TopoInputDataCnv::m_roibLocation
SG::ReadHandleKey< ROIB::RoIBResult > m_roibLocation
Definition
RoiB2TopoInputDataCnv.h:49
LVL1::RoiB2TopoInputDataCnv::m_jetLocation
SG::WriteHandleKey< DataVector< JetCMXTopoData > > m_jetLocation
Definition
RoiB2TopoInputDataCnv.h:51
LVL1::RoiB2TopoInputDataCnv::RoiB2TopoInputDataCnv
RoiB2TopoInputDataCnv()
LVL1::RoiB2TopoInputDataCnv::m_datamaker
L1TopoDataMaker * m_datamaker
Definition
RoiB2TopoInputDataCnv.h:47
LVL1::RoiB2TopoInputDataCnv::m_energyLocation
SG::WriteHandleKey< EnergyTopoData > m_energyLocation
Definition
RoiB2TopoInputDataCnv.h:52
LVL1::RoiB2TopoInputDataCnv::~RoiB2TopoInputDataCnv
virtual ~RoiB2TopoInputDataCnv()
Definition
RoiB2TopoInputDataCnv.cxx:38
LVL1::TrigT1CaloDefs
Definition
TrigT1CaloDefs.h:24
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::VarHandleBase::isPresent
bool isPresent() const
Is the referenced object present in SG?
Definition
StoreGate/src/VarHandleBase.cxx:400
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition
IZdcDataAccess.h:13
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0