6 #include "fastjet/ClusterSequence.hh"
7 #include "fastjet/JetDefinition.hh"
15 Dipolarity::Dipolarity(
unsigned int n1,
unsigned int n2,
bool exclusive,
double subjetR) :
16 m_exclusive(exclusive),
22 cout <<
"dipolarity was called with invalid arguments" << endl;
28 vector<fastjet::PseudoJet> constit_pseudojets =
jet.constituents();
29 if(constit_pseudojets.empty())
return -1;
31 vector<fastjet::PseudoJet> kt_subjets;
32 fastjet::PseudoJet jet1, jet2;
36 fastjet::E_scheme, fastjet::Best);
38 kt_subjets = fastjet::sorted_by_pt(kt_clust_seq.inclusive_jets(5000.0));
40 if(kt_subjets.size() <
m_n2) {
46 if(
m_n2 > constit_pseudojets.size()) {
52 fastjet::E_scheme, fastjet::Best);
54 kt_subjets = fastjet::sorted_by_pt(kt_clust_seq.exclusive_jets((
int)
m_n2));
57 jet1 = kt_subjets[
m_n1-1];
58 jet2 = kt_subjets[
m_n2-1];
59 return dipolarity(constit_pseudojets, jet1, jet2);
63 const fastjet::PseudoJet& jet1,
const fastjet::PseudoJet& jet2)
const
68 TVector2 v12(jet2.eta() - jet1.eta(), jet1.delta_phi_to(jet2));
69 if(v12.Mod2() < 0.001)
return -1;
71 for(
unsigned int iConstit = 0; iConstit < constit_pseudojets.size(); iConstit++) {
72 fastjet::PseudoJet constituent = constit_pseudojets[iConstit];
74 sumpt += constituent.perp();
78 v.Set(constituent.eta() - jet1.eta(), jet1.delta_phi_to(constituent));
79 float test =
v * v12.Unit();
83 else if(
test < v12.Mod())
86 v.Set(constituent.eta() - jet2.eta(), jet2.delta_phi_to(constituent));
91 if(sumpt < 0.001)
return -1;