ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkInDet
src
UnassociatedHitsDecorator.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Author: Olivier Arnaez ( olivier.arnaez@cern.ch )
6
7
#include "
DerivationFrameworkInDet/UnassociatedHitsDecorator.h
"
8
#include "
DerivationFrameworkInDet/DecoratorUtils.h
"
9
#include "
AthenaBaseComps/AthMsgStreamMacros.h
"
10
11
#include <vector>
12
#include <utility>
13
#include <string>
14
15
namespace
DerivationFramework
{
16
17
StatusCode
UnassociatedHitsDecorator::initialize
()
18
{
19
20
if
(
m_sgName
.empty()) {
21
ATH_MSG_WARNING
(
"No decoration prefix name provided for the output of UnassociatedHitsDecorator!"
);
22
}
23
24
if
(
m_eventInfoKey
.empty()) {
25
ATH_MSG_ERROR
(
"No EventInfo collection provided for UnassociatedHitsDecorator!"
);
26
return
StatusCode::FAILURE;
27
}
28
ATH_CHECK
(
m_eventInfoKey
.initialize() );
29
// retrieve PRD association tool
30
ATH_CHECK
(
m_UnassociatedHitsGetterTool
.retrieve() );
31
32
{
// FIXME DecorHandleKeys should be properly configured in the python layer
33
std::vector<std::string> names;
34
names.resize(
kNIntDecor
);
35
names[
knPixelUADecor
] =
"nPixelUA"
;
36
names[
knBlayerUADecor
] =
"nBlayerUA"
;
37
names[
knPixelBarrelUADecor
] =
"nPixelBarrelUA"
;
38
names[
knPixelEndCapAUADecor
] =
"nPixelEndCapAUA"
;
39
names[
knPixelEndCapCUADecor
] =
"nPixelEndCapCUA"
;
40
names[
knSCTUADecor
] =
"nSCTUA"
;
41
names[
knSCTBarrelUADecor
] =
"nSCTBarrelUA"
;
42
names[
knSCTEndCapAUADecor
] =
"nSCTEndCapAUA"
;
43
names[
knSCTEndCapCUADecor
] =
"nSCTEndCapCUA"
;
44
names[
knTRTUADecor
] =
"nTRTUA"
;
45
names[
knTRTBarrelUADecor
] =
"nTRTBarrelUA"
;
46
names[
knTRTEndCapAUADecor
] =
"nTRTEndCapAUA"
;
47
names[
knTRTEndCapCUADecor
] =
"nTRTEndCapCUA"
;
48
createDecoratorKeys
(*
this
,
m_eventInfoKey
,
m_sgName
, names,
m_intDecorKeys
);
49
}
50
return
StatusCode::SUCCESS;
51
}
52
53
54
StatusCode
UnassociatedHitsDecorator::addBranches
(
const
EventContext& ctx)
const
55
{
56
ATH_MSG_DEBUG
(
"Adding unassociated hits info to EventInfo"
);
57
58
SG::ReadHandle<xAOD::EventInfo>
eventInfo(
m_eventInfoKey
,ctx);
59
CHECK
( eventInfo.
isValid
() ? StatusCode::SUCCESS : StatusCode::FAILURE );
60
61
const
MinBiasPRDAssociation
* prdAssoc =
m_UnassociatedHitsGetterTool
->get(ctx);
62
std::vector<SG::WriteDecorHandle<xAOD::EventInfo,int> >
63
intDecorators =
createDecorators<xAOD::EventInfo,int>
(
m_intDecorKeys
,ctx);
64
if
(prdAssoc) {
65
intDecorators[
knPixelUADecor
](*eventInfo) = prdAssoc->
nPixelUA
;
66
intDecorators[
knBlayerUADecor
](*eventInfo) = prdAssoc->
nBlayerUA
;
67
intDecorators[
knPixelBarrelUADecor
](*eventInfo) = prdAssoc->
nPixelBarrelUA
;
68
intDecorators[
knPixelEndCapAUADecor
](*eventInfo) = prdAssoc->
nPixelEndCapAUA
;
69
intDecorators[
knPixelEndCapCUADecor
](*eventInfo) = prdAssoc->
nPixelEndCapCUA
;
70
intDecorators[
knSCTUADecor
](*eventInfo) = prdAssoc->
nSCTUA
;
71
intDecorators[
knSCTBarrelUADecor
](*eventInfo) = prdAssoc->
nSCTBarrelUA
;
72
intDecorators[
knSCTEndCapAUADecor
](*eventInfo) = prdAssoc->
nSCTEndCapAUA
;
73
intDecorators[
knSCTEndCapCUADecor
](*eventInfo) = prdAssoc->
nSCTEndCapCUA
;
74
intDecorators[
knTRTUADecor
](*eventInfo) = prdAssoc->
nTRTUA
;
75
intDecorators[
knTRTBarrelUADecor
](*eventInfo) = prdAssoc->
nTRTBarrelUA
;
76
intDecorators[
knTRTEndCapAUADecor
](*eventInfo) = prdAssoc->
nTRTEndCapAUA
;
77
intDecorators[
knTRTEndCapCUADecor
](*eventInfo) = prdAssoc->
nTRTEndCapCUA
;
78
79
ATH_MSG_DEBUG
(
"Decorating unassociated hits with nPixelBarrelUA = "
);
80
ATH_MSG_DEBUG
(prdAssoc->
nPixelBarrelUA
);
81
82
m_UnassociatedHitsGetterTool
->releaseObject(prdAssoc);
83
}
84
else
85
ATH_MSG_WARNING
(
"Could not retrieve Unassociated hits information"
);
86
87
return
StatusCode::SUCCESS;
88
}
89
90
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
AthMsgStreamMacros.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DecoratorUtils.h
UnassociatedHitsDecorator.h
DerivationFramework::UnassociatedHitsDecorator::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition
UnassociatedHitsDecorator.cxx:54
DerivationFramework::UnassociatedHitsDecorator::knTRTUADecor
@ knTRTUADecor
Definition
UnassociatedHitsDecorator.h:56
DerivationFramework::UnassociatedHitsDecorator::knPixelEndCapAUADecor
@ knPixelEndCapAUADecor
Definition
UnassociatedHitsDecorator.h:50
DerivationFramework::UnassociatedHitsDecorator::knSCTEndCapCUADecor
@ knSCTEndCapCUADecor
Definition
UnassociatedHitsDecorator.h:55
DerivationFramework::UnassociatedHitsDecorator::knPixelBarrelUADecor
@ knPixelBarrelUADecor
Definition
UnassociatedHitsDecorator.h:49
DerivationFramework::UnassociatedHitsDecorator::knTRTEndCapCUADecor
@ knTRTEndCapCUADecor
Definition
UnassociatedHitsDecorator.h:59
DerivationFramework::UnassociatedHitsDecorator::knPixelUADecor
@ knPixelUADecor
Definition
UnassociatedHitsDecorator.h:47
DerivationFramework::UnassociatedHitsDecorator::knPixelEndCapCUADecor
@ knPixelEndCapCUADecor
Definition
UnassociatedHitsDecorator.h:51
DerivationFramework::UnassociatedHitsDecorator::kNIntDecor
@ kNIntDecor
Definition
UnassociatedHitsDecorator.h:60
DerivationFramework::UnassociatedHitsDecorator::knSCTBarrelUADecor
@ knSCTBarrelUADecor
Definition
UnassociatedHitsDecorator.h:53
DerivationFramework::UnassociatedHitsDecorator::knBlayerUADecor
@ knBlayerUADecor
Definition
UnassociatedHitsDecorator.h:48
DerivationFramework::UnassociatedHitsDecorator::knSCTEndCapAUADecor
@ knSCTEndCapAUADecor
Definition
UnassociatedHitsDecorator.h:54
DerivationFramework::UnassociatedHitsDecorator::knTRTEndCapAUADecor
@ knTRTEndCapAUADecor
Definition
UnassociatedHitsDecorator.h:58
DerivationFramework::UnassociatedHitsDecorator::knSCTUADecor
@ knSCTUADecor
Definition
UnassociatedHitsDecorator.h:52
DerivationFramework::UnassociatedHitsDecorator::knTRTBarrelUADecor
@ knTRTBarrelUADecor
Definition
UnassociatedHitsDecorator.h:57
DerivationFramework::UnassociatedHitsDecorator::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition
UnassociatedHitsDecorator.h:42
DerivationFramework::UnassociatedHitsDecorator::initialize
virtual StatusCode initialize() override final
Definition
UnassociatedHitsDecorator.cxx:17
DerivationFramework::UnassociatedHitsDecorator::m_intDecorKeys
std::vector< SG::WriteDecorHandleKey< xAOD::EventInfo > > m_intDecorKeys
Definition
UnassociatedHitsDecorator.h:61
DerivationFramework::UnassociatedHitsDecorator::m_UnassociatedHitsGetterTool
ToolHandle< IUnassociatedHitsGetterTool > m_UnassociatedHitsGetterTool
Definition
UnassociatedHitsDecorator.h:45
DerivationFramework::UnassociatedHitsDecorator::m_sgName
Gaudi::Property< std::string > m_sgName
Definition
UnassociatedHitsDecorator.h:39
MinBiasPRDAssociation
Definition
MinBiasPRDAssociation.h:11
MinBiasPRDAssociation::nSCTEndCapAUA
int nSCTEndCapAUA
Definition
MinBiasPRDAssociation.h:26
MinBiasPRDAssociation::nBlayerUA
int nBlayerUA
Definition
MinBiasPRDAssociation.h:19
MinBiasPRDAssociation::nTRTEndCapCUA
int nTRTEndCapCUA
Definition
MinBiasPRDAssociation.h:32
MinBiasPRDAssociation::nTRTEndCapAUA
int nTRTEndCapAUA
Definition
MinBiasPRDAssociation.h:31
MinBiasPRDAssociation::nTRTUA
int nTRTUA
Definition
MinBiasPRDAssociation.h:29
MinBiasPRDAssociation::nPixelUA
int nPixelUA
Definition
MinBiasPRDAssociation.h:18
MinBiasPRDAssociation::nSCTEndCapCUA
int nSCTEndCapCUA
Definition
MinBiasPRDAssociation.h:27
MinBiasPRDAssociation::nPixelEndCapCUA
int nPixelEndCapCUA
Definition
MinBiasPRDAssociation.h:22
MinBiasPRDAssociation::nPixelBarrelUA
int nPixelBarrelUA
Definition
MinBiasPRDAssociation.h:20
MinBiasPRDAssociation::nPixelEndCapAUA
int nPixelEndCapAUA
Definition
MinBiasPRDAssociation.h:21
MinBiasPRDAssociation::nSCTUA
int nSCTUA
Definition
MinBiasPRDAssociation.h:24
MinBiasPRDAssociation::nSCTBarrelUA
int nSCTBarrelUA
Definition
MinBiasPRDAssociation.h:25
MinBiasPRDAssociation::nTRTBarrelUA
int nTRTBarrelUA
Definition
MinBiasPRDAssociation.h:30
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
DerivationFramework::createDecorators
std::vector< SG::WriteDecorHandle< T_Cont, T > > createDecorators(const std::vector< SG::WriteDecorHandleKey< T_Cont > > &keys, const EventContext &ctx)
Definition
DecoratorUtils.h:51
DerivationFramework::createDecoratorKeys
void createDecoratorKeys(T_Parent &parent, const SG::ReadHandleKey< T_Cont > &container_key, const std::string &prefix, const std::vector< std::string > &decor_names, std::vector< SG::WriteDecorHandleKey< T_Cont > > &decor_out)
Definition
DecoratorUtils.h:20
Generated on
for ATLAS Offline Software by
1.17.0