ATLAS Offline Software
ZCut.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include "fastjet/ClusterSequence.hh"
8 #include "fastjet/JetDefinition.hh"
9 
10 using namespace std;
11 using namespace JetSubStructureUtils;
12 
13 double ZCut::result(const fastjet::PseudoJet &jet) const
14 {
15  vector<fastjet::PseudoJet> constit_pseudojets = jet.constituents();
16  if(constit_pseudojets.empty()) return -1;
17 
18  fastjet::JetDefinition jet_def = fastjet::JetDefinition(fastjet::kt_algorithm, 1.5,
19  fastjet::E_scheme, fastjet::Best);
20  fastjet::ClusterSequence kt_clust_seq(constit_pseudojets, jet_def);
21 
22  if(constit_pseudojets.size() < m_nSubJets) {
23  //We were asked to calculate zCut, but there are not enough constituents
24  return 0.0;
25  }
26  vector<fastjet::PseudoJet> subjets = kt_clust_seq.exclusive_jets((int)m_nSubJets);
27 
28  // Find last split jet (cluster_hist_index should be highest for the last created jet)
29  fastjet::PseudoJet *lastSplitSubjet = nullptr;
30  int max_cluster_hist_index = -1;
31  for(size_t iSubjet=0; iSubjet < subjets.size(); iSubjet++) {
32  fastjet::PseudoJet parent1, parent2;
33  if(kt_clust_seq.has_parents(subjets[iSubjet], parent1, parent2) &&
34  subjets[iSubjet].cluster_hist_index() > max_cluster_hist_index) {
35  max_cluster_hist_index = subjets[iSubjet].cluster_hist_index();
36  lastSplitSubjet = &subjets[iSubjet];
37  }
38  }
39 
40  if(lastSplitSubjet == nullptr) {
41  //None of the subjets were split
42  return 0.0;
43  }
44 
45  KtSplittingScale split(m_nSubJets);
46  double dmin = pow(split.result(jet), 2.0);
47 
48  double zcut = -1;
49  if(dmin == 0)
50  zcut = 0;
51  else
52  zcut = dmin / (dmin + lastSplitSubjet->m2());
53 
54  return zcut;
55 }
ZCut.h
KtSplittingScale.h
get_generator_info.result
result
Definition: get_generator_info.py:21
JetSubStructureUtils::KtSplittingScale
Definition: KtSplittingScale.h:11
xAOD::JetAlgorithmType::kt_algorithm
@ kt_algorithm
Definition: JetContainerInfo.h:31
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
JetSubStructureUtils
Definition: Angularity.h:10
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
jet::ClusterSequence
fastjet::ClusterSequence ClusterSequence
Definition: ClusterSequence.h:21
Trk::split
@ split
Definition: LayerMaterialProperties.h:38