ATLAS Offline Software
Loading...
Searching...
No Matches
SeedJetBuilder.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
7
8
10 const std::string& name,
11 const IInterface * parent) :
12 DiTauToolBase(type, name, parent)
13{
14 declareInterface<DiTauToolBase > (this);
15}
16
17
19
20
22 ATH_CHECK( m_jetContainerName.initialize() );
23
24 return StatusCode::SUCCESS;
25}
26
27
29 const EventContext& ctx) const {
30
31 ATH_MSG_DEBUG("jet seed finder executing...");
32
33 xAOD::DiTauJet* pDiTau = data->xAODDiTau;
34
35 if (pDiTau == nullptr) {
36 ATH_MSG_ERROR("no di-tau candidate given");
37 return StatusCode::FAILURE;
38 }
39
40 const xAOD::Jet* pSeed = data->seed;
41 if (!pSeed) {
42 ATH_MSG_WARNING("no seed given. Di-Tau can not be reconstructed.");
43 return StatusCode::FAILURE;
44 }
45
46 // TODO: check if seed is already used?
47
48 ATH_MSG_DEBUG("ditau candidate: pt: "<<pSeed->pt()<< " eta: "<<pSeed->eta()<< " phi: "<<pSeed->phi()<< " m: "<<pSeed->m());
49 pDiTau->setP4(pSeed->pt(), pSeed->eta(), pSeed->phi(), pSeed->m());
50
51 // retrieve jet container
53
54 pDiTau->setJet(pJetCont.get(), pSeed);
55
56 if (pDiTau->jetLink().isValid()) {
57 ATH_MSG_DEBUG("assciated seed jet with"
58 <<" pt:" << (*pDiTau->jetLink())->pt()
59 <<" eta:" << (*pDiTau->jetLink())->eta()
60 <<" phi:" << (*pDiTau->jetLink())->phi() );
61 }
62 else
63 ATH_MSG_WARNING("jet link could not be registered");
64
65 if (data->Rjet == 0 || data->Rsubjet == 0 || data->Rcore == 0 ||
66 data->Rjet < data->Rsubjet || data->Rsubjet < data->Rcore ) {
67 ATH_MSG_WARNING("ditau radius parameters are not set correctly." <<
68 " R_jet: " << data->Rjet <<
69 " R_subjet: " << data->Rsubjet <<
70 " R_core: " << data->Rcore);
71 }
72
73 pDiTau->setDetail(xAOD::DiTauJetParameters::R_jet, static_cast<float>(data->Rjet));
74 pDiTau->setDetail(xAOD::DiTauJetParameters::R_subjet, static_cast<float>(data->Rsubjet));
75 pDiTau->setDetail(xAOD::DiTauJetParameters::R_core, static_cast<float>(data->Rcore));
76
77 return StatusCode::SUCCESS;
78}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Handle class for reading from StoreGate.
DiTauToolBase(const std::string &type, const std::string &name, const IInterface *parent)
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
SeedJetBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerName
virtual ~SeedJetBuilder()
Destructor.
virtual StatusCode execute(DiTauCandidateData *data, const EventContext &ctx) const override
Execute - called for each Ditau candidate.
virtual StatusCode initialize() override
Tool initializer.
void setP4(double pt, double eta, double phi, double m)
Set methods for IParticle values.
const JetLink_t & jetLink() const
void setDetail(DiTauJetParameters::Detail detail, int value)
void setJet(const xAOD::JetContainer *cont, const xAOD::Jet *jet)
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition Jet_v1.cxx:54
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44
virtual double m() const
The invariant mass of the particle.
Definition Jet_v1.cxx:59
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49
Jet_v1 Jet
Definition of the current "jet version".
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition DiTauJet.h:17