197 #include "fastjet/ClusterSequenceArea.hh" 198 #include "fastjet/tools/JetMedianBackgroundEstimator.hh" 199 #include "fastjet/tools/GridMedianBackgroundEstimator.hh" 200 #include "fastjet/Selector.hh" 212 #include "CmdLine.hh" 216 #include "fastjet/config.h" 220 #ifdef FASTJET_ENABLE_PLUGIN_SISCONE 221 #include "fastjet/SISConePlugin.hh" 222 #include "fastjet/SISConeSphericalPlugin.hh" 224 #ifdef FASTJET_ENABLE_PLUGIN_CDFCONES 225 #include "fastjet/CDFMidPointPlugin.hh" 226 #include "fastjet/CDFJetCluPlugin.hh" 228 #ifdef FASTJET_ENABLE_PLUGIN_PXCONE 229 #include "fastjet/PxConePlugin.hh" 231 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNIICONE 232 #include "fastjet/D0RunIIConePlugin.hh" 234 #ifdef FASTJET_ENABLE_PLUGIN_TRACKJET 235 #include "fastjet/TrackJetPlugin.hh" 237 #ifdef FASTJET_ENABLE_PLUGIN_ATLASCONE 238 #include "fastjet/ATLASConePlugin.hh" 240 #ifdef FASTJET_ENABLE_PLUGIN_EECAMBRIDGE 241 #include "fastjet/EECambridgePlugin.hh" 243 #ifdef FASTJET_ENABLE_PLUGIN_JADE 244 #include "fastjet/JadePlugin.hh" 246 #ifdef FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE 247 #include "fastjet/CMSIterativeConePlugin.hh" 249 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNICONE 250 #include "fastjet/D0RunIpre96ConePlugin.hh" 251 #include "fastjet/D0RunIConePlugin.hh" 253 #ifdef FASTJET_ENABLE_PLUGIN_GRIDJET 254 #include "fastjet/GridJetPlugin.hh" 264 using namespace fjcore;
267 inline double pow2(
const double x) {
return x*x;}
270 void print_jets_and_sub (
const vector<PseudoJet> & jets,
double dcut);
278 enum SubType {subtype_internal, subtype_newclust_dcut, subtype_newclust_R};
280 void do_compare_strategy(
int iev,
281 const vector<PseudoJet> & particles,
284 int compare_strategy);
294 bool ee_print =
false;
295 void print_jets(
const vector<PseudoJet> & jets,
bool show_const =
false);
297 bool found_unavailable =
false;
298 void is_unavailable(
const string & algname) {
299 cerr << algname <<
" requested, but not available for this compilation" << endl;
300 found_unavailable =
true;
307 int main (
int argc,
char ** argv) {
309 ClusterSequence::print_banner();
311 CmdLine cmdline(argc,argv);
312 cmdline_p = &cmdline;
317 cmdline.int_val(
"-clever", Best)));
318 int repeat = cmdline.int_val(
"-repeat",1);
319 int combine = cmdline.int_val(
"-combine",1);
320 bool write = cmdline.present(
"-write");
321 bool unique_write = cmdline.present(
"-unique_write");
322 bool hydjet = cmdline.present(
"-hydjet");
323 double ktR = cmdline.double_val(
"-r",1.0);
324 ktR = cmdline.double_val(
"-R",ktR);
325 double inclkt = cmdline.double_val(
"-incl",-1.0);
326 double repeatinclkt = cmdline.double_val(
"-repeat-incl",-1.0);
327 int excln = cmdline.int_val (
"-excln",-1);
328 double excld = cmdline.double_val(
"-excld",-1.0);
329 double excly = cmdline.double_val(
"-excly",-1.0);
330 ee_print = cmdline.present(
"-ee-print");
331 bool get_all_dij = cmdline.present(
"-get-all-dij");
332 bool get_all_yij = cmdline.present(
"-get-all-yij");
333 double subdcut = cmdline.double_val(
"-subdcut",-1.0);
334 double rapmax = cmdline.double_val(
"-rapmax",1.0e305);
335 if (cmdline.present(
"-etamax")) {
336 cerr <<
"WARNING: -etamax options actually sets maximum rapidity (and overrides -rapmax)\n";
337 rapmax = cmdline.double_val(
"-etamax");
339 bool show_constituents = cmdline.present(
"-const");
340 bool massless = cmdline.present(
"-massless");
341 int nev = cmdline.int_val(
"-nev",1);
342 int skip = cmdline.int_val(
"-skip",0);
343 bool add_dense_coverage = cmdline.present(
"-dense");
344 double ghost_maxrap = cmdline.value(
"-ghost-maxrap",5.0);
345 bool all_algs = cmdline.present(
"-all-algs");
350 int compare_strategy = cmdline.value<
int>(
"-compare-strategy",
plugin_strategy);
353 Selector particles_sel = (cmdline.present(
"-nhardest"))
355 : SelectorIdentity();
357 do_areas = cmdline.present(
"-area");
363 cmdline.value(
"-area:repeat", 1),
364 cmdline.value(
"-ghost-area", 0.01));
365 if (cmdline.present(
"-area:fj2")) ghost_spec.set_fj2_placement(
true);
366 if (cmdline.present(
"-area:explicit")) {
367 area_def =
AreaDefinition(active_area_explicit_ghosts, ghost_spec);
368 }
else if (cmdline.present(
"-area:passive")) {
370 }
else if (cmdline.present(
"-area:voronoi")) {
371 double Rfact = cmdline.value<
double>(
"-area:voronoi");
375 cmdline.present(
"-area:active");
383 bool do_bkgd = cmdline.present(
"-bkgd");
385 bool do_bkgd_csab =
false, do_bkgd_jetmedian =
false, do_bkgd_fj2 =
false;
386 bool do_bkgd_gridmedian =
false;
390 if (cmdline.present(
"-bkgd:csab")) {do_bkgd_csab =
true;}
391 else if (cmdline.present(
"-bkgd:jetmedian")) {do_bkgd_jetmedian =
true;
392 do_bkgd_fj2 = cmdline.present(
"-bkgd:fj2");
393 }
else if (cmdline.present(
"-bkgd:gridmedian")) {do_bkgd_gridmedian =
true;
395 throw Error(
"with the -bkgd option, some particular background must be specified (csab or jetmedian)");
397 assert(do_areas || do_bkgd_gridmedian);
403 bool show_cones = cmdline.present(
"-cones");
407 double overlap_threshold = cmdline.double_val(
"-overlap",0.5);
408 overlap_threshold = cmdline.double_val(
"-f",overlap_threshold);
409 double seed_threshold = cmdline.double_val(
"-seed",1.0);
416 double ycut = cmdline.double_val(
"-ycut",0.08);
419 rootfile = cmdline.value<
string>(
"-root",
"");
427 vector<JetDefinition> jet_defs;
428 if (all_algs || cmdline.present(
"-cam") || cmdline.present(
"-CA")) {
429 jet_defs.push_back(
JetDefinition(cambridge_algorithm, ktR, scheme, strategy));
431 if (all_algs || cmdline.present(
"-antikt")) {
432 jet_defs.push_back(
JetDefinition(antikt_algorithm, ktR, scheme, strategy));
434 if (all_algs || cmdline.present(
"-genkt")) {
436 if (cmdline.present(
"-genkt")) p = cmdline.value<
double>(
"-genkt");
438 jet_defs.push_back(
JetDefinition(genkt_algorithm, ktR, p, scheme, strategy));
440 if (all_algs || cmdline.present(
"-eekt")) {
443 if (all_algs || cmdline.present(
"-eegenkt")) {
445 if (cmdline.present(
"-eegenkt")) p = cmdline.value<
double>(
"-eegenkt");
447 jet_defs.push_back(
JetDefinition(ee_genkt_algorithm, ktR, p, scheme, strategy));
451 if (all_algs || cmdline.present(
"-midpoint")) {
452 #ifdef FASTJET_ENABLE_PLUGIN_CDFCONES 454 double cone_area_fraction = 1.0;
455 int max_pair_size = 2;
456 int max_iterations = 100;
457 MPPlug::SplitMergeScale sm_scale = MPPlug::SM_pt;
458 if (cmdline.present(
"-sm-pttilde")) sm_scale = MPPlug::SM_pttilde;
459 if (cmdline.present(
"-sm-pt")) sm_scale = MPPlug::SM_pt;
460 if (cmdline.present(
"-sm-mt")) sm_scale = MPPlug::SM_mt;
461 if (cmdline.present(
"-sm-Et")) sm_scale = MPPlug::SM_Et;
464 cone_area_fraction, max_pair_size,
465 max_iterations, overlap_threshold,
467 #else // FASTJET_ENABLE_PLUGIN_CDFCONES 468 is_unavailable(
"MidPoint");
469 #endif // FASTJET_ENABLE_PLUGIN_CDFCONES 471 if (all_algs || cmdline.present(
"-pxcone")) {
472 #ifdef FASTJET_ENABLE_PLUGIN_PXCONE 473 double min_jet_energy = 5.0;
476 overlap_threshold)));
477 #else // FASTJET_ENABLE_PLUGIN_PXCONE 478 is_unavailable(
"PxCone");
479 #endif // FASTJET_ENABLE_PLUGIN_PXCONE 481 if (all_algs || cmdline.present(
"-jetclu")) {
482 #ifdef FASTJET_ENABLE_PLUGIN_CDFCONES 484 ktR, overlap_threshold, seed_threshold)));
485 #else // FASTJET_ENABLE_PLUGIN_CDFCONES 486 is_unavailable(
"JetClu");
487 #endif // FASTJET_ENABLE_PLUGIN_CDFCONES 489 if (all_algs || cmdline.present(
"-siscone") || cmdline.present(
"-sisconespheri")) {
490 #ifdef FASTJET_ENABLE_PLUGIN_SISCONE 492 int npass = cmdline.value(
"-npass",0);
493 if (all_algs || cmdline.present(
"-siscone")) {
494 double sisptmin = cmdline.value(
"-sisptmin",0.0);
495 SISPlug * plugin =
new SISPlug (ktR, overlap_threshold,npass,sisptmin);
496 if (cmdline.present(
"-sm-pt")) plugin->set_split_merge_scale(SISPlug::SM_pt);
497 if (cmdline.present(
"-sm-mt")) plugin->set_split_merge_scale(SISPlug::SM_mt);
498 if (cmdline.present(
"-sm-Et")) plugin->set_split_merge_scale(SISPlug::SM_Et);
499 if (cmdline.present(
"-sm-pttilde")) plugin->set_split_merge_scale(SISPlug::SM_pttilde);
501 plugin->set_use_jet_def_recombiner(
true);
504 if (all_algs || cmdline.present(
"-sisconespheri")) {
505 double sisEmin = cmdline.value(
"-sisEmin",0.0);
508 if (cmdline.present(
"-ghost-sep")) {
509 plugin->set_ghost_separation_scale(cmdline.value<
double>(
"-ghost-sep"));
513 #else // FASTJET_ENABLE_PLUGIN_SISCONE 514 is_unavailable(
"SISCone");
515 #endif // FASTJET_ENABLE_PLUGIN_SISCONE 517 if (all_algs || cmdline.present(
"-d0runiicone")) {
518 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNIICONE 519 double min_jet_Et = 6.0;
521 #else // FASTJET_ENABLE_PLUGIN_D0RUNIICONE 522 is_unavailable(
"D0RunIICone");
523 #endif // FASTJET_ENABLE_PLUGIN_D0RUNIICONE 525 if (all_algs || cmdline.present(
"-trackjet")) {
526 #ifdef FASTJET_ENABLE_PLUGIN_TRACKJET 528 #else // FASTJET_ENABLE_PLUGIN_TRACKJET 529 is_unavailable(
"TrackJet");
530 #endif // FASTJET_ENABLE_PLUGIN_TRACKJET 532 if (all_algs || cmdline.present(
"-atlascone")) {
533 #ifdef FASTJET_ENABLE_PLUGIN_ATLASCONE 535 #else // FASTJET_ENABLE_PLUGIN_ATLASCONE 536 is_unavailable(
"ATLASCone");
537 #endif // FASTJET_ENABLE_PLUGIN_ATLASCONE 539 if (all_algs || cmdline.present(
"-eecambridge")) {
540 #ifdef FASTJET_ENABLE_PLUGIN_EECAMBRIDGE 542 #else // FASTJET_ENABLE_PLUGIN_EECAMBRIDGE 543 is_unavailable(
"EECambridge");
544 #endif // FASTJET_ENABLE_PLUGIN_EECAMBRIDGE 546 if (all_algs || cmdline.present(
"-jade")) {
547 #ifdef FASTJET_ENABLE_PLUGIN_JADE 550 JadePlugin::strategy_NNFJN2Plain));
552 #else // FASTJET_ENABLE_PLUGIN_JADE 553 is_unavailable(
"Jade");
554 #endif // FASTJET_ENABLE_PLUGIN_JADE 556 if (all_algs || cmdline.present(
"-cmsiterativecone")) {
557 #ifdef FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE 559 #else // FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE 560 is_unavailable(
"CMSIterativeCone");
561 #endif // FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE 563 if (all_algs || cmdline.present(
"-d0runipre96cone")) {
564 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNICONE 566 #else // FASTJET_ENABLE_PLUGIN_D0RUNICONE 567 is_unavailable(
"D0RunIpre96Cone");
568 #endif // FASTJET_ENABLE_PLUGIN_D0RUNICONE 570 if (all_algs || cmdline.present(
"-d0runicone")) {
571 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNICONE 573 #else // FASTJET_ENABLE_PLUGIN_D0RUNICONE 574 is_unavailable(
"D0RunICone");
575 #endif // FASTJET_ENABLE_PLUGIN_D0RUNICONE 577 if (all_algs || cmdline.present(
"-gridjet")) {
578 #ifdef FASTJET_ENABLE_PLUGIN_GRIDJET 586 double grid_ymax = 4.9999999999;
588 #else // FASTJET_ENABLE_PLUGIN_GRIDJET 589 is_unavailable(
"GridJet");
590 #endif // FASTJET_ENABLE_PLUGIN_GRIDJET 594 cmdline.present(
"-kt") ||
595 (jet_defs.size() == 0 && !found_unavailable)) {
596 jet_defs.push_back(
JetDefinition(kt_algorithm, ktR, E_scheme, strategy));
599 string filename = cmdline.value<
string>(
"-file",
"");
602 if (!cmdline.all_options_used()) {cerr <<
603 "Error: some options were not recognized"<<endl;
606 for (
unsigned idef = 0; idef < jet_defs.size(); idef++) {
609 if (filename ==
"") istr = &cin;
610 else istr =
new ifstream(filename.c_str());
612 for (
int iev = 0; iev < nev; iev++) {
613 vector<PseudoJet> jets;
614 vector<PseudoJet> particles;
617 while (getline(*istr, line)) {
619 istringstream linestream(line);
620 if (line ==
"#END") {
622 if (ndone == combine) {
break;}
624 if (line.substr(0,1) ==
"#") {
continue;}
625 valarray<double> fourvec(4);
630 int ii, istat,id,m1,m2,d1,d2;
632 linestream >> ii>> istat >>
id >> m1 >> m2 >> d1 >> d2
633 >> fourvec[0] >> fourvec[1] >> fourvec[2] >> mass;
636 fourvec[3] = sqrt(+pow2(fourvec[0])+pow2(fourvec[1])
637 +pow2(fourvec[2])+pow2(mass));
641 linestream >> fourvec[0] >> fourvec[1] >> fourvec[2];
642 fourvec[3] = sqrt(pow2(fourvec[0])+pow2(fourvec[1])+pow2(fourvec[2]));}
644 linestream >> fourvec[0] >> fourvec[1] >> fourvec[2] >> fourvec[3];
648 if (abs(psjet.rap()) < rapmax) {particles.push_back(psjet);}
655 if (add_dense_coverage) {
660 ghosted_area_spec.set_grid_scatter(0.5);
661 ghosted_area_spec.add_ghosts(particles);
683 add_dense_coverage =
false;
687 particles = particles_sel(particles);
690 if (iev < skip)
continue;
692 for (
int irepeat = 0; irepeat < repeat ; irepeat++) {
693 int nparticles = particles.size();
704 if (compare_strategy != plugin_strategy) {
705 do_compare_strategy(iev, particles, jet_def, *clust_seq, compare_strategy);
709 if (repeatinclkt >= 0.0) {
713 if (irepeat != 0) {
continue;}
714 cout <<
"iev "<<iev<<
": number of particles = "<< nparticles << endl;
718 if (do_areas && iev == 0) cout <<
"Area definition: " << area_def.description() << endl;
729 cout <<
"Printing "<<excln<<
" exclusive jets\n";
734 cout <<
"Printing exclusive jets for d = "<<excld<<
"\n";
739 cout <<
"Printing exclusive jets for ycut = "<<excly<<
"\n";
744 for (
int i = nparticles-1; i >= 0; i--) {
745 printf(
"d for n = %4d -> %4d is %14.5e\n", i+1, i, clust_seq->
exclusive_dmerge(i));
749 for (
int i = nparticles-1; i >= 0; i--) {
750 printf(
"y for n = %4d -> %4d is %14.5e\n", i+1, i, clust_seq->
exclusive_ymerge(i));
756 if (subdcut >= 0.0) {
764 vector<int> inv_unique_history(clust_seq->
history().size());
765 for (
unsigned int i = 0; i < unique_history.size(); i++) {
766 inv_unique_history[unique_history[i]] = i;}
768 for (
unsigned int i = 0; i < unique_history.size(); i++) {
770 clust_seq->
history()[unique_history[i]];
771 int uhp1 = el.parent1>=0 ? inv_unique_history[el.parent1] : el.parent1;
773 printf(
"%7d u %15.8e %7d u %7d u\n",i,el.
dij,uhp1, uhp2);
778 #ifdef FASTJET_ENABLE_PLUGIN_SISCONE 784 throw fastjet::Error(
"extras object for SISCone was null (this can happen with certain area types)");
785 cout <<
"most ambiguous split (difference in squared dist) = " 787 vector<fastjet::PseudoJet> stable_cones(extras->
stable_cones());
789 for (
unsigned int i = 0; i < stable_cones.size(); i++) {
791 printf(
"%5u %15.8f %15.8f %15.8f\n",
792 i,stable_cones[i].rap(),stable_cones[i].phi(),
793 stable_cones[i].perp() );
799 printf(
"\n%15s %15s %15s %12s %8s %8s\n",
"rap",
"phi",
"pt",
"user-index",
"pass",
"nconst");
800 for (
unsigned i = 0; i < sisjets.size(); i++) {
801 printf(
"%15.8f %15.8f %15.8f %12d %8d %8u\n",
802 sisjets[i].rap(), sisjets[i].phi(), sisjets[i].perp(),
803 sisjets[i].user_index(), extras->
pass(sisjets[i]),
804 (
unsigned int) clust_seq->
constituents(sisjets[i]).size()
809 #endif // FASTJET_ENABLE_PLUGIN_SISCONE 813 double rho, sigma, mean_area, empty_area, n_empty_jets;
820 }
else if (do_bkgd_jetmedian) {
822 bge.set_provide_fj2_sigma(do_bkgd_fj2);
823 bge.set_cluster_sequence(*csab);
826 mean_area = bge.mean_area();
827 empty_area = bge.empty_area();
828 n_empty_jets = bge.n_empty_jets();
830 assert(do_bkgd_gridmedian);
831 double grid_rapmin, grid_rapmax;
834 bge.set_particles(particles);
837 mean_area = bge.mean_area();
841 cout <<
" rho = " << rho
842 <<
", sigma = " << sigma
843 <<
", mean_area = " << mean_area
844 <<
", empty_area = " << empty_area
845 <<
", n_empty_jets = " << n_empty_jets
850 catch (
Error fjerr) {
851 cout <<
"Caught fastjet error, exiting gracefully" << endl;
862 if (istr != &cin)
delete istr;
873 unsigned int n_constituents = jet.
constituents().size();
874 printf(
"%15.8f %15.8f %15.8f %8u\n",
875 jet.
rap(), jet.
phi(), jet.
perp(), n_constituents);
880 void print_jets(
const vector<PseudoJet> & jets_in,
bool show_constituents) {
881 vector<PseudoJet> jets;
884 for (
unsigned int j = 0; j < jets.size(); j++) {
885 printf(
"%5u %15.8f %15.8f %15.8f %15.8f\n",
886 j,jets[j].px(),jets[j].py(),jets[j].pz(),jets[j].E());
887 if (show_constituents) {
888 vector<PseudoJet> const_jets = jets[j].constituents();
889 for (
unsigned int k = 0; k < const_jets.size(); k++) {
890 printf(
" jet%03u %15.8f %15.8f %15.8f %15.8f\n",j,const_jets[k].px(),
891 const_jets[k].py(),const_jets[k].pz(),const_jets[k].E());
899 for (
unsigned int j = 0; j < jets.size(); j++) {
900 printf(
"%5u %15.8f %15.8f %15.8f",
901 j,jets[j].rap(),jets[j].phi(),jets[j].perp());
905 if (do_areas) printf(
" %15.8f %15.8f", jets[j].area(),
906 jets[j].area_4vector().perp());
910 if (show_constituents) {
911 vector<PseudoJet> const_jets = jets[j].constituents();
912 for (
unsigned int k = 0; k < const_jets.size(); k++) {
913 printf(
" jet%03u %15.8f %15.8f %15.8f %5d\n",j,const_jets[k].rap(),
914 const_jets[k].phi(),sqrt(const_jets[k].kt2()), const_jets[k].cluster_hist_index());
921 if (rootfile !=
"") {
922 ofstream ostr(rootfile.c_str());
923 ostr <<
"# " << cmdline_p->command_line() << endl;
924 ostr <<
"# output for root" << endl;
925 assert(jets.size() > 0);
926 jets[0].validated_cs()->print_jets_for_root(jets,ostr);
935 void print_jets_and_sub (
const vector<PseudoJet> & jets,
double dcut) {
941 printf(
"Printing jets and their subjets with subdcut = %10.5f\n",dcut);
942 printf(
"%5s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
943 "phi",
"pt",
"n constituents");
946 SubType sub_type = subtype_internal;
952 for (vector<PseudoJet>::const_iterator jet = sorted_jets.begin();
953 jet != sorted_jets.end(); jet++) {
959 && jet->
perp2() < dcut)
continue;
962 printf(
"%5u ",(
unsigned int) (jet - sorted_jets.begin()));
964 vector<PseudoJet> subjets;
966 if (sub_type == subtype_internal) {
971 cout <<
" for " << ddnp1 <<
" < d < " << ddn <<
" one has " << endl;
972 }
else if (sub_type == subtype_newclust_dcut) {
975 }
else if (sub_type == subtype_newclust_R) {
981 cerr <<
"unrecognized subtype for subjet finding" << endl;
986 for (
unsigned int j = 0; j < subjets.size(); j++) {
987 printf(
" -sub-%02u ",j);
988 print_jet(subjets[j]);
991 if (cspoint != 0)
delete cspoint;
1006 void signal_failed_comparison(
int iev,
1007 const string & message,
1008 const vector<PseudoJet> & particles) {
1009 cout <<
"# failed comparison, reason is " << message << endl;
1010 cout <<
"# iev = " << iev << endl;
1011 cout << setprecision(16);
1012 for (
unsigned i = 0; i < particles.size(); i++) {
1014 cout << p.px() <<
" " 1019 cout <<
"#END" << endl;
1023 void do_compare_strategy(
int iev,
1024 const vector<PseudoJet> & particles,
1027 int compare_strategy) {
1032 jet_def.recombination_scheme(),
1039 const vector<ClusterSequence::history_element> & history_in = cs.
history();
1040 const vector<ClusterSequence::history_element> & history_ref = cs_ref.history();
1042 if (history_in.size() != history_ref.size()) {
1043 signal_failed_comparison(iev,
"history sizes do not match", particles);
1047 for (
unsigned i = cs.
n_particles(); i < history_in.size(); i++) {
1048 bool fail_parents = (history_in[i].parent1 != history_ref[i].parent1 ||
1049 history_in[i].parent2 != history_ref[i].parent2);
1050 bool fail_dij = (history_in[i].dij != history_ref[i].dij);
1051 if (fail_parents || fail_dij) {
1053 ostr <<
"at step " << i <<
", ";
1054 if (fail_parents) ostr <<
"parents do not match, ";
1055 if (fail_dij) ostr <<
"dij does not match, ";
1056 ostr <<
"history in (p1, p2, dij) = " 1057 << history_in[i].parent1 <<
" " << history_in[i].parent2 <<
" " << history_in[i].dij;
1058 ostr <<
", history ref (p1, p2, dij) = " 1059 << history_ref[i].parent1 <<
" " << history_ref[i].parent2 <<
" " << history_ref[i].dij;
1060 signal_failed_comparison(iev, ostr.str(), particles);
double rap() const
returns the rapidity or some large value when the rapidity is infinite
std::vector< PseudoJet > exclusive_jets(const double dcut) const
return a vector of all jets (in the sense of the exclusive algorithm) that would be obtained when run...
Strategy
enum that contains the two clustering strategy options; for higher multiplicities, strategy_NNFJN2Plain is about a factor of two faster.
const Extras * extras() const
returns a pointer to the extras object (may be null)
vector< PseudoJet > sorted_by_pt(const vector< PseudoJet > &jets)
return a vector of jets sorted into decreasing kt2
double exclusive_subdmerge_max(int nsub) const
Returns the maximum dij that occurred in the whole event at the stage that the nsub+1 -> nsub merge o...
void get_rapidity_extent(double &rapmin, double &rapmax) const
returns the rapidity range for which it may return "true"
std::vector< PseudoJet > exclusive_subjets(const double dcut) const
return a vector of all subjets of the current jet (in the sense of the exclusive algorithm) that woul...
General class for user to obtain ClusterSequence with additional area information.
Selector SelectorNHardest(unsigned int n)
select the n hardest objects
std::vector< int > unique_history_order() const
routine that returns an order in which to read the history such that clusterings that lead to identic...
JetAlgorithm jet_algorithm() const
return information about the definition...
std::vector< PseudoJet > inclusive_jets(const double ptmin=0.0) const
return a vector of all jets (in the sense of the inclusive algorithm) with pt >= ptmin.
virtual double n_empty_jets(const Selector &selector) const
return something similar to the number of pure ghost jets in the given selector's range in an active ...
Selector SelectorAbsRapMax(double absrapmax)
select objects with |rap| <= absrapmax
Implementation of the D0 Run II Cone (plugin for fastjet v2.1 upwards)
the longitudinally invariant kt algorithm
vector< PseudoJet > sorted_by_rapidity(const vector< PseudoJet > &jets)
return a vector of jets sorted into increasing rapidity
class that holds a generic area definition
const ClusterSequence * validated_cs() const
shorthand for validated_cluster_sequence()
const Plugin * plugin() const
return a pointer to the plugin
Implementation of the spherical version of the SISCone algorithm (plugin for fastjet v2...
virtual double empty_area(const Selector &selector) const
return the total area, corresponding to the given Selector, that is free of jets, in general based on...
const JetDefinition & jet_def() const
return a reference to the jet definition
double exclusive_dmerge(const int njets) const
return the dmin corresponding to the recombination that went from n+1 to n jets (sometimes known as d...
int parent2
index in _history where first parent of this jet was created (InexistentParent if this jet is an orig...
the plugin has been used...
Implementation of the TrackJet algorithm (plugin for fastjet v2.4 upwards)
double dij
index in the _jets vector where we will find the
int main()
an example program showing how to use fastjet
Specification for the computation of the Voronoi jet area.
std::string description() const
return a textual description of the current jet definition
unsigned int n_particles() const
returns the number of particles that were provided to the clustering algorithm (helps the user find t...
const std::vector< history_element > & history() const
allow the user to access the raw internal history.
base class that sets interface for extensions of ClusterSequence that provide information about the a...
vector< PseudoJet > sorted_by_E(const vector< PseudoJet > &jets)
return a vector of jets sorted into decreasing energy
Implementation of the e+e- Cambridge algorithm (plugin for fastjet v2.4 upwards)
void print_jets(const vector< fastjet::PseudoJet > &)
a function that pretty prints a list of jets
base class corresponding to errors that can be thrown by FastJet
A plugin for FastJet (v3.0 or later) that provides an interface to the D0 version of Run-I cone algor...
RecombinationScheme
The various recombination schemes.
string fastjet_version_string()
return a string containing information about the release
std::vector< PseudoJet > constituents(const PseudoJet &jet) const
return a vector of the particles that make up jet
an implementation of C++0x shared pointers (or boost's)
Implementation of the PxCone algorithm (plugin for fastjet v2.1 upwards)
Class that encodes information about cuts and other selection criteria that can be applied to PseudoJ...
a single element in the clustering history
Implementation of the JetClu algorithm from CDF (plugin for fastjet-v2.1 upwards) ...
double phi() const
returns phi (in the range 0..2pi)
double exclusive_ymerge(int njets) const
return the ymin corresponding to the recombination that went from n+1 to n jets (sometimes known as y...
Implementation of the CMS Iterative Cone (plugin for fastjet v2.4 upwards)
double perp() const
returns the scalar transverse momentum
the longitudinally invariant variant of the cambridge algorithm (aka Aachen algoithm).
Implementation of the e+e- Jade algorithm (plugin for fastjet v2.4 upwards)
std::vector< PseudoJet > exclusive_jets_ycut(double ycut) const
the exclusive jets obtained at the given ycut
Parameters to configure the computation of jet areas using ghosts.
Strategy
the various options for the algorithmic strategy to adopt in clustering events with kt and cambridge ...
virtual std::vector< PseudoJet > constituents() const
retrieve the constituents.
virtual void get_median_rho_and_sigma(const Selector &selector, bool use_area_4vector, double &median, double &sigma, double &mean_area) const
using jets withing the selector range (and with 4-vector areas if use_area_4vector), calculate the median pt/area, as well as an "error" (uncertainty), which is defined as the 1-sigma half-width of the distribution of pt/A, obtained by looking for the point below which we have (1-0.6827)/2 of the jets (including empty jets).
Implementation of the MidPoint algorithm from CDF (plugin for fastjet-v2.1 upwards) ...
Implementation of the SISCone algorithm (plugin for fastjet v2.1 upwards)
plugin for fastjet (v3.0 upwards) that clusters particles such that all particles in a given cell of ...
T * get() const
get the stored pointer
Class to contain pseudojets, including minimal information of use to jet-clustering routines...
Implementation of the ATLAS Cone (plugin for fastjet v2.4 upwards)
double perp2() const
returns the squared transverse momentum
class that is intended to hold a full definition of the jet clusterer
A plugin for FastJet (v3.0 or later) that provides an interface to the pre 1996 D0 version of Run-I c...
std::string strategy_string() const
return the name of the strategy used to cluster the event
void reset()
reset the pointer to default value (NULL)