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) {
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));
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
549 #else // FASTJET_ENABLE_PLUGIN_JADE
550 is_unavailable(
"Jade");
551 #endif // FASTJET_ENABLE_PLUGIN_JADE
553 if (all_algs || cmdline.present(
"-cmsiterativecone")) {
554 #ifdef FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE
556 #else // FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE
557 is_unavailable(
"CMSIterativeCone");
558 #endif // FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE
560 if (all_algs || cmdline.present(
"-d0runipre96cone")) {
561 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNICONE
563 #else // FASTJET_ENABLE_PLUGIN_D0RUNICONE
564 is_unavailable(
"D0RunIpre96Cone");
565 #endif // FASTJET_ENABLE_PLUGIN_D0RUNICONE
567 if (all_algs || cmdline.present(
"-d0runicone")) {
568 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNICONE
570 #else // FASTJET_ENABLE_PLUGIN_D0RUNICONE
571 is_unavailable(
"D0RunICone");
572 #endif // FASTJET_ENABLE_PLUGIN_D0RUNICONE
574 if (all_algs || cmdline.present(
"-gridjet")) {
575 #ifdef FASTJET_ENABLE_PLUGIN_GRIDJET
583 double grid_ymax = 4.9999999999;
585 #else // FASTJET_ENABLE_PLUGIN_GRIDJET
586 is_unavailable(
"GridJet");
587 #endif // FASTJET_ENABLE_PLUGIN_GRIDJET
591 cmdline.present(
"-kt") ||
592 (jet_defs.size() == 0 && !found_unavailable)) {
593 jet_defs.push_back(
JetDefinition(kt_algorithm, ktR, strategy));
596 string filename = cmdline.value<
string>(
"-file",
"");
599 if (!cmdline.all_options_used()) {cerr <<
600 "Error: some options were not recognized"<<endl;
603 for (
unsigned idef = 0; idef < jet_defs.size(); idef++) {
606 if (filename ==
"") istr = &cin;
607 else istr =
new ifstream(filename.c_str());
609 for (
int iev = 0; iev < nev; iev++) {
610 vector<PseudoJet> jets;
611 vector<PseudoJet> particles;
614 while (getline(*istr, line)) {
616 istringstream linestream(line);
617 if (line ==
"#END") {
619 if (ndone == combine) {
break;}
621 if (line.substr(0,1) ==
"#") {
continue;}
622 valarray<double> fourvec(4);
627 int ii, istat,id,m1,m2,d1,d2;
629 linestream >> ii>> istat >>
id >> m1 >> m2 >> d1 >> d2
630 >> fourvec[0] >> fourvec[1] >> fourvec[2] >> mass;
633 fourvec[3] = sqrt(+pow2(fourvec[0])+pow2(fourvec[1])
634 +pow2(fourvec[2])+pow2(mass));
638 linestream >> fourvec[0] >> fourvec[1] >> fourvec[2];
639 fourvec[3] = sqrt(pow2(fourvec[0])+pow2(fourvec[1])+pow2(fourvec[2]));}
641 linestream >> fourvec[0] >> fourvec[1] >> fourvec[2] >> fourvec[3];
645 if (abs(psjet.rap()) < rapmax) {particles.push_back(psjet);}
652 if (add_dense_coverage) {
657 ghosted_area_spec.set_grid_scatter(0.5);
658 ghosted_area_spec.add_ghosts(particles);
680 add_dense_coverage =
false;
684 particles = particles_sel(particles);
687 if (iev < skip)
continue;
689 for (
int irepeat = 0; irepeat < repeat ; irepeat++) {
690 int nparticles = particles.size();
692 auto_ptr<ClusterSequence> clust_seq;
700 if (compare_strategy != plugin_strategy) {
701 do_compare_strategy(iev, particles, jet_def, *clust_seq, compare_strategy);
705 if (repeatinclkt >= 0.0) {
706 vector<PseudoJet> jets_local =
sorted_by_pt(clust_seq->inclusive_jets(repeatinclkt));
709 if (irepeat != 0) {
continue;}
710 cout <<
"iev "<<iev<<
": number of particles = "<< nparticles << endl;
711 cout <<
"strategy used = "<< clust_seq->strategy_string()<< endl;
714 if (do_areas && iev == 0) cout <<
"Area definition: " << area_def.description() << endl;
719 vector<PseudoJet> jets_local =
sorted_by_pt(clust_seq->inclusive_jets(inclkt));
725 cout <<
"Printing "<<excln<<
" exclusive jets\n";
726 print_jets(clust_seq->exclusive_jets(excln), show_constituents);
730 cout <<
"Printing exclusive jets for d = "<<excld<<
"\n";
731 print_jets(clust_seq->exclusive_jets(excld), show_constituents);
735 cout <<
"Printing exclusive jets for ycut = "<<excly<<
"\n";
736 print_jets(clust_seq->exclusive_jets_ycut(excly), show_constituents);
740 for (
int i = nparticles-1; i >= 0; i--) {
741 printf(
"d for n = %4d -> %4d is %14.5e\n", i+1, i, clust_seq->exclusive_dmerge(i));
745 for (
int i = nparticles-1; i >= 0; i--) {
746 printf(
"y for n = %4d -> %4d is %14.5e\n", i+1, i, clust_seq->exclusive_ymerge(i));
752 if (subdcut >= 0.0) {
753 print_jets_and_sub(clust_seq->inclusive_jets(), subdcut);
758 vector<int> unique_history = clust_seq->unique_history_order();
760 vector<int> inv_unique_history(clust_seq->history().size());
761 for (
unsigned int i = 0; i < unique_history.size(); i++) {
762 inv_unique_history[unique_history[i]] = i;}
764 for (
unsigned int i = 0; i < unique_history.size(); i++) {
766 clust_seq->history()[unique_history[i]];
767 int uhp1 = el.parent1>=0 ? inv_unique_history[el.parent1] : el.parent1;
769 printf(
"%7d u %15.8e %7d u %7d u\n",i,el.
dij,uhp1, uhp2);
774 #ifdef FASTJET_ENABLE_PLUGIN_SISCONE
780 throw fastjet::Error(
"extras object for SISCone was null (this can happen with certain area types)");
781 cout <<
"most ambiguous split (difference in squared dist) = "
783 vector<fastjet::PseudoJet> stable_cones(extras->
stable_cones());
785 for (
unsigned int i = 0; i < stable_cones.size(); i++) {
787 printf(
"%5u %15.8f %15.8f %15.8f\n",
788 i,stable_cones[i].rap(),stable_cones[i].phi(),
789 stable_cones[i].perp() );
794 vector<PseudoJet> sisjets = clust_seq->inclusive_jets();
795 printf(
"\n%15s %15s %15s %12s %8s %8s\n",
"rap",
"phi",
"pt",
"user-index",
"pass",
"nconst");
796 for (
unsigned i = 0; i < sisjets.size(); i++) {
797 printf(
"%15.8f %15.8f %15.8f %12d %8d %8u\n",
798 sisjets[i].rap(), sisjets[i].phi(), sisjets[i].perp(),
799 sisjets[i].user_index(), extras->
pass(sisjets[i]),
800 (
unsigned int) clust_seq->constituents(sisjets[i]).size()
805 #endif // FASTJET_ENABLE_PLUGIN_SISCONE
809 double rho, sigma, mean_area, empty_area, n_empty_jets;
816 }
else if (do_bkgd_jetmedian) {
818 bge.set_provide_fj2_sigma(do_bkgd_fj2);
819 bge.set_cluster_sequence(*csab);
822 mean_area = bge.mean_area();
823 empty_area = bge.empty_area();
824 n_empty_jets = bge.n_empty_jets();
826 assert(do_bkgd_gridmedian);
827 double grid_rapmin, grid_rapmax;
830 bge.set_particles(particles);
833 mean_area = bge.mean_area();
837 cout <<
" rho = " << rho
838 <<
", sigma = " << sigma
839 <<
", mean_area = " << mean_area
840 <<
", empty_area = " << empty_area
841 <<
", n_empty_jets = " << n_empty_jets
846 catch (
Error fjerr) {
847 cout <<
"Caught fastjet error, exiting gracefully" << endl;
858 if (istr != &cin)
delete istr;
869 unsigned int n_constituents = jet.
constituents().size();
870 printf(
"%15.8f %15.8f %15.8f %8u\n",
871 jet.
rap(), jet.
phi(), jet.
perp(), n_constituents);
876 void print_jets(
const vector<PseudoJet> & jets_in,
bool show_constituents) {
877 vector<PseudoJet> jets;
880 for (
unsigned int j = 0; j < jets.size(); j++) {
881 printf(
"%5u %15.8f %15.8f %15.8f %15.8f\n",
882 j,jets[j].px(),jets[j].py(),jets[j].pz(),jets[j].E());
883 if (show_constituents) {
884 vector<PseudoJet> const_jets = jets[j].constituents();
885 for (
unsigned int k = 0; k < const_jets.size(); k++) {
886 printf(
" jet%03u %15.8f %15.8f %15.8f %15.8f\n",j,const_jets[k].px(),
887 const_jets[k].py(),const_jets[k].pz(),const_jets[k].E());
895 for (
unsigned int j = 0; j < jets.size(); j++) {
896 printf(
"%5u %15.8f %15.8f %15.8f",
897 j,jets[j].rap(),jets[j].phi(),jets[j].perp());
901 if (do_areas) printf(
" %15.8f %15.8f", jets[j].area(),
902 jets[j].area_4vector().perp());
906 if (show_constituents) {
907 vector<PseudoJet> const_jets = jets[j].constituents();
908 for (
unsigned int k = 0; k < const_jets.size(); k++) {
909 printf(
" jet%03u %15.8f %15.8f %15.8f %5d\n",j,const_jets[k].rap(),
910 const_jets[k].phi(),sqrt(const_jets[k].kt2()), const_jets[k].cluster_hist_index());
917 if (rootfile !=
"") {
918 ofstream ostr(rootfile.c_str());
919 ostr <<
"# " << cmdline_p->command_line() << endl;
920 ostr <<
"# output for root" << endl;
921 assert(jets.size() > 0);
922 jets[0].validated_cs()->print_jets_for_root(jets,ostr);
931 void print_jets_and_sub (
const vector<PseudoJet> & jets,
double dcut) {
937 printf(
"Printing jets and their subjets with subdcut = %10.5f\n",dcut);
938 printf(
"%5s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
939 "phi",
"pt",
"n constituents");
942 SubType sub_type = subtype_internal;
948 for (vector<PseudoJet>::const_iterator jet = sorted_jets.begin();
949 jet != sorted_jets.end(); jet++) {
955 && jet->
perp2() < dcut)
continue;
958 printf(
"%5u ",(
unsigned int) (jet - sorted_jets.begin()));
960 vector<PseudoJet> subjets;
962 if (sub_type == subtype_internal) {
967 cout <<
" for " << ddnp1 <<
" < d < " << ddn <<
" one has " << endl;
968 }
else if (sub_type == subtype_newclust_dcut) {
971 }
else if (sub_type == subtype_newclust_R) {
977 cerr <<
"unrecognized subtype for subjet finding" << endl;
982 for (
unsigned int j = 0; j < subjets.size(); j++) {
983 printf(
" -sub-%02u ",j);
984 print_jet(subjets[j]);
987 if (cspoint != 0)
delete cspoint;
1002 void signal_failed_comparison(
int iev,
1003 const string & message,
1004 const vector<PseudoJet> & particles) {
1005 cout <<
"# failed comparison, reason is " << message << endl;
1006 cout <<
"# iev = " << iev << endl;
1007 cout << setprecision(16);
1008 for (
unsigned i = 0; i < particles.size(); i++) {
1010 cout << p.px() <<
" "
1015 cout <<
"#END" << endl;
1019 void do_compare_strategy(
int iev,
1020 const vector<PseudoJet> & particles,
1023 int compare_strategy) {
1028 jet_def.recombination_scheme(),
1035 const vector<ClusterSequence::history_element> & history_in = cs.
history();
1036 const vector<ClusterSequence::history_element> & history_ref = cs_ref.history();
1038 if (history_in.size() != history_ref.size()) {
1039 signal_failed_comparison(iev,
"history sizes do not match", particles);
1043 for (
unsigned i = cs.
n_particles(); i < history_in.size(); i++) {
1044 bool fail_parents = (history_in[i].parent1 != history_ref[i].parent1 ||
1045 history_in[i].parent2 != history_ref[i].parent2);
1046 bool fail_dij = (history_in[i].dij != history_ref[i].dij);
1047 if (fail_parents || fail_dij) {
1049 ostr <<
"at step " << i <<
", ";
1050 if (fail_parents) ostr <<
"parents do not match, ";
1051 if (fail_dij) ostr <<
"dij does not match, ";
1052 ostr <<
"history in (p1, p2, dij) = "
1053 << history_in[i].parent1 <<
" " << history_in[i].parent2 <<
" " << history_in[i].dij;
1054 ostr <<
", history ref (p1, p2, dij) = "
1055 << history_ref[i].parent1 <<
" " << history_ref[i].parent2 <<
" " << history_ref[i].dij;
1056 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...
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
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 ...
static void print_banner()
This is the function that is automatically called during clustering to print the FastJet banner...
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
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
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)
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).
void set_fj2_placement(bool val)
if val is true, set ghost placement as it was in FastJet 2.X.
Implementation of the e+e- Jade algorithm (plugin for fastjet v2.4 upwards)
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 ...
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...