ATLAS Offline Software
KtDeltaR.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "fastjet/ClusterSequence.hh"
7 #include "fastjet/JetDefinition.hh"
9 #include <math.h>
10 #include <cmath>
11 using namespace std;
12 using namespace JetSubStructureUtils;
13 
14 double KtDeltaR::result(const fastjet::PseudoJet &jet) const
15 {
16  vector<fastjet::PseudoJet> constit_pseudojets = jet.constituents();
17  if ( constit_pseudojets.size() < 2 ) {
18  //Jet has fewer than 2 constituents.
19  return 0.0;
20  }
21 
22  fastjet::JetDefinition jetdef = fastjet::JetDefinition(fastjet::kt_algorithm, m_jetrad);
23  fastjet::ClusterSequence cs(constit_pseudojets, jetdef);
24  std::vector<fastjet::PseudoJet> outjets = cs.exclusive_jets(2);
25  if ( outjets.size() < 2 ) {
26  //"Fewer than two subjets found.
27  return 0.0;
28  }
29 
30  return xAOD::P4Helpers::deltaR(outjets[0].eta(), outjets[0].phi(),
31  outjets[1].eta(), outjets[1].phi());
32 }
get_generator_info.result
result
Definition: get_generator_info.py:21
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
xAOD::JetAlgorithmType::kt_algorithm
@ kt_algorithm
Definition: JetContainerInfo.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
xAODP4Helpers.h
JetSubStructureUtils
Definition: Angularity.h:10
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
jet::ClusterSequence
fastjet::ClusterSequence ClusterSequence
Definition: ClusterSequence.h:21
xAOD::P4Helpers::deltaR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Definition: xAODP4Helpers.h:150
KtDeltaR.h