ATLAS Offline Software
SeedJetBuilder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include "StoreGate/ReadHandle.h"
9 
10 
12  const std::string& name,
13  const IInterface * parent) :
15 {
16  declareInterface<DiTauToolBase > (this);
17 }
18 
19 
21 
22 
24  ATH_CHECK( m_jetContainerName.initialize() );
25 
26  return StatusCode::SUCCESS;
27 }
28 
29 
31  const EventContext& ctx) const {
32 
33  ATH_MSG_DEBUG("jet seed finder executing...");
34 
35  xAOD::DiTauJet* pDiTau = data->xAODDiTau;
36 
37  if (pDiTau == nullptr) {
38  ATH_MSG_ERROR("no di-tau candidate given");
39  return StatusCode::FAILURE;
40  }
41 
42  const xAOD::Jet* pSeed = data->seed;
43  if (!pSeed) {
44  ATH_MSG_WARNING("no seed given. Di-Tau can not be reconstructed.");
45  return StatusCode::FAILURE;
46  }
47 
48  // TODO: check if seed is already used?
49 
50  ATH_MSG_DEBUG("ditau candidate: pt: "<<pSeed->pt()<< " eta: "<<pSeed->eta()<< " phi: "<<pSeed->phi()<< " m: "<<pSeed->m());
51  pDiTau->setP4(pSeed->pt(), pSeed->eta(), pSeed->phi(), pSeed->m());
52 
53  // retrieve jet container
55 
56  pDiTau->setJet(pJetCont.get(), pSeed);
57 
58  if (pDiTau->jetLink().isValid()) {
59  ATH_MSG_DEBUG("assciated seed jet with"
60  <<" pt:" << (*pDiTau->jetLink())->pt()
61  <<" eta:" << (*pDiTau->jetLink())->eta()
62  <<" phi:" << (*pDiTau->jetLink())->phi() );
63  }
64  else
65  ATH_MSG_WARNING("jet link could not be registered");
66 
67  if (data->Rjet == 0 || data->Rsubjet == 0 || data->Rcore == 0 ||
68  data->Rjet < data->Rsubjet || data->Rsubjet < data->Rcore ) {
69  ATH_MSG_WARNING("ditau radius parameters are not set correctly." <<
70  " R_jet: " << data->Rjet <<
71  " R_subjet: " << data->Rsubjet <<
72  " R_core: " << data->Rcore);
73  }
74 
75  pDiTau->setDetail(xAOD::DiTauJetParameters::R_jet, static_cast<float>(data->Rjet));
76  pDiTau->setDetail(xAOD::DiTauJetParameters::R_subjet, static_cast<float>(data->Rsubjet));
77  pDiTau->setDetail(xAOD::DiTauJetParameters::R_core, static_cast<float>(data->Rcore));
78 
79  return StatusCode::SUCCESS;
80 }
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
DiTauToolBase.h
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::DiTauJet_v1::setDetail
void setDetail(DiTauJetParameters::Detail detail, int value)
Definition: DiTauJet_v1.cxx:373
DiTauCandidateData.h
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:23
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:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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:11