ATLAS Offline Software
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 
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,
15  const dType defValue = dType{}) {
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:99
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