diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,6435 +1,6439 @@ +2018-12-05 Andy Buckley + + * Add fjcontrib RecursiveTools to Rivet/Tools/fjcontrib set. + 2018-11-21 Andy Buckley * Add CMS_2018_I1653948, CMS_2018_I1653948, CMS_2018_I1682495, and CMS_2018_I1690148 analyses. * Add FastJet EnergyCorrelator and rejig the internal fjcontrib bundle a little. 2018-11-15 Andy Buckley * Merge ATLAS_2017_I1517194_MU and ATLAS_2018_I1656578. * Add signed calculation optional bool argument on all deltaPhi functions. 2018-11-12 Andy Buckley * Fix CMS_2012_I1102908 efficiency calculation. Thanks to Anton Karneyeu! 2018-11-09 Andy Buckley * Remove doc dir from default top-level make 2018-09-20 Andy Buckley * Use updated ATLAS R2 muon efficiencies. * Use proper ATLAS photon efficiency functions for Runs 1 and 2, from arXiv:1606.01813 and ATL-PHYS-PUB-2016-014. 2018-08-31 Andy Buckley * Update embedded yaml-cpp to v0.6.0. 2018-08-29 Andy Buckley * Add RIVET_WEIGHT_INDEX=-1 -> ignore event weights behaviour. Slow, but sometimes useful for debug. 2018-08-29 Christian Gutschow * Allow reference data file name to be different from plugin name via setRefDataName(fname) method, aiming to unify HepData records. 2018-08-14 Andy Buckley * Version 2.6.1 release. 2018-08-08 Andy Buckley * Add a RIVET_RANDOM_SEED variable to fix the smearing random-seed engine for validation comparisons. 2018-07-19 Andy Buckley * Merge in ATLAS_2017_I1604029 (ttbar+gamma), ATLAS_2017_I1626105 (dileptonic ttbar), ATLAS_2017_I1644367 (triphotons), and ATLAS_2017_I1645627 (photon + jets). * Postpone Particles enhancement now, since the required C++11 isn't supported on lxplus7 = CentOS7. * Add MC_DILEPTON analysis. 2018-07-10 Andy Buckley * Fix HepData tarball download handling: StringIO is *not* safe anymore 2018-07-08 Andy Buckley * Add LorentzTransform factory functions direct from FourMomentum, and operator()s 2018-06-20 Andy Buckley * Add FinalState(fs, cut) augmenting constructor, and PrevFS projection machinery. Validated for a abscharge > 0 cut. * Add hasProjection() methods to ProjectionHandler and ProjectionApplier. * Clone MC_GENERIC as MC_FSPARTICLES and deprecate the badly-named original. * Fix Spires -> Inspire ID for CMS_2017_I1518399. 2018-06-04 Andy Buckley * Fix installation of (In)DirectFinalState.hh 2018-05-31 Andy Buckley * Add init-time setting of a single weight-vector index from the RIVET_WEIGHT_INDEX environment variable. To be removed in v3, but really we should have done this years ago... and we don't know how long the handover will be. 2018-05-22 Neil Warrack * Include 'unphysical' photon parents in PartonicTops' veto of prompt leptons from photon conversions. 2018-05-20 Andy Buckley * Make Particles and Jets into actual specialisations of std::vector rather than typedefs, and update surrounding classes to use them. The specialisations can implicitly cast to vectors of FourMomentum (and maybe Pseudojet). 2018-05-18 Andy Buckley * Make CmpAnaHandle::operator() const, for GCC 8 (thanks to CMS) 2018-05-07 Andy Buckley * CMS_2016_I1421646.cc: Add patch from CMS to veto if leading jets outside |y| < 2.5, rather than only considering jets in that acceptance. Thanks to CMS and Markus Seidel. 2018-04-27 Andy Buckley * Tidy keywords and luminosity entries, and add both to BSM search .info files. * Add Luminosity_fb and Keywords placeholders in mkanalysis output. 2018-04-26 Andy Buckley * Add pairMass and pairPt functions. * Add (i)discardIfAnyDeltaRLess and (i)discardIfAnyDeltaPhiLess functions. * Add normalize() methods to Cutflow and Cutflows. * Add DirectFinalState and IndirectFinalState alias headers, for forward compatibility. 'Prompt' is confusing. 2018-04-24 Andy Buckley * Add initializer_list overload for binIndex. Needed for other util functions operating on vectors. * Fix function signature bug is isMT2 overload. * Add isSameSign, isOppSign, isSameFlav, isOppFlav, and isOSSF etc. functions on PIDs and Particles. 2018-03-27 Andy Buckley * Add RatioPlotLogY key to make-plots. Thanks to Antonin Maire. 2018-02-22 Andy Buckley * Adding boolean operator syntactic sugar for composition of bool functors. * Copy & paste error fixes in implementation of BoolJetAND,OR,NOT. 2018-02-01 Andy Buckley * Make the project() and compare() methods of projections public. * Fix a serious bug in the SmearedParticles and SmearedJets compare methods. * Add string representations and streamability to the Cut objects, for debugging. 2018-01-08 Andy Buckley * Add highlighted source to HTML analysis metadata listings. 2017-12-21 Andy Buckley * Version 2.6.0 release. 2017-12-20 Andy Buckley * Typo fix in TOTEM_2012_I1220862 data -- thanks to Anton Karneyeu. 2017-12-19 Andy Buckley * Adding contributed analyses: 1 ALICE, 6 ATLAS, 1 CMS. * Fix bugged PID codes in MC_PRINTEVENT. 2017-12-13 Andy Buckley * Protect Run methods and rivet script against being told to run from a missing or unreadable file. 2017-12-11 Andy Buckley * Replace manual event count & weight handling with a YODA Counter object. 2017-11-28 Andy Buckley * Providing neater & more YODA-consistent sumW and sumW2 methods on AnalysisHandler and Analysis. * Fix to Python version check for >= 2.7.10 (patch submitted to GNU) 2017-11-17 Andy Buckley * Various improvements to DISKinematics, DISLepton, and the ZEUS 2001 analysis. 2017-11-06 Andy Buckley * Extend AOPath regex to allow dots and underscores in weight names. 2017-10-27 Andy Buckley * Add energy to the list of cuts (both as Cuts::E and Cuts::energy) * Add missing pT (rather than Et) functions to SmearedMET, although they are just copies of the MET functions for now. 2017-10-09 Andy Buckley * Embed zstr and enable transparent reading of gzipped HepMC streams. 2017-10-03 Andy Buckley * Use Lester MT2 bisection header, and expose a few more mT2 function signatures. 2017-09-26 Andy Buckley * Use generic YODA read and write functions -- enables zipped yoda.gz output. * Add ChargedLeptons enum and mode argument to ZFinder and WFinder constructors, to allow control over whether the selected charged leptons are prompt. This is mostly cosmetic/for symmetry in the case of ZFinder, since the same can be achieved by passing a PromptFinalState as the fs argument, but for WFinder it's essential since passing a prompt final state screws up the MET calculation. Both are slightly different in the treatment of the lepton dressing, although conventionally this is an area where only prompt photons are used. 2017-09-25 Andy Buckley * Add deltaR2 functions for squared distances. 2017-09-10 Andy Buckley * Add white backgrounds to make-plots main and ratio plot frames. 2017-09-05 Andy Buckley * Add CMS_2016_PAS_TOP_15_006 jet multiplicity in lepton+jets ttbar at 8 TeV analysis. * Add CMS_2017_I1467451 Higgs -> WW -> emu + MET in 8 TeV pp analysis. * Add ATLAS_2017_I1609448 Z->ll + pTmiss analysis. * Add vectorMissingEt/Pt and vectorMET/MPT convenience methods to MissingMomentum. * Add ATLAS_2017_I1598613 J/psi + mu analysis. * Add CMS SUSY 0-lepton search CMS_2017_I1594909 (unofficial implementation, validated vs. published cutflows) 2017-09-04 Andy Buckley * Change license explicitly to GPLv3, cf. MCnet3 agreement. * Add a better jet smearing resolution parametrisation, based on GAMBIT code from Matthias Danninger. 2017-08-16 Andy Buckley * Protect make-plots against NaNs in error band values (patch from Dmitry Kalinkin). 2017-07-20 Andy Buckley * Add sumPt, sumP4, sumP3 utility functions. * Record truth particles as constituents of SmearedParticles output. * Rename UnstableFinalState -> UnstableParticles, and convert ZFinder to be a general ParticleFinder rather than FinalState. 2017-07-19 Andy Buckley * Add implicit cast from FourVector & FourMomentum to Vector3, and tweak mT implementation. * Add rawParticles() to ParticleFinder, and update DressedLeptons, WFinder, ZFinder and VetoedFinalState to cope. * Add isCharged() and isChargedLepton() to Particle. * Add constituents() and rawConstituents() to Particle. * Add support for specifying bin edges as braced initializer lists rather than explicit vector. 2017-07-18 Andy Buckley * Enable methods for booking of Histo2D and Profile2D from Scatter3D reference data. * Remove IsRef annotation from autobooked histogram objects. 2017-07-17 Andy Buckley * Add pair-smearing to SmearedJets. 2017-07-08 Andy Buckley * Add Event::centrality(), for non-HepMC access to the generator value if one has been recorded -- otherwise -1. 2017-06-28 Andy Buckley * Split the smearing functions into separate header files for generic/momentum, Particle, Jet, and experiment-specific smearings & efficiencies. 2017-06-27 Andy Buckley * Add 'JetFinder' alias for JetAlg, by analogy with ParticleFinder. 2017-06-26 Andy Buckley * Convert SmearedParticles to a more general list of combined efficiency+smearing functions, with extra constructors and some variadic template cleverness to allow implicit conversions from single-operation eff and smearing function. Yay for C++11 ;-) This work based on a macro-based version of combined eff/smear functions by Karl Nordstrom -- thanks! * Add *EffFn, *SmearFn, and *EffSmearFn types to SmearingFunctions.hh. 2017-06-23 Andy Buckley * Add portable OpenMP enabling flags to AM_CXXFLAGS. 2017-06-22 Andy Buckley * Fix the smearing random number seed and make it thread-specific if OpenMP is available (not yet in the build system). * Remove the UNUSED macro and find an alternative solution for the cases where it was used, since there was a risk of macro clashes with embedding codes. * Add a -o output directory option to make-plots. * Vector4.hh: Add mT2(vec,vec) functions. 2017-06-21 Andy Buckley * Add a full set of in-range kinematics functors: ptInRange, (abs)etaInRange, (abs)phiInRange, deltaRInRange, deltaPhiInRange, deltaEtaInRange, deltaRapInRange. * Add a convenience JET_BTAG_EFFS functor with several constructors to handle mistag rates. * Add const efficiency functors operating on Particle, Jet, and FourMomentum. * Add const-efficiency constructor variants for SmearedParticles. 2017-06-21 Jon Butterworth * Fix normalisations in CMS_2016_I1454211. * Fix analysis name in ref histo paths for ATLAS_2017_I1591327. 2017-06-18 Andy Buckley * Move all standard plugin files into subdirs of src/Analyses, with some custom make rules driving rivet-buildplugin. 2017-06-18 David Grellscheid * Parallelise rivet-buildplugin, with source-file cat'ing and use of a temporary Makefile. 2016-06-18 Holger Schulz * Version 2.5.4 release! 2016-06-17 Holger Schulz * Fix 8 TeV DY (ATLAS_2016_I1467454), EL/MU bits were bissing. * Add 13 TeV DY (ATLAS_2017_I1514251) and mark ATLAS_2015_CONF_2015_041 obsolete * Add missing install statement for ATLAS_2016_I1448301.yoda/plot/info leading to segfault 2017-06-09 Andy Buckley * Slight improvements to Particle constructors. * Improvement to Beam projection: before falling back to barcodes 1 & 2, try a manual search for status=4 particles. Based on a patch from Andrii Verbytskyi. 2017-06-05 Andy Buckley * Add CMS_2016_I1430892: dilepton channel ttbar charge asymmetry analysis. * Add CMS_2016_I1413748: dilepton channel ttbar spin correlations and polarisation analysis. * Add CMS_2017_I1518399: leading jet mass for boosted top quarks at 8 TeV. * Add convenience constructors for ChargedLeptons projection. 2017-06-03 Andy Buckley * Add FinalState and Cut (optional) constructor arguments and usage to DISFinalState. Thanks to Andrii Verbytskyi for the idea and initial patch. 2017-05-23 Andy Buckley * Add ATLAS_2016_I1448301, Z/gamma cross section measurement at 8 TeV. * Add ATLAS_2016_I1426515, WW production at 8 TeV. 2016-05-19 Holger Schulz * Add BELLE measurement of semileptonic B0bar -> D*+ ell nu decays. I took the liberty to correct the data in the sense that I take the bin widhts into account in the normalisation. BELLE_2017_I1512299. This is a nice analysis as it probes the hadronic and the leptonic side of the decay so very valuable for model building and of course it is rare as it is an unfolded B measurement. 2016-05-17 Holger Schulz * Add ALEPH measurement of hadronic tau decays, ALEPH_2014_I1267648. * Add ALEPH dimuon invariant mass (OS and SS) analysis, ALEPH_2016_I1492968 * The latter needed GENKTEE FastJet algorithm so I added that FastJets * Protection against logspace exception in histobooking of MC_JetAnalysis * Fix compiler complaints about uninitialised variable in OPAL_2004. 2016-05-16 Holger Schulz * Tidy ALEPH_1999 charm fragmentation analysis and normalise to data integral. Added DSTARPLUS and DSTARMINUS to PID. 2017-05-16 Andy Buckley * Add ATLAS_2016_CONF_2016_092, inclusive jet cross sections using early 13 TeV data. * Add ATLAS_2017_I1591327, isolated diphoton + X differential cross-sections. * Add ATLAS_2017_I1589844, ATLAS_2017_I1589844_EL, ATLAS_2017_I1589844_MU: kT splittings in Z events at 8 TeV. * Add ATLAS_2017_I1509919, track-based underlying event at 13 TeV in ATLAS. * Add ATLAS_2016_I1492320_2l2j and ATLAS_2016_I1492320_3l, the WWW cross-section at 8 TeV. 2017-05-12 Andy Buckley * Add ATLAS_2016_I1449082, charge asymmetry in top quark pair production in dilepton channel. * Add ATLAS_2015_I1394865, inclusive 4-lepton/ZZ lineshape. 2017-05-11 Andy Buckley * Add ATLAS_2013_I1234228, high-mass Drell-Yan at 7 TeV. 2017-05-10 Andy Buckley * Add CMS_2017_I1519995, search for new physics with dijet angular distributions in proton-proton collisions at sqrt{(s) = 13 TeV. * Add CMS_2017_I1511284, inclusive energy spectrum in the very forward direction in proton-proton collisions at 13 TeV. * Add CMS_2016_I1486238, studies of 2 b-jet + 2 jet production in proton-proton collisions at 7 TeV. * Add CMS_2016_I1454211, boosted ttbar in pp collisions at sqrtS = 8 TeV. * Add CMS_2016_I1421646, CMS azimuthal decorrelations at 8 TeV. 2017-05-09 Andy Buckley * Add CMS_2015_I1380605, per-event yield of the highest transverse momentum charged particle and charged-particle jet. * Add CMS_2015_I1370682_PARTON, a partonic-top version of the CMS 7 TeV pseudotop ttbar differential cross-section analysis. * Adding EHS_1988_I265504 from Felix Riehn: charged-particle production in K+ p, pi+ p and pp interactions at 250 GeV/c. * Fix ALICE_2012_I1116147 for pi0 and Lambda feed-down. 2017-05-08 Andy Buckley * Add protection against leptons from QED FSR photon conversions in assigning PartonicTop decay modes. Thanks to Markus Seidel for the report and suggested fix. * Reimplement FastJets methods in terms of new static helper functions. * Add new mkClusterInputs, mkJet and mkJets static methods to FastJets, to help with direct calls to FastJet where particle lookup for constituents and ghost tags are required. * Fix Doxygen config and Makefile target to allow working with out-of-source builds. Thanks to Christian Holm Christensen. * Improve DISLepton for HERA analyses: thanks to Andrii Verbytskyi for the patch! 2017-03-30 Andy Buckley * Replace non-template Analysis::refData functions with C++11 default T=Scatter2D. 2017-03-29 Andy Buckley * Allow yes/no and true/false values for LogX, etc. plot options. * Add --errs as an alias for --mc-errs to rivet-mkhtml and rivet-cmphistos. 2017-03-08 Peter Richardson * Added 6 analyses AMY_1990_I295160, HRS_1986_I18502, JADE_1983_I190818, PLUTO_1980_I154270, TASSO_1989_I277658, TPC_1987_I235694 for charged multiplicity in e+e- at CMS energies below the Z pole * Added 2 analyses for charged multiplicity at the Z pole DELPHI_1991_I301657, OPAL_1992_I321190 * Updated ALEPH_1991_S2435284 to plot the average charged multiplcity * Added analyses OPAL_2004_I631361, OPAL_2004_I631361_qq, OPAL_2004_I648738 for gluon jets in e+e-, most need fictitious e+e- > g g process 2017-03-29 Andy Buckley * Add Cut and functor selection args to HeavyHadrons accessor methods. 2017-03-03 Andy Buckley * bin/rivet-mkanalysis: Add FastJets.hh include by default -- it's almost always used. 2017-03-02 Andy Buckley * src/Analyses/CMS_2016_I1473674.cc: Patch from CMS to use partonic tops. * src/Analyses/CMS_2015_I1370682.cc: Patch to inline jet finding from CMS. 2017-03-01 Andy Buckley * Convert DressedLeptons use of fromDecay to instead veto photons that match fromHadron() || fromHadronicTau() -- meaning that electrons and muons from leptonic taus will now be dressed. * Move Particle and Jet std::function aliases to .fhh files, and replace many uses of templates for functor arguments with ParticleSelector meta-types instead. * Move the canonical implementations of hasAncestorWith, etc. and isLastWith, etc. from ParticleUtils.hh into Particle. * Disable the event-to-event beam consistency check if the ignore-beams mode is active. 2017-02-27 Andy Buckley * Add BoolParticleAND, BoolJetOR, etc. functor combiners to Tools/ParticleUtils.hh and Tools/JetUtils.hh. 2017-02-24 Andy Buckley * Mark ATLAS_2016_CONF_2016_078 and CMS_2016_PAS_SUS_16_14 analyses as validated, since their cutflows match the documentation. 2017-02-22 Andy Buckley * Add aggregate signal regions to CMS_2016_PAS_SUS_16_14. 2017-02-18 Andy Buckley * Add getEnvParam function, for neater use of environment variable parameters with a required default. 2017-02-05 Andy Buckley * Add HasBTag and HasCTag jet functors, with lower-case aliases. 2017-01-18 Andy Buckley * Use std::function in functor-expanded method signatures on JetAlg. 2017-01-16 Andy Buckley * Convert FinalState particles() accessors to use std::function rather than a template arg for sorting, and add filtering functor support -- including a mix of filtering and sorting functors. Yay for C++11! * Add ParticleEffFilter and JetEffFilter constructors from a double (encoding constant efficiency). * Add Vector3::abseta() 2016-12-13 Andy Buckley * Version 2.5.3 release. 2016-12-12 Holger Schulz * Add cut in BZ calculation in OPAL 4 jet analysis. Paper is not clear about treatment of parallel vectors, leads to division by zero and nan-fill and subsequent YODA RangeError (OPAL_2001_S4553896) 2016-12-12 Andy Buckley * Fix bugs in SmearedJets treatment of b & c tagging rates. * Adding ATLAS_2016_I1467454 analysis (high-mass Drell-Yan at 8 TeV) * Tweak to 'convert' call to improve the thumbnail quality from rivet-mkhtml/make-plots. 2016-12-07 Andy Buckley * Require Cython 0.24 or later. 2016-12-02 Andy Buckley * Adding L3_2004_I652683 (LEP 1 & 2 event shapes) and LHCB_2014_I1262703 (Z+jet at 7 TeV). * Adding leading dijet mass plots to MC_JetAnalysis (and all derived classes). Thanks to Chris Gutschow! * Adding CMS_2012_I1298807 (ZZ cross-section at 8 TeV), CMS_2016_I1459051 (inclusive jet cross-sections at 13 TeV) and CMS_PAS_FSQ_12_020 (preliminary 7 TeV leading-track underlying event). * Adding CDF_2015_1388868 (ppbar underlying event at 300, 900, and 1960 GeV) * Adding ATLAS_2016_I1467230 (13 TeV min bias), ATLAS_2016_I1468167 (13 TeV inelastic pp cross-section), and ATLAS_2016_I1479760 (7 TeV pp double-parton scattering with 4 jets). 2016-12-01 Andy Buckley * Adding ALICE_2012_I1116147 (eta and pi0 pTs and ratio) and ATLAS_2011_I929691 (7 TeV jet frag) 2016-11-30 Andy Buckley * Fix bash bugs in rivet-buildplugin, including fixing the --cmd mode. 2016-11-28 Andy Buckley * Add LHC Run 2 BSM analyses ATLAS_2016_CONF_2016_037 (3-lepton and same-sign 2-lepton), ATLAS_2016_CONF_2016_054 (1-lepton + jets), ATLAS_2016_CONF_2016_078 (ICHEP jets + MET), ATLAS_2016_CONF_2016_094 (1-lepton + many jets), CMS_2013_I1223519 (alphaT + b-jets), and CMS_2016_PAS_SUS_16_14 (jets + MET). * Provide convenience reversed-argument versions of apply and declare methods, to allow presentational choice of declare syntax in situations where the projection argument is very long, and reduce requirements on the user's memory since this is one situation in Rivet where there is no 'most natural' ordering choice. 2016-11-24 Andy Buckley * Adding pTvec() function to 4-vectors and ParticleBase. * Fix --pwd option of the rivet script 2016-11-21 Andy Buckley * Add weights and scaling to Cutflow/s. 2016-11-19 Andy Buckley * Add Et(const ParticleBase&) unbound function. 2016-11-18 Andy Buckley * Fix missing YAML quote mark in rivet-mkanalysis. 2016-11-15 Andy Buckley * Fix constness requirements on ifilter_select() and Particle/JetEffFilter::operator(). * src/Analyses/ATLAS_2016_I1458270.cc: Fix inverted particle efficiency filtering. 2016-10-24 Andy Buckley * Add rough ATLAS and CMS photon reco efficiency functions from Delphes (ATLAS and CMS versions are identical, hmmm) 2016-10-12 Andy Buckley * Tidying/fixing make-plots custom z-ticks code. Thanks to Dmitry Kalinkin. 2016-10-03 Holger Schulz * Fix SpiresID -> InspireID in some analyses (show-analysis pointed to non-existing web page) 2016-09-29 Holger Schulz * Add Luminosity_fb to AnalysisInfo * Added some keywords and Lumi to ATLAS_2016_I1458270 2016-09-28 Andy Buckley * Merge the ATLAS and CMS from-Delphes electron and muon tracking efficiency functions into generic trkeff functions -- this is how it should be. * Fix return type typo in Jet::bTagged(FN) templated method. * Add eta and pT cuts to ATLAS truth b-jet definition. * Use rounding rather than truncation in Cutflow percentage efficiency printing. 2016-09-28 Frank Siegert * make-plots bugfix in y-axis labels for RatioPlotMode=deviation 2016-09-27 Andy Buckley * Add vector and scalar pT (rather than Et) to MissingMomentum. 2016-09-27 Holger Schulz * Analysis keyword machinery * rivet -a @semileptonic * rivet -a @semileptonic@^bdecays -a @semileptonic@^ddecays 2016-09-22 Holger Schulz * Release version 2.5.2 2016-09-21 Andy Buckley * Add a requirement to DressedLeptons that the FinalState passed as 'bareleptons' will be filtered to only contain charged leptons, if that is not already the case. Thanks to Markus Seidel for the suggestion. 2016-09-21 Holger Schulz * Add Simone Amoroso's plugin for hadron spectra (ALEPH_1995_I382179) * Add Simone Amoroso's plugin for hadron spectra (OPAL_1993_I342766) 2016-09-20 Holger Schulz * Add CMS ttbar analysis from contrib, mark validated (CMS_2016_I1473674) * Extend rivet-mkhtml --booklet to also work with pdfmerge 2016-09-20 Andy Buckley * Fix make-plots automatic YMax calculation, which had a typo from code cleaning (mea culpa!). * Fix ChargedLeptons projection, which failed to exclude neutrinos!!! Thanks to Markus Seidel. * Add templated FN filtering arg versions of the Jet::*Tags() and Jet::*Tagged() functions. 2016-09-18 Andy Buckley * Add CMS partonic top analysis (CMS_2015_I1397174) 2016-09-18 Holger Schulz * Add L3 xp analysis of eta mesons, thanks Simone (L3_1992_I336180) * Add D0 1.8 TeV jet shapes analysis, thanks Simone (D0_1995_I398175) 2016-09-17 Andy Buckley * Add has{Ancestor,Parent,Child,Descendant}With functions and HasParticle{Ancestor,Parent,Child,Descendant}With functors. 2016-09-16 Holger Schulz * Add ATLAS 8TeV ttbar analysis from contrib (ATLAS_2015_I1404878) 2016-09-16 Andy Buckley * Add particles(GenParticlePtr) to RivetHepMC.hh * Add hasParent, hasParentWith, and hasAncestorWith to Particle. 2016-09-15 Holger Schulz * Add ATLAS 8TeV dijet analysis from contrib (ATLAS_2015_I1393758) * Add ATLAS 8TeV 'number of tracks in jets' analysis from contrib (ATLAS_2016_I1419070) * Add ATLAS 8TeV g->H->WW->enumunu analysis from contrib (ATLAS_2016_I1444991) 2016-09-14 Holger Schulz * Explicit std::toupper and std::tolower to make clang happy 2016-09-14 Andy Buckley * Add ATLAS Run 2 0-lepton SUSY and monojet search papers (ATLAS_2016_I1452559, ATLAS_2016_I1458270) 2016-09-13 Andy Buckley * Add experimental Cutflow and Cutflows objects for BSM cut tracking. * Add 'direct' versions of any, all, none to Utils.hh, with an implicity bool() transforming function. 2016-09-13 Holger Schulz * Add and mark validated B+ to omega analysis (BABAR_2013_I1116411) * Add and mark validated D0 to pi- analysis (BABAR_2015_I1334693) * Add a few more particle names and use PID names in recently added analyses * Add Simone's OPAL b-frag analysis (OPAL_2003_I599181) after some cleanup and heavy usage of new features * Restructured DELPHI_2011_I890503 in the same manner --- picks up a few more B-hadrons now (e.g. 20523 and such) * Clean up and add ATLAS 8TeV MinBias (from contrib ATLAS_2016_I1426695) 2016-09-12 Andy Buckley * Add a static constexpr DBL_NAN to Utils.hh for convenience, and move some utils stuff out of MathHeader.hh 2016-09-12 Holger Schulz * Add count function to Tools/Utils.h * Add and mark validated B0bar and Bminus-decay to pi analysis (BELLE_2013_I1238273) * Add and mark validated B0-decay analysis (BELLE_2011_I878990) * Add and mark validated B to D decay analysis (BELLE_2011_I878990) 2016-09-08 Andy Buckley * Add C-array version of multi-target Analysis::scale() and normalize(), and fix (semantic) constness. * Add == and != operators for cuts applied to integers. * Add missing delta{Phi,Eta,Rap}{Gtr,Less} functors to ParticleBaseUtils.hh 2016-09-07 Andy Buckley * Add templated functor filtering args to the Particle parent/child/descendent methods. 2016-09-06 Andy Buckley * Add ATLAS Run 1 medium and tight electron ID efficiency functions. * Update configure scripts to use newer (Py3-safe) Python testing macros. 2016-09-02 Andy Buckley * Add isFirstWith(out), isLastWith(out) functions, and functor wrappers, using Cut and templated function/functor args. * Add Particle::parent() method. * Add using import/typedef of HepMC *Ptr types (useful step for HepMC 2.07 and 3.00). * Various typo fixes (and canonical renaming) in ParticleBaseUtils functor collection. * Add ATLAS MV2c10 and MV2c20 b-tagging effs to SmearingFunctions.hh collection. 2016-09-01 Andy Buckley * Add a PartonicTops projection. * Add overloaded versions of the Event::allParticles() method with selection Cut or templated selection function arguments. 2016-08-25 Andy Buckley * Add rapidity scheme arg to DeltaR functor constructors. 2016-08-23 Andy Buckley * Provide an Analysis::bookCounter(d,x,y, title) function, for convenience and making the mkanalysis template valid. * Improve container utils functions, and provide combined remove_if+erase filter_* functions for both select- and discard-type selector functions. 2016-08-22 Holger Schulz * Bugfix in rivet-mkhtml (NoneType: ana.spiresID() --> spiresid) * Added include to Rivet/Tools/Utils.h to make gcc6 happy 2016-08-22 Andy Buckley * Add efffilt() functions and Particle/JetEffFilt functors to SmearingFunctions.hh 2016-08-20 Andy Buckley * Adding filterBy methods for Particle and Jet which accept generic boolean functions as well as the Cut specialisation. 2016-08-18 Andy Buckley * Add a Jet::particles(Cut&) method, for inline filtering of jet constituents. * Add 'conjugate' behaviours to container head and tail functions via negative length arg values. 2016-08-15 Andy Buckley * Add convenience headers for including all final-state and smearing projections, to save user typing. 2016-08-12 Andy Buckley * Add standard MET functions for ATLAS R1 (and currently copies for R2 and CMS). * Add lots of vector/container helpers for e.g. container slicing, summing, and min/max calculation. * Adapt SmearedMET to take *two* arguments, since SET is typically used to calculate MET resolution. * Adding functors for computing vector & ParticleBase differences w.r.t. another vector. 2016-08-12 Holger Schulz * Implemented a few more cuts in prompt photon analysis (CDF_1993_S2742446) but to no avail, the rise of the data towards larger costheta values cannot be reproduced --- maybe this is a candidate for more scrutiny and using the boosting machinery such that the c.m. cuts can be done in a non-approximate way 2016-08-11 Holger Schulz * Rename CDF_2009_S8383952 to CDF_2009_I856131 due to invalid Spires entry. * Add InspireID to all analysis known by their Spires key 2016-08-09 Holger Schulz * Release 2.5.1 2016-08-08 Andy Buckley * Add a simple MC_MET analysis for out-of-the-box MET distribution testing. 2016-08-08 Holger Schulz * Add DELPHI_2011_I890503 b-quark fragmentation function measurement, which superseded DELPHI_2002_069_CONF_603. The latter is marked OBSOLETE. 2016-08-05 Holger Schulz * Use Jet mass and energy smearing in CDF_1997_... six-jet analysis, mark validated. * Mark CDF_2001_S4563131 validated * D0_1996_S3214044 --- cut on jet Et rather than pT, fix filling of costheta and theta plots, mark validated. Concerning the jet algorithm, I tried with the implementation of fastjet fastjet/D0RunIConePlugin.hh but that really does not help. * D0_1996_S3324664 --- fix normalisations, sorting jets properly now, cleanup and mark validated. 2016-08-04 Holger Schulz * Use Jet mass and energy smearing in CDF_1996_S310 ... jet properties analysis. Cleanup analysis and mark validated. Added some more run info. The same for CDF_1996_S334... (pretty much the same cuts, different observables). * Minor fixes in SmearedJets projection 2016-08-03 Andy Buckley * Protect SmearedJets against loss of tagging information if a momentum smearing function is used (rather than a dedicated Jet smearing fn) via implicit casts. 2016-08-02 Andy Buckley * Add SmearedMET projection, wrapping MissingMomentum. * Include base truth-level projections in SmearedParticles/Jets compare() methods. 2016-07-29 Andy Buckley * Rename TOTEM_2012_002 to proper TOTEM_2012_I1220862 name. * Remove conditional building of obsolete, preliminary and unvalidated analyses. Now always built, since there are sufficient warnings. 2016-07-28 Holger Schulz * Mark D0_2000... W pT analysis validated * Mark LHCB_2011_S919... phi meson analysis validated 2016-07-25 Andy Buckley * Add unbound accessors for momentum properties of ParticleBase objects. * Add Rivet/Tools/ParticleBaseUtils.hh to collect tools like functors for particle & jet filtering. * Add vector versions of Analysis::scale() and ::normalize(), for batched scaling. * Add Analysis::scale() and Analysis::divide() methods for Counter types. * Utils.hh: add a generic sum() function for containers, and use auto in loop to support arrays. * Set data path as well as lib path in scripts with --pwd option, and use abs path to $PWD. * Add setAnalysisDataPaths and addAnalysisDataPath to RivetPaths.hh/cc and Python. * Pass absolutized RIVET_DATA_PATH from rivet-mkhtml to rivet-cmphistos. 2016-07-24 Holger Schulz * Mark CDF_2008_S77... b jet shapes validated * Added protection against low stats yoda exception in finalize for that analysis 2016-07-22 Andy Buckley * Fix newly introduced bug in make-plots which led to data point markers being skipped for all but the last bin. 2016-07-21 Andy Buckley * Add pid, abspid, charge, abscharge, charge3, and abscharge3 Cut enums, handled by Particle cut targets. * Add abscharge() and abscharge3() methods to Particle. * Add optional Cut and duplicate-removal flags to Particle children & descendants methods. * Add unbound versions of Particle is* and from* methods, for easier functor use. * Add Particle::isPrompt() as a member rather than unbound function. * Add protections against -ve mass from numerical precision errors in smearing functions. 2016-07-20 Andy Buckley * Move several internal system headers into the include/Rivet/Tools directory. * Fix median-computing safety logic in ATLAS_2010_S8914702 and tidy this and @todo markers in several similar analyses. * Add to_str/toString and stream functions for Particle, and a bit of Particle util function reorganisation. * Add isStrange/Charm/Bottom PID and Particle functions. * Add RangeError exception throwing from MathUtils.hh stats functions if given empty/mismatched datasets. * Add Rivet/Tools/PrettyPrint.hh, based on https://louisdx.github.io/cxx-prettyprint/ * Allow use of path regex group references in .plot file keyed values. 2016-07-20 Holger Schulz * Fix the --nskip behaviour on the main rivet script. 2016-07-07 Andy Buckley * Release version 2.5.0 2016-07-01 Andy Buckley * Fix pandoc interface flag version detection. 2016-06-28 Andy Buckley * Release version 2.4.3 * Add ATLAS_2016_I1468168 early ttbar fully leptonic fiducial cross-section analysis at 13 TeV. 2016-06-21 Andy Buckley * Add ATLAS_2016_I1457605 inclusive photon analysis at 8 TeV. 2016-06-15 Andy Buckley * Add a --show-bibtex option to the rivet script, for convenient outputting of a BibTeX db for the used analyses. 2016-06-14 Andy Buckley * Add and rename 4-vector boost calculation methods: new methods beta, betaVec, gamma & gammaVec are now preferred to the deprecated boostVector method. 2016-06-13 Andy Buckley * Add and use projection handling methods declare(proj, pname) and apply(evt, pname) rather than the longer and explicitly 'projectiony' addProjection & applyProjection. * Start using the DEFAULT_RIVET_ANALYSIS_CTOR macro (newly created preferred alias to long-present DEFAULT_RIVET_ANA_CONSTRUCTOR) * Add a DEFAULT_RIVET_PROJ_CLONE macro for implementing the clone() method boiler-plate code in projections. 2016-06-10 Andy Buckley * Add a NonPromptFinalState projection, and tweak the PromptFinalState and unbound Particle functions a little in response. May need some more finessing. * Add user-facing aliases to ProjectionApplier add, get, and apply methods... the templated versions of which can now be called without using the word 'projection', which makes the function names a bit shorter and pithier, and reduces semantic repetition. 2016-06-10 Andy Buckley * Adding ATLAS_2015_I1397635 Wt at 8 TeV analysis. * Adding ATLAS_2015_I1390114 tt+b(b) at 8 TeV analysis. 2016-06-09 Andy Buckley * Downgrade some non-fatal error messages from ERROR to WARNING status, because *sigh* ATLAS's software treats any appearance of the word 'ERROR' in its log file as a reason to report the job as failed (facepalm). 2016-06-07 Andy Buckley * Adding ATLAS 13 TeV minimum bias analysis, ATLAS_2016_I1419652. 2016-05-30 Andy Buckley * pyext/rivet/util.py: Add pandoc --wrap/--no-wrap CLI detection and batch conversion. * bin/rivet: add -o as a more standard 'output' option flag alias to -H. 2016-05-23 Andy Buckley * Remove the last ref-data bin from table 16 of ATLAS_2010_S8918562, due to data corruption. The corresponding HepData record will be amended by ATLAS. 2016-05-12 Holger Schulz * Mark ATLAS_2012_I1082009 as validated after exhaustive tests with Pythia8 and Sherpa in inclusive QCD mode. 2016-05-11 Andy Buckley * Specialise return error codes from the rivet script. 2016-05-11 Andy Buckley * Add Event::allParticles() to provide neater (but not *helpful*) access to Rivet-wrapped versions of the raw particles in the Event::genEvent() record, and hence reduce HepMC digging. 2016-05-05 Andy Buckley * Version 2.4.2 release! * Update SLD_2002_S4869273 ref data to match publication erratum, now updated in HepData. Thanks to Peter Skands for the report and Mike Whalley / Graeme Watt for the quick fix and heads-up. 2016-04-27 Andy Buckley * Add CMS_2014_I1305624 event shapes analysis, with standalone variable calculation struct embedded in an unnamed namespace. 2016-04-19 Andy Buckley * Various clean-ups and fixes in ATLAS analyses using isolated photons with median pT density correction. 2016-04-18 Andy Buckley * Add transformBy(LT) methods to Particle and Jet. * Add mkObjectTransform and mkFrameTransform factory methods to LorentzTransform. 2016-04-17 Andy Buckley * Add null GenVertex protection in Particle children & descendants methods. 2016-04-15 Andy Buckley * Add ATLAS_2015_I1397637, ATLAS 8 TeV boosted top cross-section vs. pT 2016-04-14 Andy Buckley * Add a --no-histos argument to the rivet script. 2016-04-13 Andy Buckley * Add ATLAS_2015_I1351916 (8 TeV Z FB asymmetry) and ATLAS_2015_I1408516 (8 TeV Z phi* and pT) analyses, and their _EL, _MU variants. 2016-04-12 Andy Buckley * Patch PID utils for ordering issues in baryon decoding. 2016-04-11 Andy Buckley * Actually implement ZEUS_2001_S4815815... only 10 years late! 2016-04-08 Andy Buckley * Add a --guess-prefix flag to rivet-config, cf. fastjet-config. * Add RIVET_DATA_PATH variable and related functions in C++ and Python as a common first-fallback for RIVET_REF_PATH, RIVET_INFO_PATH, and RIVET_PLOT_PATH. * Add --pwd options to rivet-mkhtml and rivet-cmphistos 2016-04-07 Andy Buckley * Remove implicit conventional event rotation for HERA -- this needs to be done explicitly from now. * Add comBoost functions and methods to Beam.hh, and tidy LorentzTransformation. * Restructure Beam projection functions for beam particle and sqrtS extraction, and add asqrtS functions. * Rename and improve PID and Particle Z,A,lambda functions -> nuclZ,nuclA,nuclNlambda. 2016-04-05 Andy Buckley * Improve binIndex function, with an optional argument to allow overflow lookup, and add it to testMath. * Adding setPE, setPM, setPtEtaPhiM, etc. methods and corresponding mk* static methods to FourMomentum, as well as adding more convenience aliases and vector attributes for completeness. Coordinate conversion functions taken from HEPUtils::P4. New attrs also mapped to ParticleBase. 2016-03-29 Andy Buckley * ALEPH_1996_S3196992.cc, ATLAS_2010_S8914702.cc, ATLAS_2011_I921594.cc, ATLAS_2011_S9120807.cc, ATLAS_2012_I1093738.cc, ATLAS_2012_I1199269.cc, ATLAS_2013_I1217867.cc, ATLAS_2013_I1244522.cc, ATLAS_2013_I1263495.cc, ATLAS_2014_I1307756.cc, ATLAS_2015_I1364361.cc, CDF_2008_S7540469.cc, CMS_2015_I1370682.cc, MC_JetSplittings.cc, STAR_2006_S6870392.cc: Updates for new FastJets interface, and other cleaning. * Deprecate 'standalone' FastJets constructors -- they are misleading. * More improvements around jets, including unbound conversion and filtering routines between collections of Particles, Jets, and PseudoJets. * Place 'Cut' forward declaration in a new Cuts.fhh header. * Adding a Cuts::OPEN extern const (a bit more standard- and constant-looking than Cuts::open()) 2016-03-28 Andy Buckley * Improvements to FastJets constructors, including specification of optional AreaDefinition as a constructor arg, disabling dodgy no-FS constructors which I suspect don't work properly in the brave new world of automatic ghost tagging, using a bit of judicious constructor delegation, and completing/exposing use of shared_ptr for internal memory management. 2016-03-26 Andy Buckley * Remove Rivet/Tools/RivetBoost.hh and Boost references from rivet-config, rivet-buildplugin, and configure.ac. It's gone ;-) * Replace Boost assign usage with C++11 brace initialisers. All Boost use is gone from Rivet! * Replace Boost lexical_cast and string algorithms. 2016-03-25 Andy Buckley * Bug-fix in semi-leptonic top selection of CMS_2015_I1370682. 2016-03-12 Andy Buckley * Allow multi-line major tick labels on make-plots linear x and y axes. Linebreaks are indicated by \n in the .dat file. 2016-03-09 Andy Buckley * Release 2.4.1 2016-03-03 Andy Buckley * Add a --nskip flag to the rivet command-line tool, to allow processing to begin in the middle of an event file (useful for batched processing of large files, in combination with --nevts) 2016-03-03 Holger Schulz * Add ATLAS 7 TeV event shapes in Z+jets analysis (ATLAS_2016_I1424838) 2016-02-29 Andy Buckley * Update make-plots to use multiprocessing rather than threading. * Add FastJets::trimJet method, thanks to James Monk for the suggestion and patch. * Add new preferred name PID::charge3 in place of PID::threeCharge, and also convenience PID::abscharge and PID::abscharge3 functions -- all derived from changes in external HEPUtils. * Add analyze(const GenEvent*) and analysis(string&) methods to AnalysisHandler, plus some docstring improvements. 2016-02-23 Andy Buckley * New ATLAS_2015_I1394679 analysis. * New MC_HHJETS analysis from Andreas Papaefstathiou. * Ref data updates for ATLAS_2013_I1219109, ATLAS_2014_I1312627, and ATLAS_2014_I1319490. * Add automatic output paging to 'rivet --show-analyses' 2016-02-16 Andy Buckley * Apply cross-section unit fixes and plot styling improvements to ATLAS_2013_I1217863 analyses, thanks to Christian Gutschow. * Fix to rivet-cmphistos to avoid overwriting RatioPlotYLabel if already set via e.g. the PLOT pseudo-file. Thanks to Johann Felix v. Soden-Fraunhofen. 2016-02-15 Andy Buckley * Add Analysis::bookCounter and some machinery in rivet-cmphistos to avoid getting tripped up by unplottable (for now) data types. * Add --font and --format options to rivet-mkhtml and make-plots, to replace the individual flags used for that purpose. Not fully cleaned up, but a necessary step. * Add new plot styling options to rivet-cmphistos and rivet-mkhtml. Thanks to Gavin Hesketh. * Modify rivet-cmphistos and rivet-mkhtml to apply plot hiding if *any* path component is hidden by an underscore prefix, as implemented in AOPath, plus other tidying using new AOPath methods. * Add pyext/rivet/aopaths.py, containing AOPath object for central & standard decoding of Rivet-standard analysis object path structures. 2016-02-12 Andy Buckley * Update ParticleIdUtils.hh (i.e. PID:: functions) to use the functions from the latest version of MCUtils' PIDUtils.h. 2016-01-15 Andy Buckley * Change rivet-cmphistos path matching logic from match to search (user can add explicit ^ marker if they want match semantics). 2015-12-20 Andy Buckley * Improve linspace (and hence also logspace) precision errors by using multiplication rather than repeated addition to build edge list (thanks to Holger Schulz for the suggestion). 2015-12-15 Andy Buckley * Add cmphistos and make-plots machinery for handling 'suffix' variations on plot paths, currently just by plotting every line, with the variations in a 70% faded tint. * Add Beam::pv() method for finding the beam interaction primary vertex 4-position. * Add a new Particle::setMomentum(E,x,y,z) method, and an origin position member which is automatically populated from the GenParticle, with access methods corresponding to the momentum ones. 2015-12-10 Andy Buckley * make-plots: improve custom tick attribute handling, allowing empty lists. Also, any whitespace now counts as a tick separator -- explicit whitespace in labels should be done via ~ or similar LaTeX markup. 2015-12-04 Andy Buckley * Pro-actively use -m/-M arguments when initially loading histograms in mkhtml, *before* passing them to cmphistos. 2015-12-03 Andy Buckley * Move contains() and has_key() functions on STL containers from std to Rivet namespaces. * Adding IsRef attributes to all YODA refdata files; this will be used to replace the /REF prefix in Rivet v3 onwards. The migration has also removed leading # characters from BEGIN/END blocks, as per YODA format evolution: new YODA versions as required by current Rivet releases are able to read both the old and new formats. 2015-12-02 Andy Buckley * Add handling of a command-line PLOT 'file' argument to rivet-mkhtml, cf. rivet-cmphistos. * Improvements to rivet-mkhtml behaviour re. consistency with rivet-cmphistos in how muti-part histo paths are decomposed into analysis-name + histo name, and removal of 'NONE' strings. 2015-11-30 Andy Buckley * Relax rivet/plotinfo.py pattern matching on .plot file components, to allow leading whitespace and around = signs, and to make the leading # optional on BEGIN/END blocks. 2015-11-26 Andy Buckley * Write out intermediate histogram files by default, with event interval of 10k. 2015-11-25 Andy Buckley * Protect make-plots against lock-up due to partial pstricks command when there are no data points. 2015-11-17 Andy Buckley * rivet-cmphistos: Use a ratio label that doesn't mention 'data' when plotting MC vs. MC. 2015-11-12 Andy Buckley * Tweak plot and subplot sizing defaults in make-plots so the total canvas is always the same size by default. 2015-11-10 Andy Buckley * Handle 2D histograms better in rivet-cmphistos (since they can't be overlaid) 2015-11-05 Andy Buckley * Allow comma-separated analysis name lists to be passed to a single -a/--analysis/--analyses option. * Convert namespace-global const variables to be static, to suppress compiler warnings. * Use standard MAX_DBL and MAX_INT macros as a source for MAXDOUBLE and MAXINT, to suppress GCC5 warnings. 2015-11-04 Holger Schulz * Adding LHCB inelastic xsection measurement (LHCB_2015_I1333223) * Adding ATLAS colour flow in ttbar->semileptonic measurement (ATLAS_2015_I1376945) 2015-10-07 Chris Pollard * Release 2.4.0 2015-10-06 Holger Schulz * Adding CMS_2015_I1327224 dijet analysis (Mjj>2 TeV) 2015-10-03 Holger Schulz * Adding CMS_2015_I1346843 Z+gamma 2015-09-30 Andy Buckley * Important improvement in FourVector & FourMomentum: new reverse() method to return a 4-vector in which only the spatial component has been inverted cf. operator- which flips the t/E component as well. 2015-09-28 Holger Schulz * Adding D0_2000_I503361 ZPT at 1800 GeV 2015-09-29 Chris Pollard * Adding ATLAS_2015_CONF_2015_041 2015-09-29 Chris Pollard * Adding ATLAS_2015_I1387176 2015-09-29 Chris Pollard * Adding ATLAS_2014_I1327229 2015-09-28 Chris Pollard * Adding ATLAS_2014_I1326641 2015-09-28 Holger Schulz * Adding CMS_2013_I1122847 FB assymetry in DY analysis 2015-09-28 Andy Buckley * Adding CMS_2015_I1385107 LHA pp 2.76 TeV track-jet underlying event. 2015-09-27 Andy Buckley * Adding CMS_2015_I1384119 LHC Run 2 minimum bias dN/deta with no B field. 2015-09-25 Andy Buckley * Adding TOTEM_2014_I1328627 forward charged density in eta analysis. 2015-09-23 Andy Buckley * Add CMS_2015_I1310737 Z+jets analysis. * Allow running MC_{W,Z}INC, MC_{W,Z}JETS as separate bare lepton analyses. 2015-09-23 Andy Buckley * FastJets now allows use of FastJet pure ghosts, by excluding them from the constituents of Rivet Jet objects. Thanks to James Monk for raising the issue and providing a patch. 2015-09-15 Andy Buckley * More MissingMomentum changes: add optional 'mass target' argument when retrieving the vector sum as a 4-momentum, with the mass defaulting to 0 rather than sqrt(sum(E)^2 - sum(p)^2). * Require Boost 1.55 for robust compilation, as pointed out by Andrii Verbytskyi. 2015-09-10 Andy Buckley * Allow access to MissingMomentum projection via WFinder. * Adding extra methods to MissingMomentum, to make it more user-friendly. 2015-09-09 Andy Buckley * Fix factor of 2 in LHCB_2013_I1218996 normalisation, thanks to Felix Riehn for the report. 2015-08-20 Frank Siegert * Add function to ZFinder to retrieve all fiducial dressed leptons, e.g. to allow vetoing on a third one (proposed by Christian Gutschow). 2015-08-18 Andy Buckley * Rename xs and counter AOs to start with underscores, and modify rivet-cmphistos to skip AOs whose basenames start with _. 2015-08-17 Andy Buckley * Add writing out of cross-section and total event counter by default. Need to add some name protection to avoid them being plotted. 2015-08-16 Andy Buckley * Add templated versions of Analysis::refData() to use data types other than Scatter2DPtr, and convert the cached ref data store to generic AnalysisObjectPtrs to make it possible. 2015-07-29 Andy Buckley * Add optional Cut arguments to all the Jet tag methods. * Add exception handling and pre-emptive testing for a non-writeable output directory (based on patch from Lukas Heinrich). 2015-07-24 Andy Buckley * Version 2.3.0 release. 2015-07-02 Holger Schulz * Tidy up ATLAS higgs combination analysis. * Add ALICE kaon, pion analysis (ALICE_2015_I1357424) * Add ALICE strange baryon analysis (ALICE_2014_I1300380) * Add CDF ZpT measurement in Z->ee events analysis (CDF_2012_I1124333) * Add validated ATLAS W+charm measurement (ATLAS_2014_I1282447) * Add validated CMS jet and dijet analysis (CMS_2013_I1208923) 2015-07-01 Andy Buckley * Define a private virtual operator= on Projection, to block 'sliced' accidental value copies of derived class instances. * Add new muon-in-jet options to FastJet constructors, pass that and invisibles enums correctly to JetAlg, tweak the default strategies, and add a FastJets constructor from a fastjet::JetDefinition (while deprecating the plugin-by-reference constructor). 2015-07-01 Holger Schulz * Add D0 phi* measurement (D0_2015_I1324946). * Remove WUD and MC_PHOTONJETUE analyses * Don't abort ATLAS_2015_I1364361 if there is no stable Higgs print a warning instead and veto event 2015-07-01 Andy Buckley * Add all, none, from-decay muon filtering options to JetAlg and FastJets. * Rename NONPROMPT_INVISIBLES to DECAY_INVISIBLES for clarity & extensibility. * Remove FastJets::ySubJet, splitJet, and filterJet methods -- they're BDRS-paper-specific and you can now use the FastJet objects directly to do this and much more. * Adding InvisiblesStrategy to JetAlg, using it rather than a bool in the useInvisibles method, and updating FastJets to use this approach for its particle filtering and to optionally use the enum in the constructor arguments. The new default invisibles-using behaviour is to still exclude _prompt_ invisibles, and the default is still to exclude them all. Only one analysis (src/Analyses/STAR_2006_S6870392.cc) required updating, since it was the only one to be using the FastJets legacy seed_threshold constructor argument. * Adding isVisible method to Particle, taken from VisibleFinalState (which now uses this). 2015-06-30 Andy Buckley * Marking many old & superseded ATLAS analyses as obsolete. * Adding cmpMomByMass and cmpMomByAscMass sorting functors. * Bump version to 2.3.0 and require YODA > 1.4.0 (current head at time of development). 2015-06-08 Andy Buckley * Add handling of -m/-M flags on rivet-cmphistos and rivet-mkhtml, moving current rivet-mkhtml -m/-M to -a/-A (for analysis name pattern matching). Requires YODA head (will be YODA 1.3.2 of 1.4.0). * src/Analyses/ATLAS_2015_I1364361.cc: Now use the built-in prompt photon selecting functions. * Tweak legend positions in MC_JETS .plot file. * Add a bit more debug output from ZFinder and WFinder. 2015-05-24 Holger Schulz * Normalisation discussion concerning ATLAS_2014_I1325553 is resolved. Changed YLabel accordingly. 2015-05-19 Holger Schulz * Add (preliminary) ATLAS combined Higgs analysis (ATLAS_2015_I1364361). Data will be updated and more histos added as soon as paper is published in journal. For now using data taken from public ressource https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/PAPERS/HIGG-2014-11/ 2015-05-19 Peter Richardson * Fix ATLAS_2014_I1325553 normalisation of histograms was wrong by factor of two |y| vs y problem 2015-05-01 Andy Buckley * Fix MC_HJETS/HINC/HKTSPLITTINGS analyses to (ab)use the ZFinder with a mass range of 115-135 GeV and a mass target of 125 GeV (was previously 115-125 and mass target of mZ) 2015-04-30 Andy Buckley * Removing uses of boost::assign::list_of, preferring the existing comma-based assign override for now, for C++11 compatibility. * Convert MC_Z* analysis finalize methods to use scale() rather than normalize(). 2015-04-01 Holger Schulz * Add CMS 7 TeV rapidity gap analysis (CMS_2015_I1356998). * Remove FinalState Projection. 2015-03-30 Holger Schulz * Add ATLAS 7 TeV photon + jets analysis (ATLAS_2013_I1244522). 2015-03-26 Andy Buckley * Updates for HepMC 2.07 interface constness improvements. 2015-03-25 Holger Schulz * Add ATLAS double parton scattering in W+2j analysis (ATLAS_2013_I1216670). 2015-03-24 Andy Buckley * 2.2.1 release! 2015-03-23 Holger Schulz * Add ATLAS differential Higgs analysis (ATLAS_2014_I1306615). 2015-03-19 Chris Pollard * Add ATLAS V+gamma analyses (ATLAS_2013_I1217863) 2015-03-20 Andy Buckley * Adding ATLAS R-jets analysis i.e. ratios of W+jets and Z+jets observables (ATLAS_2014_I1312627 and _EL, _MU variants) * include/Rivet/Tools/ParticleUtils.hh: Adding same/oppSign and same/opp/diffCharge functions, operating on two Particles. * include/Rivet/Tools/ParticleUtils.hh: Adding HasAbsPID functor and removing optional abs arg from HasPID. 2015-03-19 Andy Buckley * Mark ATLAS_2012_I1083318 as VALIDATED and fix d25-x01-y02 ref data. 2015-03-19 Chris Pollard * Add ATLAS W and Z angular analyses (ATLAS_2011_I928289) 2015-03-19 Andy Buckley * Add LHCb charged particle multiplicities and densities analysis (LHCB_2014_I1281685) * Add LHCb Z y and phi* analysis (LHCB_2012_I1208102) 2015-03-19 Holger Schulz * Add ATLAS dijet analysis (ATLAS_2014_I1325553). * Add ATLAS Z pT analysis (ATLAS_2014_I1300647). * Add ATLAS low-mass Drell-Yan analysis (ATLAS_2014_I1288706). * Add ATLAS gap fractions analysis (ATLAS_2014_I1307243). 2015-03-18 Andy Buckley * Adding CMS_2014_I1298810 and CMS_2014_I1303894 analyses. 2015-03-18 Holger Schulz * Add PDG_TAUS analysis which makes use of the TauFinder. * Add ATLAS 'traditional' Underlying Event in Z->mumu analysis (ATLAS_2014_I1315949). 2015-03-18 Andy Buckley * Change UnstableFinalState duplicate resolution to use the last in a chain rather than the first. 2015-03-17 Holger Schulz * Update Taufinder to use decaytyoe (can be HADRONIC, LEPTONIC or ANY), in FastJet.cc --- set TauFinder mode to hadronic for tau-tagging 2015-03-16 Chris Pollard * Removed fuzzyEquals() from Vector3::angle() 2015-03-16 Andy Buckley * Adding Cuts-based constructor to PrimaryHadrons. * Adding missing compare() method to HeavyHadrons projection. 2015-03-15 Chris Pollard * Adding FinalPartons projection which selects the quarks and gluons immediately before hadronization 2015-03-05 Andy Buckley * Adding Cuts-based constructors and other tidying in UnstableFinalState and HeavyHadrons 2015-03-03 Andy Buckley * Add support for a PLOT meta-file argument to rivet-cmphistos. 2015-02-27 Andy Buckley * Improved time reporting. 2015-02-24 Andy Buckley * Add Particle::fromHadron and Particle::fromPromptTau, and add a boolean 'prompt' argument to Particle::fromTau. * Fix WFinder use-transverse-mass property setting. Thanks to Christian Gutschow. 2015-02-04 Andy Buckley * Add more protection against math domain errors with log axes. * Add some protection against nan-valued points and error bars in make-plots. 2015-02-03 Andy Buckley * Converting 'bitwise' to 'logical' Cuts combinations in all analyses. 2015-02-02 Andy Buckley * Use vector MET rather than scalar VET (doh...) in WFinder cut. Thanks to Ines Ochoa for the bug report. * Updating and tidying analyses with deprecation warnings. * Adding more Cuts/FS constructors for Charged,Neutral,UnstableFinalState. * Add &&, || and ! operators for without-parens-warnings Cut combining. Note these don't short-circuit, but this is ok since Cut comparisons don't have side-effects. * Add absetaIn, absrapIn Cut range definitions. * Updating use of sorted particle/jet access methods and cmp functors in projections and analyses. 2014-12-09 Andy Buckley * Adding a --cmd arg to rivet-buildplugin to allow the output paths to be sed'ed (to help deal with naive Grid distribution). For example BUILDROOT=`rivet-config --prefix`; rivet-buildplugin PHOTONS.cc --cmd | sed -e "s:$BUILDROOT:$SITEROOT:g" 2014-11-26 Andy Buckley * Interface improvements in DressedLeptons constructor. * Adding DEPRECATED macro to throw compiler deprecation warnings when using deprecated features. 2014-11-25 Andy Buckley * Adding Cut-based constructors, and various constructors with lists of PDG codes to IdentifiedFinalState. 2014-11-20 Andy Buckley * Analysis updates (ATLAS, CMS, CDF, D0) to apply the changes below. * Adding JetAlg jets(Cut, Sorter) methods, and other interface improvements for cut and sorted ParticleBase retrieval from JetAlg and ParticleFinder projections. Some old many-doubles versions removed, syntactic sugar sorting methods deprecated. * Adding Cuts::Et and Cuts::ptIn, Cuts::etIn, Cuts::massIn. * Moving FastJet includes, conversions, uses etc. into Tools/RivetFastJet.hh 2014-10-07 Andy Buckley * Fix a bug in the isCharmHadron(pid) function and remove isStrange* functions. 2014-09-30 Andy Buckley * 2.2.0 release! * Mark Jet::containsBottom and Jet::containsCharm as deprecated methods: use the new methods. Analyses updated. * Add Jet::bTagged(), Jet::cTagged() and Jet::tauTagged() as ghost-assoc-based replacements for the 'contains' tagging methods. 2014-09-17 Andy Buckley * Adding support for 1D and 3D YODA scatters, and helper methods for calling the efficiency, asymm and 2D histo divide functions. 2014-09-12 Andy Buckley * Adding 5 new ATLAS analyses: ATLAS_2011_I921594: Inclusive isolated prompt photon analysis with full 2010 LHC data ATLAS_2013_I1263495: Inclusive isolated prompt photon analysis with 2011 LHC data ATLAS_2014_I1279489: Measurements of electroweak production of dijets + $Z$ boson, and distributions sensitive to vector boson fusion ATLAS_2014_I1282441: The differential production cross section of the $\phi(1020)$ meson in $\sqrt{s}=7$ TeV $pp$ collisions measured with the ATLAS detector ATLAS_2014_I1298811: Leading jet underlying event at 7 TeV in ATLAS * Adding a median(vector) function and fixing the other stats functions to operate on vector rather than vector. 2014-09-03 Andy Buckley * Fix wrong behaviour of LorentzTransform with a null boost vector -- thanks to Michael Grosse. 2014-08-26 Andy Buckley * Add calc() methods to Hemispheres as requested, to allow it to be used with Jet or FourMomentum inputs outside the normal projection system. 2014-08-17 Andy Buckley * Improvements to the particles methods on ParticleFinder/FinalState, in particular adding the range of cuts arguments cf. JetAlg (and tweaking the sorted jets equivalent) and returning as a copy rather than a reference if cut/sorted to avoid accidentally messing up the cached copy. * Creating ParticleFinder projection base class, and moving Particles-accessing methods from FinalState into it. * Adding basic forms of MC_ELECTRONS, MC_MUONS, and MC_TAUS analyses. 2014-08-15 Andy Buckley * Version bump to 2.2.0beta1 for use at BOOST and MCnet school. 2014-08-13 Andy Buckley * New analyses: ATLAS_2014_I1268975 (high mass dijet cross-section at 7 TeV) ATLAS_2014_I1304688 (jet multiplicity and pT at 7 TeV) ATLAS_2014_I1307756 (scalar diphoton resonance search at 8 TeV -- no histograms!) CMSTOTEM_2014_I1294140 (charged particle pseudorapidity at 8 TeV) 2014-08-09 Andy Buckley * Adding PromptFinalState, based on code submitted by Alex Grohsjean and Will Bell. Thanks! 2014-08-06 Andy Buckley * Adding MC_HFJETS and MC_JETTAGS analyses. 2014-08-05 Andy Buckley * Update all analyses to use the xMin/Max/Mid, xMean, xWidth, etc. methods on YODA classes rather than the deprecated lowEdge etc. * Merge new HasPID functor from Holger Schulz into Rivet/Tools/ParticleUtils.hh, mainly for use with the any() function in Rivet/Tools/Utils.hh 2014-08-04 Andy Buckley * Add ghost tagging of charms, bottoms and taus to FastJets, and tag info accessors to Jet. * Add constructors from and cast operators to FastJet's PseudoJet object from Particle and Jet. * Convert inRange to not use fuzzy comparisons on closed intervals, providing old version as fuzzyInRange. 2014-07-30 Andy Buckley * Remove classifier functions accepting a Particle from the PID inner namespace. 2014-07-29 Andy Buckley * MC_JetAnalysis.cc: re-enable +- ratios for eta and y, now that YODA divide doesn't throw an exception. * ATLAS_2012_I1093734: fix a loop index error which led to the first bin value being unfilled for half the dphi plots. * Fix accidental passing of a GenParticle pointer as a PID code int in HeavyHadrons.cc. Effect limited to incorrect deductions about excited HF decay chains and should be small. Thanks to Tomasz Przedzinski for finding and reporting the issue during HepMC3 design work! 2014-07-23 Andy Buckley * Fix to logspace: make sure that start and end values are exact, not the result of exp(log(x)). 2014-07-16 Andy Buckley * Fix setting of library paths for doc building: Python can't influence the dynamic loader in its own process by setting an environment variable because the loader only looks at the variable once, when it starts. 2014-07-02 Andy Buckley * rivet-cmphistos now uses the generic yoda.read() function rather than readYODA() -- AIDA files can also be compared and plotted directly now. 2014-06-24 Andy Buckley * Add stupid missing include and std:: prefix in Rivet.hh 2014-06-20 Holger Schulz * bin/make-plots: Automatic generation of minor xtick labels if LogX is requested but data resides e.g. in [200, 700]. Fixes m_12 plots of, e.g. ATLAS_2010_S8817804 2014-06-17 David Grellscheid * pyext/rivet/Makefile.am: 'make distcheck' and out-of-source builds should work now. 2014-06-10 Andy Buckley * Fix use of the install command for bash completion installation on Macs. 2014-06-07 Andy Buckley * Removing direct includes of MathUtils.hh and others from analysis code files. 2014-06-02 Andy Buckley * Rivet 2.1.2 release! 2014-05-30 Andy Buckley * Using Particle absrap(), abseta() and abspid() where automatic conversion was feasible. * Adding a few extra kinematics mappings to ParticleBase. * Adding p3() accessors to the 3-momentum on FourMomentum, Particle, and Jet. * Using Jet and Particle kinematics methods directly (without momentum()) where possible. * More tweaks to make-plots 2D histo parsing behaviour. 2014-05-30 Holger Schulz * Actually fill the XQ 2D histo, .plot decorations. * Have make-plots produce colourmaps using YODA_3D_SCATTER objects. Remove the grid in colourmaps. * Some tweaks for the SFM analysis, trying to contact Martin Wunsch who did the unfolding back then. 2014-05-29 Holger Schulz * Re-enable 2D histo in MC_PDFS 2014-05-28 Andy Buckley * Updating analysis and project routines to use Particle::pid() by preference to Particle::pdgId(), and Particle::abspid() by preference to abs(Particle::pdgId()), etc. * Adding interfacing of smart pointer types and booking etc. for YODA 2D histograms and profiles. * Improving ParticleIdUtils and ParticleUtils functions based on merging of improved function collections from MCUtils, and dropping the compiled ParticleIdUtils.cc file. 2014-05-27 Andy Buckley * Adding CMS_2012_I1090423 (dijet angular distributions), CMS_2013_I1256943 (Zbb xsec and angular correlations), CMS_2013_I1261026 (jet and UE properties vs. Nch) and D0_2000_I499943 (bbbar production xsec and angular correlations). 2014-05-26 Andy Buckley * Fixing a bug in plot file handling, and adding a texpand() routine to rivet.util, to be used to expand some 'standard' physics TeX macros. * Adding ATLAS_2012_I1124167 (min bias event shapes), ATLAS_2012_I1203852 (ZZ cross-section), and ATLAS_2013_I1190187 (WW cross-section) analyses. 2014-05-16 Andy Buckley * Adding any(iterable, fn) and all(iterable, fn) template functions for convenience. 2014-05-15 Holger Schulz * Fix some bugs in identified hadron PIDs in OPAL_1998_S3749908. 2014-05-13 Andy Buckley * Writing out [UNVALIDATED], [PRELIMINARY], etc. in the --list-analyses output if analysis is not VALIDATED. 2014-05-12 Andy Buckley * Adding CMS_2013_I1265659 colour coherence analysis. 2014-05-07 Andy Buckley * Bug fixes in CMS_2013_I1209721 from Giulio Lenzi. * Fixing compiler warnings from clang, including one which indicated a misapplied cut bug in CDF_2006_S6653332. 2014-05-05 Andy Buckley * Fix missing abs() in Particle::abspid()!!!! 2014-04-14 Andy Buckley * Adding the namespace protection workaround for Boost described at http://www.boost.org/doc/libs/1_55_0/doc/html/foreach.html 2014-04-13 Andy Buckley * Adding a rivet.pc template file and installation rule for pkg-config to use. * Updating data/refdata/ALEPH_2001_S4656318.yoda to corrected version in HepData. 2014-03-27 Andy Buckley * Flattening PNG output of make-plots (i.e. no transparency) and other tweaks. 2014-03-23 Andy Buckley * Renaming the internal meta-particle class in DressedLeptons (and exposed in the W/ZFinders) from ClusteredLepton to DressedLepton for consistency with the change in name of its containing class. * Removing need for cmake and unportable yaml-cpp trickery by using libtool to build an embedded symbol-mangled copy of yaml-cpp rather than trying to mangle and build direct from the tarball. 2014-03-10 Andy Buckley * Rivet 2.1.1 release. 2014-03-07 Andy Buckley * Adding ATLAS multilepton search (no ref data file), ATLAS_2012_I1204447. 2014-03-05 Andy Buckley * Also renaming Breit-Wigner functions to cdfBW, invcdfBW and bwspace. * Renaming index_between() to the more Rivety binIndex(), since that's the only real use of such a function... plus a bit of SFINAE type relaxation trickery. 2014-03-04 Andy Buckley * Adding programmatic access to final histograms via AnalysisHandler::getData(). * Adding CMS 4 jet correlations analysis, CMS_2013_I1273574. * Adding CMS W + 2 jet double parton scattering analysis, CMS_2013_I1272853. * Adding ATLAS isolated diphoton measurement, ATLAS_2012_I1199269. * Improving the index_between function so the numeric types don't have to exactly match. * Adding better momentum comparison functors and sortBy, sortByX functions to use them easily on containers of Particle, Jet, and FourMomentum. 2014-02-10 Andy Buckley * Removing duplicate and unused ParticleBase sorting functors. * Removing unused HT increment and units in ATLAS_2012_I1180197 (unvalidated SUSY). * Fixing photon isolation logic bug in CMS_2013_I1258128 (Z rapidity). * Replacing internal uses of #include Rivet/Rivet.hh with Rivet/Config/RivetCommon.hh, removing the MAXRAPIDITY const, and repurposing Rivet/Rivet.hh as a convenience include for external API users. * Adding isStable, children, allDescendants, stableDescendants, and flightLength functions to Particle. * Replacing Particle and Jet deltaX functions with generic ones on ParticleBase, and adding deltaRap variants. * Adding a Jet.fhh forward declaration header, including fastjet::PseudoJet. * Adding a RivetCommon.hh header to allow Rivet.hh to be used externally. * Fixing HeavyHadrons to apply pT cuts if specified. 2014-02-06 Andy Buckley * 2.1.0 release! 2014-02-05 Andy Buckley * Protect against invalid prefix value if the --prefix configure option is unused. 2014-02-03 Andy Buckley * Adding the ATLAS_2012_I1093734 fwd-bwd / azimuthal minbias correlations analysis. * Adding the LHCB_2013_I1208105 forward energy flow analysis. 2014-01-31 Andy Buckley * Checking the YODA minimum version in the configure script. * Fixing the JADE_OPAL analysis ycut values to the midpoints, thanks to information from Christoph Pahl / Stefan Kluth. 2014-01-29 Andy Buckley * Removing unused/overrestrictive Isolation* headers. 2014-01-27 Andy Buckley * Re-bundling yaml-cpp, now built as a mangled static lib based on the LHAPDF6 experience. * Throw a UserError rather than an assert if AnalysisHandler::init is called more than once. 2014-01-25 David Grellscheid * src/Core/Cuts.cc: New Cuts machinery, already used in FinalState. Old-style "mineta, maxeta, minpt" constructors kept around for ease of transition. Minimal set of convenience functions available, like EtaIn(), should be expanded as needed. 2014-01-22 Andy Buckley * configure.ac: Remove opportunistic C++11 build, until this becomes mandatory (in version 2.2.0?). Anyone who wants C++11 can explicitly set the CXXFLAGS (and DYLDFLAGS for pre-Mavericks Macs) 2014-01-21 Leif Lonnblad * src/Core/Analysis.cc: Fixed bug in Analysis::isCompatible where an 'abs' was left out when checking that beam energes does not differ by more than 1GeV. * src/Analyses/CMS_2011_S8978280.cc: Fixed checking of beam energy and booking corresponding histograms. 2013-12-19 Andy Buckley * Adding pid() and abspid() methods to Particle. * Adding hasCharm and hasBottom methods to Particle. * Adding a sorting functor arg version of the ZFinder::constituents() method. * Adding pTmin cut accessors to HeavyHadrons. * Tweak to the WFinder constructor to place the target W (trans) mass argument last. 2013-12-18 Andy Buckley * Adding a GenParticle* cast operator to Particle, removing the Particle and Jet copies of the momentum cmp functors, and general tidying/improvement/unification of the momentum properties of jets and particles. 2013-12-17 Andy Buckley * Using SFINAE techniques to improve the math util functions. * Adding isNeutrino to ParticleIdUtils, and isHadron/isMeson/isBaryon/isLepton/isNeutrino methods to Particle. * Adding a FourMomentum cast operator to ParticleBase, so that Particle and Jet objects can be used directly as FourMomentums. 2013-12-16 Andy Buckley * LeptonClusters renamed to DressedLeptons. * Adding singular particle accessor functions to WFinder and ZFinder. * Removing ClusteredPhotons and converting ATLAS_2010_S8919674. 2013-12-12 Andy Buckley * Fixing a problem with --disable-analyses (thanks to David Hall) * Require FastJet version 3. * Bumped version to 2.1.0a0 * Adding -DNDEBUG to the default build flags, unless in --enable-debug mode. * Adding a special treatment of RIVET_*_PATH variables: if they end in :: the default search paths will not be appended. Used primarily to restrict the doc builds to look only inside the build dirs, but potentially also useful in other special circumstances. * Adding a definition of exec_prefix to rivet-buildplugin. * Adding -DNDEBUG to the default non-debug build flags. 2013-11-27 Andy Buckley * Removing accidentally still-present no-as-needed linker flag from rivet-config. * Lots of analysis clean-up and migration to use new features and W/Z finder APIs. * More momentum method forwarding on ParticleBase and adding abseta(), absrap() etc. functions. * Adding the DEFAULT_RIVET_ANA_CONSTRUCTOR cosmetic macro. * Adding deltaRap() etc. function variations * Adding no-decay photon clustering option to WFinder and ZFinder, and replacing opaque bool args with enums. * Adding an option for ignoring photons from hadron/tau decays in LeptonClusters. 2013-11-22 Andy Buckley * Adding Particle::fromBottom/Charm/Tau() members. LHCb were aready mocking this up, so it seemed sensible to add it to the interface as a more popular (and even less dangerous) version of hasAncestor(). * Adding an empty() member to the JetAlg interface. 2013-11-07 Andy Buckley * Adding the GSL lib path to the library path in the env scripts and the rivet-config --ldflags output. 2013-10-25 Andy Buckley * 2.0.0 release!!!!!! 2013-10-24 Andy Buckley * Supporting zsh completion via bash completion compatibility. 2013-10-22 Andy Buckley * Updating the manual to describe YODA rather than AIDA and the new rivet-cmphistos script. * bin/make-plots: Adding paths to error messages in histogram combination. * CDF_2005_S6217184: fixes to low stats errors and final scatter plot binning. 2013-10-21 Andy Buckley * Several small fixes in jet shape analyses, SFM_1984, etc. found in the last H++ validation run. 2013-10-18 Andy Buckley * Updates to configure and the rivetenv scripts to try harder to discover YODA. 2013-09-26 Andy Buckley * Now bundling Cython-generated files in the tarballs, so Cython is not a build requirement for non-developers. 2013-09-24 Andy Buckley * Removing unnecessary uses of a momentum() indirection when accessing kinematic variables. * Clean-up in Jet, Particle, and ParticleBase, in particular splitting PID functions on Particle from those on PID codes, and adding convenience kinematic functions to ParticleBase. 2013-09-23 Andy Buckley * Add the -avoid-version flag to libtool. * Final analysis histogramming issues resolved. 2013-08-16 Andy Buckley * Adding a ConnectBins flag in make-plots, to decide whether to connect adjacent, gapless bins with a vertical line. Enabled by default (good for the step-histo default look of MC lines), but now rivet-cmphistos disables it for the reference data. 2013-08-14 Andy Buckley * Making 2.0.0beta3 -- just a few remaining analysis migration issues remaining but it's worth making another beta since there were lots of framework fixes/improvements. 2013-08-11 Andy Buckley * ARGUS_1993_S2669951 also fixed using scatter autobooking. * Fixing remaining issues with booking in BABAR_2007_S7266081 using the feature below (far nicer than hard-coding). * Adding a copy_pts param to some Analysis::bookScatter2D methods: pre-setting the points with x values is sometimes genuinely useful. 2013-07-26 Andy Buckley * Removed the (officially) obsolete CDF 2008 LEADINGJETS and NOTE_9351 underlying event analyses -- superseded by the proper versions of these analyses based on the final combined paper. * Removed the semi-demo Multiplicity projection -- only the EXAMPLE analysis and the trivial ALEPH_1991_S2435284 needed adaptation. 2013-07-24 Andy Buckley * Adding a rejection of histo paths containing /TMP/ from the writeData function. Use this to handle booked temporary histograms... for now. 2013-07-23 Andy Buckley * Make rivet-cmphistos _not_ draw a ratio plot if there is only one line. * Improvements and fixes to HepData lookup with rivet-mkanalysis. 2013-07-22 Andy Buckley * Add -std=c++11 or -std=c++0x to the Rivet compiler flags if supported. * Various fixes to analyses with non-zero numerical diffs. 2013-06-12 Andy Buckley * Adding a new HeavyHadrons projection. * Adding optional extra include_end args to logspace() and linspace(). 2013-06-11 Andy Buckley * Moving Rivet/RivetXXX.hh tools headers into Rivet/Tools/. * Adding PrimaryHadrons projection. * Adding particles_in/out functions on GenParticle to RivetHepMC. * Moved STL extensions from Utils.hh to RivetSTL.hh and tidying. * Tidying, improving, extending, and documenting in RivetSTL.hh. * Adding a #include of Logging.hh into Projection.hh, and removing unnecessary #includes from all Projection headers. 2013-06-10 Andy Buckley * Moving htmlify() and detex() Python functions into rivet.util. * Add HepData URL for Inspire ID lookup to the rivet script. * Fix analyses' info files which accidentally listed the Inspire ID under the SpiresID metadata key. 2013-06-07 Andy Buckley * Updating mk-analysis-html script to produce MathJax output * Adding a version of Analysis::removeAnalysisObject() which takes an AO pointer as its argument. * bin/rivet: Adding pandoc-based conversion of TeX summary and description strings to plain text on the terminal output. * Add MathJax to rivet-mkhtml output, set up so the .info entries should render ok. * Mark the OPAL 1993 analysis as UNVALIDATED: from the H++ benchmark runs it looks nothing like the data, and there are some outstanding ambiguities. 2013-06-06 Andy Buckley * Releasing 2.0.0b2 beta version. 2013-06-05 Andy Buckley * Renaming Analysis::add() etc. to very explicit addAnalysisObject(), sorting out shared_pointer polymorphism issues via the Boost dynamic_pointer_cast, and adding a full set of getHisto1D(), etc. explicitly named and typed accessors, including ones with HepData dataset/axis ID signatures. * Adding histo booking from an explicit reference Scatter2D (and more placeholders for 2D histos / 3D scatters) and rewriting existing autobooking to use this. * Converting inappropriate uses of size_t to unsigned int in Analysis. * Moving Analysis::addPlot to Analysis::add() (or reg()?) and adding get() and remove() (or unreg()?) * Fixing attempted abstraction of import fallbacks in rivet.util.import_ET(). * Removing broken attempt at histoDir() caching which led to all histograms being registered under the same analysis name. 2013-06-04 Andy Buckley * Updating the Cython version requirement to 0.18 * Adding Analysis::integrate() functions and tidying the Analysis.hh file a bit. 2013-06-03 Andy Buckley * Adding explicit protection against using inf/nan scalefactors in ATLAS_2011_S9131140 and H1_2000_S4129130. * Making Analysis::scale noisly complain about invalid scalefactors. 2013-05-31 Andy Buckley * Reducing the TeX main memory to ~500MB. Turns out that it *can* be too large with new versions of TeXLive! 2013-05-30 Andy Buckley * Reverting bookScatter2D behaviour to never look at ref data, and updating a few affected analyses. This should fix some bugs with doubled datapoints introduced by the previous behaviour+addPoint. * Adding a couple of minor Utils.hh and MathUtils.hh features. 2013-05-29 Andy Buckley * Removing Constraints.hh header. * Minor bugfixes and improvements in Scatter2D booking and MC_JetAnalysis. 2013-05-28 Andy Buckley * Removing defunct HistoFormat.hh and HistoHandler.{hh,cc} 2013-05-27 Andy Buckley * Removing includes of Logging.hh, RivetYODA.hh, and ParticleIdUtils.hh from analyses (and adding an include of ParticleIdUtils.hh to Analysis.hh) * Removing now-unused .fhh files. * Removing lots of unnecessary .fhh includes from core classes: everything still compiling ok. A good opportunity to tidy this up before the release. * Moving the rivet-completion script from the data dir to bin (the completion is for scripts in bin, and this makes development easier). * Updating bash completion scripts for YODA format and compare-histos -> rivet-cmphistos. 2013-05-23 Andy Buckley * Adding Doxy comments and a couple of useful convenience functions to Utils.hh. * Final tweaks to ATLAS ttbar jet veto analysis (checked logic with Kiran Joshi). 2013-05-15 Andy Buckley * Many 1.0 -> weight bugfixes in ATLAS_2011_I945498. * yaml-cpp v3 support re-introduced in .info parsing. * Lots of analysis clean-ups for YODA TODO issues. 2013-05-13 Andy Buckley * Analysis histo booking improvements for Scatter2D, placeholders for 2D histos, and general tidying. 2013-05-12 Andy Buckley * Adding configure-time differentiation between yaml-cpp API versions 3 and 5. 2013-05-07 Andy Buckley * Converting info file reading to use the yaml-cpp 0.5.x API. 2013-04-12 Andy Buckley * Tagging as 2.0.0b1 2013-04-04 Andy Buckley * Removing bundling of yaml-cpp: it needs to be installed by the user / bootstrap script from now on. 2013-04-03 Andy Buckley * Removing svn:external m4 directory, and converting Boost detection to use better boost.m4 macros. 2013-03-22 Andy Buckley * Moving PID consts to the PID namespace and corresponding code updates and opportunistic clean-ups. * Adding Particle::fromDecay() method. 2013-03-09 Andy Buckley * Version bump to 2.0.0b1 in anticipation of first beta release. * Adding many more 'popular' particle ID code named-consts and aliases, and updating the RapScheme enum with ETA -> ETARAP, and fixing affected analyses (plus other opportunistic tidying / minor bug-fixing). * Fixing a symbol misnaming in ATLAS_2012_I1119557. 2013-03-07 Andy Buckley * Renaming existing uses of ParticleVector to the new 'Particles' type. * Updating util classes, projections, and analyses to deal with the HepMC return value changes. * Adding new Particle(const GenParticle*) constructor. * Converting Particle::genParticle() to return a const pointer rather than a reference, for the same reason as below (+ consistency within Rivet and with the HepMC pointer-centric coding design). * Converting Event to use a different implementation of original and modified GenParticles, and to manage the memory in a more future-proof way. Event::genParticle() now returns a const pointer rather than a reference, to signal that the user is leaving the happy pastures of 'normal' Rivet behind. * Adding a Particles typedef by analogy to Jets, and in preference to the cumbersome ParticleVector. * bin/: Lots of tidying/pruning of messy/defunct scripts. * Creating spiresbib, util, and plotinfo rivet python module submodules: this eliminates lighthisto and the standalone spiresbib modules. Util contains convenience functions for Python version testing, clean ElementTree import, and process renaming, for primary use by the rivet-* scripts. * Removing defunct scripts that have been replaced/obsoleted by YODA. 2013-03-06 Andy Buckley * Fixing doc build so that the reference histos and titles are ~correctly documented. We may want to truncate some of the lists! 2013-03-06 Hendrik Hoeth * Added ATLAS_2012_I1125575 analysis * Converted rivet-mkhtml to yoda * Introduced rivet-cmphistos as yoda based replacement for compare-histos 2013-03-05 Andy Buckley * Replacing all AIDA ref data with YODA versions. * Fixing the histograms entries in the documentation to be tolerant to plotinfo loading failures. * Making the findDatafile() function primarily find YODA data files, then fall back to AIDA. The ref data loader will use the appropriate YODA format reader. 2013-02-05 David Grellscheid * include/Rivet/Math/MathUtils.hh: added BWspace bin edge method to give equal-area Breit-Wigner bins 2013-02-01 Andy Buckley * Adding an element to the PhiMapping enum and a new mapAngle(angle, mapping) function. * Fixes to Vector3::azimuthalAngle and Vector3::polarAngle calculation (using the mapAngle functions). 2013-01-25 Frank Siegert * Split MC_*JETS analyses into three separate bits: MC_*INC (inclusive properties) MC_*JETS (jet properties) MC_*KTSPLITTINGS (kT splitting scales). 2013-01-22 Hendrik Hoeth * Fix TeX variable in the rivetenv scripts, especially for csh 2012-12-21 Andy Buckley * Version 1.8.2 release! 2012-12-20 Andy Buckley * Adding ATLAS_2012_I1119557 analysis (from Roman Lysak and Lily Asquith). 2012-12-18 Andy Buckley * Adding TOTEM_2012_002 analysis, from Sercan Sen. 2012-12-18 Hendrik Hoeth * Added CMS_2011_I954992 analysis 2012-12-17 Hendrik Hoeth * Added CMS_2012_I1193338 analysis * Fixed xi cut in ATLAS_2011_I894867 2012-12-17 Andy Buckley * Adding analysis descriptions to the HTML analysis page ToC. 2012-12-14 Hendrik Hoeth * Added CMS_2012_PAS_FWD_11_003 analysis * Added LHCB_2012_I1119400 analysis 2012-12-12 Andy Buckley * Correction to jet acceptance in CMS_2011_S9120041, from Sercan Sen: thanks! 2012-12-12 Hendrik Hoeth * Added CMS_2012_PAS_QCD_11_010 analysis 2012-12-07 Andy Buckley * Version number bump to 1.8.2 -- release approaching. * Rewrite of ALICE_2012_I1181770 analysis to make it a bit more sane and acceptable. * Adding a note on FourVector and FourMomentum that operator- and operator-= invert both the space and time components: use of -= can result in a vector with negative energy. * Adding particlesByRapidity and particlesByAbsRapidity to FinalState. 2012-12-07 Hendrik Hoeth * Added ALICE_2012_I1181770 analysis * Bump version to 1.8.2 2012-12-06 Hendrik Hoeth * Added ATLAS_2012_I1188891 analysis * Added ATLAS_2012_I1118269 analysis * Added CMS_2012_I1184941 analysis * Added LHCB_2010_I867355 analysis * Added TGraphErrors support to root2flat 2012-11-27 Andy Buckley * Converting CMS_2012_I1102908 analysis to use YODA. * Adding XLabel and YLabel setting in histo/profile/scatter booking. 2012-11-27 Hendrik Hoeth * Fix make-plots png creation for SL5 2012-11-23 Peter Richardson * Added ATLAS_2012_CONF_2012_153 4-lepton SUSY search 2012-11-17 Andy Buckley * Adding MC_PHOTONS by Steve Lloyd and AB, for testing general unisolated photon properties, especially those associated with charged leptons (e and mu). 2012-11-16 Andy Buckley * Adding MC_PRINTEVENT, a convenient (but verbose!) analysis for printing out event details to stdout. 2012-11-15 Andy Buckley * Removing the long-unused/defunct autopackage system. 2012-11-15 Hendrik Hoeth * Added LHCF_2012_I1115479 analysis * Added ATLAS_2011_I894867 analysis 2012-11-14 Hendrik Hoeth * Added CMS_2012_I1102908 analysis 2012-11-14 Andy Buckley * Converting the argument order of logspace, clarifying the arguments, updating affected code, and removing Analysis::logBinEdges. * Merging updates from the AIDA maintenance branch up to r4002 (latest revision for next merges is r4009). 2012-11-11 Andy Buckley * include/Math/: Various numerical fixes to Vector3::angle and changing the 4 vector mass treatment to permit spacelike virtualities (in some cases even the fuzzy isZero assert check was being violated). The angle check allows a clean-up of some workaround code in MC_VH2BB. 2012-10-15 Hendrik Hoeth * Added CMS_2012_I1107658 analysis 2012-10-11 Hendrik Hoeth * Added CDF_2012_NOTE10874 analysis 2012-10-04 Hendrik Hoeth * Added ATLAS_2012_I1183818 analysis 2012-07-17 Hendrik Hoeth * Cleanup and multiple fixes in CMS_2011_S9120041 * Bugfixed in ALEPH_2004_S5765862 and ATLAS_2010_CONF_2010_049 (thanks to Anil Pratap) 2012-08-09 Andy Buckley * Fixing aida2root command-line help message and converting to TH* rather than TGraph by default. 2012-07-24 Andy Buckley * Improvements/migrations to rivet-mkhtml, rivet-mkanalysis, and rivet-buildplugin. 2012-07-17 Hendrik Hoeth * Add CMS_2012_I1087342 2012-07-12 Andy Buckley * Fix rivet-mkanalysis a bit for YODA compatibility. 2012-07-05 Hendrik Hoeth * Version 1.8.1! 2012-07-05 Holger Schulz * Add ATLAS_2011_I945498 2012-07-03 Hendrik Hoeth * Bugfix for transverse mass (thanks to Gavin Hesketh) 2012-06-29 Hendrik Hoeth * Merge YODA branch into trunk. YODA is alive!!!!!! 2012-06-26 Holger Schulz * Add ATLAS_2012_I1091481 2012-06-20 Hendrik Hoeth * Added D0_2011_I895662: 3-jet mass 2012-04-24 Hendrik Hoeth * fixed a few bugs in rivet-rmgaps * Added new TOTEM dN/deta analysis 2012-03-19 Andy Buckley * Version 1.8.0! * src/Projections/UnstableFinalState.cc: Fix compiler warning. * Version bump for testing: 1.8.0beta1. * src/Core/AnalysisInfo.cc: Add printout of YAML parser exception error messages to aid debugging. * bin/Makefile.am: Attempt to fix rivet-nopy build on SLC5. * src/Analyses/LHCB_2010_S8758301.cc: Add two missing entries to the PDGID -> lifetime map. * src/Projections/UnstableFinalState.cc: Extend list of vetoed particles to include reggeons. 2012-03-16 Andy Buckley * Version change to 1.8.0beta0 -- nearly ready for long-awaited release! * pyext/setup.py.in: Adding handling for the YAML library: fix for Genser build from Anton Karneyeu. * src/Analyses/LHCB_2011_I917009.cc: Hiding lifetime-lookup error message if the offending particle is not a hadron. * include/Rivet/Math/MathHeader.hh: Using unnamespaced std::isnan and std::isinf as standard. 2012-03-16 Hendrik Hoeth * Improve default plot behaviour for 2D histograms 2012-03-15 Hendrik Hoeth * Make ATLAS_2012_I1084540 less verbose, and general code cleanup of that analysis. * New-style plugin hook in ATLAS_2011_I926145, ATLAS_2011_I944826 and ATLAS_2012_I1084540 * Fix compiler warnings in ATLAS_2011_I944826 and CMS_2011_S8973270 * CMS_2011_S8941262: Weights are double, not int. * disable inRange() tests in test/testMath.cc until we have a proper fix for the compiler warnings we see on SL5. 2012-03-07 Andy Buckley * Marking ATLAS_2011_I919017 as VALIDATED (this should have happened a long time ago) and adding more references. 2012-02-28 Hendrik Hoeth * lighthisto.py: Caching for re.compile(). This speeds up aida2flat and flat2aida by more than an order of magnitude. 2012-02-27 Andy Buckley * doc/mk-analysis-html: Adding more LaTeX/text -> HTML conversion replacements, including better <,> handling. 2012-02-26 Andy Buckley * Adding CMS_2011_S8973270, CMS_2011_S8941262, CMS_2011_S9215166, CMS_QCD_10_024, from CMS. * Adding LHCB_2011_I917009 analysis, from Alex Grecu. * src/Core/Analysis.cc, include/Rivet/Analysis.hh: Add a numeric-arg version of histoPath(). 2012-02-24 Holger Schulz * Adding ATLAS Ks/Lambda analysis. 2012-02-20 Andy Buckley * src/Analyses/ATLAS_2011_I925932.cc: Using new overflow-aware normalize() in place of counters and scale(..., 1/count) 2012-02-14 Andy Buckley * Splitting MC_GENERIC to put the PDF and PID plotting into MC_PDFS and MC_IDENTIFIED respectively. * Renaming MC_LEADINGJETS to MC_LEADJETUE. 2012-02-14 Hendrik Hoeth * DELPHI_1996_S3430090 and ALEPH_1996_S3486095: fix rapidity vs {Thrust,Sphericity}-axis. 2012-02-14 Andy Buckley * bin/compare-histos: Don't attempt to remove bins from MC histos where they aren't found in the ref file, if the ref file is not expt data, or if the new --no-rmgapbins arg is given. * bin/rivet: Remove the conversion of requested analysis names to upper-case: mixed-case analysis names will now work. 2012-02-14 Frank Siegert * Bugfixes and improvements for MC_TTBAR: - Avoid assert failure with logspace starting at 0.0 - Ignore charged lepton in jet finding (otherwise jet multi is always +1). - Add some dR/deta/dphi distributions as noted in TODO - Change pT plots to logspace as well (to avoid low-stat high pT bins) 2012-02-10 Hendrik Hoeth * rivet-mkhtml -c option now has the semantics of a .plot file. The contents are appended to the dat output by compare-histos. 2012-02-09 David Grellscheid * Fixed broken UnstableFS behaviour 2012-01-25 Frank Siegert * Improvements in make-plots: - Add PlotTickLabels and RatioPlotTickLabels options (cf. make-plots.txt) - Make ErrorBars and ErrorBands non-exclusive (and change their order, such that Bars are on top of Bands) 2012-01-25 Holger Schulz * Add ATLAS diffractive gap analysis 2012-01-23 Andy Buckley * bin/rivet: When using --list-analyses, the analysis summary is now printed out when log level is <= INFO, rather than < INFO. The effect on command line behaviour is that useful identifying info is now printed by default when using --list-analyses, rather than requiring --list-analyses -v. To get the old behaviour, e.g. if using the output of rivet --list-analyses for scripting, now use --list-analyses -q. 2012-01-22 Andy Buckley * Tidying lighthisto, including fixing the order in which +- error values are passed to the Bin constructor in fromFlatHisto. 2012-01-16 Frank Siegert * Bugfix in ATLAS_2012_I1083318: Include non-signal neutrinos in jet clustering. * Add first version of ATLAS_2012_I1083318 (W+jets). Still UNVALIDATED until final happiness with validation plots arises and data is in Hepdata. * Bugfix in ATLAS_2010_S8919674: Really use neutrino with highest pT for Etmiss. Doesn't seem to make very much difference, but is more correct in principle. 2012-01-16 Peter Richardson * Fixes to ATLAS_20111_S9225137 to include reference data 2012-01-13 Holger Schulz * Add ATLAS inclusive lepton analysis 2012-01-12 Hendrik Hoeth * Font selection support in rivet-mkhtml 2012-01-11 Peter Richardson * Added pi0 to list of particles. 2012-01-11 Andy Buckley * Removing references to Boost random numbers. 2011-12-30 Andy Buckley * Adding a placeholder rivet-which script (not currently installed). * Tweaking to avoid a very time-consuming debug printout in compare-histos with the -v flag, and modifying the Rivet env vars in rivet-mkhtml before calling compare-histos to eliminate problems induced by relative paths (i.e. "." does not mean the same thing when the directory is changed within the script). 2011-12-12 Andy Buckley * Adding a command line completion function for rivet-mkhtml. 2011-12-12 Frank Siegert * Fix for factor of 2.0 in normalisation of CMS_2011_S9086218 * Add --ignore-missing option to rivet-mkhtml to ignore non-existing AIDA files. 2011-12-06 Andy Buckley * Include underflow and overflow bins in the normalisation when calling Analysis::normalise(h) 2011-11-23 Andy Buckley * Bumping version to 1.8.0alpha0 since the Jet interface changes are quite a major break with backward compatibility (although the vast majority of analyses should be unaffected). * Removing crufty legacy stuff from the Jet class -- there is never any ambiguity between whether Particle or FourMomentum objects are the constituents now, and the jet 4-momentum is set explicitly by the jet alg so that e.g. there is no mismatch if the FastJet pt recombination scheme is used. * Adding default do-nothing implementations of Analysis::init() and Analysis::finalize(), since it is possible for analysis implementations to not need to do anything in these methods, and forcing analysis authors to write do-nothing boilerplate code is not "the Rivet way"! 2011-11-19 Andy Buckley * Adding variant constructors to FastJets with a more natural Plugin* argument, and decrufting the constructor implementations a bit. * bin/rivet: Adding a more helpful error message if the rivet module can't be loaded, grouping the option parser options, removing the -A option (this just doesn't seem useful anymore), and providing a --pwd option as a shortcut to append "." to the search path. 2011-11-18 Andy Buckley * Adding a guide to compiling a new analysis template to the output message of rivet-mkanalysis. 2011-11-11 Andy Buckley * Version 1.7.0 release! * Protecting the OPAL 2004 analysis against NaNs in the hemispheres projection -- I can't track the origin of these and suspect some occasional memory corruption. 2011-11-09 Andy Buckley * Renaming source files for EXAMPLE and PDG_HADRON_MULTIPLICITIES(_RATIOS) analyses to match the analysis names. * Cosmetic fixes in ATLAS_2011_S9212183 SUSY analysis. * Adding new ATLAS W pT analysis from Elena Yatsenko (slightly adapted). 2011-10-20 Frank Siegert * Extend API of W/ZFinder to allow for specification of input final state in which to search for leptons/photons. 2011-10-19 Andy Buckley * Adding new version of LHCB_2010_S8758301, based on submission from Alex Grecu. There is some slightly dodgy-looking GenParticle* fiddling going on, but apparently it's necessary (and hopefully robust). 2011-10-17 Andy Buckley * bin/rivet-nopy linker line tweak to make compilation work with GCC 4.6 (-lHepMC has to be explicitly added for some reason). 2011-10-13 Frank Siegert * Add four CMS QCD analyses kindly provided by CMS. 2011-10-12 Andy Buckley * Adding a separate test program for non-matrix/vector math functions, and adding a new set of int/float literal arg tests for the inRange functions in it. * Adding a jet multiplicity plot for jets with pT > 30 GeV to MC_TTBAR. 2011-10-11 Andy Buckley * Removing SVertex. 2011-10-11 James Monk * root2flat was missing the first bin (plus spurious last bin) * My version of bash does not understand the pipe syntax |& in rivet-buildplugin 2011-09-30 James Monk * Fix bug in ATLAS_2010_S8817804 that misidentified the akt4 jets as akt6 2011-09-29 Andy Buckley * Converting FinalStateHCM to a slightly more general DISFinalState. 2011-09-26 Andy Buckley * Adding a default libname argument to rivet-buildplugin. If the first argument doesn't have a .so library suffix, then use RivetAnalysis.so as the default. 2011-09-19 Hendrik Hoeth * make-plots: Fixing regex for \physicscoor. Adding "FrameColor" option. 2011-09-17 Andy Buckley * Improving interactive metadata printout, by not printing headings for missing info. * Bumping the release number to 1.7.0alpha0, since with these SPIRES/Inspire changes and the MissingMomentum API change we need more than a minor release. * Updating the mkanalysis, BibTeX-grabbing and other places that care about analysis SPIRES IDs to also be able to handle the new Inspire system record IDs. The missing link is getting to HepData from an Inspire code... * Using the .info file rather than an in-code declaration to specify that an analysis needs cross-section information. * Adding Inspire support to the AnalysisInfo and Analysis interfaces. Maybe we can find a way to combine the two, e.g. return the SPIRES code prefixed with an "S" if no Inspire ID is available... 2011-09-17 Hendrik Hoeth * Added ALICE_2011_S8909580 (strange particle production at 900 GeV) * Feed-down correction in ALICE_2011_S8945144 2011-09-16 Andy Buckley * Adding ATLAS track jet analysis, modified from the version provided by Seth Zenz: ATLAS_2011_I919017. Note that this analysis is currently using the Inspire ID rather than the Spires one: we're clearly going to have to update the API to handle Inspire codes, so might as well start now... 2011-09-14 Andy Buckley * Adding the ATLAS Z pT measurement at 7 TeV (ATLAS_2011_S9131140) and an MC analysis for VH->bb events (MC_VH2BB). 2011-09-12 Andy Buckley * Removing uses of getLog, cout, cerr, and endl from all standard analyses and projections, except in a very few special cases. 2011-09-10 Andy Buckley * Changing the behaviour and interface of the MissingMomentum projection to calculate vector ET correctly. This was previously calculated according to the common definition of -E*sin(theta) of the summed visible 4-momentum in the event, but that is incorrect because the timelike term grows monotonically. Instead, transverse 2-vectors of size ET need to be constructed for each visible particle, and vector-summed in the transverse plane. The rewrite of this behaviour made it opportune to make an API improvement: the previous method names scalarET/vectorET() have been renamed to scalar/vectorEt() to better match the Rivet FourMomentum::Et() method, and MissingMomentum::vectorEt() now returns a Vector3 rather than a double so that the transverse missing Et direction is also available. Only one data analysis has been affected by this change in behaviour: the D0_2004_S5992206 dijet delta(phi) analysis. It's expected that this change will not be very significant, as it is a *veto* on significant missing ET to reduce non-QCD contributions. MC studies using this analysis ~always run with QCD events only, so these contributions should be small. The analysis efficiency may have been greatly improved, as fewer events will now fail the missing ET veto cut. * Add sorting of the ParticleVector returned by the ChargedLeptons projection. * configure.ac: Adding a check to make sure that no-one tries to install into --prefix=$PWD. 2011-09-04 Andy Buckley * lighthisto fixes from Christian Roehr. 2011-08-26 Andy Buckley * Removing deprecated features: the setBeams(...) method on Analysis, the MaxRapidity constant, the split(...) function, the default init() method from AnalysisHandler and its test, and the deprecated TotalVisibleMomentum and PVertex projections. 2011-08-23 Andy Buckley * Adding a new DECLARE_RIVET_PLUGIN wrapper macro to hide the details of the plugin hook system from analysis authors. Migration of all analyses and the rivet-mkanalysis script to use this as the standard plugin hook syntax. * Also call the --cflags option on root-config when using the --root option with rivet-biuldplugin (thanks to Richard Corke for the report) 2011-08-23 Frank Siegert * Added ATLAS_2011_S9126244 * Added ATLAS_2011_S9128077 2011-08-23 Hendrik Hoeth * Added ALICE_2011_S8945144 * Remove obsolete setBeams() from the analyses * Update CMS_2011_S8957746 reference data to the official numbers * Use Inspire rather than Spires. 2011-08-19 Frank Siegert * More NLO parton level generator friendliness: Don't crash or fail when there are no beam particles. * Add --ignore-beams option to skip compatibility check. 2011-08-09 David Mallows * Fix aida2flat to ignore empty dataPointSet 2011-08-07 Andy Buckley * Adding TEXINPUTS and LATEXINPUTS prepend definitions to the variables provided by rivetenv.(c)sh. A manual setting of these variables that didn't include the Rivet TEXMFHOME path was breaking make-plots on lxplus, presumably since the system LaTeX packages are so old there. 2011-08-02 Frank Siegert Version 1.6.0 release! 2011-08-01 Frank Siegert * Overhaul of the WFinder and ZFinder projections, including a change of interface. This solves potential problems with leptons which are not W/Z constituents being excluded from the RemainingFinalState. 2011-07-29 Andy Buckley * Version 1.5.2 release! * New version of aida2root from James Monk. 2011-07-29 Frank Siegert * Fix implementation of --config file option in make-plots. 2011-07-27 David Mallows * Updated MC_TTBAR.plot to reflect updated analysis. 2011-07-25 Andy Buckley * Adding a useTransverseMass flag method and implementation to InvMassFinalState, and using it in the WFinder, after feedback from Gavin Hesketh. This was the neatest way I could do it :S Some other tidying up happened along the way. * Adding transverse mass massT and massT2 methods and functions for FourMomentum. 2011-07-22 Frank Siegert * Added ATLAS_2011_S9120807 * Add two more observables to MC_DIPHOTON and make its isolation cut more LHC-like * Add linear photon pT histo to MC_PHOTONJETS 2011-07-20 Andy Buckley * Making MC_TTBAR work with semileptonic ttbar events and generally tidying the code. 2011-07-19 Andy Buckley * Version bump to 1.5.2.b01 in preparation for a release in the very near future. 2011-07-18 David Mallows * Replaced MC_TTBAR: Added t,tbar reconstruction. Not yet working. 2011-07-18 Andy Buckley * bin/rivet-buildplugin.in: Pass the AM_CXXFLAGS variable (including the warning flags) to the C++ compiler when building user analysis plugins. * include/LWH/DataPointSet.h: Fix accidental setting of errorMinus = scalefactor * error_Plus_. Thanks to Anton Karneyeu for the bug report! 2011-07-18 Hendrik Hoeth * Added CMS_2011_S8884919 (charged hadron multiplicity in NSD events corrected to pT>=0). * Added CMS_2010_S8656010 and CMS_2010_S8547297 (charged hadron pT and eta in NSD events) * Added CMS_2011_S8968497 (chi_dijet) * Added CMS_2011_S8978280 (strangeness) 2011-07-13 Andy Buckley * Rivet PDF manual updates, to not spread disinformation about bootstrapping a Genser repo. 2011-07-12 Andy Buckley * bin/make-plots: Protect property reading against unstripped \r characters from DOS newlines. * bin/rivet-mkhtml: Add a -M unmatch regex flag (note that these are matching the analysis path rather than individual histos on this script), and speed up the initial analysis identification and selection by avoiding loops of regex comparisons for repeats of strings which have already been analysed. * bin/compare-histos: remove the completely (?) unused histogram list, and add -m and -M regex flags, as for aida2flat and flat2aida. 2011-06-30 Hendrik Hoeth * fix fromFlat() in lighthistos: It would ignore histogram paths before. * flat2aida: preserve histogram order from .dat files 2011-06-27 Andy Buckley * pyext/setup.py.in: Use CXXFLAGS and LDFLAGS safely in the Python extension build, and improve the use of build/src directory arguments. 2011-06-23 Andy Buckley * Adding a tentative rivet-updateanalyses script, based on lhapdf-getdata, which will download new analyses as requested. We could change our analysis-providing behaviour a bit to allow this sort of delivery mechanism to be used as the normal way of getting analysis updates without us having to make a whole new Rivet release. It is nice to be able to identify analyses with releases, though, for tracking whether bugs have been addressed. 2011-06-10 Frank Siegert * Bugfixes in WFinder. 2011-06-10 Andy Buckley * Adding \physicsxcoor and \physicsycoor treatment to make-plots. 2011-06-06 Hendrik Hoeth * Allow for negative cross-sections. NLO tools need this. * make-plots: For RatioPlotMode=deviation also consider the MC uncertainties, not just data. 2011-06-04 Hendrik Hoeth * Add support for goodness-of-fit calculations to make-plots. The results are shown in the legend, and one histogram can be selected to determine the color of the plot margin. See the documentation for more details. 2011-06-04 Andy Buckley * Adding auto conversion of Histogram2D to DataPointSets in the AnalysisHandler _normalizeTree method. 2011-06-03 Andy Buckley * Adding a file-weight feature to the Run object, which will optionally rescale the weights in the provided HepMC files. This should be useful for e.g. running on multiple differently-weighted AlpGen HepMC files/streams. The new functionality is used by the rivet command via an optional weight appended to the filename with a colon delimiter, e.g. "rivet fifo1.hepmc fifo2.hepmc:2.31" 2011-06-01 Hendrik Hoeth * Add BeamThrust projection 2011-05-31 Hendrik Hoeth * Fix LIBS for fastjet-3.0 * Add basic infrastructure for Taylor plots in make-plots * Fix OPAL_2004_S6132243: They are using charged+neutral. * Release 1.5.1 2011-05-22 Andy Buckley * Adding plots of stable and decayed PID multiplicities to MC_GENERIC (useful for sanity-checking generator setups). * Removing actually-unused ProjectionApplier.fhh forward declaration header. 2011-05-20 Andy Buckley * Removing import of ipython shell from rivet-rescale, having just seen it throw a multi-coloured warning message on a student's lxplus Rivet session! * Adding support for the compare-histos --no-ratio flag when using rivet-mkhtml. Adding --rel-ratio, --linear, etc. is an exercise for the enthusiast ;-) 2011-05-10 Andy Buckley * Internal minor changes to the ProjectionHandler and ProjectionApplier interfaces, in particular changing the ProjectionHandler::create() function to be called getInstance and to return a reference rather than a pointer. The reference change is to make way for an improved singleton implementation, which cannot yet be used due to a bug in projection memory management. The code of the improved singleton is available, but commented out, in ProjectionManager.hh to allow for easier migration and to avoid branching. 2011-05-08 Andy Buckley * Extending flat2aida to be able to read from and write to stdin/out as for aida2flat, and also eliminating the internal histo parsing representation in favour of the one in lighthisto. lighthisto's fromFlat also needed a bit of an overhaul: it has been extended to parse each histo's chunk of text (including BEGIN and END lines) in fromFlatHisto, and for fromFlat to parse a collection of histos from a file, in keeping with the behaviour of fromDPS/fromAIDA. Merging into Professor is now needed. * Extending aida2flat to have a better usage message, to accept input from stdin for command chaining via pipes, and to be a bit more sensibly internally structured (although it also now has to hold all histos in memory before writing out -- that shouldn't be a problem for anything other than truly huge histo files). 2011-05-04 Andy Buckley * compare-histos: If using --mc-errs style, prefer dotted and dashdotted line styles to dashed, since dashes are often too long to be distinguishable from solid lines. Even better might be to always use a solid line for MC errs style, and to add more colours. * rivet-mkhtml: use a no-mc-errors drawing style by default, to match the behaviour of compare-histos, which it calls. The --no-mc-errs option has been replaced with an --mc-errs option. 2011-05-04 Hendrik Hoeth * Ignore duplicate files in compare-histos. 2011-04-25 Andy Buckley * Adding some hadron-specific N and sumET vs. |eta| plots to MC_GENERIC. * Re-adding an explicit attempt to get the beam particles, since HepMC's IO_HERWIG seems to not always set them even though it's meant to. 2011-04-19 Hendrik Hoeth * Added ATLAS_2011_S9002537 W asymmetry analysis 2011-04-14 Hendrik Hoeth * deltaR, deltaPhi, deltaEta now available in all combinations of FourVector, FourMomentum, Vector3, doubles. They also accept jets and particles as arguments now. 2011-04-13 David Grellscheid * added ATLAS 8983313: 0-lepton BSM 2011-04-01 Andy Buckley * bin/rivet-mkanalysis: Don't try to download SPIRES or HepData info if it's not a standard analysis (i.e. if the SPIRES ID is not known), and make the default .info file validly parseable by YAML, which was an unfortunate gotcha for anyone writing a first analysis. 2011-03-31 Andy Buckley * bin/compare-histos: Write more appropriate ratio plot labels when not comparing to data, and use the default make-plots labels when comparing to data. * bin/rivet-mkhtml: Adding a timestamp to the generated pages, and a -t/--title option to allow setting the main HTML page title on the command line: otherwise it becomes impossible to tell these pages apart when you have a lot of them, except by URL! 2011-03-24 Andy Buckley * bin/aida2flat: Adding a -M option to *exclude* histograms whose paths match a regex. Writing a negative lookahead regex with positive matching was far too awkward! 2011-03-18 Leif Lonnblad * src/Core/AnalysisHandler.cc (AnalysisHandler::removeAnalysis): Fixed strange shared pointer assignment that caused seg-fault. 2011-03-13 Hendrik Hoeth * filling of functions works now in a more intuitive way (I hope). 2011-03-09 Andy Buckley * Version 1.5.0 release! 2011-03-08 Andy Buckley * Adding some extra checks for external packages in make-plots. 2011-03-07 Andy Buckley * Changing the accuracy of the beam energy checking to 1%, to make the UI a bit more forgiving. It's still best to specify exactly the right energy of course! 2011-03-01 Andy Buckley * Adding --no-plottitle to compare-histos (+ completion). * Fixing segfaults in UA1_1990_S2044935 and UA5_1982_S875503. * Bump ABI version numbers for 1.5.0 release. * Use AnalysisInfo for storage of the NeedsCrossSection analysis flag. * Allow field setting in AnalysisInfo. 2011-02-27 Hendrik Hoeth * Support LineStyle=dashdotted in make-plots * New command line option --style for compare-histos. Options are "default", "bw" and "talk". * cleaner uninstall 2011-02-26 Andy Buckley * Changing internal storage and return type of Particle::pdgId() to PdgId, and adding Particle::energy(). * Renaming Analysis::energies() as Analysis::requiredEnergies(). * Adding beam energies into beam consistency checking: Analysis::isCompatible methods now also require the beam energies to be provided. * Removing long-deprecated AnalysisHandler::init() constructor and AnalysisHandler::removeIncompatibleAnalyses() methods. 2011-02-25 Andy Buckley * Adding --disable-obsolete, which takes its value from the value of --disable-preliminary by default. * Replacing RivetUnvalidated and RivetPreliminary plugin libraries with optionally-configured analysis contents in the experiment-specific plugin libraries. This avoids issues with making libraries rebuild consistently when sources were reassigned between libraries. 2011-02-24 Andy Buckley * Changing analysis plugin registration to fall back through available paths rather than have RIVET_ANALYSIS_PATH totally override the built-in paths. The first analysis hook of a given name to be found is now the one that's used: any duplicates found will be warned about but unused. getAnalysisLibPaths() now returns *all* the search paths, in keeping with the new search behaviour. 2011-02-22 Andy Buckley * Moving the definition of the MSG_* macros into the Logging.hh header. They can't be used everywhere, though, as they depend on the existence of a this->getLog() method in the call scope. This move makes them available in e.g. AnalysisHandler and other bits of framework other than projections and analyses. * Adding a gentle print-out from the Rivet AnalysisHandler if preliminary analyses are being used, and strengthening the current warning if unvalidated analyses are used. * Adding documentation about the validation "process" and the (un)validated and preliminary analysis statuses. * Adding the new RivetPreliminary analysis library, and the corresponding --disable-preliminary configure flag. Analyses in this library are subject to change names, histograms, reference data values, etc. between releases: make sure you check any dependences on these analyses when upgrading Rivet. * Change the Python script ref data search behaviours to use Rivet ref data by default where available, rather than requiring a -R option. Where relevant, -R is still a valid option, to avoid breaking legacy scripts, and there is a new --no-rivet-refs option to turn the default searching *off*. * Add the prepending and appending optional arguments to the path searching functions. This will make it easier to combine the search functions with user-supplied paths in Python scripts. * Make make-plots killable! * Adding Rivet version to top of run printout. * Adding Run::crossSection() and printing out the cross-section in pb at the end of a Rivet run. 2011-02-22 Hendrik Hoeth * Make lighthisto.py aware of 2D histograms * Adding published versions of the CDF_2008 leading jets and DY analyses, and marking the preliminary ones as "OBSOLETE". 2011-02-21 Andy Buckley * Adding PDF documentation for path searching and .info/.plot files, and tidying overfull lines. * Removing unneeded const declarations from various return by value path and internal binning functions. Should not affect ABI compatibility but will force recompilation of external packages using the RivetPaths.hh and Utils.hh headers. * Adding findAnalysis*File(fname) functions, to be used by Rivet scripts and external programs to find files known to Rivet according to Rivet's (newly standard) lookup rule. * Changing search path function behaviour to always return *all* search directories rather than overriding the built-in locations if the environment variables are set. 2011-02-20 Andy Buckley * Adding the ATLAS 2011 transverse jet shapes analysis. 2011-02-18 Hendrik Hoeth * Support for transparency in make-plots 2011-02-18 Frank Siegert * Added ATLAS prompt photon analysis ATLAS_2010_S8914702 2011-02-10 Hendrik Hoeth * Simple NOOP constructor for Thrust projection * Add CMS event shape analysis. Data read off the plots. We will get the final numbers when the paper is accepted by the journal. 2011-02-10 Frank Siegert * Add final version of ATLAS dijet azimuthal decorrelation 2011-02-10 Hendrik Hoeth * remove ATLAS conf note analyses for which we have final data * reshuffle histograms in ATLAS minbias analysis to match Hepdata * small pT-cut fix in ATLAS track based UE analysis 2011-01-31 Andy Buckley * Doc tweaks and adding cmp-by-|p| functions for Jets, to match those added by Hendrik for Particles. * Don't sum photons around muons in the D0 2010 Z pT analysis. 2011-01-27 Andy Buckley * Adding ATLAS 2010 min bias and underlying event analyses and data. 2011-01-23 Andy Buckley * Make make-plots write out PDF rather than PS by default. 2011-01-12 Andy Buckley * Fix several rendering and comparison bugs in rivet-mkhtml. * Allow make-plots to write into an existing directory, at the user's own risk. * Make rivet-mkhtml produce PDF-based output rather than PS by default (most people want PDF these days). Can we do the same change of default for make-plots? * Add getAnalysisPlotPaths() function, and use it in compare-histos * Use proper .info file search path function internally in AnalysisInfo::make. 2011-01-11 Andy Buckley * Clean up ATLAS dijet analysis. 2010-12-30 Andy Buckley * Adding a run timeout option, and small bug-fixes to the event timeout handling, and making first event timeout work nicely with the run timeout. Run timeout is intended to be used in conjunction with timed batch token expiry, of the type that likes to make 0 byte AIDA files on LCG when Grid proxies time out. 2010-12-21 Andy Buckley * Fix the cuts in the CDF 1994 colour coherence analysis. 2010-12-19 Andy Buckley * Fixing CDF midpoint cone jet algorithm default construction to have an overlap threshold of 0.5 rather than 0.75. This was recommended by the FastJet manual, and noticed while adding the ATLAS and CMS cones. * Adding ATLAS and CMS old iterative cones as "official" FastJets constructor options (they could always have been used by explicit instantiation and attachment of a Fastjet plugin object). * Removing defunct and unused ClosestJetShape projection. 2010-12-16 Andy Buckley * bin/compare-histos, pyext/lighthisto.py: Take ref paths from rivet module API rather than getting the environment by hand. * pyext/lighthisto.py: Only read .plot info from the first matching file (speed-up compare-histos). 2010-12-14 Andy Buckley * Augmenting the physics vector functionality to make FourMomentum support maths operators with the correct return type (FourMomentum rather than FourVector). 2010-12-11 Andy Buckley * Adding a --event-timeout option to control the event timeout, adding it to the completion script, and making sure that the init time check is turned OFF once successful! * Adding an 3600 second timeout for initialising an event file. If it takes longer than (or anywhere close to) this long, chances are that the event source is inactive for some reason (perhaps accidentally unspecified and stdin is not active, or the event generator has died at the other end of the pipe. The reason for not making it something shorter is that e.g. Herwig++ or Sherpa can have long initialisation times to set up the MPI handler or to run the matrix element integration. An timeout after an hour is still better than a batch job which runs for two days before you realise that you forgot to generate any events! 2010-12-10 Andy Buckley * Fixing unbooked-histo segfault in UA1_1990_S2044935 at 63 GeV. 2010-12-08 Hendrik Hoeth * Fixes in ATLAS_2010_CONF_083, declaring it validated * Added ATLAS_2010_CONF_046, only two plots are implemented. The paper will be out soon, and we don't need the other plots right now. Data is read off the plots in the note. * New option "SmoothLine" for HISTOGRAM sections in make-plots * Changed CustomTicks to CustomMajorTicks and added CustomMinorTicks in make-plots. 2010-12-07 Andy Buckley * Update the documentation to explain this latest bump to path lookup behaviours. * Various improvements to existing path lookups. In particular, the analysis lib path locations are added to the info and ref paths to avoid having to set three variables when you have all three file types in the same personal plugin directory. * Adding setAnalysisLibPaths and addAnalysisLibPath functions. rivet --analysis-path{,-append} now use these and work correctly. Hurrah! * Add --show-analyses as an alias for --show-analysis, following a comment at the ATLAS tutorial. 2010-12-07 Hendrik Hoeth * Change LegendXPos behaviour in make-plots. Now the top left corner of the legend is used as anchor point. 2010-12-03 Andy Buckley * 1.4.0 release. * Add bin-skipping to compare-histos to avoid one use of rivet-rmgaps (it's still needed for non-plotting post-processing like Professor). 2010-12-03 Hendrik Hoeth * Fix normalisation issues in UA5 and ALEPH analyses 2010-11-27 Andy Buckley * MathUtils.hh: Adding fuzzyGtrEquals and fuzzyLessEquals, and tidying up the math utils collection a bit. * CDF 1994 colour coherence analysis overhauled and correction/norm factors fixed. Moved to VALIDATED status. * Adding programmable completion for aida2flat and flat2aida. * Improvements to programmable completion using the neat _filedir completion shell function which I just discovered. 2010-11-26 Andy Buckley * Tweak to floating point inRange to use fuzzyEquals for CLOSED interval equality comparisons. * Some BibTeX generation improvements, and fixing the ATLAS dijet BibTeX key. * Resolution upgrade in PNG make-plots output. * CDF_2005_S6217184.cc, CDF_2008_S7782535.cc: Updates to use the new per-jet JetAlg interface (and some other fixes). * JetAlg.cc: Changed the interface on request to return per-jet rather than per-event jet shapes, with an extra jet index argument. * MathUtils.hh: Adding index_between(...) function, which is handy for working out which bin a value falls in, given a set of bin edges. 2010-11-25 Andy Buckley * Cmp.hh: Adding ASC/DESC (and ANTISORTED) as preferred non-EQUIVALENT enum value synonyms over misleading SORTED/UNSORTED. * Change of rapidity scheme enum name to RapScheme * Reworking JetShape a bit further: constructor args now avoid inconsistencies (it was previously possible to define incompatible range-ends and interval). Internal binning implementation also reworked to use a vector of bin edges: the bin details are available via the interface. The general jet pT cuts can be applied via the JetShape constructor. * MathUtils.hh: Adding linspace and logspace utility functions. Useful for defining binnings. * Adding more general cuts on jet pT and (pseudo)rapidity. 2010-11-11 Andy Buckley * Adding special handling of FourMomentum::mass() for computed zero-mass vectors for which mass2 can go (very slightly) negative due to numerical precision. 2010-11-10 Hendrik Hoeth * Adding ATLAS-CONF-2010-083 conference note. Data is read from plots. When I run Pythia 6 the bins close to pi/2 are higher than in the note, so I call this "unvalidated". But then ... the note doesn't specify a tune or even just a version for the generators in the plots. Not even if they used Pythia 6 or Pythia 8. Probably 6, since they mention AGILe. 2010-11-10 Andy Buckley * Adding a JetAlg::useInvisibles(bool) mechanism to allow ATLAS jet studies to include neutrinos. Anyone who chooses to use this mechanism had better be careful to remove hard neutrinos manually in the provided FinalState object. 2010-11-09 Hendrik Hoeth * Adding ATLAS-CONF-2010-049 conference note. Data is read from plots. Fragmentation functions look good, but I can't reproduce the MC lines (or even the relative differences between them) in the jet cross-section plots. So consider those unvalidated for now. Oh, and it seems ATLAS screwed up the error bands in their ratio plots, too. They are upside-down. 2010-11-07 Hendrik Hoeth * Adding ATLAS-CONF-2010-081 conference note. Data is read from plots. 2010-11-06 Andy Buckley * Deprecating the old JetShape projection and renaming to ClosestJetShape: the algorithm has a tenuous relationship with that actually used in the CDF (and ATLAS) jet shape analyses. CDF analyses to be migrated to the new JetShape projection... and some of that projection's features, design elements, etc. to be finished off: we may as well take this opportunity to clear up what was one of our nastiest pieces of code. 2010-11-05 Hendrik Hoeth * Adding ATLAS-CONF-2010-031 conference note. Data is read from plots. 2010-10-29 Andy Buckley * Making rivet-buildplugin use the same C++ compiler and CXXFLAGS variable as used for the Rivet system build. * Fixing NeutralFinalState projection to, erm, actually select neutral particles (by Hendrik). * Allow passing a general FinalState reference to the JetShape projection, rather than requiring a VetoedFS. 2010-10-07 Andy Buckley * Adding a --with-root flag to rivet-buildplugin to add root-config --libs flags to the plugin build command. 2010-09-24 Andy Buckley * Releasing as Rivet 1.3.0. * Bundling underscore.sty to fix problems with running make-plots on dat files generated by compare-histos from AIDA files with underscores in their names. 2010-09-16 Andy Buckley * Fix error in N_effective definition for weighted profile errors. 2010-08-18 Andy Buckley * Adding MC_GENERIC analysis. NB. Frank Siegert also added MC_HJETS. 2010-08-03 Andy Buckley * Fixing compare-histos treatment of what is now a ref file, and speeding things up... again. What a mess! 2010-08-02 Andy Buckley * Adding rivet-nopy: a super-simple Rivet C++ command line interface which avoids Python to make profiling and debugging easier. * Adding graceful exception handling to the AnalysisHandler event loop methods. * Changing compare-histos behaviour to always show plots for which there is at least one MC histo. The default behaviour should now be the correct one in 99% of use cases. 2010-07-30 Andy Buckley * Merging in a fix for shared_ptrs not being compared for insertion into a set based on raw pointer value. 2010-07-16 Andy Buckley * Adding an explicit library dependency declaration on libHepMC, and hence removing the -lHepMC from the rivet-config --libs output. 2010-07-14 Andy Buckley * Adding a manual section on use of Rivet (and AGILe) as libraries, and how to use the -config scripts to aid compilation. * FastJets projection now allows setting of a jet area definition, plus a hacky mapping for getting the area-enabled cluster sequence. Requested by Pavel Starovoitov & Paolo Francavilla. * Lots of script updates in last two weeks! 2010-06-30 Andy Buckley * Minimising amount of Log class mapped into SWIG. * Making Python ext build checks fail with error rather than warning if it has been requested (or, rather, not explicitly disabled). 2010-06-28 Andy Buckley * Converting rivet Python module to be a package, with the dlopen flag setting etc. done around the SWIG generated core wrapper module (rivet.rivetwrap). * Requiring Python >= 2.4.0 in rivet scripts (and adding a Python version checker function to rivet module) * Adding --epspng option to make-plots (and converting to use subprocess.Popen). 2010-06-27 Andy Buckley * Converting JADE_OPAL analysis to use the fastjet exclusive_ymerge_*max* function, rather than just exclusive_ymerge: everything looks good now. It seems that fastjet >= 2.4.2 is needed for this to work properly. 2010-06-24 Andy Buckley * Making rivet-buildplugin look in its own bin directory when trying to find rivet-config. 2010-06-23 Andy Buckley * Adding protection and warning about numerical precision issues in jet mass calculation/histogramming to the MC_JetAnalysis analysis. * Numerical precision improvement in calculation of Vector4::mass2. * Adding relative scale ratio plot flag to compare-histos * Extended command completion to rivet-config, compare-histos, and make-plots. * Providing protected log messaging macros, MSG_{TRACE,DEBUG,INFO,WARNING,ERROR} cf. Athena. * Adding environment-aware functions for Rivet search path list access. 2010-06-21 Andy Buckley * Using .info file beam ID and energy info in HTML and LaTeX documentation. * Using .info file beam ID and energy info in command-line printout. * Fixing a couple of references to temporary variables in the analysis beam info, which had been introduced during refactoring: have reinstated reference-type returns as the more efficient solution. This should not affect API compatibility. * Making SWIG configure-time check include testing for incompatibilities with the C++ compiler (re. the recurring _const_ char* literals issue). * Various tweaks to scripts: make-plots and compare-histos processes are now renamed (on Linux), rivet-config is avoided when computing the Rivet version,and RIVET_REF_PATH is also set using the rivet --analysis-path* flags. compare-histos now uses multiple ref data paths for .aida file globbing. * Hendrik changed VetoedFinalState comparison to always return UNDEFINED if vetoing on the results of other FS projections is being used. This is the only simple way to avoid problems emanating from the remainingFinalState thing. 2010-06-19 Andy Buckley * Adding --analysis-path and --analysis-path-append command-line flags to the rivet script, as a "persistent" way to set or extend the RIVET_ANALYSIS_PATH variable. * Changing -Q/-V script verbosity arguments to more standard -q/-v, after Hendrik moaned about it ;) * Small fix to TinyXML operator precendence: removes a warning, and I think fixes a small bug. * Adding plotinfo entries for new jet rapidity and jet mass plots in MC_JetAnalysis derivatives. * Moving MC_JetAnalysis base class into a new libRivetAnalysisTools library, with analysis base class and helper headers to be stored in the reinstated Rivet/Analyses include directory. 2010-06-08 Andy Buckley * Removing check for CEDARSTD #define guard, since we no longer compile against AGILe and don't have to be careful about duplication. * Moving crappy closest approach and decay significance functions from Utils into SVertex, which is the only place they have ever been used (and is itself almost entirely pointless). * Overhauling particle ID <-> name system to clear up ambiguities between enums, ints, particles and beams. There are no more enums, although the names are still available as const static ints, and names are now obtained via a singleton class which wraps an STL map for name/ID lookups in both directions. 2010-05-18 Hendrik Hoeth * Fixing factor-of-2 bug in the error calculation when scaling histograms. * Fixing D0_2001_S4674421 analysis. 2010-05-11 Andy Buckley * Replacing TotalVisibleMomentum with MissingMomentum in analyses and WFinder. Using vector ET rather than scalar ET in some places. 2010-05-07 Andy Buckley * Revamping the AnalysisHandler constructor and data writing, with some LWH/AIDA mangling to bypass the stupid AIDA idea of having to specify the sole output file and format when making the data tree. Preferred AnalysisHandler constructor now takes only one arg -- the runname -- and there is a new AH.writeData(outfile) method to replace AH.commitData(). Doing this now to begin migration to more flexible histogramming in the long term. 2010-04-21 Hendrik Hoeth * Fixing LaTeX problems (make-plots) on ancient machines, like lxplus. 2010-04-29 Andy Buckley * Fixing (I hope!) the treatment of weighted profile bin errors in LWH. 2010-04-21 Andy Buckley * Removing defunct and unused KtJets and Configuration classes. * Hiding some internal details from Doxygen. * Add @brief Doxygen comments to all analyses, projections and core classes which were missing them. 2010-04-21 Hendrik Hoeth * remove obsolete reference to InitialQuarks from DELPHI_2002 * fix normalisation in CDF_2000_S4155203 2010-04-20 Hendrik Hoeth * bin/make-plots: real support for 2-dim histograms plotted as colormaps, updated the documentation accordingly. * fix misleading help comment in configure.ac 2010-04-08 Andy Buckley * bin/root2flat: Adding this little helper script, minimally modified from one which Holger Schulz made for internal use in ATLAS. 2010-04-05 Andy Buckley * Using spiresbib in rivet-mkanalysis: analysis templates made with rivet-mkanalysis will now contain a SPIRES-dumped BibTeX key and entry if possible! * Adding BibKey and BibTeX entries to analysis metadata files, and updating doc build to use them rather than the time-consuming SPIRES screen-scraping. Added SPIRES BibTeX dumps to all analysis metadata using new (uninstalled & unpackaged) doc/get-spires-data script hack. * Updating metadata files to add Energies, Beams and PtCuts entries to all of them. * Adding ToDo, NeedsCrossSection, and better treatment of Beams and Energies entries in metadata files and in AnalysisInfo and Analysis interfaces. 2010-04-03 Andy Buckley * Frank Siegert: Update of rivet-mkhtml to conform to improved compare-histos. * Frank Siegert: LWH output in precision-8 scientific notation, to solve a binning precision problem... the first time weve noticed a problem! * Improved treatment of data/reference datasets and labels in compare-histos. * Rewrite of rivet-mkanalysis in Python to make way for neat additions. * Improving SWIG tests, since once again the user's biuld system must include SWIG (no test to check that it's a 'good SWIG', since the meaning of that depends on which compiler is being used and we hope that the user system is consistent... evidence from Finkified Macs and bloody SLC5 notwithstanding). 2010-03-23 Andy Buckley * Tag as patch release 1.2.1. 2010-03-22 Andy Buckley * General tidying of return arguments and intentionally unused parameters to keep -Wextra happy (some complaints remain from TinyXML, FastJet, and HepMC). * Some extra bug fixes: in FastJets projection with explicit plugin argument, removing muon veto cut on FoxWolframMoments. * Adding UNUSED macro to help with places where compiler warnings can't be helped. * Turning on -Wextra warnings, and fixing some violations. 2010-03-21 Andy Buckley * Adding MissingMomentum projection, as replacement for ~all uses of now-deprecated TotalVisibleMomentum projection. * Fixing bug with TotalVisibleMomentum projection usage in MC_SUSY analysis. * Frank Siegert fixed major bug in pTmin param passing to FastJets projection. D'oh: requires patch release. 2010-03-02 Andy Buckley * Tagging for 1.2.0 release... at last! 2010-03-01 Andy Buckley * Updates to manual, manual generation scripts, analysis info etc. * Add HepData URL to metadata print-out with rivet --show-analysis * Fix average Et plot in UA1 analysis to only apply to the tracker acceptance (but to include neutral particle contributions, i.e. the region of the calorimeter in the tracker acceptance). * Use Et rather than pT in filling the scalar Et measure in TotalVisibleMomentum. * Fixes to UA1 normalisation (which is rather funny in the paper). 2010-02-26 Andy Buckley * Update WFinder to not place cuts and other restrictions on the neutrino. 2010-02-11 Andy Buckley * Change analysis loader behaviour to use ONLY RIVET_ANALYSIS_PATH locations if set, otherwise use ONLY the standard Rivet analysis install path. Should only impact users of personal plugin analyses, who should now explicitly set RIVET_ANALYSIS_PATH to load their analysis... and who can now create personal versions of standard analyses without getting an error message about duplicate loading. 2010-01-15 Andy Buckley * Add tests for "stable" heavy flavour hadrons in jets (rather than just testing for c/b hadrons in the ancestor lists of stable jet constituents) 2009-12-23 Hendrik Hoeth * New option "RatioPlotMode=deviation" in make-plots. 2009-12-14 Hendrik Hoeth * New option "MainPlot" in make-plots. For people who only want the ratio plot and nothing else. * New option "ConnectGaps" in make-plots. Set to 1 if you want to connect gaps in histograms with a line when ErrorBars=0. Works both in PLOT and in HISTOGRAM sections. * Eliminated global variables for coordinates in make-plots and enabled multithreading. 2009-12-14 Andy Buckley * AnalysisHandler::execute now calls AnalysisHandler::init(event) if it has not yet been initialised. * Adding more beam configuration features to Beam and AnalysisHandler: the setRunBeams(...) methods on the latter now allows a beam configuration for the run to be specified without using the Run class. 2009-12-11 Andy Buckley * Removing use of PVertex from few remaining analyses. Still used by SVertex, which is itself hardly used and could maybe be removed... 2009-12-10 Andy Buckley * Updating JADE_OPAL to do the histo booking in init(), since sqrtS() is now available at that stage. * Renaming and slightly re-engineering all MC_*_* analyses to not be collider-specific (now the Analysis::sqrtS/beams()) methods mean that histograms can be dynamically binned. * Creating RivetUnvalidated.so plugin library for unvalidated analyses. Unvalidated analyses now need to be explicitly enabled with a --enable-unvalidated flag on the configure script. * Various min bias analyses updated and validated. 2009-12-10 Hendrik Hoeth * Propagate SPECIAL and HISTOGRAM sections from .plot files through compare-histos * STAR_2006_S6860818: vs particle mass, validate analysis 2009-12-04 Andy Buckley * Use scaling rather than normalising in DELPHI_1996: this is generally desirable, since normalizing to 1 for 1/sig dsig/dx observables isn't correct if any events fall outside the histo bounds. * Many fixes to OPAL_2004. * Improved Hemispheres interface to remove unnecessary consts on returned doubles, and to also return non-squared versions of (scaled) hemisphere masses. * Add "make pyclean" make target at the top level to make it easier for developers to clean their Python module build when the API is extended. * Identify use of unvalidated analyses with a warning message at runtime. * Providing Analysis::sqrtS() and Analysis::beams(), and making sure they're available by the time the init methods are called. 2009-12-02 Andy Buckley * Adding passing of first event sqrt(s) and beams to analysis handler. * Restructuring running to only use one HepMC input file (no-one was using multiple ones, right?) and to break down the Run class to cleanly separate the init and event loop phases. End of file is now neater. 2009-12-01 Andy Buckley * Adding parsing of beam types and pairs of energies from YAML. 2009-12-01 Hendrik Hoeth * Fixing trigger efficiency in CDF_2009_S8233977 2009-11-30 Andy Buckley * Using shared pointers to make I/O object memory management neater and less error-prone. * Adding crossSectionPerEvent() method [== crossSection()/sumOfWeights()] to Analysis. Useful for histogram scaling since numerator of sumW_passed/sumW_total (to calculate pass-cuts xsec) is cancelled by dividing histo by sumW_passed. * Clean-up of Particle class and provision of inline PID:: functions which take a Particle as an argument to avoid having to explicitly call the Particle::pdgId() method. 2009-11-30 Hendrik Hoeth * Fixing division by zero in Profile1D bin errors for bins with just a single entry. 2009-11-24 Hendrik Hoeth * First working version of STAR_2006_S6860818 2009-11-23 Hendrik Hoeth * Adding missing CDF_2001_S4751469 plots to uemerge * New "ShowZero" option in make-plots * Improving lots of plot defaults * Fixing typos / non-existing bins in CDF_2001_S4751469 and CDF_2004_S5839831 reference data 2009-11-19 Hendrik Hoeth * Fixing our compare() for doubles. 2009-11-17 Hendrik Hoeth * Zeroth version of STAR_2006_S6860818 analysis (identified strange particles). Not working yet for unstable particles. 2009-11-11 Andy Buckley * Adding separate jet-oriented and photon-oriented observables to MC PHOTONJETUE analysis. * Bug fix in MC leading jets analysis, and general tidying of leading jet analyses to insert units, etc. (should not affect any current results) 2009-11-10 Hendrik Hoeth * Fixing last issues in STAR_2006_S6500200 and setting it to VALIDATED. * Noramlise STAR_2006_S6870392 to cross-section 2009-11-09 Andy Buckley * Overhaul of jet caching and ParticleBase interface. * Adding lists of analyses' histograms (obtained by scanning the plot info files) to the LaTeX documentation. 2009-11-07 Andy Buckley * Adding checking system to ensure that Projections aren't registered before the init phase of analyses. * Now that the ProjHandler isn't full of defunct pointers (which tend to coincidentally point to *new* Projection pointers rather than undefined memory, hence it wasn't noticed until recently!), use of a duplicate projection name is now banned with a helpful message at runtime. * (Huge) overhaul of ProjectionHandler system to use shared_ptr: projections are now deleted much more efficiently, naturally cleaning themselves out of the central repository as they go out of scope. 2009-11-06 Andy Buckley * Adding Cmp specialisation, using fuzzyEquals(). 2009-11-05 Hendrik Hoeth * Fixing histogram division code. 2009-11-04 Hendrik Hoeth * New analysis STAR_2006_S6500200 (pion and proton pT spectra in pp collisions at 200 GeV). It is still unclear if they used a cut in rapidity or pseudorapidity, thus the analysis is declared "UNDER DEVELOPMENT" and "DO NOT USE". * Fixing compare() in NeutralFinalState and MergedFinalState 2009-11-04 Andy Buckley * Adding consistence checking on beam ID and sqrt(s) vs. those from first event. 2009-11-03 Andy Buckley * Adding more assertion checks to linear algebra testing. 2009-11-02 Hendrik Hoeth * Fixing normalisation issue with stacked histograms in make-plots. 2009-10-30 Hendrik Hoeth * CDF_2009_S8233977: Updating data and axes labels to match final paper. Normalise to cross-section instead of data. 2009-10-23 Andy Buckley * Fixing Cheese-3 plot in CDF 2004... at last! 2009-10-23 Hendrik Hoeth * Fix muon veto in CDF_1994_S2952106, CDF_2005_S6217184, CDF_2008_S7782535, and D0_2004_S5992206 2009-10-19 Andy Buckley * Adding analysis info files for MC SUSY and PHOTONJETUE analyses. * Adding MC UE analysis in photon+jet events. 2009-10-19 Hendrik Hoeth * Adding new NeutralFinalState projection. Note that this final state takes E_T instead of p_T as argument (makes more sense for neutral particles). The compare() method does not yet work as expected (E_T comparison still missing). * Adding new MergedFinalState projection. This merges two final states, removing duplicate particles. Duplicates are identified by looking at the genParticle(), so users need to take care of any manually added particles themselves. * Fixing most open issues with the STAR_2009_UE_HELEN analysis. There is only one question left, regarding the away region. * Set the default split-merge value for SISCone in our FastJets projection to the recommended (but not Fastjet-default!) value of 0.75. 2009-10-17 Andy Buckley * Adding parsing of units in cross-sections passed to the "-x" flag, i.e. "-x 101 mb" is parsed internally into 1.01e11 pb. 2009-10-16 Hendrik Hoeth * Disabling DELPHI_2003_WUD_03_11 in the Makefiles, since I don't trust the data. * Getting STAR_2009_UE_HELEN to work. 2009-10-04 Andy Buckley * Adding triggers and other tidying to (still unvalidated) UA1_1990 analysis. * Fixing definition of UA5 trigger to not be intrinscally different for pp and ppbar: this is corrected for (although it takes some readng to work this out) in the 1982 paper, which I think is the only one to compare the two modes. * Moving projection setup and registration into init() method for remaining analyses. * Adding trigger implementations as projections for CDF Runs 0 & 1, and for UA5. 2009-10-01 Andy Buckley * Moving projection setup and registration into init() method for analyses from ALEPH, CDF and the MC_ group. * Adding generic SUSY validation analysis, based on plots used in ATLAS Herwig++ validation. * Adding sorted particle accessors to FinalState (cf. JetAlg). 2009-09-29 Andy Buckley * Adding optional use of args as regex match expressions with -l/--list-analyses. 2009-09-03 Andy Buckley * Passing GSL include path to compiler, since its absence was breaking builds on systems with no GSL installation in a standard location (such as SLC5, for some mysterious reason!) * Removing lib extension passing to compiler from the configure script, because Macs and Linux now both use .so extensions for the plugin analysis modules. 2009-09-02 Andy Buckley * Adding analysis info file path search with RIVET_DATA_PATH variable (and using this to fix doc build.) * Improvements to AnalysisLoader path search. * Moving analysis sources back into single directory, after a proletarian uprising ;) 2009-09-01 Andy Buckley * Adding WFinder and WAnalysis, based on Z proj and analysis, with some tidying of the Z code. * ClusteredPhotons now uses an IdentifiedFS to pick the photons to be looped over, and only clusters photons around *charged* signal particles. 2009-08-31 Andy Buckley * Splitting analyses by directory, to make it easier to disable building of particular analysis group plugin libs. * Removing/merging headers for all analyses except for the special MC_JetAnalysis base class. * Exit with an error message if addProjection is used twice from the same parent with distinct projections. 2009-08-28 Andy Buckley * Changed naming convention for analysis plugin libraries, since the loader has changed so much: they must now *start* with the word "Rivet" (i.e. no lib prefix). * Split standard plugin analyses into several plugin libraries: these will eventually move into separate subdirs for extra build convenience. * Started merging analysis headers into the source files, now that we can (the plugin hooks previously forbade this). * Replacement of analysis loader system with a new one based on ideas from ThePEG, which uses dlopen-time instantiation of templated global variables to reduce boilerplate plugin hooks to one line in analyses. 2009-07-14 Frank Siegert * Replacing in-source histo-booking metadata with .plot files. 2009-07-14 Andy Buckley * Making Python wrapper files copy into place based on bundled versions for each active HepMC interface (2.3, 2.4 & 2.5), using a new HepMC version detector test in configure. * Adding YAML metadata files and parser, removing same metadata from the analysis classes' source headers. 2009-07-07 Andy Buckley * Adding Jet::hadronicEnergy() * Adding VisibleFinalState and automatically using it in JetAlg projections. * Adding YAML parser for new metadata (and eventually ref data) files. 2009-07-02 Andy Buckley * Adding Jet::neutralEnergy() (and Jet::totalEnergy() for convenience/symmetry). 2009-06-25 Andy Buckley * Tidying and small efficiency improvements in CDF_2008_S7541902 W+jets analysis (remove unneeded second stage of jet storing, sorting the jets twice, using foreach, etc.). 2009-06-24 Andy Buckley * Fixing Jet's containsBottom and containsCharm methods, since B hadrons are not necessarily to be found in the final state. Discovered at the same time that HepMC::GenParticle defines a massively unhelpful copy constructor that actually loses the tree information; it would be better to hide it entirely! * Adding RivetHepMC.hh, which defines container-type accessors to HepMC particles and vertices, making it possible to use Boost foreach and hence avoiding the usual huge boilerplate for-loops. 2009-06-11 Andy Buckley * Adding --disable-pdfmanual option, to make the bootstrap a bit more robust. * Re-enabling D0IL in FastJets: adding 10^-10 to the pTmin removes the numerical instability! * Fixing CDF_2004 min/max cone analysis to use calo jets for the leading jet Et binning. Thanks to Markus Warsinsky for (re)discovering this bug: I was sure it had been fixed. I'm optimistic that this will fix the main distributions, although Swiss Cheese "minus 3" is still likely to be broken. Early tests look okay, but it'll take more stats before we can remove the "do not trust" sign. 2009-06-10 Andy Buckley * Providing "calc" methods so that Thrust and Sphericity projections can be used as calculators without having to use the projecting/caching system. 2009-06-09 Andy Buckley * 1.1.3 release! * More doc building and SWIG robustness tweaks. 2009-06-07 Andy Buckley * Make doc build from metadata work even before the library is installed. 2009-06-07 Hendrik Hoeth * Fix phi rotation in CDF_2008_LEADINGJETS. 2009-06-07 Andy Buckley * Disabling D0 IL midpoint cone (using CDF modpoint instead), since there seems to be a crashing bug in FastJet's implementation: we can't release that way, since ~no D0 analyses will run. 2009-06-03 Andy Buckley * Putting SWIG-generated source files under SVN control to make life easier for people who we advise to check out the SVN head version, but who don't have a sufficiently modern copy of SWIG to * Adding the --disable-analyses option, for people who just want to use Rivet as a framework for their own analyses. * Enabling HepMC cross-section reading, now that HepMC 2.5.0 has been released. 2009-05-23 Hendrik Hoeth * Using gsl-config to locate libgsl * Fix the paths for linking such that our own libraries are found before any system libraries, e.g. for the case that there is an outdated fastjet version installed on the system while we want to use our own up-to-date version. * Change dmerge to ymerge in the e+e- analyses using JADE or DURHAM from fastjet. That's what it is called in fastjet-2.4 now. 2009-05-18 Andy Buckley * Adding use of gsl-config in configure script. 2009-05-16 Andy Buckley * Removing argument to vetoEvent macro, since no weight subtraction is now needed. It's now just an annotated return, with built-in debug log message. * Adding an "open" FinalState, which is only calculated once per even, then used by all other FSes, avoiding the loop over non-status 1 particles. 2009-05-15 Andy Buckley * Removing incorrect setting of DPS x-errs in CDF_2008 jet shape analysis: the DPS autobooking already gets this bit right. * Using Jet rather than FastJet::PseudoJet where possible, as it means that the phi ranges match up nicely between Particle and the Jet object. The FastJet objects are only really needed if you want to do detailed things like look at split/merge scales for e.g. diff jet rates or "y-split" analyses. * Tidying and debugging CDF jet shape analyses and jet shape plugin... ongoing, but I think I've found at least one real bug, plus a lot of stuff that can be done a lot more nicely. * Fully removing deprecated math functions and updating affected analyses. 2009-05-14 Andy Buckley * Removing redundant rotation in DISKinematics... this was a legacy of Peter using theta rather than pi-theta in his rotation. * Adding convenience phi, rho, eta, theta, and perp,perp2 methods to the 3 and 4 vector classes. 2009-05-12 Andy Buckley * Adding event auto-rotation for events with one proton... more complete approach? 2009-05-09 Hendrik Hoeth * Renaming CDF_2008_NOTE_9337 to CDF_2009_S8233977. * Numerous small bug fixes in ALEPH_1996_S3486095. * Adding data for one of the Rick-Field-style STAR UE analyses. 2009-05-08 Andy Buckley * Adding rivet-mkanalysis script, to make generating new analysis source templates easier. 2009-05-07 Andy Buckley * Adding null vector check to Vector3::azimuthalAngle(). * Fixing definition of HCM/Breit frames in DISKinematics, and adding asserts to check that the transformation is doing what it should. 2009-05-05 Andy Buckley * Removing eta and Et cuts from CDF 2000 Z pT analysis, based on our reading of the paper, and converting most of the analysis to a call of the ZFinder projection. 2009-05-05 Hendrik Hoeth * Support non-default seed_threshold in CDF cone jet algorithms. * New analyses STAR_2006_S6870392 and STAR_2008_S7993412. In STAR_2008_S7993412 only the first distribution is filled at the moment. STAR_2006_S6870392 is normalised to data instead of the Monte Carlo cross-section, since we don't have that available in the HepMC stream yet. 2009-05-05 Andy Buckley * Changing Event wrapper to copy whole GenEvents rather than pointers, use std units if supported in HepMC, and run a placeholder function for event auto-orientation. 2009-04-28 Andy Buckley * Removing inclusion of IsolationTools header by analyses that aren't actually using the isolation tools... which is all of them. Leaving the isolation tools in place for now, as there might still be use cases for them and there's quite a lot of code there that deserves a second chance to be used! 2009-04-24 Andy Buckley * Deleting Rivet implementations of TrackJet and D0ILConeJets: the code from these has now been incorporated into FastJet 2.4.0. * Removed all mentions of the FastJet JADE patch and the HAVE_JADE preprocessor macro. * Bug fix to D0_2008_S6879055 to ensure that cuts compare to both electron and positron momenta (was just comparing against electrons, twice, probably thanks to the miracle of cut and paste). * Converting all D0 IL Cone jets to use FastJets. Involved tidying D0_2004 jet azimuthal decorrelation analysis and D0_2008_S6879055 as part of migration away from using the getLorentzJets method, and removing the D0ILConeJets header from quite a few analyses that weren't using it at all. * Updating CDF 2001 to use FastJets in place of TrackJet, and adding axis labels to its plots. * Note that ZEUS_2001_S4815815 uses the wrong jet definition: it should be a cone but curently uses kT. * Fixing CDF_2005_S6217184 to use correct (midpoint, R=0.7) jet definition. That this was using a kT definition with R=1.0 was only made obvious when the default FastJets constructor was removed. * Removing FastJets default constructor: since there are now several good (IRC safe) jet definitions available, there is no obvious safe default and analyses should have to specify which they use. * Moving FastJets constructors into implementation file to reduce recompilation dependencies, and adding new plugins. * Ensuring that axis labels actually get written to the output data file. 2009-04-22 Andy Buckley * Adding explicit FastJet CDF jet alg overlap_threshold constructor param values, since the default value from 2.3.x is now removed in version 2.4.0. * Removing use of HepMC ThreeVector::mag method (in one place only) since this has been removed in version 2.5.0b. * Fix to hepmc.i (included by rivet.i) to ignore new HepMC 2.5.0b GenEvent stream operator. 2009-04-21 Andy Buckley * Dependency on FastJet now requires version 2.4.0 or later. Jade algorithm is now native. * Moving all analysis constructors and Projection headers from the analysis header files into their .cc implementation files, cutting header dependencies. * Removing AIDA headers: now using LWH headers only, with enhancement to use axis labels. This facility is now used by the histo booking routines, and calling the booking function versions which don't specify axis labels will result in a runtime warning. 2009-04-07 Andy Buckley * Adding $(DESTDIR) prefix to call to Python module "setup.py install" * Moving HepMC SWIG mappings into Python Rivet module for now: seems to work-around the SL type-mapping bug. 2009-04-03 Andy Buckley * Adding MC analysis for LHC UE: higher-pT replica of Tevatron 2008 leading jets study. * Adding CDF_1990 pseudorapidity analysis. * Moving CDF_2001 constructor into implementation file. * Cleaning up CDF_2008_LEADINGJETS a bit, e.g. using foreach loops. * Adding function interface for specifying axis labels in histo bookings. Currently has no effect, since AIDA doesn't seem to have a mechanism for axis labels. It really is a piece of crap. 2009-03-18 Andy Buckley * Adding docs "make upload" and other tweaks to make the doc files fit in with the Rivet website. * Improving LaTex docs to show email addresses in printable form and to group analyses by collider or other metadata. * Adding doc script to include run info in LaTeX docs, and to make HTML docs. * Removing WZandh projection, which wasn't generator independent and whose sole usage was already replaced by ZFinder. * Improvements to constructors of ZFinder and InvMassFS. * Changing ExampleTree to use real FS-based Z finding. 2009-03-16 Andy Buckley * Allow the -H histo file spec to give a full name if wanted. If it doesn't end in the desired extension, it will be added. * Adding --runname option (and API elements) to choose a run name to be prepended as a "top level directory" in histo paths. An empty value results in no extra TLD. 2009-03-06 Andy Buckley * Adding R=0.2 photon clustering to the electrons in the CDF 2000 Z pT analysis. 2009-03-04 Andy Buckley * Fixing use of fastjet-config to not use the user's PATH variable. * Fixing SWIG type table for HepMC object interchange. 2009-02-20 Andy Buckley * Adding use of new metadata in command line analysis querying with the rivet command, and in building the PDF Rivet manual. * Adding extended metadata methods to the Analysis interface and the Python wrapper. All standard analyses comply with this new interface. 2009-02-19 Andy Buckley * Adding usefully-scoped config headers, a Rivet::version() function which uses them, and installing the generated headers to fix "external" builds against an installed copy of Rivet. The version() function has been added to the Python wrapper. 2009-02-05 Andy Buckley * Removing ROOT dependency and linking. Woo! There's no need for this now, because the front-end accepts no histo format switch and we'll just use aida2root for output conversions. Simpler this way, and it avoids about half of our compilation bug reports from 32/64 bit ROOT build confusions. 2009-02-04 Andy Buckley * Adding automatic generation of LaTeX manual entries for the standard analyses. 2009-01-20 Andy Buckley * Removing RivetGun and TCLAP source files! 2009-01-19 Andy Buckley * Added psyco Python optimiser to rivet, make-plots and compare-histos. * bin/aida2root: Added "-" -> "_" mangling, following requests. 2009-01-17 Andy Buckley * 1.1.2 release. 2009-01-15 Andy Buckley * Converting Python build system to bundle SWIG output in tarball. 2009-01-14 Andy Buckley * Converting AIDA/LWH divide function to return a DPS so that bin width factors don't get all screwed up. Analyses adapted to use the new division operation (a DPS/DPS divide would also be nice... but can wait for YODA). 2009-01-06 Andy Buckley * bin/make-plots: Added --png option for making PNG output files, using 'convert' (after making a PDF --- it's a bit messy) * bin/make-plots: Added --eps option for output filtering through ps2eps. 2009-01-05 Andy Buckley * Python: reworking Python extension build to use distutils and newer m4 Python macros. Probably breaks distcheck but is otherwise more robust and platform independent (i.e. it should now work on Macs). 2008-12-19 Andy Buckley * make-plots: Multi-threaded make-plots and cleaned up the LaTeX building a bit (necessary to remove the implicit single global state). 2008-12-18 Andy Buckley * make-plots: Made LaTeX run in no-stop mode. * compare-histos: Updated to use a nicer labelling syntax on the command line and to successfully build MC-MC plots. 2008-12-16 Andy Buckley * Made LWH bin edge comparisons safe against numerical errors. * Added Particle comparison functions for sorting. * Removing most bad things from ExampleTree and tidying up. Marked WZandh projection for removal. 2008-12-03 Hendrik Hoeth * Added the two missing observables to the CDF_2008_NOTE_9337 analysis, i.e. track pT and sum(ET). There is a small difference between our MC output and the MC plots of the analysis' author, we're still waiting for the author's comments. 2008-12-02 Andy Buckley * Overloading use of a std::set in the interface, since the version of SWIG on Sci Linux doesn't have a predefined mapping for STL sets. 2008-12-02 Hendrik Hoeth * Fixed uemerge. The output was seriously broken by a single line of debug information in fillAbove(). Also changed uemerge output to exponential notation. * Unified ref and mc histos in compare-histos. Histos with one bin are plotted linear. Option for disabling the ratio plot. Several fixes for labels, legends, output directories, ... * Changed rivetgun's fallback directory for parameter files to $PREFIX/share/AGILe, since that's where the steering files now are. * Running aida2flat in split mode now produces make-plots compatible dat-files for direct plotting. 2008-11-28 Andy Buckley * Replaced binreloc with an upgraded and symbol-independent copy. 2008-11-25 Andy Buckley * Added searching of $RIVET_REF_PATH for AIDA reference data files. 2008-11-24 Andy Buckley * Removing "get"s and other obsfucated syntax from ProjectionApplier (Projection and Analysis) interfaces. 2008-11-21 Andy Buckley * Using new "global" Jet and V4 sorting functors in TrackJet. Looks like there was a sorting direction problem before... * Verbose mode with --list-analyses now shows descriptions as well as analysis names. * Moved data/Rivet to data/refdata and moved data/RivetGun contents to AGILe (since generator steering is no longer a Rivet thing) * Added unchecked ratio plots to D0 Run II jet + photon analysis. * Added D0 inclusive photon analysis. * Added D0 Z rapidity analysis. * Tidied up constructor interface and projection chain implementation of InvMassFinalState. * Added ~complete set of Jet and FourMomentum sorting functors. 2008-11-20 Andy Buckley * Added IdentifiedFinalState. * Moved a lot of TrackJet and Jet code into .cc files. * Fixed a caching bug in Jet: cache flag resets should never be conditional, since they are then sensitive to initialisation errors. * Added quark enum values to ParticleName. * Rationalised JetAlg interfaces somewhat, with "size()" and "jets()" methods in the interface. * Added D0 W charge asymmetry and D0 inclusive jets analyses. 2008-11-18 Andy Buckley * Adding D0 inclusive Z pT shape analysis. * Added D0 Z + jet pT and photon + jet pT spectrum analyses. * Lots of tidying up of particle, event, particle name etc. * Now the first event is used to detect the beam type and remove incompatible analyses. 2008-11-17 Andy Buckley * Added bash completion for rivetgun. * Starting to provide stand-alone call methods on projections so they can be used without the caching infrastructure. This could also be handy for unit testing. * Adding functionality (sorting function and built-in sorting schemes) to the JetAlg interface. 2008-11-10 Hendrik Hoeth * Fix floating point number output format in aida2flat and flat2aida * Added CDF_2002_S4796047: CDF Run-I charged multiplicity distribution * Renamed CDF_2008_MINBIAS to CDF_2008_NOTE_9337, since the note is publicly available now. 2008-11-10 Hendrik Hoeth * Added DELPHI_2003_WUD_03_11: Delphi 4-jet angular distributions. There is still a problem with the analysis, so don't use it yet. But I need to commit the code because my laptop is broken ... 2008-11-06 Andy Buckley * Code review: lots of tidying up of projections and analyses. * Fixes for compatibility with the LLVM C & C++ compiler. * Change of Particle interface to remove "get"-prefixed method names. 2008-11-05 Andy Buckley * Adding ability to query analysis metadata from the command line. * Example of a plugin analyis now in plugindemo, with a make check test to make sure that the plugin analysis is recognised by the command line "rivet" tool. * GCC 4.3 fix to mat-vec tests. 2008-11-04 Andy Buckley * Adding native logger control from Python interface. 2008-11-03 Andy Buckley * Adding bash_completion for rivet executable. 2008-10-31 Andy Buckley * Clean-up of histo titles and analysis code review. * Added momentum construction functions from FastJet PseudoJets. 2008-10-28 Andy Buckley * Auto-booking of histograms with a name, rather than the HepData ID 3-tuple is now possible. * Fix in CDF 2001 pT spectra to get the normalisations to depend on the pT_lead cutoff. 2008-10-23 Andy Buckley * rivet handles signals neatly, as for rivetgun, so that premature killing of the analysis process will still result in an analysis file. * rivet now accepts cross-section as a command line argument and, if it is missing and is required, will prompt the user for it interactively. 2008-10-22 Andy Buckley * rivet (Python interface) now can list analyses, check when adding analyses that the given names are valid, specify histo file name, and provide sensibly graded event number logging. 2008-10-20 Andy Buckley * Corrections to CDF 2004 analysis based on correspondance with Joey Huston. M bias dbns now use whole event within |eta| < 0.7, and Cheese plots aren't filled at all if there are insufficient jets (and the correct ETlead is used). 2008-10-08 Andy Buckley * Added AnalysisHandler::commitData() method, to allow the Python interface to write out a histo file without having to know anything about the histogramming API. * Reduced SWIG interface file to just map a subset of Analysis and AnalysisHandler functionality. This will be the basis for a new command line interface. 2008-10-06 Andy Buckley * Converted FastJets plugin to use a Boost shared_pointer to the cached ClusterSequence. The nullness of the pointer is now used to indicate an empty tracks (and hence jets) set. Once FastJet natively support empty CSeqs, we can rewrite this a bit more neatly and ditch the shared_ptr. 2008-10-02 Andy Buckley * The CDF_2004 (Acosta) data file now includes the full range of pT for the min bias data at both 630 and 1800 GeV. Previously, only the small low-pT insert plot had been entered into HepData. 2008-09-30 Andy Buckley * Lots of updates to CDF_2004 (Acosta) UE analysis, including sorting jets by E rather than Et, and factorising transverse cone code into a function so that it can be called with a random "leading jet" in min bias mode. Min bias histos are now being trial-filled just with tracks in the transverse cones, since the paper is very unclear on this. * Discovered a serious caching problem in FastJets projection when an empty tracks vector is passed from the FinalState. Unfortunately, FastJet provides no API way to solve the problem, so we'll have to report this upstream. For now, we're solving this for CDF_2004 by explicitly vetoing events with no tracks. * Added Doxygen to the build with target "dox" * Moved detection of whether cross-section information is needed into the AnalysisHandler, with dynamic computation by scanning contained analyses. * Improved robustness of event reading to detect properly when the input file is smaller than expected. 2008-09-29 Hendrik Hoeth * New analysis: CDF_2000_S4155203 2008-09-23 Andy Buckley * rivetgun can now be built and run without AGILe. Based on a patch by Frank Siegert. 2008-09-23 Hendrik Hoeth * Some preliminary numbers for the CDF_2008_LEADINGJETS analysis (only transverse region and not all observables. But all we have now.) 2008-09-17 Andy Buckley * Breaking up the mammoth "generate" function, to make Python mapping easier, among other reasons. * Added if-zero-return-zero checking to angle mapping functions, to avoid problems where 1e-19 gets mapped on to 2 pi and then fails boundary asserts. * Added HistoHandler singleton class, which will be a central repository for holding analyses' histogram objects to be accessed via a user-chosen name. 2008-08-26 Andy Buckley * Allowing rivet-config to return combined flags. 2008-08-14 Andy Buckley * Fixed some g++ 4.3 compilation bugs, including "vector" not being a valid name for a method which returns a physics vector, since it clashes with std::vector (which we globally import). Took the opportunity to rationalise the Jet interface a bit, since "particle" was used to mean "FourMomentum", and "Particle" types required a call to "getFullParticle". I removed the "gets" at the same time, as part of our gradual migration to a coherent naming policy. 2008-08-11 Andy Buckley * Tidying of FastJets and added new data files from HepData. 2008-08-10 James Monk * FastJets now uses user_index property of fastjet::PseudoJet to reconstruct PID information in jet contents. 2008-08-07 Andy Buckley * Reworking of param file and command line parsing. Tab characters are now handled by the parser, in a way equivalent to spaces. 2008-08-06 Andy Buckley * Added extra histos and filling to Acosta analysis - all HepData histos should now be filled, depending on sqrt{s}. Also trialling use of LaTeX math mode in titles. 2008-08-05 Andy Buckley * More data files for CDF analyses (2 x 2008, 1 x 1994), and moved the RivetGun AtlasPythia6.params file to more standard fpythia-atlas.params (and added to the install list). 2008-08-04 Andy Buckley * Reduced size of available options blocks in RivetGun help text by removing "~" negating variants (which are hardly ever used in practice) and restricting beam particles to PROTON, ANTIPROTON,ELECTRON and POSITRON. * Fixed Et sorting in Acosta analysis. 2008-08-01 Andy Buckley * Added AIDA headers to the install list, since external (plugin-type) analyses need them to be present for compilation to succeed. 2008-07-29 Andy Buckley * Fixed missing ROOT compile flags for libRivet. * Added command line repetition to logging. 2008-07-29 Hendrik Hoeth * Included the missing numbers and three more observables in the CDF_2008_NOTE_9351 analysis. 2008-07-29 Andy Buckley * Fixed wrong flags on rivet-config 2008-07-28 Hendrik Hoeth * Renamed CDF_2008_DRELLYAN to CDF_2008_NOTE_9351. Updated numbers and cuts to the final version of this CDF note. 2008-07-28 Andy Buckley * Fixed polar angle calcuation to use atan2. * Added "mk" prefixes and x/setX convention to math classes. 2008-07-28 Hendrik Hoeth * Fixed definition of FourMomentum::pT (it had been returning pT2) 2008-07-27 Andy Buckley * Added better tests for Boost headers. * Added testing for -ansi, -pedantic and -Wall compiler flags. 2008-07-25 Hendrik Hoeth * updated DELPHI_2002_069_CONF_603 according to information from the author 2008-07-17 Andy Buckley * Improvements to aida2flat: now can produce one output file per histo, and there is a -g "gnuplot mode" which comments out the YODA/make_plot headers to make the format readable by gnuplot. * Import boost::assign namespace contents into the Rivet namespace --- provides very useful intuitive collection initialising functions. 2008-07-15 Andy Buckley * Fixed missing namespace in vector/matrix testing. * Removed Boost headers: now a system dependency. * Fixed polarRadius infinite loop. 2008-07-09 Andy Buckley * Fixed definitions of mapAngleMPiToPi, etc. and used them to fix the Jet::getPhi method. * Trialling use of "foreach" loop in CDF_2004: it works! Very nice. 2008-07-08 Andy Buckley * Removed accidental reference to an "FS" projection in FinalStateHCM's compare method. rivetgun -A now works again. * Added TASSO, SLD and D0_2008 reference data. The TASSO and SLD papers aren't installed or included in the tarball since there are currently no plans to implement these analyses. * Added Rivet namespacing to vector, matrix etc. classes. This required some re-writing and the opportunity was taken to move some canonical function definitions inside the classes and to improve the header structure of the Math area. 2008-07-07 Andy Buckley * Added Rivet namespace to Units.hh and Constants.hh. * Added Doxygen "@brief" flags to analyses. * Added "RIVET_" namespacing to all header guards. * Merged Giulio Lenzi's isolation/vetoing/invmass projections and D0 2008 analysis. 2008-06-23 Jon Butterworth * Modified FastJet to fix ysplit and split and filter. * Modified ExampleTree to show how to call them. 2008-06-19 Hendrik Hoeth * Added first version of the CDF_2008_DRELLYAN analysis described on http://www-cdf.fnal.gov/physics/new/qcd/abstracts/UEinDY_08.html There is a small difference between the analysis and this implementation, but it's too small to be visible. The fpythia-cdfdrellyan.params parameter file is for this analysis. * Added first version of the CDF_2008_MINBIAS analysis described on http://www-cdf.fnal.gov/physics/new/qcd/abstracts/minbias_08.html The .aida file is read from the plots on the web and will change. I'm still discussing some open questions about the analysis with the author. 2008-06-18 Jon Butterworth * Added First versions of splitJet and filterJet methods to fastjet.cc. Not yet tested, buyer beware. 2008-06-18 Andy Buckley * Added extra sorted Jets and Pseudojets methods to FastJets, and added ptmin argument to the JetAlg getJets() method, requiring a change to TrackJet. 2008-06-13 Andy Buckley * Fixed processing of "RG" parameters to ensure that invalid iterators are never used. 2008-06-10 Andy Buckley * Updated AIDA reference files, changing "/HepData" root path to "/REF". Still missing a couple of reference files due to upstream problems with the HepData records. 2008-06-09 Andy Buckley * rivetgun now handles termination signals (SIGTERM, SIGINT and SIGHUP) gracefully, finishing the event loop and finalising histograms. This means that histograms will always get written out, even if not all the requested events have been generated. 2008-06-04 Hendrik Hoeth * Added DELPHI_2002_069_CONF_603 analysis 2008-05-30 Hendrik Hoeth * Added InitialQuarks projection * Added OPAL_1998_S3780481 analysis 2008-05-29 Andy Buckley * distcheck compatibility fixes and autotools tweaks. 2008-05-28 Andy Buckley * Converted FastJet to use Boost smart_ptr for its plugin handling, to solve double-delete errors stemming from the heap cloning of projections. * Added (a subset of) Boost headers, particularly the smart pointers. 2008-05-24 Andy Buckley * Added autopackage spec files. * Merged these changes into the trunk. * Added a registerClonedProjection(...) method to ProjectionHandler: this is needed so that cloned projections will have valid pointer entries in the ProjectHandler repository. * Added clone() methods to all projections (need to use this, since the templated "new PROJ(proj)" approach to cloning can't handle object polymorphism. 2008-05-19 Andy Buckley * Moved projection-applying functions into ProjectionApplier base class (from which Projection and Analysis both derive). * Added Rivet-specific exceptions in place of std::runtime_error. * Removed unused HepML reference files. * Added error handling for requested analyses with wrong case convention / missing name. 2008-05-15 Hendrik Hoeth * New analysis PDG_Hadron_Multiplicities * flat2aida converter 2008-05-15 Andy Buckley * Removed unused mysterious Perl scripts! * Added RivetGun.HepMC logging of HepMC event details. 2008-05-14 Hendrik Hoeth * New analysis DELPHI_1995_S3137023. This analysis contains the xp spectra of Xi+- and Sigma(1385)+-. 2008-05-13 Andy Buckley * Improved logging interface: log levels are now integers (for cross-library compatibility and level setting also applies to existing loggers. 2008-05-09 Andy Buckley * Improvements to robustness of ROOT checks. * Added --version flag on config scripts and rivetgun. 2008-05-06 Hendrik Hoeth * New UnstableFinalState projection which selects all hadrons, leptons and real photons including unstable particles. * In the DELPHI_1996_S3430090 analysis the multiplicities for pi+/pi- and p0 are filled, using the UnstableFinalState projection. 2008-05-06 Andy Buckley * FastJets projection now protects against the case where no particles exist in the final state (where FastJet throws an exception). * AIDA file writing is now separated from the AnalysisHandler::finalize method... API users can choose what to do with the histo objects, be that writing out or further processing. 2008-04-29 Andy Buckley * Increased default tolerances in floating point comparisons as they were overly stringent and valid f.p. precision errors were being treated as significant. * Implemented remainder of Acosta UE analysis. * Added proper getEtSum() to Jet. * Added Et2() member and function to FourMomentum. * Added aida2flat conversion script. * Fixed ambiguity in TrackJet algorithm as to how the iteration continues when tracks are merged into jets in the inner loop. 2008-04-28 Andy Buckley * Merged in major "ProjectionHandler" branch. Projections are now all stored centrally in the singleton ProjectionHandler container, rather than as member pointers in projections and analyses. This also affects the applyProjection mechanism, which is now available as a templated method on Analysis and Projection. Still a few wrinkles need to be worked out. * The branch changes required a comprehensive review of all existing projections and analyses: lots of tidying up of these classes, as well as the auxiliary code like math utils, has taken place. Too much to list and track, unfortunately! 2008-03-28 Andy Buckley * Started second CDF UE analysis ("Acosta"): histograms defined. * Fixed anomalous factor of 2 in LWH conversion from Profile1D to DataPointSet. * Added pT distribution histos to CDF 2001 UE analysis. 2008-03-26 Andy Buckley * Removed charged+neutral versions of histograms and projections from DELPHI analysis since they just duplicate the more robust charged-only measurements and aren't really of interest for tuning. 2008-03-10 Andy Buckley * Profile histograms now use error computation with proper weighting, as described here: http://en.wikipedia.org/wiki/Weighted_average 2008-02-28 Andy Buckley * Added --enable-jade flag for Professor studies with patched FastJet. * Minor fixes to LCG tag generator and gfilt m4 macros. * Fixed projection slicing issues with Field UE analysis. * Added Analysis::vetoEvent(e) function, which keeps track of the correction to the sum of weights due to event vetoing in analysis classes. 2008-02-26 Andy Buckley * Vector and derived classes now initialise to have zeroed components when the no-arg constructor is used. * Added Analysis::scale() function to scale 1D histograms. Analysis::normalize() uses it internally, and the DELPHI (A)EEC, whose histo weights are not pure event weights, and normalised using scale(h, 1/sumEventWeights). 2008-02-21 Hendrik Hoeth * Added EEC and AEEC to the DELPHI_1996_S3430090 analysis. The normalisation of these histograms is still broken (ticket #163). 2008-02-19 Hendrik Hoeth * Many fixes to the DELPHI_1996_S3430090 analysis: bugfix in the calulation of eigenvalues/eigenvectors in MatrixDiag.hh for the sphericity, rewrite of Thrust/Major/Minor, fixed scaled momentum, hemisphere masses, normalisation in single particle events, final state slicing problems in the projections for Thrust, Sphericity and Hemispheres. 2008-02-08 Andy Buckley * Applied fixes and extensions to DIS classes, based on submissions by Dan Traynor. 2008-02-06 Andy Buckley * Made projection pointers used for cut combining into const pointers. Required some redefinition of the Projection* comparison operator. * Temporarily added FinalState member to ChargedFinalState to stop projection lifetime crash. 2008-02-01 Andy Buckley * Fixed another misplaced factor of bin width in the Analysis::normalize() method. 2008-01-30 Andy Buckley * Fixed the conversion of IHistogram1D to DPS, both via the explicit Analysis::normalize() method and the implicit AnalysisHandler::treeNormalize() route. The root of the problem is the AIDA choice of the word "height" to represent the sum of weights in a bin: i.e. the bin width is not taken into account either in computing bin height or error. 2008-01-22 Andy Buckley * Beam projection now uses HepMC GenEvent::beam_particles() method to get the beam particles. This is more portable and robust for C++ generators, and equivalent to the existing "first two" method for Fortran generators. 2008-01-17 Andy Buckley * Added angle range fix to pseudorapidity function (thanks to Piergiulio Lenzi). 2008-01-10 Andy Buckley * Changed autobooking plot codes to use zero-padding (gets the order right in JAS, file browser, ROOT etc.). Also changed the 'ds' part to 'd' for consistency. HepData's AIDA output has been correspondingly updated, as have the bundled data files. 2008-01-04 Andy Buckley * Tidied up JetShape projection a bit, including making the constructor params const references. This seems to have sorted the runtime segfault in the CDF_2005 analysis. * Added caching of the analysis bin edges from the AIDA file - each analysis object will now only read its reference file once, which massively speeds up the rivetgun startup time for analyses with large numbhers of autobooked histos (e.g. the DELPHI_1996_S3430090 analysis). 2008-01-02 Andy Buckley * CDF_2001_S4751469 now uses the LossyFinalState projection, with an 8% loss rate. * Added LossyFinalState and HadronicFinalState, and fixed a "polarity" bug in the charged final state projection (it was keeping only the *uncharged* particles). * Now using isatty(1) to determine whether or not color escapes can be used. Also removed --color argument, since it can't have an effect (TCLAP doesn't do position-based flag toggling). * Made Python extension build optional (and disabled by default). 2008-01-01 Andy Buckley * Removed some unwanted DEBUG statements, and lowered the level of some infrastructure DEBUGs to TRACE level. * Added bash color escapes to the logger system. 2007-12-21 Leif Lonnblad * include/LWH/ManagedObject.h: Fixed infinite loop in encodeForXML cf. ticket #135. 2007-12-20 Andy Buckley * Removed HepPID, HepPDT and Boost dependencies. * Fixed XML entity encoding in LWH. Updated CDF_2007_S7057202 analysis to not do its own XML encoding of titles. 2007-12-19 Andy Buckley * Changed units header to set GeV = 1 (HepMC convention) and using units in CDF UE analysis. 2007-12-15 Andy Buckley * Introduced analysis metadata methods for all analyses (and made them part of the Analysis interface). 2007-12-11 Andy Buckley * Added JetAlg base projection for TrackJet, FastJet etc. 2007-12-06 Andy Buckley * Added checking for Boost library, and the standard Boost test program for shared_ptr. * Got basic Python interface running - required some tweaking since Python and Rivet's uses of dlopen collide (another RTLD_GLOBAL issue - see http://muttley.hates-software.com/2006/01/25/c37456e6.html ) 2007-12-05 Andy Buckley * Replaced all use of KtJets projection with FastJets projection. KtJets projection disabled but left undeleted for now. CLHEP and KtJet libraries removed from configure searches and Makefile flags. 2007-12-04 Andy Buckley * Param file loading now falls back to the share/RivetGun directory if a local file can't be found and the provided name has no directory separators in it. * Converted TrackJet projection to update the jet centroid with each particle added, using pT weighting in the eta and phi averaging. 2007-12-03 Andy Buckley * Merged all command line handling functions into one large parse function, since only one executable now needs them. This removes a few awkward memory leaks. * Removed rivet executable - HepMC file reading functionality will move into rivetgun. * Now using HepMC IO_GenEvent format (IO_Ascii and IO_ExtendedAscii are deprecated). Now requires HepMC >= 2.3.0. * Added forward declarations of GSL diagonalisation routines, eliminating need for GSL headers to be installed on build machine. 2007-11-27 Andy Buckley * Removed charge differentiation from Multiplicity projection (use CFS proj) and updated ExampleAnalysis to produce more useful numbers. * Introduced binreloc for runtime path determination. * Fixed several bugs in FinalState, ChargedFinalState, TrackJet and Field analysis. * Completed move to new analysis naming scheme. 2007-11-26 Andy Buckley * Removed conditional HAVE_FASTJET bits: FastJet is now compulsory. * Merging appropriate RivetGun parts into Rivet. RivetGun currently broken. 2007-11-23 Andy Buckley * Renaming analyses to Spires-ID scheme: currently of form S, to become __. 2007-11-20 Andy Buckley * Merged replacement vectors, matrices and boosts into trunk. 2007-11-15 Leif Lonnblad * src/Analysis.cc, include/Rivet/Analysis.hh: Introduced normalize function. See ticket #126. 2007-10-31 Andy Buckley * Tagging as 1.0b2 for HERA-LHC meeting. 2007-10-25 Andy Buckley * Added AxesDefinition base interface to Sphericity and Thrust, used by Hemispheres. * Exposed BinaryCut class, improved its interface and fixed a few bugs. It's now used by VetoedFinalState for momentum cuts. * Removed extra output from autobooking AIDA reader. * Added automatic DPS booking. 2007-10-12 Andy Buckley * Improved a few features of the build system 2007-10-09 James Monk * Fixed dylib dlopen on Mac OS X. 2007-10-05 Andy Buckley * Added new reference files. 2007-10-03 Andy Buckley * Fixed bug in configure.ac which led to explicit CXX setting being ignored. * Including Logging.hh in Projection.hh, hence new transitive dependency on Logging.hh being installed. Since this is the normal behaviour, I don't think this is a problem. * Fixed segfaulting bug due to use of addProjection() in locally-scoped contained projections. This isn't a proper fix, since the whole framework should be designed to avoid the possibility of bugs like this. * Added newly built HepML and AIDA reference files for current analyses. 2007-10-02 Andy Buckley * Fixed possible null-pointer dereference in Particle copy constructor and copy assignment: this removes one of two blocker segfaults, the other of which is related to the copy-assignment of the TotalVisMomentum projection in the ExampleTree analysis. 2007-10-01 Andy Buckley * Fixed portable path to Rivet share directory. 2007-09-28 Andy Buckley * Added more functionality to the rivet-config script: now has libdir, includedir, cppflags, ldflags and ldlibs options. 2007-09-26 Andy Buckley * Added the analysis library closer function to the AnalysisHandler finalize() method, and also moved the analysis delete loop into AnalysisHandler::finalize() so as not to try deleting objects whose libraries have already closed. * Replaced the RivetPaths.cc.in method for portable paths with something using -D defines - much simpler! 2007-09-21 Lars Sonnenschein * Added HepEx0505013 analysis and JetShape projection (some fixes by AB.) * Added GetLorentzJets member function to D0 RunII cone jet projection 2007-09-21 Andy Buckley * Fixed lots if bugs and bad practice in HepEx0505013 (to make it compile-able!) * Downclassed the log messages from the Test analysis to DEBUG level. * Added isEmpty() method to final state projection. * Added testing for empty final state and useful debug log messages to sphericity projection. 2007-09-20 Andy Buckley * Added Hemispheres projection, which calculates event hemisphere masses and broadenings. 2007-09-19 Andy Buckley * Added an explicit copy assignment operator to Particle: the absence of one of these was responsible for the double-delete error. * Added a "fuzzy equals" utility function for float/double types to Utils.hh (which already contains a variety of handy little functions). * Removed deprecated Beam::operator(). * Added ChargedFinalState projection and de-pointered the contained FinalState projection in VetoedFinalState. 2007-09-18 Andy Buckley * Major bug fixes to the regularised version of the sphericity projection (and hence the Parisi tensor projection). Don't trust C & D param results from any previous version! * Added extra methods to thrust and sphericity projections to get the oblateness and the sphericity basis (currently returns dummy axes since I can't yet work out how to get the similarity transform eigenvectors from CLHEP) 2007-09-14 Andy Buckley * Merged in a branch of pluggable analysis mechanisms. 2007-06-25 Jon Butterworth * Fixed some bugs in the root output for DataPoint.h 2007-06-25 Andy Buckley * include/Rivet/**/Makefile.am: No longer installing headers for "internal" functionality. * include/Rivet/Projections/*.hh: Removed the private restrictions on copy-assignment operators. 2007-06-18 Leif Lonnblad * include/LWH/Tree.h: Fixed minor bug in listObjectNames. * include/LWH/DataPointSet.h: Fixed setCoordinate functions so that they resize the vector of DataPoints if it initially was empty. * include/LWH/DataPoint.h: Added constructor taking a vector of measuremts. 2007-06-16 Leif Lonnblad * include/LWH/Tree.h: Implemented the listObjectNames and ls functions. * include/Rivet/Projections/FinalStateHCM.hh, include/Rivet/Projections/VetoedFinalState.hh: removed _theParticles and corresponding access function. Use base class variable instead. * include/Rivet/Projections/FinalState.hh: Made _theParticles protected. 2007-06-13 Leif Lonnblad * src/Projections/FinalStateHCM.cc, src/Projections/DISKinematics.cc: Equality checks using GenParticle::operator== changed to check for pointer equality. * include/Rivet/Analysis/HepEx9506012.hh: Uses modified DISLepton projection. * include/Rivet/Particle.hh: Added member function to check if a GenParticle is associated. * include/Rivet/Projections/DISLepton.hh, src/Projections/DISLepton.cc: Fixed bug in projection. Introduced final state projection to limit searching for scattered lepton. Still not properly tested. 2007-06-08 Leif Lonnblad * include/Rivet/Projections/PVertex.hh, src/Projections/PVertex.cc: Fixed the projection to simply get the signal_process_vertex from the GenEvent. This is the way it should work. If the GenEvent does not have a signal_process_vertex properly set up in this way, the problem is with the class that fills the GenEvent. 2007-06-06 Jon Butterworth * Merged TotalVisibleMomentum and CalMET * Added pT ranges to Vetoed final state projection 2007-05-27 Jon Butterworth * Fixed initialization of VetoedFinalStateProjection in ExampleTree 2007-05-27 Leif Lonnblad * include/Rivet/Projections/KtJets.*: Make sure the KtEvent is deleted properly. 2007-05-26 Jon Butterworth * Added leptons to the ExampleTree. * Added TotalVisibleEnergy projection, and added output to ExampleTree. 2007-05-25 Jon Butterworth * Added a charged lepton projection 2007-05-23 Andy Buckley * src/Analysis/HepEx0409040.cc: Changed range of the histograms to the "pi" range rather than the "128" range. * src/Analysis/Analysis.cc: Fixed a bug in the AIDA path building. Histogram auto-booking now works. 2007-05-23 Leif Lonnblad * src/Analysis/HepEx9506012.cc: Now uses the histogram booking function in the Analysis class. 2007-05-23 Jon Butterworth * Fixed bug in PRD65092002 (was failing on zero jets) 2007-05-23 Andy Buckley * Added (but haven't properly tested) a VetoedFinalState projection. * Added normalize() method for AIDA 1D histograms. * Added configure checking for Mac OS X version, and setting the development target flag accordingly. 2007-05-22 Andy Buckley * Added an ostream method for AnalysisName enums. * Converted Analyses and Projections to use projection lists, cuts and beam constraints. * Added beam pair combining to the BeamPair sets of Projections by finding set meta-intersections. * Added methods to Cuts, Analysis and Projection to make Cut definition easier. * Fixed default fall-through in cut handling switch statement and now using -numeric_limits::max() rather than min() * Added more control of logging presentation via static flag methods on Log. 2007-05-13 Andy Buckley * Added self-consistency checking mechanisms for Cuts and Beam * Re-implemented the cut-handling part of RivetInfo as a Cuts class. * Changed names of Analysis and Projection name() and handler() methods to getName() and getHandler() to be more consistent with the rest of the public method names in those classes. 2007-05-02 Andy Buckley * Added auto-booking of histogram bins from AIDA XML files. The AIDA files are located via a C++ function which is generated from RivetPaths.cc.in by running configure. 2007-04-18 Andy Buckley * Added a preliminary version of the Rick Field UE analysis, under the name PRD65092002. 2007-04-19 Leif Lonnblad * src/Analysis/HepEx0409040.cc: The reason this did not compile under gcc-4 is that some iterators into a vector were wrongly assued to be pointers and were initialized to 0 and later compared to 0. I've changed this to initialize to end() of the corresponding vector and to compare with the same end() later. 2007-04-05 Andy Buckley * Lots of name changes in anticipation of the MCNet school. RivetHandler is now AnalysisHandler (since that's what it does!), BeamParticle has become ParticleName, and RivetInfo has been split into Cut and BeamConstraint portions. * Added BeamConstraint mechanism, which can be used to determine if an analysis is compatible with the beams being used in the generator. The ParticleName includes an "ANY" wildcard for this purpose. 2006-03-19 Andy Buckley * Added "rivet" executable which can read in HepMC ASCII dump files and apply Rivet analyses on the events. 2007-02-24 Leif Lonnblad * src/Projections/KtJets.cc: Added comparison of member variables in compare() function * all: Merged changes from polymorphic-projections branch into trunk 2007-02-17 Leif Lonnblad * all: projections and analysis handlers: All projections which uses other projctions now has a pointer rather than a copy of those projections to allow for polymorphism. The constructors has also been changed to require the used projections themselves, rather than the arguments needed to construct them. 2007-02-17 Leif Lonnblad * src/Projections/FinalState.cc, include/Rivet/Projections/FinalState.icc (Rivet), include/Rivet/Projections/FinalState.hh: Added cut in transverse momentum on the particles to be included in the final state. 2007-02-06 Leif Lonnblad * include/LWH/HistogramFactory.h: Fixed divide-by-zero in divide function. Also fixed bug in error calculation in divide function. Introduced checkBin function to make sure two histograms are equal even if they have variable bin widths. * include/LWH/Histogram1D.h: In normalize(double), do not do anything if the sum of the bins are zero to avoid dividing by zero. 2007-01-20 Leif Lonnblad * src/Test/testLWH.cc: Modified to output files using the Tree. * configure.ac: Removed AC_CONFIG_AUX_DIR([include/Rivet/Config]) since the directory does not exist anymore. 2006-12-21 Andy Buckley * Rivet will now conditionally install the AIDA and LWH headers if it can't find them when configure'ing. * Started integrating Leif's LWH package to fulfill the AIDA duties. * Replaced multitude of CLHEP wrapper headers with a single RivetCLHEP.h header. 2006-11-20 Andy Buckley * Introduced log4cpp logging. * Added analysis enum, which can be used as input to an analysis factory by Rivet users. 2006-11-02 Andy Buckley * Yet more, almost pointless, administrative moving around of things with the intention of making the structure a bit better-defined: * The RivetInfo and RivetHandler classes have been moved from src/Analysis into src as they are really the main Rivet interface classes. The Rivet.h header has also been moved into the "header root". * The build of a single shared library in lib has been disabled, with the library being built instead in src. 2006-10-14 Andy Buckley * Introduced a minimal subset of the Sherpa math tools, such as Vector{3,4}D, Matrix, etc. The intention is to eventually cut the dependency on CLHEP. 2006-07-28 Andy Buckley * Moving things around: all sources now in directories under src 2006-06-04 Leif Lonnblad * Analysis/Examples/HZ95108.*: Now uses CentralEtHCM. Also set GeV units on the relevant histograms. * Projections/CentralEtHCM.*: Making a special class just to get out one number - the summed Et in the central rapidity bin - may seem like an overkill. But in case some one else might nees it... 2006-06-03 Leif Lonnblad * Analysis/Examples/HZ95108.*: Added the hz95108 energy flow analysis from HZtool. * Projections/DISLepton.*: Since many HERA measurements do not care if we have electron or positron beam, it is now possible to specify lepton or anti-lepton. * Projections/Event.*: Added member and access function for the weight of an event (taken from the GenEvent object.weights()[0]. * Analysis/RivetHandler.*: Now depends explicitly on the AIDA interface. An AIDA analysis factory must be specified in the constructor, where a tree and histogram factory is automatically created. Added access functions to the relevant AIDA objects. * Analysis/AnalysisBase.*: Added access to the RivetHandler and its AIDA factories. 2005-12-27 Leif Lonnblad * configure.ac: Added -I$THEPEGPATH/include to AM_CPPFLAGS. * Config/Rivet.h: Added some std incudes and using std:: declaration. * Analysis/RivetInfo.*: Fixed some bugs. The RivetInfo facility now works, although it has not been thoroughly tested. * Analysis/Examples/TestMultiplicity.*: Re-introduced FinalStateHCM for testing purposes but commented it away again. * .: Made a number of changes to implement handling of RivetInfo objects. diff --git a/analyses/pluginATLAS/ATLAS_2015_I1404878.cc b/analyses/pluginATLAS/ATLAS_2015_I1404878.cc --- a/analyses/pluginATLAS/ATLAS_2015_I1404878.cc +++ b/analyses/pluginATLAS/ATLAS_2015_I1404878.cc @@ -1,262 +1,263 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/IdentifiedFinalState.hh" #include "Rivet/Projections/PromptFinalState.hh" #include "Rivet/Projections/DressedLeptons.hh" #include "Rivet/Projections/FastJets.hh" #include "Rivet/Projections/VisibleFinalState.hh" namespace Rivet { class ATLAS_2015_I1404878 : public Analysis { public: /// Constructor DEFAULT_RIVET_ANALYSIS_CTOR(ATLAS_2015_I1404878); void init() { // Eta ranges Cut eta_full = (Cuts::abseta < 4.2) & (Cuts::pT >= 1.0*MeV); Cut lep_cuts = (Cuts::abseta < 2.5) && (Cuts::pT > 25*GeV); // All final state particles FinalState fs(eta_full); // Get photons to dress leptons IdentifiedFinalState photons(fs); photons.acceptIdPair(PID::PHOTON); // Projection to find the electrons IdentifiedFinalState el_id(fs); el_id.acceptIdPair(PID::ELECTRON); PromptFinalState electrons(el_id); electrons.acceptTauDecays(true); declare(electrons, "electrons"); DressedLeptons dressedelectrons(photons, electrons, 0.1, lep_cuts, true); declare(dressedelectrons, "dressedelectrons"); DressedLeptons ewdressedelectrons(photons, electrons, 0.1, eta_full, true); declare(ewdressedelectrons, "ewdressedelectrons"); // Projection to find the muons IdentifiedFinalState mu_id(fs); mu_id.acceptIdPair(PID::MUON); PromptFinalState muons(mu_id); muons.acceptTauDecays(true); declare(muons, "muons"); DressedLeptons dressedmuons(photons, muons, 0.1, lep_cuts, true); declare(dressedmuons, "dressedmuons"); DressedLeptons ewdressedmuons(photons, muons, 0.1, eta_full, true); declare(ewdressedmuons, "ewdressedmuons"); // Projection to find neutrinos IdentifiedFinalState nu_id; nu_id.acceptNeutrinos(); PromptFinalState neutrinos(nu_id); neutrinos.acceptTauDecays(true); // get MET from generic invisibles VetoedFinalState inv_fs(fs); inv_fs.addVetoOnThisFinalState(VisibleFinalState(fs)); declare(inv_fs, "InvisibleFS"); // Jet clustering. VetoedFinalState vfs; vfs.addVetoOnThisFinalState(ewdressedelectrons); vfs.addVetoOnThisFinalState(ewdressedmuons); vfs.addVetoOnThisFinalState(neutrinos); FastJets jets(vfs, FastJets::ANTIKT, 0.4); jets.useInvisibles(true); declare(jets, "jets"); // Histogram booking _h["massttbar"] = bookHisto1D( 1, 1, 1); _h["massttbar_norm"] = bookHisto1D( 2, 1, 1); _h["ptttbar"] = bookHisto1D( 3, 1, 1); _h["ptttbar_norm"] = bookHisto1D( 4, 1, 1); _h["absrapttbar"] = bookHisto1D( 5, 1, 1); _h["absrapttbar_norm"] = bookHisto1D( 6, 1, 1); _h["ptpseudotophadron"] = bookHisto1D( 7, 1, 1); _h["ptpseudotophadron_norm"] = bookHisto1D( 8, 1, 1); _h["absrappseudotophadron"] = bookHisto1D( 9, 1, 1); _h["absrappseudotophadron_norm"] = bookHisto1D(10, 1, 1); _h["absPout"] = bookHisto1D(11, 1, 1); _h["absPout_norm"] = bookHisto1D(12, 1, 1); _h["dPhittbar"] = bookHisto1D(13, 1, 1); _h["dPhittbar_norm"] = bookHisto1D(14, 1, 1); _h["HTttbar"] = bookHisto1D(15, 1, 1); _h["HTttbar_norm"] = bookHisto1D(16, 1, 1); _h["Yboost"] = bookHisto1D(17, 1, 1); _h["Yboost_norm"] = bookHisto1D(18, 1, 1); _h["chittbar"] = bookHisto1D(19, 1, 1); _h["chittbar_norm"] = bookHisto1D(20, 1, 1); _h["RWt"] = bookHisto1D(21, 1, 1); _h["RWt_norm"] = bookHisto1D(22, 1, 1); } + void analyze(const Event& event) { const double weight = event.weight(); // Get the selected objects, using the projections. vector electrons = applyProjection(event, "dressedelectrons").dressedLeptons(); vector muons = applyProjection(event, "dressedmuons").dressedLeptons(); const Jets& jets = applyProjection(event, "jets").jetsByPt(Cuts::pT > 25*GeV && Cuts::abseta < 2.5); const FinalState& ifs = applyProjection(event, "InvisibleFS"); // Calculate MET FourMomentum met; for (const Particle& p : ifs.particles()) met += p.momentum(); // Count the number of b-tags Jets bjets, lightjets; for (const Jet& jet : jets){ bool b_tagged = jet.bTags(Cuts::pT > 5*GeV).size(); if ( b_tagged && bjets.size() < 2 ) bjets += jet; else lightjets += jet; } bool single_electron = (electrons.size() == 1) && (muons.empty()); bool single_muon = (muons.size() == 1) && (electrons.empty()); DressedLepton* lepton = nullptr; if (single_electron) lepton = &electrons[0]; else if (single_muon) lepton = &muons[0]; if(!single_electron && !single_muon) vetoEvent; if (jets.size() < 4 || bjets.size() < 2) vetoEvent; FourMomentum pbjet1; // Momentum of bjet1 FourMomentum pbjet2; // Momentum of bjet2 if ( deltaR(bjets[0], *lepton) <= deltaR(bjets[1], *lepton) ) { pbjet1 = bjets[0].momentum(); pbjet2 = bjets[1].momentum(); } else { pbjet1 = bjets[1].momentum(); pbjet2 = bjets[0].momentum(); } - double bestWmass = 1000.0*TeV; double mWPDG = 80.399*GeV; int Wj1index = -1, Wj2index = -1; for (unsigned int i = 0; i < (lightjets.size() - 1); ++i) { for (unsigned int j = i + 1; j < lightjets.size(); ++j) { double wmass = (lightjets[i].momentum() + lightjets[j].momentum()).mass(); if (fabs(wmass - mWPDG) < fabs(bestWmass - mWPDG)) { bestWmass = wmass; Wj1index = i; Wj2index = j; } } } // Compute hadronic W boson FourMomentum pWhadron = lightjets[Wj1index].momentum() + lightjets[Wj2index].momentum(); double pz = _computeneutrinoz(lepton->momentum(), met); FourMomentum ppseudoneutrino( sqrt(sqr(met.px()) + sqr(met.py()) + sqr(pz)), met.px(), met.py(), pz); // Compute leptonic, hadronic, combined pseudo-top FourMomentum ppseudotoplepton = lepton->momentum() + ppseudoneutrino + pbjet1; FourMomentum ppseudotophadron = pbjet2 + pWhadron; FourMomentum pttbar = ppseudotoplepton + ppseudotophadron; Vector3 z_versor(0,0,1); Vector3 vpseudotophadron = ppseudotophadron.vector3(); Vector3 vpseudotoplepton = ppseudotoplepton.vector3(); // Observables double ystar = 0.5 * deltaRap(ppseudotophadron, ppseudotoplepton); double chi_ttbar = exp(2 * fabs(ystar)); double deltaPhi_ttbar = deltaPhi(ppseudotoplepton,ppseudotophadron); double HT_ttbar = ppseudotophadron.pt() + ppseudotoplepton.pt(); double Yboost = 0.5 * fabs(ppseudotophadron.rapidity() + ppseudotoplepton.rapidity()); double R_Wt = pWhadron.pt() / ppseudotophadron.pt(); double absPout = fabs(vpseudotophadron.dot((vpseudotoplepton.cross(z_versor))/(vpseudotoplepton.cross(z_versor).mod()))); // absolute cross sections _h["ptpseudotophadron"]->fill( ppseudotophadron.pt(), weight); //pT of pseudo top hadron _h["ptttbar"]->fill( pttbar.pt(), weight); //fill pT of ttbar in combined channel _h["absrappseudotophadron"]->fill(ppseudotophadron.absrap(), weight); _h["absrapttbar"]->fill( pttbar.absrap(), weight); _h["massttbar"]->fill( pttbar.mass(), weight); _h["absPout"]->fill( absPout, weight); _h["chittbar"]->fill( chi_ttbar, weight); _h["dPhittbar"]->fill( deltaPhi_ttbar, weight); _h["HTttbar"]->fill( HT_ttbar, weight); _h["Yboost"]->fill( Yboost, weight); _h["RWt"]->fill( R_Wt, weight); // normalised cross sections _h["ptpseudotophadron_norm"]->fill( ppseudotophadron.pt(), weight); //pT of pseudo top hadron _h["ptttbar_norm"]->fill( pttbar.pt(), weight); //fill pT of ttbar in combined channel _h["absrappseudotophadron_norm"]->fill(ppseudotophadron.absrap(), weight); _h["absrapttbar_norm"]->fill( pttbar.absrap(), weight); _h["massttbar_norm"]->fill( pttbar.mass(), weight); _h["absPout_norm"]->fill( absPout, weight); _h["chittbar_norm"]->fill( chi_ttbar, weight); _h["dPhittbar_norm"]->fill( deltaPhi_ttbar, weight); _h["HTttbar_norm"]->fill( HT_ttbar, weight); _h["Yboost_norm"]->fill( Yboost, weight); _h["RWt_norm"]->fill( R_Wt, weight); } + void finalize() { // Normalize to cross-section const double sf = crossSection() / sumOfWeights(); for (auto& k_h : _h) { scale(k_h.second, sf); if (k_h.first.find("_norm") != string::npos) normalize(k_h.second); } } private: // Compute z component of neutrino momentum given lepton and met double _computeneutrinoz(const FourMomentum& lepton, FourMomentum& met) const { double m_W = 80.399; // in GeV, given in the paper double k = (( sqr( m_W ) - sqr( lepton.mass() ) ) / 2 ) + (lepton.px() * met.px() + lepton.py() * met.py()); double a = sqr ( lepton.E() )- sqr ( lepton.pz() ); double b = -2*k*lepton.pz(); double c = sqr( lepton.E() ) * sqr( met.pT() ) - sqr( k ); double discriminant = sqr(b) - 4 * a * c; double quad[2] = { (- b - sqrt(discriminant)) / (2 * a), (- b + sqrt(discriminant)) / (2 * a) }; //two possible quadratic solns double pzneutrino; if (discriminant < 0) { // if the discriminant is negative: pzneutrino = - b / (2 * a); } else { // if the discriminant is positive, take the soln with smallest absolute value pzneutrino = (fabs(quad[0]) < fabs(quad[1])) ? quad[0] : quad[1]; } return pzneutrino; } /// @todo Replace with central version double _mT(const FourMomentum &l, FourMomentum &nu) const { return sqrt( 2 * l.pT() * nu.pT() * (1 - cos(deltaPhi(l, nu))) ); } /// @name Objects that are used by the event selection decisions map _h; }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(ATLAS_2015_I1404878); } diff --git a/analyses/pluginCMS/CMS_2018_I1680318.info b/analyses/pluginCMS/CMS_2018_I1680318.info --- a/analyses/pluginCMS/CMS_2018_I1680318.info +++ b/analyses/pluginCMS/CMS_2018_I1680318.info @@ -1,48 +1,48 @@ Name: CMS_2018_I1680318 Year: 2018 Summary: Charged particle distributions in different final states at 13~TeV Experiment: CMS collaboration Collider: LHC InspireID: 1680318 Status: VALIDATED Authors: - - Juan Manuel Grados Luyando - - Pieters Maxim - References: + - Juan Manuel Grados Luyando + - Pieters Maxim +References: - arXiv:1806.11245 - CMS-FSQ-16-011 - Eur.Phys.J. C78 (2018) no.9, 697 RunInfo: 'Inelastic events at 13~TeV centre of mass energy. Tracks in $|\eta|<2.4$ and with $\pT > 0.5~GeV$' #NumEvents: 10000000 NeedCrossSection: no Beams: [p+, p+] Energies: [13000] Description: 'Charged particle distributions in different final states at $\sqrt{s} = 13$~TeV by the CMS experiment. Pseudorapidity, multiplicity and transverse momentum distributions of all charged particles. Also the $\pT$ leading charged particle spectrum and its integration as function of $\pT$. The distributions are presented for inelastic, non-single-diffractive and single-diffractive event selections. Please note, that the MC predictions are not scaled to the datapoints, in contrast to Figure 6 in the publication.' BibKey: Sirunyan:2018zdc BibTeX: '@article{Sirunyan:2018zdc, author = "Sirunyan, Albert M. and others", title = "{Measurement of charged particle spectra in minimum-bias events from proton–proton collisions at $\sqrt{s}=13\,\text {TeV} $}", collaboration = "CMS", journal = "Eur. Phys. J.", volume = "C78", year = "2018", number = "9", pages = "697", doi = "10.1140/epjc/s10052-018-6144-y", eprint = "1806.11245", archivePrefix = "arXiv", primaryClass = "hep-ex", reportNumber = "CMS-FSQ-16-011, CERN-EP-2018-187", SLACcitation = "%%CITATION = ARXIV:1806.11245;%%" }' diff --git a/analyses/pluginCMS/CMS_2018_I1682495.cc b/analyses/pluginCMS/CMS_2018_I1682495.cc --- a/analyses/pluginCMS/CMS_2018_I1682495.cc +++ b/analyses/pluginCMS/CMS_2018_I1682495.cc @@ -1,156 +1,155 @@ // -*- C++ -*- #include "Rivet/Analysis.hh" #include "Rivet/Projections/FinalState.hh" #include "Rivet/Projections/VetoedFinalState.hh" #include "Rivet/Projections/FastJets.hh" -#include "fastjet/contrib/SoftDrop.hh" -#include "Rivet/Math/MathUtils.hh" +#include "Rivet/Tools/fjcontrib/SoftDrop.hh" namespace Rivet { class CMS_2018_I1682495 : public Analysis { public: /// @name Constructors etc. //@{ /// Constructor CMS_2018_I1682495() : Analysis("CMS_2018_I1682495"), - _softdrop(fastjet::contrib::SoftDrop(0, 0.1, 0.8) ) // parameters are beta, zcut, R0 + _softdrop(fjcontrib::SoftDrop(0, 0.1, 0.8) ) // parameters are beta, zcut, R0 { } //@} /// @name Analysis methods //@{ /// Book histograms and initialise projections before the run void init() { // define a projection that keeps all the particles up to |eta|=5 const FinalState fs(Cuts::abseta < 5.); // use FastJet, anti-kt(R=0.8) to do the clustering addProjection(FastJets(fs, FastJets::ANTIKT, 0.8), "JetsAK8"); // Histograms for (size_t i = 0; i < N_PT_BINS_dj; ++i ) { _h_ungroomedJetMass_dj[i][0] = bookHisto1D(i+1+0*N_PT_BINS_dj, 1, 1); // Ungroomed mass, absolute _h_sdJetMass_dj[i][0] = bookHisto1D(i+1+1*N_PT_BINS_dj, 1, 1); // Groomed mass, absolute _h_ungroomedJetMass_dj[i][1] = bookHisto1D(i+1+2*N_PT_BINS_dj, 1, 1); // Ungroomed mass, normalized _h_sdJetMass_dj[i][1] = bookHisto1D(i+1+3*N_PT_BINS_dj, 1, 1); // Groomed mass, normalized } } // Find the pT histogram bin index for value pt (in GeV), to hack a 2D histogram equivalent /// @todo Use a YODA axis/finder alg when available size_t findPtBin(double ptJ) { const double ptBins_dj[N_PT_BINS_dj+1] = { 200., 260., 350., 460., 550., 650., 760., 900, 1000, 1100, 1200, 1300, 13000}; for (size_t ibin = 0; ibin < N_PT_BINS_dj; ++ibin) { if (inRange(ptJ, ptBins_dj[ibin], ptBins_dj[ibin+1])) return ibin; } return N_PT_BINS_dj; } /// Perform the per-event analysis void analyze(const Event& event) { const double weight = event.weight(); // Look at events with >= 2 jets auto jetsAK8 = applyProjection(event, "JetsAK8").jetsByPt(Cuts::pT > 200*GeV and Cuts::abseta < 2.4); if (jetsAK8.size() < 2) vetoEvent; // Get the leading two jets const fastjet::PseudoJet& j0 = jetsAK8[0].pseudojet(); const fastjet::PseudoJet& j1 = jetsAK8[1].pseudojet(); // Calculate delta phi and the pt asymmetry double deltaPhi = Rivet::deltaPhi( j0.phi(), j1.phi() ); double ptasym = (j0.pt() - j1.pt()) / (j0.pt() + j1.pt()); if (deltaPhi < 2.0 ) vetoEvent; if (ptasym > 0.3) vetoEvent; // Find the appropriate pT bins and fill the histogram const size_t njetBin0 = findPtBin(j0.pt()/GeV); const size_t njetBin1 = findPtBin(j1.pt()/GeV); if (njetBin0 < N_PT_BINS_dj && njetBin1 < N_PT_BINS_dj) { for ( size_t jbin = 0; jbin < N_CATEGORIES; jbin++ ){ _h_ungroomedJetMass_dj[njetBin0][jbin]->fill(j0.m()/GeV, weight); _h_ungroomedJetMass_dj[njetBin1][jbin]->fill(j1.m()/GeV, weight); } } // Now run the substructure algs... fastjet::PseudoJet sd0 = _softdrop(j0); fastjet::PseudoJet sd1 = _softdrop(j1); // ... and repeat if (njetBin0 < N_PT_BINS_dj && njetBin1 < N_PT_BINS_dj) { for ( size_t jbin = 0; jbin < N_CATEGORIES; jbin++ ){ _h_sdJetMass_dj[njetBin0][jbin]->fill(sd0.m()/GeV, weight); _h_sdJetMass_dj[njetBin1][jbin]->fill(sd1.m()/GeV, weight); } } } /// Normalise histograms etc., after the run void finalize() { // Normalize the normalized cross section histograms to unity, for (size_t i = 0; i < N_PT_BINS_dj; ++i) { normalize(_h_ungroomedJetMass_dj[i][1]); normalize(_h_sdJetMass_dj[i][1]); } // Normalize the absolute cross section histograms to xs * lumi. for (size_t i = 0; i < N_PT_BINS_dj; ++i) { scale(_h_ungroomedJetMass_dj[i][0], crossSection()/picobarn / sumOfWeights()); scale(_h_sdJetMass_dj[i][0], crossSection()/picobarn / sumOfWeights()); } } //@} private: /// @name FastJet grooming tools (configured in constructor init list) //@{ - const fastjet::contrib::SoftDrop _softdrop; + const fjcontrib::SoftDrop _softdrop; //@} /// @name Histograms //@{ enum { PT_200_260_dj=0, PT_260_350_dj, PT_350_460_dj, PT_460_550_dj, PT_550_650_dj, PT_650_760_dj, PT_760_900_dj, PT_900_1000_dj, PT_1000_1100_dj, PT_1100_1200_dj, PT_1200_1300_dj, PT_1300_Inf_dj, N_PT_BINS_dj } BINS_dj; static const int N_CATEGORIES=2; Histo1DPtr _h_ungroomedJet0pt, _h_ungroomedJet1pt; Histo1DPtr _h_sdJet0pt, _h_sdJet1pt; // Here, store both the absolute (index 0) and normalized (index 1) cross sections. Histo1DPtr _h_ungroomedJetMass_dj[N_PT_BINS_dj][2]; Histo1DPtr _h_sdJetMass_dj[N_PT_BINS_dj][2]; //@} }; // The hook for the plugin system DECLARE_RIVET_PLUGIN(CMS_2018_I1682495); } diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -1,339 +1,340 @@ ## Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT([Rivet],[2.6.1],[rivet@projects.hepforge.org],[Rivet]) ## Check and block installation into the src/build dir if test "$prefix" = "$PWD"; then AC_MSG_ERROR([Installation into the build directory is not supported: use a different --prefix argument]) fi ## Force default prefix to have a path value rather than NONE if test "$prefix" = "NONE"; then prefix=/usr/local fi AC_CONFIG_SRCDIR([src/Core/Analysis.cc]) AC_CONFIG_HEADERS([include/Rivet/Config/DummyConfig.hh include/Rivet/Config/RivetConfig.hh include/Rivet/Config/BuildOptions.hh]) AM_INIT_AUTOMAKE([dist-bzip2 -Wall 1.10]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) AC_CONFIG_MACRO_DIR([m4]) AC_SUBST(LT_OBJDIR) ## Package-specific #defines AC_DEFINE_UNQUOTED(RIVET_VERSION, "$PACKAGE_VERSION", "Rivet version string") AC_DEFINE_UNQUOTED(RIVET_NAME, "$PACKAGE_NAME", "Rivet name string") AC_DEFINE_UNQUOTED(RIVET_STRING, "$PACKAGE_STRING", "Rivet name and version string") AC_DEFINE_UNQUOTED(RIVET_TARNAME, "$PACKAGE_TARNAME", "Rivet short name string") AC_DEFINE_UNQUOTED(RIVET_BUGREPORT, "$PACKAGE_BUGREPORT", "Rivet contact email address") ## OS X AC_CEDAR_OSX ## Work out the LCG platform tag AC_LCG_TAG ## Set default compiler flags if test "x$CXXFLAGS" == "x"; then CXXFLAGS="-O2"; fi ## Compiler setup AC_LANG(C++) AC_PROG_CXX AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory]) ## Store and propagate the compiler identity and flags RIVETCXX="$CXX" AC_SUBST(RIVETCXX) RIVETCXXFLAGS="$CXXFLAGS" AC_SUBST(RIVETCXXFLAGS) ## Checks for programs. AC_PROG_INSTALL AC_PROG_LN_S AC_DISABLE_STATIC AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL AC_FUNC_STRERROR_R ## YODA histogramming library AC_CEDAR_LIBRARYANDHEADERS([YODA], , , [AC_MSG_ERROR([YODA is required])]) YODABINPATH=$YODALIBPATH/../bin AC_SUBST(YODABINPATH) AC_PATH_PROG(YODACONFIG, yoda-config, [], [$YODALIBPATH/../bin:$PATH]) YODA_PYTHONPATH="" if test -f "$YODACONFIG"; then AC_MSG_CHECKING([YODA version using yoda-config]) YODA_VERSION=`$YODACONFIG --version` AC_MSG_RESULT([$YODA_VERSION]) YODA_VERSION1=[`echo $YODA_VERSION | cut -d. -f1 | sed -e 's/\([0-9]*\).*/\1/g'`] YODA_VERSION2=[`echo $YODA_VERSION | cut -d. -f2 | sed -e 's/\([0-9]*\).*/\1/g'`] YODA_VERSION3=[`echo $YODA_VERSION | cut -d. -f3 | sed -e 's/\([0-9]*\).*/\1/g'`] let YODA_VERSION_INT=YODA_VERSION1*10000+YODA_VERSION2*100+YODA_VERSION3 if test $YODA_VERSION_INT -lt 10500; then AC_MSG_ERROR([YODA version isn't sufficient: at least version 1.5.0 required]) fi AC_MSG_CHECKING([YODA Python path using yoda-config]) YODA_PYTHONPATH=`$YODACONFIG --pythonpath` AC_MSG_RESULT([$YODA_PYTHONPATH]) fi AC_SUBST(YODA_PYTHONPATH) ## HepMC event record library AC_CEDAR_LIBRARYANDHEADERS([HepMC], , , [AC_MSG_ERROR([HepMC is required])]) oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$HEPMCINCPATH" if test -e "$HEPMCINCPATH/HepMC/HepMCDefs.h"; then AC_LANG_CONFTEST([AC_LANG_SOURCE([#include #include "HepMC/HepMCDefs.h" int main() { std::cout << HEPMC_VERSION << std::endl; return 0; }])]) else AC_LANG_CONFTEST([AC_LANG_SOURCE([#include #include "HepMC/defs.h" int main() { std::cout << VERSION << std::endl; return 0; }])]) fi if test -f conftest.cc; then $CXX $CPPFLAGS conftest.cc -o conftest 2>&1 1>&5 elif test -f conftest.C; then $CXX $CPPFLAGS conftest.C -o conftest 2>&1 1>&5 else $CXX $CPPFLAGS conftest.cpp -o conftest 2>&1 1>&5 fi hepmc_version=`./conftest` if test x$hepmc_version != x; then let hepmc_major=`echo "$hepmc_version" | cut -d. -f1` let hepmc_minor=`echo "$hepmc_version" | cut -d. -f2` fi rm -f conftest conftest.cpp conftest.cc conftest.C HEPMC_VERSION=$hepmc_major$hepmc_minor AC_MSG_NOTICE([HepMC version is $hepmc_version -> $HEPMC_VERSION]) AC_SUBST(HEPMC_VERSION) CPPFLAGS=$oldCPPFLAGS ## FastJet clustering library AC_CEDAR_LIBRARYANDHEADERS([fastjet], , , [AC_MSG_ERROR([FastJet is required])]) AC_PATH_PROG(FJCONFIG, fastjet-config, [], $FASTJETPATH/bin:$PATH) if test -f "$FJCONFIG"; then AC_MSG_CHECKING([FastJet version using fastjet-config]) fjversion=`$FJCONFIG --version` AC_MSG_RESULT([$fjversion]) fjmajor=$(echo $fjversion | cut -f1 -d.) fjminor=$(echo $fjversion | cut -f2 -d.) fjmicro=$(echo $fjversion | cut -f3 -d.) if test "$fjmajor" -lt 3; then AC_MSG_ERROR([FastJet version 3.0.0 or later is required]) fi FASTJETCONFIGLIBADD="$($FJCONFIG --plugins --shared --libs)" else FASTJETCONFIGLIBADD="-L$FASTJETLIBPATH -l$FASTJETLIBNAME" FASTJETCONFIGLIBADD="$FASTJETCONFIGLIBADD -lSISConePlugin -lsiscone -lsiscone_spherical" FASTJETCONFIGLIBADD="$FASTJETCONFIGLIBADD -lCDFConesPlugin -lD0RunIIConePlugin -lNestedDefsPlugin" FASTJETCONFIGLIBADD="$FASTJETCONFIGLIBADD -lTrackJetPlugin -lATLASConePlugin -lCMSIterativeConePlugin" FASTJETCONFIGLIBADD="$FASTJETCONFIGLIBADD -lEECambridgePlugin -lJadePlugin" fi; AC_MSG_NOTICE([FastJet LIBADD = $FASTJETCONFIGLIBADD]) AC_SUBST(FASTJETCONFIGLIBADD) ## Check for FastJet headers that require the --enable-all(cxx)plugins option FASTJET_ERRMSG="Required FastJet plugin headers were not found: did you build FastJet with the --enable-allcxxplugins option?" oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$FASTJETINCPATH" AC_CHECK_HEADER([fastjet/D0RunIIConePlugin.hh], [], [AC_MSG_ERROR([$FASTJET_ERRMSG])]) AC_CHECK_HEADER([fastjet/TrackJetPlugin.hh], [], [AC_MSG_ERROR([$FASTJET_ERRMSG])]) CPPFLAGS=$oldCPPFLAGS ## FastJet contrib # TODO: Check for fjcontrib? Otherwise use a bundled version? ## Temporary (until 2.7 or 3.0) symlink fix-up of bundled fjcontrib Nsubjettiness header path (cd include/Rivet/Tools/ && $LN_S fjcontrib Nsubjettiness) # ## GNU Scientific Library # AC_SEARCH_GSL # AC_CEDAR_HEADERS([gsl], , , [AC_MSG_ERROR([GSL (GNU Scientific Library) is required])]) # oldCPPFLAGS=$CPPFLAGS # CPPFLAGS="$CPPFLAGS -I$GSLINCPATH" # AC_CHECK_HEADER([gsl/gsl_vector.h], [], [AC_MSG_ERROR([GSL vectors not found.])]) # CPPFLAGS=$oldCPPFLAGS ## Disable build/install of standard analyses AC_ARG_ENABLE([analyses], [AC_HELP_STRING(--disable-analyses, [don't try to build or install standard analyses])], [], [enable_analyses=yes]) if test x$enable_analyses != xyes; then AC_MSG_WARN([Not building standard Rivet analyses, by request]) fi AM_CONDITIONAL(ENABLE_ANALYSES, [test x$enable_analyses = xyes]) ## Build LaTeX docs if possible... AC_PATH_PROG(PDFLATEX, pdflatex) AM_CONDITIONAL(WITH_PDFLATEX, [test x$PDFLATEX != x]) ## ... unless told otherwise! AC_ARG_ENABLE([pdfmanual], [AC_HELP_STRING(--enable-pdfmanual, [build and install the manual])], [], [enable_pdfmanual=no]) if test x$enable_pdfmanual = xyes; then AC_MSG_WARN([Building Rivet manual, by request]) fi AM_CONDITIONAL(ENABLE_PDFMANUAL, [test x$enable_pdfmanual = xyes]) ## Build Doxygen documentation if possible AC_ARG_ENABLE([doxygen], [AC_HELP_STRING(--disable-doxygen, [don't try to make Doxygen documentation])], [], [enable_doxygen=yes]) if test x$enable_doxygen = xyes; then AC_PATH_PROG(DOXYGEN, doxygen) fi AM_CONDITIONAL(WITH_DOXYGEN, [test x$DOXYGEN != x]) ## Build asciidoc docs if possible AC_PATH_PROG(ASCIIDOC, asciidoc) AM_CONDITIONAL(WITH_ASCIIDOC, [test x$ASCIIDOC != x]) ## Python extension AC_ARG_ENABLE(pyext, [AC_HELP_STRING(--disable-pyext, [don't build Python module (default=build)])], [], [enable_pyext=yes]) ## Basic Python checks if test x$enable_pyext == xyes; then AX_PYTHON_DEVEL([>= '2.7.3']) AC_SUBST(PYTHON_VERSION) RIVET_PYTHONPATH=`$PYTHON -c "from __future__ import print_function; import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(prefix='$prefix', plat_specific=True));"` AC_SUBST(RIVET_PYTHONPATH) if test -z "$PYTHON"; then AC_MSG_ERROR([Can't build Python extension since python can't be found]) enable_pyext=no fi if test -z "$PYTHON_CPPFLAGS"; then AC_MSG_ERROR([Can't build Python extension since Python.h header file cannot be found]) enable_pyext=no fi fi AM_CONDITIONAL(ENABLE_PYEXT, [test x$enable_pyext == xyes]) dnl dnl setup.py puts its build artifacts into a labelled path dnl this helps the test scripts to find them locally instead of dnl having to install first dnl RIVET_SETUP_PY_PATH=$(${PYTHON} -c 'from __future__ import print_function; import distutils.util as u, sys; vi=sys.version_info; print("lib.%s-%s.%s" % (u.get_platform(),vi.major, vi.minor))') AC_SUBST(RIVET_SETUP_PY_PATH) ## Cython checks if test x$enable_pyext == xyes; then AM_CHECK_CYTHON([0.24.0], [:], [:]) if test x$CYTHON_FOUND = xyes; then AC_MSG_NOTICE([Cython >= 0.24 found: Python extension source can be rebuilt (for developers)]) fi AC_CHECK_FILE([pyext/rivet/core.cpp], [], [if test "x$CYTHON_FOUND" != "xyes"; then AC_MSG_ERROR([Cython is required for --enable-pyext, no pre-built core.cpp was found.]) fi]) cython_compiler=$CXX ## Set extra Python extension build flags (to cope with Cython output code oddities) PYEXT_CXXFLAGS="$CXXFLAGS" AC_CEDAR_CHECKCXXFLAG([-Wno-unused-but-set-variable], [PYEXT_CXXFLAGS="$PYEXT_CXXFLAGS -Wno-unused-but-set-variable"]) AC_CEDAR_CHECKCXXFLAG([-Wno-sign-compare], [PYEXT_CXXFLAGS="$PYEXT_CXXFLAGS -Wno-sign-compare"]) AC_SUBST(PYEXT_CXXFLAGS) AC_MSG_NOTICE([All Python build checks successful: 'rivet' Python extension will be built]) fi AM_CONDITIONAL(WITH_CYTHON, [test x$CYTHON_FOUND = xyes]) ## Set default build flags AM_CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include" #AM_CPPFLAGS="$AM_CPPFLAGS -I\$(top_srcdir)/include/eigen3" #AM_CPPFLAGS="$AM_CPPFLAGS \$(GSL_CPPFLAGS)" dnl AM_CPPFLAGS="$AM_CPPFLAGS \$(BOOST_CPPFLAGS)" AM_CPPFLAGS="$AM_CPPFLAGS -I\$(YODAINCPATH)" AM_CPPFLAGS="$AM_CPPFLAGS -I\$(HEPMCINCPATH)" AM_CPPFLAGS="$AM_CPPFLAGS -I\$(FASTJETINCPATH)" AC_CEDAR_CHECKCXXFLAG([-pedantic], [AM_CXXFLAGS="$AM_CXXFLAGS -pedantic"]) AC_CEDAR_CHECKCXXFLAG([-Wall], [AM_CXXFLAGS="$AM_CXXFLAGS -Wall"]) AC_CEDAR_CHECKCXXFLAG([-Wno-long-long], [AM_CXXFLAGS="$AM_CXXFLAGS -Wno-long-long"]) AC_CEDAR_CHECKCXXFLAG([-Wno-format], [AM_CXXFLAGS="$AM_CXXFLAGS -Wno-format"]) dnl AC_CEDAR_CHECKCXXFLAG([-Wno-unused-variable], [AM_CXXFLAGS="$AM_CXXFLAGS -Wno-unused-variable"]) AC_CEDAR_CHECKCXXFLAG([-Werror=uninitialized], [AM_CXXFLAGS="$AM_CXXFLAGS -Werror=uninitialized"]) AC_CEDAR_CHECKCXXFLAG([-Werror=delete-non-virtual-dtor], [AM_CXXFLAGS="$AM_CXXFLAGS -Werror=delete-non-virtual-dtor"]) ## Add OpenMP-enabling flags if possible AX_OPENMP([AM_CXXFLAGS="$AM_CXXFLAGS $OPENMP_CXXFLAGS"]) ## Optional zlib support for gzip-compressed data streams/files AX_CHECK_ZLIB ## Debug flag (default=-DNDEBUG, enabled=-g) AC_ARG_ENABLE([debug], [AC_HELP_STRING(--enable-debug, [build with debugging symbols @<:@default=no@:>@])], [], [enable_debug=no]) if test x$enable_debug == xyes; then AM_CXXFLAGS="$AM_CXXFLAGS -g" fi ## Extra warnings flag (default=none) AC_ARG_ENABLE([extra-warnings], [AC_HELP_STRING(--enable-extra-warnings, [build with extra compiler warnings (recommended for developers) @<:@default=no@:>@])], [], [enable_extra_warnings=no]) if test x$enable_extra_warnings == xyes; then AC_CEDAR_CHECKCXXFLAG([-Wextra], [AM_CXXFLAGS="$AM_CXXFLAGS -Wextra "]) fi AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_CXXFLAGS) AC_EMPTY_SUBST AC_CONFIG_FILES(Makefile Doxyfile) AC_CONFIG_FILES(include/Makefile include/Rivet/Makefile) AC_CONFIG_FILES(src/Makefile) AC_CONFIG_FILES(src/Core/Makefile src/Core/yamlcpp/Makefile) AC_CONFIG_FILES(src/Tools/Makefile) AC_CONFIG_FILES(src/Tools/fjcontrib/Makefile) AC_CONFIG_FILES(src/Tools/fjcontrib/EnergyCorrelator/Makefile) AC_CONFIG_FILES(src/Tools/fjcontrib/Nsubjettiness/Makefile) +AC_CONFIG_FILES(src/Tools/fjcontrib/RecursiveTools/Makefile) AC_CONFIG_FILES(src/Projections/Makefile) AC_CONFIG_FILES(src/AnalysisTools/Makefile) AC_CONFIG_FILES(analyses/Makefile) AC_CONFIG_FILES(test/Makefile) AC_CONFIG_FILES(pyext/Makefile pyext/rivet/Makefile pyext/setup.py) AC_CONFIG_FILES(data/Makefile data/texmf/Makefile) AC_CONFIG_FILES(doc/Makefile) AC_CONFIG_FILES(doc/rivetversion.sty) AC_CONFIG_FILES(bin/Makefile bin/rivet-config bin/rivet-buildplugin) AC_CONFIG_FILES(rivetenv.sh rivetenv.csh rivet.pc) AC_OUTPUT if test x$enable_pyrivet == xyes; then cat <. +//---------------------------------------------------------------------- + +#ifndef __BOTTOMUPSOFTDROP_HH__ +#define __BOTTOMUPSOFTDROP_HH__ + +#include "fastjet/ClusterSequence.hh" +#include "fastjet/WrappedStructure.hh" +#include "fastjet/tools/Transformer.hh" + +#include +#include + +// TODO +// +// - missing class description +// +// - check what to do when pta=ptb=0 +// for the moment, we recombine both for multiple reasons +// . this avois breakingteh symemtry between pa and pb +// . it would be groomed in later steps anyway +// Note that this is slightly inconsistent with our use of +// > (instead of >=) in the cdt + +//FASTJET_BEGIN_NAMESPACE + +//namespace contrib{ + +namespace Rivet { + namespace fjcontrib { + using namespace fastjet; + + +// fwd declarations +class BottomUpSoftDrop; +class BottomUpSoftDropStructure; +class BottomUpSoftDropRecombiner; +class BottomUpSoftDropPlugin; + +//---------------------------------------------------------------------- +/// \class BottomUpSoftDrop +/// Implementation of the BottomUpSoftDrop transformer +/// +/// Bottom-Up Soft drop grooms a jet by applying a modified +/// recombination scheme, where particles are recombined only if they +/// pass the Soft Drop condition +/// +/// \f[ +/// z < z_{\rm cut} (\theta/R0)^\beta +/// \f] +/// +/// the groomed jet contains the particles remaining after this +/// pair-wise recombination +/// +/// Note: +/// - one can use BottomUpSoftDrop on a full event with the +/// global_grooming(event) method. +/// - if two recombined particles a and b have momentum pta=ptb=0, +/// we recombine both. +/// + + +class BottomUpSoftDrop : public Transformer { +public: + /// minimal constructor, which the jet algorithm to CA, sets the radius + /// to JetDefinition::max_allowable_R (practically equivalent to + /// infinity) and also tries to use a recombiner based on the one in + /// the jet definition of the particular jet being Soft Dropped. + /// + /// \param beta the value for beta + /// \param symmetry_cut the value for symmetry_cut + /// \param R0 the value for R0 + BottomUpSoftDrop(double beta, double symmetry_cut, double R0 = 1.0) + : _jet_def(cambridge_algorithm, JetDefinition::max_allowable_R), + _beta(beta),_symmetry_cut(symmetry_cut), _R0(R0), + _get_recombiner_from_jet(true) {} + + /// alternative constructor which takes a specified jet algorithm + /// + /// \param jet_alg the jet algorithm for the internal clustering (uses R=infty) + /// \param symmetry_cut the value of symmetry_cut + /// \param beta the value for beta + /// \param R0 the value for R0 + BottomUpSoftDrop(const JetAlgorithm jet_alg, double beta, double symmetry_cut, + double R0 = 1.0) + : _jet_def(jet_alg, JetDefinition::max_allowable_R), + _beta(beta), _symmetry_cut(symmetry_cut), _R0(R0), + _get_recombiner_from_jet(true) {} + + + /// alternative ctor in which the full reclustering jet definition can + /// be specified. + /// + /// \param jet_def the jet definition for the internal clustering + /// \param symmetry_cut the value of symmetry_cut + /// \param beta the value for beta + /// \param R0 the value for R0 + BottomUpSoftDrop(const JetDefinition &jet_def, double beta, double symmetry_cut, + double R0 = 1.0) + : _jet_def(jet_def), _beta(beta), _symmetry_cut(symmetry_cut), _R0(R0), + _get_recombiner_from_jet(false) {} + + /// action on a single jet + virtual PseudoJet result(const PseudoJet &jet) const; + + /// global grooming on a full event + /// note: does not support jet areas + virtual std::vector global_grooming(const std::vector & event) const; + + /// description + virtual std::string description() const; + + // the type of the associated structure + typedef BottomUpSoftDropStructure StructureType; + +private: + /// check if the jet has explicit_ghosts (knowing that there is an + /// area support) + bool _check_explicit_ghosts(const PseudoJet &jet) const; + + /// see if there is a common recombiner among the pieces; if there + /// is return true and set jet_def_for_recombiner so that the + /// recombiner can be taken from that JetDefinition. Otherwise, + /// return false. 'assigned' is initially false; when true, each + /// time we meet a new jet definition, we'll check it shares the + /// same recombiner as jet_def_for_recombiner. + bool _check_common_recombiner(const PseudoJet &jet, + JetDefinition &jet_def_for_recombiner, + bool assigned=false) const; + + + JetDefinition _jet_def; ///< the internal jet definition + double _beta; ///< the value of beta + double _symmetry_cut; ///< the value of symmetry_cut + double _R0; ///< the value of R0 + bool _get_recombiner_from_jet; ///< true for minimal constructor, + ///< causes recombiner to be set equal + ///< to that already used in the jet + ///< (if it can be deduced) +}; + +//---------------------------------------------------------------------- +/// The structure associated with a PseudoJet thas has gone through a +/// bottom/up SoftDrop transformer +class BottomUpSoftDropStructure : public WrappedStructure{ +public: + /// default ctor + /// \param result_jet the jet for which we have to keep the structure + BottomUpSoftDropStructure(const PseudoJet & result_jet) + : WrappedStructure(result_jet.structure_shared_ptr()){} + + /// description + virtual std::string description() const{ + return "Bottom/Up Soft Dropped PseudoJet"; + } + + /// return the constituents that have been rejected + std::vector rejected() const{ + return validated_cs()->childless_pseudojets(); + } + + /// return the other jets that may have been found along with the + /// result of the bottom/up Soft Drop + /// The resulting vector is sorted in pt + std::vector extra_jets() const { + return sorted_by_pt((!SelectorNHardest(1))(validated_cs()->inclusive_jets())); + } + + /// return the value of beta that was used for this specific Soft Drop. + double beta() const {return _beta;} + + /// return the value of symmetry_cut that was used for this specific Soft Drop. + double symmetry_cut() const {return _symmetry_cut;} + + /// return the value of R0 that was used for this specific Soft Drop. + double R0() const {return _R0;} + +protected: + friend class BottomUpSoftDrop; ///< to allow setting the internal information + +private: + double _beta, _symmetry_cut, _R0; +}; + +//---------------------------------------------------------------------- +/// Class for Soft Drop recombination +/// recombines the objects that are not vetoed by Bottom-Up SoftDrop +/// +/// This recombiner only recombines, using the provided 'recombiner', +/// objects (i and j) that pass the following SoftDrop criterion: +/// +/// min(pti, ptj) > zcut (pti+ptj) (theta_ij/R0)^beta +/// +/// If the criterion fail, the hardest of i and j is kept and the +/// softest is rejected. +/// +/// Note that this in not meant for standalone use [in particular +/// because it could lead to memory issues due to the rejected indices +/// stored internally]. +/// +/// This class is a direct adaptation of PruningRecombiner in Fastjet tools +class BottomUpSoftDropRecombiner : public JetDefinition::Recombiner { +public: + /// ctor + /// \param symmetry_cut value of cut on symmetry measure + /// \param beta avalue of beta parameter + /// \param recomb pointer to a recombiner to use to cluster pairs + BottomUpSoftDropRecombiner(double beta, double symmetry_cut, double R0, + const JetDefinition::Recombiner *recombiner) + : _beta(beta), _symmetry_cut(symmetry_cut), _R0sqr(R0*R0), + _recombiner(recombiner) {} + + /// perform a recombination taking into account the Soft Drop + /// conditions + virtual void recombine(const PseudoJet &pa, + const PseudoJet &pb, + PseudoJet &pab) const; + + /// returns the description of the recombiner + virtual std::string description() const { + std::ostringstream oss; + oss << "SoftDrop recombiner with symmetry_cut = " << _symmetry_cut + << ", beta = " << _beta + << ", and underlying recombiner = " << _recombiner->description(); + return oss.str(); + } + + /// return the history indices that have been soft dropped away + const std::vector & rejected() const{ return _rejected;} + + /// clears the list of rejected indices + /// + /// If one decides to use this recombiner standalone, one has to + /// call this after each clustering in order for the rejected() vector + /// to remain sensible and not grow to infinite size. + void clear_rejected(){ _rejected.clear();} + +private: + double _beta; ///< beta parameter + double _symmetry_cut; ///< value of symmetry_cut + double _R0sqr; ///< normalisation of the angular distance + const JetDefinition::Recombiner *_recombiner; ///< the underlying recombiner to use + mutable std::vector _rejected; ///< list of rejected history indices +}; + +//---------------------------------------------------------------------- +/// \class BottomUpSoftDropPlugin +/// Class for a bottom/up Soft Drop algorithm, based on the Pruner plugin +/// +/// This is an internal plugin that clusters the particles using the +/// BottomUpRecombiner. +/// +/// See BottomUpRecombiner for a description of what bottom-up +/// SoftDrop does. +/// +/// Note that this is an internal class used by the BottomUpSoftDrop +/// transformer and it is not meant to be used as a standalone +/// clustering tool. +class BottomUpSoftDropPlugin : public JetDefinition::Plugin { +public: + /// ctor + /// \param jet_def the jet definition to be used for the + /// internal clustering + /// \param symmetry_cut value of cut on symmetry measure + /// \param beta value of beta parameter + BottomUpSoftDropPlugin(const JetDefinition &jet_def, double beta, double symmetry_cut, + double R0 = 1.0) + : _jet_def(jet_def), _beta(beta), _symmetry_cut(symmetry_cut), _R0(R0) {} + + /// the actual clustering work for the plugin + virtual void run_clustering(ClusterSequence &input_cs) const; + + /// description of the plugin + virtual std::string description() const; + + /// returns the radius + virtual double R() const {return _jet_def.R();} + +private: + JetDefinition _jet_def; ///< the internal jet definition + double _beta; ///< beta parameter + double _symmetry_cut; ///< value of symmetry_cut + double _R0; ///< normalisation of the angular distance +}; + + } } + + //FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh +#endif // __BOTTOMUPSOFTDROP_HH__ diff --git a/include/Rivet/Tools/fjcontrib/IteratedSoftDrop.hh b/include/Rivet/Tools/fjcontrib/IteratedSoftDrop.hh new file mode 100644 --- /dev/null +++ b/include/Rivet/Tools/fjcontrib/IteratedSoftDrop.hh @@ -0,0 +1,223 @@ +// $Id: IteratedSoftDrop.hh 1086 2017-10-11 08:07:26Z gsoyez $ +// +// Copyright (c) 2017-, Jesse Thaler, Kevin Zhou, Gavin P. Salam, +// Gregory Soyez +// +// based on arXiv:1704.06266 by Christopher Frye, Andrew J. Larkoski, +// Jesse Thaler, Kevin Zhou +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#ifndef __FASTJET_CONTRIB_ITERATEDSOFTDROP_HH__ +#define __FASTJET_CONTRIB_ITERATEDSOFTDROP_HH__ + +#include "RecursiveSoftDrop.hh" + +// FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + //namespace contrib{ + +namespace Rivet { + namespace fjcontrib { + using namespace fastjet; + +//------------------------------------------------------------------------ +/// \class IteratedSoftDropInfo +/// helper class that carries all the relevant information one can get +/// from running IteratedSoftDrop on a given jet (or vector of jets) +/// +class IteratedSoftDropInfo{ +public: + /// ctor without initialisation + IteratedSoftDropInfo(){} + + /// ctor with initialisation + IteratedSoftDropInfo(std::vector > zg_thetag_in) + : _all_zg_thetag(zg_thetag_in){} + + /// get the raw list of (angular-ordered) zg and thetag + const std::vector > &all_zg_thetag() const{ + return _all_zg_thetag; + } + + /// overloadd the () operator so that it also returns the full (zg,thetag) list + const std::vector > & operator()() const{ + return _all_zg_thetag; + } + + /// overloadd the [] operator to access the ith (zg,thetag) pair + const std::pair & operator[](unsigned int i) const{ + return _all_zg_thetag[i]; + } + + /// returns the angularity with angular exponent alpha and z + /// exponent kappa calculated on the zg's and thetag's found by + /// iterated SoftDrop + /// + /// returns 0 if no substructure was found + double angularity(double alpha, double kappa=1.0) const; + + /// returns the Iterated SoftDrop multiplicity + unsigned int multiplicity() const{ return _all_zg_thetag.size(); } + + /// returns the Iterated SoftDrop multiplicity (i.e. size) + unsigned int size() const{ return _all_zg_thetag.size(); } + +protected: + /// the real information: angular-ordered list of all the zg and + /// thetag that passed the (recursive) SD conddition + std::vector > _all_zg_thetag; +}; + + + +//------------------------------------------------------------------------ +/// \class IteratedSoftDrop +/// implementation of the IteratedSoftDrop procedure +/// +/// This class provides an implementation of the IteratedSoftDrop +/// procedure. It is based on the SoftDrop procedure can be used to +/// define a 'groomed symmetry factor', equal to the symmetry factor +/// of the two subjets of the resulting groomed jet. The Iterated +/// Soft Drop procedure recursively performs Soft Drop on the harder +/// branch of the groomed jet, halting at a specified angular cut +/// \f$\theta_{\rm cut}\f$, returning a list of symmetry factors which +/// can be used to define observables. +/// +/// Like SoftDrop, the cut applied recursively is +/// \f[ +/// z > z_{\rm cut} (\theta/R_0)^\beta +/// \f] +/// with z the asymmetry measure and \f$\theta\f$ the geometrical +/// distance between the two subjets. The procedure halts when +/// \f$\theta < \theta_{\rm cut}\f$. +/// +/// By default, this implementation returs the IteratedSoftDropInfo +/// obtained after running IteratedSoftDrop on a jet +/// +/// Although all these quantities can be obtained from the returned +/// IteratedSoftDropInfo, we also provide helpers to directly get the +/// multiplicity, some (generalised) angularity, or the raw list of +/// (angular-ordered) (zg, thetag) pairs that passed the (recursive) +/// SoftDrop condition. +/// +/// We stress the fact that IteratedSoftDrop is _not_ a Transformer +/// since it returns an IteratedSoftDropInfo and not a modified +/// PseudoJet +/// +class IteratedSoftDrop : public FunctionOfPseudoJet { +public: + /// Constructor. Takes in the standard Soft Drop parameters, an angular cut \f$\theta_{\rm cut}\f$, + /// and a choice of angular and symmetry measure. + /// + /// \param beta the Soft Drop beta parameter + /// \param symmetry_cut the Soft Drop symmetry cut + /// \param angular_cut the angular cutoff to halt Iterated Soft Drop + /// \param R0 the angular distance normalization + /// \param subtractor an optional pointer to a pileup subtractor (ignored if zero) + IteratedSoftDrop(double beta, double symmetry_cut, double angular_cut, double R0 = 1.0, + const FunctionOfPseudoJet * subtractor = 0); + + /// Full constructor, which takes the following parameters: + /// + /// \param beta the value of the beta parameter + /// \param symmetry_cut the value of the cut on the symmetry measure + /// \param symmetry_measure the choice of measure to use to estimate the symmetry + /// \param angular_cut the angular cutoff to halt Iterated Soft Drop + /// \param R0 the angular distance normalisation [1 by default] + /// \param mu_cut the maximal allowed value of mass drop variable mu = m_heavy/m_parent + /// \param recursion_choice the strategy used to decide which subjet to recurse into + /// \param subtractor an optional pointer to a pileup subtractor (ignored if zero) + /// + /// Notes: + /// + /// - by default, SoftDrop will recluster the jet with the + /// Cambridge/Aachen algorithm if it is not already the case. This + /// behaviour can be changed using the "set_reclustering" method + /// defined below + /// + IteratedSoftDrop(double beta, + double symmetry_cut, + RecursiveSoftDrop::SymmetryMeasure symmetry_measure, + double angular_cut, + double R0 = 1.0, + double mu_cut = std::numeric_limits::infinity(), + RecursiveSoftDrop::RecursionChoice recursion_choice = RecursiveSoftDrop::larger_pt, + const FunctionOfPseudoJet * subtractor = 0); + + /// default destructor + virtual ~IteratedSoftDrop(){} + + //---------------------------------------------------------------------- + // behaviour tweaks (inherited from RecursiveSoftDrop and RecursiveSymmetryCutBase) + + /// switch to using a dynamical R0 (see RecursiveSoftDrop) + void set_dynamical_R0(bool value=true) { _rsd.set_dynamical_R0(value); } + bool use_dynamical_R0() const { return _rsd.use_dynamical_R0(); } + + /// an alternative way to set the subtractor (see RecursiveSymmetryCutBase) + void set_subtractor(const FunctionOfPseudoJet * subtractor_) {_rsd.set_subtractor(subtractor_);} + const FunctionOfPseudoJet * subtractor() const {return _rsd.subtractor();} + + /// returns the IteratedSoftDropInfo associated with the jet "jet" + IteratedSoftDropInfo result(const PseudoJet& jet) const; + + /// Tells the tagger whether to assume that the input jet has + /// already been subtracted (relevant only with a non-null + /// subtractor, see RecursiveSymmetryCutBase) + void set_input_jet_is_subtracted(bool is_subtracted) { _rsd.set_input_jet_is_subtracted(is_subtracted);} + bool input_jet_is_subtracted() const {return _rsd.input_jet_is_subtracted();} + + /// configure the reclustering prior to the recursive de-clustering + void set_reclustering(bool do_reclustering=true, const Recluster *recluster=0){ + _rsd.set_reclustering(do_reclustering, recluster); + } + + //---------------------------------------------------------------------- + // actions on jets + /// returns vector of ISD symmetry factors and splitting angles + std::vector > all_zg_thetag(const PseudoJet& jet) const{ + return result(jet).all_zg_thetag(); + } + + /// returns the angularity with angular exponent alpha and z + /// exponent kappa calculated on the zg's and thetag's found by + /// iterated SoftDrop + /// + /// returns 0 if no substructure was found + double angularity(const PseudoJet& jet, double alpha, double kappa=1.0) const{ + return result(jet).angularity(alpha, kappa); + } + + /// returns the Iterated SoftDrop multiplicity + double multiplicity(const PseudoJet& jet) const{ return result(jet).multiplicity(); } + + /// description of the class + std::string description() const; + +protected: + RecursiveSoftDrop _rsd; +}; + + + +} } // namespace contrib + + //FASTJET_END_NAMESPACE + +#endif // __FASTJET_CONTRIB_ITERATEDSOFTDROP_HH__ diff --git a/include/Rivet/Tools/fjcontrib/ModifiedMassDropTagger.hh b/include/Rivet/Tools/fjcontrib/ModifiedMassDropTagger.hh new file mode 100644 --- /dev/null +++ b/include/Rivet/Tools/fjcontrib/ModifiedMassDropTagger.hh @@ -0,0 +1,132 @@ +// $Id: ModifiedMassDropTagger.hh 1032 2017-07-31 14:20:03Z gsoyez $ +// +// Copyright (c) 2014-, Gavin P. Salam +// based on arXiv:1307.007 by Mrinal Dasgupta, Simone Marzani and Gavin P. Salam +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#ifndef __FASTJET_CONTRIB_MODIFIEDMASSDROPTAGGER_HH__ +#define __FASTJET_CONTRIB_MODIFIEDMASSDROPTAGGER_HH__ + +#include "RecursiveSymmetryCutBase.hh" + +//FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + //namespace contrib{ + +namespace Rivet { + namespace fjcontrib { + using namespace fastjet; + +//------------------------------------------------------------------------ +/// \class ModifiedMassDropTagger +/// An implementation of the modified Mass-Drop Tagger from arXiv:1307.0007. +/// +class ModifiedMassDropTagger : public RecursiveSymmetryCutBase { +public: + + /// Simplified constructor, which takes just a symmetry cut (applied + /// on the scalar_z variable) and an optional subtractor. + /// + /// In this incarnation the ModifiedMassDropTagger is a bit of a + /// misnomer, because there is no mass-drop condition + /// applied. Recursion into the jet structure chooses the prong with + /// largest pt. (Results from arXiv:1307.0007 were based on the + /// largest mt, but this only makes a difference for values of the + /// symmetry_cut close to 1/2). + /// + /// If the (optional) pileup subtractor can be supplied, then see + /// also the documentation for the set_input_jet_is_subtracted() member + /// function. + /// + /// NB: The configuration of MMDT provided by this constructor is + /// probably the most robust for use with subtraction. + ModifiedMassDropTagger(double symmetry_cut, + const FunctionOfPseudoJet * subtractor = 0 + ) : + RecursiveSymmetryCutBase(scalar_z, // the default SymmetryMeasure + std::numeric_limits::infinity(), // the default is no mass drop + larger_pt, // the default RecursionChoice + subtractor), + _symmetry_cut(symmetry_cut) + {} + + /// Full constructor, which takes the following parameters: + /// + /// \param symmetry_cut the value of the cut on the symmetry measure + /// \param symmetry_measure the choice of measure to use to estimate the symmetry + /// \param mu_cut the maximal allowed value of mass drop variable mu = m_heavy/m_parent + /// \param recursion_choice the strategy used to decide which subjet to recurse into + /// \param subtractor an optional pointer to a pileup subtractor (ignored if zero) + /// + /// To obtain the mMDT as discussed in arXiv:1307.0007, use an + /// symmetry_measure that's one of the following + /// + /// - RecursiveSymmetryCutBase::y (for a cut on y) + /// - RecursiveSymmetryCutBase::scalar_z (for a cut on z) + /// + /// and use the default recursion choice of + /// RecursiveSymmetryCutBase::larger_pt (larger_mt will give something + /// very similar, while larger_m will give the behaviour of the + /// original, but now deprecated MassDropTagger) + /// + /// Notes: + /// + /// - By default the ModifiedMassDropTagger will relcuster the jets + /// with the C/A algorithm (if needed). + /// + /// - the mu_cut parameter is mostly irrelevant when it's taken + /// larger than about 1/2: the tagger is then one that cuts + /// essentially on the (a)symmetry of the jet's momentum + /// sharing. The default value of infinity turns off its use + /// entirely + ModifiedMassDropTagger(double symmetry_cut, + SymmetryMeasure symmetry_measure, + double mu_cut = std::numeric_limits::infinity(), + RecursionChoice recursion_choice = larger_pt, + const FunctionOfPseudoJet * subtractor = 0 + ) : + RecursiveSymmetryCutBase(symmetry_measure, mu_cut, recursion_choice, subtractor), + _symmetry_cut(symmetry_cut) + {} + + /// default destructor + virtual ~ModifiedMassDropTagger(){} + + //---------------------------------------------------------------------- + // access to class info + double symmetry_cut() const { return _symmetry_cut; } + +protected: + + /// The symmetry cut function for MMDT returns just a constant, since the cut value + /// has no dependence on the subjet kinematics + virtual double symmetry_cut_fn(const PseudoJet & /* p1 */, + const PseudoJet & /* p2 */, + void *extra_parameters = 0 + ) const {return _symmetry_cut;} + virtual std::string symmetry_cut_description() const; + + double _symmetry_cut; +}; + +} } // namespace contrib + + //FASTJET_END_NAMESPACE + +#endif // __FASTJET_CONTRIB_MODIFIEDMASSDROPTAGGER_HH__ diff --git a/include/Rivet/Tools/fjcontrib/Recluster.hh b/include/Rivet/Tools/fjcontrib/Recluster.hh new file mode 100644 --- /dev/null +++ b/include/Rivet/Tools/fjcontrib/Recluster.hh @@ -0,0 +1,187 @@ +#ifndef __FASTJET_CONTRIB_TOOLS_RECLUSTER_HH__ +#define __FASTJET_CONTRIB_TOOLS_RECLUSTER_HH__ + +// $Id: Recluster.hh 723 2014-07-30 09:11:01Z gsoyez $ +// +// Copyright (c) 2014-, Matteo Cacciari, Gavin P. Salam and Gregory Soyez +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include +#include // to derive the ReclusterStructure from CompositeJetStructure +#include // to derive Recluster from Transformer +#include +#include + +//FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + //namespace contrib{ + +namespace Rivet { + namespace fjcontrib { + using namespace fastjet; + +//---------------------------------------------------------------------- +/// \class Recluster +/// Class that helps reclustering a jet with a new jet definition +/// +/// The result of the reclustering is returned as a single PseudoJet +/// with a CompositeJet structure. The pieces of that PseudoJet will +/// be the individual subjets +/// +/// When constructed from a JetDefinition, that definition will be +/// used to obtain the subjets. When constructed from a JetAlgorithm +/// and parameters (0 parameters for e+e-, just R or R and an extra +/// parameter for others) the recombination scheme will be taken as +/// the same one used to initially cluster the original jet. +/// +/// The result of this transformer depends on its usage. There are two +/// typical use-cases: either we recluster one fat jet into subjets, +/// OR, we recluster the jet with a different jet alg. When Recluster +/// is created from a full jet definition. The last parameter of the +/// constructors below dicatate that behaviour: if "single" is true +/// (the default), a single jet, issued from a regular clustering is +/// returned (if there are more than one, the hardest is taken); +/// otherwise (single==false), the result will be a composite jet with +/// each subjet as pieces +/// +/// Open points for discussion: +/// +/// - do we add an option to force area support? [could be useful +/// e.g. for the filter with a subtractor where area support is +/// mandatory] +/// +class Recluster : public Transformer { +public: + /// define a recluster that decomposes a jet into subjets using a + /// generic JetDefinition + /// + /// \param subjet_def the jet definition applied to obtain the subjets + /// \param single when true, cluster the jet in a single jet (the + /// hardest one) with an associated ClusterSequence, + /// otherwise return a composite jet with subjets + /// as pieces. + Recluster(const JetDefinition & subjet_def, bool single=true) + : _subjet_def(subjet_def), _use_full_def(true), _single(single) {} + + /// define a recluster that decomposes a jet into subjets using a + /// JetAlgorithm and its parameters + /// + /// \param subjet_alg the jet algorithm applied to obtain the subjets + /// \param subjet_radius the jet radius if required + /// \param subjet_extra optional extra parameters for the jet algorithm (only when needed) + /// \param single when true, cluster the jet in a single jet (the + /// hardest one) with an associated ClusterSequence, + /// otherwise return a composite jet with subjets + /// as pieces. + /// + /// Typically, for e+e- algoriothm you should use the third version + /// below with no parameters, for "standard" pp algorithms, just the + /// clustering radius has to be specified and for genkt-type of + /// algorithms, both the radius and the extra parameter have to be + /// specified. + Recluster(JetAlgorithm subjet_alg, double subjet_radius, double subjet_extra, + bool single=true) + : _subjet_alg(subjet_alg), _use_full_def(false), + _subjet_radius(subjet_radius), _has_subjet_radius(true), + _subjet_extra(subjet_extra), _has_subjet_extra(true), _single(single) {} + Recluster(JetAlgorithm subjet_alg, double subjet_radius, bool single=true) + : _subjet_alg(subjet_alg), _use_full_def(false), + _subjet_radius(subjet_radius), _has_subjet_radius(true), + _has_subjet_extra(false), _single(single) {} + Recluster(JetAlgorithm subjet_alg, bool single=true) + : _subjet_alg(subjet_alg), _use_full_def(false), + _has_subjet_radius(false), _has_subjet_extra(false), _single(single) {} + + /// default dtor + virtual ~Recluster(){}; + + //---------------------------------------------------------------------- + // standard Transformer behaviour inherited from the base class + // (i.e. result(), description() and structural info) + + /// runs the reclustering and sets kept and rejected to be the jets of interest + /// (with non-zero rho, they will have been subtracted). + /// + /// \param jet the jet that gets reclustered + /// \return the reclustered jet + virtual PseudoJet result(const PseudoJet & jet) const; + + /// class description + virtual std::string description() const; + + // the type of the associated structure + typedef CompositeJetStructure StructureType; + +private: + /// set the reclustered elements in the simple case of C/A+C/A + void _recluster_cafilt(const std::vector & all_pieces, + std::vector & subjets, + double Rfilt) const; + + /// set the reclustered elements in the generic re-clustering case + void _recluster_generic(const PseudoJet & jet, + std::vector & subjets, + const JetDefinition & subjet_def, + bool do_areas) const; + + // a series of checks + //-------------------------------------------------------------------- + /// get the pieces down to the fundamental pieces + bool _get_all_pieces(const PseudoJet &jet, std::vector &all_pieces) const; + + /// get the common recombiner to all pieces (NULL if none) + const JetDefinition::Recombiner* _get_common_recombiner(const std::vector &all_pieces) const; + + /// construct the proper jet definition ensuring that the recombiner + /// is taken from the underlying pieces (an error is thrown if the + /// pieces do no share a common recombiner) + void _build_jet_def_with_recombiner(const std::vector &all_pieces, + JetDefinition &subjet_def) const; + + /// check if one can apply the simplified trick for C/A subjets + bool _check_ca(const std::vector &all_pieces, + const JetDefinition &subjet_def) const; + + /// check if the jet (or all its pieces) have explicit ghosts + /// (assuming the jet has area support + /// + /// Note that if the jet has an associated cluster sequence that is no + /// longer valid, an error will be thrown + bool _check_explicit_ghosts(const std::vector &all_pieces) const; + + JetDefinition _subjet_def; ///< the jet definition to use to extract the subjets + JetAlgorithm _subjet_alg; ///< the jet algorithm to be used + bool _use_full_def; ///< true when the full JetDefinition is supplied to the ctor + double _subjet_radius; ///< the jet radius (only if needed for the jet alg) + bool _has_subjet_radius; ///< the subjet radius has been specified + double _subjet_extra; ///< the jet alg extra param (only if needed) + bool _has_subjet_extra; ///< the extra param has been specified + + bool _single; ///< (true) return a single jet with a + ///< regular clustering or (false) a + ///< composite jet with subjets as pieces + + static LimitedWarning _explicit_ghost_warning; +}; + +} } // namespace contrib + + //FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh + +#endif // __FASTJET_CONTRIB_TOOLS_RECLUSTER_HH__ diff --git a/include/Rivet/Tools/fjcontrib/RecursiveSoftDrop.hh b/include/Rivet/Tools/fjcontrib/RecursiveSoftDrop.hh new file mode 100644 --- /dev/null +++ b/include/Rivet/Tools/fjcontrib/RecursiveSoftDrop.hh @@ -0,0 +1,212 @@ +// $Id: RecursiveSoftDrop.hh 1082 2017-10-10 12:00:13Z gsoyez $ +// +// Copyright (c) 2014-, Gavin P. Salam, Gregory Soyez, Jesse Thaler, +// Kevin Zhou, Frederic Dreyer +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#ifndef __RECURSIVESOFTDROP_HH__ +#define __RECURSIVESOFTDROP_HH__ + +#include "Recluster.hh" +#include "SoftDrop.hh" +#include "fastjet/WrappedStructure.hh" + +#include +#include +#include + +//FASTJET_BEGIN_NAMESPACE + +//namespace contrib{ + +namespace Rivet { + namespace fjcontrib { + using namespace fastjet; + + +//------------------------------------------------------------------------ +/// \class RecursiveSoftDrop +/// An implementation of the RecursiveSoftDrop. +/// +/// Recursive Soft Drop will recursively groom a jet, removing +/// particles that fail the criterion +/// \f[ +/// z > z_{\rm cut} (\theta/R0)^\beta +/// \f] +/// until n subjets have been found. +/// +/// Several variants are supported: +/// - set_fixed_depth_mode() switches to fixed depth on all branches +/// of the clustering tree +/// - set_dynamical_R0() switches to dynamical R0 implementation of +/// RSD +/// - set_hardest_branch_only() switches to following only the +/// hardest branch (e.g. for Iterated Soft Drop) +/// - set_min_deltaR_square(val) sets a minimum angle considered for +/// substructure (e.g. for Iterated Soft Drop) +/// +/// Notes: +/// +/// - Even though the calls to "set_tagging_mode()" or +/// "set_grooming_mode(false)" are allowed, they should not be used +/// with n=-1, and the default grooming_mode has to remain +/// untouched (except for beta<0 and finite n). +/// +//---------------------------------------------------------------------- +class RecursiveSoftDrop : public SoftDrop { +public: + /// Simplified constructor. This takes the value of the "beta" + /// parameter and the symmetry cut (applied by default on the + /// scalar_z variable, as for the mMDT). It also takes an optional + /// subtractor. + /// + /// n is the number of times we require the SoftDrop condition to be + /// satisfied. n=-1 means infinity, i.e. we recurse into the jet + /// until individual constituents + /// + /// If the (optional) pileup subtractor can be supplied, then see + /// also the documentation for the set_input_jet_is_subtracted() member + /// function. + /// + /// \param beta the value of the beta parameter + /// \param symmetry_cut the value of the cut on the symmetry measure + /// \param n the requested number of iterations + /// \param R0 the angular distance normalisation [1 by default] + RecursiveSoftDrop(double beta, + double symmetry_cut, + int n = -1, + double R0 = 1, + const FunctionOfPseudoJet * subtractor = 0) : + SoftDrop(beta, symmetry_cut, R0, subtractor), _n(n) { set_defaults(); } + + /// Full constructor, which takes the following parameters: + /// + /// \param beta the value of the beta parameter + /// \param symmetry_cut the value of the cut on the symmetry measure + /// \param symmetry_measure the choice of measure to use to estimate the symmetry + /// \param n the requested number of iterations + /// \param R0 the angular distance normalisation [1 by default] + /// \param mu_cut the maximal allowed value of mass drop variable mu = m_heavy/m_parent + /// \param recursion_choice the strategy used to decide which subjet to recurse into + /// \param subtractor an optional pointer to a pileup subtractor (ignored if zero) + RecursiveSoftDrop(double beta, + double symmetry_cut, + SymmetryMeasure symmetry_measure, + int n = -1, + double R0 = 1.0, + double mu_cut = std::numeric_limits::infinity(), + RecursionChoice recursion_choice = larger_pt, + const FunctionOfPseudoJet * subtractor = 0) : + SoftDrop(beta, symmetry_cut, symmetry_measure, R0, mu_cut, recursion_choice, subtractor), + _n(n) { set_defaults(); } + + /// default destructor + virtual ~RecursiveSoftDrop(){} + + //---------------------------------------------------------------------- + // access to class info + int n() const { return _n; } + + //---------------------------------------------------------------------- + // on top of the tweaks that we inherit from SoftDrop (via + // RecursiveSymmetryBase): + // - set_verbose_structure() + // - set_subtractor() + // - set_input_jet_is_subtracted() + // we provide several other knobs, given below + + /// initialise all the flags below to their default value + void set_defaults(); + + /// switch to using the "same depth" variant where instead of + /// recursing from large to small angles and requiring n SD + /// conditions to be met (our default), we recurse simultaneously in + /// all the branches found during the previous iteration, up to a + /// maximum depth of n. + /// default: false + void set_fixed_depth_mode(bool value=true) { _fixed_depth = value; } + bool fixed_depth_mode() const { return _fixed_depth; } + + /// switch to using a dynamical R0 (used for the normalisation of + /// the symmetry measure) set by the last deltaR at which some + /// substructure was found. + /// default: false + void set_dynamical_R0(bool value=true) { _dynamical_R0 = value; } + bool use_dynamical_R0() const { return _dynamical_R0; } + + /// when finding some substructure, only follow the hardest branch + /// for the recursion + /// default: false (i.e. recurse in both branches) + void set_hardest_branch_only(bool value=true) { _hardest_branch_only = value; } + bool use_hardest_branch_only() const { return _hardest_branch_only; } + + /// set the minimum angle (squared) that we should consider for + /// substructure + /// default: -1.0 (i.e. no minimum) + void set_min_deltaR_squared(double value=-1.0) { _min_dR2 = value; } + double min_deltaR_squared() const { return _min_dR2; } + + /// description of the tool + virtual std::string description() const; + + //---------------------------------------------------------------------- + /// action on a single jet with RecursiveSoftDrop. + /// + /// uses "result_fixed_tags" by default (i.e. recurse from R0 to + /// smaller angles until n SD conditions have been met), or + /// "result_fixed_depth" where each of the previous SD branches are + /// recirsed into down to a depth of n. + virtual PseudoJet result(const PseudoJet &jet) const; + + /// this routine applies the Soft Drop criterion recursively on the + /// CA tree until we find n subjets (or until it converges), and + /// adds them together into a groomed PseudoJet + PseudoJet result_fixed_tags(const PseudoJet &jet) const; + + /// this routine applies the Soft Drop criterion recursively on the + /// CA tree, recursing into all the branches found during the previous iteration + /// until n layers have been found (or until it converges) + PseudoJet result_fixed_depth(const PseudoJet &jet) const; + +protected: + /// return false if we reached desired layer of grooming _n + bool continue_grooming(int current_n) const { + return ((_n < 0) or (current_n < _n)); + } + +private: + int _n; ///< the value of n + + // behaviour tweaks + bool _fixed_depth; ///< look in parallel into each all branches until depth n + bool _dynamical_R0; ///< when true, use the last deltaR with substructure as D0 + bool _hardest_branch_only; ///< recurse only in the hardest branch + /// when substructure is found + double _min_dR2; ///< the min allowed angle to search for substructure +}; + +// helper to get the (linear) list of prongs inside a jet resulting +// from RecursiveSoftDrop. This would avoid having amnually to go +// through the successive pairwise compositeness +std::vector recursive_soft_drop_prongs(const PseudoJet & rsd_jet); + +} } + + //FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh +#endif // __RECURSIVESOFTDROP_HH__ diff --git a/include/Rivet/Tools/fjcontrib/RecursiveSymmetryCutBase.hh b/include/Rivet/Tools/fjcontrib/RecursiveSymmetryCutBase.hh new file mode 100644 --- /dev/null +++ b/include/Rivet/Tools/fjcontrib/RecursiveSymmetryCutBase.hh @@ -0,0 +1,392 @@ +// $Id: RecursiveSymmetryCutBase.hh 1074 2017-09-18 15:15:20Z gsoyez $ +// +// Copyright (c) 2014-, Gavin P. Salam, Gregory Soyez, Jesse Thaler +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#ifndef __FASTJET_CONTRIB_RECURSIVESYMMETRYCUTBASE_HH__ +#define __FASTJET_CONTRIB_RECURSIVESYMMETRYCUTBASE_HH__ + +#include +#include +#include +#include "fastjet/tools/Transformer.hh" +#include "fastjet/WrappedStructure.hh" +#include "fastjet/CompositeJetStructure.hh" + +#include "fastjet/config.h" + +// we'll use the native FJ class for reculstering if available +#if FASTJET_VERSION_NUMBER >= 30100 +#include "fastjet/tools/Recluster.hh" +#else +#include "Recluster.hh" +#endif + +/** \mainpage RecursiveTools contrib + + The RecursiveTools contrib provides a set of tools for + recursive investigation jet substructure. Currently it includes: + - fastjet::contrib::ModifiedMassDropTagger + - fastjet::contrib::SoftDrop + - fastjet::contrib::RecursiveSymmetryCutBase (from which the above two classes derive) + - fastjet::contrib::IteratedSoftDropSymmetryFactors (defines ISD procedure) + - fastjet::contrib::IteratedSoftDropMultiplicity (defines a useful observable using ISD) + - example*.cc provides usage examples + */ + + +//FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + //namespace contrib{ + +namespace Rivet { + namespace fjcontrib { + using namespace fastjet; + + +//------------------------------------------------------------------------ +/// \class RecursiveSymmetryCutBase +/// A base class for all the tools that de-cluster a jet until a +/// sufficiently symmetric configuration if found. +/// +/// Derived classes (so far, ModifiedMassDropTagger and SoftDrop) have to +/// implement the symmetry cut and its description +/// +/// Note that by default, the jet will be reculstered with +/// Cambridge/Aachen before applying the de-clustering procedure. This +/// behaviour can be changed using set_clustering (see below). +/// +/// By default, this class behaves as a tagger, i.e. returns an empty +/// PseudoJet if no substructure is found. While the derived +/// ModifiedMassDropTagger is a tagger, the derived SoftDrop is a groomer +/// (i.e. it returns a non-zero jet even if no substructure is found). +/// +/// This class provides support for +/// - an optional mass-drop cut (see ctor) +/// - options to select which symmetry measure should be used (see ctor) +/// - options to select how the recursion proceeds (see ctor) +/// - options for reclustering the jet before running the de-clustering +/// (see set_reclustering) +/// - an optional subtractor (see ctor and other methods below) +class RecursiveSymmetryCutBase : public Transformer { +public: + // ctors and dtors + //---------------------------------------------------------------------- + + /// an enum of the different (a)symmetry measures that can be used + enum SymmetryMeasure{scalar_z, ///< \f$ \min(p_{ti}, p_{tj})/(p_{ti} + p_{tj}) \f$ + vector_z, ///< \f$ \min(p_{ti}, p_{tj})/p_{t(i+j)} \f$ + y, ///< \f$ \min(p_{ti}^2,p_{tj}^2) \Delta R_{ij}^2 / m_{ij}^2 \f$ + theta_E, ///< \f$ \min(E_i,E_j)/(E_i+E_j) \f$ with 3d angle (ee collisions) + cos_theta_E ///< \f$ \min(E_i,E_j)/(E_i+E_j) \f$ with + /// \f$ \sqrt{2[1-cos(theta)]}\f$ for angles (ee collisions) + }; + + /// an enum for the options of how to choose which of two subjets to recurse into + enum RecursionChoice{larger_pt, ///< choose the subjet with larger \f$ p_t \f$ + larger_mt, ///< choose the subjet with larger \f$ m_t \equiv (m^2+p_t^2)^{\frac12}] \f$ + larger_m, ///< choose the subjet with larger mass (deprecated) + larger_E ///< choose the subjet with larger energy (meant for ee collisions) + }; + + /// Full constructor, which takes the following parameters: + /// + /// \param symmetry_measure the choice of measure to use to estimate the symmetry + /// \param mu_cut the maximal allowed value of mass drop variable mu = m_heavy/m_parent + /// \param recursion_choice the strategy used to decide which subjet to recurse into + /// \param subtractor an optional pointer to a pileup subtractor (ignored if zero) + /// + /// If the (optional) pileup subtractor is supplied, then, by + /// default, the input jet is assumed unsubtracted and the + /// RecursiveSymmetryCutBase returns a subtracted 4-vector. [see + /// also the set_input_jet_is_subtracted() member function]. + /// + RecursiveSymmetryCutBase(SymmetryMeasure symmetry_measure = scalar_z, + double mu_cut = std::numeric_limits::infinity(), + RecursionChoice recursion_choice = larger_pt, + const FunctionOfPseudoJet * subtractor = 0 + ) : + _symmetry_measure(symmetry_measure), + _mu_cut(mu_cut), + _recursion_choice(recursion_choice), + _subtractor(subtractor), _input_jet_is_subtracted(false), + _do_reclustering(true), _recluster(0), + _grooming_mode(false), + _verbose_structure(false) // by default, don't story verbose information + {} + + /// default destructor + virtual ~RecursiveSymmetryCutBase(){} + + // access to class info + //---------------------------------------------------------------------- + SymmetryMeasure symmetry_measure() const { return _symmetry_measure; } + double mu_cut() const { return _mu_cut; } + RecursionChoice recursion_choice() const { return _recursion_choice; } + + // internal subtraction configuration + //---------------------------------------------------------------------- + + /// This tells the tagger whether to assume that the input jet has + /// already been subtracted. This is relevant only if a non-null + /// subtractor pointer has been supplied, and the default assymption + /// is that the input jet is passed unsubtracted. + /// + /// Note: given that subtractors usually change the momentum of the + /// main jet, but not that of the subjets, subjets will continue to + /// have subtraction applied to them. + void set_input_jet_is_subtracted(bool is_subtracted) {_input_jet_is_subtracted = is_subtracted;} + + /// returns a bool to indicate if the input jet is assumed already subtracted + bool input_jet_is_subtracted() const {return _input_jet_is_subtracted;} + + /// an alternative way to set the subtractor + /// + /// Note that when a subtractor is provided, the result of the + /// RecursiveSymmetryCutBase will be a subtracted jet. + void set_subtractor(const FunctionOfPseudoJet * subtractor_) {_subtractor = subtractor_;} + + /// returns a pointer to the subtractor + const FunctionOfPseudoJet * subtractor() const {return _subtractor;} + + // reclustering behaviour + //---------------------------------------------------------------------- + + /// configure the reclustering prior to the recursive de-clustering + /// \param do_reclustering recluster the jet or not? + /// \param recluster how to recluster the jet + /// (only if do_recluster is true; + /// Cambridge/Aachen used if NULL) + /// + /// Note that the ModifiedMassDropTagger and SoftDrop are designed + /// to work with a Cambridge/Aachen clustering. Use any other option + /// at your own risk! + void set_reclustering(bool do_reclustering=true, const Recluster *recluster=0){ + _do_reclustering = do_reclustering; + _recluster = recluster; + } + + // what to do when no substructure is found + //---------------------------------------------------------------------- + /// specify the behaviour adopted when no substructure is found + /// - in tagging mode, an empty PseudoJet will be returned + /// - in grooming mode, a single particle is returned + /// for clarity, we provide both function although they are redundant + void set_grooming_mode(bool enable=true){ _grooming_mode = enable;} + void set_tagging_mode(bool enable=true){ _grooming_mode = !enable;} + + + /// Allows access to verbose information about recursive declustering, + /// in particular values of symmetry, delta_R, and mu of dropped branches + void set_verbose_structure(bool enable=true) { _verbose_structure = enable; } + bool has_verbose_structure() const { return _verbose_structure; } + + + // inherited from the Transformer base + //---------------------------------------------------------------------- + + /// the function that carries out the tagging; if a subtractor is + /// being used, then this function assumes that input jet is + /// unsubtracted (unless set_input_jet_is_subtracted(true) has been + /// explicitly called before) and the result of the MMDT will be a + /// subtracted jet. + virtual PseudoJet result(const PseudoJet & j) const; + + /// description of the tool + virtual std::string description() const; + + /// returns the gepometrical distance between the two particles + /// depending on the symmetry measure used + double squared_geometric_distance(const PseudoJet &j1, + const PseudoJet &j2) const; + + + class StructureType; + + /// for testing + static bool _verbose; + +protected: + // the methods below have to be defined by deerived classes + //---------------------------------------------------------------------- + /// the cut on the symmetry measure (typically z) that one need to + /// apply for a given pair of subjets p1 and p2 + virtual double symmetry_cut_fn(const PseudoJet & /* p1 */, + const PseudoJet & /* p2 */, + void *extra_parameters = 0) const = 0; + /// the associated dwescription + virtual std::string symmetry_cut_description() const = 0; + + //---------------------------------------------------------------------- + /// this defines status codes when checking for substructure + enum RecursionStatus{ + recursion_success=0, //< found some substructure + recursion_dropped, //< dropped softest prong; recursion continues + recursion_no_parents, //< down to constituents; bottom of recursion + recursion_issue //< something went wrong; recursion stops + }; + + //---------------------------------------------------------------------- + /// the method below is the one actually performing one step of the + /// recursion. + /// + /// It returns a status code (defined above) + /// + /// In case of success, all the information is filled + /// In case of "no parents", piee1 is the same subjet + /// In case of trouble, piece2 will be a 0 PJ and piece1 is the PJ we + /// should return (either 0 itself if the issue was critical, or + /// non-wero in case of a minor issue just causing the recursion to + /// stop) + /// + /// The extra_parameter argument allows one to pass extra agruments + /// to the symmetry condition + RecursionStatus recurse_one_step(const PseudoJet & subjet, + PseudoJet &piece1, PseudoJet &piece2, + double &sym, double &mu2, + void *extra_parameters = 0) const; + + //---------------------------------------------------------------------- + /// helper for handling the reclustering + PseudoJet _recluster_if_needed(const PseudoJet &jet) const; + + //---------------------------------------------------------------------- + // helpers for selecting between ee and pp cases + bool is_ee() const{ + return ((_symmetry_measure==theta_E) || (_symmetry_measure==cos_theta_E)); + } + +private: + SymmetryMeasure _symmetry_measure; + double _mu_cut; + RecursionChoice _recursion_choice; + const FunctionOfPseudoJet * _subtractor; + bool _input_jet_is_subtracted; + + bool _do_reclustering; ///< start with a reclustering + const Recluster *_recluster; ///< how to recluster the jet + + bool _grooming_mode; ///< grooming or tagging mode + + static LimitedWarning _negative_mass_warning; + static LimitedWarning _mu2_gt1_warning; + //static LimitedWarning _nonca_warning; + static LimitedWarning _explicit_ghost_warning; + + // additional verbose structure information + bool _verbose_structure; + + /// decide what to return when no substructure has been found + PseudoJet _result_no_substructure(const PseudoJet &last_parent) const; +}; + + + +//---------------------------------------------------------------------- +/// class to hold the structure of a jet tagged by RecursiveSymmetryCutBase. +class RecursiveSymmetryCutBase::StructureType : public WrappedStructure { +public: + StructureType(const PseudoJet & j) : + WrappedStructure(j.structure_shared_ptr()), _delta_R(-1.0), _symmetry(-1.0), _mu(-1.0), + _is_composite(false), _has_verbose(false) // by default, do not store verbose structure + {} + + /// construct a structure with + /// - basic info inherited from the reference jet "j" + /// - a given deltaR for substructure + /// - a given symmetry for substructure + /// - a given mu parameter for substructure + /// If j is a "copmposite jet", it means that it has further + /// substructure to potentially recurse into + StructureType(const PseudoJet & j, double delta_R_in, double symmetry_in, double mu_in=-1.0) : + WrappedStructure(j.structure_shared_ptr()), _delta_R(delta_R_in), _symmetry(symmetry_in), _mu(mu_in), + _is_composite(dynamic_cast(j.structure_ptr()) != NULL), + _has_verbose(false) // by default, do not store verbose structure + {} + + // information about kept branch + double delta_R() const {return _delta_R;} + double thetag() const {return _delta_R;} // alternative name + double symmetry() const {return _symmetry;} + double zg() const {return _symmetry;} // alternative name + double mu() const {return _mu;} + + // additional verbose information about dropped branches + bool has_verbose() const { return _has_verbose;} + void set_verbose(bool value) { _has_verbose = value;} + + /// returns true if the current jet has some substructure (i.e. has + /// been tagged by the resursion) or not + /// + /// Note that this should include deltaR==0 (e.g. a perfectly + /// collinear branching with SoftDrop) + bool has_substructure() const { return _delta_R>=0; } + + /// number of dropped branches + int dropped_count(bool global=true) const; + + /// delta_R of dropped branches + /// when "global" is set, recurse into possile further substructure + std::vector dropped_delta_R(bool global=true) const; + void set_dropped_delta_R(const std::vector &v) { _dropped_delta_R = v; } + + /// symmetry values of dropped branches + std::vector dropped_symmetry(bool global=true) const; + void set_dropped_symmetry(const std::vector &v) { _dropped_symmetry = v; } + + /// mass drop values of dropped branches + std::vector dropped_mu(bool global=true) const; + void set_dropped_mu(const std::vector &v) { _dropped_mu = v; } + + /// maximum symmetry value dropped + double max_dropped_symmetry(bool global=true) const; + + /// (global) list of groomed away elements as zg and thetag + /// sorted from largest to smallest anlge + std::vector > sorted_zg_and_thetag() const; + +private: + double _delta_R, _symmetry, _mu; + friend class RecursiveSymmetryCutBase; + + bool _is_composite; + + // additional verbose information + bool _has_verbose; + // information about dropped values + std::vector _dropped_delta_R; + std::vector _dropped_symmetry; + std::vector _dropped_mu; + + bool check_verbose(const std::string &what) const{ + if (!_has_verbose){ + throw Error("RecursiveSymmetryCutBase::StructureType: Verbose structure must be turned on to get "+what+"."); + return false; + } + return true; + } + + +}; + +} } // namespace contrib + + //FASTJET_END_NAMESPACE + +#endif // __FASTJET_CONTRIB_RECURSIVESYMMETRYCUTBASE_HH__ diff --git a/include/Rivet/Tools/fjcontrib/SoftDrop.hh b/include/Rivet/Tools/fjcontrib/SoftDrop.hh new file mode 100644 --- /dev/null +++ b/include/Rivet/Tools/fjcontrib/SoftDrop.hh @@ -0,0 +1,152 @@ +// $Id: SoftDrop.hh 1034 2017-08-01 10:03:53Z gsoyez $ +// +// Copyright (c) 2014-, Gregory Soyez, Jesse Thaler +// based on arXiv:1402.2657 by Andrew J. Larkoski, Simone Marzani, +// Gregory Soyez, Jesse Thaler +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#ifndef __FASTJET_CONTRIB_SOFTDROP_HH__ +#define __FASTJET_CONTRIB_SOFTDROP_HH__ + +#include "RecursiveSymmetryCutBase.hh" + +//FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + +namespace Rivet { + namespace fjcontrib { + using namespace fastjet; + + +//------------------------------------------------------------------------ +/// \class SoftDrop +/// An implementation of the SoftDrop from arXiv:1402.2657. +/// +/// For the basic functionalities, we refer the reader to the +/// documentation of the RecursiveSymmetryCutBase from which SoftDrop +/// inherits. Here, we mostly put the emphasis on things specific to +/// SoftDrop: +/// +/// - the cut applied recursively is +/// \f[ +/// z > z_{\rm cut} (\theta/R0)^\beta +/// \f] +/// with z the asymmetry measure and \f$\theta\f$ the geometrical +/// distance between the two subjets. R0 is set to 1 by default. +/// +/// - by default, we work in "grooming mode" i.s. if no substructure +/// is found, we return a jet made of a single parton. Note that +/// this behaviour differs from the mMDT (and can be a source of +/// differences when running SoftDrop with beta=0.) +/// +class SoftDrop : public RecursiveSymmetryCutBase { +public: + /// Simplified constructor. This takes the value of the "beta" + /// parameter and the symmetry cut (applied by default on the + /// scalar_z variable, as for the mMDT). It also takes an optional + /// subtractor. + /// + /// If the (optional) pileup subtractor can be supplied, then see + /// also the documentation for the set_input_jet_is_subtracted() member + /// function. + /// + /// \param beta the value of the beta parameter + /// \param symmetry_cut the value of the cut on the symmetry measure + /// \param R0 the angular distance normalisation [1 by default] + SoftDrop(double beta, + double symmetry_cut, + double R0 = 1, + const FunctionOfPseudoJet * subtractor = 0) : + RecursiveSymmetryCutBase(scalar_z, // the default SymmetryMeasure + std::numeric_limits::infinity(), // default is no mass drop + larger_pt, // the default RecursionChoice + subtractor), + _beta(beta), _symmetry_cut(symmetry_cut), _R0sqr(R0*R0) { + // change the default: use grooming mode + set_grooming_mode(); + } + + /// Full constructor, which takes the following parameters: + /// + /// \param beta the value of the beta parameter + /// \param symmetry_cut the value of the cut on the symmetry measure + /// \param symmetry_measure the choice of measure to use to estimate the symmetry + /// \param R0 the angular distance normalisation [1 by default] + /// \param mu_cut the maximal allowed value of mass drop variable mu = m_heavy/m_parent + /// \param recursion_choice the strategy used to decide which subjet to recurse into + /// \param subtractor an optional pointer to a pileup subtractor (ignored if zero) + /// + /// The default values provided for this constructor are suited to + /// obtain the SoftDrop as discussed in arXiv:1402.2657: + /// - no mass drop is requested + /// - recursion follows the branch with the largest pt + /// The symmetry measure has to be specified (scalar_z is the recommended value) + /// + /// Notes: + /// + /// - by default, SoftDrop will recluster the jet with the + /// Cambridge/Aachen algorithm if it is not already the case. This + /// behaviour can be changed using the "set_reclustering" method + /// defined below + /// + SoftDrop(double beta, + double symmetry_cut, + SymmetryMeasure symmetry_measure, + double R0 = 1.0, + double mu_cut = std::numeric_limits::infinity(), + RecursionChoice recursion_choice = larger_pt, + const FunctionOfPseudoJet * subtractor = 0) : + RecursiveSymmetryCutBase(symmetry_measure, mu_cut, recursion_choice, subtractor), + _beta(beta), _symmetry_cut(symmetry_cut), _R0sqr(R0*R0) + { + // change the default: use grooming mode + set_grooming_mode(); + } + + /// default destructor + virtual ~SoftDrop(){} + + //---------------------------------------------------------------------- + // access to class info + double beta() const { return _beta; } + double symmetry_cut() const { return _symmetry_cut; } + double R0() const { return sqrt(_R0sqr); } + +protected: + + // Unlike MMDT, the SoftDrop symmetry_cut_fn depends on the subjet kinematics + // since the symmetry condition depends on the DeltaR between subjets. + virtual double symmetry_cut_fn(const PseudoJet & p1, + const PseudoJet & p2, + void * optional_R0sqr_ptr = 0) const; + virtual std::string symmetry_cut_description() const; + + //private: + double _beta; ///< the power of the angular distance to be used + ///< in the symmetry condition + double _symmetry_cut; ///< the value of zcut (the prefactor in the asymmetry cut) + double _R0sqr; ///< normalisation of the angular distance + ///< (typically set to the jet radius, 1 by default) +}; + +} } // namespace contrib + + //FASTJET_END_NAMESPACE + +#endif // __FASTJET_CONTRIB_SOFTDROP_HH__ diff --git a/src/Makefile.am b/src/Makefile.am --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,18 +1,16 @@ SUBDIRS = Core Tools Projections AnalysisTools lib_LTLIBRARIES = libRivet.la libRivet_la_SOURCES = libRivet_la_LDFLAGS = -export-dynamic -avoid-version -L$(YODALIBPATH) -L$(HEPMCLIBPATH) libRivet_la_LIBADD = \ Core/libRivetCore.la \ Projections/libRivetProjections.la \ Tools/libRivetTools.la \ -Tools/fjcontrib/EnergyCorrelator/libRivetEnergyCorrelator.la \ -Tools/fjcontrib/Nsubjettiness/libRivetNsubjettiness.la \ AnalysisTools/libRivetAnalysisTools.la \ -lYODA -lHepMC -ldl -lm \ $(FASTJETCONFIGLIBADD) \ $(GSL_LDFLAGS) diff --git a/src/Tools/Makefile.am b/src/Tools/Makefile.am --- a/src/Tools/Makefile.am +++ b/src/Tools/Makefile.am @@ -1,21 +1,26 @@ SUBDIRS = fjcontrib noinst_LTLIBRARIES = libRivetTools.la libRivetTools_la_SOURCES = \ BinnedHistogram.cc \ Cuts.cc \ JetUtils.cc \ Random.cc \ Logging.cc \ ParticleUtils.cc \ ParticleName.cc \ RivetYODA.cc \ RivetMT2.cc \ RivetPaths.cc \ Utils.cc \ binreloc.c dist_noinst_HEADERS = binreloc.h lester_mt2_bisect.hh libRivetTools_la_CPPFLAGS = $(AM_CPPFLAGS) -DENABLE_BINRELOC -DDEFAULTDATADIR=\"$(datadir)\" -DDEFAULTLIBDIR=\"$(libdir)\" + +libRivetTools_la_LIBADD = \ + fjcontrib/EnergyCorrelator/libRivetEnergyCorrelator.la \ + fjcontrib/Nsubjettiness/libRivetNsubjettiness.la \ + fjcontrib/RecursiveTools/libRivetRecursiveTools.la diff --git a/src/Tools/fjcontrib/EnergyCorrelator/Makefile.am b/src/Tools/fjcontrib/EnergyCorrelator/Makefile.am new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/EnergyCorrelator/Makefile.am @@ -0,0 +1,3 @@ +noinst_LTLIBRARIES = libRivetEnergyCorrelator.la +libRivetEnergyCorrelator_la_SOURCES = EnergyCorrelator.cc +libRivetEnergyCorrelator_la_CPPFLAGS = $(AM_CPPFLAGS) -I${top_srcdir}/include/Rivet/Tools diff --git a/src/Tools/fjcontrib/Makefile.am b/src/Tools/fjcontrib/Makefile.am --- a/src/Tools/fjcontrib/Makefile.am +++ b/src/Tools/fjcontrib/Makefile.am @@ -1,1 +1,1 @@ -SUBDIRS = EnergyCorrelator Nsubjettiness +SUBDIRS = EnergyCorrelator Nsubjettiness RecursiveTools diff --git a/src/Tools/fjcontrib/RecursiveTools/AUTHORS b/src/Tools/fjcontrib/RecursiveTools/AUTHORS new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/AUTHORS @@ -0,0 +1,31 @@ +The RecursiveTools FastJet contrib is developed and maintained by: + + Gavin P. Salam + Gregory Soyez + Jesse Thaler + Kevin Zhou + Frederic Dreyer + +The physics is based on: + + [ModifiedMassDropTagger] + Towards an understanding of jet substructure. + Mrinal Dasgupta, Alessandro Fregoso, Simone Marzani, and Gavin P. Salam. + JHEP 1309:029 (2013), arXiv:1307.0007. + + [SoftDrop] + Soft Drop. + Andrew J. Larkoski, Simone Marzani, Gregory Soyez, and Jesse Thaler. + JHEP 1405:146 (2014), arXiv:1402.2657 + + [IteratedSoftDrop] + Casimir Meets Poisson: Improved Quark/Gluon Discrimination with Counting Observables. + Christopher Frye, Andrew J. Larkoski, Jesse Thaler, Kevin Zhou. + JHEP 1709:083 (2017), arXiv:1704.06266 + + [RecursiveSoftDrop] + [BottomUpSoftDrop] + Recursive Soft Drop. + Frederic A. Dreyer, Lina Necib, Gregory Soyez, and Jesse Thaler + arXiv:1804.03657 + \ No newline at end of file diff --git a/src/Tools/fjcontrib/RecursiveTools/BottomUpSoftDrop.cc b/src/Tools/fjcontrib/RecursiveTools/BottomUpSoftDrop.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/BottomUpSoftDrop.cc @@ -0,0 +1,329 @@ +// $Id: BottomUpSoftDrop.cc 1064 2017-09-08 09:19:57Z gsoyez $ +// +// Copyright (c) 2017-, Gavin P. Salam, Gregory Soyez, Jesse Thaler, +// Kevin Zhou, Frederic Dreyer +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include "BottomUpSoftDrop.hh" +#include +#include +#include +#include +#include "fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh" +#include "fastjet/Selector.hh" +#include "fastjet/config.h" + + +using namespace std; + + +//FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + +//namespace contrib{ + +namespace Rivet{ + namespace fjcontrib{ + + + +//---------------------------------------------------------------------- +// BottomUpSoftDrop class +//---------------------------------------------------------------------- + +// action on a single jet +PseudoJet BottomUpSoftDrop::result(const PseudoJet &jet) const{ + // soft drop can only be applied to jets that have constituents + if (!jet.has_constituents()){ + throw Error("BottomUpSoftDrop: trying to apply the Soft Drop transformer to a jet that has no constituents"); + } + + // if the jet has area support and there are explicit ghosts, we can + // transfer that support to the internal re-clustering + // + // Note that this is just meant to maintain the information since + // all the jes will have a 0 area + bool do_areas = jet.has_area() && _check_explicit_ghosts(jet); + + // build the soft drop plugin + BottomUpSoftDropPlugin * softdrop_plugin; + + // for some constructors, we get the recombiner from the + // input jet -- some acrobatics are needed + if (_get_recombiner_from_jet) { + JetDefinition jet_def = _jet_def; + + // if all the pieces have a shared recombiner, we'll use that + // one. Otherwise, use the one from _jet_def as a fallback. + JetDefinition jet_def_for_recombiner; + if (_check_common_recombiner(jet, jet_def_for_recombiner)){ +#if FASTJET_VERSION_NUMBER >= 30100 + // Note that this is better than the option directly passing the + // recombiner (for cases where th ejet def own its recombiner) + // but it's only available in FJ>=3.1 + jet_def.set_recombiner(jet_def_for_recombiner); +#else + jet_def.set_recombiner(jet_def_for_recombiner.recombiner()); +#endif + } + softdrop_plugin = new BottomUpSoftDropPlugin(jet_def, _beta, _symmetry_cut, _R0); + } else { + softdrop_plugin = new BottomUpSoftDropPlugin(_jet_def, _beta, _symmetry_cut, _R0); + } + + // now recluster the constituents of the jet with that plugin + JetDefinition internal_jet_def(softdrop_plugin); + // flag the plugin for automatic deletion _before_ we make + // copies (so that as long as the copies are also present + // it doesn't get deleted). + internal_jet_def.delete_plugin_when_unused(); + + ClusterSequence * cs; + if (do_areas){ + vector particles, ghosts; + SelectorIsPureGhost().sift(jet.constituents(), ghosts, particles); + // determine the ghost area from the 1st ghost (if none, any value + // will do, as the area will be 0 and subtraction will have + // no effect!) + double ghost_area = (ghosts.size()) ? ghosts[0].area() : 0.01; + cs = new ClusterSequenceActiveAreaExplicitGhosts(particles, internal_jet_def, + ghosts, ghost_area); + } else { + cs = new ClusterSequence(jet.constituents(), internal_jet_def); + } + + PseudoJet result_local = SelectorNHardest(1)(cs->inclusive_jets())[0]; + BottomUpSoftDropStructure * s = new BottomUpSoftDropStructure(result_local); + s->_beta = _beta; + s->_symmetry_cut = _symmetry_cut; + s->_R0 = _R0; + result_local.set_structure_shared_ptr(SharedPtr(s)); + + // make sure things remain persistent -- i.e. tell the jet definition + // and the cluster sequence that it is their responsibility to clean + // up memory once the "result" reaches the end of its life in the user's + // code. (The CS deletes itself when the result goes out of scope and + // that also triggers deletion of the plugin) + cs->delete_self_when_unused(); + + return result_local; +} + +// global grooming on a full event +// note: does not support jet areas +vector BottomUpSoftDrop::global_grooming(const vector & event) const { + // start by reclustering the event into one very large jet + ClusterSequence cs(event, _jet_def); + std::vector global_jet = SelectorNHardest(1)(cs.inclusive_jets()); + // if the event is empty, do nothing + if (global_jet.size() == 0) return vector(); + + // apply the groomer to the large jet + PseudoJet result = this->result(global_jet[0]); + return result.constituents(); +} + +// check if the jet has explicit_ghosts (knowing that there is an +// area support) +bool BottomUpSoftDrop::_check_explicit_ghosts(const PseudoJet &jet) const { + // if the jet comes from a Clustering check explicit ghosts in that + // clustering + if (jet.has_associated_cluster_sequence()) + return jet.validated_csab()->has_explicit_ghosts(); + + // if the jet has pieces, recurse in the pieces + if (jet.has_pieces()){ + vector pieces = jet.pieces(); + for (unsigned int i=0;ijet_def().has_same_recombiner(jet_def_for_recombiner); + + // otherwise, assign it. + jet_def_for_recombiner = jet.validated_cs()->jet_def(); + assigned = true; + return true; + } + + // if the jet has pieces, recurse in the pieces + if (jet.has_pieces()){ + vector pieces = jet.pieces(); + if (pieces.size() == 0) return false; + for (unsigned int i=0;i kept(internal_hist.size(), true); + const vector &sd_rej = softdrop_recombiner.rejected(); + for (unsigned int i=0;i internal2input(internal_hist.size()); + for (unsigned int i=0; i + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/src/Tools/fjcontrib/RecursiveTools/ChangeLog b/src/Tools/fjcontrib/RecursiveTools/ChangeLog new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/ChangeLog @@ -0,0 +1,674 @@ +2018-05-29 Jesse Thaler + + * VERSION + * NEWS + Changed to 2.0.0-beta2, noted in news + +2018-04-21 Jesse Thaler + + * AUTHORS: updated arxiv number for RecursiveSoftDrop + +2018-04-21 Gavin Salam + + * README: updated arxiv number for RecursiveSoftDrop & Bottom-up + Soft Drop. + +2018-04-04 Gregory Soyez + + * RecursiveSoftDrop.cc (contrib): + fixed syntax of calls to structure_of<...> + (thanks to Attila Krasznahorkay) + +2018-01-24 Gregory Soyez + + * RecursiveSoftDrop.cc: + for the (dafault) dynamical R0 implementation, the dynamical R0 is + evolved independently in each branch. + +2017-10-10 Jesse Thaler + * AUTHORS + Added mention of BUSD + + * README + Some tweaks to the wording + +2017-10-11 Gregory Soyez + + * IteratedSoftDrop.hh: + IteratedSoftDropInfo::size() and multiplicity() now return an + unsigned int instead of a double + +2017-10-10 Jesse Thaler + * AUTHORS + Updated journal reference for ISD + + * example_isd.{cc,ref}: + Included soft drop multiplicity in example + + * README + Added warning at top that documentation has not been updated + + * VERSION + Changed to 2.0.0-beta1 + +2017-10-10 Gregory Soyez + + * example_isd.ref: + updated to reflect the bugfix below + + * IteratedSoftDrop.cc: + fixed issue in description (was taking sqrt of -ve number when + there were no angular cut) + + * NEWS: + drafted for RecursiveTools-2.0.0-beta1 + + * TODO: + updated list in view of a beta release + + * example_isd.cc: + pointed to the right header for IteratedSoftDrop + + * RecursiveSoftDrop.{hh,cc}: + * IteratedSoftDrop.{hh,cc}: + moved IteratedSoftDrop to its own file (replacing the old + implementation) + + * example_advanced_usage.ref: + updated reference file following the fix below. + +2017-09-28 Gregory Soyez + + * RecursiveSymmetryCutBase.cc: + when no substructure is found, keep the _symmetry, _delta_R and + _mu structure variables at -1. This for example allows one to + trigger on substructure by checking if delta_R>=0. + + Note: we could set it to 0 (as it was before) and trigger using + _delta_R>0 but there might be some genuine substructure exactly + collinear. + +2017-09-19 Gregory Soyez + + * example_isd.ref: + updated to the latest version of the example + +2017-09-18 Gregory Soyez + + * Makefile: + updating make check to use all the examples (failing on ISD as + expected, see below) + + * example_bottomup_softdrop.cc: + fixed typo + + * example_bottomup_softdrop.ref: + * example_recursive_softdrop.ref: + added reference output for this example + + * RecursiveSoftDrop.{hh,cc}: + * RecursiveSymmetryCutBase.{cc,hh}: + moved the "all_prongs" method from the base structure t oa + standalone function in RecursiveSoftDrop.hh + + In practice, this is irrelevant for mMDT and SD (since pieces() + gets the job done, and the substructure class does not have (as + is) reliable info to get the full structure) + + * RecursiveSymmetryCutBase.cc: + revamped a series of requests for substructure info to better + handle possible recursion into deeper jet substructure. + + * RecursiveSoftDrop.{hh,cc}: + updated "description" to reuse the info from the base class + + * example_isd.cc: + updated to use the newer implementation of ISD. Checked that it + gives the same results as the former implementation. + + Note: make check still needs fixing because the example now + computes a different set of angularities + + * RecursiveSoftDrop.hh: + added a few helpers to IteratedSoftDropInfo ([] operator and size, + meaning it can be used as a vector >) + + * RecursiveSymmetryCutBase.cc: + . fixed bugs in the calculation of the geometric distances for ee + coordinates + . fixed bug in the computation of the (zg,thetag) pairs [it was + returning the groomed ones instead of the ones passing the + condition] + + * example_recursive_softdrop.cc: + set the R0 parameter to the original jet radius + +2017-09-13 Gregory Soyez + + * example_recursive_softdrop.cc: + tied up a few comments and the code output + + * RecursiveSymmetryCutBase.{hh,cc}: + removed the unneeded _is_composite + + * RecursiveSoftDrop.cc: + fixed issue with "verbose" dropped info on branches with no + further substructure + +2017-09-11 Gregory Soyez + + * RecursiveSoftDrop.{hh,cc}: + have IteratedSoftDDrop returning by default an object of type + IteratedSoftDropInfo; added several helpers + +2017-09-08 Gregory Soyez + + * RecursiveSoftDrop.{hh,cc}: + updated IteratedSoftDrop to give it the flexibility of + RecursiveSoftDrop + + * RecursiveSymmetryCutBase.hh: + fixed typo in comment + + * example_mmdt_ee.cc: *** ADDED *** + added an example to illustrat usage in ee collisions + + * example_isd.cc: + * BottomUpSoftDrop.cc: + * IteratedSoftDrop.cc: + * RecursiveSoftDrop.cc: + Fixed compilation issues with FJ 3.0 (mostly the usage of features + introduced only in FJ3.1) + + * RecursiveSymmetryCutBase.{hh,cc}: + used the internal Recluster class for FJ<3.1.0 and the FJ antive + one for FJ>=3.1.0 + + * BottomUpSoftDrop.{hh,cc}: + moved the implementation of global_grooming to the source file and + fixed a few trivial compilation errors + +2017-09-08 Frédéric Dreyer + + * BottomUpSoftDrop.hh: + added the global_grooming method to process full event + +2017-09-07 Gregory Soyez + + * RecursiveSoftDrop.cc: + cleaned (mostly by removing older commented-out code) + + * RecursiveSoftDrop.{hh,cc}: + * RecursiveSymmetryCutBase.{hh,cc}: + * SoftDrop.cc: + + added support for ee coordinates. For that, the symmetry measure + has to be set to either theta_E (which uses the 3-vector angle + theta) or to cos_theta_E which uses sqrt(2*[1-cos(theta)]) + + Accordingly, the recursion_choice can be set to larger_E to + recurse into the branch with the largest energy. The larger_m + mode, recorsing into the larger-mass branch is also possible but + not advised (for the same reason as the pp version). + + * RecursiveSymmetryCutBase.{hh,cc}: + switched to the Recluster class provided with FastJet. ASlso + included the recluster description to RecursiveSymmetryCutBase + when it is user-defined. + +2017-09-06 Gregory Soyez + + * BottomUpSoftDrop.{hh,cc}: + . renamed SoftDropStructure -> BottomUpSoftDropStructure + SoftDropRecombiner -> BottomUpSoftDropRecombiner + SoftDropPlugin -> BottomUpSoftDropPlugin + . moved 'description' to source file (instead of header) + . kept the "area" information when available (jets will just + appear as having a 0 area) + . added most class description (main class still missing) + + * RecursiveSoftDrop.cc: + . put internal classes to handle CS history in an internal namespace + . replaced the "switch" in the mail loop by a series of if (allows + us a few simplificatins/cleaning) + . more uniform treatment of issues in the presence of an angular cut + (as part of the above reorganisation) + + * example_advanced_usage.ref: + updated reference output file following the bugfix (missing + "grooming mode" initialisation in one of the SoftDrop ctors) on + 2017-08-01 + + * RecursiveSymmetryCutBase.cc: + removed redundent code + +2017-08-10 Gregory Soyez + + * RecursiveSoftDrop.cc: + fixed trivial typo in variable name + +>>>>>>> .r1071 +2017-08-04 Gregory Soyez + + * RecursiveSoftDrop.cc: + do not impose an angular cut in IterativeSD if it is -ve. + +2017-08-01 Gregory Soyez + + * example_recursive_softdrop.cc: + added a series of optional flags + + * RecursiveSoftDrop.cc: + fixed a few issues with the fixed depth version + + * RecursiveSymmetryCutBase.hh: + a jet is now considered as havig substructure if deltaR>0 + (coherent with released version) + + * SoftDrop.hh: + bugfix: set the "grooming mode" by default in all ctors + EDIT: caused issue with make check, fixed on 2017-09-069 (see + above) + + * RecursiveSoftDrop.{hh,cc}: + added support for the "same depth" variant + + * RecursiveSymmetryCutBase.cc: + also associate a RecursiveSymmetryCutBase::StructureType structure + to the result jet in case it is just a single particle (in + grooming mode) + +2017-07-31 Gregory Soyez + + * RecursiveSymmetryCutBase.{hh,cc}: + added the option to pass an extra parameter to the symmetry cut + function + + * RecursiveSymmetryCutBase.{hh,cc}: + * ModifiedMassDropTagger.hh + * SoftDrop.hh: + minor adaptions due to the above change + added a few methods to + query the class information (symmetry cut, beta, ...) + + * RecursiveSoftDrop.{hh,cc}: + Added support for + - a dynamical R0 + - recursing only in the hardest branch + - imposing a min deltaR cut + + Added a tentative IterativeSoftDrop class + +2017-07-28 Gregory Soyez + + * RecursiveSoftDrop.cc: + adapted to the latest changes in RecursiveSymmetryCutBase + + * RecursiveSymmetryCutBase.{hh,cc}: + reorganised the output of the recursion step (recurse_one_step) + using an enum to make iot more readable (and to fix issues where + the dropped prong is actually 0, e.g. after subtraction) + +2017-07-26 Gregory Soyez + + * example_recursive_softdrop.cc: *** ADDED *** + added a draft example for the use of RecursiveSoftDrop + + * RecursiveSoftDrop.{hh,cc}: *** ADDED *** + added a first pass at an implementation of RecursiveSoftDrop. + + This is based on Frederic's initial version but keeps the + branching structure of the jet. Some of the features, like + dynamical R0, direct access to the substructure or the same depth + variant, are still unsupported. + + * SoftDrop.hh: + declared _beta, _symmetry_cut and _R0sqr as protected (was + private) so they ca n be used by RecursiveSoftDrop + + * RecursiveSymmetryCutBase.{hh,cc}: + extracted from result() the part that performs one step of the + resursion (implemented as recurse_one_step()). This is repeatedly + called by result(). It has specific conventions to indicate + whether or not some substructure has been found or if one ran into + some issue. + +2017-04-25 Kevin Zhou + + * IteratedSoftDrop.hh + . Added Doxygen documentation + + * RecursiveSymmetryCutBase.hh + . Added references to ISD + +2017-04-25 Jesse Thaler + * AUTHORS, COPYING: + . Added ISD arXiv number + + * example_isd.{cc,ref} + . Added ISD arXiv number + . Changing z_cut to be optimal value (with Lambda = 1 GeV) + . Tweaked formatting + + * IteratedSoftDrop.{hh,cc} + . Added ISD arXiv number + . Assert added if recluster does not return one jet. + + * README + . Added ISD arXiv number and tweaked wording + + +2017-04-20 Kevin Zhou + + * example_isd.{cc,ref} ** ADDED ** + * IteratedSoftDrop.{cc,hh} ** ADDED ** + + * Makefile + . Added IteratedSoftDrop (ISD) as appropriate + + * AUTHORS + . Added myself to author list + . Added placeholder for ISD paper + + * COPYING + . Added placeholder for ISD paper + + * README + . Added description of ISD + + * TODO + . Added tasks to integrate ISD with other classes, e.g. SD, + Recluster, and the future RecursiveSoftDrop (RSD) + + * NEWS + . Added dummy for release of 1.1.0 + + * VERSION: + . Switched version number to 1.1.0-dev + + * example_advanced_usage.cc: + . Added $Id$ tag, didn't change anything else + +2014-07-30 Gregory Soyez + + * Recluster.hh: fixed the name of the #define for the header + +2014-07-09 Gregory Soyez + Jesse + + * NEWS: + release of RecursiveTools v1.0.0 + + * VERSION: + switched version number to 1.0.0 + +2014-07-08 Gavin Salam + + * README (RecursionChoice): + added ref to .hh for constness specs of virtual functions (to + reduce risk of failed overloading due to wrong constness). + +2014-07-08 Gregory Soyez + Jesse + + * README: + partially rewrote the description of set_subtractor + +2014-07-07 Gregory Soyez + Jesse + + * example_advanced_usage.cc: + * example_softdrop.cc: + a few small fixed in the header of the files + + * VERSION: + switched over to 1.0.0-alpha2-devel + + * README: + Reordered a few things and added a few details. + + * Makefile (check): + Be quiter during "make check" + + * Recluster.cc (contrib): + Documented the "single" ctor argument + + * RecursiveSymmetryCutBase.cc (contrib): + If the user sets himself the reclustering, disable the "non-CA" + warning (we assume that he knows what he is doing). Mentioned in + the comments that non-CA reclustering has to be used at the user's + risk. Also throw when th input jet has no constituents or when + there is no cluster sequence after reclustering. + + * Recluster.cc (contrib): + replaced a remaining mention to "filtering" by reclustering + +2014-07-04 Jesse Thaler + * VERSION + . Ready for alpha release + +2014-06-17 Jesse Thaler + * example_advanced_usage.{cc,ref} ** ADDED ** + * Makefile + . New example file to test a bunch of soft drop options + . Put in makefile as well + . Fixed nasty memory bug with pointers to Recluster + + * RecursiveSymmetryCutBase.cc + * example_softdrop.ref + . description() now says Groomer vs. Tagger + + * RecursiveSymmetryCutBase.{cc,hh} + . Added optional verbose logging information about + kinematics of dropped branches + + * example_softdrop.cc + * example_advanced_usage.cc + . Fixed + + +2014-06-16 Gregory Soyez + + * Makefile: + also install the RecursiveSymmetryuCutBase.hh header + +2014-06-13 Jesse Thaler + * AUTHORS + . Added myself to author list + . Put complete bibliographic details on papers + + * COPYING + . Added boilerplate MC/GPLv2 statement + + * example.cc: ** REMOVED ** renamed to... + * example_mmdt.cc ** ADDED ** + * Makefile + . Made name change for consistency + . Made corresponding changes in Makefile + + * example_mmdt_sub.cc: + * example_mmdt.cc: + * example_recluster.cc: + . light editing of comments + + * example_softdrop.cc: + . light editing of comments + . added assert for sdjet != 0, since SoftDrop is a groomer + + * ModifiedMassDropTagger.hh + * Recluster.{cc,hh} + * RecursiveSymmetryCutBase.{cc,hh} + * SoftDrop.hh + . Updated some comments + + * README + . Updated to include basic usage description and some + technical details + + * TODO: + . Added some discussion points. + +2014-06-13 Gregory Soyez + + * example_softdrop.{cc,ref}: + added an example for SoftDrop + + * SoftDrop.{hh,cc}: + * ModifiedMassDropTagger.{hh,cc}: + * RecursiveSymmetryCutBase.{hh,cc}: *** ADDED *** + . added a base class for both the mMDT and SoftDrop + . made mMDT and SoftDrop inherit from RecursiveSymmetryCutBase + . moved the reclustering to the base class. By default, both + mMDT and SoftDrop now recluster the jet with C/A + . added set_grooming_mode and set_tagging_mode methods to the + base class + + * Merging the development branch 1.0-beta1-softdrop-addition back + into the trunk (will correspond to revision 682) + + * VERSION: + switched back to 1.0.0-devel + + * SoftDrop.{hh,cc}: + added support for re-clustering through set_reclustering(bool, + Recluster*). By default, reclustering is done with + Cambridge/Aachen. + + * example_recluster.{cc,ref}: *** ADDED *** + added an example of reclustering + + * Recluster.{hh,cc}: + added a 'single' ctor argument [true by default]. When true, the + hardest jet after reclustering is returned, otherwise, the result + is a composite jet with all the subjets as its pieces. + +2014-05-15 Gregory Soyez + + * VERSION: + set version number to 1.0-alpha-PUWS14.1 in preparation for a + fastjet-contrib release for the pileup-workshop at CERN on May + 2014. + +2014-04-25 Gregory Soyez + + * ModifiedMassDropTagger.hh: + * ModifiedMassDropTagger.cc: + Added comments at various places + + * AUTHORS: + * README: + Updated info about what is now included in this contrib + + * SoftDrop.hh: *** ADDED *** + * SoftDrop.cc: *** ADDED *** + * Recluster.hh: *** ADDED *** + * Recluster.cc; *** ADDED *** + Added tools for reclustering and softDrop + +2014-04-25 Gregory Soyez + + branch started at revision 611 to start including SoftDrop in the + Recursivetols contrib + +2014-04-24 Gregory Soyez + + * ModifiedMassDropTagger.hh: + added a mention of the fact that when result is called in the + presence of a subtractor, then the output is a subtracted + PseudoJet. + + * ModifiedMassDropTagger.hh: + declared _symmetry_cut as protected (rather than provate) so it + can be accessed if symmetry_cut_description() is overloaded. + + * example.cc: + trivial typo fixed in a comment + +2014-02-04 Gavin Salam + + * VERSION: + upped it to 1.0-beta1 + + * example_mmdt_sub.cc (main): + added an #if to make sure FJ3.1 features are only used if FJ3.1 + is available. (Currently FJ3.1 is only available to FJ developers). + +2014-01-26 Gavin Salam + + * VERSION: + renamed to 1.0-beta0 + + * ModifiedMassDropTagger.hh: + * README: + added info on author names + + * example_mmdt_sub.ref: *** ADDED *** + added reference output for the pileup test. + +2014-01-25 Gavin Salam + + * example_mmdt_sub.cc: + * Makefile: + added an extra example illustrating functionality with pileup + subtraction. + +2014-01-24 Gavin Salam + + * ModifiedMassDropTagger.cc: + + Reorganised code so that (sub)jet.m2()>0 check is only used when + absolutely necessary: so if using a scalar_z symmetry measure, + whenever scalar_z < zcut, then there is no point checking the mu + condition. This means that there's no issue if the (sub)jet mass + is negative, and one simply recurses down into the jet. (Whereas + before it would bail out, reducing the tagging efficiency). + + Also removed the verbose code. + +2014-01-23 Gavin Salam + + * ModifiedMassDropTagger.cc|hh: + * example.cc + replaced "asymmetry" with "symmetry" in a number of places; + implemented the structural information and added it to the example; + added a new simplified constructor; + improved doxygen documentation; + started renaming -> RecursiveTools + + * README + some tidying + + * VERSION + 1.0-b0 + +2014-01-22 Gavin Salam + + * ModifiedMassDropTagger.cc (contrib): + -ve mass now bails out also when using the "y" asymmetry measure. + Also, default my is now infinite. + +2014-01-20 Gavin Salam + Gregory + + + * ModifiedMassDropTagger.cc|hh: + introduced a virtual asymmetry_cut_fn (essentially a + dummy function returning a constant), to allow for derived classes + to do fancier things. + + added warning about non-C/A clustering. + explicitly labelled some (inherited) virtual functions as + virtual. + +2014-01-20 Gavin Salam + + * example.ref: + * example.cc (main): + got a first working example and make check setup. + + * ModifiedMassDropTagger.cc|hh: + improved doxygen comments; + added option whereby input jet is assumed already subtracted + +2014-01-19 Gavin Salam + + * ModifiedMassDropTagger.cc|hh: + * many other files + + Initial creation, with basic code for MMDT + diff --git a/src/Tools/fjcontrib/RecursiveTools/IteratedSoftDrop.cc b/src/Tools/fjcontrib/RecursiveTools/IteratedSoftDrop.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/IteratedSoftDrop.cc @@ -0,0 +1,132 @@ +// $Id: IteratedSoftDrop.cc 1084 2017-10-10 20:36:50Z gsoyez $ +// +// Copyright (c) 2017-, Jesse Thaler, Kevin Zhou, Gavin P. Salam +// andGregory Soyez +// +// based on arXiv:1704.06266 by Christopher Frye, Andrew J. Larkoski, +// Jesse Thaler, Kevin Zhou +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include "IteratedSoftDrop.hh" +#include +#include +#include + +using namespace std; + +//FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + //namespace contrib{ + + namespace Rivet{ + namespace fjcontrib{ + + +//======================================================================== +// implementation of IteratedSoftDropInfo +//======================================================================== + +// returns the angularity with angular exponent alpha and z +// exponent kappa calculated on the zg's and thetag's found by +// iterated SoftDrop +// +// returns 0 if no substructure was found +double IteratedSoftDropInfo::angularity(double alpha, double kappa) const{ + double sum = 0.0; + for (unsigned int i=0; i< _all_zg_thetag.size(); ++i) + sum += pow(_all_zg_thetag[i].first, kappa) * pow(_all_zg_thetag[i].second, alpha); + return sum; +} + +//======================================================================== +// implementation of IteratedSoftDrop +//======================================================================== + +// Constructor. Takes in the standard Soft Drop parameters, an angular cut \f$\theta_{\rm cut}\f$, +// and a choice of angular and symmetry measure. +// +// - beta the Soft Drop beta parameter +// - symmetry_cut the Soft Drop symmetry cut +// - angular_cut the angular cutoff to halt Iterated Soft Drop +// - R0 the angular distance normalization +IteratedSoftDrop::IteratedSoftDrop(double beta, double symmetry_cut, double angular_cut, double R0, + const FunctionOfPseudoJet * subtractor) : + _rsd(beta, symmetry_cut, -1, R0, subtractor){ + _rsd.set_hardest_branch_only(true); + if (angular_cut>0) + _rsd.set_min_deltaR_squared(angular_cut*angular_cut); +} + + +// Full constructor, which takes the following parameters: +// +// \param beta the value of the beta parameter +// \param symmetry_cut the value of the cut on the symmetry measure +// \param symmetry_measure the choice of measure to use to estimate the symmetry +// \param angular_cut the angular cutoff to halt Iterated Soft Drop +// \param R0 the angular distance normalisation [1 by default] +// \param mu_cut the maximal allowed value of mass drop variable mu = m_heavy/m_parent +// \param recursion_choice the strategy used to decide which subjet to recurse into +// \param subtractor an optional pointer to a pileup subtractor (ignored if zero) +IteratedSoftDrop::IteratedSoftDrop(double beta, + double symmetry_cut, + RecursiveSoftDrop::SymmetryMeasure symmetry_measure, + double angular_cut, + double R0, + double mu_cut, + RecursiveSoftDrop::RecursionChoice recursion_choice, + const FunctionOfPseudoJet * subtractor) + : _rsd(beta, symmetry_cut, symmetry_measure, -1, R0, mu_cut, recursion_choice, subtractor){ + _rsd.set_hardest_branch_only(true); + if (angular_cut>0) + _rsd.set_min_deltaR_squared(angular_cut*angular_cut); +} + + +// returns vector of ISD symmetry factors and splitting angles +IteratedSoftDropInfo IteratedSoftDrop::result(const PseudoJet& jet) const{ + PseudoJet rsd_jet = _rsd(jet); + if (! rsd_jet.has_structure_of()) + return IteratedSoftDropInfo(); + return IteratedSoftDropInfo(rsd_jet.structure_of().sorted_zg_and_thetag()); +} + + +std::string IteratedSoftDrop::description() const{ + std::ostringstream oss; + oss << "IteratedSoftDrop with beta =" << _rsd.beta() + << ", symmetry_cut=" << _rsd.symmetry_cut() + << ", R0=" << _rsd.R0(); + + if (_rsd.min_deltaR_squared() >= 0){ + oss << " and angular_cut=" << sqrt(_rsd.min_deltaR_squared()); + } else { + oss << " and no angular_cut"; + } + + if (_rsd.subtractor()){ + oss << ", and with internal subtraction using [" << _rsd.subtractor()->description() << "]"; + } + return oss.str(); +} + + + } } // namespace contrib + + //FASTJET_END_NAMESPACE diff --git a/src/Tools/fjcontrib/RecursiveTools/Makefile.am b/src/Tools/fjcontrib/RecursiveTools/Makefile.am new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/Makefile.am @@ -0,0 +1,12 @@ +noinst_LTLIBRARIES = libRivetRecursiveTools.la + +libRivetRecursiveTools_la_SOURCES = \ + BottomUpSoftDrop.cc \ + IteratedSoftDrop.cc \ + ModifiedMassDropTagger.cc \ + Recluster.cc \ + RecursiveSoftDrop.cc \ + RecursiveSymmetryCutBase.cc \ + SoftDrop.cc + +libRivetRecursiveTools_la_CPPFLAGS = -I${top_srcdir}/include/Rivet/Tools/fjcontrib $(AM_CPPFLAGS) diff --git a/src/Tools/fjcontrib/RecursiveTools/ModifiedMassDropTagger.cc b/src/Tools/fjcontrib/RecursiveTools/ModifiedMassDropTagger.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/ModifiedMassDropTagger.cc @@ -0,0 +1,48 @@ +// $Id: ModifiedMassDropTagger.cc 683 2014-06-13 14:38:38Z gsoyez $ +// +// Copyright (c) 2014-, Gavin P. Salam +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include "ModifiedMassDropTagger.hh" +#include "fastjet/JetDefinition.hh" +#include "fastjet/ClusterSequenceAreaBase.hh" +#include +#include + +using namespace std; + +//FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + //namespace contrib{ + + namespace Rivet{ + namespace fjcontrib{ + + +//---------------------------------------------------------------------- +string ModifiedMassDropTagger::symmetry_cut_description() const { + ostringstream ostr; + ostr << _symmetry_cut << " [ModifiedMassDropTagger]"; + return ostr.str(); +} + + + } } // namespace contrib + + //FASTJET_END_NAMESPACE diff --git a/src/Tools/fjcontrib/RecursiveTools/NEWS b/src/Tools/fjcontrib/RecursiveTools/NEWS new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/NEWS @@ -0,0 +1,11 @@ +2018/05/31: release of version 2.0.0-beta2 with corrected syntax + +2017/10/10: release of version 2.0.0-beta1 including implementations of + +* RecursiveSoftDrop (see example_rsd.hh for usage) +* IteratedSoftDrop (see example_isd.hh for usage) +* e+e- version of the recursive tools (see example_mmdt_ee.hh for usage) +* BottomUpSoftDrop (see example_bottomup_softdrop.cc for usage) + +2014/07/09: release of version 1.0.0 of RecursiveTools including + ModifiedMassDropTagger and SoftDrop (as well as Recluster) diff --git a/src/Tools/fjcontrib/RecursiveTools/README b/src/Tools/fjcontrib/RecursiveTools/README new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/README @@ -0,0 +1,346 @@ +------------------------------------------------------------------------ +RecursiveTools FastJet contrib +------------------------------------------------------------------------ + +The RecursiveTools FastJet contrib aims to provide a common contrib +for a number of tools that involve recursive reclustering/declustering +of a jet for tagging or grooming purposes. + +Currently it contains: + +- ModifiedMassDropTagger + This corresponds to arXiv:1307.0007 by Mrinal Dasgupta, Alessandro + Fregoso, Simone Marzani and Gavin P. Salam + +- SoftDrop + This corresponds to arXiv:1402.2657 by Andrew J. Larkoski, Simone + Marzani, Gregory Soyez, Jesse Thaler + +- RecursiveSoftDrop +- BottomUpSoftDrop + This corresponds to arXiv:1804.03657 by Frederic Dreyer, Lina + Necib, Gregory Soyez and Jesse Thaler + +- IteratedSoftDrop + This corresponds to arXiv:1704.06266 by Christopher Frye, Andrew J. + Larkoski, Jesse Thaler, Kevin Zhou + +- Recluster + A generic tool to recluster a given jet into subjets + Note: a Recluster class is available natively in FastJet since v3.1. + Users are therefore encouraged to use the FastJet version + rather than this one which is mostly provided for + compatibility of this contrib with older versions of FastJet. + +The interface for these tools is described in more detail below, with +all of the available options documented in the header files. + +One note about nomenclature. A groomer is a procedure that takes a +PseudoJet and always returns another (non-zero) PseudoJet. A tagger is +a procedure that takes a PseudoJet, and either returns another PseudoJet +(i.e. tags it) or returns an empty PseudoJet (i.e. doesn't tag it). + +------------------------------------------------------------------------ +ModifiedMassDropTagger +------------------------------------------------------------------------ + +The Modified Mass Drop Tagger (mMDT) recursively declusters a jet, +following the largest pT subjet until a pair of subjets is found that +satisfy the symmetry condition on the energy sharing + + z > z_cut + +where z_cut is a predetermined value. By default, z is calculated as +the scalar pT fraction of the softest subjet. Note that larger values +of z_cut correspond to a more restrictive tagging criteria. + +By default, mMDT will first recluster the jet using the CA clustering +algorithm, which means that mMDT can be called on any jet, regardless +of the original jet finding measure. + +A default mMDT can be created via + + double z_cut = 0.10; + ModifiedMassDropTagger mMDT(z_cut); + +More options are available in the full constructor. To apply mMDT, +one simply calls it on the jet of interest. + + PseudoJet tagged_jet = mMDT(original_jet); + +Note that mMDT is a tagger, such that tagged_jet will only be non-zero +if the symmetry cut z > z_cut is satisfied by some branching of the +clustering tree. + +To gain additional information about the mMDT procedure, one can use + + tagged_jet.structure_of() + +which gives access to information about the delta_R between the tagged +subjets, their z value, etc. + +------------------------------------------------------------------------ +SoftDrop +------------------------------------------------------------------------ + +The SoftDrop procedure is very similar to mMDT, albeit with a +generalised symmetry condition: + + z > z_cut * (R / R0)^beta + +Note that larger z_cut and smaller beta correspond to more aggressive +grooming of the jet. + +SoftDrop is intended to be used as a groomer (instead of as a tagger), +such that if the symmetry condition fails throughout the whole +clustering tree, SoftDrop will still return a single particle in the +end. Apart from the tagger/groomer distinction, SoftDrop with beta=0 is +the same as mMDT. + +A default SoftDrop groomer can be created via: + + double z_cut = 0.10; + double beta = 2.0; + double R0 = 1.0; // this is the default value + SoftDrop sd(z_cut,beta,R0); + +and acts on a desired jet as + + PseudoJet groomed_jet = sd(original_jet); + +and additional information can be obtained via + + groomed_jet.structure_of() + +SoftDrop is typically called with beta > 0, though beta < 0 is still a +viable option. Because beta < 0 is infrared-collinear unsafe in +grooming mode, one probably wants to switch to tagging mode for negative +beta, via set_tagging_mode(). + +------------------------------------------------------------------------ +RecursiveSoftDrop +------------------------------------------------------------------------ + +The RecursiveSoftDrop procedure applies the Soft Drop procedure N times +in a jet in order to find up to N+1 prongs. N=0 makes no modification +to the jet, and N=1 is equivalent to the original SoftDrop. + +Once one has more than one prong, one has to decide which will be +declustered next. At each step of the declustering procedure, one +undoes the clustering which has the largest declustering angle +(amongst all the branches that are searched for substructure). [see +"set_fixed_depth" below for an alternative] + +Compared to SoftDrop, RecursiveSoftDrop takes an extra argument N +specifying the number of times the SoftDrop procedure is recursively +applied. Negative N means that the procedure is applied until no +further substructure is found (i.e. corresponds to taking N=infinity). + + double z_cut = 0.10; + double beta = 2.0; + double R0 = 1.0; // this is the default value + int N = -1; + RecursiveSoftDrop rsd(z_cut, beta, N, R0); + +One then acts on a jet as + + PseudoJet groomed_jet = rsd(jet) + +and get additional information via + + groomed_jet.structure_of() + +------------------------------------------------------------------------ +IteratedSoftDrop +------------------------------------------------------------------------ + +Iterated Soft Drop (ISD) is a repeated variant of SoftDrop. After +performing the Soft Drop procedure once, it logs the groomed symmetry +factor, then recursively performs Soft Drop again on the harder +branch. This procedure is repeated down to an (optional) angular cut +theta_cut, yielding a set of symmetry factors from which observables +can be built. + +An IteratedSoftDrop tool can be created as follows: + + double beta = -1.0; + double z_cut = 0.005; + double theta_cut = 0.0; + double R0 = 0.5; // characteristic radius of jet algorithm + IteratedSoftDrop isd(beta, z_cut, double theta_cut, R0); + +By default, ISD applied on a jet gives a result of type +IteratedSoftDropInfo that can then be probed to obtain physical +observables + + IteratedSoftDropInfo isd_info = isd(jet); + + unsigned int multiplicity = isd_info.multiplicity(); + double kappa = 1.0; // changes angular scale of ISD angularity + double isd_width = isd_info.angularity(kappa); + vector > zg_thetags = isd_info.all_zg_thetag(); + vector > zg_thetags = isd_info(); + for (unsigned int i=0; i< isd_info.size(); ++i){ + cout << "(zg, theta_g)_" << i << " = " + << isd_info[i].first << " " << isd_info[i].second << endl; + } + +Alternatively, one can directly get the multiplicity, angularity, and +(zg,thetag) pairs from the IteratedSoftDrop class, at the expense of +re-running the declustering procedure: + + unsigned int multiplicity = isd.multiplicity(jet); + double isd_width = isd.angularity(jet, 1.0); + vector > zg_thetags = isd.all_zg_thetag(jet); + + +Note: the iterative declustering procedure is the same as what one + would obtain with RecursiveSoftDrop with an (optional) angular cut + and recursing only in the hardest branch [see the "Changing + behaviour" section below for details], except that it returns some + information about the jet instead of a modified jet as RSD does. + + +------------------------------------------------------------------------ +BottomUpSoftDrop +------------------------------------------------------------------------ + +This is a bottom-up version of the RecursiveSoftDrop procedure, in a +similar way as Pruning can be seen as a bottom-up version of Trimming. + +In practice, the jet is reclustered and at each step of the clustering +one checks the SoftDrop condition + + z > z_cut * (R / R0)^beta + +If the condition is met, the pair is recombined. If the condition is +not met, only the hardest of the two objects is kept for further +clustering and the softest is rejected. + +------------------------------------------------------------------------ +Recluster +------------------------------------------------------------------------ + + *** NOTE: this is provided only for backwards compatibility *** + *** with FastJet <3.1. For FastJet >=3.1, the native *** + *** fastjet::Recluster is used instead *** + +The Recluster class allows the constituents of a jet to be reclustered +with a different recursive clustering algorithm. This is used +internally in the mMDT/SoftDrop/RecursiveSoftDrop/IteratedSoftDrop +code in order to recluster the jet using the CA algorithm. This is +achieved via + + Recluster ca_reclusterer(cambridge_algorithm, + JetDefinition::max_allowable_R); + PseudoJet reclustered_jet = ca_reclusterer(original_jet); + +Note that reclustered_jet creates a new ClusterSequence that knows to +delete_self_when_unused. + +------------------------------------------------------------------------ +Changing behaviour +------------------------------------------------------------------------ + +The behaviour of the all the tools provided here +(ModifiedMassDropTagger, SoftDrop, RecursiveSoftDrop and +IteratedSoftDrop) can be tweaked using the following options: + +SymmetryMeasure = {scalar_z, vector_z, y, theta_E, cos_theta_E} + [constructor argument] + : The definition of the energy sharing between subjets, with 0 + corresponding to the most asymmetric. + . scalar_z = min(pt1,pt2)/(pt1+pt2) [default] + . vector_z = min(pt1,pt2)/pt_{1+2} + . y = min(pt1^2,pt2^2)/m_{12}^2 (original y from MDT) + . theta_E = min(E1,E2)/(E1+E2), + with angular measure theta_{12}^2 + . cos_theta_E = min(E1,E2)/(E1+E2), + with angular measure 2[1-cos(theta_{12})] + The last two variants are meant for use in e+e- collisions, + together with the "larger_E" recursion choice (see below) + +RecursionChoice = {larger_pt, larger_mt, larger_m, larger_E} + [constructor argument] + : The path to recurse through the tree after the symmetry condition + fails. Options refer to transverse momentum (pt), transverse mass + (mt=sqrt(pt^2+m^2), mass (m) or energy (E). the latter is meant + for use in e+e- collisions + +mu_cut [constructor argument] + : An optional mass drop condition + +set_subtractor(subtractor*) [or subtractor as a constructor argument] + : provide a subtractor. When a subtractor is supplied, the + kinematic constraints are applied on subtracted 4-vectors. In + this case, the result of the ModifiedMassDropTagger/SoftDrop is a + subtracted PseudoJet, and it is assumed that + ModifiedMassDropTagger/SoftDrop is applied to an unsubtracted jet. + The latter default can be changed by calling + set_input_jet_is_subtracted(). + +set_reclustering(bool, Recluster*) + : An optional setting to recluster a jet with a different jet + recursive jet algorithm. The code is only designed to give sensible + results with the CA algorithm, but other reclustering algorithm + (especially kT) may be appropriate in certain contexts. + Use at your own risk. + +set_grooming_mode()/set_tagging_mode() + : In grooming mode, the algorithm will return a single particle if the + symmetry condition fails for the whole tree. In tagging mode, the + algorithm will return an zero PseudoJet if no symmetry conditions + passes. Note that ModifiedMassDropTagger defaults to tagging mode + and SoftDrop defaults to grooming mode. + +set_verbose_structure(bool) + : when set to true, additional information will be stored in the jet + structure. This includes in particular values of symmetry, + delta_R, and mu of dropped branches + +For the specific case of RecursiveSoftDrop, additional tweaking is +possible via the following methods + +set_fixed_depth_mode(bool) + : when this is true, RSD will recurse (N times) into all the + branches found during the previous iteration [instead of recursing + through the largest declustering angle until N prongs have been + found]. This yields at most 2^N prong. For infinite N, the two + options are equivalent. + +set_dynamical_R0(bool) + : By default the angles in the SD condition are normalised to the + parameter R0. With "dynamical R0", RSD will dynamically adjust R0 + to be the angle between the two prongs found during the previous + iteration. + +set_hardest_branch_only(bool) + : When substructure is found, only recurse into the hardest of the + two branches for further substructure search. This uses the class + RecursionChoice. + +set_min_deltaR_squared(double): + : set a minimal angle (squared) at which we stop the declustering + procedure. This cut is ineffective for negative values of the + argument. + +------------------------------------------------------------------------ +Technical Details +------------------------------------------------------------------------ + +Both ModifiedMassDropTagger and SoftDrop inherit from +RecursiveSymmetryCutBase, which provides a common codebase for recursive +declustering of a jet with a symmetry cut condition. A generic +RecursiveSymmetryCutBase depends on the following (virtual) functions +(see header file for exact full specs, including constness): + +double symmetry_cut_fn(PseudoJet &, PseudoJet &) + : The function that defines the symmetry cut. This is what actually + defines different recursive declustering schemes, and all classes + that inherit from RecursiveSymmetryCutBase must define this + function. + +string symmetry_cut_description() + : the string description of the symmetry cut. + +------------------------------------------------------------------------ diff --git a/src/Tools/fjcontrib/RecursiveTools/Recluster.cc b/src/Tools/fjcontrib/RecursiveTools/Recluster.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/Recluster.cc @@ -0,0 +1,394 @@ +// $Id: Recluster.cc 699 2014-07-07 09:58:12Z gsoyez $ +// +// Copyright (c) 2014-, Matteo Cacciari, Gavin P. Salam and Gregory Soyez +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include "Recluster.hh" +#include +#include +#include + +using namespace std; + +// Comments: +// +// - If the jet comes from a C/A clustering (or is a composite jet +// made of C/A clusterings) and we recluster it with a C/A +// algorithm, we just use exclusive jets instead of doing the +// clustering explicitly. In this specific case, we need to make +// sure that all the pieces share the same cluster sequence. +// +// - If the recombiner has to be taken from the original jet and that +// jet is composite, we need to check that all the pieces were +// obtained with the same recombiner. +// +// TODO: +// +// - check this actually works!!! + +//FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + //namespace contrib{ + + namespace Rivet{ + namespace fjcontrib{ + + +LimitedWarning Recluster::_explicit_ghost_warning; + +// class description +string Recluster::description() const { + ostringstream ostr; + ostr << "Recluster with subjet_def = "; + if (_use_full_def) { + ostr << _subjet_def.description(); + } else { + if (_subjet_alg == kt_algorithm) { + ostr << "Longitudinally invariant kt algorithm with R = " << _subjet_radius; + } else if (_subjet_alg == cambridge_algorithm) { + ostr << "Longitudinally invariant Cambridge/Aachen algorithm with R = " << _subjet_radius; + } else if (_subjet_alg == antikt_algorithm) { + ostr << "Longitudinally invariant anti-kt algorithm with R = " << _subjet_radius; + } else if (_subjet_alg == genkt_algorithm) { + ostr << "Longitudinally invariant generalised kt algorithm with R = " << _subjet_radius + << ", p = " << _subjet_extra; + } else if (_subjet_alg == cambridge_for_passive_algorithm) { + ostr << "Longitudinally invariant Cambridge/Aachen algorithm with R = " << _subjet_radius + << " and a special hack whereby particles with kt < " + << _subjet_extra << "are treated as passive ghosts"; + } else if (_subjet_alg == ee_kt_algorithm) { + ostr << "e+e- kt (Durham) algorithm"; + } else if (_subjet_alg == ee_genkt_algorithm) { + ostr << "e+e- generalised kt algorithm with R = " << _subjet_radius + << ", p = " << _subjet_extra; + } else if (_subjet_alg == undefined_jet_algorithm) { + ostr << "uninitialised JetDefinition (jet_algorithm=undefined_jet_algorithm)" ; + } else { + ostr << "unrecognized jet_algorithm"; + } + ostr << ", a recombiner obtained from the jet being reclustered"; + } + + if (_single) + ostr << " and keeping the hardest subjet"; + else + ostr << " and joining all subjets in a composite jet"; + + return ostr.str(); +} + +// return a vector of subjets, which are the ones that would be kept +// by the filtering +PseudoJet Recluster::result(const PseudoJet &jet) const { + // generic sanity checks + //------------------------------------------------------------------- + // make sure that the jet has constituents + if (! jet.has_constituents()) + throw Error("Filter can only be applied on jets having constituents"); + + // tests particular to certain configurations + //------------------------------------------------------------------- + + // for a whole variety of checks, we shall need the "recursive" + // pieces of the jet (the jet itself or recursing down to its most + // fundamental pieces). So we do compute these once and for all. + // + // Note that the pieces are always needed (either for C/A or for the + // area checks) + vector all_pieces; //.clear(); + if ((!_get_all_pieces(jet, all_pieces)) || (all_pieces.size()==0)){ + throw Error("Recluster: failed to retrieve all the pieces composing the jet."); + } + + // decide which jet definition to use + //------------------------------------------------------------------- + JetDefinition subjet_def; + if (_use_full_def){ + subjet_def = _subjet_def; + } else { + _build_jet_def_with_recombiner(all_pieces, subjet_def); + } + + + // the vector that will ultimately hold the subjets + vector subjets; + + // check if we can apply the simplification for C/A jets reclustered + // with C/A + // + // we apply C/A clustering iff + // - the request subjet_def is C/A + // - the jet is either directly coming from C/A or if it is a + // superposition of C/A jets from the same cluster sequence + // - the pieces agree with the recombination scheme of subjet_def + // + // Note that in this case area support will be automatically + // inherted so we can only worry about this later + //------------------------------------------------------------------- + if (_check_ca(all_pieces, subjet_def)){ + _recluster_cafilt(all_pieces, subjets, subjet_def.R()); + subjets = sorted_by_pt(subjets); + return _single + ? subjets[0] + : join(subjets, *(subjet_def.recombiner())); + } + + // decide if area support has to be kept + //------------------------------------------------------------------- + bool include_area_support = jet.has_area(); + if ((include_area_support) && (!_check_explicit_ghosts(all_pieces))){ + _explicit_ghost_warning.warn("Recluster: the original cluster sequence is lacking explicit ghosts; area support will no longer be available after re-clustering"); + include_area_support = false; + } + + // extract the subjets + //------------------------------------------------------------------- + _recluster_generic(jet, subjets, subjet_def, include_area_support); + subjets = sorted_by_pt(subjets); + + return _single + ? subjets[0] + : join(subjets, *(subjet_def.recombiner())); +} + +//---------------------------------------------------------------------- +// the parts that really do the reclustering +//---------------------------------------------------------------------- + +// get the subjets in the simple case of C/A+C/A +void Recluster::_recluster_cafilt(const vector & all_pieces, + vector & subjets, + double Rfilt) const{ + subjets.clear(); + + // each individual piece should have a C/A cluster sequence + // associated to it. So a simple loop would do the job + for (vector::const_iterator piece_it = all_pieces.begin(); + piece_it!=all_pieces.end(); piece_it++){ + // just extract the exclusive subjets of 'jet' + const ClusterSequence *cs = piece_it->associated_cluster_sequence(); + vector local_subjets; + + double dcut = Rfilt / cs->jet_def().R(); + if (dcut>=1.0){ + local_subjets.push_back(*piece_it); + } else { + local_subjets = piece_it->exclusive_subjets(dcut*dcut); + } + + copy(local_subjets.begin(), local_subjets.end(), back_inserter(subjets)); + } +} + + +// set the filtered elements in the generic re-clustering case (w/o +// subtraction) +void Recluster::_recluster_generic(const PseudoJet & jet, + vector & subjets, + const JetDefinition & subjet_def, + bool do_areas) const{ + // create a new, internal, ClusterSequence from the jet constituents + // get the subjets directly from there + // + // If the jet has area support then we separate the ghosts from the + // "regular" particles so the subjets will also have area + // support. Note that we do this regardless of whether rho is zero + // or not. + // + // Note that to be able to separate the ghosts, one needs explicit + // ghosts!! + // --------------------------------------------------------------- + if (do_areas){ + vector all_constituents = jet.constituents(); + vector regular_constituents, ghosts; + + for (vector::iterator it = all_constituents.begin(); + it != all_constituents.end(); it++){ + if (it->is_pure_ghost()) + ghosts.push_back(*it); + else + regular_constituents.push_back(*it); + } + + // figure out the ghost area from the 1st ghost (if none, any value + // would probably do as the area will be 0 and subtraction will have + // no effect!) + double ghost_area = (ghosts.size()) ? ghosts[0].area() : 0.01; + ClusterSequenceActiveAreaExplicitGhosts * csa + = new ClusterSequenceActiveAreaExplicitGhosts(regular_constituents, + subjet_def, + ghosts, ghost_area); + + subjets = csa->inclusive_jets(); + + // allow the cs to be deleted when it's no longer used + // + // Note that there is at least one constituent in the jet so there + // is in principle at least one subjet But one may have used a + // nasty recombiner that left an empty set of subjets, so we'd + // rather play it safe + if (subjets.size()) + csa->delete_self_when_unused(); + else + delete csa; + } else { + ClusterSequence * cs = new ClusterSequence(jet.constituents(), subjet_def); + subjets = cs->inclusive_jets(); + // allow the cs to be deleted when it's no longer used (again, we + // add an extra safety check) + if (subjets.size()) + cs->delete_self_when_unused(); + else + delete cs; + } +} + + +//---------------------------------------------------------------------- +// various checks and internal constructs +//---------------------------------------------------------------------- + +// fundamental info for CompositeJets +//---------------------------------------------------------------------- + +// get the pieces down to the fundamental pieces +// +// Note that this just checks that there is an associated CS to the +// fundamental pieces, not that it is still valid +bool Recluster::_get_all_pieces(const PseudoJet &jet, vector &all_pieces) const{ + if (jet.has_associated_cluster_sequence()){ + all_pieces.push_back(jet); + return true; + } + + if (jet.has_pieces()){ + const vector pieces = jet.pieces(); + for (vector::const_iterator it=pieces.begin(); it!=pieces.end(); it++) + if (!_get_all_pieces(*it, all_pieces)) return false; + return true; + } + + return false; +} + +// treatment of recombiners +//---------------------------------------------------------------------- +// get the common recombiner to all pieces (NULL if none) +// +// Note that if the jet has an associated cluster sequence that is no +// longer valid, an error will be thrown (needed since it could be the +// 1st check called after the enumeration of the pieces) +const JetDefinition::Recombiner* Recluster::_get_common_recombiner(const vector &all_pieces) const{ + const JetDefinition & jd_ref = all_pieces[0].validated_cs()->jet_def(); + for (unsigned int i=1; ijet_def().has_same_recombiner(jd_ref)) return NULL; + + return jd_ref.recombiner(); +} + +void Recluster::_build_jet_def_with_recombiner(const vector &all_pieces, + JetDefinition &subjet_def) const{ + // the recombiner has to be guessed from the pieces + const JetDefinition::Recombiner * common_recombiner = _get_common_recombiner(all_pieces); + if (common_recombiner) { + if (typeid(*common_recombiner) == typeid(JetDefinition::DefaultRecombiner)) { + RecombinationScheme scheme = + static_cast(common_recombiner)->scheme(); + if (_has_subjet_extra) + subjet_def = JetDefinition(_subjet_alg, _subjet_radius, _subjet_extra, scheme); + else if (_has_subjet_radius) + subjet_def = JetDefinition(_subjet_alg, _subjet_radius, scheme); + else + subjet_def = JetDefinition(_subjet_alg, scheme); + } else { + if (_has_subjet_extra) + subjet_def = JetDefinition(_subjet_alg, _subjet_radius, _subjet_extra, common_recombiner); + else if (_has_subjet_radius) + subjet_def = JetDefinition(_subjet_alg, _subjet_radius, common_recombiner); + else + subjet_def = JetDefinition(_subjet_alg, common_recombiner); + } + } else { + throw Error("Recluster: requested to guess the recombination scheme (or recombiner) from the original jet but an inconsistency was found between the pieces constituing that jet."); + } +} + +// area support +//---------------------------------------------------------------------- + +// check if the jet (or all its pieces) have explicit ghosts +// (assuming the jet has area support). +// +// Note that if the jet has an associated cluster sequence that is no +// longer valid, an error will be thrown (needed since it could be the +// 1st check called after the enumeration of the pieces) +bool Recluster::_check_explicit_ghosts(const vector &all_pieces) const{ + for (vector::const_iterator it=all_pieces.begin(); it!=all_pieces.end(); it++) + if (! it->validated_csab()->has_explicit_ghosts()) return false; + return true; +} + +// C/A specific tests +//---------------------------------------------------------------------- + +// check if one can apply the simplification for C/A subjets +// +// This includes: +// - the subjet definition asks for C/A subjets +// - all the pieces share the same CS +// - that CS is C/A with the same recombiner as the subjet def +// - the filtering radius is not larger than any of the pairwise +// distance between the pieces +// +// Note that if the jet has an associated cluster sequence that is no +// longer valid, an error will be thrown (needed since it could be the +// 1st check called after the enumeration of the pieces) +bool Recluster::_check_ca(const vector &all_pieces, + const JetDefinition &subjet_def) const{ + if (subjet_def.jet_algorithm() != cambridge_algorithm) return false; + + // check that the 1st of all the pieces (we're sure there is at + // least one) is coming from a C/A clustering. Then check that all + // the following pieces share the same ClusterSequence + const ClusterSequence * cs_ref = all_pieces[0].validated_cs(); + if (cs_ref->jet_def().jet_algorithm() != cambridge_algorithm) return false; + for (unsigned int i=1; ijet_def().has_same_recombiner(subjet_def)) return false; + + // we also have to make sure that the reclustering radius is not larger + // than any of the inter-pieces distance + double Rsub2 = subjet_def.R(); + Rsub2 *= Rsub2; + for (unsigned int i=0; i. +//---------------------------------------------------------------------- + +#include "RecursiveSoftDrop.hh" +#include "fastjet/ClusterSequence.hh" + +using namespace std; + +// FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + //namespace contrib{ + + namespace Rivet{ + namespace fjcontrib{ + + +namespace internal_recursive_softdrop{ + +//======================================================================== +/// \class RSDHistoryElement +/// a helper class to help keeping track od the RSD tree +/// +/// The element is created at the top of a branch and updated each +/// time one grooms something away. +class RSDHistoryElement{ +public: + RSDHistoryElement(const PseudoJet &jet, const RecursiveSoftDrop* rsd_ptr, double R0sqr) : + R0_squared(R0sqr), + child1_in_history(-1), child2_in_history(-1), symmetry(-1.0), mu2(-1.0){ + reset(jet, rsd_ptr); + } + + void reset(const PseudoJet &jet, const RecursiveSoftDrop* rsd_ptr){ + current_in_ca_tree = jet.cluster_hist_index(); + PseudoJet piece1, piece2; + theta_squared = (jet.has_parents(piece1, piece2)) + ? rsd_ptr->squared_geometric_distance(piece1,piece2) : 0.0; + } + + int current_in_ca_tree; ///< (history) index of the current particle in the C/A tree + double theta_squared; ///< squared angle at which this decays + double R0_squared; ///< squared angle at the top of the branch + ///< (used for RSD with dynamic_R0) + int child1_in_history; ///< hardest of the 2 decay products (-1 if untagged) + int child2_in_history; ///< softest of the 2 decay products (-1 if untagged) + + // info about what has been dropped and the local substructure + vector dropped_delta_R; + vector dropped_symmetry; + vector dropped_mu; + double symmetry, mu2; +}; + + +/// \class OrderRSDHistoryElements +/// angular ordering of (pointers to) the history elements +/// +/// our priority queue will use pointers to these elements that are +/// ordered in angle (of the objects they point to) +class OrderRSDHistoryElements{ +public: + bool operator()(const RSDHistoryElement *e1, const RSDHistoryElement *e2) const { + return e1->theta_squared < e2->theta_squared; + } +}; + +} // internal_recursive_softdrop + +//======================================================================== + +// initialise all the flags and parameters to their default value +void RecursiveSoftDrop::set_defaults(){ + set_fixed_depth_mode(false); + set_dynamical_R0(false); + set_hardest_branch_only(false); + set_min_deltaR_squared(-1.0); +} + +// description of the tool +string RecursiveSoftDrop::description() const{ + ostringstream res; + res << "recursive application of [" + << RecursiveSymmetryCutBase::description() + << "]"; + + if (_fixed_depth){ + res << ", recursively applied down to a maximal depth of N="; + if (_n==-1) res << "infinity"; else res << _n; + } else { + res << ", applied N="; + if (_n==-1) res << "infinity"; else res << _n; + res << " times"; + } + + if (_dynamical_R0) + res << ", with R0 dynamically scaled"; + else + res << ", with R0 kept fixed"; + + if (_hardest_branch_only) + res << ", following only the hardest branch"; + + if (_min_dR2>0) + res << ", with minimal angle (squared) = " << _min_dR2; + + return res.str(); +} + + +// action on a single jet with RecursiveSoftDrop. +// +// uses "result_fixed_tags" by default (i.e. recurse from R0 to +// smaller angles until n SD conditions have been met), or +// "result_fixed_depth" where each of the previous SD branches are +// recirsed into down to a depth of n. +PseudoJet RecursiveSoftDrop::result(const PseudoJet &jet) const{ + return _fixed_depth ? result_fixed_depth(jet) : result_fixed_tags(jet); +} + +// this routine applies the Soft Drop criterion recursively on the +// CA tree until we find n subjets (or until it converges), and +// adds them together into a groomed PseudoJet +PseudoJet RecursiveSoftDrop::result_fixed_tags(const PseudoJet &jet) const { + // start by reclustering jet with C/A algorithm + PseudoJet ca_jet = _recluster_if_needed(jet); + + if (! ca_jet.has_valid_cluster_sequence()){ + throw Error("RecursiveSoftDrop can only be applied to jets associated to a (valid) cluster sequence"); + } + + const ClusterSequence *cs = ca_jet.validated_cluster_sequence(); + const vector &cs_history = cs->history(); + const vector &cs_jets = cs->jets(); + + // initialize counter to 1 subjet (i.e. the full ca_jet) + int n_tagged = 0; + int max_njet = ca_jet.constituents().size(); + + // create the list of branches + unsigned int max_history_size = 2*max_njet; + if ((_n>0) && (_n history; + history.reserve(max_history_size); // could be one shorter + history.push_back(internal_recursive_softdrop::RSDHistoryElement(ca_jet, this, _R0sqr)); + + // create a priority queue containing the subjets and a comparison definition + // initialise to the full ca_jet + priority_queue, internal_recursive_softdrop::OrderRSDHistoryElements> active_branches; + active_branches.push(& (history[0])); + + PseudoJet parent, piece1, piece2; + double sym, mu2; + + // which R0 to use + //double R0sqr = _R0sqr; + + // loop over C/A tree until we reach the appropriate number of subjets + while ((continue_grooming(n_tagged)) && (active_branches.size())) { + // get the element corresponding to the max dR + // and the associated PJ + internal_recursive_softdrop::RSDHistoryElement * elm = active_branches.top(); + PseudoJet parent = cs_jets[cs_history[elm->current_in_ca_tree].jetp_index]; + + // do one step of SD + RecursionStatus status = recurse_one_step(parent, piece1, piece2, sym, mu2, &elm->R0_squared); + + // check if we passed the SD condition + if (status==recursion_success){ + // check for the optional angular cut + if ((_min_dR2 > 0) && (squared_geometric_distance(piece1,piece2) < _min_dR2)) + break; + + // both subjets are kept in the list for potential further de-clustering + elm->child1_in_history = history.size(); + elm->child2_in_history = history.size()+1; + elm->symmetry = sym; + elm->mu2 = mu2; + active_branches.pop(); + + // update the history + double next_R0_squared = (_dynamical_R0) + ? piece1.squared_distance(piece2) : elm->R0_squared; + + internal_recursive_softdrop::RSDHistoryElement elm1(piece1, this, next_R0_squared); + history.push_back(elm1); + active_branches.push(&(history.back())); + internal_recursive_softdrop::RSDHistoryElement elm2(piece2, this, next_R0_squared); + history.push_back(elm2); + if (!_hardest_branch_only){ + active_branches.push(&(history.back())); + } + + ++n_tagged; + } else if (status==recursion_dropped){ + // check for the optional angular cut + if ((_min_dR2 > 0) && (squared_geometric_distance(piece1,piece2) < _min_dR2)) + break; + + active_branches.pop(); + // tagging failed and the softest branch should be dropped + // keep track of what has een groomed away + max_njet -= piece2.constituents().size(); + elm->dropped_delta_R .push_back((elm->theta_squared >= 0) ? sqrt(elm->theta_squared) : -sqrt(elm->theta_squared)); + elm->dropped_symmetry.push_back(sym); + elm->dropped_mu .push_back((mu2>=0) ? sqrt(mu2) : -sqrt(mu2)); + + // keep the hardest bhanch in the recursion + elm->reset(piece1, this); + active_branches.push(elm); + } else if (status==recursion_no_parents){ + if (_min_dR2 > 0) break; + active_branches.pop(); + // nothing specific to do: we just keep the curent jet as a "leaf" + } else { // recursion_issue + active_branches.pop(); + // we've met an issue + // if the piece2 is null as well, it means we've had a critical problem. + // In that case, return an empty PseudoJet + if (piece2 == 0) return PseudoJet(); + + // otherwise, we should consider "piece2" as a final particle + // not to be recursed into + if (_min_dR2 > 0) break; + max_njet -= (piece2.constituents().size()-1); + break; + } + + // If the missing number of tags is exactly the number of objects + // we have left in the recursion, stop + if (n_tagged == max_njet) break; + } + + // now we have a bunch of history elements that we can use to build the final jet + vector mapped_to_history(history.size()); + unsigned int history_index = history.size(); + do { + --history_index; + const internal_recursive_softdrop::RSDHistoryElement & elm = history[history_index]; + + // two kinds of events: either just a final leave, poteitially with grooming + // or a brandhing (also with potential grooming at the end) + if (elm.child1_in_history<0){ + // this is a leaf, i.e. with no further sustructure + PseudoJet & subjet = mapped_to_history[history_index] + = cs_jets[cs_history[elm.current_in_ca_tree].jetp_index]; + + StructureType * structure = new StructureType(subjet); + if (has_verbose_structure()){ + structure->set_verbose(true); + structure->set_dropped_delta_R (elm.dropped_delta_R); + structure->set_dropped_symmetry(elm.dropped_symmetry); + structure->set_dropped_mu (elm.dropped_mu); + } + subjet.set_structure_shared_ptr(SharedPtr(structure)); + } else { + PseudoJet & subjet = mapped_to_history[history_index] + = join(mapped_to_history[elm.child1_in_history], mapped_to_history[elm.child2_in_history]); + StructureType * structure = new StructureType(subjet, sqrt(elm.theta_squared), elm.symmetry, sqrt(elm.mu2)); + if (has_verbose_structure()){ + structure->set_verbose(true); + structure->set_dropped_delta_R (elm.dropped_delta_R); + structure->set_dropped_symmetry(elm.dropped_symmetry); + structure->set_dropped_mu (elm.dropped_mu); + } + subjet.set_structure_shared_ptr(SharedPtr(structure)); + } + } while (history_index>0); + + return mapped_to_history[0]; +} + +// this routine applies the Soft Drop criterion recursively on the +// CA tree, recursing into all the branches found during the previous iteration +// until n layers have been found (or until it converges) +PseudoJet RecursiveSoftDrop::result_fixed_depth(const PseudoJet &jet) const { + // start by reclustering jet with C/A algorithm + PseudoJet ca_jet = _recluster_if_needed(jet); + + if (! ca_jet.has_valid_cluster_sequence()){ + throw Error("RecursiveSoftDrop can only be applied to jets associated to a (valid) cluster sequence"); + } + + const ClusterSequence *cs = ca_jet.validated_cluster_sequence(); + const vector &cs_history = cs->history(); + const vector &cs_jets = cs->jets(); + + // initialize counter to 1 subjet (i.e. the full ca_jet) + int n_depth = 0; + int max_njet = ca_jet.constituents().size(); + + // create the list of branches + unsigned int max_history_size = 2*max_njet; + //if ((_n>0) && (_n history; + history.reserve(max_history_size); // could be one shorter + history.push_back(internal_recursive_softdrop::RSDHistoryElement(ca_jet, this, _R0sqr)); + history.back().theta_squared = _R0sqr; + + // create a priority queue containing the subjets and a comparison definition + // initialize counter to 1 subjet (i.e. the full ca_jet) + list active_branches; + active_branches.push_back(& (history[0])); + + PseudoJet parent, piece1, piece2; + + while ((continue_grooming(n_depth)) && (active_branches.size())) { + // loop over all the branches and look for substructure + list::iterator hist_it=active_branches.begin(); + while (hist_it!=active_branches.end()){ + // get the element corresponding to the max dR + // and the associated PJ + internal_recursive_softdrop::RSDHistoryElement * elm = (*hist_it); + PseudoJet parent = cs_jets[cs_history[elm->current_in_ca_tree].jetp_index]; + + // we need to iterate this branch until we find some substructure + PseudoJet result_sd; + if (_dynamical_R0){ + SoftDrop sd(_beta, _symmetry_cut, symmetry_measure(), sqrt(elm->theta_squared), + mu_cut(), recursion_choice(), subtractor()); + sd.set_reclustering(false); + sd.set_verbose_structure(has_verbose_structure()); + result_sd = sd(parent); + } else { + result_sd = SoftDrop::result(parent); + } + + // if we had an empty PJ, that means we ran into some problems. + // just return an empty PJ ourselves + if (result_sd == 0) return PseudoJet(); + + // update the history element to reflect our iteration + elm->current_in_ca_tree = result_sd.cluster_hist_index(); + + if (has_verbose_structure()){ + elm->dropped_delta_R = result_sd.structure_of().dropped_delta_R(); + elm->dropped_symmetry = result_sd.structure_of().dropped_symmetry(); + elm->dropped_mu = result_sd.structure_of().dropped_mu(); + } + + // if some substructure was found: + if (result_sd.structure_of().has_substructure()){ + // update the history element to reflect our iteration + elm->child1_in_history = history.size(); + elm->child2_in_history = history.size()+1; + elm->theta_squared = result_sd.structure_of().delta_R(); + elm->theta_squared *= elm->theta_squared; + elm->symmetry = result_sd.structure_of().symmetry(); + elm->mu2 = result_sd.structure_of().mu(); + elm->mu2 *= elm->mu2; + + // the next iteration will have to handle 2 new history + // elements (the R0squared argument here is unused) + result_sd.has_parents(piece1, piece2); + internal_recursive_softdrop::RSDHistoryElement elm1(piece1, this, _R0sqr); + history.push_back(elm1); + // insert it in the active branches if needed + if (elm1.theta_squared>0) + active_branches.insert(hist_it,&(history.back())); // insert just before + + internal_recursive_softdrop::RSDHistoryElement elm2(piece2, this, _R0sqr); + history.push_back(elm2); + if ((!_hardest_branch_only) && (elm2.theta_squared>0)){ + active_branches.insert(hist_it,&(history.back())); // insert just before + } + } + // otherwise we've just reached the end of the recursion the + // history information has been updated above + // + // we just need to make sure that we do not recurse into that + // element any longer + + list::iterator current = hist_it; + ++hist_it; + active_branches.erase(current); + } // loop over branches at current depth + ++n_depth; + } // loop over depth + + // now we have a bunch of history elements that we can use to build the final jet + vector mapped_to_history(history.size()); + unsigned int history_index = history.size(); + do { + --history_index; + const internal_recursive_softdrop::RSDHistoryElement & elm = history[history_index]; + + // two kinds of events: either just a final leave, poteitially with grooming + // or a brandhing (also with potential grooming at the end) + if (elm.child1_in_history<0){ + // this is a leaf, i.e. with no further sustructure + PseudoJet & subjet = mapped_to_history[history_index] + = cs_jets[cs_history[elm.current_in_ca_tree].jetp_index]; + + StructureType * structure = new StructureType(subjet); + if (has_verbose_structure()){ + structure->set_verbose(true); + } + subjet.set_structure_shared_ptr(SharedPtr(structure)); + } else { + PseudoJet & subjet = mapped_to_history[history_index] + = join(mapped_to_history[elm.child1_in_history], mapped_to_history[elm.child2_in_history]); + StructureType * structure = new StructureType(subjet, sqrt(elm.theta_squared), elm.symmetry, sqrt(elm.mu2)); + if (has_verbose_structure()){ + structure->set_verbose(true); + structure->set_dropped_delta_R (elm.dropped_delta_R); + structure->set_dropped_symmetry(elm.dropped_symmetry); + structure->set_dropped_mu (elm.dropped_mu); + } + subjet.set_structure_shared_ptr(SharedPtr(structure)); + } + } while (history_index>0); + + return mapped_to_history[0]; +} + + +//======================================================================== +// implementation of the helpers +//======================================================================== + +// helper to get all the prongs in a jet that has been obtained using +// RecursiveSoftDrop (instead of recursively parsing the 1->2 +// composite jet structure) +vector recursive_soft_drop_prongs(const PseudoJet & rsd_jet){ + // make sure that the jet has the appropriate RecursiveSoftDrop structure + if (!rsd_jet.has_structure_of()) + return vector(); + + // if this jet has no substructure, just return a 1-prong object + if (!rsd_jet.structure_of().has_substructure()) + return vector(1, rsd_jet); + + // otherwise fill a vector with all the prongs (no specific ordering) + vector prongs; + + // parse the list of PseudoJet we still need to deal with + vector to_parse = rsd_jet.pieces(); // valid both for a C/A recombination step or a RSD join + unsigned int i_parse = 0; + while (i_parse()) && + (current.structure_of().has_substructure())){ + // if this has some deeper substructure, add it to the list of + // things to further process + vector pieces = current.pieces(); + assert(pieces.size() == 2); + to_parse[i_parse] = pieces[0]; + to_parse.push_back(pieces[1]); + } else { + // no further substructure, just add this as a branch + prongs.push_back(current); + ++i_parse; + } + } + + return prongs; +} + + } } + + //FASTJET_END_NAMESPACE diff --git a/src/Tools/fjcontrib/RecursiveTools/RecursiveSymmetryCutBase.cc b/src/Tools/fjcontrib/RecursiveTools/RecursiveSymmetryCutBase.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/RecursiveSymmetryCutBase.cc @@ -0,0 +1,646 @@ +// $Id: RecursiveSymmetryCutBase.cc 1080 2017-09-28 07:51:37Z gsoyez $ +// +// Copyright (c) 2014-, Gavin P. Salam, Gregory Soyez, Jesse Thaler +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include "RecursiveSymmetryCutBase.hh" +#include "fastjet/JetDefinition.hh" +#include "fastjet/ClusterSequenceAreaBase.hh" +#include +#include +#include + +using namespace std; + +//FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + //namespace contrib{ + + namespace Rivet{ + namespace fjcontrib{ + + +LimitedWarning RecursiveSymmetryCutBase::_negative_mass_warning; +LimitedWarning RecursiveSymmetryCutBase::_mu2_gt1_warning; +//LimitedWarning RecursiveSymmetryCutBase::_nonca_warning; +LimitedWarning RecursiveSymmetryCutBase::_explicit_ghost_warning; + +bool RecursiveSymmetryCutBase::_verbose = false; + +//---------------------------------------------------------------------- +PseudoJet RecursiveSymmetryCutBase::result(const PseudoJet & jet) const { + // construct the input jet (by default, recluster with C/A) + if (! jet.has_constituents()){ + throw Error("RecursiveSymmetryCutBase can only be applied to jets with constituents"); + } + + PseudoJet j = _recluster_if_needed(jet); + + // sanity check: the jet must have a valid CS + if (! j.has_valid_cluster_sequence()){ + throw Error("RecursiveSymmetryCutBase can only be applied to jets associated to a (valid) cluster sequence"); + } + + // check that area information is there in case we have a subtractor + // GS: do we really need this since subtraction may not require areas? + if (_subtractor) { + const ClusterSequenceAreaBase * csab = + dynamic_cast(j.associated_cs()); + if (csab == 0 || (!csab->has_explicit_ghosts())) + _explicit_ghost_warning.warn("RecursiveSymmetryCutBase: there is no clustering sequence, or it lacks explicit ghosts: subtraction is not guaranteed to function properly"); + } + + // establish the first subjet and optionally subtract it + PseudoJet subjet = j; + if (_subtractor && (!_input_jet_is_subtracted)) { + subjet = (*_subtractor)(subjet); + } + + // variables for tracking what will happen + PseudoJet piece1, piece2; + + // vectors for storing optional verbose structure + // these hold the deltaR, symmetry, and mu values of dropped branches + std::vector dropped_delta_R; + std::vector dropped_symmetry; + std::vector dropped_mu; + + double sym, mu2; + + // now recurse into the jet's structure + RecursionStatus status; + while ((status=recurse_one_step(subjet, piece1, piece2, sym, mu2)) != recursion_success) { + // start with sanity checks: + if ((status == recursion_issue) || (status == recursion_no_parents)) { + // we should return piece1 by our convention for recurse_one_step + PseudoJet result; + if (status == recursion_issue){ + result = piece1; + if (_verbose) cout << "reached end; returning null jet " << endl; + } else { + result = _result_no_substructure(piece1); + if (_verbose) cout << "no parents found; returning last PJ or empty jet" << endl; + } + + if (result != 0) { + // if in grooming mode, add dummy structure information + StructureType * structure = new StructureType(result); + // structure->_symmetry = 0.0; + // structure->_mu = 0.0; + // structure->_delta_R = 0.0; + if (_verbose_structure) { // still want to store verbose information about dropped branches + structure->_has_verbose = true; + structure->_dropped_symmetry = dropped_symmetry; + structure->_dropped_mu = dropped_mu; + structure->_dropped_delta_R = dropped_delta_R; + } + result.set_structure_shared_ptr(SharedPtr(structure)); + } + + return result; + } + + assert(status == recursion_dropped); + + // if desired, store information about dropped branches before recursing + if (_verbose_structure) { + dropped_delta_R.push_back(piece1.delta_R(piece2)); + dropped_symmetry.push_back(sym); + dropped_mu.push_back((mu2 >= 0) ? sqrt(mu2) : -sqrt(-mu2)); + } + + subjet = piece1; + } + + + // we've tagged the splitting, return the jet with its substructure + StructureType * structure = new StructureType(subjet); + structure->_symmetry = sym; + structure->_mu = (mu2 >= 0) ? sqrt(mu2) : -sqrt(-mu2); + structure->_delta_R = sqrt(squared_geometric_distance(piece1, piece2)); + if (_verbose_structure) { + structure->_has_verbose = true; + structure->_dropped_symmetry = dropped_symmetry; + structure->_dropped_mu = dropped_mu; + structure->_dropped_delta_R = dropped_delta_R; + } + subjet.set_structure_shared_ptr(SharedPtr(structure)); + return subjet; +} + + + +//---------------------------------------------------------------------- +// the method below is the one actually performing one step of the +// recursion. +// +// It returns a status code (defined above) +// +// In case of success, all the information is filled +// In case of "no parents", piee1 is the same subjet +// In case of trouble, piece2 will be a 0 PJ and piece1 is the PJ we +// should return (either 0 itself if the issue was critical, or +// non-wero in case of a minor issue just causing the recursion to +// stop) +RecursiveSymmetryCutBase::RecursionStatus + RecursiveSymmetryCutBase::recurse_one_step(const PseudoJet & subjet, + PseudoJet &piece1, PseudoJet &piece2, + double &sym, double &mu2, + void *extra_parameters) const { + if (!subjet.has_parents(piece1, piece2)){ + piece1 = subjet; + piece2 = PseudoJet(); + return recursion_no_parents; + } + + // first sanity check: + // - zero or negative pts are not allowed for the input subjet + // - zero or negative masses are not allowed for configurations + // in which the mass will effectively appear in a denominator + // (The masses will be checked later) + if (subjet.pt2() <= 0){ // this is a critical problem, return an empty PJ + piece1 = piece2 = PseudoJet(); + return recursion_issue; + } + + if (_subtractor) { + piece1 = (*_subtractor)(piece1); + piece2 = (*_subtractor)(piece2); + } + + // determine the symmetry parameter + if (_symmetry_measure == y) { + // the original d_{ij}/m^2 choice from MDT + // first make sure the mass is sensible + if (subjet.m2() <= 0) { + _negative_mass_warning.warn("RecursiveSymmetryCutBase: cannot calculate y, because (sub)jet mass is negative; bailing out"); + // since rounding errors can give -ve masses, be a it more + // tolerant and consider that no substructure has been found + piece1 = _result_no_substructure(subjet); + piece2 = PseudoJet(); + return recursion_issue; + } + sym = piece1.kt_distance(piece2) / subjet.m2(); + + } else if (_symmetry_measure == vector_z) { + // min(pt1, pt2)/(pt), where the denominator is a vector sum + // of the two subjets + sym = min(piece1.pt(), piece2.pt()) / subjet.pt(); + } else if (_symmetry_measure == scalar_z) { + // min(pt1, pt2)/(pt1+pt2), where the denominator is a scalar sum + // of the two subjets + double pt1 = piece1.pt(); + double pt2 = piece2.pt(); + // make sure denominator is non-zero + sym = pt1 + pt2; + if (sym == 0){ // this is a critical problem, return an empty PJ + piece1 = piece2 = PseudoJet(); + return recursion_issue; + } + sym = min(pt1, pt2) / sym; + } else if ((_symmetry_measure == theta_E) || (_symmetry_measure == cos_theta_E)){ + // min(E1, E2)/(E1+E2) + double E1 = piece1.E(); + double E2 = piece2.E(); + // make sure denominator is non-zero + sym = E1 + E2; + if (sym == 0){ // this is a critical problem, return an empty PJ + piece1 = piece2 = PseudoJet(); + return recursion_issue; + } + sym = min(E1, E2) / sym; + } else { + throw Error ("Unrecognized choice of symmetry_measure"); + } + + // determine the symmetry cut + // (This function is specified in the derived classes) + double this_symmetry_cut = symmetry_cut_fn(piece1, piece2, extra_parameters); + + // and make a first tagging decision based on symmetry cut + bool tagged = (sym > this_symmetry_cut); + + // if tagged based on symmetry cut, then check the mu cut (if relevant) + // and update the tagging decision. Calculate mu^2 regardless, for cases + // of users not cutting on mu2, but still interested in its value. + bool use_mu_cut = (_mu_cut != numeric_limits::infinity()); + mu2 = max(piece1.m2(), piece2.m2())/subjet.m2(); + if (tagged && use_mu_cut) { + // first a sanity check -- mu2 won't be sensible if the subjet mass + // is negative, so we can't then trust the mu cut - bail out + if (subjet.m2() <= 0) { + _negative_mass_warning.warn("RecursiveSymmetryCutBase: cannot trust mu, because (sub)jet mass is negative; bailing out"); + piece1 = piece2 = PseudoJet(); + return recursion_issue; + } + if (mu2 > 1) _mu2_gt1_warning.warn("RecursiveSymmetryCutBase encountered mu^2 value > 1"); + if (mu2 > pow(_mu_cut,2)) tagged = false; + } + + // we'll continue unclustering, allowing for the different + // ways of choosing which parent to look into + if (_recursion_choice == larger_pt) { + if (piece1.pt2() < piece2.pt2()) std::swap(piece1, piece2); + } else if (_recursion_choice == larger_mt) { + if (piece1.mt2() < piece2.mt2()) std::swap(piece1, piece2); + } else if (_recursion_choice == larger_m) { + if (piece1.m2() < piece2.m2()) std::swap(piece1, piece2); + } else if (_recursion_choice == larger_E) { + if (piece1.E() < piece2.E()) std::swap(piece1, piece2); + } else { + throw Error ("Unrecognized value for recursion_choice"); + } + + return tagged ? recursion_success : recursion_dropped; +} + + +//---------------------------------------------------------------------- +string RecursiveSymmetryCutBase::description() const { + ostringstream ostr; + ostr << "Recursive " << (_grooming_mode ? "Groomer" : "Tagger") << " with a symmetry cut "; + + switch(_symmetry_measure) { + case y: + ostr << "y"; break; + case scalar_z: + ostr << "scalar_z"; break; + case vector_z: + ostr << "vector_z"; break; + case theta_E: + ostr << "theta_E"; break; + case cos_theta_E: + ostr << "cos_theta_E"; break; + default: + cerr << "failed to interpret symmetry_measure" << endl; exit(-1); + } + ostr << " > " << symmetry_cut_description(); + + if (_mu_cut != numeric_limits::infinity()) { + ostr << ", mass-drop cut mu=max(m1,m2)/m < " << _mu_cut; + } else { + ostr << ", no mass-drop requirement"; + } + + ostr << ", recursion into the subjet with larger "; + switch(_recursion_choice) { + case larger_pt: + ostr << "pt"; break; + case larger_mt: + ostr << "mt(=sqrt(m^2+pt^2))"; break; + case larger_m: + ostr << "mass"; break; + case larger_E: + ostr << "energy"; break; + default: + cerr << "failed to interpret recursion_choice" << endl; exit(-1); + } + + if (_subtractor) { + ostr << ", subtractor: " << _subtractor->description(); + if (_input_jet_is_subtracted) {ostr << " (input jet is assumed already subtracted)";} + } + + if (_recluster) { + ostr << " and reclustering using " << _recluster->description(); + } + + return ostr.str(); +} + +//---------------------------------------------------------------------- +// helper for handling the reclustering +PseudoJet RecursiveSymmetryCutBase::_recluster_if_needed(const PseudoJet &jet) const{ + if (! _do_reclustering) return jet; + if (_recluster) return (*_recluster)(jet); + if (is_ee()){ +#if FASTJET_VERSION_NUMBER >= 30100 + return Recluster(JetDefinition(ee_genkt_algorithm, JetDefinition::max_allowable_R, 0.0), true)(jet); +#else + return Recluster(JetDefinition(ee_genkt_algorithm, JetDefinition::max_allowable_R, 0.0))(jet); +#endif + } + + return Recluster(cambridge_algorithm, JetDefinition::max_allowable_R)(jet); +} + +//---------------------------------------------------------------------- +// decide what to return when no substructure has been found +double RecursiveSymmetryCutBase::squared_geometric_distance(const PseudoJet &j1, + const PseudoJet &j2) const{ + if (_symmetry_measure == theta_E){ + double dot_3d = j1.px()*j2.px() + j1.py()*j2.py() + j1.pz()*j2.pz(); + double cos_theta = max(-1.0,min(1.0, dot_3d/sqrt(j1.modp2()*j2.modp2()))); + double theta = acos(cos_theta); + return theta*theta; + } else if (_symmetry_measure == cos_theta_E){ + double dot_3d = j1.px()*j2.px() + j1.py()*j2.py() + j1.pz()*j2.pz(); + return max(0.0, 2*(1-dot_3d/sqrt(j1.modp2()*j2.modp2()))); + } + + return j1.squared_distance(j2); +} + +//---------------------------------------------------------------------- +PseudoJet RecursiveSymmetryCutBase::_result_no_substructure(const PseudoJet &last_parent) const{ + if (_grooming_mode){ + // in grooming mode, return the last parent + return last_parent; + } else { + // in tagging mode, return an empty PseudoJet + return PseudoJet(); + } +} + + +//======================================================================== +// implementation of the details of the structure + +// the number of dropped subjets +int RecursiveSymmetryCutBase::StructureType::dropped_count(bool global) const { + check_verbose("dropped_count()"); + + // if this jet has no substructure, just return an empty vector + if (!has_substructure()) return _dropped_delta_R.size(); + + // deal with the non-global case + if (!global) return _dropped_delta_R.size(); + + // for the global case, we've unfolded the recursion (likely more + // efficient as it requires less copying) + unsigned int count = 0; + vector to_parse; + to_parse.push_back(this); + + unsigned int i_parse = 0; + while (i_parse_dropped_delta_R.size(); + + // check if we need to recurse deeper in the substructure + // + // we can have 2 situations here for the underlying structure (the + // one we've wrapped around): + // - it's of the clustering type + // - it's a composite jet + // only in the 2nd case do we have to recurse deeper + const CompositeJetStructure *css = dynamic_cast(current->_structure.get()); + if (css == 0){ ++i_parse; continue; } + + vector prongs = css->pieces(PseudoJet()); // argument irrelevant + assert(prongs.size() == 2); + for (unsigned int i_prong=0; i_prong<2; ++i_prong){ + if (prongs[i_prong].has_structure_of()){ + RecursiveSymmetryCutBase::StructureType* prong_structure + = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr(); + if (prong_structure->has_substructure()) + to_parse.push_back(prong_structure); + } + } + + ++i_parse; + } + return count; +} + +// the delta_R of all the dropped subjets +vector RecursiveSymmetryCutBase::StructureType::dropped_delta_R(bool global) const { + check_verbose("dropped_delta_R()"); + + // if this jet has no substructure, just return an empty vector + if (!has_substructure()) return vector(); + + // deal with the non-global case + if (!global) return _dropped_delta_R; + + // for the global case, we've unfolded the recursion (likely more + // efficient as it requires less copying) + vector all_dropped; + vector to_parse; + to_parse.push_back(this); + + unsigned int i_parse = 0; + while (i_parse_dropped_delta_R.begin(), current->_dropped_delta_R.end()); + + // check if we need to recurse deeper in the substructure + // + // we can have 2 situations here for the underlying structure (the + // one we've wrapped around): + // - it's of the clustering type + // - it's a composite jet + // only in the 2nd case do we have to recurse deeper + const CompositeJetStructure *css = dynamic_cast(current->_structure.get()); + if (css == 0){ ++i_parse; continue; } + + vector prongs = css->pieces(PseudoJet()); // argument irrelevant + assert(prongs.size() == 2); + for (unsigned int i_prong=0; i_prong<2; ++i_prong){ + if (prongs[i_prong].has_structure_of()){ + RecursiveSymmetryCutBase::StructureType* prong_structure + = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr(); + if (prong_structure->has_substructure()) + to_parse.push_back(prong_structure); + } + } + + ++i_parse; + } + return all_dropped; +} + +// the symmetry of all the dropped subjets +vector RecursiveSymmetryCutBase::StructureType::dropped_symmetry(bool global) const { + check_verbose("dropped_symmetry()"); + + // if this jet has no substructure, just return an empty vector + if (!has_substructure()) return vector(); + + // deal with the non-global case + if (!global) return _dropped_symmetry; + + // for the global case, we've unfolded the recursion (likely more + // efficient as it requires less copying) + vector all_dropped; + vector to_parse; + to_parse.push_back(this); + + unsigned int i_parse = 0; + while (i_parse_dropped_symmetry.begin(), current->_dropped_symmetry.end()); + + // check if we need to recurse deeper in the substructure + // + // we can have 2 situations here for the underlying structure (the + // one we've wrapped around): + // - it's of the clustering type + // - it's a composite jet + // only in the 2nd case do we have to recurse deeper + const CompositeJetStructure *css = dynamic_cast(current->_structure.get()); + if (css == 0){ ++i_parse; continue; } + + vector prongs = css->pieces(PseudoJet()); // argument irrelevant + assert(prongs.size() == 2); + for (unsigned int i_prong=0; i_prong<2; ++i_prong){ + if (prongs[i_prong].has_structure_of()){ + RecursiveSymmetryCutBase::StructureType* prong_structure + = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr(); + if (prong_structure->has_substructure()) + to_parse.push_back(prong_structure); + } + } + + ++i_parse; + } + return all_dropped; +} + +// the mu of all the dropped subjets +vector RecursiveSymmetryCutBase::StructureType::dropped_mu(bool global) const { + check_verbose("dropped_mu()"); + + // if this jet has no substructure, just return an empty vector + if (!has_substructure()) return vector(); + + // deal with the non-global case + if (!global) return _dropped_mu; + + // for the global case, we've unfolded the recursion (likely more + // efficient as it requires less copying) + vector all_dropped; + vector to_parse; + to_parse.push_back(this); + + unsigned int i_parse = 0; + while (i_parse_dropped_mu.begin(), current->_dropped_mu.end()); + + // check if we need to recurse deeper in the substructure + // + // we can have 2 situations here for the underlying structure (the + // one we've wrapped around): + // - it's of the clustering type + // - it's a composite jet + // only in the 2nd case do we have to recurse deeper + const CompositeJetStructure *css = dynamic_cast(current->_structure.get()); + if (css == 0){ ++i_parse; continue; } + + vector prongs = css->pieces(PseudoJet()); // argument irrelevant + assert(prongs.size() == 2); + for (unsigned int i_prong=0; i_prong<2; ++i_prong){ + if (prongs[i_prong].has_structure_of()){ + RecursiveSymmetryCutBase::StructureType* prong_structure + = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr(); + if (prong_structure->has_substructure()) + to_parse.push_back(prong_structure); + } + } + + ++i_parse; + } + return all_dropped; +} + +// the maximum of the symmetry over the dropped subjets +double RecursiveSymmetryCutBase::StructureType::max_dropped_symmetry(bool global) const { + check_verbose("max_dropped_symmetry()"); + + // if there is no substructure, just exit + if (!has_substructure()){ return 0.0; } + + // local value of the max_dropped_symmetry + double local_max = (_dropped_symmetry.size() == 0) + ? 0.0 : *max_element(_dropped_symmetry.begin(),_dropped_symmetry.end()); + + // recurse down the structure if instructed to do so + if (global){ + // we can have 2 situations here for the underlying structure (the + // one we've wrapped around): + // - it's of the clustering type + // - it's a composite jet + // only in the 2nd case do we have to recurse deeper + const CompositeJetStructure *css = dynamic_cast(_structure.get()); + if (css == 0) return local_max; + + vector prongs = css->pieces(PseudoJet()); // argument irrelevant + assert(prongs.size() == 2); + for (unsigned int i_prong=0; i_prong<2; ++i_prong){ + // check if the prong has further substructure + if (prongs[i_prong].has_structure_of()){ + RecursiveSymmetryCutBase::StructureType* prong_structure + = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr(); + local_max = max(local_max, prong_structure->max_dropped_symmetry(true)); + } + } + } + + return local_max; +} + +//------------------------------------------------------------------------ +// helper class to sort by decreasing thetag +class SortRecursiveSoftDropStructureZgThetagPair{ +public: + bool operator()(const pair &p1, const pair &p2) const{ + return p1.second > p2.second; + } +}; +//------------------------------------------------------------------------ + +// the (zg,thetag) pairs of all the splitting that were found and passed the SD condition +vector > RecursiveSymmetryCutBase::StructureType::sorted_zg_and_thetag() const { + //check_verbose("sorted_zg_and_thetag()"); + + // if this jet has no substructure, just return an empty vector + if (!has_substructure()) return vector >(); + + // otherwise fill a vector with all the prongs (no specific ordering) + vector > all; + vector to_parse; + to_parse.push_back(this); + + unsigned int i_parse = 0; + while (i_parse(current->_symmetry, current->_delta_R)); + + vector prongs = current->pieces(PseudoJet()); + assert(prongs.size() == 2); + for (unsigned int i_prong=0; i_prong<2; ++i_prong){ + if (prongs[i_prong].has_structure_of()){ + RecursiveSymmetryCutBase::StructureType* prong_structure + = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr(); + if (prong_structure->has_substructure()) + to_parse.push_back(prong_structure); + } + } + + ++i_parse; + } + + sort(all.begin(), all.end(), SortRecursiveSoftDropStructureZgThetagPair()); + return all; +} + + } } // namespace contrib + + //FASTJET_END_NAMESPACE diff --git a/src/Tools/fjcontrib/RecursiveTools/SoftDrop.cc b/src/Tools/fjcontrib/RecursiveTools/SoftDrop.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/SoftDrop.cc @@ -0,0 +1,78 @@ +// $Id: SoftDrop.cc 1059 2017-09-07 20:48:00Z gsoyez $ +// +// Copyright (c) 2014-, Gregory Soyez, Jesse. Thaler +// based on arXiv:1402.2657 by Andrew J. Larkoski, Simone Marzani, +// Gregory Soyez, Jesse Thaler +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include "SoftDrop.hh" +#include +#include + +using namespace std; + +//FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + + //namespace contrib{ + + namespace Rivet{ + namespace fjcontrib{ + + +//---------------------------------------------------------------------- +// TODO: +// +// - implement reclustering (at the moment we assume it's C/A as for mMDT +// +// - what is returned if no substructure is found? [and for negativeve +// pt, m2 or other situations where mMDT currentlty returns an empty +// PseudoJet] +// +// GS.: mMDT seeks substructure so it makes sense for it to return +// an empry PseudoJet when no substructure is found (+ it is the +// original behaviour). For SoftDrop, in grooming mode (beta>0), if +// would make sense to return a jet with a single particle. In +// tagging mode (beta<0), the situation is less clear. At the level +// of the implementation, having a virtual function could work +// (with a bit of care to cover the -ve pt or m2 cases) +// +// - Do we include Andrew and Simone in the "contrib-author" list +// since they are on the paper? Do we include Gavin in the author's +// list since he started this contrib? +// +//---------------------------------------------------------------------- + +//---------------------------------------------------------------------- +double SoftDrop::symmetry_cut_fn(const PseudoJet & p1, + const PseudoJet & p2, + void *optional_R0sqr_ptr) const{ + double R0sqr = (optional_R0sqr_ptr == 0) ? _R0sqr : *((double*) optional_R0sqr_ptr); + return _symmetry_cut * pow(squared_geometric_distance(p1,p2)/R0sqr, 0.5*_beta); +} + +//---------------------------------------------------------------------- +string SoftDrop::symmetry_cut_description() const { + ostringstream ostr; + ostr << _symmetry_cut << " (theta/" << sqrt(_R0sqr) << ")^" << _beta << " [SoftDrop]"; + return ostr.str(); +} + + } } // namespace contrib + +//FASTJET_END_NAMESPACE diff --git a/src/Tools/fjcontrib/RecursiveTools/TODO b/src/Tools/fjcontrib/RecursiveTools/TODO new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/TODO @@ -0,0 +1,26 @@ +For v2.0 +-------- + +- CHECK: lines 100-102 of RecursiveSymmetryCutBase.hh: this was + initially setting the structure members to 0. I think it's highly + preferable to set them to their default of -1, signalling the + absence of substructure. [0 dR might happen with a perfectly + collinear splitting] + +- CHECK: are we happy with how the structure info is stored and the + recursive_soft_drop_prongs(...) function in RecursiveSoftDrop.hh? + +- QUESTION: do we move set_min_deltaR_squared in the base class? + +- Add option to define z wrt to original jet? + +For future releases? +-------------------- +- JDT: In Recluster, change "single" to an enum for user clarity? + [do we have any other option that "sungle" or "subjets"] +- JDT: Should we have a FASTJET_CONTRIB_BEGIN_NAMESPACE? It would + help those of us who use XCode to edit, which is aggressive about + auto-indenting. [Consider this for the full contrib??] +- More generic kinematic cuts? +- KZ: common base class for IteratedSoftDrop and RecursiveSoftDrop? +- KZ: make IteratedSoftDrop use Recluster \ No newline at end of file diff --git a/src/Tools/fjcontrib/RecursiveTools/VERSION b/src/Tools/fjcontrib/RecursiveTools/VERSION new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/VERSION @@ -0,0 +1,1 @@ +2.0.0-beta2 diff --git a/src/Tools/fjcontrib/RecursiveTools/example_advanced_usage.cc b/src/Tools/fjcontrib/RecursiveTools/example_advanced_usage.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_advanced_usage.cc @@ -0,0 +1,362 @@ +//---------------------------------------------------------------------- +/// \file example_advanced_usage.cc +/// +/// This example program is meant to illustrate some advanced features +/// of the fastjet::contrib::SoftDrop class is used. +/// +/// Run this example with +/// +/// \verbatim +/// ./example_advanced_usage < ../data/single-event.dat +/// \endverbatim +//---------------------------------------------------------------------- + +// $Id: example_advanced_usage.cc 1016 2017-04-20 16:51:52Z knzhou $ +// +// Copyright (c) 2014, Gavin P. Salam +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include +#include + +#include +#include +#include +#include "fastjet/ClusterSequence.hh" +#include "SoftDrop.hh" // In external code, this should be fastjet/contrib/SoftDrop.hh + +#define MY_INF std::numeric_limits::infinity() + +using namespace std; +using namespace fastjet; +using namespace fastjet::contrib; + +// forward declaration to make things clearer +void read_event(vector &event); +ostream & operator<<(ostream &, const PseudoJet &); + +// Simple class to store SoftDrop objects along with display information +class SoftDropStruct { + +private: + string _name; + double _beta; + double _z_cut; + SoftDrop::SymmetryMeasure _symmetry_measure; + double _R0; + double _mu; //mass drop + SoftDrop::RecursionChoice _recursion_choice; + JetAlgorithm _recluster_algorithm; + bool _tagging_mode; + SoftDrop _soft_drop; + Recluster _reclusterer; + +public: + SoftDropStruct(string name, + double beta, + double z_cut, + SoftDrop::SymmetryMeasure symmetry_measure, + double R0, + double mu, + SoftDrop::RecursionChoice recursion_choice, + JetAlgorithm recluster_algorithm, + bool tagging_mode = false) + : _name(name), + _beta(beta), + _z_cut(z_cut), + _symmetry_measure(symmetry_measure), + _R0(R0), + _mu(mu), + _recursion_choice(recursion_choice), + _recluster_algorithm(recluster_algorithm), + _tagging_mode(tagging_mode), + _soft_drop(beta,z_cut,symmetry_measure,R0,mu,recursion_choice), + _reclusterer(recluster_algorithm,JetDefinition::max_allowable_R) + { + // no need to recluser if already CA algorithm + if (recluster_algorithm != cambridge_algorithm) { + _soft_drop.set_reclustering(true,&_reclusterer); + } + + // if beta is negative, typically want to use in tagging mode + // MMDT behavior is also tagging mode + // set this option here + if (tagging_mode) { + _soft_drop.set_tagging_mode(); + } + + //turn verbose structure on (off by default) + _soft_drop.set_verbose_structure(); + } + + const SoftDrop& soft_drop() const { return _soft_drop;} + string name() const { return _name;} + double beta() const { return _beta;} + double z_cut() const { return _z_cut;} + string symmetry_measure_name() const { + switch (_symmetry_measure) { + case SoftDrop::scalar_z: + return "scalar_z"; + case SoftDrop::vector_z: + return "vector_z"; + case SoftDrop::y: + return "y"; + default: + return "unknown"; + } + } + double R0() const { return _R0;} + double mu() const { return _mu;} + + string recursion_choice_name() const { + switch (_recursion_choice) { + case SoftDrop::larger_pt: + return "larger_pt"; + case SoftDrop::larger_mt: + return "larger_mt"; + case SoftDrop::larger_m: + return "larger_m"; + default: + return "unknown"; + } + } + + string reclustering_name() const { + switch (_recluster_algorithm) { + case kt_algorithm: + return "KT"; + case cambridge_algorithm: + return "CA"; + default: + return "unknown"; + } + } + + string tag_or_groom() const { + return (_tagging_mode ? "tag" : "groom"); + } + +}; + + +//---------------------------------------------------------------------- +int main(){ + + //---------------------------------------------------------- + // read in input particles + vector event; + read_event(event); + cout << "# read an event with " << event.size() << " particles" << endl; + + // first get some anti-kt jets + double R = 1.0, ptmin = 20.0; + JetDefinition jet_def(antikt_algorithm, R); + ClusterSequence cs(event, jet_def); + vector jets = sorted_by_pt(cs.inclusive_jets(ptmin)); + + + //---------------------------------------------------------- + // Make vector of structs to store a bunch of different SoftDrop options + // This is a vector of pointers because SoftDropStruct doesn't + // have a valid copy constructor + vector sd_vec; + + // make some standard SoftDrop + sd_vec.push_back(new SoftDropStruct("beta=2.0 zcut=.1", 2.0,0.10,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("beta=1.0 zcut=.1", 1.0,0.10,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("beta=0.5 zcut=.1", 0.5,0.10,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("beta=2.0 zcut=.2", 2.0,0.20,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("beta=1.0 zcut=.2", 1.0,0.20,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("beta=0.5 zcut=.2", 0.5,0.20,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + + // make a mMDT-like tagger using SoftDrop + sd_vec.push_back(new SoftDropStruct("MMDT-like zcut=.1", 0.0,0.10,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm,true)); + sd_vec.push_back(new SoftDropStruct("MMDT-like zcut=.2", 0.0,0.20,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm,true)); + sd_vec.push_back(new SoftDropStruct("MMDT-like zcut=.3", 0.0,0.30,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm,true)); + sd_vec.push_back(new SoftDropStruct("MMDT-like zcut=.4", 0.0,0.40,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm,true)); + + // make some tagging SoftDrop (negative beta) + sd_vec.push_back(new SoftDropStruct("beta=-2.0 zcut=.05", -2.0,0.05,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm,true)); + sd_vec.push_back(new SoftDropStruct("beta=-1.0 zcut=.05", -1.0,0.05,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm,true)); + sd_vec.push_back(new SoftDropStruct("beta=-0.5 zcut=.05", -0.5,0.05,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm,true)); + + // make a SoftDrop with R0 parameter + sd_vec.push_back(new SoftDropStruct("b=.5 z=.3 R0=1.0", 0.5,0.30,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=.5 z=.3 R0=0.5", 0.5,0.30,SoftDrop::scalar_z,0.5,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=.5 z=.3 R0=0.2", 0.5,0.30,SoftDrop::scalar_z,0.2,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + + // make a SoftDrop with different symmetry measure + sd_vec.push_back(new SoftDropStruct("b=2 z=.4 scalar_z", 2.0,0.4,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=2 z=.4 vector_z", 2.0,0.4,SoftDrop::vector_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=2 z=.4 y", 2.0,0.4,SoftDrop::y, 1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + + // make a SoftDrop with different recursion choice + sd_vec.push_back(new SoftDropStruct("b=3 z=.2 larger_pt", 3.0,0.20,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=3 z=.2 larger_mt", 3.0,0.20,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_mt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=3 z=.2 larger_m", 3.0,0.20,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_m,cambridge_algorithm)); + + // make a SoftDrop with mass drop + sd_vec.push_back(new SoftDropStruct("b=2 z=.1 mu=1.0", 2.0,0.10,SoftDrop::scalar_z,1.0,1.0,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=2 z=.1 mu=0.8", 2.0,0.10,SoftDrop::scalar_z,1.0,0.8,SoftDrop::larger_pt,cambridge_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=2 z=.1 mu=0.5", 2.0,0.10,SoftDrop::scalar_z,1.0,0.5,SoftDrop::larger_pt,cambridge_algorithm)); + + // make a SoftDrop with a different clustering scheme (kT instead of default CA) + sd_vec.push_back(new SoftDropStruct("b=2.0 z=.2 kT", 2.0,0.20,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,kt_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=1.0 z=.2 kT", 1.0,0.20,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,kt_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=0.5 z=.2 kT", 0.5,0.20,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,kt_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=2.0 z=.4 kT", 2.0,0.40,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,kt_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=1.0 z=.4 kT", 1.0,0.40,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,kt_algorithm)); + sd_vec.push_back(new SoftDropStruct("b=0.5 z=.4 kT", 0.5,0.40,SoftDrop::scalar_z,1.0,MY_INF,SoftDrop::larger_pt,kt_algorithm)); + + //---------------------------------------------------------- + // Output information about the various Soft Drop algorithms + + + // header lines + cout << "---------------------------------------------------------------------------------------------" << endl; + cout << "Soft Drops to be tested:" << endl; + cout << "---------------------------------------------------------------------------------------------" << endl; + cout << std::setw(18) << "name" + << std::setw(8) << "beta" + << std::setw(8) << "z_cut" + << std::setw(9) << "sym" + << std::setw(8) << "R0" + << std::setw(8) << "mu" + << std::setw(10)<< "recurse" + << std::setw(8) << "reclust" + << std::setw(8) << "mode" + << endl; + + // set precision for display + cout << setprecision(3) << fixed; + + // line for each SoftDrop + for (unsigned i_sd = 0; i_sd < sd_vec.size(); i_sd++) { + cout << std::setw(18) << sd_vec[i_sd]->name() + << std::setw(8) << sd_vec[i_sd]->beta() + << std::setw(8) << sd_vec[i_sd]->z_cut() + << std::setw(9) << sd_vec[i_sd]->symmetry_measure_name() + << std::setw(8) << sd_vec[i_sd]->R0() + << std::setw(8) << sd_vec[i_sd]->mu() + << std::setw(10)<< sd_vec[i_sd]->recursion_choice_name() + << std::setw(8) << sd_vec[i_sd]->reclustering_name() + << std::setw(8) << sd_vec[i_sd]->tag_or_groom() + << endl; + } + cout << "---------------------------------------------------------------------------------------------" << endl; + + + + for (unsigned ijet = 0; ijet < jets.size(); ijet++) { + + cout << "---------------------------------------------------------------------------------------------" << endl; + cout << "Analyzing Jet " << ijet + 1 << ":" << endl; + cout << "---------------------------------------------------------------------------------------------" << endl; + + cout << std::setw(18) << "name" + << std::setw(10) << "pt" + << std::setw(9) << "m" + << std::setw(8) << "y" + << std::setw(8) << "phi" + << std::setw(8) << "constit" + << std::setw(8) << "delta_R" + << std::setw(8) << "sym" + << std::setw(8) << "mu" + << std::setw(8) << "mxdropz" // max_dropped_z from verbose logging + + << endl; + + PseudoJet original_jet = jets[ijet]; + + // set precision for display + cout << setprecision(4) << fixed; + + cout << std::setw(18) << "Original Jet" + << std::setw(10) << original_jet.pt() + << std::setw(9) << original_jet.m() + << std::setw(8) << original_jet.rap() + << std::setw(8) << original_jet.phi() + << std::setw(8) << original_jet.constituents().size() + << endl; + + for (unsigned i_sd = 0; i_sd < sd_vec.size(); i_sd++) { + // the current Soft Drop + const SoftDrop & sd = (*sd_vec[i_sd]).soft_drop(); + PseudoJet sd_jet = sd(jets[ijet]); + + cout << std::setw(18) << sd_vec[i_sd]->name(); + if (sd_jet != 0.0) { + cout << std::setw(10) << sd_jet.pt() + << std::setw(9) << sd_jet.m() + << std::setw(8) << sd_jet.rap() + << std::setw(8) << sd_jet.phi() + << std::setw(8) << sd_jet.constituents().size() + << std::setw(8) << sd_jet.structure_of().delta_R() + << std::setw(8) << sd_jet.structure_of().symmetry() + << std::setw(8) << sd_jet.structure_of().mu() + // the next line is part of the verbose information that is off by default + << std::setw(8) << sd_jet.structure_of().max_dropped_symmetry(); + } else { + cout << " ---- untagged jet ----"; + } + cout << endl; + + } + } + + // clean up + for (unsigned i_sd = 0; i_sd < sd_vec.size(); i_sd++) { + delete sd_vec[i_sd]; + } + + return 0; +} + +//---------------------------------------------------------------------- +/// read in input particles +void read_event(vector &event){ + string line; + while (getline(cin, line)) { + istringstream linestream(line); + // take substrings to avoid problems when there are extra "pollution" + // characters (e.g. line-feed). + if (line.substr(0,4) == "#END") {return;} + if (line.substr(0,1) == "#") {continue;} + double px,py,pz,E; + linestream >> px >> py >> pz >> E; + PseudoJet particle(px,py,pz,E); + + // push event onto back of full_event vector + event.push_back(particle); + } +} + +//---------------------------------------------------------------------- +/// overloaded jet info output +ostream & operator<<(ostream & ostr, const PseudoJet & jet) { + if (jet == 0) { + ostr << " 0 "; + } else { + ostr << " pt = " << jet.pt() + << " m = " << jet.m() + << " y = " << jet.rap() + << " phi = " << jet.phi(); + } + return ostr; +} diff --git a/src/Tools/fjcontrib/RecursiveTools/example_advanced_usage.ref b/src/Tools/fjcontrib/RecursiveTools/example_advanced_usage.ref new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_advanced_usage.ref @@ -0,0 +1,144 @@ +--------------------------------------------------------------------------------------------- +Soft Drops to be tested: +--------------------------------------------------------------------------------------------- + name beta z_cut sym R0 mu recurse reclust mode + beta=2.0 zcut=.1 2.000 0.100 scalar_z 1.000 inf larger_pt CA groom + beta=1.0 zcut=.1 1.000 0.100 scalar_z 1.000 inf larger_pt CA groom + beta=0.5 zcut=.1 0.500 0.100 scalar_z 1.000 inf larger_pt CA groom + beta=2.0 zcut=.2 2.000 0.200 scalar_z 1.000 inf larger_pt CA groom + beta=1.0 zcut=.2 1.000 0.200 scalar_z 1.000 inf larger_pt CA groom + beta=0.5 zcut=.2 0.500 0.200 scalar_z 1.000 inf larger_pt CA groom + MMDT-like zcut=.1 0.000 0.100 scalar_z 1.000 inf larger_pt CA tag + MMDT-like zcut=.2 0.000 0.200 scalar_z 1.000 inf larger_pt CA tag + MMDT-like zcut=.3 0.000 0.300 scalar_z 1.000 inf larger_pt CA tag + MMDT-like zcut=.4 0.000 0.400 scalar_z 1.000 inf larger_pt CA tag +beta=-2.0 zcut=.05 -2.000 0.050 scalar_z 1.000 inf larger_pt CA tag +beta=-1.0 zcut=.05 -1.000 0.050 scalar_z 1.000 inf larger_pt CA tag +beta=-0.5 zcut=.05 -0.500 0.050 scalar_z 1.000 inf larger_pt CA tag + b=.5 z=.3 R0=1.0 0.500 0.300 scalar_z 1.000 inf larger_pt CA groom + b=.5 z=.3 R0=0.5 0.500 0.300 scalar_z 0.500 inf larger_pt CA groom + b=.5 z=.3 R0=0.2 0.500 0.300 scalar_z 0.200 inf larger_pt CA groom + b=2 z=.4 scalar_z 2.000 0.400 scalar_z 1.000 inf larger_pt CA groom + b=2 z=.4 vector_z 2.000 0.400 vector_z 1.000 inf larger_pt CA groom + b=2 z=.4 y 2.000 0.400 y 1.000 inf larger_pt CA groom +b=3 z=.2 larger_pt 3.000 0.200 scalar_z 1.000 inf larger_pt CA groom +b=3 z=.2 larger_mt 3.000 0.200 scalar_z 1.000 inf larger_mt CA groom + b=3 z=.2 larger_m 3.000 0.200 scalar_z 1.000 inf larger_m CA groom + b=2 z=.1 mu=1.0 2.000 0.100 scalar_z 1.000 1.000 larger_pt CA groom + b=2 z=.1 mu=0.8 2.000 0.100 scalar_z 1.000 0.800 larger_pt CA groom + b=2 z=.1 mu=0.5 2.000 0.100 scalar_z 1.000 0.500 larger_pt CA groom + b=2.0 z=.2 kT 2.000 0.200 scalar_z 1.000 inf larger_pt KT groom + b=1.0 z=.2 kT 1.000 0.200 scalar_z 1.000 inf larger_pt KT groom + b=0.5 z=.2 kT 0.500 0.200 scalar_z 1.000 inf larger_pt KT groom + b=2.0 z=.4 kT 2.000 0.400 scalar_z 1.000 inf larger_pt KT groom + b=1.0 z=.4 kT 1.000 0.400 scalar_z 1.000 inf larger_pt KT groom + b=0.5 z=.4 kT 0.500 0.400 scalar_z 1.000 inf larger_pt KT groom +--------------------------------------------------------------------------------------------- +--------------------------------------------------------------------------------------------- +Analyzing Jet 1: +--------------------------------------------------------------------------------------------- + name pt m y phi constit delta_R sym mu mxdropz + Original Jet 983.3873 39.9912 -0.8673 2.9051 35 + beta=2.0 zcut=.1 980.4398 27.1382 -0.8675 2.9053 25 0.2092 0.0047 0.8353 0.0014 + beta=1.0 zcut=.1 971.5229 20.8426 -0.8686 2.9051 22 0.0954 0.0294 0.5476 0.0047 + beta=0.5 zcut=.1 933.8859 9.9073 -0.8697 2.9075 13 0.0217 0.0174 0.8786 0.0294 + beta=2.0 zcut=.2 975.8387 22.6675 -0.8684 2.9057 23 0.1316 0.0045 0.9195 0.0047 + beta=1.0 zcut=.2 971.5229 20.8426 -0.8686 2.9051 22 0.0954 0.0294 0.5476 0.0047 + beta=0.5 zcut=.2 917.6736 8.7048 -0.8696 2.9079 12 0.0200 0.1543 0.5576 0.0294 + MMDT-like zcut=.1 917.6736 8.7048 -0.8696 2.9079 12 0.0200 0.1543 0.5576 0.0294 + MMDT-like zcut=.2 669.6354 1.9839 -0.8677 2.9075 4 0.0044 0.2031 0.7051 0.1543 + MMDT-like zcut=.3 446.5813 1.0182 -0.8678 2.9069 2 0.0030 0.4251 0.4848 0.2031 + MMDT-like zcut=.4 446.5813 1.0182 -0.8678 2.9069 2 0.0030 0.4251 0.4848 0.2031 +beta=-2.0 zcut=.05 ---- untagged jet ---- +beta=-1.0 zcut=.05 ---- untagged jet ---- +beta=-0.5 zcut=.05 ---- untagged jet ---- + b=.5 z=.3 R0=1.0 917.6736 8.7048 -0.8696 2.9079 12 0.0200 0.1543 0.5576 0.0294 + b=.5 z=.3 R0=0.5 917.6736 8.7048 -0.8696 2.9079 12 0.0200 0.1543 0.5576 0.0294 + b=.5 z=.3 R0=0.2 917.6736 8.7048 -0.8696 2.9079 12 0.0200 0.1543 0.5576 0.0294 + b=2 z=.4 scalar_z 971.5229 20.8426 -0.8686 2.9051 22 0.0954 0.0294 0.5476 0.0047 + b=2 z=.4 vector_z 971.5229 20.8426 -0.8686 2.9051 22 0.0954 0.0294 0.5476 0.0047 + b=2 z=.4 y 971.5229 20.8426 -0.8686 2.9051 22 0.0954 0.0171 0.5476 0.0013 +b=3 z=.2 larger_pt 980.4398 27.1382 -0.8675 2.9053 25 0.2092 0.0047 0.8353 0.0014 +b=3 z=.2 larger_mt 980.4398 27.1382 -0.8675 2.9053 25 0.2092 0.0047 0.8353 0.0014 + b=3 z=.2 larger_m 980.4398 27.1382 -0.8675 2.9053 25 0.2092 0.0047 0.8353 0.0014 + b=2 z=.1 mu=1.0 980.4398 27.1382 -0.8675 2.9053 25 0.2092 0.0047 0.8353 0.0014 + b=2 z=.1 mu=0.8 971.5229 20.8426 -0.8686 2.9051 22 0.0954 0.0294 0.5476 0.0047 + b=2 z=.1 mu=0.5 446.5813 1.0182 -0.8678 2.9069 2 0.0030 0.4251 0.4848 0.2031 + b=2.0 z=.2 kT 983.3873 39.9912 -0.8673 2.9051 35 0.1119 0.0377 0.5030 0.0000 + b=1.0 z=.2 kT 983.3873 39.9912 -0.8673 2.9051 35 0.1119 0.0377 0.5030 0.0000 + b=0.5 z=.2 kT 946.4934 20.1170 -0.8699 2.9084 21 0.0233 0.1579 0.5951 0.0377 + b=2.0 z=.4 kT 983.3873 39.9912 -0.8673 2.9051 35 0.1119 0.0377 0.5030 0.0000 + b=1.0 z=.4 kT 946.4934 20.1170 -0.8699 2.9084 21 0.0233 0.1579 0.5951 0.0377 + b=0.5 z=.4 kT 946.4934 20.1170 -0.8699 2.9084 21 0.0233 0.1579 0.5951 0.0377 +--------------------------------------------------------------------------------------------- +Analyzing Jet 2: +--------------------------------------------------------------------------------------------- + name pt m y phi constit delta_R sym mu mxdropz + Original Jet 908.0979 87.7124 0.2195 6.0349 47 + beta=2.0 zcut=.1 887.9353 11.3171 0.2232 6.0303 15 0.1116 0.0044 0.7910 0.0104 + beta=1.0 zcut=.1 884.0262 8.9520 0.2228 6.0306 14 0.0570 0.0067 0.8862 0.0104 + beta=0.5 zcut=.1 872.2856 7.0426 0.2230 6.0308 12 0.0346 0.0232 0.7445 0.0104 + beta=2.0 zcut=.2 887.9353 11.3171 0.2232 6.0303 15 0.1116 0.0044 0.7910 0.0104 + beta=1.0 zcut=.2 872.2856 7.0426 0.2230 6.0308 12 0.0346 0.0232 0.7445 0.0104 + beta=0.5 zcut=.2 852.0552 5.2435 0.2230 6.0300 10 0.0154 0.0608 0.7701 0.0232 + MMDT-like zcut=.1 800.2694 4.0381 0.2230 6.0310 9 0.0101 0.2350 0.2291 0.0608 + MMDT-like zcut=.2 800.2694 4.0381 0.2230 6.0310 9 0.0101 0.2350 0.2291 0.0608 + MMDT-like zcut=.3 ---- untagged jet ---- + MMDT-like zcut=.4 ---- untagged jet ---- +beta=-2.0 zcut=.05 ---- untagged jet ---- +beta=-1.0 zcut=.05 ---- untagged jet ---- +beta=-0.5 zcut=.05 ---- untagged jet ---- + b=.5 z=.3 R0=1.0 852.0552 5.2435 0.2230 6.0300 10 0.0154 0.0608 0.7701 0.0232 + b=.5 z=.3 R0=0.5 852.0552 5.2435 0.2230 6.0300 10 0.0154 0.0608 0.7701 0.0232 + b=.5 z=.3 R0=0.2 800.2694 4.0381 0.2230 6.0310 9 0.0101 0.2350 0.2291 0.0608 + b=2 z=.4 scalar_z 884.0262 8.9520 0.2228 6.0306 14 0.0570 0.0067 0.8862 0.0104 + b=2 z=.4 vector_z 884.0262 8.9520 0.2228 6.0306 14 0.0570 0.0067 0.8862 0.0104 + b=2 z=.4 y 884.0262 8.9520 0.2228 6.0306 14 0.0570 0.0014 0.8862 0.0050 +b=3 z=.2 larger_pt 887.9353 11.3171 0.2232 6.0303 15 0.1116 0.0044 0.7910 0.0104 +b=3 z=.2 larger_mt 887.9353 11.3171 0.2232 6.0303 15 0.1116 0.0044 0.7910 0.0104 + b=3 z=.2 larger_m 887.9353 11.3171 0.2232 6.0303 15 0.1116 0.0044 0.7910 0.0104 + b=2 z=.1 mu=1.0 887.9353 11.3171 0.2232 6.0303 15 0.1116 0.0044 0.7910 0.0104 + b=2 z=.1 mu=0.8 887.9353 11.3171 0.2232 6.0303 15 0.1116 0.0044 0.7910 0.0104 + b=2 z=.1 mu=0.5 800.2694 4.0381 0.2230 6.0310 9 0.0101 0.2350 0.2291 0.0608 + b=2.0 z=.2 kT 900.1551 59.2173 0.2190 6.0292 31 0.0176 0.2314 0.8689 0.0104 + b=1.0 z=.2 kT 900.1551 59.2173 0.2190 6.0292 31 0.0176 0.2314 0.8689 0.0104 + b=0.5 z=.2 kT 900.1551 59.2173 0.2190 6.0292 31 0.0176 0.2314 0.8689 0.0104 + b=2.0 z=.4 kT 900.1551 59.2173 0.2190 6.0292 31 0.0176 0.2314 0.8689 0.0104 + b=1.0 z=.4 kT 900.1551 59.2173 0.2190 6.0292 31 0.0176 0.2314 0.8689 0.0104 + b=0.5 z=.4 kT 900.1551 59.2173 0.2190 6.0292 31 0.0176 0.2314 0.8689 0.0104 +--------------------------------------------------------------------------------------------- +Analyzing Jet 3: +--------------------------------------------------------------------------------------------- + name pt m y phi constit delta_R sym mu mxdropz + Original Jet 72.9429 23.4022 -1.1908 6.1199 43 + beta=2.0 zcut=.1 71.5847 20.0943 -1.1761 6.1254 37 0.6803 0.0730 0.5627 0.0111 + beta=1.0 zcut=.1 71.5847 20.0943 -1.1761 6.1254 37 0.6803 0.0730 0.5627 0.0111 + beta=0.5 zcut=.1 67.3730 11.3061 -1.1810 6.0789 29 0.3790 0.0855 0.6966 0.0730 + beta=2.0 zcut=.2 67.3730 11.3061 -1.1810 6.0789 29 0.3790 0.0855 0.6966 0.0730 + beta=1.0 zcut=.2 67.3730 11.3061 -1.1810 6.0789 29 0.3790 0.0855 0.6966 0.0730 + beta=0.5 zcut=.2 57.6019 5.9671 -1.1998 6.1138 16 0.1161 0.2463 0.7416 0.0855 + MMDT-like zcut=.1 57.6019 5.9671 -1.1998 6.1138 16 0.1161 0.2463 0.7416 0.0855 + MMDT-like zcut=.2 57.6019 5.9671 -1.1998 6.1138 16 0.1161 0.2463 0.7416 0.0855 + MMDT-like zcut=.3 43.4356 4.4251 -1.2213 6.0950 13 0.1136 0.4598 0.5944 0.2463 + MMDT-like zcut=.4 43.4356 4.4251 -1.2213 6.0950 13 0.1136 0.4598 0.5944 0.2463 +beta=-2.0 zcut=.05 ---- untagged jet ---- +beta=-1.0 zcut=.05 43.4356 4.4251 -1.2213 6.0950 13 0.1136 0.4598 0.5944 0.2463 +beta=-0.5 zcut=.05 71.5847 20.0943 -1.1761 6.1254 37 0.6803 0.0730 0.5627 0.0111 + b=.5 z=.3 R0=1.0 57.6019 5.9671 -1.1998 6.1138 16 0.1161 0.2463 0.7416 0.0855 + b=.5 z=.3 R0=0.5 57.6019 5.9671 -1.1998 6.1138 16 0.1161 0.2463 0.7416 0.0855 + b=.5 z=.3 R0=0.2 57.6019 5.9671 -1.1998 6.1138 16 0.1161 0.2463 0.7416 0.0855 + b=2 z=.4 scalar_z 67.3730 11.3061 -1.1810 6.0789 29 0.3790 0.0855 0.6966 0.0730 + b=2 z=.4 vector_z 67.3730 11.3061 -1.1810 6.0789 29 0.3790 0.0859 0.6966 0.0741 + b=2 z=.4 y 57.6019 5.9671 -1.1998 6.1138 16 0.1161 0.0763 0.7416 0.0376 +b=3 z=.2 larger_pt 71.5847 20.0943 -1.1761 6.1254 37 0.6803 0.0730 0.5627 0.0111 +b=3 z=.2 larger_mt 71.5847 20.0943 -1.1761 6.1254 37 0.6803 0.0730 0.5627 0.0111 + b=3 z=.2 larger_m 71.5847 20.0943 -1.1761 6.1254 37 0.6803 0.0730 0.5627 0.0111 + b=2 z=.1 mu=1.0 71.5847 20.0943 -1.1761 6.1254 37 0.6803 0.0730 0.5627 0.0111 + b=2 z=.1 mu=0.8 71.5847 20.0943 -1.1761 6.1254 37 0.6803 0.0730 0.5627 0.0111 + b=2 z=.1 mu=0.5 10.2806 0.1396 -1.1761 6.0554 1 -1.0000 -1.0000 -1.0000 0.0000 + b=2.0 z=.2 kT 72.9429 23.4022 -1.1908 6.1199 43 0.2517 0.3453 0.4508 0.0000 + b=1.0 z=.2 kT 72.9429 23.4022 -1.1908 6.1199 43 0.2517 0.3453 0.4508 0.0000 + b=0.5 z=.2 kT 72.9429 23.4022 -1.1908 6.1199 43 0.2517 0.3453 0.4508 0.0000 + b=2.0 z=.4 kT 72.9429 23.4022 -1.1908 6.1199 43 0.2517 0.3453 0.4508 0.0000 + b=1.0 z=.4 kT 72.9429 23.4022 -1.1908 6.1199 43 0.2517 0.3453 0.4508 0.0000 + b=0.5 z=.4 kT 72.9429 23.4022 -1.1908 6.1199 43 0.2517 0.3453 0.4508 0.0000 diff --git a/src/Tools/fjcontrib/RecursiveTools/example_bottomup_softdrop.cc b/src/Tools/fjcontrib/RecursiveTools/example_bottomup_softdrop.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_bottomup_softdrop.cc @@ -0,0 +1,123 @@ +//---------------------------------------------------------------------- +/// \file example_bottomup_softdrop.cc +/// +/// This example program is meant to illustrate how the +/// fastjet::contrib::BottomUpSoftDrop class is used. +/// +/// Run this example with +/// +/// \verbatim +/// ./example_bottomup_softdrop < ../data/single-event.dat +/// \endverbatim +//---------------------------------------------------------------------- + +// $Id: example_bottomup_softdrop.cc 1075 2017-09-18 15:27:09Z gsoyez $ +// +// Copyright (c) 2017-, Gavin P. Salam, Gregory Soyez, Jesse Thaler, +// Kevin Zhou, Frederic Dreyer +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include +#include + +#include +#include +#include "fastjet/ClusterSequence.hh" +#include "BottomUpSoftDrop.hh" // In external code, this should be fastjet/contrib/BottomUpSoftDrop.hh + +using namespace std; +using namespace fastjet; + +// forward declaration to make things clearer +void read_event(vector &event); +void print_prongs(const PseudoJet &jet, const string &pprefix); +ostream & operator<<(ostream &, const PseudoJet &); + +//---------------------------------------------------------------------- +int main(){ + + //---------------------------------------------------------- + // read in input particles + vector event; + read_event(event); + cout << "# read an event with " << event.size() << " particles" << endl; + + // first get some anti-kt jets + double R = 1.0, ptmin = 100.0; + JetDefinition jet_def(antikt_algorithm, R); + ClusterSequence cs(event, jet_def); + vector jets = sorted_by_pt(cs.inclusive_jets(ptmin)); + + //---------------------------------------------------------------------- + // give the soft drop groomer a short name + // Use a symmetry cut z > z_cut R^beta + // By default, there is no mass-drop requirement + double z_cut = 0.2; + double beta = 1.0; + contrib::BottomUpSoftDrop busd(beta, z_cut); + + //---------------------------------------------------------------------- + cout << "BottomUpSoftDrop groomer is: " << busd.description() << endl; + + for (unsigned ijet = 0; ijet < jets.size(); ijet++) { + // Run SoftDrop and examine the output + PseudoJet busd_jet = busd(jets[ijet]); + cout << endl; + cout << "original jet: " << jets[ijet] << endl; + cout << "BottomUpSoftDropped jet: " << busd_jet << endl; + + assert(busd_jet != 0); //because bottom-up soft drop is a groomer (not a tagger), it should always return a soft-dropped jet + + } + + return 0; +} + +//---------------------------------------------------------------------- +/// read in input particles +void read_event(vector &event){ + string line; + while (getline(cin, line)) { + istringstream linestream(line); + // take substrings to avoid problems when there are extra "pollution" + // characters (e.g. line-feed). + if (line.substr(0,4) == "#END") {return;} + if (line.substr(0,1) == "#") {continue;} + double px,py,pz,E; + linestream >> px >> py >> pz >> E; + PseudoJet particle(px,py,pz,E); + + // push event onto back of full_event vector + event.push_back(particle); + } +} + +//---------------------------------------------------------------------- +/// overloaded jet info output +ostream & operator<<(ostream & ostr, const PseudoJet & jet) { + if (jet == 0) { + ostr << " 0 "; + } else { + ostr << " pt = " << jet.pt() + << " m = " << jet.m() + << " y = " << jet.rap() + << " phi = " << jet.phi(); + } + return ostr; +} diff --git a/src/Tools/fjcontrib/RecursiveTools/example_bottomup_softdrop.ref b/src/Tools/fjcontrib/RecursiveTools/example_bottomup_softdrop.ref new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_bottomup_softdrop.ref @@ -0,0 +1,21 @@ +# read an event with 354 particles +#-------------------------------------------------------------------------- +# FastJet release 3.3.1-devel +# M. Cacciari, G.P. Salam and G. Soyez +# A software package for jet finding and analysis at colliders +# http://fastjet.fr +# +# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package +# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210]. +# +# FastJet is provided without warranty under the terms of the GNU GPLv2. +# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code +# and 3rd party plugin jet algorithms. See COPYING file for details. +#-------------------------------------------------------------------------- +BottomUpSoftDrop groomer is: BottomUpSoftDrop with jet_definition = (Longitudinally invariant Cambridge/Aachen algorithm with R = 1000 and E scheme recombination), symmetry_cut = 0.2, beta = 1, R0 = 1 + +original jet: pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 +BottomUpSoftDropped jet: pt = 962.379 m = 19.9368 y = -0.868399 phi = 2.90497 + +original jet: pt = 908.098 m = 87.7124 y = 0.219482 phi = 6.03487 +BottomUpSoftDropped jet: pt = 872.286 m = 7.04265 y = 0.223045 phi = 6.03083 diff --git a/src/Tools/fjcontrib/RecursiveTools/example_isd.cc b/src/Tools/fjcontrib/RecursiveTools/example_isd.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_isd.cc @@ -0,0 +1,170 @@ +//---------------------------------------------------------------------- +/// \file example_isd.cc +/// +/// This example program is meant to illustrate how the +/// fastjet::contrib::IteratedSoftDrop class is used. +/// +/// Run this example with +/// +/// \verbatim +/// ./example_isd < ../data/single-event.dat +/// \endverbatim +//---------------------------------------------------------------------- + +// $Id: example_isd.cc 1115 2018-04-21 13:37:04Z jthaler $ +// +// Copyright (c) 2017, Jesse Thaler, Kevin Zhou +// based on arXiv:1704.06266 by Christopher Frye, Andrew J. Larkoski, +// Jesse Thaler, Kevin Zhou +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include +#include + +#include +#include +#include +#include "fastjet/ClusterSequence.hh" + +#include "IteratedSoftDrop.hh" // In external code, this should be fastjet/contrib/IteratedSoftDrop.hh + +using namespace std; +using namespace fastjet; + +// forward declaration to make things clearer +void read_event(vector &event); + +//---------------------------------------------------------------------- +int main(){ + + //---------------------------------------------------------- + // read in input particles + vector event; + read_event(event); + cout << "# read an event with " << event.size() << " particles" << endl; + + // first get some anti-kt jets + double R = 0.5; + JetDefinition jet_def(antikt_algorithm, R); + double ptmin = 200.0; + Selector pt_min_selector = SelectorPtMin(ptmin); + + ClusterSequence cs(event,jet_def); + vector jets = pt_min_selector(sorted_by_pt(cs.inclusive_jets())); + + // Determine optimal scale from 1704.06266 for beta = -1 + double expected_jet_pt = 1000; // in GeV + double NP_scale = 1; // approximately Lambda_QCD in GeV + double optimal_z_cut = (NP_scale / expected_jet_pt / R); + + // set up iterated soft drop objects + double z_cut = optimal_z_cut; + double beta = -1.0; + double theta_cut = 0.0; + + contrib::IteratedSoftDrop isd(beta, z_cut, theta_cut, R); + contrib::IteratedSoftDrop isd_ee(beta, z_cut, contrib::RecursiveSoftDrop::theta_E, + theta_cut, R, std::numeric_limits::infinity(), + contrib::RecursiveSoftDrop::larger_E); + + cout << "---------------------------------------------------" << endl; + cout << "Iterated Soft Drop" << endl; + cout << "---------------------------------------------------" << endl; + + cout << endl; + cout << "Computing with:" << endl; + cout << " " << isd.description() << endl; + cout << " " << isd_ee.description() << endl; + cout << endl; + + for (unsigned ijet = 0; ijet < jets.size(); ijet++) { + + cout << "---------------------------------------------------" << endl; + cout << "Processing Jet " << ijet << endl; + cout << "---------------------------------------------------" << endl; + + + cout << endl; + cout << "Jet pT: " << jets[ijet].pt() << " GeV" << endl; + cout << endl; + + + // Run full iterated soft drop + // + // Instead of asking for an IteratedSoftDropInfo which contains + // all the information to calculate physics observables, one can + // use + // isd.all_zg_thetag(jet) for the list of symmetry factors and angles + // isd.multiplicity(jet) for the ISD multiplicity + // isd.angularity(jet,alpha) for the angularity obtained from the (zg, thetag) + // + contrib::IteratedSoftDropInfo syms = isd(jets[ijet]); + + cout << "Soft Drop Multiplicity (pt_R measure, beta=" << beta << ", z_cut=" << z_cut << "):" << endl; + cout << syms.multiplicity() << endl; + cout << endl; + + cout << "Symmetry Factors (pt_R measure, beta=" << beta << ", z_cut=" << z_cut << "):" << endl; + for (unsigned i = 0; i < syms.size(); i++){ + cout << syms[i].first << " "; + } + cout << endl; + cout << endl; + + cout << "Soft Drop Angularities (pt_R measure, beta=" << beta << ", z_cut=" << z_cut << "):" << endl; + cout << " alpha = 0, kappa = 0 : " << syms.angularity(0.0, 0.0) << endl; + cout << " alpha = 0, kappa = 2 : " << syms.angularity(0.0, 2.0) << endl; + cout << " alpha = 0.5, kappa = 1 : " << syms.angularity(0.5) << endl; + cout << " alpha = 1, kappa = 1 : " << syms.angularity(1.0) << endl; + cout << " alpha = 2, kappa = 1 : " << syms.angularity(2.0) << endl; + cout << endl; + + // Alternative version with e+e- measure + contrib::IteratedSoftDropInfo syms_ee = isd_ee(jets[ijet]); + cout << "Symmetry Factors (E_theta measure, beta=" << beta << ", z_cut=" << z_cut << "):" << endl; + for (unsigned i = 0; i < syms_ee.size(); i++){ + cout << syms_ee[i].first << " "; + } + cout << endl; + cout << endl; + + + } + + return 0; +} + +//---------------------------------------------------------------------- +/// read in input particles +void read_event(vector &event){ + string line; + while (getline(cin, line)) { + istringstream linestream(line); + // take substrings to avoid problems when there are extra "pollution" + // characters (e.g. line-feed). + if (line.substr(0,4) == "#END") {return;} + if (line.substr(0,1) == "#") {continue;} + double px,py,pz,E; + linestream >> px >> py >> pz >> E; + PseudoJet particle(px,py,pz,E); + + // push event onto back of full_event vector + event.push_back(particle); + } +} diff --git a/src/Tools/fjcontrib/RecursiveTools/example_isd.ref b/src/Tools/fjcontrib/RecursiveTools/example_isd.ref new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_isd.ref @@ -0,0 +1,66 @@ +# read an event with 354 particles +#-------------------------------------------------------------------------- +# FastJet release 3.2.0 +# M. Cacciari, G.P. Salam and G. Soyez +# A software package for jet finding and analysis at colliders +# http://fastjet.fr +# +# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package +# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210]. +# +# FastJet is provided without warranty under the terms of the GNU GPLv2. +# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code +# and 3rd party plugin jet algorithms. See COPYING file for details. +#-------------------------------------------------------------------------- +--------------------------------------------------- +Iterated Soft Drop +--------------------------------------------------- + +Computing with: + IteratedSoftDrop with beta =-1, symmetry_cut=0.002, R0=0.5 and no angular_cut + IteratedSoftDrop with beta =-1, symmetry_cut=0.002, R0=0.5 and no angular_cut + +--------------------------------------------------- +Processing Jet 0 +--------------------------------------------------- + +Jet pT: 982.342 GeV + +Soft Drop Multiplicity (pt_R measure, beta=-1, z_cut=0.002): +3 + +Symmetry Factors (pt_R measure, beta=-1, z_cut=0.002): +0.0294298 0.154333 0.42512 + +Soft Drop Angularities (pt_R measure, beta=-1, z_cut=0.002): + alpha = 0, kappa = 0 : 3 + alpha = 0, kappa = 2 : 0.205411 + alpha = 0.5, kappa = 1 : 0.0541032 + alpha = 1, kappa = 1 : 0.0071635 + alpha = 2, kappa = 1 : 0.000333819 + +Symmetry Factors (E_theta measure, beta=-1, z_cut=0.002): +0.0286322 0.156129 + +--------------------------------------------------- +Processing Jet 1 +--------------------------------------------------- + +Jet pT: 899.993 GeV + +Soft Drop Multiplicity (pt_R measure, beta=-1, z_cut=0.002): +4 + +Symmetry Factors (pt_R measure, beta=-1, z_cut=0.002): +0.00357435 0.0033004 0.00518061 0.235041 + +Soft Drop Angularities (pt_R measure, beta=-1, z_cut=0.002): + alpha = 0, kappa = 0 : 4 + alpha = 0, kappa = 2 : 0.0552947 + alpha = 0.5, kappa = 1 : 0.0307531 + alpha = 1, kappa = 1 : 0.00657501 + alpha = 2, kappa = 1 : 0.00151741 + +Symmetry Factors (E_theta measure, beta=-1, z_cut=0.002): +0.00367919 0.00338026 0.00506002 0.235347 + diff --git a/src/Tools/fjcontrib/RecursiveTools/example_mmdt.cc b/src/Tools/fjcontrib/RecursiveTools/example_mmdt.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_mmdt.cc @@ -0,0 +1,131 @@ +//---------------------------------------------------------------------- +/// \file example_mmdt.cc +/// +/// This example program is meant to illustrate how the +/// fastjet::contrib::ModifiedMassDropTagger class is used. +/// +/// Run this example with +/// +/// \verbatim +/// ./example_mmdt < ../data/single-event.dat +/// \endverbatim +/// +/// It also shows operation in conjunction with a Filter. +//---------------------------------------------------------------------- + +// $Id: example_mmdt.cc 686 2014-06-14 03:25:09Z jthaler $ +// +// Copyright (c) 2014, Gavin P. Salam +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include +#include + +#include +#include +#include +#include "fastjet/ClusterSequence.hh" +#include "fastjet/tools/Filter.hh" +#include "ModifiedMassDropTagger.hh" // In external code, this should be fastjet/contrib/ModifiedMassDropTagger.hh + +using namespace std; +using namespace fastjet; + +// forward declaration to make things clearer +void read_event(vector &event); +ostream & operator<<(ostream &, const PseudoJet &); + +//---------------------------------------------------------------------- +int main(){ + + //---------------------------------------------------------- + // read in input particles + vector event; + read_event(event); + cout << "# read an event with " << event.size() << " particles" << endl; + + // first get some Cambridge/Aachen jets + double R = 1.0, ptmin = 20.0; + JetDefinition jet_def(cambridge_algorithm, R); + ClusterSequence cs(event, jet_def); + vector jets = sorted_by_pt(cs.inclusive_jets(ptmin)); + + // give the tagger a short name + typedef contrib::ModifiedMassDropTagger MMDT; + // use just a symmetry cut, with no mass-drop requirement + double z_cut = 0.10; + MMDT tagger(z_cut); + cout << "tagger is: " << tagger.description() << endl; + + for (unsigned ijet = 0; ijet < jets.size(); ijet++) { + // first run MMDT and examine the output + PseudoJet tagged_jet = tagger(jets[ijet]); + cout << endl; + cout << "original jet: " << jets[ijet] << endl; + cout << "tagged jet: " << tagged_jet << endl; + if (tagged_jet == 0) continue; // If symmetry condition not satisified, jet is not tagged + cout << " delta_R between subjets: " << tagged_jet.structure_of().delta_R() << endl; + cout << " symmetry measure(z): " << tagged_jet.structure_of().symmetry() << endl; + cout << " mass drop(mu): " << tagged_jet.structure_of().mu() << endl; + + // then filter the jet (useful for studies at moderate pt) + // with a dynamic Rfilt choice (as in arXiv:0802.2470) + double Rfilt = min(0.3, tagged_jet.structure_of().delta_R()*0.5); + int nfilt = 3; + Filter filter(Rfilt, SelectorNHardest(nfilt)); + PseudoJet filtered_jet = filter(tagged_jet); + cout << "filtered jet: " << filtered_jet << endl; + cout << endl; + } + + return 0; +} + +//---------------------------------------------------------------------- +/// read in input particles +void read_event(vector &event){ + string line; + while (getline(cin, line)) { + istringstream linestream(line); + // take substrings to avoid problems when there are extra "pollution" + // characters (e.g. line-feed). + if (line.substr(0,4) == "#END") {return;} + if (line.substr(0,1) == "#") {continue;} + double px,py,pz,E; + linestream >> px >> py >> pz >> E; + PseudoJet particle(px,py,pz,E); + + // push event onto back of full_event vector + event.push_back(particle); + } +} + +//---------------------------------------------------------------------- +/// overloaded jet info output +ostream & operator<<(ostream & ostr, const PseudoJet & jet) { + if (jet == 0) { + ostr << " 0 "; + } else { + ostr << " pt = " << jet.pt() + << " m = " << jet.m() + << " y = " << jet.rap() + << " phi = " << jet.phi(); + } + return ostr; +} diff --git a/src/Tools/fjcontrib/RecursiveTools/example_mmdt.ref b/src/Tools/fjcontrib/RecursiveTools/example_mmdt.ref new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_mmdt.ref @@ -0,0 +1,39 @@ +# read an event with 354 particles +#-------------------------------------------------------------------------- +# FastJet release 3.1.0-devel +# M. Cacciari, G.P. Salam and G. Soyez +# A software package for jet finding and analysis at colliders +# http://fastjet.fr +# +# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package +# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210]. +# +# FastJet is provided without warranty under the terms of the GNU GPLv2. +# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code, +# CGAL and 3rd party plugin jet algorithms. See COPYING file for details. +#-------------------------------------------------------------------------- +tagger is: Recursive Tagger with a symmetry cut scalar_z > 0.1 [ModifiedMassDropTagger], no mass-drop requirement, recursion into the subjet with larger pt + +original jet: pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 +tagged jet: pt = 917.674 m = 8.70484 y = -0.869593 phi = 2.90788 + delta_R between subjets: 0.0200353 + symmetry measure(z): 0.154333 + mass drop(mu): 0.557579 +filtered jet: pt = 917.674 m = 8.70484 y = -0.869593 phi = 2.90788 + + +original jet: pt = 910.164 m = 122.615 y = 0.223738 phi = 6.04265 +tagged jet: pt = 800.269 m = 4.03811 y = 0.223011 phi = 6.03096 + delta_R between subjets: 0.0101382 + symmetry measure(z): 0.235041 + mass drop(mu): 0.229134 +filtered jet: pt = 778.731 m = 3.66481 y = 0.223066 phi = 6.0309 + + +original jet: pt = 73.2118 m = 21.4859 y = -1.16399 phi = 6.11977 +tagged jet: pt = 57.6019 m = 5.96709 y = -1.19982 phi = 6.11382 + delta_R between subjets: 0.116062 + symmetry measure(z): 0.246343 + mass drop(mu): 0.741581 +filtered jet: pt = 46.7389 m = 4.6395 y = -1.19991 phi = 6.12566 + diff --git a/src/Tools/fjcontrib/RecursiveTools/example_mmdt_ee.cc b/src/Tools/fjcontrib/RecursiveTools/example_mmdt_ee.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_mmdt_ee.cc @@ -0,0 +1,142 @@ +//---------------------------------------------------------------------- +/// \file example_ee.cc +/// +/// This example program is meant to illustrate how to use +/// RecursiveTools for e+e- events. It is done using the +/// ModifiedMassDropTagger class but the same strategy would work as +/// well for SoftDrop, RecursiveSoftDrop and IteratedSoftDrop +/// +/// Run this example with +/// +/// \verbatim +/// ./example_ee < ../data/single-ee-event.dat +/// \endverbatim +//---------------------------------------------------------------------- + +// $Id: example_mmdt_ee.cc 1064 2017-09-08 09:19:57Z gsoyez $ +// +// Copyright (c) 2017-, Gavin P. Salam, Gregory Soyez, Jesse Thaler, +// Kevin Zhou, Frederic Dreyer +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include +#include + +#include +#include +#include +#include "fastjet/ClusterSequence.hh" +#include "fastjet/tools/Filter.hh" +#include "ModifiedMassDropTagger.hh" // In external code, this should be fastjet/contrib/ModifiedMassDropTagger.hh + +using namespace std; +using namespace fastjet; + +// forward declaration to make things clearer +void read_event(vector &event); +ostream & operator<<(ostream &, const PseudoJet &); + +//---------------------------------------------------------------------- +int main(){ + + //---------------------------------------------------------- + // read in input particles + vector event; + read_event(event); + cout << "# read an event with " << event.size() << " particles" << endl; + + // first get some Cambridge/Aachen jets + double R = 1.0; + JetDefinition jet_def(ee_genkt_algorithm, R, 0.0); + ClusterSequence cs(event, jet_def); + + double Emin = 10.0; + Selector sel_jets = SelectorEMin(Emin); + vector jets = sorted_by_E(sel_jets(cs.inclusive_jets())); + + // give the tagger a short name + typedef contrib::ModifiedMassDropTagger MMDT; + + // This version uses the following setup: + // - use energy for the symmetry measure + // Note: since the mMDT does not require angular information, + // here we could use either theta_E or cos_theta_E (it would + // only change the value of DeltaR). For + // SoftDrop/RecursiveSoftDrop/IteratedSoftDrop, this would make + // a difference and we have + // DeltaR_{ij}^2 = theta_{ij}^2 (theta_E) + // DeltaR_{ij}^2 = 2 [1-cos(theta_{ij}^2)] (cos_theta_E) + // + // - recurse into the branch with the largest energy + // + // - use a symmetry cut, with no mass-drop requirement + double z_cut = 0.20; + MMDT tagger(z_cut, + MMDT::cos_theta_E, + std::numeric_limits::infinity(), + MMDT::larger_E); + cout << "tagger is: " << tagger.description() << endl; + + for (unsigned ijet = 0; ijet < jets.size(); ijet++) { + // first run MMDT and examine the output + PseudoJet tagged_jet = tagger(jets[ijet]); + cout << endl; + cout << "original jet: " << jets[ijet] << endl; + cout << "tagged jet: " << tagged_jet << endl; + if (tagged_jet == 0) continue; // If symmetry condition not satisified, jet is not tagged + cout << " delta_R between subjets: " << tagged_jet.structure_of().delta_R() << endl; + cout << " symmetry measure(z): " << tagged_jet.structure_of().symmetry() << endl; + cout << " mass drop(mu): " << tagged_jet.structure_of().mu() << endl; + + cout << endl; + } + + return 0; +} + +//---------------------------------------------------------------------- +/// read in input particles +void read_event(vector &event){ + string line; + while (getline(cin, line)) { + istringstream linestream(line); + // take substrings to avoid problems when there are extra "pollution" + // characters (e.g. line-feed). + if (line.substr(0,4) == "#END") {return;} + if (line.substr(0,1) == "#") {continue;} + double px,py,pz,E; + linestream >> px >> py >> pz >> E; + PseudoJet particle(px,py,pz,E); + + // push event onto back of full_event vector + event.push_back(particle); + } +} + +//---------------------------------------------------------------------- +/// overloaded jet info output +ostream & operator<<(ostream & ostr, const PseudoJet & jet) { + if (jet == 0) { + ostr << " 0 "; + } else { + ostr << " E = " << jet.pt() + << " m = " << jet.m(); + } + return ostr; +} diff --git a/src/Tools/fjcontrib/RecursiveTools/example_mmdt_ee.ref b/src/Tools/fjcontrib/RecursiveTools/example_mmdt_ee.ref new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_mmdt_ee.ref @@ -0,0 +1,36 @@ +# read an event with 70 particles +#-------------------------------------------------------------------------- +# FastJet release 3.3.1-devel +# M. Cacciari, G.P. Salam and G. Soyez +# A software package for jet finding and analysis at colliders +# http://fastjet.fr +# +# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package +# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210]. +# +# FastJet is provided without warranty under the terms of the GNU GPLv2. +# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code +# and 3rd party plugin jet algorithms. See COPYING file for details. +#-------------------------------------------------------------------------- +tagger is: Recursive Tagger with a symmetry cut cos_theta_E > 0.2 [ModifiedMassDropTagger], no mass-drop requirement, recursion into the subjet with larger energy + +original jet: E = 11.7799 m = 19.2957 +tagged jet: E = 6.02018 m = 6.52181 + delta_R between subjets: 0.270322 + symmetry measure(z): 0.49629 + mass drop(mu): 0.403395 + + +original jet: E = 15.9528 m = 7.28134 +tagged jet: E = 8.08779 m = 0.992053 + delta_R between subjets: 0.113801 + symmetry measure(z): 0.289966 + mass drop(mu): 0.413689 + + +original jet: E = 10.3356 m = 9.53801 +tagged jet: E = 10.3356 m = 9.53801 + delta_R between subjets: 0.779204 + symmetry measure(z): 0.35827 + mass drop(mu): 0.331619 + diff --git a/src/Tools/fjcontrib/RecursiveTools/example_mmdt_sub.cc b/src/Tools/fjcontrib/RecursiveTools/example_mmdt_sub.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_mmdt_sub.cc @@ -0,0 +1,211 @@ +// $Id: example_mmdt_sub.cc 686 2014-06-14 03:25:09Z jthaler $ +// +// Copyright (c) 2014, Gavin Salam +// +/// \file example_mmdt_sub.cc +/// +/// An example to illustrate how to use the ModifiedMassDropTagger +/// together with pileup subtraction. +/// +/// Usage: +/// +/// \verbatim +/// ./example_mmdt_sub < ../data/Pythia-Zp2jets-lhc-pileup-1ev.dat +/// \endverbatim +/// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include +#include + +#include +#include +#include "fastjet/ClusterSequenceArea.hh" +#include "fastjet/tools/GridMedianBackgroundEstimator.hh" +#include "fastjet/tools/Subtractor.hh" +#include "fastjet/tools/Filter.hh" +#include "fastjet/config.h" +#include "ModifiedMassDropTagger.hh" // In external code, this should be fastjet/contrib/ModifiedMassDropTagger.hh + +using namespace std; +using namespace fastjet; + +// forward declaration to make things clearer +void read_event(vector &hard_event, vector &full_event); +void do_analysis(const vector & jets, const Subtractor * subtractor); +ostream & operator<<(ostream &, const PseudoJet &); + +// give the tagger a short name +typedef contrib::ModifiedMassDropTagger MMDT; + +//---------------------------------------------------------------------- +int main(){ + + // Specify our basic jet tools: + // jet definition & area definition + double R = 1.0, rapmax = 5.0, ghost_area = 0.01; + int repeat = 1; + JetDefinition jet_def(cambridge_algorithm, R); + AreaDefinition area_def(active_area_explicit_ghosts, + GhostedAreaSpec(SelectorAbsRapMax(rapmax),repeat,ghost_area)); + cout << "# " << jet_def.description() << endl; + cout << "# " << area_def.description() << endl; + + // then our background estimator: use the (fast) grid-median method, + // and manually include reasonable rapidity dependence for + // particle-level 14 TeV events. + double grid_size = 0.55; + GridMedianBackgroundEstimator bge(rapmax, grid_size); + BackgroundRescalingYPolynomial rescaling (1.1685397, 0, -0.0246807, 0, 5.94119e-05); + bge.set_rescaling_class(&rescaling); + // define a corresponding subtractor + Subtractor subtractor(&bge); + + + //---------------------------------------------------------- + // next read in input particles and get corresponding jets + // for the hard event (no pileup) and full event (with pileup) + vector hard_event, full_event; + read_event(hard_event, full_event); + cout << "# read a hard event with " << hard_event.size() << " particles" ; +#if (FASTJET_VERSION_NUMBER >= 30100) // Selector.sum(..) works only for FJ >= 3.1 + cout << ", centre-of-mass energy = " << SelectorIdentity().sum(hard_event).m(); +#endif + cout << endl; + cout << "# read a full event with " << full_event.size() << " particles" << endl; + + // then get the CS and jets for both hard and full events + ClusterSequenceArea csa_hard(hard_event, jet_def, area_def); + ClusterSequenceArea csa_full(full_event, jet_def, area_def); + vector hard_jets = SelectorNHardest(2)(csa_hard.inclusive_jets()); + vector full_jets = SelectorNHardest(2)(csa_full.inclusive_jets()); + hard_jets = sorted_by_rapidity(hard_jets); + full_jets = sorted_by_rapidity(full_jets); + + // estimate the background (the subtractor is automatically tied to this) + bge.set_particles(full_event); + + // then do analyses with and without PU, and with and without subtraction + cout << endl << "-----------------------------------------" << endl + << "No pileup, no subtraction" << endl; + do_analysis(hard_jets, 0); + cout << endl << "-----------------------------------------" << endl + << "Pileup, no subtraction" << endl; + do_analysis(full_jets, 0); + cout << endl << "-----------------------------------------" << endl + << "Pileup, with subtraction" << endl; + do_analysis(full_jets, &subtractor); + + return 0; +} + + +//---------------------------------------------------------------------- +/// do a simple MMDT + filter analysis, optionally with a subtractor +void do_analysis(const vector & jets, const Subtractor * subtractor) { + + // use just a symmetry cut for the tagger, with no mass-drop requirement + double z_cut = 0.10; + MMDT tagger(z_cut); + cout << "tagger is: " << tagger.description() << endl; + // tell the tagger that we will subtract the input jet ourselves + tagger.set_subtractor(subtractor); + tagger.set_input_jet_is_subtracted(true); + + + PseudoJet jet; + for (unsigned ijet = 0; ijet < jets.size(); ijet++) { + if (subtractor) { + jet = (*subtractor)(jets[ijet]); + } else { + jet = jets[ijet]; + } + PseudoJet tagged_jet = tagger(jet); + cout << endl; + cout << "original jet" << jet << endl; + cout << "tagged jet" << tagged_jet << endl; + if (tagged_jet != 0) { // get additional informaition about satisified symmetry condition + cout << " delta_R between subjets: " << tagged_jet.structure_of().delta_R() << endl; + cout << " symmetry measure(z): " << tagged_jet.structure_of().symmetry() << endl; + cout << " mass drop(mu): " << tagged_jet.structure_of().mu() << endl; + } + + // then filter the jet (useful for studies at moderate pt) + // with a dynamic Rfilt choice (as in arXiv:0802.2470) + double Rfilt = min(0.3, tagged_jet.structure_of().delta_R()*0.5); + int nfilt = 3; + Filter filter(Rfilt, SelectorNHardest(nfilt)); + filter.set_subtractor(subtractor); + PseudoJet filtered_jet = filter(tagged_jet); + cout << "filtered jet: " << filtered_jet << endl; + cout << endl; + } + + +} + + +//------------------------------------------------------------------------ +// read the event with and without pileup +void read_event(vector &hard_event, vector &full_event){ + string line; + int nsub = 0; // counter to keep track of which sub-event we're reading + while (getline(cin, line)) { + istringstream linestream(line); + // take substrings to avoid problems when there are extra "pollution" + // characters (e.g. line-feed). + if (line.substr(0,4) == "#END") {break;} + if (line.substr(0,9) == "#SUBSTART") { + // if more sub events follow, make copy of first one (the hard one) here + if (nsub == 1) hard_event = full_event; + nsub += 1; + } + if (line.substr(0,1) == "#") {continue;} + double px,py,pz,E; + linestream >> px >> py >> pz >> E; + PseudoJet particle(px,py,pz,E); + + // push event onto back of full_event vector + full_event.push_back(particle); + } + + // if we have read in only one event, copy it across here... + if (nsub == 1) hard_event = full_event; + + // if there was nothing in the event + if (nsub == 0) { + cerr << "Error: read empty event\n"; + exit(-1); + } + + cout << "# " << nsub-1 << " pileup events on top of the hard event" << endl; +} + +//---------------------------------------------------------------------- +/// overloaded jet info output +ostream & operator<<(ostream & ostr, const PseudoJet & jet) { + if (jet == 0) { + ostr << " 0 "; + } else { + ostr << " pt = " << jet.pt() + << " m = " << jet.m() + << " y = " << jet.rap() + << " phi = " << jet.phi(); + } + return ostr; +} diff --git a/src/Tools/fjcontrib/RecursiveTools/example_mmdt_sub.ref b/src/Tools/fjcontrib/RecursiveTools/example_mmdt_sub.ref new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_mmdt_sub.ref @@ -0,0 +1,78 @@ +# Longitudinally invariant Cambridge/Aachen algorithm with R = 1 and E scheme recombination +# Active area (explicit ghosts) with ghosts of area 0.00997331 (had requested 0.01), placed according to selector (|rap| <= 5), scattered wrt to perfect grid by (rel) 1, mean_ghost_pt = 1e-100, rel pt_scatter = 0.1, n repetitions of ghost distributions = 1 +# 20 pileup events on top of the hard event +# read a hard event with 309 particles, centre-of-mass energy = 14000 +# read a full event with 3109 particles +#-------------------------------------------------------------------------- +# FastJet release 3.1.0-devel +# M. Cacciari, G.P. Salam and G. Soyez +# A software package for jet finding and analysis at colliders +# http://fastjet.fr +# +# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package +# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210]. +# +# FastJet is provided without warranty under the terms of the GNU GPLv2. +# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code, +# CGAL and 3rd party plugin jet algorithms. See COPYING file for details. +#-------------------------------------------------------------------------- + +----------------------------------------- +No pileup, no subtraction +tagger is: Recursive Tagger with a symmetry cut scalar_z > 0.1 [ModifiedMassDropTagger], no mass-drop requirement, recursion into the subjet with larger pt + +original jet pt = 221.812 m = 32.2905 y = -1.05822 phi = 0.0756913 +tagged jet pt = 206.662 m = 6.022 y = -1.07399 phi = 0.074484 + delta_R between subjets: 0.0625986 + symmetry measure(z): 0.10081 + mass drop(mu): 0.629535 +filtered jet: pt = 198.618 m = 5.00366 y = -1.07664 phi = 0.0741277 + + +original jet pt = 147.272 m = 32.4736 y = 0.684444 phi = 3.45888 +tagged jet pt = 125.59 m = 9.00653 y = 0.673318 phi = 3.44347 + delta_R between subjets: 0.0732829 + symmetry measure(z): 0.348016 + mass drop(mu): 0.604284 +filtered jet: pt = 72.4046 m = 4.32252 y = 0.668029 phi = 3.44446 + + +----------------------------------------- +Pileup, no subtraction +tagger is: Recursive Tagger with a symmetry cut scalar_z > 0.1 [ModifiedMassDropTagger], no mass-drop requirement, recursion into the subjet with larger pt + +original jet pt = 238.971 m = 82.4889 y = -1.07084 phi = 0.0430975 +tagged jet pt = 206.662 m = 6.022 y = -1.07399 phi = 0.074484 + delta_R between subjets: 0.0625986 + symmetry measure(z): 0.10081 + mass drop(mu): 0.629535 +filtered jet: pt = 198.618 m = 5.00366 y = -1.07664 phi = 0.0741277 + + +original jet pt = 173.75 m = 74.6701 y = 0.73638 phi = 3.48392 +tagged jet pt = 133.133 m = 13.4499 y = 0.667906 phi = 3.44217 + delta_R between subjets: 0.10831 + symmetry measure(z): 0.107147 + mass drop(mu): 0.862327 +filtered jet: pt = 109.81 m = 7.14298 y = 0.676746 phi = 3.43921 + + +----------------------------------------- +Pileup, with subtraction +tagger is: Recursive Tagger with a symmetry cut scalar_z > 0.1 [ModifiedMassDropTagger], no mass-drop requirement, recursion into the subjet with larger pt + +original jet pt = 203.782 m = -0.967618 y = -1.05353 phi = 0.0821247 +tagged jet pt = 206.662 m = 6.022 y = -1.07399 phi = 0.074484 + delta_R between subjets: 0.0625986 + symmetry measure(z): 0.10081 + mass drop(mu): 0.629535 +filtered jet: pt = 198.618 m = 5.00366 y = -1.07664 phi = 0.0741277 + + +original jet pt = 146.109 m = 51.1929 y = 0.705189 phi = 3.44819 +tagged jet pt = 132.536 m = 13.3758 y = 0.668335 phi = 3.44231 + delta_R between subjets: 0.107608 + symmetry measure(z): 0.104244 + mass drop(mu): 0.866401 +filtered jet: pt = 109.661 m = 7.13553 y = 0.676798 phi = 3.43925 + diff --git a/src/Tools/fjcontrib/RecursiveTools/example_recluster.cc b/src/Tools/fjcontrib/RecursiveTools/example_recluster.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_recluster.cc @@ -0,0 +1,173 @@ +//---------------------------------------------------------------------- +/// \file example_recluster.cc +/// +/// This example program is meant to illustrate how the +/// fastjet::contrib::ModifiedMassDropTagger class is used. +/// +/// Run this example with +/// +/// \verbatim +/// ./example_recluster < ../data/single-event.dat +/// \endverbatim +//---------------------------------------------------------------------- + +// $Id: example_recluster.cc 705 2014-07-07 14:37:03Z gsoyez $ +// +// Copyright (c) 2014, Gavin P. Salam +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include +#include + +#include +#include +#include +#include "fastjet/ClusterSequence.hh" + +#include "Recluster.hh" // In external code, this should be fastjet/contrib/Recluster.hh + +using namespace std; +using namespace fastjet; + +// forward declaration to make things clearer +void read_event(vector &event); +ostream & operator<<(ostream &, const PseudoJet &); + +//---------------------------------------------------------------------- +int main(){ + + //---------------------------------------------------------- + // read in input particles + vector event; + read_event(event); + cout << "# read an event with " << event.size() << " particles" << endl; + + double R = 1.0; + double ptmin = 20.0; + double Rsub = 0.3; + + //---------------------------------------------------------- + // start with an example from anti-kt jets + cout << "--------------------------------------------------" << endl; + JetDefinition jet_def_akt(antikt_algorithm, R); + ClusterSequence cs_akt(event, jet_def_akt); + vector jets_akt = sorted_by_pt(cs_akt.inclusive_jets(ptmin)); + PseudoJet jet_akt = jets_akt[0]; + cout << "Starting from a jet obtained from: " << jet_def_akt.description() << endl + << " " << jet_akt << endl << endl; + + // recluster with C/A ("infinite" radius) + contrib::Recluster recluster_ca_inf(cambridge_algorithm, JetDefinition::max_allowable_R); + PseudoJet rec_jet_ca_inf = recluster_ca_inf(jet_akt); + cout << "Reclustering with: " << recluster_ca_inf.description() << endl + << " " << rec_jet_ca_inf << endl << endl;; + + // recluster with C/A (small radius), keeping all subjets + contrib::Recluster recluster_ca_sub(cambridge_algorithm, Rsub, false); + PseudoJet rec_jet_ca_sub = recluster_ca_sub(jet_akt); + cout << "Reclustering with: " << recluster_ca_sub.description() << endl + << " " << rec_jet_ca_sub << endl; + vector pieces = rec_jet_ca_sub.pieces(); + cout << " subjets: " << endl; + for (unsigned int i=0;i jets_ca = sorted_by_pt(cs_ca.inclusive_jets(ptmin)); + PseudoJet jet_ca = jets_ca[0]; + cout << "Starting from a jet obtained from: " << jet_def_ca.description() << endl + << " " << jet_ca << endl << endl; + + // recluster with C/A ("infinite" radius) + rec_jet_ca_inf = recluster_ca_inf(jet_ca); + cout << "Reclustering with: " << recluster_ca_inf.description() << endl + << " " << rec_jet_ca_inf << endl << endl; + + // recluster with C/A (small radius), keeping all subjets + rec_jet_ca_sub = recluster_ca_sub(jet_ca); + cout << "Reclustering with: " << recluster_ca_sub.description() << endl + << " " << rec_jet_ca_sub << endl; + pieces = rec_jet_ca_sub.pieces(); + cout << " subjets: " << endl; + for (unsigned int i=0;i &event){ + string line; + while (getline(cin, line)) { + istringstream linestream(line); + // take substrings to avoid problems when there are extra "pollution" + // characters (e.g. line-feed). + if (line.substr(0,4) == "#END") {return;} + if (line.substr(0,1) == "#") {continue;} + double px,py,pz,E; + linestream >> px >> py >> pz >> E; + PseudoJet particle(px,py,pz,E); + + // push event onto back of full_event vector + event.push_back(particle); + } +} + +//---------------------------------------------------------------------- +/// overloaded jet info output +ostream & operator<<(ostream & ostr, const PseudoJet & jet) { + if (jet == 0) { + ostr << " 0 "; + } else { + ostr << " pt = " << jet.pt() + << " m = " << jet.m() + << " y = " << jet.rap() + << " phi = " << jet.phi() + << " ClusSeq = " << (jet.has_associated_cs() ? "yes" : "no"); + } + return ostr; +} diff --git a/src/Tools/fjcontrib/RecursiveTools/example_recluster.ref b/src/Tools/fjcontrib/RecursiveTools/example_recluster.ref new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_recluster.ref @@ -0,0 +1,64 @@ +# read an event with 354 particles +-------------------------------------------------- +#-------------------------------------------------------------------------- +# FastJet release 3.1.0-devel +# M. Cacciari, G.P. Salam and G. Soyez +# A software package for jet finding and analysis at colliders +# http://fastjet.fr +# +# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package +# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210]. +# +# FastJet is provided without warranty under the terms of the GNU GPLv2. +# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code, +# CGAL and 3rd party plugin jet algorithms. See COPYING file for details. +#-------------------------------------------------------------------------- +Starting from a jet obtained from: Longitudinally invariant anti-kt algorithm with R = 1 and E scheme recombination + pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 ClusSeq = yes + +Reclustering with: Recluster with subjet_def = Longitudinally invariant Cambridge/Aachen algorithm with R = 1000, a recombiner obtained from the jet being reclustered and keeping the hardest subjet + pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 ClusSeq = yes + +Reclustering with: Recluster with subjet_def = Longitudinally invariant Cambridge/Aachen algorithm with R = 0.3, a recombiner obtained from the jet being reclustered and joining all subjets in a composite jet + pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 ClusSeq = no + subjets: + pt = 980.937 m = 27.6178 y = -0.86753 phi = 2.90527 ClusSeq = yes + pt = 1.34048 m = 0.13498 y = -0.448775 phi = 2.76161 ClusSeq = yes + pt = 0.461349 m = 0.13957 y = -1.31787 phi = 3.17806 ClusSeq = yes + pt = 0.362421 m = 0.0359117 y = -0.593531 phi = 3.08425 ClusSeq = yes + pt = 0.241708 m = -3.12684e-06 y = -1.16407 phi = 2.42725 ClusSeq = yes + pt = 0.115239 m = 0.13957 y = -1.6844 phi = 2.54038 ClusSeq = yes + +Reclustering with: Recluster with subjet_def = Longitudinally invariant kt algorithm with R = 0.3, a recombiner obtained from the jet being reclustered and joining all subjets in a composite jet + pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 ClusSeq = no + subjets: + pt = 982.621 m = 32.8883 y = -0.866837 phi = 2.90514 ClusSeq = yes + pt = 0.461349 m = 0.13957 y = -1.31787 phi = 3.17806 ClusSeq = yes + pt = 0.241708 m = -3.12684e-06 y = -1.16407 phi = 2.42725 ClusSeq = yes + pt = 0.115239 m = 0.13957 y = -1.6844 phi = 2.54038 ClusSeq = yes + +-------------------------------------------------- +Starting from a jet obtained from: Longitudinally invariant Cambridge/Aachen algorithm with R = 1 and E scheme recombination + pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 ClusSeq = yes + +Reclustering with: Recluster with subjet_def = Longitudinally invariant Cambridge/Aachen algorithm with R = 1000, a recombiner obtained from the jet being reclustered and keeping the hardest subjet + pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 ClusSeq = yes + +Reclustering with: Recluster with subjet_def = Longitudinally invariant Cambridge/Aachen algorithm with R = 0.3, a recombiner obtained from the jet being reclustered and joining all subjets in a composite jet + pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 ClusSeq = no + subjets: + pt = 980.937 m = 27.6178 y = -0.86753 phi = 2.90527 ClusSeq = yes + pt = 1.34048 m = 0.13498 y = -0.448775 phi = 2.76161 ClusSeq = yes + pt = 0.461349 m = 0.13957 y = -1.31787 phi = 3.17806 ClusSeq = yes + pt = 0.362421 m = 0.0359117 y = -0.593531 phi = 3.08425 ClusSeq = yes + pt = 0.241708 m = -3.12684e-06 y = -1.16407 phi = 2.42725 ClusSeq = yes + pt = 0.115239 m = 0.13957 y = -1.6844 phi = 2.54038 ClusSeq = yes + +Reclustering with: Recluster with subjet_def = Longitudinally invariant kt algorithm with R = 0.3, a recombiner obtained from the jet being reclustered and joining all subjets in a composite jet + pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 ClusSeq = no + subjets: + pt = 982.621 m = 32.8883 y = -0.866837 phi = 2.90514 ClusSeq = yes + pt = 0.461349 m = 0.13957 y = -1.31787 phi = 3.17806 ClusSeq = yes + pt = 0.241708 m = -3.12684e-06 y = -1.16407 phi = 2.42725 ClusSeq = yes + pt = 0.115239 m = 0.13957 y = -1.6844 phi = 2.54038 ClusSeq = yes + diff --git a/src/Tools/fjcontrib/RecursiveTools/example_recursive_softdrop.cc b/src/Tools/fjcontrib/RecursiveTools/example_recursive_softdrop.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_recursive_softdrop.cc @@ -0,0 +1,240 @@ +//---------------------------------------------------------------------- +/// \file example_recursive_softdrop.cc +/// +/// This example program is meant to illustrate how the +/// fastjet::contrib::RecursiveSoftDrop class is used. +/// +/// Run this example with +/// +/// \verbatim +/// ./example_recursive_softdrop < ../data/single-event.dat +/// \endverbatim +//---------------------------------------------------------------------- + +// $Id: example_recursive_softdrop.cc 1074 2017-09-18 15:15:20Z gsoyez $ +// +// Copyright (c) 2017-, Gavin P. Salam, Gregory Soyez, Jesse Thaler, +// Kevin Zhou, Frederic Dreyer +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include +#include + +#include +#include +#include "fastjet/ClusterSequence.hh" +#include "RecursiveSoftDrop.hh" // In external code, this should be fastjet/contrib/RecursiveSoftDrop.hh + +using namespace std; +using namespace fastjet; + +// forward declaration to make things clearer +void read_event(vector &event); + +void print_prongs_with_clustering_info(const PseudoJet &jet, const string &pprefix); +void print_raw_prongs(const PseudoJet &jet); + +ostream & operator<<(ostream &, const PseudoJet &); + +//---------------------------------------------------------------------- +int main(){ + + //---------------------------------------------------------- + // read in input particles + vector event; + read_event(event); + cout << "# read an event with " << event.size() << " particles" << endl; + + // first get some anti-kt jets + double R = 1.0, ptmin = 100.0; + JetDefinition jet_def(antikt_algorithm, R); + ClusterSequence cs(event, jet_def); + vector jets = sorted_by_pt(cs.inclusive_jets(ptmin)); + + //---------------------------------------------------------------------- + // give the soft drop groomer a short name + // Use a symmetry cut z > z_cut R^beta + // By default, there is no mass-drop requirement + double z_cut = 0.2; + double beta = 0.5; + int n=4; // number of layers (-1 <> infinite) + contrib::RecursiveSoftDrop rsd(beta, z_cut, n, R); + + // keep addittional structure info (used below) + rsd.set_verbose_structure(true); + + // (optionally) use the same-depth variant + // + // instead of recursing into the largest Delta R branch until "n+1" + // branches hav ebeen found, the same-depth variant recurses n times + // into all the branches found in the previous iteration + // + //rsd.set_fixed_depth_mode(); + + // (optionally) use a dynamical R0 + // + // Instead of being normalised by the initial jet radios R0, angles + // are notrmalised by the delta R of the previous iteration + // + rsd.set_dynamical_R0(); + + // (optionally) recurse only in the hardest branch + // + // Instead of recursing into both branches found by the previous + // iteration, only keep recursing into the hardest one + // + //rsd.set_hardest_branch_only(); + + + //---------------------------------------------------------------------- + cout << "RecursiveSoftDrop groomer is: " << rsd.description() << endl; + + for (unsigned ijet = 0; ijet < jets.size(); ijet++) { + // Run SoftDrop and examine the output + PseudoJet rsd_jet = rsd(jets[ijet]); + cout << endl; + cout << "original jet: " << jets[ijet] << endl; + cout << "RecursiveSoftDropped jet: " << rsd_jet << endl; + + assert(rsd_jet != 0); //because soft drop is a groomer (not a tagger), it should always return a soft-dropped jet + + // print the prong structure of the jet + // + // This can be done in 2 ways: + // + // - either keeping the clustering information and get the + // branches as a succession of 2->1 recombinations (this is + // done calling "pieces" recursively) + cout << endl + << "Prongs with clustering information" << endl + << "----------------------------------" << endl; + print_prongs_with_clustering_info(rsd_jet, " "); + // + // - or getting all the branches in a single go (done directly + // through the jet associated structure) + cout << endl + << "Prongs without clustering information" << endl + << "-------------------------------------" << endl; + print_raw_prongs(rsd_jet); + + cout << "Groomed prongs information:" << endl; + cout << "index zg thetag" << endl; + vector > ztg = rsd_jet.structure_of().sorted_zg_and_thetag(); + for (unsigned int i=0; i(); + double dR = structure.delta_R(); + cout << " " << left << setw(14) << (prefix.substr(0, prefix.size()-1)+"+--> ") << right + << setw(8) << jet.pt() << setw(14) << jet.m() + << setw(5) << structure.dropped_count(false) + << setw(5) << structure.dropped_count() + << setw(11) << structure.max_dropped_symmetry(false); + + if (structure.has_substructure()){ + cout << setw(11) << structure.symmetry() + << setw(11) << structure.delta_R(); + } + cout << endl; + + if (dR>=0){ + vector pieces = jet.pieces(); + assert(pieces.size()==2); + print_prongs_with_clustering_info(pieces[0], prefix+" |"); + print_prongs_with_clustering_info(pieces[1], prefix+" "); + } +} + +//---------------------------------------------------------------------- +// print all the prongs inside the jet (no clustering info) +void print_raw_prongs(const PseudoJet &jet){ + cout << "(Raw) list of prongs:" << endl; + if (!jet.has_structure_of()){ + cout << " None (bad structure)" << endl; + return; + } + + cout << setw(5) << " " << setw(11) << "pt" << setw(14) << "mass" << endl; + + vector prongs = contrib::recursive_soft_drop_prongs(jet); + for (unsigned int iprong=0; iprong(); + cout << setw(5) << iprong << setw(11) << prong.pt() << setw(14) << prong.m() << endl; + + assert(!structure.has_substructure()); + } + cout << endl; +} + +//---------------------------------------------------------------------- +/// read in input particles +void read_event(vector &event){ + string line; + while (getline(cin, line)) { + istringstream linestream(line); + // take substrings to avoid problems when there are extra "pollution" + // characters (e.g. line-feed). + if (line.substr(0,4) == "#END") {return;} + if (line.substr(0,1) == "#") {continue;} + double px,py,pz,E; + linestream >> px >> py >> pz >> E; + PseudoJet particle(px,py,pz,E); + + // push event onto back of full_event vector + event.push_back(particle); + } +} + +//---------------------------------------------------------------------- +/// overloaded jet info output +ostream & operator<<(ostream & ostr, const PseudoJet & jet) { + if (jet == 0) { + ostr << " 0 "; + } else { + ostr << " pt = " << jet.pt() + << " m = " << jet.m() + << " y = " << jet.rap() + << " phi = " << jet.phi(); + } + return ostr; +} diff --git a/src/Tools/fjcontrib/RecursiveTools/example_recursive_softdrop.ref b/src/Tools/fjcontrib/RecursiveTools/example_recursive_softdrop.ref new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_recursive_softdrop.ref @@ -0,0 +1,83 @@ +# read an event with 354 particles +#-------------------------------------------------------------------------- +# FastJet release 3.3.1-devel +# M. Cacciari, G.P. Salam and G. Soyez +# A software package for jet finding and analysis at colliders +# http://fastjet.fr +# +# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package +# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210]. +# +# FastJet is provided without warranty under the terms of the GNU GPLv2. +# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code +# and 3rd party plugin jet algorithms. See COPYING file for details. +#-------------------------------------------------------------------------- +RecursiveSoftDrop groomer is: recursive application of [Recursive Groomer with a symmetry cut scalar_z > 0.2 (theta/1)^0.5 [SoftDrop], no mass-drop requirement, recursion into the subjet with larger pt], applied N=4 times, with R0 dynamically scaled + +original jet: pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 +RecursiveSoftDropped jet: pt = 811.261 m = 6.45947 y = -0.87094 phi = 2.9083 + +Prongs with clustering information +---------------------------------- + branch branch N_groomed max loc substructure + pt mass loc tot zdrop zg thetag + +--> 811.261 6.45947 13 13 0.0294298 0.154333 0.0200353 + +--> 669.635 1.98393 2 2 0 + +--> 141.627 0.765329 0 0 0 0.199906 0.00734861 + +--> 113.316 0.462946 0 0 0 0.208947 0.00550512 + | +--> 89.6387 0.211913 0 0 0 + | +--> 23.6769 0.13957 0 0 0 + +--> 28.3123 0.170026 0 0 0 0.248173 0.00447786 + +--> 21.286 0.13957 0 0 0 + +--> 7.02636 -3.21461e-05 0 0 0 + +Prongs without clustering information +------------------------------------- +(Raw) list of prongs: + pt mass + 0 669.635 1.98393 + 1 89.6387 0.211913 + 2 21.286 0.13957 + 3 23.6769 0.13957 + 4 7.02636 -3.21461e-05 + +Groomed prongs information: +index zg thetag + 1 0.154333 0.0200353 + 2 0.199906 0.00734861 + 3 0.208947 0.00550512 + 4 0.248173 0.00447786 + +original jet: pt = 908.098 m = 87.7124 y = 0.219482 phi = 6.03487 +RecursiveSoftDropped jet: pt = 830.517 m = 4.91035 y = 0.223054 phi = 6.02995 + +Prongs with clustering information +---------------------------------- + branch branch N_groomed max loc substructure + pt mass loc tot zdrop zg thetag + +--> 830.517 4.91035 12 13 0.0232056 0.060784 0.0153863 + +--> 778.731 3.66481 0 1 0 0.235041 0.0101382 + | +--> 599.106 0.403809 1 1 0 + | +--> 179.628 0.853363 0 1 0 0.25773 0.00871739 + | +--> 131.15 0.378456 1 1 0.0606587 0.315246 0.00417298 + | | +--> 89.8058 0.107191 0 0 0 + | | +--> 41.3448 0.13957 0 0 0 + | +--> 48.4785 0.13957 0 0 0 + +--> 51.7916 0.13957 0 0 0 + +Prongs without clustering information +------------------------------------- +(Raw) list of prongs: + pt mass + 0 599.106 0.403809 + 1 51.7916 0.13957 + 2 89.8058 0.107191 + 3 48.4785 0.13957 + 4 41.3448 0.13957 + +Groomed prongs information: +index zg thetag + 1 0.060784 0.0153863 + 2 0.235041 0.0101382 + 3 0.25773 0.00871739 + 4 0.315246 0.00417298 diff --git a/src/Tools/fjcontrib/RecursiveTools/example_softdrop.cc b/src/Tools/fjcontrib/RecursiveTools/example_softdrop.cc new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_softdrop.cc @@ -0,0 +1,122 @@ +//---------------------------------------------------------------------- +/// \file example_softdrop.cc +/// +/// This example program is meant to illustrate how the +/// fastjet::contrib::SoftDrop class is used. +/// +/// Run this example with +/// +/// \verbatim +/// ./example_softdrop < ../data/single-event.dat +/// \endverbatim +//---------------------------------------------------------------------- + +// $Id: example_softdrop.cc 705 2014-07-07 14:37:03Z gsoyez $ +// +// Copyright (c) 2014, Gavin P. Salam +// +//---------------------------------------------------------------------- +// This file is part of FastJet contrib. +// +// It is free software; you can redistribute it and/or modify it under +// the terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2 of the License, or (at +// your option) any later version. +// +// It is distributed in the hope that it will be useful, but WITHOUT +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +// License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this code. If not, see . +//---------------------------------------------------------------------- + +#include +#include + +#include +#include +#include +#include "fastjet/ClusterSequence.hh" +#include "SoftDrop.hh" // In external code, this should be fastjet/contrib/SoftDrop.hh + +using namespace std; +using namespace fastjet; + +// forward declaration to make things clearer +void read_event(vector &event); +ostream & operator<<(ostream &, const PseudoJet &); + +//---------------------------------------------------------------------- +int main(){ + + //---------------------------------------------------------- + // read in input particles + vector event; + read_event(event); + cout << "# read an event with " << event.size() << " particles" << endl; + + // first get some anti-kt jets + double R = 1.0, ptmin = 20.0; + JetDefinition jet_def(antikt_algorithm, R); + ClusterSequence cs(event, jet_def); + vector jets = sorted_by_pt(cs.inclusive_jets(ptmin)); + + // give the soft drop groomer a short name + // Use a symmetry cut z > z_cut R^beta + // By default, there is no mass-drop requirement + double z_cut = 0.10; + double beta = 2.0; + contrib::SoftDrop sd(beta, z_cut); + cout << "SoftDrop groomer is: " << sd.description() << endl; + + for (unsigned ijet = 0; ijet < jets.size(); ijet++) { + // Run SoftDrop and examine the output + PseudoJet sd_jet = sd(jets[ijet]); + cout << endl; + cout << "original jet: " << jets[ijet] << endl; + cout << "SoftDropped jet: " << sd_jet << endl; + + assert(sd_jet != 0); //because soft drop is a groomer (not a tagger), it should always return a soft-dropped jet + + cout << " delta_R between subjets: " << sd_jet.structure_of().delta_R() << endl; + cout << " symmetry measure(z): " << sd_jet.structure_of().symmetry() << endl; + cout << " mass drop(mu): " << sd_jet.structure_of().mu() << endl; + } + + return 0; +} + +//---------------------------------------------------------------------- +/// read in input particles +void read_event(vector &event){ + string line; + while (getline(cin, line)) { + istringstream linestream(line); + // take substrings to avoid problems when there are extra "pollution" + // characters (e.g. line-feed). + if (line.substr(0,4) == "#END") {return;} + if (line.substr(0,1) == "#") {continue;} + double px,py,pz,E; + linestream >> px >> py >> pz >> E; + PseudoJet particle(px,py,pz,E); + + // push event onto back of full_event vector + event.push_back(particle); + } +} + +//---------------------------------------------------------------------- +/// overloaded jet info output +ostream & operator<<(ostream & ostr, const PseudoJet & jet) { + if (jet == 0) { + ostr << " 0 "; + } else { + ostr << " pt = " << jet.pt() + << " m = " << jet.m() + << " y = " << jet.rap() + << " phi = " << jet.phi(); + } + return ostr; +} diff --git a/src/Tools/fjcontrib/RecursiveTools/example_softdrop.ref b/src/Tools/fjcontrib/RecursiveTools/example_softdrop.ref new file mode 100644 --- /dev/null +++ b/src/Tools/fjcontrib/RecursiveTools/example_softdrop.ref @@ -0,0 +1,33 @@ +# read an event with 354 particles +#-------------------------------------------------------------------------- +# FastJet release 3.0.6 +# M. Cacciari, G.P. Salam and G. Soyez +# A software package for jet finding and analysis at colliders +# http://fastjet.fr +# +# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package +# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210]. +# +# FastJet is provided without warranty under the terms of the GNU GPLv2. +# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code +# and 3rd party plugin jet algorithms. See COPYING file for details. +#-------------------------------------------------------------------------- +SoftDrop groomer is: Recursive Groomer with a symmetry cut scalar_z > 0.1 (theta/1)^2 [SoftDrop], no mass-drop requirement, recursion into the subjet with larger pt + +original jet: pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 +SoftDropped jet: pt = 980.44 m = 27.1382 y = -0.867485 phi = 2.90532 + delta_R between subjets: 0.209158 + symmetry measure(z): 0.0047049 + mass drop(mu): 0.835262 + +original jet: pt = 908.098 m = 87.7124 y = 0.219482 phi = 6.03487 +SoftDropped jet: pt = 887.935 m = 11.3171 y = 0.223247 phi = 6.03034 + delta_R between subjets: 0.111631 + symmetry measure(z): 0.00440752 + mass drop(mu): 0.791013 + +original jet: pt = 72.9429 m = 23.4022 y = -1.19083 phi = 6.1199 +SoftDropped jet: pt = 71.5847 m = 20.0943 y = -1.1761 phi = 6.12539 + delta_R between subjets: 0.680305 + symmetry measure(z): 0.0730158 + mass drop(mu): 0.56265