ATLAS Offline Software
PFLeptonSelector.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef PFLEPTONSELECTOR_H
5 #define PFLEPTONSELECTOR_H
6 
11 #include "StoreGate/DataHandle.h"
12 
14 #include "xAODMuon/MuonContainer.h"
15 
16 class CaloCellContainer;
17 
19 {
20 
21 public:
23  PFLeptonSelector(const std::string& name, ISvcLocator* pSvcLocator);
26 
29  StatusCode execute(const EventContext& ctx) const;
31 
32 private:
35  const SG::WriteHandle<ConstDataVector<CaloCellContainer>>& leptonCaloCellsWriteHandle) const;
36 
39  SG::WriteHandle<ConstDataVector<CaloCellContainer>> leptonCaloCellsWriteHandle) const;
40 
43  const SG::WriteHandle<ConstDataVector<CaloCellContainer>>& leptonCaloCellsWriteHandle) const;
44 
46  void storeMuonCells(const xAOD::Muon& muon,
47  SG::WriteHandle<ConstDataVector<CaloCellContainer>> leptonCaloCellsWriteHandle) const;
48 
50  void storeLeptonCells(const xAOD::CaloCluster& theCluster,
51  SG::WriteHandle<ConstDataVector<CaloCellContainer>> leptonCaloCellsWriteHandle) const;
52 
55  SG::WriteHandle<ConstDataVector<xAOD::ElectronContainer>>& selectedElectronsWriteHandle,
56  SG::WriteHandle<ConstDataVector<xAOD::MuonContainer>>& selectedMuonsWriteHandle,
57  SG::WriteHandle<ConstDataVector<CaloCellContainer>> leptonCaloCellsWriteHandle) const;
58 
61  this,
62  "inputElectronsName",
63  "Electrons",
64  "ReadHandle for the ElectronContainer to be used as input"
65  };
66 
69  "inputMuonsName",
70  "Muons",
71  "ReadHandle for the MuonContainer to be used as input" };
72 
76  this,
77  "outputElectronsName",
78  "eflowRec_selectedElectrons",
79  "WriteHandle for the ElectronContainer, that will be filled with electrons passing the electron ID in "
80  "PFLeptonSelector::selectElectrons"
81  };
82 
86  this,
87  "outputMuonsName",
88  "eflowRec_selectedMuons",
89  "WriteHandle for the MuonContainer, that will be filled with muons passing the muon ID in "
90  "PFLeptonSelector::selectMuons"
91  };
92 
95  this,
96  "outputLeptonCellsName",
97  "eflowRec_leptonCellContainer",
98  "WriteHandle for the CaloCellContainer, that will store calorimeter cells associated to leptons"
99  };
100 
102  Gaudi::Property<bool> m_storeLeptonCells{ this, "storeLeptonCells", false, "Toggle storage of lepton CaloCells" };
103 
104  Gaudi::Property<std::string> m_electronID{ this, "electronID", "LHMedium", "Select electron ID" };
105 
110  Gaudi::Property<bool> m_selectElectrons{ this, "selectElectrons", true, "Toggle usage of electron ID" };
111 
116  Gaudi::Property<bool> m_selectMuons{ this, "selectMuons", true, "Toggle usage of muon ID" };
117 };
118 #endif
PFLeptonSelector::selectElectrons
StatusCode selectElectrons(SG::WriteHandle< ConstDataVector< xAOD::ElectronContainer >> &selectedElectronsWriteHandle, const SG::WriteHandle< ConstDataVector< CaloCellContainer >> &leptonCaloCellsWriteHandle) const
Select electrons to use.
Definition: PFLeptonSelector.cxx:54
PFLeptonSelector::PFLeptonSelector
PFLeptonSelector(const std::string &name, ISvcLocator *pSvcLocator)
Default constructor.
Definition: PFLeptonSelector.cxx:7
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
PFLeptonSelector::finalize
StatusCode finalize()
Definition: PFLeptonSelector.cxx:51
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
PFLeptonSelector::m_storeLeptonCells
Gaudi::Property< bool > m_storeLeptonCells
Toggle storage of lepton CaloCells.
Definition: PFLeptonSelector.h:102
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
SG::ReadHandleKey< xAOD::ElectronContainer >
DataHandle.h
PFLeptonSelector::m_selectedElectronsWriteHandleKey
SG::WriteHandleKey< ConstDataVector< xAOD::ElectronContainer > > m_selectedElectronsWriteHandleKey
WriteHandle for the ElectronContainer, that will be filled with electrons passing the electron ID in ...
Definition: PFLeptonSelector.h:75
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
PFLeptonSelector::storeElectronCells
void storeElectronCells(const xAOD::Egamma &electron, SG::WriteHandle< ConstDataVector< CaloCellContainer >> leptonCaloCellsWriteHandle) const
store the cells of the electrons
Definition: PFLeptonSelector.cxx:96
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
PFLeptonSelector::execute
StatusCode execute(const EventContext &ctx) const
Definition: PFLeptonSelector.cxx:24
ElectronContainer.h
PFLeptonSelector::initialize
StatusCode initialize()
Gaudi AthAlgorithm hooks.
Definition: PFLeptonSelector.cxx:12
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PFLeptonSelector::m_electronID
Gaudi::Property< std::string > m_electronID
Definition: PFLeptonSelector.h:104
PFLeptonSelector::~PFLeptonSelector
~PFLeptonSelector()
Default destructor.
Definition: PFLeptonSelector.h:25
AthReentrantAlgorithm.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
PFLeptonSelector::m_selectedMuonsWriteHandleKey
SG::WriteHandleKey< ConstDataVector< xAOD::MuonContainer > > m_selectedMuonsWriteHandleKey
WriteHandle for the MuonContainer, that will be filled with muons passing the muon ID in PFLeptonSele...
Definition: PFLeptonSelector.h:85
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
MuonContainer.h
PFLeptonSelector::storeMuonCells
void storeMuonCells(const xAOD::Muon &muon, SG::WriteHandle< ConstDataVector< CaloCellContainer >> leptonCaloCellsWriteHandle) const
store the cells of the muons
Definition: PFLeptonSelector.cxx:145
PFLeptonSelector::recordLeptonContainers
StatusCode recordLeptonContainers(SG::WriteHandle< ConstDataVector< xAOD::ElectronContainer >> &selectedElectronsWriteHandle, SG::WriteHandle< ConstDataVector< xAOD::MuonContainer >> &selectedMuonsWriteHandle, SG::WriteHandle< ConstDataVector< CaloCellContainer >> leptonCaloCellsWriteHandle) const
Put lepton containers and list of lepton cells into Storegate.
Definition: PFLeptonSelector.cxx:177
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
PFLeptonSelector::m_selectMuons
Gaudi::Property< bool > m_selectMuons
Toggle to determine whether we select any muons or not - if selected then tracks matched to those muo...
Definition: PFLeptonSelector.h:116
PFLeptonSelector::m_leptonCaloCellsWriteHandleKey
SG::WriteHandleKey< ConstDataVector< CaloCellContainer > > m_leptonCaloCellsWriteHandleKey
WriteHandle for the CaloCellContainer, that will store calorimeter cells associated to leptons.
Definition: PFLeptonSelector.h:94
ConstDataVector
DataVector adapter that acts like it holds const pointers.
Definition: ConstDataVector.h:76
PFLeptonSelector::selectMuons
StatusCode selectMuons(SG::WriteHandle< ConstDataVector< xAOD::MuonContainer >> &selectedMuonsWriteHandle, const SG::WriteHandle< ConstDataVector< CaloCellContainer >> &leptonCaloCellsWriteHandle) const
select muons to use
Definition: PFLeptonSelector.cxx:108
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
PFLeptonSelector::storeLeptonCells
void storeLeptonCells(const xAOD::CaloCluster &theCluster, SG::WriteHandle< ConstDataVector< CaloCellContainer >> leptonCaloCellsWriteHandle) const
puts set of lepton cells into the lepton container
Definition: PFLeptonSelector.cxx:161
PFLeptonSelector::m_electronsReadHandleKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsReadHandleKey
ReadHandle for the ElectronContainer to be used as input.
Definition: PFLeptonSelector.h:60
PFLeptonSelector::m_muonsReadHandleKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsReadHandleKey
ReadHandle for the MuonContainer to be used as input.
Definition: PFLeptonSelector.h:68
PFLeptonSelector
Definition: PFLeptonSelector.h:19
PFLeptonSelector::m_selectElectrons
Gaudi::Property< bool > m_selectElectrons
Toggle to determine whether we select any electrons or not - if selected then tracks matched to those...
Definition: PFLeptonSelector.h:110