ATLAS Offline Software
Loading...
Searching...
No Matches
PFLeptonSelector Class Reference

#include <PFLeptonSelector.h>

Inheritance diagram for PFLeptonSelector:
Collaboration diagram for PFLeptonSelector:

Public Member Functions

 PFLeptonSelector (const std::string &name, ISvcLocator *pSvcLocator)
 Default constructor.
 ~PFLeptonSelector ()
 Default destructor.
StatusCode initialize ()
 Gaudi AthAlgorithm hooks.
StatusCode execute (const EventContext &ctx) const
StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode selectElectrons (SG::WriteHandle< ConstDataVector< xAOD::ElectronContainer > > &selectedElectronsWriteHandle, const SG::WriteHandle< ConstDataVector< CaloCellContainer > > &leptonCaloCellsWriteHandle) const
 Select electrons to use.
void storeElectronCells (const xAOD::Egamma &electron, SG::WriteHandle< ConstDataVector< CaloCellContainer > > leptonCaloCellsWriteHandle) const
 store the cells of the electrons
StatusCode selectMuons (SG::WriteHandle< ConstDataVector< xAOD::MuonContainer > > &selectedMuonsWriteHandle, const SG::WriteHandle< ConstDataVector< CaloCellContainer > > &leptonCaloCellsWriteHandle) const
 select muons to use
void storeMuonCells (const xAOD::Muon &muon, SG::WriteHandle< ConstDataVector< CaloCellContainer > > leptonCaloCellsWriteHandle) const
 store the cells of the muons
void storeLeptonCells (const xAOD::CaloCluster &theCluster, SG::WriteHandle< ConstDataVector< CaloCellContainer > > leptonCaloCellsWriteHandle) const
 puts set of lepton cells into the lepton container
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.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::ElectronContainerm_electronsReadHandleKey
 ReadHandle for the ElectronContainer to be used as input.
SG::ReadHandleKey< xAOD::MuonContainerm_muonsReadHandleKey
 ReadHandle for the MuonContainer to be used as input.
SG::WriteHandleKey< ConstDataVector< xAOD::ElectronContainer > > m_selectedElectronsWriteHandleKey
 WriteHandle for the ElectronContainer, that will be filled with electrons passing the electron ID in PFLeptonSelector::selectElectrons.
SG::WriteHandleKey< ConstDataVector< xAOD::MuonContainer > > m_selectedMuonsWriteHandleKey
 WriteHandle for the MuonContainer, that will be filled with muons passing the muon ID in PFLeptonSelector::selectMuons.
SG::WriteHandleKey< ConstDataVector< CaloCellContainer > > m_leptonCaloCellsWriteHandleKey
 WriteHandle for the CaloCellContainer, that will store calorimeter cells associated to leptons.
Gaudi::Property< bool > m_storeLeptonCells { this, "storeLeptonCells", false, "Toggle storage of lepton CaloCells" }
 Toggle storage of lepton CaloCells.
Gaudi::Property< std::string > m_electronID { this, "electronID", "LHMedium", "Select electron ID" }
Gaudi::Property< bool > m_selectElectrons { this, "selectElectrons", true, "Toggle usage of electron ID" }
 Toggle to determine whether we select any electrons or not - if selected then tracks matched to those electrons in PFTrackSelector are not used in particle flow.
Gaudi::Property< bool > m_selectMuons { this, "selectMuons", true, "Toggle usage of muon ID" }
 Toggle to determine whether we select any muons or not - if selected then tracks matched to those muons in PFTrackSelector are not used in particle flow.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 18 of file PFLeptonSelector.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ PFLeptonSelector()

PFLeptonSelector::PFLeptonSelector ( const std::string & name,
ISvcLocator * pSvcLocator )

Default constructor.

Definition at line 7 of file PFLeptonSelector.cxx.

7 :
8 AthReentrantAlgorithm(name, pSvcLocator)
9{
10}

◆ ~PFLeptonSelector()

PFLeptonSelector::~PFLeptonSelector ( )
inline

Default destructor.

Definition at line 25 of file PFLeptonSelector.h.

25{};

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode PFLeptonSelector::execute ( const EventContext & ctx) const

Definition at line 24 of file PFLeptonSelector.cxx.

24 {
25
26 SG::WriteHandle<ConstDataVector<xAOD::ElectronContainer >> selectedElectronsWriteHandle(m_selectedElectronsWriteHandleKey,ctx);
27 SG::WriteHandle<ConstDataVector<xAOD::MuonContainer> > selectedMuonsWriteHandle(m_selectedMuonsWriteHandleKey,ctx);
28 SG::WriteHandle<ConstDataVector<CaloCellContainer> > leptonCaloCellsWriteHandle(m_leptonCaloCellsWriteHandleKey,ctx);
29
30 if (recordLeptonContainers(selectedElectronsWriteHandle,selectedMuonsWriteHandle,leptonCaloCellsWriteHandle).isFailure()) {
31 return StatusCode::SUCCESS;
32 }
33
34 /* Select electrons */
36 StatusCode sc = this->selectElectrons(selectedElectronsWriteHandle,leptonCaloCellsWriteHandle);
37 //if fail to select electrons issue warning, but carry on processing event
38 if (sc.isFailure()) ATH_MSG_WARNING(" Problem selecting electrons");
39 }
40
41 /* Select muons */
42 if (m_selectMuons){
43 StatusCode sc = this->selectMuons(selectedMuonsWriteHandle,leptonCaloCellsWriteHandle);
44 //if fail to select muons issue warning, but carry on processing event
45 if (sc.isFailure()) ATH_MSG_WARNING("Problem selecting muons ");
46 }
47
48 return StatusCode::SUCCESS;
49}
#define ATH_MSG_WARNING(x)
static Double_t sc
StatusCode selectElectrons(SG::WriteHandle< ConstDataVector< xAOD::ElectronContainer > > &selectedElectronsWriteHandle, const SG::WriteHandle< ConstDataVector< CaloCellContainer > > &leptonCaloCellsWriteHandle) const
Select electrons to use.
SG::WriteHandleKey< ConstDataVector< xAOD::ElectronContainer > > m_selectedElectronsWriteHandleKey
WriteHandle for the ElectronContainer, that will be filled with electrons passing the electron ID in ...
StatusCode selectMuons(SG::WriteHandle< ConstDataVector< xAOD::MuonContainer > > &selectedMuonsWriteHandle, const SG::WriteHandle< ConstDataVector< CaloCellContainer > > &leptonCaloCellsWriteHandle) const
select muons to use
SG::WriteHandleKey< ConstDataVector< CaloCellContainer > > m_leptonCaloCellsWriteHandleKey
WriteHandle for the CaloCellContainer, that will store calorimeter cells associated to leptons.
SG::WriteHandleKey< ConstDataVector< xAOD::MuonContainer > > m_selectedMuonsWriteHandleKey
WriteHandle for the MuonContainer, that will be filled with muons passing the muon ID in PFLeptonSele...
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.
Gaudi::Property< bool > m_selectElectrons
Toggle to determine whether we select any electrons or not - if selected then tracks matched to those...
Gaudi::Property< bool > m_selectMuons
Toggle to determine whether we select any muons or not - if selected then tracks matched to those muo...
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode PFLeptonSelector::finalize ( )

Definition at line 51 of file PFLeptonSelector.cxx.

51{ return StatusCode::SUCCESS; }

◆ initialize()

StatusCode PFLeptonSelector::initialize ( )

Gaudi AthAlgorithm hooks.

Definition at line 12 of file PFLeptonSelector.cxx.

12 {
13 ATH_CHECK( m_electronsReadHandleKey.initialize() );
14 ATH_CHECK( m_muonsReadHandleKey.initialize() );
15
18
20
21 return StatusCode::SUCCESS;
22}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsReadHandleKey
ReadHandle for the ElectronContainer to be used as input.
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsReadHandleKey
ReadHandle for the MuonContainer to be used as input.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ recordLeptonContainers()

StatusCode PFLeptonSelector::recordLeptonContainers ( SG::WriteHandle< ConstDataVector< xAOD::ElectronContainer > > & selectedElectronsWriteHandle,
SG::WriteHandle< ConstDataVector< xAOD::MuonContainer > > & selectedMuonsWriteHandle,
SG::WriteHandle< ConstDataVector< CaloCellContainer > > leptonCaloCellsWriteHandle ) const
private

Put lepton containers and list of lepton cells into Storegate.

Definition at line 177 of file PFLeptonSelector.cxx.

181{
182
183 StatusCode sc = selectedElectronsWriteHandle.record(std::make_unique<ConstDataVector<xAOD::ElectronContainer >>(SG::VIEW_ELEMENTS));
184
185 if (sc.isFailure()) {
186 ATH_MSG_WARNING("Could not record electron WriteHandle with key: " << selectedElectronsWriteHandle.key());
187 return sc;
188 }
189
190 sc = selectedMuonsWriteHandle.record(std::make_unique<ConstDataVector<xAOD::MuonContainer> >(SG::VIEW_ELEMENTS));
191
192 if (sc.isFailure()) {
193 ATH_MSG_WARNING("Could not record muon WriteHandle with key: " << selectedMuonsWriteHandle.key());
194 return sc;
195 }
196
197 if (true == m_storeLeptonCells) {
198
199 //record the cell container
200 sc = leptonCaloCellsWriteHandle.record(std::make_unique<ConstDataVector<CaloCellContainer> >(SG::VIEW_ELEMENTS));
201
202 if (sc.isFailure()) {
203 ATH_MSG_WARNING("Could not record CaloCell WriteHandle with key: " << leptonCaloCellsWriteHandle);
204 return sc;
205 }
206 }
207
208 return StatusCode::SUCCESS;
209}
Gaudi::Property< bool > m_storeLeptonCells
Toggle storage of lepton CaloCells.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ selectElectrons()

StatusCode PFLeptonSelector::selectElectrons ( SG::WriteHandle< ConstDataVector< xAOD::ElectronContainer > > & selectedElectronsWriteHandle,
const SG::WriteHandle< ConstDataVector< CaloCellContainer > > & leptonCaloCellsWriteHandle ) const
private

Select electrons to use.

Definition at line 54 of file PFLeptonSelector.cxx.

57{
58
59 SG::ReadHandle<xAOD::ElectronContainer> electronsReadHandle(m_electronsReadHandleKey);
60
61 if (!electronsReadHandle.isValid()){
62 ATH_MSG_WARNING("Invalid read handle to electron container with name: " << electronsReadHandle.key());
63 return StatusCode::FAILURE;
64 }
65
66 for (const auto* theElectron : *electronsReadHandle) {
67
68 if (theElectron) {
69 if (theElectron->pt() > 10000) {
70 bool passElectronID = false;
71 bool gotID = theElectron->passSelection(passElectronID, m_electronID);
72 if (!gotID) {
73 ATH_MSG_WARNING("Could not get Electron ID");
74 continue;
75 }
76 if (passElectronID) {
77 if (selectedElectronsWriteHandle.isValid())
78 selectedElectronsWriteHandle->push_back(theElectron);
79 else
81 "Do not have valid WriteHandle for ElectronContainer with name: " << selectedElectronsWriteHandle.key());
82 if (true == m_storeLeptonCells)
83 this->storeElectronCells(*theElectron, leptonCaloCellsWriteHandle);
84 } // mediumPP
85 } // 10GeV pt cut
86 } // valid egamma pointer
87 else
88 ATH_MSG_WARNING("This electron is a NULL pointer");
89
90 } // electron loop
91
92 return StatusCode::SUCCESS;
93}
Gaudi::Property< std::string > m_electronID
void storeElectronCells(const xAOD::Egamma &electron, SG::WriteHandle< ConstDataVector< CaloCellContainer > > leptonCaloCellsWriteHandle) const
store the cells of the electrons
virtual bool isValid() override final
Can the handle be successfully dereferenced?

◆ selectMuons()

StatusCode PFLeptonSelector::selectMuons ( SG::WriteHandle< ConstDataVector< xAOD::MuonContainer > > & selectedMuonsWriteHandle,
const SG::WriteHandle< ConstDataVector< CaloCellContainer > > & leptonCaloCellsWriteHandle ) const
private

select muons to use

Definition at line 108 of file PFLeptonSelector.cxx.

110{
111
112 SG::ReadHandle<xAOD::MuonContainer> muonsReadHandle(m_muonsReadHandleKey);
113
114 if (!muonsReadHandle.isValid()) {
115 ATH_MSG_WARNING("Invalid read handle to muon container with name: " << muonsReadHandle.key());
116 return StatusCode::FAILURE;
117 }
118
119 for (const auto *theMuon : *muonsReadHandle){
120
121 // Details of medium muons are here:
122 // https://twiki.cern.ch/twiki/bin/view/Atlas/MuonSelectionTool
123 // We only care about muons with ID tracks. Of the muon types which could be medium, only Combined have ID tracks
124 // (for looser selections other muon types could have ID tracks)
125
126 xAOD::Muon::Quality muonQuality = theMuon->quality();
127 if (muonQuality <= xAOD::Muon::Medium) {
128 xAOD::Muon::MuonType muonType = theMuon->muonType();
129 if (xAOD::Muon::Combined == muonType) {
130 if (selectedMuonsWriteHandle.isValid())
131 selectedMuonsWriteHandle->push_back(theMuon);
132 else
134 "Do not have valid WriteHandle for MuonContainer with name: " << selectedMuonsWriteHandle.key());
135 if (true == m_storeLeptonCells)
136 this->storeMuonCells(*theMuon, leptonCaloCellsWriteHandle);
137 } // combined muons
138 } // Medium muons
139 } // muon loop
140
141 return StatusCode::SUCCESS;
142}
void storeMuonCells(const xAOD::Muon &muon, SG::WriteHandle< ConstDataVector< CaloCellContainer > > leptonCaloCellsWriteHandle) const
store the cells of the muons

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ storeElectronCells()

void PFLeptonSelector::storeElectronCells ( const xAOD::Egamma & electron,
SG::WriteHandle< ConstDataVector< CaloCellContainer > > leptonCaloCellsWriteHandle ) const
private

store the cells of the electrons

Definition at line 96 of file PFLeptonSelector.cxx.

98{
99
100 const xAOD::CaloCluster* electronCluster = electron.caloCluster();
101 if (electronCluster){
102 this->storeLeptonCells(*electronCluster,std::move(leptonCaloCellsWriteHandle));
103 }
104 else ATH_MSG_WARNING("This electron has an invalid pointer to its cluster");
105}
void storeLeptonCells(const xAOD::CaloCluster &theCluster, SG::WriteHandle< ConstDataVector< CaloCellContainer > > leptonCaloCellsWriteHandle) const
puts set of lepton cells into the lepton container
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ storeLeptonCells()

void PFLeptonSelector::storeLeptonCells ( const xAOD::CaloCluster & theCluster,
SG::WriteHandle< ConstDataVector< CaloCellContainer > > leptonCaloCellsWriteHandle ) const
private

puts set of lepton cells into the lepton container

Definition at line 161 of file PFLeptonSelector.cxx.

163{
164
165 const CaloClusterCellLink* theCellLink = theCluster.getCellLinks();
166
167 if (theCellLink){
168 for (const auto *theCaloCell : *theCellLink){
169 if (leptonCaloCellsWriteHandle.isValid()) leptonCaloCellsWriteHandle->push_back(theCaloCell);
170 else ATH_MSG_WARNING(" Do not have valid WriteHandle for CaloCellContaienr with name: " << leptonCaloCellsWriteHandle.key());
171 }//cell loop
172 }
173 else ATH_MSG_WARNING("This cluster has an invalid pointer to its cells, in storeLeptonCells");
174}
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)

◆ storeMuonCells()

void PFLeptonSelector::storeMuonCells ( const xAOD::Muon & muon,
SG::WriteHandle< ConstDataVector< CaloCellContainer > > leptonCaloCellsWriteHandle ) const
private

store the cells of the muons

Definition at line 145 of file PFLeptonSelector.cxx.

147{
148
149 const ElementLink<xAOD::CaloClusterContainer>& theLink = muon.clusterLink();
150 if (theLink.isValid()){
151 const xAOD::CaloCluster* muonCluster = *theLink;
152 if (muonCluster){
153 this->storeLeptonCells(*muonCluster,std::move(leptonCaloCellsWriteHandle));
154 }
155 else ATH_MSG_WARNING("This muon has an invalid pointer to its cluster ");
156 }
157 else ATH_MSG_WARNING("This muon has an invalid element link to its cluster");
158}

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_ERROR(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_electronID

Gaudi::Property<std::string> PFLeptonSelector::m_electronID { this, "electronID", "LHMedium", "Select electron ID" }
private

Definition at line 104 of file PFLeptonSelector.h.

104{ this, "electronID", "LHMedium", "Select electron ID" };

◆ m_electronsReadHandleKey

SG::ReadHandleKey<xAOD::ElectronContainer> PFLeptonSelector::m_electronsReadHandleKey
private
Initial value:
{
this,
"inputElectronsName",
"Electrons",
"ReadHandle for the ElectronContainer to be used as input"
}

ReadHandle for the ElectronContainer to be used as input.

Definition at line 60 of file PFLeptonSelector.h.

60 {
61 this,
62 "inputElectronsName",
63 "Electrons",
64 "ReadHandle for the ElectronContainer to be used as input"
65 };

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_leptonCaloCellsWriteHandleKey

SG::WriteHandleKey<ConstDataVector<CaloCellContainer> > PFLeptonSelector::m_leptonCaloCellsWriteHandleKey
private
Initial value:
{
this,
"outputLeptonCellsName",
"eflowRec_leptonCellContainer",
"WriteHandle for the CaloCellContainer, that will store calorimeter cells associated to leptons"
}

WriteHandle for the CaloCellContainer, that will store calorimeter cells associated to leptons.

Definition at line 94 of file PFLeptonSelector.h.

94 {
95 this,
96 "outputLeptonCellsName",
97 "eflowRec_leptonCellContainer",
98 "WriteHandle for the CaloCellContainer, that will store calorimeter cells associated to leptons"
99 };

◆ m_muonsReadHandleKey

SG::ReadHandleKey<xAOD::MuonContainer> PFLeptonSelector::m_muonsReadHandleKey
private
Initial value:
{ this,
"inputMuonsName",
"Muons",
"ReadHandle for the MuonContainer to be used as input" }

ReadHandle for the MuonContainer to be used as input.

Definition at line 68 of file PFLeptonSelector.h.

68 { this,
69 "inputMuonsName",
70 "Muons",
71 "ReadHandle for the MuonContainer to be used as input" };

◆ m_selectedElectronsWriteHandleKey

SG::WriteHandleKey<ConstDataVector<xAOD::ElectronContainer> > PFLeptonSelector::m_selectedElectronsWriteHandleKey
private
Initial value:
{
this,
"outputElectronsName",
"eflowRec_selectedElectrons",
"WriteHandle for the ElectronContainer, that will be filled with electrons passing the electron ID in "
"PFLeptonSelector::selectElectrons"
}

WriteHandle for the ElectronContainer, that will be filled with electrons passing the electron ID in PFLeptonSelector::selectElectrons.

Definition at line 75 of file PFLeptonSelector.h.

75 {
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 };

◆ m_selectedMuonsWriteHandleKey

SG::WriteHandleKey<ConstDataVector<xAOD::MuonContainer> > PFLeptonSelector::m_selectedMuonsWriteHandleKey
private
Initial value:
{
this,
"outputMuonsName",
"eflowRec_selectedMuons",
"WriteHandle for the MuonContainer, that will be filled with muons passing the muon ID in "
"PFLeptonSelector::selectMuons"
}

WriteHandle for the MuonContainer, that will be filled with muons passing the muon ID in PFLeptonSelector::selectMuons.

Definition at line 85 of file PFLeptonSelector.h.

85 {
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 };

◆ m_selectElectrons

Gaudi::Property<bool> PFLeptonSelector::m_selectElectrons { this, "selectElectrons", true, "Toggle usage of electron ID" }
private

Toggle to determine whether we select any electrons or not - if selected then tracks matched to those electrons in PFTrackSelector are not used in particle flow.

If not selected then an empty electron container is created, and hence PFTrackSelector won't find any electrons to match its selected tracks to.

Definition at line 110 of file PFLeptonSelector.h.

110{ this, "selectElectrons", true, "Toggle usage of electron ID" };

◆ m_selectMuons

Gaudi::Property<bool> PFLeptonSelector::m_selectMuons { this, "selectMuons", true, "Toggle usage of muon ID" }
private

Toggle to determine whether we select any muons or not - if selected then tracks matched to those muons in PFTrackSelector are not used in particle flow.

If not selected then an empty muon container is created, and hence PFTrackSelector won't find any muons to match its selected tracks to.

Definition at line 116 of file PFLeptonSelector.h.

116{ this, "selectMuons", true, "Toggle usage of muon ID" };

◆ m_storeLeptonCells

Gaudi::Property<bool> PFLeptonSelector::m_storeLeptonCells { this, "storeLeptonCells", false, "Toggle storage of lepton CaloCells" }
private

Toggle storage of lepton CaloCells.

Definition at line 102 of file PFLeptonSelector.h.

102{ this, "storeLeptonCells", false, "Toggle storage of lepton CaloCells" };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: