25 FASTJET_BEGIN_NAMESPACE
52 std::ostringstream oss;
53 oss <<
"CMSBoostedTauSeedingAlgorithm algorithm";
62 fastjet::PseudoJet subjet1, subjet2;
63 bool hasSubjets =
jet.has_parents(subjet1, subjet2);
66 std::string depth_and_idx_string_subjet1 = depth_and_idx_string;
67 if (depth_and_idx_string_subjet1.length() > 0)
68 depth_and_idx_string_subjet1.append(
".");
69 depth_and_idx_string_subjet1.append(
"0");
70 for (
int iSpace = 0; iSpace <
depth; ++iSpace) {
73 std::cout <<
" jetConstituent #" << depth_and_idx_string_subjet1 <<
" (depth = " <<
depth
74 <<
"): Pt = " << subjet1.pt() <<
","
75 <<
" eta = " << subjet1.eta() <<
", phi = " << subjet1.phi() <<
", mass = " << subjet1.m()
76 <<
" (constituents = " << subjet1.constituents().size() <<
")" << std::endl;
78 std::string depth_and_idx_string_subjet2 = depth_and_idx_string;
79 if (depth_and_idx_string_subjet2.length() > 0)
80 depth_and_idx_string_subjet2.append(
".");
81 depth_and_idx_string_subjet2.append(
"1");
82 for (
int iSpace = 0; iSpace <
depth; ++iSpace) {
85 std::cout <<
" jetConstituent #" << depth_and_idx_string_subjet2 <<
" (depth = " <<
depth
86 <<
"): Pt = " << subjet2.pt() <<
","
87 <<
" eta = " << subjet2.eta() <<
", phi = " << subjet2.phi() <<
", mass = " << subjet2.m()
88 <<
" (constituents = " << subjet2.constituents().size() <<
")" << std::endl;
90 for (
int iSpace = 0; iSpace <
depth; ++iSpace) {
93 double dR = subjet1.delta_R(subjet2);
94 std::cout <<
" (mass-drop @ " << depth_and_idx_string <<
" = " <<
std::max(subjet1.m(), subjet2.m()) /
jet.m()
95 <<
", dR = " <<
dR <<
")" << std::endl;
99 const PseudoJet&
jet,
int depth,
bool& subjetsFound)
const {
100 const float etaMax_ = 3.0;
102 std::cout <<
"<CMSBoostedTauSeedingAlgorithm::findSubjets>:" << std::endl;
103 std::cout <<
" jet: Pt = " <<
jet.pt() <<
", eta = " <<
jet.eta() <<
", phi = " <<
jet.phi()
104 <<
", mass = " <<
jet.m() << std::endl;
107 PseudoJet subjet1, subjet2;
108 bool hasSubjets =
jet.has_parents(subjet1, subjet2);
111 if (subjet1.m2() < subjet2.m2()) {
114 double dR = subjet1.delta_R(subjet2);
115 double kT = subjet1.kt_distance(subjet2);
118 if (subjet1.pt() >
ptMin_ && fabs(subjet1.eta()) < etaMax_ && subjet2.pt() >
ptMin_ &&
122 return std::make_pair(subjet1, subjet2);
123 }
else if (subjet1.pt() >
ptMin_) {
125 }
else if (subjet2.pt() >
ptMin_) {
129 subjetsFound =
false;
130 PseudoJet dummy_subjet1, dummy_subjet2;
131 return std::make_pair(dummy_subjet1, dummy_subjet2);
136 std::cout <<
"<CMSBoostedTauSeedingAlgorithm::findSubjets>:" << std::endl;
137 std::cout <<
" jet: Pt = " <<
jet.pt() <<
", eta = " <<
jet.eta() <<
", phi = " <<
jet.phi()
138 <<
", mass = " <<
jet.m() << std::endl;
145 bool subjetsFound =
false;
146 std::pair<PseudoJet, PseudoJet> subjets =
findSubjets(
jet, 0, subjetsFound);
149 PseudoJet subjet1 = subjets.first;
150 PseudoJet subjet2 = subjets.second;
152 std::cout <<
"before recombination:" << std::endl;
153 std::cout <<
" subjet #1: Pt = " << subjet1.pt() <<
", eta = " << subjet1.eta() <<
", phi = " << subjet1.phi()
154 <<
", mass = " << subjet1.m() << std::endl;
155 std::cout <<
" subjet #2: Pt = " << subjet2.pt() <<
", eta = " << subjet2.eta() <<
", phi = " << subjet2.phi()
156 <<
", mass = " << subjet2.m() << std::endl;
159 const JetDefinition::Recombiner* rec =
jet.associated_cluster_sequence()->jet_def().recombiner();
160 PseudoJet result_local =
join(subjet1, subjet2, *rec);
162 std::cout <<
"after recombination:" << std::endl;
163 std::vector<fastjet::PseudoJet> subjets = result_local.pieces();
165 for (std::vector<fastjet::PseudoJet>::const_iterator subjet = subjets.begin(); subjet != subjets.end();
167 std::cout <<
" subjet #" << idx_subjet <<
": Pt = " << subjet->pt() <<
", eta = " << subjet->eta()
168 <<
", phi = " << subjet->phi() <<
", mass = " << subjet->m()
169 <<
" (#constituents = " << subjet->constituents().size() <<
")" << std::endl;
170 std::vector<fastjet::PseudoJet> constituents = subjet->constituents();
171 int idx_constituent = 0;
172 for (std::vector<fastjet::PseudoJet>::const_iterator constituent = constituents.begin();
173 constituent != constituents.end();
175 if (constituent->pt() < 1.e-3)
177 std::cout <<
" constituent #" << idx_constituent <<
": Pt = " << constituent->pt()
178 <<
", eta = " << constituent->eta() <<
", phi = " << constituent->phi() <<
","
179 <<
" mass = " << constituent->m() << std::endl;
189 s->_y = (
jet.m2() > 0.) ? subjet1.kt_distance(subjet2) /
jet.m2() : 0.;
190 s->_dR = subjet1.delta_R(subjet2);
191 s->_pt = subjet2.pt();
193 result_local.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(
s));
199 std::cout <<
"No subjets found." << std::endl;
207 FASTJET_END_NAMESPACE