ATLAS Offline Software
Loading...
Searching...
No Matches
JetBottomUpSoftDrop.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// JetBottomUpSoftDrop.cxx
6
8#include <iomanip>
9#include "fastjet/PseudoJet.hh"
10#include "fastjet/JetDefinition.hh"
11#include "fastjet/Selector.hh"
12#include "fastjet/tools/Filter.hh"
14
15
16using std::setw;
17using fastjet::PseudoJet;
19
20//**********************************************************************
21
23 : AsgTool(name), m_bld("",this) {
24 declareProperty("ZCut", m_zcut =0.1);
25 declareProperty("Beta", m_beta =0.0);
26 declareProperty("R0", m_R0 =1.0);
27 declareProperty("JetBuilder", m_bld);
28}
29
30//**********************************************************************
31
33
34//**********************************************************************
35
37 if ( m_zcut < 0.0 || m_zcut > 10.0 ) {
38 ATH_MSG_ERROR("Invalid value for ZCut " << m_zcut);
39 return StatusCode::FAILURE;
40 }
41 if ( m_beta < 0.0 || m_beta > 10.0 ) {
42 ATH_MSG_ERROR("Invalid value for Beta " << m_beta);
43 return StatusCode::FAILURE;
44 }
45 if ( m_R0 < 0.0 || m_R0 > 10.0 ) {
46 ATH_MSG_ERROR("Invalid value for R0 " << m_R0);
47 return StatusCode::FAILURE;
48 }
49 if ( m_bld.empty() ) {
50 ATH_MSG_ERROR("Unable to retrieve jet builder.");
51 return StatusCode::FAILURE;
52 }
53 return StatusCode::SUCCESS;
54}
55
56//**********************************************************************
57
59 const PseudoJetContainer& pjContainer,
60 xAOD::JetContainer& jets) const {
61 if ( pseudojetRetriever() == nullptr ) {
62 ATH_MSG_WARNING("Pseudojet retriever is null.");
63 return 1;
64 }
65 const PseudoJet* ppjin = pseudojetRetriever()->pseudojet(jin);
66 if ( ppjin == nullptr ) {
67 ATH_MSG_WARNING("Jet does not have a pseudojet.");
68 return 1;
69 }
70
72 //configure bottom up soft drop tool
73 //https://fastjet.hepforge.org/trac/browser/contrib/contribs/RecursiveTools/tags/2.0.0-beta1
75 fastjet::contrib::BottomUpSoftDrop softdropper(m_beta, m_zcut, m_R0);
76 PseudoJet pjsoftdrop = softdropper(*ppjin);
77 int npsoftdrop = pjsoftdrop.pieces().size();
78 xAOD::Jet* pjet = m_bld->add(pjsoftdrop, pjContainer, jets, &jin);
79 if ( pjet == nullptr ) {
80 ATH_MSG_ERROR("Unable to add jet to container");
81 return 1;
82 }
83 pjet->setAttribute<float>("ZCut", m_zcut);
84 pjet->setAttribute<float>("SoftDropBeta", m_beta);
85 pjet->setAttribute<float>("SoftDropR0", m_R0);
86 pjet->setAttribute<int>("NSoftDropSubjets", npsoftdrop);
87
88 ATH_MSG_DEBUG("Properties after softdrop:");
89 ATH_MSG_DEBUG(" ncon: " << pjsoftdrop.constituents().size() << "/"
90 << ppjin->constituents().size());
91 ATH_MSG_DEBUG(" nsub: " << npsoftdrop);
92
93 ATH_MSG_DEBUG("Added jet to container.");
94
95 return 0;
96}
97
98//**********************************************************************
99
101 ATH_MSG_INFO(" Asymmetry measure min: " << m_zcut);
102 ATH_MSG_INFO(" Angular exponent: " << m_beta);
103 ATH_MSG_INFO(" Characteristic jet radius: " << m_R0);
104 ATH_MSG_INFO(" Jet builder: " << m_bld.name());
105}
106
107//**********************************************************************
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual const IJetPseudojetRetriever * pseudojetRetriever() const
Return the pseudojet retriever associated with this tool.
virtual const fastjet::PseudoJet * pseudojet(const xAOD::Jet &jet) const =0
Retrieve the pseudojet associate with a jet.
JetBottomUpSoftDrop(const std::string &name)
void print() const
Print the state of the tool.
int groom(const xAOD::Jet &jin, const PseudoJetContainer &, xAOD::JetContainer &jout) const
Transform jet.
ToolHandle< IJetFromPseudojet > m_bld
StatusCode initialize()
Dummy implementation of the initialisation function.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
void setAttribute(const std::string &name, const T &v)
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".