16 const float GeV = 1000.;
71 return StatusCode::SUCCESS;
79 const EventContext& ctx = Gaudi::Hive::currentContext();
82 if (!electrons.isValid()) {
84 return StatusCode::FAILURE;
91 return StatusCode::FAILURE;
96 if (!jets.isValid()) {
98 return StatusCode::FAILURE;
107 return StatusCode::FAILURE;
117 return StatusCode::FAILURE;
119 photons = readHandle.
cptr();
127 return StatusCode::FAILURE;
129 bool checkVtx =
false;
141 ATH_MSG_DEBUG(
"No primary vertices found, cannot do overlap removal! Will return all fails.");
151#ifdef XAOD_STANDALONE
152 auto msglvl =
msg().level();
154 auto msglvl = msgLevel();
156 if(msglvl >= MSG::VERBOSE){
165 auto lockDecors = [&] (
const auto&
handler) {
175 return StatusCode::SUCCESS;
181 template<
class ContainerType>
184 for(
auto obj : container){
193 template<
class ContainerType>
197 for(
auto obj : container){
200 <<
" selected? " <<
int(selDec(*obj)));
204template<
class ObjType>
215 if(obj.pt() < m_ptCut*
GeV || std::abs(obj.eta()) > m_etaCut)
return false;
223 if(m_electronLabel.empty())
return true;
224 const SG::AuxElement::ConstAccessor<char> acc_ElectronPass(m_electronLabel);
225 if(obj.pt() < m_ptCut*
GeV || std::abs(obj.eta()) > m_etaCut)
return false;
226 if(!acc_ElectronPass(obj))
return false;
234 if(m_photonLabel.empty())
return true;
235 const SG::AuxElement::ConstAccessor<char> acc_PhotonPass(m_photonLabel);
236 if(obj.pt() < m_ptCut*
GeV || std::abs(obj.eta()) > m_etaCut)
return false;
237 if(!acc_PhotonPass(obj))
return false;
245 if(m_muonLabel.empty())
return true;
246 const SG::AuxElement::ConstAccessor<char> acc_MuonPass(m_muonLabel);
247 if(obj.pt() < m_ptCut*
GeV || std::abs(obj.eta()) > m_etaCut)
return false;
248 if(!acc_MuonPass(obj))
return false;
256 if(m_tauLabel.empty())
return true;
257 const SG::AuxElement::ConstAccessor<char> acc_TauPass(m_tauLabel);
258 if(obj.pt() < m_ptCut*
GeV || std::abs(obj.eta()) > m_etaCut)
return false;
259 if(!acc_TauPass(obj))
return false;
268 const std::string&
type)
272 for(
auto obj : container){
276 <<
" eta " << obj->eta() <<
" phi " << obj->phi()
277 <<
" overlaps " << overlaps);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
const ort::outputAccessor_t overlapAcc(outputLabel)
const ort::inputAccessor_t selectAcc(inputLabel)
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
OverlapRemovalGenUseAlg(const std::string &name, ISvcLocator *svcLoc)
Standard algorithm constructor.
DataKeyHandler< xAOD::PhotonContainer > m_photonKey
Gaudi::Property< std::string > m_electronLabel
SG::ReadHandleKey< xAOD::VertexContainer > m_vtxKey
DataKeyHandler< xAOD::MuonContainer > m_muonKey
DataKeyHandler< xAOD::ElectronContainer > m_electronKey
void applySelection(const ContainerType &container)
Simple object selection.
DataKeyHandler< xAOD::TauJetContainer > m_tauKey
Gaudi::Property< float > m_etaCut
Gaudi::Property< std::string > m_muonLabel
Gaudi::Property< bool > m_defaultValue
void printObjects(const xAOD::IParticleContainer &container, const std::string &type)
Print object info.
Gaudi::Property< float > m_ptCut
Gaudi::Property< std::string > m_selectionLabel
Label configuration --> Internal usage no data dependency needed.
Gaudi::Property< std::string > m_photonLabel
Gaudi::Property< std::string > m_bJetLabel
Gaudi::Property< std::string > m_overlapLabel
void setDefaultDecorations(const ContainerType &container)
virtual StatusCode execute()
Execute the algorithm.
Gaudi::Property< std::string > m_tauLabel
virtual StatusCode initialize()
Initialize the algorithm.
DataKeyHandler< xAOD::JetContainer > m_jetKey
bool selectObject(const ObjType &obj)
Simple object selection.
ToolHandle< ORUtils::IOverlapRemovalTool > m_orTool
Handle to the tool.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
SG::AuxElement::ConstAccessor< inputFlag_t > inputAccessor_t
Input object accessor.
SG::AuxElement::Decorator< inputFlag_t > inputDecorator_t
Input object decorator (for convenience if users want it).
SG::AuxElement::ConstAccessor< outputFlag_t > outputAccessor_t
Output object accessor (for convenience).
Jet_v1 Jet
Definition of the current "jet version".
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TauJet_v3 TauJet
Definition of the current "tau version".
Muon_v1 Muon
Reference the current persistent version:
Photon_v1 Photon
Definition of the current "egamma version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
Electron_v1 Electron
Definition of the current "egamma version".
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.
void handler(int sig)
signal handler