ATLAS Offline Software
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 
6 #include "StoreGate/ReadHandle.h"
7 
8 
10  const std::string& name,
11  const IInterface * 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 }
SeedJetBuilder::m_jetContainerName
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerName
Definition: SeedJetBuilder.h:35
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
xAOD::DiTauJet_v1::setJet
void setJet(const xAOD::JetContainer *cont, const xAOD::Jet *jet)
Definition: DiTauJet_v1.cxx:82
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::DiTauJet_v1::setDetail
void setDetail(DiTauJetParameters::Detail detail, int value)
Definition: DiTauJet_v1.cxx:373
xAOD::DiTauJetParameters::R_jet
@ R_jet
Definition: DiTauDefs.h:41
xAOD::DiTauJetParameters::R_core
@ R_core
Definition: DiTauDefs.h:43
xAOD::Jet_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: Jet_v1.cxx:54
xAOD::DiTauJet_v1::setP4
void setP4(double pt, double eta, double phi, double m)
Set methods for IParticle values.
Definition: DiTauJet_v1.cxx:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SeedJetBuilder::initialize
virtual StatusCode initialize() override
Tool initializer.
Definition: SeedJetBuilder.cxx:21
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::ReadHandle::get
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::Jet_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: Jet_v1.cxx:49
SeedJetBuilder::execute
virtual StatusCode execute(DiTauCandidateData *data, const EventContext &ctx) const override
Execute - called for each Ditau candidate.
Definition: SeedJetBuilder.cxx:28
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
SeedJetBuilder.h
DiTauToolBase
The base class for all tau tools.
Definition: DiTauToolBase.h:20
xAOD::DiTauJetParameters::R_subjet
@ R_subjet
Definition: DiTauDefs.h:42
xAOD::DiTauJet_v1::jetLink
const JetLink_t & jetLink() const
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
xAOD::Jet_v1::m
virtual double m() const
The invariant mass of the particle.
Definition: Jet_v1.cxx:59
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::DiTauJet_v1
Definition: DiTauJet_v1.h:31
DiTauCandidateData
Definition: DiTauCandidateData.h:15
ReadHandle.h
Handle class for reading from StoreGate.
SeedJetBuilder::~SeedJetBuilder
virtual ~SeedJetBuilder()
Destructor.
xAOD::Jet_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: Jet_v1.cxx:44
SeedJetBuilder::SeedJetBuilder
SeedJetBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: SeedJetBuilder.cxx:9