ATLAS Offline Software
JetSeedBuilder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef XAOD_ANALYSIS
6 
7 #include "JetSeedBuilder.h"
8 
9 #include "xAODJet/Jet.h"
10 #include "xAODJet/JetContainer.h"
13 #include "xAODTau/TauJet.h"
14 
15 //______________________________________________________________________________
16 JetSeedBuilder::JetSeedBuilder(const std::string& name) :
18 }
19 
20 //______________________________________________________________________________
22 }
23 
24 //______________________________________________________________________________
26 
27  if ( pTau.jet() == nullptr) {
28  ATH_MSG_ERROR("Tau jet link is invalid.");
29  return StatusCode::FAILURE;
30  }
31 
32  const xAOD::Jet* jetSeed = pTau.jet();
33 
34  ATH_MSG_DEBUG("seed is Jet with"
35  << " pt=" << jetSeed->pt()
36  << " eta=" << jetSeed->eta()
37  << " phi=" << jetSeed->phi());
38 
39  // Do not set eta phi for negative energy jet in trigger
40  // For other case, pt is reset to be at least 1e-7.
41  if (inTrigger() && jetSeed->e() < 0) {
42  ATH_MSG_DEBUG("TauJet eta/phi will be set in Level2 Trigger for negative energy jet");
43  pTau.setP4(jetSeed->pt(),pTau.eta(),pTau.phi(),0.0);
44  }
45  else {
46  if ( jetSeed->pt() > 1e-7) {
47  pTau.setP4(jetSeed->pt(), jetSeed->eta(), jetSeed->phi(), 0.0);
48  }
49  else {
50  pTau.setP4(static_cast<float>(1e-7), jetSeed->eta(), jetSeed->phi(), 0.0);
51  }
52 
53  pTau.setP4(xAOD::TauJetParameters::JetSeed, jetSeed->pt(), jetSeed->eta(), jetSeed->phi(), jetSeed->m());
54  }
55 
56  return StatusCode::SUCCESS;
57 }
58 
59 #endif
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Jet.h
xAOD::TauJet_v3::jet
const Jet * jet() const
xAOD::TauJet_v3::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
JetSeedBuilder.h
TauRecToolBase
The base class for all tau tools.
Definition: TauRecToolBase.h:21
xAOD::Jet_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: Jet_v1.cxx:54
TauRecToolBase::inTrigger
bool inTrigger() const
Definition: TauRecToolBase.h:87
xAOD::TauJet_v3::setP4
void setP4(double pt, double eta, double phi, double m)
Set methods for IParticle values.
Definition: TauJet_v3.cxx:172
xAOD::TauJetParameters::JetSeed
@ JetSeed
Definition: TauDefs.h:336
TauJetAuxContainer.h
xAOD::TauJet_v3::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
JetSeedBuilder::~JetSeedBuilder
virtual ~JetSeedBuilder()
Destructor.
Definition: JetSeedBuilder.cxx:21
JetSeedBuilder::JetSeedBuilder
JetSeedBuilder(const std::string &name)
Constructor.
Definition: JetSeedBuilder.cxx:16
TauJetContainer.h
xAOD::Jet_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: Jet_v1.cxx:49
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
JetSeedBuilder::execute
virtual StatusCode execute(xAOD::TauJet &pTau) const override
Executation of this tool.
Definition: JetSeedBuilder.cxx:25
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
JetContainer.h
xAOD::Jet_v1::e
virtual double e() const
The total energy of the particle.
Definition: Jet_v1.cxx:63
TauJet.h
xAOD::Jet_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: Jet_v1.cxx:44