28 const std::string& name, ISvcLocator* loc)
41 return StatusCode::SUCCESS;
45 const EventContext& ctx)
const {
48 if (!jets.isValid()) {
51 return StatusCode::FAILURE;
64 std::vector<const xAOD::TruthParticle*> leptons;
66 auto collectLeptons = [&](
69 if (key.empty())
return;
71 if (!container.isValid())
return;
74 if (tp->status() != 1)
continue;
75 if (tp->pt() < ptMin)
continue;
76 if (std::abs(tp->eta()) > absEtaMax)
continue;
77 unsigned int o = origin(*tp);
78 if (o != MC::WBoson && o != MC::ZBoson && o != MC::top)
continue;
79 leptons.push_back(tp);
90 if (
jet->p4().DeltaR(lep->p4()) < drCut) {
95 decOverlap(*
jet) = hasOverlap;
98 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading a decoration on an object.
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKey< xAOD::JetContainer > m_jetKey
JetOverlapLeptonDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthElectronKey
Gaudi::Property< float > m_ptMinimum
Gaudi::Property< float > m_absEtaMaximum
SG::WriteDecorHandleKey< xAOD::JetContainer > m_dec_hasOverlapLepton
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthMuonKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_truthElectronOriginKey
Gaudi::Property< float > m_overlapDR
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_truthMuonOriginKey
virtual StatusCode execute(const EventContext &ctx) const override
virtual StatusCode initialize() override
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Handle class for reading a decoration on an object.
Property holding a SG store/key/clid from which a ReadHandle is made.
Handle class for adding a decoration to an object.
Jet_v1 Jet
Definition of the current "jet version".
TruthParticle_v1 TruthParticle
Typedef to implementation.