ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAnalysis
TrigJiveXML
src
MuonROIRetriever.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/MuonROIRetriever.h
"
6
7
#include <string>
8
9
#include "CLHEP/Units/SystemOfUnits.h"
10
11
#include "
AnalysisTriggerEvent/LVL1_ROI.h
"
12
13
namespace
JiveXML
{
14
15
//--------------------------------------------------------------------------
16
17
MuonROIRetriever::MuonROIRetriever
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent):
18
AthAlgTool
(
type
, name, parent),
19
m_typeName
(
"MuonROI"
)
20
{
21
22
declareInterface<IDataRetriever>(
this
);
23
24
declareProperty
(
"StoreGateKey"
,
m_sgKey
=
"LVL1_ROI"
,
25
"Storegate key for ROIs incl MuonROIs"
);
26
}
27
28
//--------------------------------------------------------------------------
29
30
StatusCode
MuonROIRetriever::retrieve
(ToolHandle<IFormatTool> &FormatTool) {
31
32
const
LVL1_ROI
* roi;
33
34
if
(
evtStore
()->
retrieve
(roi,
m_sgKey
).isFailure() ) {
35
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
"No MuonROI found in SG at "
36
<<
m_sgKey
<<
endmsg
;
37
return
StatusCode::SUCCESS;
38
}
39
int
noRois = roi->
getMuonROIs
().size();
40
41
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
" Retrieving MuonROIs with size "
<< noRois <<
endmsg
;
42
43
DataVect
phi
;
phi
.reserve(noRois);
44
DataVect
eta
;
eta
.reserve(noRois);
45
DataVect
roiWord; roiWord.reserve(noRois);
46
DataVect
thrNumber; thrNumber.reserve(noRois);
47
DataVect
thrName; thrName.reserve(noRois);
48
DataVect
thrValue; thrValue.reserve(noRois);
49
DataVect
energy; energy.reserve(noRois);
50
51
LVL1_ROI::muons_type::const_iterator itMU = (roi->
getMuonROIs
()).begin();
52
LVL1_ROI::muons_type::const_iterator itMUe = (roi->
getMuonROIs
()).end();
53
54
for
(; itMU != itMUe; ++itMU){
55
phi
.push_back(
DataType
( itMU->phi()));
56
eta
.push_back(
DataType
( itMU->eta()));
57
roiWord.push_back(
DataType
( itMU->getROIWord()));
58
thrNumber.push_back(
DataType
( itMU->getThrNumber()));
59
60
// prevent empty threshold name list
61
std::string thisThrName = itMU->getThrName();
62
if
(thisThrName.empty()){ thisThrName =
"empty"
; };
63
thrName.push_back(
DataType
( std::move(thisThrName) ));
64
65
thrValue.push_back(
DataType
( itMU->getThrValue()));
66
energy.push_back(
DataType
( itMU->getThrValue()/CLHEP::GeV));
67
}
68
69
DataMap
myDataMap;
70
const
auto
nPhi =
phi
.size();
71
myDataMap[
"phi"
] = std::move(
phi
);
72
myDataMap[
"eta"
] = std::move(
eta
);
73
myDataMap[
"roiWord"
] = std::move(roiWord);
74
myDataMap[
"thrNumber"
] = std::move(thrNumber);
75
myDataMap[
"thrName"
] = std::move(thrName);
76
myDataMap[
"thrValue"
] = std::move(thrValue);
77
myDataMap[
"energy"
] = std::move(energy);
78
79
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
dataTypeName
() <<
": "
<< nPhi <<
endmsg
;
80
81
//forward data to formating tool
82
return
FormatTool->AddToEvent(
dataTypeName
(),
m_sgKey
, &myDataMap);
83
}
84
}
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
LVL1_ROI.h
MuonROIRetriever.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
JiveXML::MuonROIRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition
MuonROIRetriever.cxx:30
JiveXML::MuonROIRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition
MuonROIRetriever.h:28
JiveXML::MuonROIRetriever::m_typeName
const std::string m_typeName
The data type that is generated by this retriever.
Definition
MuonROIRetriever.h:33
JiveXML::MuonROIRetriever::MuonROIRetriever
MuonROIRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition
MuonROIRetriever.cxx:17
JiveXML::MuonROIRetriever::m_sgKey
std::string m_sgKey
The storegate key for the MuonROIs.
Definition
MuonROIRetriever.h:36
LVL1_ROI
Top level AOD object storing LVL1 RoIs.
Definition
LVL1_ROI.h:43
LVL1_ROI::getMuonROIs
const muons_type & getMuonROIs() const
Get all the muon RoIs in the event.
Definition
LVL1_ROI.h:63
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