ATLAS Offline Software
Loading...
Searching...
No Matches
JetSeedBuilder.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef XAOD_ANALYSIS
6
7#include "JetSeedBuilder.h"
8
9//______________________________________________________________________________
10JetSeedBuilder::JetSeedBuilder(const std::string& name) :
11 TauRecToolBase(name) {}
12
13//______________________________________________________________________________
15
16//______________________________________________________________________________
17StatusCode JetSeedBuilder::execute(xAOD::TauJet& pTau) const {
18
19 if ( pTau.jet() == nullptr) {
20 ATH_MSG_ERROR("Tau jet link is invalid.");
21 return StatusCode::FAILURE;
22 }
23
24 const xAOD::Jet* jetSeed = pTau.jet();
25
26 ATH_MSG_DEBUG("seed is Jet with"
27 << " pt=" << jetSeed->pt()
28 << " eta=" << jetSeed->eta()
29 << " phi=" << jetSeed->phi());
30
31 // Do not set eta phi for negative energy jet in trigger
32 // For other case, pt is reset to be at least 1e-7.
33 if (inTrigger() && jetSeed->e() < 0) {
34 ATH_MSG_DEBUG("TauJet eta/phi will be set in Level2 Trigger for negative energy jet");
35 pTau.setP4(jetSeed->pt(),pTau.eta(),pTau.phi(),0.0);
36 }
37 else {
38 if ( jetSeed->pt() > 1e-7) {
39 pTau.setP4(jetSeed->pt(), jetSeed->eta(), jetSeed->phi(), 0.0);
40 }
41 else {
42 pTau.setP4(static_cast<float>(1e-7), jetSeed->eta(), jetSeed->phi(), 0.0);
43 }
44
45 pTau.setP4(xAOD::TauJetParameters::JetSeed, jetSeed->pt(), jetSeed->eta(), jetSeed->phi(), jetSeed->m());
46 }
47
48 return StatusCode::SUCCESS;
49}
50
51#endif
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
JetSeedBuilder(const std::string &name)
Constructor.
virtual StatusCode execute(xAOD::TauJet &pTau) const override
Executation of this tool.
virtual ~JetSeedBuilder()
Destructor.
TauRecToolBase(const std::string &name)
bool inTrigger() const
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
virtual double e() const
The total energy of the particle.
Definition Jet_v1.cxx:63
virtual double phi() const
The azimuthal angle ( ) of the particle.
void setP4(double pt, double eta, double phi, double m)
Set methods for IParticle values.
const Jet * jet() const
virtual double eta() const
The pseudorapidity ( ) of the particle.
Jet_v1 Jet
Definition of the current "jet version".
TauJet_v3 TauJet
Definition of the current "tau version".