197 #include "fastjet/ClusterSequenceArea.hh"
198 #include "fastjet/tools/JetMedianBackgroundEstimator.hh"
199 #include "fastjet/tools/GridMedianBackgroundEstimator.hh"
200 #include "fastjet/Selector.hh"
209 #include "CmdLine.hh"
212 #include "fastjet/config.h"
215 #ifdef FASTJET_ENABLE_PLUGIN_SISCONE
216 #include "fastjet/SISConePlugin.hh"
217 #include "fastjet/SISConeSphericalPlugin.hh"
219 #ifdef FASTJET_ENABLE_PLUGIN_CDFCONES
220 #include "fastjet/CDFMidPointPlugin.hh"
221 #include "fastjet/CDFJetCluPlugin.hh"
223 #ifdef FASTJET_ENABLE_PLUGIN_PXCONE
224 #include "fastjet/PxConePlugin.hh"
226 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNIICONE
227 #include "fastjet/D0RunIIConePlugin.hh"
229 #ifdef FASTJET_ENABLE_PLUGIN_TRACKJET
230 #include "fastjet/TrackJetPlugin.hh"
232 #ifdef FASTJET_ENABLE_PLUGIN_ATLASCONE
233 #include "fastjet/ATLASConePlugin.hh"
235 #ifdef FASTJET_ENABLE_PLUGIN_EECAMBRIDGE
236 #include "fastjet/EECambridgePlugin.hh"
238 #ifdef FASTJET_ENABLE_PLUGIN_JADE
239 #include "fastjet/JadePlugin.hh"
241 #ifdef FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE
242 #include "fastjet/CMSIterativeConePlugin.hh"
244 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNICONE
245 #include "fastjet/D0RunIpre96ConePlugin.hh"
246 #include "fastjet/D0RunIConePlugin.hh"
248 #ifdef FASTJET_ENABLE_PLUGIN_GRIDJET
249 #include "fastjet/GridJetPlugin.hh"
256 using namespace fastjet;
258 inline double pow2(
const double x) {
return x*x;}
261 void print_jets_and_sub (
const vector<PseudoJet> & jets,
double dcut);
269 enum SubType {subtype_internal, subtype_newclust_dcut, subtype_newclust_R};
271 void do_compare_strategy(
int iev,
272 const vector<PseudoJet> & particles,
275 int compare_strategy);
285 bool ee_print =
false;
286 void print_jets(
const vector<PseudoJet> & jets,
bool show_const =
false);
288 bool found_unavailable =
false;
289 void is_unavailable(
const string & algname) {
290 cerr << algname <<
" requested, but not available for this compilation" << endl;
291 found_unavailable =
true;
298 int main (
int argc,
char ** argv) {
302 CmdLine cmdline(argc,argv);
303 cmdline_p = &cmdline;
308 cmdline.int_val(
"-clever", Best)));
309 int repeat = cmdline.int_val(
"-repeat",1);
310 int combine = cmdline.int_val(
"-combine",1);
311 bool write = cmdline.present(
"-write");
312 bool unique_write = cmdline.present(
"-unique_write");
313 bool hydjet = cmdline.present(
"-hydjet");
314 double ktR = cmdline.double_val(
"-r",1.0);
315 ktR = cmdline.double_val(
"-R",ktR);
316 double inclkt = cmdline.double_val(
"-incl",-1.0);
317 double repeatinclkt = cmdline.double_val(
"-repeat-incl",-1.0);
318 int excln = cmdline.int_val (
"-excln",-1);
319 double excld = cmdline.double_val(
"-excld",-1.0);
320 double excly = cmdline.double_val(
"-excly",-1.0);
321 ee_print = cmdline.present(
"-ee-print");
322 bool get_all_dij = cmdline.present(
"-get-all-dij");
323 bool get_all_yij = cmdline.present(
"-get-all-yij");
324 double subdcut = cmdline.double_val(
"-subdcut",-1.0);
325 double rapmax = cmdline.double_val(
"-rapmax",1.0e305);
326 if (cmdline.present(
"-etamax")) {
327 cerr <<
"WARNING: -etamax options actually sets maximum rapidity (and overrides -rapmax)\n";
328 rapmax = cmdline.double_val(
"-etamax");
330 bool show_constituents = cmdline.present(
"-const");
331 bool massless = cmdline.present(
"-massless");
332 int nev = cmdline.int_val(
"-nev",1);
333 int skip = cmdline.int_val(
"-skip",0);
334 bool add_dense_coverage = cmdline.present(
"-dense");
335 double ghost_maxrap = cmdline.value(
"-ghost-maxrap",5.0);
336 bool all_algs = cmdline.present(
"-all-algs");
341 int compare_strategy = cmdline.value<
int>(
"-compare-strategy",
plugin_strategy);
344 Selector particles_sel = (cmdline.present(
"-nhardest"))
346 : SelectorIdentity();
348 do_areas = cmdline.present(
"-area");
353 cmdline.value(
"-area:repeat", 1),
354 cmdline.value(
"-ghost-area", 0.01));
356 if (cmdline.present(
"-area:explicit")) {
357 area_def =
AreaDefinition(active_area_explicit_ghosts, ghost_spec);
358 }
else if (cmdline.present(
"-area:passive")) {
360 }
else if (cmdline.present(
"-area:voronoi")) {
361 double Rfact = cmdline.value<
double>(
"-area:voronoi");
365 cmdline.present(
"-area:active");
369 bool do_bkgd = cmdline.present(
"-bkgd");
370 bool do_bkgd_csab =
false, do_bkgd_jetmedian =
false, do_bkgd_fj2 =
false;
371 bool do_bkgd_gridmedian =
false;
375 if (cmdline.present(
"-bkgd:csab")) {do_bkgd_csab =
true;}
376 else if (cmdline.present(
"-bkgd:jetmedian")) {do_bkgd_jetmedian =
true;
377 do_bkgd_fj2 = cmdline.present(
"-bkgd:fj2");
378 }
else if (cmdline.present(
"-bkgd:gridmedian")) {do_bkgd_gridmedian =
true;
380 throw Error(
"with the -bkgd option, some particular background must be specified (csab or jetmedian)");
382 assert(do_areas || do_bkgd_gridmedian);
385 bool show_cones = cmdline.present(
"-cones");
389 double overlap_threshold = cmdline.double_val(
"-overlap",0.5);
390 overlap_threshold = cmdline.double_val(
"-f",overlap_threshold);
391 double seed_threshold = cmdline.double_val(
"-seed",1.0);
394 double ycut = cmdline.double_val(
"-ycut",0.08);
397 rootfile = cmdline.value<
string>(
"-root",
"");
405 vector<JetDefinition> jet_defs;
406 if (all_algs || cmdline.present(
"-cam") || cmdline.present(
"-CA")) {
407 jet_defs.push_back(
JetDefinition(cambridge_algorithm, ktR, scheme, strategy));
409 if (all_algs || cmdline.present(
"-antikt")) {
410 jet_defs.push_back(
JetDefinition(antikt_algorithm, ktR, scheme, strategy));
412 if (all_algs || cmdline.present(
"-genkt")) {
414 if (cmdline.present(
"-genkt")) p = cmdline.value<
double>(
"-genkt");
416 jet_defs.push_back(
JetDefinition(genkt_algorithm, ktR, p, scheme, strategy));
418 if (all_algs || cmdline.present(
"-eekt")) {
421 if (all_algs || cmdline.present(
"-eegenkt")) {
423 if (cmdline.present(
"-eegenkt")) p = cmdline.value<
double>(
"-eegenkt");
425 jet_defs.push_back(
JetDefinition(ee_genkt_algorithm, ktR, p, scheme, strategy));
429 if (all_algs || cmdline.present(
"-midpoint")) {
430 #ifdef FASTJET_ENABLE_PLUGIN_CDFCONES
432 double cone_area_fraction = 1.0;
433 int max_pair_size = 2;
434 int max_iterations = 100;
435 MPPlug::SplitMergeScale sm_scale = MPPlug::SM_pt;
436 if (cmdline.present(
"-sm-pttilde")) sm_scale = MPPlug::SM_pttilde;
437 if (cmdline.present(
"-sm-pt")) sm_scale = MPPlug::SM_pt;
438 if (cmdline.present(
"-sm-mt")) sm_scale = MPPlug::SM_mt;
439 if (cmdline.present(
"-sm-Et")) sm_scale = MPPlug::SM_Et;
442 cone_area_fraction, max_pair_size,
443 max_iterations, overlap_threshold,
445 #else // FASTJET_ENABLE_PLUGIN_CDFCONES
446 is_unavailable(
"MidPoint");
447 #endif // FASTJET_ENABLE_PLUGIN_CDFCONES
449 if (all_algs || cmdline.present(
"-pxcone")) {
450 #ifdef FASTJET_ENABLE_PLUGIN_PXCONE
451 double min_jet_energy = 5.0;
454 overlap_threshold)));
455 #else // FASTJET_ENABLE_PLUGIN_PXCONE
456 is_unavailable(
"PxCone");
457 #endif // FASTJET_ENABLE_PLUGIN_PXCONE
459 if (all_algs || cmdline.present(
"-jetclu")) {
460 #ifdef FASTJET_ENABLE_PLUGIN_CDFCONES
462 ktR, overlap_threshold, seed_threshold)));
463 #else // FASTJET_ENABLE_PLUGIN_CDFCONES
464 is_unavailable(
"JetClu");
465 #endif // FASTJET_ENABLE_PLUGIN_CDFCONES
467 if (all_algs || cmdline.present(
"-siscone") || cmdline.present(
"-sisconespheri")) {
468 #ifdef FASTJET_ENABLE_PLUGIN_SISCONE
470 int npass = cmdline.value(
"-npass",0);
471 if (all_algs || cmdline.present(
"-siscone")) {
472 double sisptmin = cmdline.value(
"-sisptmin",0.0);
473 SISPlug * plugin =
new SISPlug (ktR, overlap_threshold,npass,sisptmin);
474 if (cmdline.present(
"-sm-pt")) plugin->set_split_merge_scale(SISPlug::SM_pt);
475 if (cmdline.present(
"-sm-mt")) plugin->set_split_merge_scale(SISPlug::SM_mt);
476 if (cmdline.present(
"-sm-Et")) plugin->set_split_merge_scale(SISPlug::SM_Et);
477 if (cmdline.present(
"-sm-pttilde")) plugin->set_split_merge_scale(SISPlug::SM_pttilde);
479 plugin->set_use_jet_def_recombiner(
true);
482 if (all_algs || cmdline.present(
"-sisconespheri")) {
483 double sisEmin = cmdline.value(
"-sisEmin",0.0);
486 if (cmdline.present(
"-ghost-sep")) {
487 plugin->set_ghost_separation_scale(cmdline.value<
double>(
"-ghost-sep"));
491 #else // FASTJET_ENABLE_PLUGIN_SISCONE
492 is_unavailable(
"SISCone");
493 #endif // FASTJET_ENABLE_PLUGIN_SISCONE
495 if (all_algs || cmdline.present(
"-d0runiicone")) {
496 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNIICONE
497 double min_jet_Et = 6.0;
499 #else // FASTJET_ENABLE_PLUGIN_D0RUNIICONE
500 is_unavailable(
"D0RunIICone");
501 #endif // FASTJET_ENABLE_PLUGIN_D0RUNIICONE
503 if (all_algs || cmdline.present(
"-trackjet")) {
504 #ifdef FASTJET_ENABLE_PLUGIN_TRACKJET
506 #else // FASTJET_ENABLE_PLUGIN_TRACKJET
507 is_unavailable(
"TrackJet");
508 #endif // FASTJET_ENABLE_PLUGIN_TRACKJET
510 if (all_algs || cmdline.present(
"-atlascone")) {
511 #ifdef FASTJET_ENABLE_PLUGIN_ATLASCONE
513 #else // FASTJET_ENABLE_PLUGIN_ATLASCONE
514 is_unavailable(
"ATLASCone");
515 #endif // FASTJET_ENABLE_PLUGIN_ATLASCONE
517 if (all_algs || cmdline.present(
"-eecambridge")) {
518 #ifdef FASTJET_ENABLE_PLUGIN_EECAMBRIDGE
520 #else // FASTJET_ENABLE_PLUGIN_EECAMBRIDGE
521 is_unavailable(
"EECambridge");
522 #endif // FASTJET_ENABLE_PLUGIN_EECAMBRIDGE
524 if (all_algs || cmdline.present(
"-jade")) {
525 #ifdef FASTJET_ENABLE_PLUGIN_JADE
527 #else // FASTJET_ENABLE_PLUGIN_JADE
528 is_unavailable(
"Jade");
529 #endif // FASTJET_ENABLE_PLUGIN_JADE
531 if (all_algs || cmdline.present(
"-cmsiterativecone")) {
532 #ifdef FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE
534 #else // FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE
535 is_unavailable(
"CMSIterativeCone");
536 #endif // FASTJET_ENABLE_PLUGIN_CMSITERATIVECONE
538 if (all_algs || cmdline.present(
"-d0runipre96cone")) {
539 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNICONE
541 #else // FASTJET_ENABLE_PLUGIN_D0RUNICONE
542 is_unavailable(
"D0RunIpre96Cone");
543 #endif // FASTJET_ENABLE_PLUGIN_D0RUNICONE
545 if (all_algs || cmdline.present(
"-d0runicone")) {
546 #ifdef FASTJET_ENABLE_PLUGIN_D0RUNICONE
548 #else // FASTJET_ENABLE_PLUGIN_D0RUNICONE
549 is_unavailable(
"D0RunICone");
550 #endif // FASTJET_ENABLE_PLUGIN_D0RUNICONE
552 if (all_algs || cmdline.present(
"-gridjet")) {
553 #ifdef FASTJET_ENABLE_PLUGIN_GRIDJET
561 double grid_ymax = 4.9999999999;
563 #else // FASTJET_ENABLE_PLUGIN_GRIDJET
564 is_unavailable(
"GridJet");
565 #endif // FASTJET_ENABLE_PLUGIN_GRIDJET
569 cmdline.present(
"-kt") ||
570 (jet_defs.size() == 0 && !found_unavailable)) {
571 jet_defs.push_back(
JetDefinition(kt_algorithm, ktR, strategy));
574 string filename = cmdline.value<
string>(
"-file",
"");
577 if (!cmdline.all_options_used()) {cerr <<
578 "Error: some options were not recognized"<<endl;
581 for (
unsigned idef = 0; idef < jet_defs.size(); idef++) {
584 if (filename ==
"") istr = &cin;
585 else istr =
new ifstream(filename.c_str());
587 for (
int iev = 0; iev < nev; iev++) {
588 vector<PseudoJet> jets;
589 vector<PseudoJet> particles;
592 while (getline(*istr, line)) {
594 istringstream linestream(line);
595 if (line ==
"#END") {
597 if (ndone == combine) {
break;}
599 if (line.substr(0,1) ==
"#") {
continue;}
600 valarray<double> fourvec(4);
605 int ii, istat,id,m1,m2,d1,d2;
607 linestream >> ii>> istat >>
id >> m1 >> m2 >> d1 >> d2
608 >> fourvec[0] >> fourvec[1] >> fourvec[2] >> mass;
611 fourvec[3] = sqrt(+pow2(fourvec[0])+pow2(fourvec[1])
612 +pow2(fourvec[2])+pow2(mass));
616 linestream >> fourvec[0] >> fourvec[1] >> fourvec[2];
617 fourvec[3] = sqrt(pow2(fourvec[0])+pow2(fourvec[1])+pow2(fourvec[2]));}
619 linestream >> fourvec[0] >> fourvec[1] >> fourvec[2] >> fourvec[3];
623 if (abs(psjet.rap()) < rapmax) {particles.push_back(psjet);}
629 if (add_dense_coverage) {
634 ghosted_area_spec.set_grid_scatter(0.5);
635 ghosted_area_spec.add_ghosts(particles);
658 particles = particles_sel(particles);
661 if (iev < skip)
continue;
663 for (
int irepeat = 0; irepeat < repeat ; irepeat++) {
664 int nparticles = particles.size();
666 auto_ptr<ClusterSequence> clust_seq;
672 if (compare_strategy != plugin_strategy) {
673 do_compare_strategy(iev, particles, jet_def, *clust_seq, compare_strategy);
677 if (repeatinclkt >= 0.0) {
678 vector<PseudoJet> jets_local =
sorted_by_pt(clust_seq->inclusive_jets(repeatinclkt));
681 if (irepeat != 0) {
continue;}
682 cout <<
"iev "<<iev<<
": number of particles = "<< nparticles << endl;
683 cout <<
"strategy used = "<< clust_seq->strategy_string()<< endl;
685 if (do_areas && iev == 0) cout <<
"Area definition: " << area_def.description() << endl;
689 vector<PseudoJet> jets_local =
sorted_by_pt(clust_seq->inclusive_jets(inclkt));
695 cout <<
"Printing "<<excln<<
" exclusive jets\n";
696 print_jets(clust_seq->exclusive_jets(excln), show_constituents);
700 cout <<
"Printing exclusive jets for d = "<<excld<<
"\n";
701 print_jets(clust_seq->exclusive_jets(excld), show_constituents);
705 cout <<
"Printing exclusive jets for ycut = "<<excly<<
"\n";
706 print_jets(clust_seq->exclusive_jets_ycut(excly), show_constituents);
710 for (
int i = nparticles-1; i >= 0; i--) {
711 printf(
"d for n = %4d -> %4d is %14.5e\n", i+1, i, clust_seq->exclusive_dmerge(i));
715 for (
int i = nparticles-1; i >= 0; i--) {
716 printf(
"y for n = %4d -> %4d is %14.5e\n", i+1, i, clust_seq->exclusive_ymerge(i));
722 if (subdcut >= 0.0) {
723 print_jets_and_sub(clust_seq->inclusive_jets(), subdcut);
728 vector<int> unique_history = clust_seq->unique_history_order();
730 vector<int> inv_unique_history(clust_seq->history().size());
731 for (
unsigned int i = 0; i < unique_history.size(); i++) {
732 inv_unique_history[unique_history[i]] = i;}
734 for (
unsigned int i = 0; i < unique_history.size(); i++) {
736 clust_seq->history()[unique_history[i]];
737 int uhp1 = el.parent1>=0 ? inv_unique_history[el.parent1] : el.parent1;
739 printf(
"%7d u %15.8e %7d u %7d u\n",i,el.
dij,uhp1, uhp2);
744 #ifdef FASTJET_ENABLE_PLUGIN_SISCONE
750 throw fastjet::Error(
"extras object for SISCone was null (this can happen with certain area types)");
751 cout <<
"most ambiguous split (difference in squared dist) = "
753 vector<fastjet::PseudoJet> stable_cones(extras->
stable_cones());
755 for (
unsigned int i = 0; i < stable_cones.size(); i++) {
757 printf(
"%5u %15.8f %15.8f %15.8f\n",
758 i,stable_cones[i].rap(),stable_cones[i].phi(),
759 stable_cones[i].perp() );
764 vector<PseudoJet> sisjets = clust_seq->inclusive_jets();
765 printf(
"\n%15s %15s %15s %12s %8s %8s\n",
"rap",
"phi",
"pt",
"user-index",
"pass",
"nconst");
766 for (
unsigned i = 0; i < sisjets.size(); i++) {
767 printf(
"%15.8f %15.8f %15.8f %12d %8d %8u\n",
768 sisjets[i].rap(), sisjets[i].phi(), sisjets[i].perp(),
769 sisjets[i].user_index(), extras->
pass(sisjets[i]),
770 (
unsigned int) clust_seq->constituents(sisjets[i]).size()
775 #endif // FASTJET_ENABLE_PLUGIN_SISCONE
778 double rho, sigma, mean_area, empty_area, n_empty_jets;
785 }
else if (do_bkgd_jetmedian) {
787 bge.set_provide_fj2_sigma(do_bkgd_fj2);
788 bge.set_cluster_sequence(*csab);
791 mean_area = bge.mean_area();
792 empty_area = bge.empty_area();
793 n_empty_jets = bge.n_empty_jets();
795 assert(do_bkgd_gridmedian);
796 double grid_rapmin, grid_rapmax;
799 bge.set_particles(particles);
802 mean_area = bge.mean_area();
806 cout <<
" rho = " << rho
807 <<
", sigma = " << sigma
808 <<
", mean_area = " << mean_area
809 <<
", empty_area = " << empty_area
810 <<
", n_empty_jets = " << n_empty_jets
815 cout <<
"Caught fastjet error, exiting gracefully" << endl;
826 if (istr != &cin)
delete istr;
837 unsigned int n_constituents = jet.
constituents().size();
838 printf(
"%15.8f %15.8f %15.8f %8u\n",
839 jet.
rap(), jet.
phi(), jet.
perp(), n_constituents);
844 void print_jets(
const vector<PseudoJet> & jets_in,
bool show_constituents) {
845 vector<PseudoJet> jets;
848 for (
unsigned int j = 0; j < jets.size(); j++) {
849 printf(
"%5u %15.8f %15.8f %15.8f %15.8f\n",
850 j,jets[j].px(),jets[j].py(),jets[j].pz(),jets[j].E());
851 if (show_constituents) {
852 vector<PseudoJet> const_jets = jets[j].constituents();
853 for (
unsigned int k = 0; k < const_jets.size(); k++) {
854 printf(
" jet%03u %15.8f %15.8f %15.8f %15.8f\n",j,const_jets[k].px(),
855 const_jets[k].py(),const_jets[k].pz(),const_jets[k].E());
863 for (
unsigned int j = 0; j < jets.size(); j++) {
864 printf(
"%5u %15.8f %15.8f %15.8f",
865 j,jets[j].rap(),jets[j].phi(),jets[j].perp());
868 if (do_areas) printf(
" %15.8f %15.8f", jets[j].area(),
869 jets[j].area_4vector().perp());
872 if (show_constituents) {
873 vector<PseudoJet> const_jets = jets[j].constituents();
874 for (
unsigned int k = 0; k < const_jets.size(); k++) {
875 printf(
" jet%03u %15.8f %15.8f %15.8f %5d\n",j,const_jets[k].rap(),
876 const_jets[k].phi(),sqrt(const_jets[k].kt2()), const_jets[k].cluster_hist_index());
883 if (rootfile !=
"") {
884 ofstream ostr(rootfile.c_str());
885 ostr <<
"# " << cmdline_p->command_line() << endl;
886 ostr <<
"# output for root" << endl;
887 assert(jets.size() > 0);
888 jets[0].validated_cs()->print_jets_for_root(jets,ostr);
897 void print_jets_and_sub (
const vector<PseudoJet> & jets,
double dcut) {
903 printf(
"Printing jets and their subjets with subdcut = %10.5f\n",dcut);
904 printf(
"%5s %15s %15s %15s %15s\n",
"jet #",
"rapidity",
905 "phi",
"pt",
"n constituents");
908 SubType sub_type = subtype_internal;
914 for (vector<PseudoJet>::const_iterator jet = sorted_jets.begin();
915 jet != sorted_jets.end(); jet++) {
921 && jet->
perp2() < dcut)
continue;
924 printf(
"%5u ",(
unsigned int) (jet - sorted_jets.begin()));
926 vector<PseudoJet> subjets;
928 if (sub_type == subtype_internal) {
933 cout <<
" for " << ddnp1 <<
" < d < " << ddn <<
" one has " << endl;
934 }
else if (sub_type == subtype_newclust_dcut) {
937 }
else if (sub_type == subtype_newclust_R) {
943 cerr <<
"unrecognized subtype for subjet finding" << endl;
948 for (
unsigned int j = 0; j < subjets.size(); j++) {
949 printf(
" -sub-%02u ",j);
950 print_jet(subjets[j]);
953 if (cspoint != 0)
delete cspoint;
968 void signal_failed_comparison(
int iev,
969 const string & message,
970 const vector<PseudoJet> & particles) {
971 cout <<
"# failed comparison, reason is " << message << endl;
972 cout <<
"# iev = " << iev << endl;
973 cout << setprecision(16);
974 for (
unsigned i = 0; i < particles.size(); i++) {
976 cout << p.px() <<
" "
981 cout <<
"#END" << endl;
985 void do_compare_strategy(
int iev,
986 const vector<PseudoJet> & particles,
989 int compare_strategy) {
994 jet_def.recombination_scheme(),
1001 const vector<ClusterSequence::history_element> & history_in = cs.
history();
1002 const vector<ClusterSequence::history_element> & history_ref = cs_ref.history();
1004 if (history_in.size() != history_ref.size()) {
1005 signal_failed_comparison(iev,
"history sizes do not match", particles);
1009 for (
unsigned i = cs.
n_particles(); i < history_in.size(); i++) {
1010 bool fail_parents = (history_in[i].parent1 != history_ref[i].parent1 ||
1011 history_in[i].parent2 != history_ref[i].parent2);
1012 bool fail_dij = (history_in[i].dij != history_ref[i].dij);
1013 if (fail_parents || fail_dij) {
1015 ostr <<
"at step " << i <<
", ";
1016 if (fail_parents) ostr <<
"parents do not match, ";
1017 if (fail_dij) ostr <<
"dij does not match, ";
1018 ostr <<
"history in (p1, p2, dij) = "
1019 << history_in[i].parent1 <<
" " << history_in[i].parent2 <<
" " << history_in[i].dij;
1020 ostr <<
", history ref (p1, p2, dij) = "
1021 << history_ref[i].parent1 <<
" " << history_ref[i].parent2 <<
" " << history_ref[i].dij;
1022 signal_failed_comparison(iev, ostr.str(), particles);