|
ATLAS Offline Software
|
Go to the documentation of this file.
21 return StatusCode::SUCCESS;
30 if (
recordLeptonContainers(selectedElectronsWriteHandle,selectedMuonsWriteHandle,leptonCaloCellsWriteHandle).isFailure()) {
31 return StatusCode::SUCCESS;
48 return StatusCode::SUCCESS;
61 if (!electronsReadHandle.
isValid()){
62 ATH_MSG_WARNING(
"Invalid read handle to electron container with name: " << electronsReadHandle.
key());
63 return StatusCode::FAILURE;
66 for (
const auto* theElectron : *electronsReadHandle) {
69 if (theElectron->pt() > 10000) {
70 bool passElectronID =
false;
71 bool gotID = theElectron->passSelection(passElectronID,
m_electronID);
77 if (selectedElectronsWriteHandle.isValid())
78 selectedElectronsWriteHandle->push_back(theElectron);
81 "Do not have valid WriteHandle for ElectronContainer with name: " << selectedElectronsWriteHandle.key());
92 return StatusCode::SUCCESS;
101 if (electronCluster){
102 this->
storeLeptonCells(*electronCluster,std::move(leptonCaloCellsWriteHandle));
104 else ATH_MSG_WARNING(
"This electron has an invalid pointer to its cluster");
114 if (!muonsReadHandle.
isValid()) {
115 ATH_MSG_WARNING(
"Invalid read handle to muon container with name: " << muonsReadHandle.
key());
116 return StatusCode::FAILURE;
119 for (
const auto *theMuon : *muonsReadHandle){
126 xAOD::Muon::Quality muonQuality = theMuon->quality();
128 xAOD::Muon::MuonType muonType = theMuon->muonType();
130 if (selectedMuonsWriteHandle.isValid())
131 selectedMuonsWriteHandle->push_back(theMuon);
134 "Do not have valid WriteHandle for MuonContainer with name: " << selectedMuonsWriteHandle.key());
141 return StatusCode::SUCCESS;
155 else ATH_MSG_WARNING(
"This muon has an invalid pointer to its cluster ");
157 else ATH_MSG_WARNING(
"This muon has an invalid element link to its cluster");
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());
173 else ATH_MSG_WARNING(
"This cluster has an invalid pointer to its cells, in storeLeptonCells");
185 if (
sc.isFailure()) {
186 ATH_MSG_WARNING(
"Could not record electron WriteHandle with key: " << selectedElectronsWriteHandle.key());
192 if (
sc.isFailure()) {
193 ATH_MSG_WARNING(
"Could not record muon WriteHandle with key: " << selectedMuonsWriteHandle.key());
202 if (
sc.isFailure()) {
203 ATH_MSG_WARNING(
"Could not record CaloCell WriteHandle with key: " << leptonCaloCellsWriteHandle);
208 return StatusCode::SUCCESS;
StatusCode selectElectrons(SG::WriteHandle< ConstDataVector< xAOD::ElectronContainer >> &selectedElectronsWriteHandle, const SG::WriteHandle< ConstDataVector< CaloCellContainer >> &leptonCaloCellsWriteHandle) const
Select electrons to use.
PFLeptonSelector(const std::string &name, ISvcLocator *pSvcLocator)
Default constructor.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Gaudi::Property< bool > m_storeLeptonCells
Toggle storage of lepton CaloCells.
SG::WriteHandleKey< ConstDataVector< xAOD::ElectronContainer > > m_selectedElectronsWriteHandleKey
WriteHandle for the ElectronContainer, that will be filled with electrons passing the electron ID in ...
bool isValid() const
Test to see if the link can be dereferenced.
An algorithm that can be simultaneously executed in multiple threads.
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
void storeElectronCells(const xAOD::Egamma &electron, SG::WriteHandle< ConstDataVector< CaloCellContainer >> leptonCaloCellsWriteHandle) const
store the cells of the electrons
Description of a calorimeter cluster.
StatusCode execute(const EventContext &ctx) const
StatusCode initialize()
Gaudi AthAlgorithm hooks.
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Property< std::string > m_electronID
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
SG::WriteHandleKey< ConstDataVector< xAOD::MuonContainer > > m_selectedMuonsWriteHandleKey
WriteHandle for the MuonContainer, that will be filled with muons passing the muon ID in PFLeptonSele...
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
void storeMuonCells(const xAOD::Muon &muon, SG::WriteHandle< ConstDataVector< CaloCellContainer >> leptonCaloCellsWriteHandle) const
store the cells of the muons
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_selectMuons
Toggle to determine whether we select any muons or not - if selected then tracks matched to those muo...
SG::WriteHandleKey< ConstDataVector< CaloCellContainer > > m_leptonCaloCellsWriteHandleKey
WriteHandle for the CaloCellContainer, that will store calorimeter cells associated to leptons.
#define ATH_MSG_WARNING(x)
DataVector adapter that acts like it holds const pointers.
StatusCode selectMuons(SG::WriteHandle< ConstDataVector< xAOD::MuonContainer >> &selectedMuonsWriteHandle, const SG::WriteHandle< ConstDataVector< CaloCellContainer >> &leptonCaloCellsWriteHandle) const
select muons to use
void storeLeptonCells(const xAOD::CaloCluster &theCluster, SG::WriteHandle< ConstDataVector< CaloCellContainer >> leptonCaloCellsWriteHandle) const
puts set of lepton cells into the lepton container
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.
Gaudi::Property< bool > m_selectElectrons
Toggle to determine whether we select any electrons or not - if selected then tracks matched to those...