ATLAS Offline Software
PhysicsAnalysis
DerivationFramework
DerivationFrameworkMuons
DerivationFrameworkMuons
PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/DerivationFrameworkMuons/Utils.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef DERIVATIONFRAMEWORK_MUONUTILS_H
5
#define DERIVATIONFRAMEWORK_MUONUTILS_H
6
7
#include "
StoreGate/WriteDecorHandle.h
"
8
9
namespace
DerivationFramework
{
10
/* Small helper function to create a WriteDecorHandle which then sets the value of the first element
11
* automatically to a default value
12
*/
13
template
<
class
dType,
class
ContType>
SG::WriteDecorHandle<ContType, dType>
makeHandle
(
const
EventContext& ctx,
14
const
SG::WriteDecorHandleKey<ContType>
&
key
,
15
const
dType defValue = dType{}) {
16
SG::WriteDecorHandle<ContType, dType>
handle{
key
, ctx};
17
if
(handle->size()) handle(*handle->at(0)) = defValue;
18
return
handle;
19
}
20
}
21
#endif
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition:
StoreGate/StoreGate/WriteDecorHandleKey.h:89
DerivationFramework::makeHandle
SG::WriteDecorHandle< ContType, dType > makeHandle(const EventContext &ctx, const SG::WriteDecorHandleKey< ContType > &key, const dType defValue=dType{})
Definition:
PhysicsAnalysis/DerivationFramework/DerivationFrameworkMuons/DerivationFrameworkMuons/Utils.h:13
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition:
StoreGate/StoreGate/WriteDecorHandle.h:100
WriteDecorHandle.h
Handle class for adding a decoration to an object.
DerivationFramework
THE reconstruction tool.
Definition:
ParticleSortingAlg.h:24
mapkey::key
key
Definition:
TElectronEfficiencyCorrectionTool.cxx:37
Generated on Sat Apr 19 2025 21:22:57 for ATLAS Offline Software by
1.8.18