ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigJiveXML
src
LVL1JetElementRetriever.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigJiveXML/LVL1JetElementRetriever.h
"
6
7
#include <string>
8
9
#include "CLHEP/Units/SystemOfUnits.h"
10
11
#include "
TrigT1CaloEvent/JetElement.h
"
12
13
namespace
JiveXML
{
14
15
//--------------------------------------------------------------------------
16
17
LVL1JetElementRetriever::LVL1JetElementRetriever
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent):
18
AthAlgTool
(
type
, name, parent),
19
m_typeName
(
"LVL1JetElement"
)
20
{
21
22
declareInterface<IDataRetriever>(
this
);
23
24
declareProperty
(
"StoreGateKey"
,
m_sgKey
=
"JetElements"
,
25
"Storegate key for Level-1 Jet Elements"
);
26
}
27
28
//--------------------------------------------------------------------------
29
30
StatusCode
LVL1JetElementRetriever::retrieve
(ToolHandle<IFormatTool> &FormatTool) {
31
32
// taken from TrigT1Calo/Tester.cxx
33
34
typedef
DataVector<LVL1::JetElement>
t_JECollection ;
35
const
t_JECollection* JEVector;
36
37
if
(
evtStore
()->
retrieve
(JEVector,
m_sgKey
).isFailure() ) {
38
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
"No Level-1 Jet Elements found in SG at "
39
<<
m_sgKey
<<
endmsg
;
40
return
StatusCode::SUCCESS;
41
}
42
int
noJE = JEVector->
size
();
43
44
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
" Retrieving Level-1 Jet Elements with size "
<< noJE <<
endmsg
;
45
46
DataVect
phi
;
phi
.reserve(noJE);
47
DataVect
eta
;
eta
.reserve(noJE);
48
DataVect
energy; energy.reserve(noJE);
49
50
t_JECollection::const_iterator it ;
51
52
for
( it = JEVector->begin(); it < JEVector->end(); ++it ){
53
eta
.push_back(
DataType
((*it)->eta()));
54
phi
.push_back(
DataType
((*it)->phi()));
55
energy.push_back(
DataType
((*it)->energy()));
56
}
//end JE iterator JE loop
57
58
DataMap
myDataMap;
59
const
auto
nPhi =
phi
.size();
60
myDataMap[
"energy"
] = std::move(energy);
61
myDataMap[
"phi"
] = std::move(
phi
);
62
myDataMap[
"eta"
] = std::move(
eta
);
63
64
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
dataTypeName
() <<
": "
<< nPhi <<
endmsg
;
65
67
//return FormatTool->AddToEvent(dataTypeName(), m_sgKey, &myDataMap);
70
std::string emptyStr =
""
;
71
return
FormatTool->AddToEvent(
dataTypeName
(), emptyStr, &myDataMap);
72
}
73
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition
CTPResultByteStreamTool.cxx:22
LVL1JetElementRetriever.h
JetElement.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition
AthCommonMsg.h:30
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
DataVector
Derived DataVector<T>.
Definition
DataVector.h:795
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
JiveXML::LVL1JetElementRetriever::LVL1JetElementRetriever
LVL1JetElementRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition
LVL1JetElementRetriever.cxx:17
JiveXML::LVL1JetElementRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition
LVL1JetElementRetriever.cxx:30
JiveXML::LVL1JetElementRetriever::m_sgKey
std::string m_sgKey
The storegate key for the JetElements.
Definition
LVL1JetElementRetriever.h:36
JiveXML::LVL1JetElementRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition
LVL1JetElementRetriever.h:28
JiveXML::LVL1JetElementRetriever::m_typeName
const std::string m_typeName
The data type that is generated by this retriever.
Definition
LVL1JetElementRetriever.h:33
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition
BadLArRetriever.cxx:22
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition
DataType.h:59
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition
DataType.h:58
type
Generated on
for ATLAS Offline Software by
1.17.0