ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigJiveXML
src
xAODMuonROIRetriever.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/xAODMuonROIRetriever.h
"
6
7
#include <string>
8
9
#include "CLHEP/Units/SystemOfUnits.h"
10
11
#include "
xAODTrigger/MuonRoIContainer.h
"
12
13
namespace
JiveXML
{
14
15
//--------------------------------------------------------------------------
16
17
xAODMuonROIRetriever::xAODMuonROIRetriever
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent):
18
AthAlgTool
(
type
, name, parent),
m_typeName
(
"MuonROI"
)
19
{
20
21
declareInterface<IDataRetriever>(
this
);
22
}
23
24
//--------------------------------------------------------------------------
25
26
StatusCode
xAODMuonROIRetriever::retrieve
(ToolHandle<IFormatTool> &FormatTool) {
27
29
30
const
xAOD::MuonRoIContainer
* muonROIs = 0;
31
32
//xAOD::MuonROIContainer* muonROIs = 0;
33
34
// L1JetObject -not- available
35
m_sgKey
=
"LVL1MuonRoIs"
;
36
if
(
evtStore
()->
retrieve
(muonROIs,
m_sgKey
).isFailure() ) {
37
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
"No LVL1MuonROIs found in SG "
<<
endmsg
;
38
return
StatusCode::SUCCESS;
39
}
40
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
"Found LVL1MuonROIs in SG ! "
<<
endmsg
;
41
42
int
noRois = muonROIs->
size
();
43
44
DataVect
phi
;
phi
.reserve(noRois);
45
DataVect
eta
;
eta
.reserve(noRois);
46
DataVect
roiWord; roiWord.reserve(noRois);
47
DataVect
thrNumber; thrNumber.reserve(noRois);
48
DataVect
thrName; thrName.reserve(noRois);
49
DataVect
thrValue; thrValue.reserve(noRois);
50
DataVect
energy; energy.reserve(noRois);
51
52
xAOD::MuonRoIContainer::const_iterator
itMU = muonROIs->
begin
();
53
xAOD::MuonRoIContainer::const_iterator
itMUe = muonROIs->
end
();
54
55
56
int
counter = 0;
57
for
(; itMU != itMUe; ++itMU)
58
{
59
phi
.push_back(
DataType
( (*itMU)->phi()) );
60
eta
.push_back(
DataType
( (*itMU)->eta()) );
61
// roiWord.push_back(DataType( (*itMU)->getRoIWord()) );
62
roiWord.push_back(
DataType
( (*itMU)->getRoI()) );
63
thrNumber.push_back(
DataType
( (*itMU)->getThrNumber()));
64
65
thrName.push_back(
DataType
(
"n_a"
));
// placeholders
66
thrValue.push_back(
DataType
( 1. ));
67
energy.push_back(
DataType
( 1. ));
68
69
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
"xAOD MuonROI #"
<< counter++
70
<<
", eta: "
<< (*itMU)->eta() <<
", phi: "
<< (*itMU)->phi() <<
endmsg
;
71
72
}
73
74
DataMap
myDataMap;
75
const
auto
nPhi =
phi
.size();
76
myDataMap[
"phi"
] = std::move(
phi
);
77
myDataMap[
"eta"
] = std::move(
eta
);
78
myDataMap[
"energy"
] = energy;
79
myDataMap[
"roiWord"
] = std::move(roiWord);
80
myDataMap[
"thrNumber"
] = std::move(thrNumber);
81
myDataMap[
"thrName"
] = std::move(thrName);
82
myDataMap[
"thrValue"
] = std::move(thrValue);
83
myDataMap[
"energy"
] = std::move(energy);
84
85
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
dataTypeName
() <<
": "
<< nPhi
86
<<
" from: "
<<
m_sgKey
<<
endmsg
;
87
88
//forward data to formating tool
89
return
FormatTool->AddToEvent(
dataTypeName
(),
m_sgKey
, &myDataMap);
90
}
91
}
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
MuonRoIContainer.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 > >::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< xAOD::MuonRoI_v1 >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
JiveXML::xAODMuonROIRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition
xAODMuonROIRetriever.cxx:26
JiveXML::xAODMuonROIRetriever::m_sgKey
std::string m_sgKey
Definition
xAODMuonROIRetriever.h:50
JiveXML::xAODMuonROIRetriever::xAODMuonROIRetriever
xAODMuonROIRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition
xAODMuonROIRetriever.cxx:17
JiveXML::xAODMuonROIRetriever::m_typeName
const std::string m_typeName
The data type that is generated by this retriever.
Definition
xAODMuonROIRetriever.h:48
JiveXML::xAODMuonROIRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition
xAODMuonROIRetriever.h:43
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
xAOD::MuonRoIContainer
MuonRoIContainer_v1 MuonRoIContainer
Definition
MuonRoIContainer.h:16
type
xAODMuonROIRetriever.h
Generated on
for ATLAS Offline Software by
1.17.0