ATLAS Offline Software
ElectronLRTMergingAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // ElectronLRTMergingAlg
7 // Author: Jonathan Long, jonathan.long@cern.ch
8 // Algorithm invoking std+lrt electron merger, based on the
9 // MuonLRTMergingAlg, author: Max Goblirsch-Kolb
11 
12 #ifndef ASG_ANALYSIS_ALGORITHMS__ELECTRON_LRT_MERGING_ALGORITHM__H
13 #define ASG_ANALYSIS_ALGORITHMS__ELECTRON_LRT_MERGING_ALGORITHM__H
14 
19 #include <AsgTools/ToolHandle.h>
20 
22 
28 
29 namespace CP
30 {
33  {
35  public:
36  ElectronLRTMergingAlg(const std::string &name,
37  ISvcLocator *pSvcLocator);
38 
39  public:
40  StatusCode initialize() override;
41 
42  public:
43  StatusCode execute() override;
44 
45  private:
47 
48 
50  Gaudi::Property<bool> m_createViewCollection{this, "CreateViewCollection", true, "Create a view to avoid deep copy"};
52  Gaudi::Property<bool> m_doRemoval{this, "doRemoval", true, "Remove overlapping electrons from output collection."};
54  Gaudi::Property<float> m_ORThreshold{this, "ORThreshold", 0.001, "Delta R threshold for matching in overlap removal."};
56  Gaudi::Property<int> m_ORstrategy{this, "overlapStrategy", CP::IElectronLRTOverlapRemovalTool::defaultStrategy, "Overlap removal strategy to use (0 = default)"};
59 
60  Gaudi::Property<bool> m_isDAOD{this, "isDAOD", true, "Switch for running on AOD (false) or DAOD (true)"};
62  SG::ReadHandleKey<xAOD::ElectronContainer> m_promptElectronLocation{this, "PromptElectronLocation", "Electrons", "Prompt electrons to merge"};
64  SG::ReadHandleKey<xAOD::ElectronContainer> m_lrtElectronLocation{this, "LRTElectronLocation", "ElectronsLRT", "LRT electrons to merge"};
66  SG::WriteHandleKey<xAOD::ElectronContainer> m_outElectronLocation{this, "OutputCollectionName", "StdWithLRTElectrons", "Name for combined output collection"};
68  ToolHandle<CP::IElectronLRTOverlapRemovalTool> m_overlapRemovalTool{this, "overlapRemovalTool", "", "Tool used to check overlaps between standard and LRT electrons"};
70 
72 
75  void mergeElectron(const xAOD::ElectronContainer &electronCol,
76  xAOD::ElectronContainer *outputCol,
77  const std::set<const xAOD::Electron *> &LRTElectronsToRemove) const;
78 
80  void mergeElectron(const xAOD::ElectronContainer &electronCol,
82  const std::set<const xAOD::Electron *> &LRTElectronsToRemove) const;
83  };
84 }
85 #endif
WriteHandle.h
Handle class for recording to StoreGate.
CP::ElectronLRTMergingAlg
this wraps the Electron LRT collection merger in a CP algorithm
Definition: ElectronLRTMergingAlg.h:33
PropertyWrapper.h
CP::ElectronLRTMergingAlg::m_isDAOD
Gaudi::Property< bool > m_isDAOD
Definition: ElectronLRTMergingAlg.h:60
CP::ElectronLRTMergingAlg::initialize
StatusCode initialize() override
Definition: ElectronLRTMergingAlg.cxx:26
CP::ElectronLRTMergingAlg::m_lrtElectronLocation
SG::ReadHandleKey< xAOD::ElectronContainer > m_lrtElectronLocation
Standard electron collection to be merged.
Definition: ElectronLRTMergingAlg.h:64
CP::IElectronLRTOverlapRemovalTool::defaultStrategy
@ defaultStrategy
Definition: IElectronLRTOverlapRemovalTool.h:49
CP::ElectronLRTMergingAlg::m_createViewCollection
Gaudi::Property< bool > m_createViewCollection
Protected data:
Definition: ElectronLRTMergingAlg.h:50
CurrentContext.h
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
CP::ElectronLRTMergingAlg::m_doRemoval
Gaudi::Property< bool > m_doRemoval
Create a view to avoid deep copy.
Definition: ElectronLRTMergingAlg.h:52
SG::ReadHandleKey< xAOD::ElectronContainer >
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
AnaAlgorithm.h
CP::ElectronLRTMergingAlg::m_ORstrategy
Gaudi::Property< int > m_ORstrategy
Delta R threshold for matching in overlap removal.
Definition: ElectronLRTMergingAlg.h:58
EL::AnaAlgorithm
the (new) base class for EventLoop algorithms
Definition: AnaAlgorithm.h:73
SG::WriteHandleKey< xAOD::ElectronContainer >
ElectronContainer.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
CP::ElectronLRTMergingAlg::m_outElectronLocation
SG::WriteHandleKey< xAOD::ElectronContainer > m_outElectronLocation
LRT electron collection to be merged.
Definition: ElectronLRTMergingAlg.h:66
CP::ElectronLRTMergingAlg::m_ORThreshold
Gaudi::Property< float > m_ORThreshold
Remove overlapping electrons from output collection.
Definition: ElectronLRTMergingAlg.h:54
CP::ElectronLRTMergingAlg::ElectronLRTMergingAlg
ElectronLRTMergingAlg(const std::string &name, ISvcLocator *pSvcLocator)
the standard constructor
Definition: ElectronLRTMergingAlg.cxx:21
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
IElectronLRTOverlapRemovalTool.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ReadHandle.h
Handle class for reading from StoreGate.
CP::ElectronLRTMergingAlg::m_overlapRemovalTool
ToolHandle< CP::IElectronLRTOverlapRemovalTool > m_overlapRemovalTool
Combined electron collection.
Definition: ElectronLRTMergingAlg.h:68
CP::ElectronLRTMergingAlg::execute
StatusCode execute() override
Definition: ElectronLRTMergingAlg.cxx:52
CP::ElectronLRTMergingAlg::mergeElectron
void mergeElectron(const xAOD::ElectronContainer &electronCol, xAOD::ElectronContainer *outputCol, const std::set< const xAOD::Electron * > &LRTElectronsToRemove) const
The lrt electron overlap removal tool.
Definition: ElectronLRTMergingAlg.cxx:132
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
CP::ElectronLRTMergingAlg::m_promptElectronLocation
SG::ReadHandleKey< xAOD::ElectronContainer > m_promptElectronLocation
Switches method for retrieving electron ID.
Definition: ElectronLRTMergingAlg.h:62
ToolHandle.h