ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCnv
MuonJiveXML
src
TrigMuonROIRetriever.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 "
TrigMuonROIRetriever.h
"
6
7
#include "CLHEP/Units/SystemOfUnits.h"
8
9
namespace
JiveXML
{
10
11
//--------------------------------------------------------------------------
12
13
TrigMuonROIRetriever::TrigMuonROIRetriever
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent):
14
AthAlgTool
(
type
, name, parent)
15
{
16
17
declareInterface<IDataRetriever>(
this
);
18
19
}
20
21
//--------------------------------------------------------------------------
22
23
StatusCode
TrigMuonROIRetriever::retrieve
(ToolHandle<IFormatTool> &FormatTool) {
24
25
//be verbose
26
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
"Retrieving "
<<
dataTypeName
() <<
endmsg
;
27
28
SG::ReadHandle<LVL1_ROI>
roi(
m_sgKey
);
29
30
int
nRoIs = roi->getMuonROIs().size();
31
32
DataVect
phi
;
phi
.reserve(nRoIs);
33
DataVect
eta
;
eta
.reserve(nRoIs);
34
DataVect
energy; energy.reserve(nRoIs);
35
DataVect
roiWord; roiWord.reserve(nRoIs);
36
DataVect
thrNumber; thrNumber.reserve(nRoIs);
37
DataVect
thrName; thrName.reserve(nRoIs);
38
DataVect
thrValue; thrValue.reserve(nRoIs);
39
40
// Class: PhysicsAnalysis/AnalysisTrigger/AnalysisTriggerEvent/Muon_ROI.h
41
// Access as in: PhysicsAnalysis/AnalysisCommon/AnalysisTest/ReadTrigger
42
// Tested with: AnalysisTest/share/AODTriggerRead_topOptions.py
43
44
LVL1_ROI::muons_type::const_iterator itMU = (roi->getMuonROIs()).begin();
45
LVL1_ROI::muons_type::const_iterator itMUe = (roi->getMuonROIs()).end();
46
47
for
(; itMU != itMUe; ++itMU){
48
phi
.push_back(
DataType
( itMU->getPhi()));
49
eta
.push_back(
DataType
( itMU->getEta()));
50
51
roiWord.push_back(
DataType
( itMU->getROIWord()));
52
thrNumber.push_back(
DataType
( itMU->getThrNumber()));
53
54
// prevent empty threshold name list
55
std::string str_thrName = itMU->getThrName();
56
if
(str_thrName ==
""
){ str_thrName =
"empty"
; };
57
thrName.push_back(
DataType
( std::move(str_thrName) ));
58
thrValue.push_back(
DataType
( itMU->getThrValue()));
59
60
// 'energy' used, as all other ROIs have it
61
// Threshold value used here for 'energy'
62
energy.push_back(
DataType
( itMU->getThrValue()/CLHEP::GeV ) );
63
}
64
65
DataMap
myDataMap;
66
const
auto
ndata =
phi
.size();
67
myDataMap[
"phi"
] = std::move(
phi
);
68
myDataMap[
"eta"
] = std::move(
eta
);
69
myDataMap[
"energy"
] = std::move(energy);
70
myDataMap[
"roiWord"
] = std::move(roiWord);
71
myDataMap[
"thrNumber"
] = std::move(thrNumber);
72
myDataMap[
"thrName"
] = std::move(thrName);
73
myDataMap[
"thrValue"
] = std::move(thrValue);
74
75
//Be verbose
76
if
(
msgLvl
(MSG::DEBUG))
msg
(MSG::DEBUG) <<
dataTypeName
() <<
": "
<< ndata <<
endmsg
;
77
78
//forward data to formating tool
79
return
FormatTool->AddToEvent(
dataTypeName
(),
m_sgKey
.key(), &myDataMap);
80
}
81
}
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
TrigMuonROIRetriever.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
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::TrigMuonROIRetriever::TrigMuonROIRetriever
TrigMuonROIRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition
TrigMuonROIRetriever.cxx:13
JiveXML::TrigMuonROIRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition
TrigMuonROIRetriever.cxx:23
JiveXML::TrigMuonROIRetriever::m_sgKey
SG::ReadHandleKey< LVL1_ROI > m_sgKey
The storegate key for the LVL1 Muon RoIs.
Definition
TrigMuonROIRetriever.h:35
JiveXML::TrigMuonROIRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition
TrigMuonROIRetriever.h:31
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
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