Page MenuHomeHEPForge

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6300 +1,6304 @@
+2018-03-27 Andy Buckley <andy.buckley@cern.ch>
+
+ * Add RatioPlotLogY key to make-plots. Thanks to Antonin Maire.
+
2018-02-22 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add highlighted source to HTML analysis metadata listings.
2017-12-21 Andy Buckley <andy.buckley@cern.ch>
* Version 2.6.0 release.
2017-12-20 Andy Buckley <andy.buckley@cern.ch>
* Typo fix in TOTEM_2012_I1220862 data -- thanks to Anton Karneyeu.
2017-12-19 Andy Buckley <andy.buckley@cern.ch>
* Adding contributed analyses: 1 ALICE, 6 ATLAS, 1 CMS.
* Fix bugged PID codes in MC_PRINTEVENT.
2017-12-13 Andy Buckley <andy.buckley@cern.ch>
* Protect Run methods and rivet script against being told to run from a missing or unreadable file.
2017-12-11 Andy Buckley <andy.buckley@cern.ch>
* Replace manual event count & weight handling with a YODA Counter object.
2017-11-28 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Various improvements to DISKinematics, DISLepton, and the ZEUS 2001 analysis.
2017-11-06 Andy Buckley <andy.buckley@cern.ch>
* Extend AOPath regex to allow dots and underscores in weight names.
2017-10-27 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Embed zstr and enable transparent reading of gzipped HepMC streams.
2017-10-03 Andy Buckley <andy.buckley@cern.ch>
* Use Lester MT2 bisection header, and expose a few more mT2 function signatures.
2017-09-26 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add deltaR2 functions for squared distances.
2017-09-10 Andy Buckley <andy.buckley@cern.ch>
* Add white backgrounds to make-plots main and ratio plot frames.
2017-09-05 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Protect make-plots against NaNs in error band values (patch from Dmitry Kalinkin).
2017-07-20 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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<double>.
2017-07-18 Andy Buckley <andy.buckley@cern.ch>
* Enable methods for booking of Histo2D and Profile2D from Scatter3D reference data.
* Remove IsRef annotation from autobooked histogram objects.
2017-07-17 Andy Buckley <andy.buckley@cern.ch>
* Add pair-smearing to SmearedJets.
2017-07-08 Andy Buckley <andy.buckley@cern.ch>
* Add Event::centrality(), for non-HepMC access to the generator
value if one has been recorded -- otherwise -1.
2017-06-28 Andy Buckley <andy.buckley@cern.ch>
* Split the smearing functions into separate header files for
generic/momentum, Particle, Jet, and experiment-specific smearings
& efficiencies.
2017-06-27 Andy Buckley <andy.buckley@cern.ch>
* Add 'JetFinder' alias for JetAlg, by analogy with ParticleFinder.
2017-06-26 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add portable OpenMP enabling flags to AM_CXXFLAGS.
2017-06-22 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <jmb@hep.ucl.ac.uk>
* Fix normalisations in CMS_2016_I1454211.
* Fix analysis name in ref histo paths for ATLAS_2017_I1591327.
2017-06-18 Andy Buckley <andy.buckley@cern.ch>
* Move all standard plugin files into subdirs of src/Analyses,
with some custom make rules driving rivet-buildplugin.
2017-06-18 David Grellscheid <david.grellscheid@durham.ac.uk>
* Parallelise rivet-buildplugin, with source-file cat'ing and use
of a temporary Makefile.
2016-06-18 Holger Schulz <holger.schulz@durham.ac.uk>
* Version 2.5.4 release!
2016-06-17 Holger Schulz <holger.schulz@durham.ac.uk>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <holger.schulz@durham.ac.uk>
* 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 <holger.schulz@durham.ac.uk>
* 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 <holger.schulz@durham.ac.uk>
* Tidy ALEPH_1999 charm fragmentation analysis and normalise to data
integral. Added DSTARPLUS and DSTARMINUS to PID.
2017-05-16 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add ATLAS_2013_I1234228, high-mass Drell-Yan at 7 TeV.
2017-05-10 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Replace non-template Analysis::refData functions with C++11 default T=Scatter2D.
2017-03-29 Andy Buckley <andy.buckley@cern.ch>
* 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 <peter.richardson@durham.ac.uk>
* 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 <andy.buckley@cern.ch>
* Add Cut and functor selection args to HeavyHadrons accessor methods.
2017-03-03 Andy Buckley <andy.buckley@cern.ch>
* bin/rivet-mkanalysis: Add FastJets.hh include by default -- it's almost always used.
2017-03-02 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add BoolParticleAND, BoolJetOR, etc. functor combiners to
Tools/ParticleUtils.hh and Tools/JetUtils.hh.
2017-02-24 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add aggregate signal regions to CMS_2016_PAS_SUS_16_14.
2017-02-18 Andy Buckley <andy.buckley@cern.ch>
* Add getEnvParam function, for neater use of environment variable
parameters with a required default.
2017-02-05 Andy Buckley <andy.buckley@cern.ch>
* Add HasBTag and HasCTag jet functors, with lower-case aliases.
2017-01-18 Andy Buckley <andy.buckley@cern.ch>
* Use std::function in functor-expanded method signatures on JetAlg.
2017-01-16 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Version 2.5.3 release.
2016-12-12 Holger Schulz <holger.schulz@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Require Cython 0.24 or later.
2016-12-02 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Adding ALICE_2012_I1116147 (eta and pi0 pTs and ratio) and
ATLAS_2011_I929691 (7 TeV jet frag)
2016-11-30 Andy Buckley <andy.buckley@cern.ch>
* Fix bash bugs in rivet-buildplugin, including fixing the --cmd mode.
2016-11-28 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Adding pTvec() function to 4-vectors and ParticleBase.
* Fix --pwd option of the rivet script
2016-11-21 Andy Buckley <andy.buckley@cern.ch>
* Add weights and scaling to Cutflow/s.
2016-11-19 Andy Buckley <andy.buckley@cern.ch>
* Add Et(const ParticleBase&) unbound function.
2016-11-18 Andy Buckley <andy.buckley@cern.ch>
* Fix missing YAML quote mark in rivet-mkanalysis.
2016-11-15 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add rough ATLAS and CMS photon reco efficiency functions from
Delphes (ATLAS and CMS versions are identical, hmmm)
2016-10-12 Andy Buckley <andy.buckley@cern.ch>
* Tidying/fixing make-plots custom z-ticks code. Thanks to Dmitry Kalinkin.
2016-10-03 Holger Schulz <holger.schulz@cern.ch>
* Fix SpiresID -> InspireID in some analyses (show-analysis pointed to
non-existing web page)
2016-09-29 Holger Schulz <holger.schulz@cern.ch>
* Add Luminosity_fb to AnalysisInfo
* Added some keywords and Lumi to ATLAS_2016_I1458270
2016-09-28 Andy Buckley <andy.buckley@cern.ch>
* 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 <frank.siegert@cern.ch>
* make-plots bugfix in y-axis labels for RatioPlotMode=deviation
2016-09-27 Andy Buckley <andy.buckley@cern.ch>
* Add vector and scalar pT (rather than Et) to MissingMomentum.
2016-09-27 Holger Schulz <holger.schulz@cern.ch>
* Analysis keyword machinery
* rivet -a @semileptonic
* rivet -a @semileptonic@^bdecays -a @semileptonic@^ddecays
2016-09-22 Holger Schulz <holger.schulz@cern.ch>
* Release version 2.5.2
2016-09-21 Andy Buckley <andy.buckley@cern.ch>
* 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 <holger.schulz@cern.ch>
* 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 <holger.schulz@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add CMS partonic top analysis (CMS_2015_I1397174)
2016-09-18 Holger Schulz <holger.schulz@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add has{Ancestor,Parent,Child,Descendant}With functions and
HasParticle{Ancestor,Parent,Child,Descendant}With functors.
2016-09-16 Holger Schulz <holger.schulz@cern.ch>
* Add ATLAS 8TeV ttbar analysis from contrib (ATLAS_2015_I1404878)
2016-09-16 Andy Buckley <andy.buckley@cern.ch>
* Add particles(GenParticlePtr) to RivetHepMC.hh
* Add hasParent, hasParentWith, and hasAncestorWith to Particle.
2016-09-15 Holger Schulz <holger.schulz@cern.ch>
* 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 <holger.schulz@cern.ch>
* Explicit std::toupper and std::tolower to make clang happy
2016-09-14 Andy Buckley <andy.buckley@cern.ch>
* Add ATLAS Run 2 0-lepton SUSY and monojet search papers (ATLAS_2016_I1452559, ATLAS_2016_I1458270)
2016-09-13 Andy Buckley <andy.buckley@cern.ch>
* 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 <holger.schulz@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <holger.schulz@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add templated functor filtering args to the Particle parent/child/descendent methods.
2016-09-06 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add rapidity scheme arg to DeltaR functor constructors.
2016-08-23 Andy Buckley <andy.buckley@cern.ch>
* 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 <holger.schulz@cern.ch>
* Bugfix in rivet-mkhtml (NoneType: ana.spiresID() --> spiresid)
* Added <numeric> include to Rivet/Tools/Utils.h to make gcc6 happy
2016-08-22 Andy Buckley <andy.buckley@cern.ch>
* Add efffilt() functions and Particle/JetEffFilt functors to SmearingFunctions.hh
2016-08-20 Andy Buckley <andy.buckley@cern.ch>
* Adding filterBy methods for Particle and Jet which accept
generic boolean functions as well as the Cut specialisation.
2016-08-18 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add convenience headers for including all final-state and
smearing projections, to save user typing.
2016-08-12 Andy Buckley <andy.buckley@cern.ch>
* 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 <holger.schulz@cern.ch>
* 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 <holger.schulz@cern.ch>
* 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 <holger.schulz@cern.ch>
* Release 2.5.1
2016-08-08 Andy Buckley <andy.buckley@cern.ch>
* Add a simple MC_MET analysis for out-of-the-box MET distribution testing.
2016-08-08 Holger Schulz <holger.schulz@cern.ch>
* 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 <holger.schulz@cern.ch>
* 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 <holger.schulz@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add SmearedMET projection, wrapping MissingMomentum.
* Include base truth-level projections in SmearedParticles/Jets compare() methods.
2016-07-29 Andy Buckley <andy.buckley@cern.ch>
* 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 <holger.schulz@cern.ch>
* Mark D0_2000... W pT analysis validated
* Mark LHCB_2011_S919... phi meson analysis validated
2016-07-25 Andy Buckley <andy.buckley@cern.ch>
* 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<ptr> 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 <holger.schulz@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <holger.schulz@cern.ch>
* Fix the --nskip behaviour on the main rivet script.
2016-07-07 Andy Buckley <andy.buckley@cern.ch>
* Release version 2.5.0
2016-07-01 Andy Buckley <andy.buckley@cern.ch>
* Fix pandoc interface flag version detection.
2016-06-28 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add ATLAS_2016_I1457605 inclusive photon analysis at 8 TeV.
2016-06-15 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add and use projection handling methods declare(proj, pname) and
apply<PROJ>(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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Adding ATLAS 13 TeV minimum bias analysis, ATLAS_2016_I1419652.
2016-05-30 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <holger.schulz@durham.ac.uk>
* Mark ATLAS_2012_I1082009 as validated after exhaustive tests with
Pythia8 and Sherpa in inclusive QCD mode.
2016-05-11 Andy Buckley <andy.buckley@cern.ch>
* Specialise return error codes from the rivet script.
2016-05-11 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add CMS_2014_I1305624 event shapes analysis, with standalone
variable calculation struct embedded in an unnamed namespace.
2016-04-19 Andy Buckley <andy.buckley@cern.ch>
* Various clean-ups and fixes in ATLAS analyses using isolated
photons with median pT density correction.
2016-04-18 Andy Buckley <andy.buckley@cern.ch>
* Add transformBy(LT) methods to Particle and Jet.
* Add mkObjectTransform and mkFrameTransform factory methods to LorentzTransform.
2016-04-17 Andy Buckley <andy.buckley@cern.ch>
* Add null GenVertex protection in Particle children & descendants methods.
2016-04-15 Andy Buckley <andy.buckley@cern.ch>
* Add ATLAS_2015_I1397637, ATLAS 8 TeV boosted top cross-section vs. pT
2016-04-14 Andy Buckley <andy.buckley@cern.ch>
* Add a --no-histos argument to the rivet script.
2016-04-13 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Patch PID utils for ordering issues in baryon decoding.
2016-04-11 Andy Buckley <andy.buckley@cern.ch>
* Actually implement ZEUS_2001_S4815815... only 10 years late!
2016-04-08 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Bug-fix in semi-leptonic top selection of CMS_2015_I1370682.
2016-03-12 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Release 2.4.1
2016-03-03 Andy Buckley <andy.buckley@cern.ch>
* 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 <holger.schulz@durham.ac.uk>
* Add ATLAS 7 TeV event shapes in Z+jets analysis (ATLAS_2016_I1424838)
2016-02-29 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Update ParticleIdUtils.hh (i.e. PID:: functions) to use the
functions from the latest version of MCUtils' PIDUtils.h.
2016-01-15 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Pro-actively use -m/-M arguments when initially loading
histograms in mkhtml, *before* passing them to cmphistos.
2015-12-03 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Write out intermediate histogram files by default, with event interval of 10k.
2015-11-25 Andy Buckley <andy.buckley@cern.ch>
* Protect make-plots against lock-up due to partial pstricks command when there are no data points.
2015-11-17 Andy Buckley <andy.buckley@cern.ch>
* rivet-cmphistos: Use a ratio label that doesn't mention 'data' when plotting MC vs. MC.
2015-11-12 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Handle 2D histograms better in rivet-cmphistos (since they can't be overlaid)
2015-11-05 Andy Buckley <andy.buckley@cern.ch>
* 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 <holger.schulz@durham.ac.uk>
* Adding LHCB inelastic xsection measurement (LHCB_2015_I1333223)
* Adding ATLAS colour flow in ttbar->semileptonic measurement (ATLAS_2015_I1376945)
2015-10-07 Chris Pollard <cpollard@cern.ch>
* Release 2.4.0
2015-10-06 Holger Schulz <holger.schulz@durham.ac.uk>
* Adding CMS_2015_I1327224 dijet analysis (Mjj>2 TeV)
2015-10-03 Holger Schulz <holger.schulz@durham.ac.uk>
* Adding CMS_2015_I1346843 Z+gamma
2015-09-30 Andy Buckley <andy.buckley@cern.ch>
* 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 <holger.schulz@durham.ac.uk>
* Adding D0_2000_I503361 ZPT at 1800 GeV
2015-09-29 Chris Pollard <cpollard@cern.ch>
* Adding ATLAS_2015_CONF_2015_041
2015-09-29 Chris Pollard <cpollard@cern.ch>
* Adding ATLAS_2015_I1387176
2015-09-29 Chris Pollard <cpollard@cern.ch>
* Adding ATLAS_2014_I1327229
2015-09-28 Chris Pollard <cpollard@cern.ch>
* Adding ATLAS_2014_I1326641
2015-09-28 Holger Schulz <holger.schulz@durham.ac.uk>
* Adding CMS_2013_I1122847 FB assymetry in DY analysis
2015-09-28 Andy Buckley <andy.buckley@cern.ch>
* Adding CMS_2015_I1385107 LHA pp 2.76 TeV track-jet underlying event.
2015-09-27 Andy Buckley <andy.buckley@cern.ch>
* Adding CMS_2015_I1384119 LHC Run 2 minimum bias dN/deta with no B field.
2015-09-25 Andy Buckley <andy.buckley@cern.ch>
* Adding TOTEM_2014_I1328627 forward charged density in eta analysis.
2015-09-23 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Allow access to MissingMomentum projection via WFinder.
* Adding extra methods to MissingMomentum, to make it more user-friendly.
2015-09-09 Andy Buckley <andy.buckley@cern.ch>
* Fix factor of 2 in LHCB_2013_I1218996 normalisation, thanks to
Felix Riehn for the report.
2015-08-20 Frank Siegert <frank.siegert@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Version 2.3.0 release.
2015-07-02 Holger Schulz <holger.schulz@durham.ac.uk>
* 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 <andy.buckley@cern.ch>
* 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 <holger.schulz@durham.ac.uk>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <holger.schulz@durham.ac.uk>
* Normalisation discussion concerning ATLAS_2014_I1325553
is resolved. Changed YLabel accordingly.
2015-05-19 Holger Schulz <holger.schulz@durham.ac.uk>
* 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 <peter.richardson@durham.ac.uk>
* Fix ATLAS_2014_I1325553 normalisation of histograms was wrong by
factor of two |y| vs y problem
2015-05-01 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <holger.schulz@durham.ac.uk>
* Add CMS 7 TeV rapidity gap analysis (CMS_2015_I1356998).
* Remove FinalState Projection.
2015-03-30 Holger Schulz <holger.schulz@durham.ac.uk>
* Add ATLAS 7 TeV photon + jets analysis (ATLAS_2013_I1244522).
2015-03-26 Andy Buckley <andy.buckley@cern.ch>
* Updates for HepMC 2.07 interface constness improvements.
2015-03-25 Holger Schulz <holger.schulz@durham.ac.uk>
* Add ATLAS double parton scattering in W+2j analysis (ATLAS_2013_I1216670).
2015-03-24 Andy Buckley <andy.buckley@cern.ch>
* 2.2.1 release!
2015-03-23 Holger Schulz <holger.schulz@durham.ac.uk>
* Add ATLAS differential Higgs analysis (ATLAS_2014_I1306615).
2015-03-19 Chris Pollard <cpollard@cern.ch>
* Add ATLAS V+gamma analyses (ATLAS_2013_I1217863)
2015-03-20 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Mark ATLAS_2012_I1083318 as VALIDATED and fix d25-x01-y02 ref data.
2015-03-19 Chris Pollard <cpollard@cern.ch>
* Add ATLAS W and Z angular analyses (ATLAS_2011_I928289)
2015-03-19 Andy Buckley <andy.buckley@cern.ch>
* 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 <holger.schulz@durham.ac.uk>
* 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 <andy.buckley@cern.ch>
* Adding CMS_2014_I1298810 and CMS_2014_I1303894 analyses.
2015-03-18 Holger Schulz <holger.schulz@durham.ac.uk>
* 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 <andy.buckley@cern.ch>
* Change UnstableFinalState duplicate resolution to use the last
in a chain rather than the first.
2015-03-17 Holger Schulz <holger.schulz@durham.ac.uk>
* 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 <cpollard@cern.ch>
* Removed fuzzyEquals() from Vector3::angle()
2015-03-16 Andy Buckley <andy.buckley@cern.ch>
* Adding Cuts-based constructor to PrimaryHadrons.
* Adding missing compare() method to HeavyHadrons projection.
2015-03-15 Chris Pollard <cpollard@cern.ch>
* Adding FinalPartons projection which selects the quarks and
gluons immediately before hadronization
2015-03-05 Andy Buckley <andy.buckley@cern.ch>
* Adding Cuts-based constructors and other tidying in UnstableFinalState and HeavyHadrons
2015-03-03 Andy Buckley <andy.buckley@cern.ch>
* Add support for a PLOT meta-file argument to rivet-cmphistos.
2015-02-27 Andy Buckley <andy.buckley@cern.ch>
* Improved time reporting.
2015-02-24 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Converting 'bitwise' to 'logical' Cuts combinations in all analyses.
2015-02-02 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Interface improvements in DressedLeptons constructor.
* Adding DEPRECATED macro to throw compiler deprecation warnings when using deprecated features.
2014-11-25 Andy Buckley <andy.buckley@cern.ch>
* Adding Cut-based constructors, and various constructors with
lists of PDG codes to IdentifiedFinalState.
2014-11-20 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Fix a bug in the isCharmHadron(pid) function and remove isStrange* functions.
2014-09-30 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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<NUM>) function and fixing the other stats
functions to operate on vector<NUM> rather than vector<int>.
2014-09-03 Andy Buckley <andy.buckley@cern.ch>
* Fix wrong behaviour of LorentzTransform with a null boost vector
-- thanks to Michael Grosse.
2014-08-26 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Version bump to 2.2.0beta1 for use at BOOST and MCnet school.
2014-08-13 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Adding PromptFinalState, based on code submitted by Alex
Grohsjean and Will Bell. Thanks!
2014-08-06 Andy Buckley <andy.buckley@cern.ch>
* Adding MC_HFJETS and MC_JETTAGS analyses.
2014-08-05 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Remove classifier functions accepting a Particle from the PID
inner namespace.
2014-07-29 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Fix to logspace: make sure that start and end values are exact,
not the result of exp(log(x)).
2014-07-16 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add stupid missing <string> include and std:: prefix in Rivet.hh
2014-06-20 Holger Schulz <hschulz@physik.hu-berlin.de>
* 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 <David.Grellscheid@durham.ac.uk>
* pyext/rivet/Makefile.am: 'make distcheck' and out-of-source
builds should work now.
2014-06-10 Andy Buckley <andy.buckley@cern.ch>
* Fix use of the install command for bash completion installation on Macs.
2014-06-07 Andy Buckley <andy.buckley@cern.ch>
* Removing direct includes of MathUtils.hh and others from analysis code files.
2014-06-02 Andy Buckley <andy.buckley@cern.ch>
* Rivet 2.1.2 release!
2014-05-30 Andy Buckley <andy.buckley@cern.ch>
* 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 <hschulz@physik.hu-berlin.de>
* 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 <hschulz@physik.hu-berlin.de>
* Re-enable 2D histo in MC_PDFS
2014-05-28 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Adding any(iterable, fn) and all(iterable, fn) template functions for convenience.
2014-05-15 Holger Schulz <holger.schulz@cern.ch>
* Fix some bugs in identified hadron PIDs in OPAL_1998_S3749908.
2014-05-13 Andy Buckley <andy.buckley@cern.ch>
* Writing out [UNVALIDATED], [PRELIMINARY], etc. in the
--list-analyses output if analysis is not VALIDATED.
2014-05-12 Andy Buckley <andy.buckley@cern.ch>
* Adding CMS_2013_I1265659 colour coherence analysis.
2014-05-07 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Fix missing abs() in Particle::abspid()!!!!
2014-04-14 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Flattening PNG output of make-plots (i.e. no transparency) and other tweaks.
2014-03-23 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Rivet 2.1.1 release.
2014-03-07 Andy Buckley <andy.buckley@cern.ch>
* Adding ATLAS multilepton search (no ref data file), ATLAS_2012_I1204447.
2014-03-05 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 2.1.0 release!
2014-02-05 Andy Buckley <andy.buckley@cern.ch>
* Protect against invalid prefix value if the --prefix configure option is unused.
2014-02-03 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Removing unused/overrestrictive Isolation* headers.
2014-01-27 Andy Buckley <andy.buckley@cern.ch>
* 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 <david.grellscheid@durham.ac.uk>
* 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 <andy.buckley@cern.ch>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy@duality>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Adding the GSL lib path to the library path in the env scripts
and the rivet-config --ldflags output.
2013-10-25 Andy Buckley <andy.buckley@cern.ch>
* 2.0.0 release!!!!!!
2013-10-24 Andy Buckley <andy.buckley@cern.ch>
* Supporting zsh completion via bash completion compatibility.
2013-10-22 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Several small fixes in jet shape analyses, SFM_1984, etc. found
in the last H++ validation run.
2013-10-18 Andy Buckley <andy.buckley@cern.ch>
* Updates to configure and the rivetenv scripts to try harder to discover YODA.
2013-09-26 Andy Buckley <andy.buckley@cern.ch>
* Now bundling Cython-generated files in the tarballs, so Cython
is not a build requirement for non-developers.
2013-09-24 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Add the -avoid-version flag to libtool.
* Final analysis histogramming issues resolved.
2013-08-16 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Adding a new HeavyHadrons projection.
* Adding optional extra include_end args to logspace() and linspace().
2013-06-11 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Releasing 2.0.0b2 beta version.
2013-06-05 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Removing Constraints.hh header.
* Minor bugfixes and improvements in Scatter2D booking and MC_JetAnalysis.
2013-05-28 Andy Buckley <andy.buckley@cern.ch>
* Removing defunct HistoFormat.hh and HistoHandler.{hh,cc}
2013-05-27 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Analysis histo booking improvements for Scatter2D, placeholders
for 2D histos, and general tidying.
2013-05-12 Andy Buckley <andy.buckley@cern.ch>
* Adding configure-time differentiation between yaml-cpp API versions 3 and 5.
2013-05-07 Andy Buckley <andy.buckley@cern.ch>
* Converting info file reading to use the yaml-cpp 0.5.x API.
2013-04-12 Andy Buckley <andy.buckley@cern.ch>
* Tagging as 2.0.0b1
2013-04-04 Andy Buckley <andy.buckley@cern.ch>
* Removing bundling of yaml-cpp: it needs to be installed by the
user / bootstrap script from now on.
2013-04-03 Andy Buckley <andy.buckley@cern.ch>
* Removing svn:external m4 directory, and converting Boost
detection to use better boost.m4 macros.
2013-03-22 Andy Buckley <andy.buckley@cern.ch>
* Moving PID consts to the PID namespace and corresponding code
updates and opportunistic clean-ups.
* Adding Particle::fromDecay() method.
2013-03-09 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <David.Grellscheid@durham.ac.uk>
* include/Rivet/Math/MathUtils.hh: added BWspace bin edge method
to give equal-area Breit-Wigner bins
2013-02-01 Andy Buckley <andy.buckley@cern.ch>
* 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 <frank.siegert@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* Fix TeX variable in the rivetenv scripts, especially for csh
2012-12-21 Andy Buckley <andy.buckley@cern.ch>
* Version 1.8.2 release!
2012-12-20 Andy Buckley <andy.buckley@cern.ch>
* Adding ATLAS_2012_I1119557 analysis (from Roman Lysak and Lily Asquith).
2012-12-18 Andy Buckley <andy.buckley@cern.ch>
* Adding TOTEM_2012_002 analysis, from Sercan Sen.
2012-12-18 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Added CMS_2011_I954992 analysis
2012-12-17 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Added CMS_2012_I1193338 analysis
* Fixed xi cut in ATLAS_2011_I894867
2012-12-17 Andy Buckley <andy.buckley@cern.ch>
* Adding analysis descriptions to the HTML analysis page ToC.
2012-12-14 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Added CMS_2012_PAS_FWD_11_003 analysis
* Added LHCB_2012_I1119400 analysis
2012-12-12 Andy Buckley <andy.buckley@cern.ch>
* Correction to jet acceptance in CMS_2011_S9120041, from Sercan Sen: thanks!
2012-12-12 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Added CMS_2012_PAS_QCD_11_010 analysis
2012-12-07 Andy Buckley <andy.buckley@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* Added ALICE_2012_I1181770 analysis
* Bump version to 1.8.2
2012-12-06 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy.buckley@cern.ch>
* Converting CMS_2012_I1102908 analysis to use YODA.
* Adding XLabel and YLabel setting in histo/profile/scatter booking.
2012-11-27 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Fix make-plots png creation for SL5
2012-11-23 Peter Richardson <peter.richardson@durham.ac.uk>
* Added ATLAS_2012_CONF_2012_153 4-lepton SUSY search
2012-11-17 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Adding MC_PRINTEVENT, a convenient (but verbose!) analysis for
printing out event details to stdout.
2012-11-15 Andy Buckley <andy.buckley@cern.ch>
* Removing the long-unused/defunct autopackage system.
2012-11-15 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Added LHCF_2012_I1115479 analysis
* Added ATLAS_2011_I894867 analysis
2012-11-14 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Added CMS_2012_I1102908 analysis
2012-11-14 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* Added CMS_2012_I1107658 analysis
2012-10-11 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Added CDF_2012_NOTE10874 analysis
2012-10-04 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Added ATLAS_2012_I1183818 analysis
2012-07-17 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy.buckley@cern.ch>
* Fixing aida2root command-line help message and converting to TH*
rather than TGraph by default.
2012-07-24 Andy Buckley <andy.buckley@cern.ch>
* Improvements/migrations to rivet-mkhtml, rivet-mkanalysis, and
rivet-buildplugin.
2012-07-17 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Add CMS_2012_I1087342
2012-07-12 Andy Buckley <andy.buckley@cern.ch>
* Fix rivet-mkanalysis a bit for YODA compatibility.
2012-07-05 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Version 1.8.1!
2012-07-05 Holger Schulz <holger.schulz@physik.hu-berlin.de>
* Add ATLAS_2011_I945498
2012-07-03 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Bugfix for transverse mass (thanks to Gavin Hesketh)
2012-06-29 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Merge YODA branch into trunk. YODA is alive!!!!!!
2012-06-26 Holger Schulz <holger.schulz@physik.hu-berlin.de>
* Add ATLAS_2012_I1091481
2012-06-20 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Added D0_2011_I895662: 3-jet mass
2012-04-24 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* fixed a few bugs in rivet-rmgaps
* Added new TOTEM dN/deta analysis
2012-03-19 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* Improve default plot behaviour for 2D histograms
2012-03-15 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy.buckley@cern.ch>
* Marking ATLAS_2011_I919017 as VALIDATED (this should have
happened a long time ago) and adding more references.
2012-02-28 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* lighthisto.py: Caching for re.compile(). This speeds up aida2flat
and flat2aida by more than an order of magnitude.
2012-02-27 Andy Buckley <andy.buckley@cern.ch>
* doc/mk-analysis-html: Adding more LaTeX/text -> HTML conversion
replacements, including better <,> handling.
2012-02-26 Andy Buckley <andy.buckley@cern.ch>
* 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 <holger.schulz@physik.hu-berlin.de>
* Adding ATLAS Ks/Lambda analysis.
2012-02-20 Andy Buckley <andy.buckley@cern.ch>
* src/Analyses/ATLAS_2011_I925932.cc: Using new overflow-aware
normalize() in place of counters and scale(..., 1/count)
2012-02-14 Andy Buckley <andy.buckley@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* DELPHI_1996_S3430090 and ALEPH_1996_S3486095:
fix rapidity vs {Thrust,Sphericity}-axis.
2012-02-14 Andy Buckley <andy.buckley@cern.ch>
* 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 <frank.siegert@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* 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 <david.grellscheid@durham.ac.uk>
* Fixed broken UnstableFS behaviour
2012-01-25 Frank Siegert <frank.siegert@cern.ch>
* 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 <holger.schulz@physik.hu-berlin.de>
* Add ATLAS diffractive gap analysis
2012-01-23 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Tidying lighthisto, including fixing the order in which +- error
values are passed to the Bin constructor in fromFlatHisto.
2012-01-16 Frank Siegert <frank.siegert@cern.ch>
* 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 <peter.richardson@durham.ac.uk>
* Fixes to ATLAS_20111_S9225137 to include reference data
2012-01-13 Holger Schulz <holger.schulz@physik.hu-berlin.de>
* Add ATLAS inclusive lepton analysis
2012-01-12 Hendrik Hoeth <hendrik.hoeth@durham.ac.uk>
* Font selection support in rivet-mkhtml
2012-01-11 Peter Richardson <peter.richardson@durham.ac.uk>
* Added pi0 to list of particles.
2012-01-11 Andy Buckley <andy.buckley@cern.ch>
* Removing references to Boost random numbers.
2011-12-30 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Adding a command line completion function for rivet-mkhtml.
2011-12-12 Frank Siegert <frank.siegert@cern.ch>
* 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 <andy.buckley@cern.ch>
* Include underflow and overflow bins in the normalisation when
calling Analysis::normalise(h)
2011-11-23 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* 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 <andy.buckley@cern.ch>
* Adding a guide to compiling a new analysis template to the
output message of rivet-mkanalysis.
2011-11-11 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy@insectnation.org>
* 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 <frank.siegert@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <frank.siegert@cern.ch>
* Add four CMS QCD analyses kindly provided by CMS.
2011-10-12 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Removing SVertex.
2011-10-11 James Monk <jmonk@cern.ch>
* 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 <jmonk@cern.ch>
* Fix bug in ATLAS_2010_S8817804 that misidentified the akt4 jets
as akt6
2011-09-29 Andy Buckley <andy@insectnation.org>
* Converting FinalStateHCM to a slightly more general
DISFinalState.
2011-09-26 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* make-plots: Fixing regex for \physicscoor. Adding "FrameColor"
option.
2011-09-17 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Added ALICE_2011_S8909580 (strange particle production at 900 GeV)
* Feed-down correction in ALICE_2011_S8945144
2011-09-16 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* lighthisto fixes from Christian Roehr.
2011-08-26 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <frank.siegert@cern.ch>
* Added ATLAS_2011_S9126244
* Added ATLAS_2011_S9128077
2011-08-23 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <frank.siegert@cern.ch>
* 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 <dave.mallows@gmail.com>
* Fix aida2flat to ignore empty dataPointSet
2011-08-07 Andy Buckley <andy@insectnation.org>
* 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 <frank.siegert@cern.ch>
Version 1.6.0 release!
2011-08-01 Frank Siegert <frank.siegert@cern.ch>
* 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 <andy@insectnation.org>
* Version 1.5.2 release!
* New version of aida2root from James Monk.
2011-07-29 Frank Siegert <frank.siegert@cern.ch>
* Fix implementation of --config file option in make-plots.
2011-07-27 David Mallows <dave.mallows@gmail.com>
* Updated MC_TTBAR.plot to reflect updated analysis.
2011-07-25 Andy Buckley <andy@insectnation.org>
* 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 <frank.siegert@cern.ch>
* 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 <andy@insectnation.org>
* Making MC_TTBAR work with semileptonic ttbar events and generally
tidying the code.
2011-07-19 Andy Buckley <andy@insectnation.org>
* Version bump to 1.5.2.b01 in preparation for a release in the
very near future.
2011-07-18 David Mallows <dave.mallows@gmail.com>
* Replaced MC_TTBAR: Added t,tbar reconstruction. Not yet working.
2011-07-18 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* Rivet PDF manual updates, to not spread disinformation about
bootstrapping a Genser repo.
2011-07-12 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* fix fromFlat() in lighthistos: It would ignore histogram paths
before.
* flat2aida: preserve histogram order from .dat files
2011-06-27 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <frank.siegert@cern.ch>
* Bugfixes in WFinder.
2011-06-10 Andy Buckley <andy@insectnation.org>
* Adding \physicsxcoor and \physicsycoor treatment to make-plots.
2011-06-06 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* Adding auto conversion of Histogram2D to DataPointSets in the
AnalysisHandler _normalizeTree method.
2011-06-03 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Add BeamThrust projection
2011-05-31 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Ignore duplicate files in compare-histos.
2011-04-25 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Added ATLAS_2011_S9002537 W asymmetry analysis
2011-04-14 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <david.grellscheid@durham.ac.uk>
* added ATLAS 8983313: 0-lepton BSM
2011-04-01 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <Leif.Lonnblad@thep.lu.se>
* src/Core/AnalysisHandler.cc (AnalysisHandler::removeAnalysis):
Fixed strange shared pointer assignment that caused seg-fault.
2011-03-13 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* filling of functions works now in a more intuitive way (I hope).
2011-03-09 Andy Buckley <andy@insectnation.org>
* Version 1.5.0 release!
2011-03-08 Andy Buckley <andy@insectnation.org>
* Adding some extra checks for external packages in make-plots.
2011-03-07 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding the ATLAS 2011 transverse jet shapes analysis.
2011-02-18 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Support for transparency in make-plots
2011-02-18 Frank Siegert <frank.siegert@cern.ch>
* Added ATLAS prompt photon analysis ATLAS_2010_S8914702
2011-02-10 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <frank.siegert@cern.ch>
* Add final version of ATLAS dijet azimuthal decorrelation
2011-02-10 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding ATLAS 2010 min bias and underlying event analyses and data.
2011-01-23 Andy Buckley <andy@insectnation.org>
* Make make-plots write out PDF rather than PS by default.
2011-01-12 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Clean up ATLAS dijet analysis.
2010-12-30 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Fix the cuts in the CDF 1994 colour coherence analysis.
2010-12-19 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Fixing unbooked-histo segfault in UA1_1990_S2044935 at 63 GeV.
2010-12-08 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Change LegendXPos behaviour in make-plots. Now the top left
corner of the legend is used as anchor point.
2010-12-03 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Fix normalisation issues in UA5 and ALEPH analyses
2010-11-27 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* Adding ATLAS-CONF-2010-081 conference note. Data is read from plots.
2010-11-06 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Adding ATLAS-CONF-2010-031 conference note. Data is read from plots.
2010-10-29 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding a --with-root flag to rivet-buildplugin to add
root-config --libs flags to the plugin build command.
2010-09-24 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Fix error in N_effective definition for weighted profile errors.
2010-08-18 Andy Buckley <andy@insectnation.org>
* Adding MC_GENERIC analysis. NB. Frank Siegert also added MC_HJETS.
2010-08-03 Andy Buckley <andy@insectnation.org>
* Fixing compare-histos treatment of what is now a ref file, and
speeding things up... again. What a mess!
2010-08-02 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding an explicit library dependency declaration on libHepMC,
and hence removing the -lHepMC from the rivet-config --libs
output.
2010-07-14 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Making rivet-buildplugin look in its own bin directory when
trying to find rivet-config.
2010-06-23 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Fixing factor-of-2 bug in the error calculation when scaling
histograms.
* Fixing D0_2001_S4674421 analysis.
2010-05-11 Andy Buckley <andy@insectnation.org>
* Replacing TotalVisibleMomentum with MissingMomentum in analyses
and WFinder. Using vector ET rather than scalar ET in some places.
2010-05-07 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Fixing LaTeX problems (make-plots) on ancient machines, like lxplus.
2010-04-29 Andy Buckley <andy@insectnation.org>
* Fixing (I hope!) the treatment of weighted profile bin errors in LWH.
2010-04-21 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* remove obsolete reference to InitialQuarks from DELPHI_2002
* fix normalisation in CDF_2000_S4155203
2010-04-20 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Tag as patch release 1.2.1.
2010-03-22 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Tagging for 1.2.0 release... at last!
2010-03-01 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Update WFinder to not place cuts and other restrictions on the
neutrino.
2010-02-11 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* New option "RatioPlotMode=deviation" in make-plots.
2009-12-14 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Propagate SPECIAL and HISTOGRAM sections from .plot files
through compare-histos
* STAR_2006_S6860818: <pT> vs particle mass, validate analysis
2009-12-04 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding parsing of beam types and pairs of energies from YAML.
2009-12-01 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Fixing trigger efficiency in CDF_2009_S8233977
2009-11-30 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Fixing division by zero in Profile1D bin errors for
bins with just a single entry.
2009-11-24 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* First working version of STAR_2006_S6860818
2009-11-23 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* Fixing our compare() for doubles.
2009-11-17 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Zeroth version of STAR_2006_S6860818 analysis (identified
strange particles). Not working yet for unstable particles.
2009-11-11 Andy Buckley <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Fixing last issues in STAR_2006_S6500200 and setting it to
VALIDATED.
* Noramlise STAR_2006_S6870392 to cross-section
2009-11-09 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding Cmp<double> specialisation, using fuzzyEquals().
2009-11-05 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Fixing histogram division code.
2009-11-04 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* Adding consistence checking on beam ID and sqrt(s) vs. those
from first event.
2009-11-03 Andy Buckley <andy@insectnation.org>
* Adding more assertion checks to linear algebra testing.
2009-11-02 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Fixing normalisation issue with stacked histograms in
make-plots.
2009-10-30 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* CDF_2009_S8233977: Updating data and axes labels to match final
paper. Normalise to cross-section instead of data.
2009-10-23 Andy Buckley <andy@insectnation.org>
* Fixing Cheese-3 plot in CDF 2004... at last!
2009-10-23 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Fix muon veto in CDF_1994_S2952106, CDF_2005_S6217184,
CDF_2008_S7782535, and D0_2004_S5992206
2009-10-19 Andy Buckley <andy@insectnation.org>
* Adding analysis info files for MC SUSY and PHOTONJETUE analyses.
* Adding MC UE analysis in photon+jet events.
2009-10-19 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy.buckley@cern.ch>
* 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 <andy@insectnation.org>
* Adding optional use of args as regex match expressions with
-l/--list-analyses.
2009-09-03 Andy Buckley <andy.buckley@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <frank.siegert@durham.ac.uk>
* Replacing in-source histo-booking metadata with .plot files.
2009-07-14 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding Jet::neutralEnergy() (and Jet::totalEnergy() for
convenience/symmetry).
2009-06-25 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 1.1.3 release!
* More doc building and SWIG robustness tweaks.
2009-06-07 Andy Buckley <andy@insectnation.org>
* Make doc build from metadata work even before the library is
installed.
2009-06-07 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Fix phi rotation in CDF_2008_LEADINGJETS.
2009-06-07 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* Adding use of gsl-config in configure script.
2009-05-16 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding event auto-rotation for events with one proton... more
complete approach?
2009-05-09 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* Adding rivet-mkanalysis script, to make generating new analysis
source templates easier.
2009-05-07 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding R=0.2 photon clustering to the electrons in the CDF 2000
Z pT analysis.
2009-03-04 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding automatic generation of LaTeX manual entries for the
standard analyses.
2009-01-20 Andy Buckley <andy@insectnation.org>
* Removing RivetGun and TCLAP source files!
2009-01-19 Andy Buckley <andy@insectnation.org>
* Added psyco Python optimiser to rivet, make-plots and
compare-histos.
* bin/aida2root: Added "-" -> "_" mangling, following requests.
2009-01-17 Andy Buckley <andy@insectnation.org>
* 1.1.2 release.
2009-01-15 Andy Buckley <andy@insectnation.org>
* Converting Python build system to bundle SWIG output in tarball.
2009-01-14 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* Replaced binreloc with an upgraded and symbol-independent copy.
2008-11-25 Andy Buckley <andy@insectnation.org>
* Added searching of $RIVET_REF_PATH for AIDA reference data
files.
2008-11-24 Andy Buckley <andy@insectnation.org>
* Removing "get"s and other obsfucated syntax from
ProjectionApplier (Projection and Analysis) interfaces.
2008-11-21 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Adding native logger control from Python interface.
2008-11-03 Andy Buckley <andy@insectnation.org>
* Adding bash_completion for rivet executable.
2008-10-31 Andy Buckley <andy@insectnation.org>
* Clean-up of histo titles and analysis code review.
* Added momentum construction functions from FastJet PseudoJets.
2008-10-28 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* New analysis: CDF_2000_S4155203
2008-09-23 Andy Buckley <andy@insectnation.org>
* rivetgun can now be built and run without AGILe. Based on a
patch by Frank Siegert.
2008-09-23 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Allowing rivet-config to return combined flags.
2008-08-14 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Tidying of FastJets and added new data files from HepData.
2008-08-10 James Monk <jmonk@hep.ucl.ac.uk>
* FastJets now uses user_index property of fastjet::PseudoJet to
reconstruct PID information in jet contents.
2008-08-07 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Fixed missing ROOT compile flags for libRivet.
* Added command line repetition to logging.
2008-07-29 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Included the missing numbers and three more observables
in the CDF_2008_NOTE_9351 analysis.
2008-07-29 Andy Buckley <andy@insectnation.org>
* Fixed wrong flags on rivet-config
2008-07-28 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectation.org>
* Fixed polar angle calcuation to use atan2.
* Added "mk" prefixes and x/setX convention to math classes.
2008-07-28 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Fixed definition of FourMomentum::pT (it had been returning pT2)
2008-07-27 Andy Buckley <andy@insectnation.org>
* Added better tests for Boost headers.
* Added testing for -ansi, -pedantic and -Wall compiler flags.
2008-07-25 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* updated DELPHI_2002_069_CONF_603 according to information
from the author
2008-07-17 Andy Buckley <andy@insectnation.org>
* 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 <andy.buckley@dur.ac.uk>
* Fixed missing namespace in vector/matrix testing.
* Removed Boost headers: now a system dependency.
* Fixed polarRadius infinite loop.
2008-07-09 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <J.Butterworth@ucl.ac.uk>
* Modified FastJet to fix ysplit and split and filter.
* Modified ExampleTree to show how to call them.
2008-06-19 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <J.Butterworth@ucl.ac.uk>
* Added First versions of splitJet and filterJet methods to
fastjet.cc. Not yet tested, buyer beware.
2008-06-18 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Fixed processing of "RG" parameters to ensure that invalid
iterators are never used.
2008-06-10 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* Added DELPHI_2002_069_CONF_603 analysis
2008-05-30 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* Added InitialQuarks projection
* Added OPAL_1998_S3780481 analysis
2008-05-29 Andy Buckley <andy@insectnation.org>
* distcheck compatibility fixes and autotools tweaks.
2008-05-28 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <hendrik.hoeth@cern.ch>
* New analysis PDG_Hadron_Multiplicities
* flat2aida converter
2008-05-15 Andy Buckley <andy@insectnation.org>
* Removed unused mysterious Perl scripts!
* Added RivetGun.HepMC logging of HepMC event details.
2008-05-14 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* New analysis DELPHI_1995_S3137023. This analysis contains
the xp spectra of Xi+- and Sigma(1385)+-.
2008-05-13 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Improvements to robustness of ROOT checks.
* Added --version flag on config scripts and rivetgun.
2008-05-06 Hendrik Hoeth <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <buckley@pc54.hep.ucl.ac.uk>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Profile histograms now use error computation with proper
weighting, as described here:
http://en.wikipedia.org/wiki/Weighted_average
2008-02-28 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Vector<N> 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 <hendrik.hoeth@cern.ch>
* 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 <hendrik.hoeth@cern.ch>
* 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 <andy@insectnation.org>
* Applied fixes and extensions to DIS classes, based on
submissions by Dan Traynor.
2008-02-06 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Fixed another misplaced factor of bin width in the
Analysis::normalize() method.
2008-01-30 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Added angle range fix to pseudorapidity function (thanks to
Piergiulio Lenzi).
2008-01-10 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <Leif.Lonnblad@thep.lu.se>
* include/LWH/ManagedObject.h: Fixed infinite loop in
encodeForXML cf. ticket #135.
2007-12-20 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Changed units header to set GeV = 1 (HepMC convention) and using
units in CDF UE analysis.
2007-12-15 Andy Buckley <andy@insectnation.org>
* Introduced analysis metadata methods for all analyses (and made
them part of the Analysis interface).
2007-12-11 Andy Buckley <andy@insectnation.org>
* Added JetAlg base projection for TrackJet, FastJet etc.
2007-12-06 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Removed conditional HAVE_FASTJET bits: FastJet is now compulsory.
* Merging appropriate RivetGun parts into Rivet. RivetGun currently broken.
2007-11-23 Andy Buckley <andy@insectnation.org>
* Renaming analyses to Spires-ID scheme: currently of form
S<SpiresID>, to become <Expt>_<YYYY>_<SpiresID>.
2007-11-20 Andy Buckley <andy@insectnation.org>
* Merged replacement vectors, matrices and boosts into trunk.
2007-11-15 Leif Lonnblad <Leif.Lonnblad@thep.lu.se>
* src/Analysis.cc, include/Rivet/Analysis.hh: Introduced normalize
function. See ticket #126.
2007-10-31 Andy Buckley <andy@insectnation.org>
* Tagging as 1.0b2 for HERA-LHC meeting.
2007-10-25 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Added new reference files.
2007-10-03 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Fixed portable path to Rivet share directory.
2007-09-28 Andy Buckley <andy@insectnation.org>
* Added more functionality to the rivet-config script: now has
libdir, includedir, cppflags, ldflags and ldlibs options.
2007-09-26 Andy Buckley <andy@insectnation.org>
* 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 <sonne@mail.cern.ch>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Added Hemispheres projection, which calculates event hemisphere
masses and broadenings.
2007-09-19 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Merged in a branch of pluggable analysis mechanisms.
2007-06-25 Jon Butterworth <jmb@hep.ucl.ac.uk>
* Fixed some bugs in the root output for DataPoint.h
2007-06-25 Andy Buckley <andy@insectnation.org>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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 <jmb@hep.ucl.ac.uk>
* Merged TotalVisibleMomentum and CalMET
* Added pT ranges to Vetoed final state projection
2007-05-27 Jon Butterworth <jmb@hep.ucl.ac.uk>
* Fixed initialization of VetoedFinalStateProjection in ExampleTree
2007-05-27 Leif Lonnblad <Leif.Lonnblad@thep.lu.se>
* include/Rivet/Projections/KtJets.*: Make sure the KtEvent is
deleted properly.
2007-05-26 Jon Butterworth <jmb@hep.ucl.ac.uk>
* Added leptons to the ExampleTree.
* Added TotalVisibleEnergy projection, and added output to ExampleTree.
2007-05-25 Jon Butterworth <jmb@hep.ucl.ac.uk>
* Added a charged lepton projection
2007-05-23 Andy Buckley <andy@insectnation.org>
* 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 <Leif.Lonnblad@thep.lu.se>
* src/Analysis/HepEx9506012.cc: Now uses the histogram booking
function in the Analysis class.
2007-05-23 Jon Butterworth <jmb@hep.ucl.ac.uk>
* Fixed bug in PRD65092002 (was failing on zero jets)
2007-05-23 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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<double>::max() rather than min()
* Added more control of logging presentation via static flag
methods on Log.
2007-05-13 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Added a preliminary version of the Rick Field UE analysis, under
the name PRD65092002.
2007-04-19 Leif Lonnblad <Leif.Lonnblad@thep.lu.se>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Added "rivet" executable which can read in HepMC ASCII dump
files and apply Rivet analyses on the events.
2007-02-24 Leif Lonnblad <Leif.Lonnblad@thep.lu.se>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Introduced log4cpp logging.
* Added analysis enum, which can be used as input to an analysis
factory by Rivet users.
2006-11-02 Andy Buckley <andy@insectnation.org>
* 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 <andy@insectnation.org>
* 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 <andy@insectnation.org>
* Moving things around: all sources now in directories under src
2006-06-04 Leif Lonnblad <Leif.Lonnblad@thep.lu.se>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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 <Leif.Lonnblad@thep.lu.se>
* 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/bin/make-plots b/bin/make-plots
--- a/bin/make-plots
+++ b/bin/make-plots
@@ -1,2835 +1,2837 @@
#! /usr/bin/env python
"""\
Usage: %prog [options] file.dat [file2.dat ...]
TODO
* Optimise output for e.g. lots of same-height bins in a row
* Add a RatioFullRange directive to show the full range of error bars + MC envelope in the ratio
* Tidy LaTeX-writing code -- faster to compile one doc only, then split it?
* Handle boolean values flexibly (yes, no, true, false, etc. as well as 1, 0)
"""
from __future__ import print_function
##
## This program is copyright by Hendrik Hoeth <hoeth@linta.de> and
## the Rivet team https://rivet.hepforge.org. It may be used
## for scientific and private purposes. Patches are welcome, but please don't
## redistribute changed versions yourself.
##
## Check the Python version
import sys
if sys.version_info[:3] < (2,6,0):
print("make-plots requires Python version >= 2.6.0... exiting")
sys.exit(1)
## Try to rename the process on Linux
try:
import ctypes
libc = ctypes.cdll.LoadLibrary('libc.so.6')
libc.prctl(15, 'make-plots', 0, 0, 0)
except Exception as e:
pass
import os, logging, re
import tempfile
import getopt
import string
from math import *
## Regex patterns
pat_begin_block = re.compile(r'^#+\s*BEGIN ([A-Z0-9_]+) ?(\S+)?')
pat_end_block = re.compile('^#+\s*END ([A-Z0-9_]+)')
pat_comment = re.compile('^#|^\s*$')
pat_property = re.compile('^(\w+?)=(.*)$')
pat_path_property = re.compile('^(\S+?)::(\w+?)=(.*)$')
def fuzzyeq(a, b, tolerance=1e-6):
"Fuzzy equality comparison function for floats, with given fractional tolerance"
# if type(a) is not float or type(a) is not float:
# print(a, b)
if (a == 0 and abs(b) < 1e-12) or (b == 0 and abs(a) < 1e-12):
return True
return 2.0*abs(a-b)/abs(a+b) < tolerance
def inrange(x, a, b):
return x >= a and x < b
def floatify(x):
if type(x) is str:
x = x.split()
if not hasattr(x, "__len__"):
x = [x]
x = [float(a) for a in x]
return x[0] if len(x) == 1 else x
def floatpair(x):
if type(x) is str:
x = x.split()
if hasattr(x, "__len__"):
assert len(x) == 2
return [float(a) for a in x]
return [float(x), float(x)]
def is_end_marker(line, blockname):
m = pat_end_block.match(line)
return m and m.group(1) == blockname
def is_comment(line):
return pat_comment.match(line) is not None
class Described(object):
"Inherited functionality for objects holding a 'description' dictionary"
def __init__(self):
pass
def has_attr(self, key):
return key in self.description
def set_attr(self, key, val):
self.description[key] = val
def attr(self, key, default=None):
return self.description.get(key, default)
def attr_bool(self, key, default=None):
x = self.attr(key, default)
if x is None: return None
if str(x).lower() in ["1", "true", "yes", "on"]: return True
if str(x).lower() in ["0", "false", "no", "off"]: return False
return None
def attr_int(self, key, default=None):
x = self.attr(key, default)
try:
x = int(x)
except:
x = None
return x
def attr_float(self, key, default=None):
x = self.attr(key, default)
try:
x = float(x)
except:
x = None
return x
class InputData(Described):
def __init__(self, filename):
self.filename = filename
if not self.filename.endswith(".dat"):
self.filename += ".dat"
self.histos = {}
self.special = {}
self.functions = {}
self.description = {}
self.pathdescriptions = []
self.is2dim = False
f = open(self.filename)
for line in f:
m = pat_begin_block.match(line)
if m:
name, path = m.group(1,2)
if path is None and name != 'PLOT':
raise Exception('BEGIN sections need a path name.')
## Pass the reading of the block to separate functions
if name == 'PLOT':
self.read_input(f);
elif name == 'SPECIAL':
self.special[path] = Special(f)
elif name == 'HISTOGRAM' or name == 'HISTOGRAM2D':
self.histos[path] = Histogram(f, p=path)
# self.histos[path].path = path
self.description['is2dim'] = self.histos[path].is2dim
elif name == 'HISTO1D':
self.histos[path] = Histo1D(f, p=path)
elif name == 'HISTO2D':
self.histos[path] = Histo2D(f, p=path)
self.description['is2dim'] = True
elif name == 'COUNTER':
self.histos[path] = Counter(f, p=path)
elif name == 'VALUE':
self.histos[path] = Value(f, p=path)
elif name == 'FUNCTION':
self.functions[path] = Function(f)
# elif is_comment(line):
# continue
# else:
# self.read_path_based_input(line)
f.close()
self.apply_config_files(opts.CONFIGFILES)
## Plot (and subplot) sizing
# TODO: Use attr functions and bools properly
self.description.setdefault('PlotSizeX', 10.)
if self.description['is2dim']:
self.description['PlotSizeX'] -= 1.7
self.description['MainPlot'] = '1'
self.description['RatioPlot'] = '0'
if self.description.get('PlotSize', '') != '':
plotsizes = self.description['PlotSize'].split(',')
self.description['PlotSizeX'] = float(plotsizes[0])
self.description['PlotSizeY'] = float(plotsizes[1])
if len(plotsizes) == 3:
self.description['RatioPlotSizeY'] = float(plotsizes[2])
del self.description['PlotSize']
if self.description.get('MainPlot', '1') == '0':
## Ratio, no main
self.description['RatioPlot'] = '1' #< don't allow both to be zero!
self.description['PlotSizeY'] = 0.
self.description.setdefault('RatioPlotSizeY', 9.)
else:
if self.description.get('RatioPlot', '0') == '1':
## Main and ratio
self.description.setdefault('PlotSizeY', 6.)
self.description.setdefault('RatioPlotSizeY', self.description.get('RatioPlotYSize', 3.))
else:
## Main, no ratio
self.description.setdefault('PlotSizeY', self.description.get('PlotYSize', 9.))
self.description['RatioPlotSizeY'] = 0.
## Ensure numbers, not strings
self.description['PlotSizeX'] = float(self.description['PlotSizeX'])
self.description['PlotSizeY'] = float(self.description['PlotSizeY'])
self.description['RatioPlotSizeY'] = float(self.description['RatioPlotSizeY'])
# self.description['TopMargin'] = float(self.description['TopMargin'])
# self.description['BottomMargin'] = float(self.description['BottomMargin'])
self.description['LogX'] = str(self.description.get('LogX', 0)) in ["1", "yes", "true"]
self.description['LogY'] = str(self.description.get('LogY', 0)) in ["1", "yes", "true"]
self.description['LogZ'] = str(self.description.get('LogZ', 0)) in ["1", "yes", "true"]
+ self.description['RatioPlotLogY'] = str(self.description.get('RatioPlotLogY', 0)) in ["1", "yes", "true"]
+
if 'Rebin' in self.description:
for i in self.histos:
self.histos[i].description['Rebin'] = self.description['Rebin']
histoordermap = {}
histolist = list(self.histos.keys())
if 'DrawOnly' in self.description:
histolist = list(filter(list(self.histos.keys()).count, self.description['DrawOnly'].strip().split()))
for histo in histolist:
order = 0
if 'PlotOrder' in self.histos[histo].description:
order = int(self.histos[histo].description['PlotOrder'])
if not order in histoordermap:
histoordermap[order] = []
histoordermap[order].append(histo)
sortedhistolist = []
for i in sorted(histoordermap.keys()):
sortedhistolist.extend(histoordermap[i])
self.description['DrawOnly'] = sortedhistolist
## Inherit various values from histograms if not explicitly set
for k in ['LogX', 'LogY', 'LogZ',
'XLabel', 'YLabel', 'ZLabel',
'XCustomMajorTicks', 'YCustomMajorTicks', 'ZCustomMajorTicks']:
self.inherit_from_histos(k)
return
@property
def is2dim(self):
return self.attr_bool("is2dim", False)
@is2dim.setter
def is2dim(self, val):
self.set_attr("is2dim", val)
@property
def drawonly(self):
x = self.attr("DrawOnly")
if type(x) is str:
self.drawonly = x #< use setter to listify
return x if x else []
@drawonly.setter
def drawonly(self, val):
if type(val) is str:
val = val.strip().split()
self.set_attr("DrawOnly", val)
@property
def stacklist(self):
x = self.attr("Stack")
if type(x) is str:
self.stacklist = x #< use setter to listify
return x if x else []
@stacklist.setter
def stacklist(self, val):
if type(val) is str:
val = val.strip().split()
self.set_attr("Stack", val)
@property
def plotorder(self):
x = self.attr("PlotOrder")
if type(x) is str:
self.plotorder = x #< use setter to listify
return x if x else []
@plotorder.setter
def plotorder(self, val):
if type(val) is str:
val = val.strip().split()
self.set_attr("PlotOrder", val)
@property
def plotsizex(self):
return self.attr_float("PlotSizeX")
@plotsizex.setter
def plotsizex(self, val):
self.set_attr("PlotSizeX", val)
@property
def plotsizey(self):
return self.attr_float("PlotSizeY")
@plotsizey.setter
def plotsizey(self, val):
self.set_attr("PlotSizeY", val)
@property
def plotsize(self):
return [self.plotsizex, self.plotsizey]
@plotsize.setter
def plotsize(self, val):
if type(val) is str:
val = [float(x) for x in val.split(",")]
assert len(val) == 2
self.plotsizex = val[0]
self.plotsizey = val[1]
@property
def ratiosizey(self):
return self.attr_float("RatioPlotSizeY")
@ratiosizey.setter
def ratiosizey(self, val):
self.set_attr("RatioPlotSizeY", val)
@property
def scale(self):
return self.attr_float("Scale")
@scale.setter
def scale(self, val):
self.set_attr("Scale", val)
@property
def xmin(self):
return self.attr_float("XMin")
@xmin.setter
def xmin(self, val):
self.set_attr("XMin", val)
@property
def xmax(self):
return self.attr_float("XMax")
@xmax.setter
def xmax(self, val):
self.set_attr("XMax", val)
@property
def xrange(self):
return [self.xmin, self.xmax]
@xrange.setter
def xrange(self, val):
if type(val) is str:
val = [float(x) for x in val.split(",")]
assert len(val) == 2
self.xmin = val[0]
self.xmax = val[1]
@property
def ymin(self):
return self.attr_float("YMin")
@ymin.setter
def ymin(self, val):
self.set_attr("YMin", val)
@property
def ymax(self):
return self.attr_float("YMax")
@ymax.setter
def ymax(self, val):
self.set_attr("YMax", val)
@property
def yrange(self):
return [self.ymin, self.ymax]
@yrange.setter
def yrange(self, val):
if type(val) is str:
val = [float(y) for y in val.split(",")]
assert len(val) == 2
self.ymin = val[0]
self.ymax = val[1]
# TODO: add more rw properties for plotsize(x,y), ratiosize(y),
# show_mainplot, show_ratioplot, show_legend, log(x,y,z), rebin,
# drawonly, legendonly, plotorder, stack,
# label(x,y,z), majorticks(x,y,z), minorticks(x,y,z),
# min(x,y,z), max(x,y,z), range(x,y,z)
def inherit_from_histos(self, k):
"""Note: this will inherit the key from a random histogram:
only use if you're sure all histograms have this key!"""
if k not in self.description:
h = list(self.histos.values())[0]
if k in h.description:
self.description[k] = h.description[k]
def read_input(self, f):
for line in f:
if is_end_marker(line, 'PLOT'):
break
elif is_comment(line):
continue
m = pat_property.match(line)
if m:
prop, value = m.group(1,2)
if prop in self.description:
logging.debug("Overwriting property %s = %s -> %s" % (prop, self.description[prop], value))
## Use strip here to deal with DOS newlines containing \r
self.description[prop.strip()] = value.strip()
def apply_config_files(self, conffiles):
if conffiles is not None:
for filename in conffiles:
cf = open(filename,'r')
lines = cf.readlines()
for i in range(0, len(lines)):
## First evaluate PLOT sections
m = pat_begin_block.match(lines[i])
if m and m.group(1) == 'PLOT' and re.match(m.group(2),self.filename):
while i<len(lines)-1:
i = i+1
if is_end_marker(lines[i], 'PLOT'):
break
elif is_comment(lines[i]):
continue
m = pat_property.match(lines[i])
if m:
prop, value = m.group(1,2)
if prop in self.description:
logging.debug("Overwriting from conffile property %s = %s -> %s" % (prop, self.description[prop], value))
## Use strip here to deal with DOS newlines containing \r
self.description[prop.strip()] = value.strip()
elif is_comment(lines[i]):
continue
else:
## Then evaluate path-based settings, e.g. for HISTOGRAMs
m = pat_path_property.match(lines[i])
if m:
regex, prop, value = m.group(1,2,3)
for obj_dict in [self.special, self.histos, self.functions]:
for path, obj in obj_dict.items():
if re.match(regex, path):
## Use strip here to deal with DOS newlines containing \r
obj.description.update({prop.strip() : value.strip()})
cf.close()
class Plot(object):
def __init__(self, inputdata):
pass
def set_normalization(self,inputdata):
for method in ['NormalizeToIntegral', 'NormalizeToSum']:
if method in inputdata.description:
for i in inputdata.drawonly:
if not inputdata.histos[i].has_attr(method):
inputdata.histos[i].set_attr(method, inputdata.attr(method))
if inputdata.scale:
for i in inputdata.drawonly:
inputdata.histos[i].scale = inputdata.scale
for i in inputdata.drawonly:
inputdata.histos[i].mangle_input()
def stack_histograms(self,inputdata):
if 'Stack' in inputdata.description:
stackhists = [h for h in inputdata.attr('Stack').strip().split() if h in inputdata.histos]
previous = ''
for i in stackhists:
if previous != '':
inputdata.histos[i].add(inputdata.histos[previous])
previous = i
def set_histo_options(self,inputdata):
if 'ConnectGaps' in inputdata.description:
for i in inputdata.histos.keys():
if 'ConnectGaps' not in inputdata.histos[i].description:
inputdata.histos[i].description['ConnectGaps'] = inputdata.description['ConnectGaps']
# Counter and Value only have dummy x-axis, ticks wouldn't make sense here, so suppress them:
if 'Value object' in str(inputdata.histos) or 'Counter object' in str(inputdata.histos):
inputdata.description['XCustomMajorTicks'] = ''
inputdata.description['XCustomMinorTicks'] = ''
def set_borders(self, inputdata):
self.set_xmax(inputdata)
self.set_xmin(inputdata)
self.set_ymax(inputdata)
self.set_ymin(inputdata)
self.set_zmax(inputdata)
self.set_zmin(inputdata)
inputdata.description['Borders'] = (self.xmin, self.xmax, self.ymin, self.ymax, self.zmin, self.zmax)
def set_xmin(self, inputdata):
self.xmin = inputdata.xmin
if self.xmin is None:
xmins = [inputdata.histos[h].getXMin() for h in inputdata.description['DrawOnly']]
self.xmin = min(xmins) if xmins else 0.0
def set_xmax(self,inputdata):
self.xmax = inputdata.xmax
if self.xmax is None:
xmaxs = [inputdata.histos[h].getXMax() for h in inputdata.description['DrawOnly']]
self.xmax = min(xmaxs) if xmaxs else 1.0
def set_ymin(self,inputdata):
if inputdata.ymin is not None:
self.ymin = inputdata.ymin
else:
ymins = [inputdata.histos[i].getYMin(self.xmin, self.xmax, inputdata.description['LogY']) for i in inputdata.attr('DrawOnly')]
minymin = min(ymins) if ymins else 0.0
if inputdata.description['is2dim']:
self.ymin = minymin
else:
showzero = inputdata.attr_bool("ShowZero", True)
if showzero:
self.ymin = 0. if minymin > -1e-4 else 1.1*minymin
else:
self.ymin = 1.1*minymin if minymin < -1e-4 else 0 if minymin < 1e-4 else 0.9*minymin
if inputdata.description['LogY']:
ymins = [ymin for ymin in ymins if ymin > 0.0]
if not ymins:
if self.ymax == 0:
self.ymax = 1
ymins.append(2e-7*self.ymax)
minymin = min(ymins)
fullrange = opts.FULL_RANGE
if inputdata.has_attr('FullRange'):
fullrange = inputdata.attr_bool('FullRange')
self.ymin = minymin/1.7 if fullrange else max(minymin/1.7, 2e-7*self.ymax)
if self.ymin == self.ymax:
self.ymin -= 1
self.ymax += 1
def set_ymax(self,inputdata):
if inputdata.has_attr('YMax'):
self.ymax = inputdata.attr_float('YMax')
else:
ymaxs = [inputdata.histos[h].getYMax(self.xmin, self.xmax) for h in inputdata.attr('DrawOnly')]
self.ymax = max(ymaxs) if ymaxs else 1.0
if not inputdata.is2dim:
self.ymax *= (1.7 if inputdata.attr_bool('LogY') else 1.1)
def set_zmin(self,inputdata):
if inputdata.has_attr('ZMin'):
self.zmin = inputdata.attr_float('ZMin')
else:
zmins = [inputdata.histos[i].getZMin(self.xmin, self.xmax, self.ymin, self.ymax) for i in inputdata.attr('DrawOnly')]
minzmin = min(zmins) if zmins else 0.0
self.zmin = minzmin
if zmins:
showzero = inputdata.attr_bool('ShowZero', True)
if showzero:
self.zmin = 0 if minzmin > -1e-4 else 1.1*minzmin
else:
self.zmin = 1.1*minzmin if minzmin < -1e-4 else 0. if minzmin < 1e-4 else 0.9*minzmin
if inputdata.attr_bool('LogZ', False):
zmins = [zmin for zmin in zmins if zmin > 0]
if not zmins:
if self.zmax == 0:
self.zmax = 1
zmins.append(2e-7*self.zmax)
minzmin = min(zmins)
fullrange = inputdata.attr_bool("FullRange", opts.FULL_RANGE)
self.zmin = minzmin/1.7 if fullrange else max(minzmin/1.7, 2e-7*self.zmax)
if self.zmin == self.zmax:
self.zmin -= 1
self.zmax += 1
def set_zmax(self,inputdata):
self.zmax = inputdata.attr_float('ZMax')
if self.zmax is None:
zmaxs = [inputdata.histos[h].getZMax(self.xmin, self.xmax, self.ymin, self.ymax) for h in inputdata.attr('DrawOnly')]
self.zmax = max(zmaxs) if zmaxs else 1.0
def draw(self):
pass
def write_header(self,inputdata):
if inputdata.description.get('LeftMargin', '') != '':
inputdata.description['LeftMargin'] = float(inputdata.description['LeftMargin'])
else:
inputdata.description['LeftMargin'] = 1.4
if inputdata.description.get('RightMargin', '') != '':
inputdata.description['RightMargin'] = float(inputdata.description['RightMargin'])
else:
inputdata.description['RightMargin'] = 0.35
if inputdata.description.get('TopMargin', '') != '':
inputdata.description['TopMargin'] = float(inputdata.description['TopMargin'])
else:
inputdata.description['TopMargin'] = 0.65
if inputdata.description.get('BottomMargin', '') != '':
inputdata.description['BottomMargin'] = float(inputdata.description['BottomMargin'])
else:
inputdata.description['BottomMargin'] = 0.95
if inputdata.description['is2dim']:
inputdata.description['RightMargin'] += 1.7
papersizex = inputdata.description['PlotSizeX'] + 0.1 + \
inputdata.description['LeftMargin'] + inputdata.description['RightMargin']
papersizey = inputdata.description['PlotSizeY'] + inputdata.description['RatioPlotSizeY'] + 0.1 + \
inputdata.description['TopMargin'] + inputdata.description['BottomMargin']
#
out = ""
out += '\\documentclass{article}\n'
if opts.OUTPUT_FONT == "MINION":
out += ('\\usepackage{minion}\n')
elif opts.OUTPUT_FONT == "PALATINO_OSF":
out += ('\\usepackage[osf,sc]{mathpazo}\n')
elif opts.OUTPUT_FONT == "PALATINO":
out += ('\\usepackage{mathpazo}\n')
elif opts.OUTPUT_FONT == "TIMES":
out += ('\\usepackage{mathptmx}\n')
elif opts.OUTPUT_FONT == "HELVETICA":
out += ('\\renewcommand{\\familydefault}{\\sfdefault}\n')
out += ('\\usepackage{sfmath}\n')
out += ('\\usepackage{helvet}\n')
out += ('\\usepackage[symbolgreek]{mathastext}\n')
for pkg in opts.LATEXPKGS:
out += ('\\usepackage{%s}\n' % pkg)
out += ('\\usepackage{pst-all}\n')
out += ('\\usepackage{xcolor}\n')
out += ('\\selectcolormodel{rgb}\n')
out += ('\\definecolor{red}{HTML}{EE3311}\n') # (Google uses 'DC3912')
out += ('\\definecolor{blue}{HTML}{3366FF}')
out += ('\\definecolor{green}{HTML}{109618}')
out += ('\\definecolor{orange}{HTML}{FF9900}')
out += ('\\definecolor{lilac}{HTML}{990099}')
out += ('\\usepackage{amsmath}\n')
out += ('\\usepackage{amssymb}\n')
out += ('\\usepackage{relsize}\n')
out += ('\\usepackage[dvips,\n')
out += (' left=%4.3fcm, right=0cm,\n' % (inputdata.description['LeftMargin']-0.45,))
out += (' top=%4.3fcm, bottom=0cm,\n' % (inputdata.description['TopMargin']-0.30,))
out += (' paperwidth=%scm,paperheight=%scm\n' % (papersizex,papersizey))
out += (']{geometry}\n')
out += ('\\begin{document}\n')
out += ('\\pagestyle{empty}\n')
out += ('\\SpecialCoor\n')
out += ('\\begin{pspicture}(0,0)(0,0)\n')
out += ('\\psset{xunit=%scm}\n' %(inputdata.description['PlotSizeX']))
if inputdata.description['is2dim']:
if inputdata.description.get('ColorSeries', '') != '':
colorseries = inputdata.description['ColorSeries']
else:
colorseries = '{hsb}{grad}[rgb]{0,0,1}{-.700,0,0}'
out += ('\\definecolorseries{gradientcolors}%s\n' % colorseries)
out += ('\\resetcolorseries[130]{gradientcolors}\n')
return out
def write_footer(self):
out = ""
out += ('\\end{pspicture}\n')
out += ('\\end{document}\n')
return out
class MainPlot(Plot):
def __init__(self, inputdata):
self.set_normalization(inputdata)
self.stack_histograms(inputdata)
do_gof = inputdata.description.get('GofLegend', '0') == '1' or inputdata.description.get('GofFrame', '') != ''
do_taylor = inputdata.description.get('TaylorPlot', '0') == '1'
if do_gof and not do_taylor:
self.calculate_gof(inputdata)
self.set_histo_options(inputdata)
self.set_borders(inputdata)
self.yoffset = inputdata.description['PlotSizeY']
self.coors = Coordinates(inputdata)
def draw(self, inputdata):
out = ""
out += ('\n%\n% MainPlot\n%\n')
out += ('\\psset{yunit=%scm}\n' %(self.yoffset))
out += ('\\rput(0,-1){%\n')
out += ('\\psset{yunit=%scm}\n' %(inputdata.description['PlotSizeY']))
out += self._draw(inputdata)
out += ('}\n')
return out
def _draw(self, inputdata):
out = ""
## Draw a white background first
# TODO: Allow specifying in-frame bg color
out += '\n'
out += '\\psframe[linewidth=0pt,linestyle=none,fillstyle=solid,fillcolor=white,dimen=middle](0,0)(1,1)\n'
out += '\n'
# TODO: do this more compactly, e.g. by assigning sorting keys!
if inputdata.attr_bool('DrawSpecialFirst', False):
for s in inputdata.special.values():
out += s.draw(self.coors)
if inputdata.attr_bool('DrawFunctionFirst', False):
for f in inputdata.functions.values():
out += f.draw(self.coors)
for i in inputdata.description['DrawOnly']:
out += inputdata.histos[i].draw(self.coors)
else:
for i in inputdata.description['DrawOnly']:
out += inputdata.histos[i].draw(self.coors)
for f in inputdata.functions.values():
out += f.draw(self.coors)
else:
if inputdata.attr_bool('DrawFunctionFirst', False):
for f in inputdata.functions.values():
out += f.draw(self.coors)
for i in inputdata.description['DrawOnly']:
out += inputdata.histos[i].draw(self.coors)
else:
for i in inputdata.description['DrawOnly']:
out += inputdata.histos[i].draw(self.coors)
for f in inputdata.functions.values():
out += f.draw(self.coors)
for s in inputdata.special.values():
out += s.draw(self.coors)
if inputdata.attr_bool('Legend', False):
legend = Legend(inputdata.description,inputdata.histos,inputdata.functions)
out += legend.draw()
if inputdata.description['is2dim']:
colorscale = ColorScale(inputdata.description, self.coors)
out += colorscale.draw()
frame = Frame()
out += frame.draw(inputdata)
xcustommajortickmarks = inputdata.attr_int('XMajorTickMarks', -1)
xcustomminortickmarks = inputdata.attr_int('XMinorTickMarks', -1)
xcustommajorticks = xcustomminorticks = None
if inputdata.attr('XCustomMajorTicks'):
xcustommajorticks = []
x_label_pairs = inputdata.attr('XCustomMajorTicks').strip().split() #'\t')
if len(x_label_pairs) % 2 == 0:
for i in range(0, len(x_label_pairs), 2):
xcustommajorticks.append({'Value': float(x_label_pairs[i]), 'Label': x_label_pairs[i+1]})
else:
print("Warning: XCustomMajorTicks requires an even number of alternating pos/label entries")
if inputdata.attr('XCustomMinorTicks'):
xs = inputdata.attr('XCustomMinorTicks').strip().split() #'\t')
xcustomminorticks = [{'Value': float(x)} for x in xs]
xticks = XTicks(inputdata.description, self.coors)
drawxlabels = inputdata.attr_bool('PlotXTickLabels', True) and not inputdata.attr_bool('RatioPlot', False)
out += xticks.draw(custommajortickmarks=xcustommajortickmarks,
customminortickmarks=xcustomminortickmarks,
custommajorticks=xcustommajorticks,
customminorticks=xcustomminorticks,
drawlabels=drawxlabels)
ycustommajortickmarks = inputdata.attr_int('YMajorTickMarks', -1)
ycustomminortickmarks = inputdata.attr_int('YMinorTickMarks', -1)
ycustommajorticks = ycustomminorticks = None
if 'YCustomMajorTicks' in inputdata.description:
ycustommajorticks = []
y_label_pairs = inputdata.description['YCustomMajorTicks'].strip().split() #'\t')
if len(y_label_pairs) % 2 == 0:
for i in range(0, len(y_label_pairs), 2):
ycustommajorticks.append({'Value': float(y_label_pairs[i]), 'Label': y_label_pairs[i+1]})
else:
print("Warning: YCustomMajorTicks requires an even number of alternating pos/label entries")
if inputdata.has_attr('YCustomMinorTicks'):
ys = inputdata.attr('YCustomMinorTicks').strip().split() #'\t')
ycustomminorticks = [{'Value': float(y)} for y in ys]
yticks = YTicks(inputdata.description, self.coors)
drawylabels = inputdata.attr_bool('PlotYTickLabels', True)
out += yticks.draw(custommajortickmarks=ycustommajortickmarks,
customminortickmarks=ycustomminortickmarks,
custommajorticks=ycustommajorticks,
customminorticks=ycustomminorticks,
drawlabels=drawylabels)
labels = Labels(inputdata.description)
if inputdata.attr_bool('RatioPlot', False):
olab = labels.draw(['Title','YLabel'])
else:
if not inputdata.description['is2dim']:
olab = labels.draw(['Title','XLabel','YLabel'])
else:
olab = labels.draw(['Title','XLabel','YLabel','ZLabel'])
out += olab
return out
def calculate_gof(self, inputdata):
refdata = inputdata.description.get('GofReference')
if refdata is None:
refdata = inputdata.description.get('RatioPlotReference')
if refdata is None:
inputdata.description['GofLegend'] = '0'
inputdata.description['GofFrame'] = ''
return
def pickcolor(gof):
color = None
colordefs = {}
for i in inputdata.description.setdefault('GofFrameColor', '0:green 3:yellow 6:red!70').strip().split():
foo = i.split(':')
if len(foo) != 2:
continue
colordefs[float(foo[0])] = foo[1]
for i in sorted(colordefs.keys()):
if gof>=i:
color=colordefs[i]
return color
inputdata.description.setdefault('GofLegend', '0')
inputdata.description.setdefault('GofFrame', '')
inputdata.description.setdefault('FrameColor', None)
for i in inputdata.description['DrawOnly']:
if i == refdata:
continue
if inputdata.description['GofLegend']!='1' and i!=inputdata.description['GofFrame']:
continue
if inputdata.description.get('GofType', "chi2") != 'chi2':
return
gof = inputdata.histos[i].getChi2(inputdata.histos[refdata])
if i == inputdata.description['GofFrame'] and inputdata.description['FrameColor'] is None:
inputdata.description['FrameColor'] = pickcolor(gof)
if inputdata.histos[i].description.setdefault('Title', '') != '':
inputdata.histos[i].description['Title'] += ', '
inputdata.histos[i].description['Title'] += '$\\chi^2/n={}$%1.2f' %gof
class TaylorPlot(Plot):
def __init__(self, inputdata):
self.refdata = inputdata.description['TaylorPlotReference']
self.calculate_taylorcoordinates(inputdata)
def calculate_taylorcoordinates(self,inputdata):
foo = inputdata.description['DrawOnly'].pop(inputdata.description['DrawOnly'].index(self.refdata))
inputdata.description['DrawOnly'].append(foo)
for i in inputdata.description['DrawOnly']:
print(i)
print('meanbinval = ', inputdata.histos[i].getMeanBinValue())
print('sigmabinval = ', inputdata.histos[i].getSigmaBinValue())
print('chi2/nbins = ', inputdata.histos[i].getChi2(inputdata.histos[self.refdata]))
print('correlation = ', inputdata.histos[i].getCorrelation(inputdata.histos[self.refdata]))
print('distance = ', inputdata.histos[i].getRMSdistance(inputdata.histos[self.refdata]))
class RatioPlot(Plot):
def __init__(self, inputdata):
self.refdata = inputdata.description['RatioPlotReference']
self.yoffset = inputdata.description['PlotSizeY'] + inputdata.description['RatioPlotSizeY']
inputdata.description['RatioPlotStage'] = True
inputdata.description['PlotSizeY'] = inputdata.description['RatioPlotSizeY']
inputdata.description['LogY'] = False # TODO: actually, log ratio plots could be useful...
# TODO: It'd be nice it this wasn't so MC-specific
rpmode = inputdata.description.get('RatioPlotMode', "mcdata")
if rpmode == 'deviation':
inputdata.description['YLabel'] = '$(\\text{MC}-\\text{data})$'
inputdata.description['YMin'] = -3.5
inputdata.description['YMax'] = 3.5
elif rpmode == 'datamc':
inputdata.description['YLabel'] = 'Data/MC'
inputdata.description['YMin'] = 0.5
inputdata.description['YMax'] = 1.5
else:
inputdata.description['YLabel'] = 'MC/Data'
inputdata.description['YMin'] = 0.5
inputdata.description['YMax'] = 1.5
if 'RatioPlotYLabel' in inputdata.description:
inputdata.description['YLabel'] = inputdata.description['RatioPlotYLabel']
inputdata.description['YLabel']='\\rput(-%s,0){%s}'%(0.5*inputdata.description['PlotSizeY']/inputdata.description['PlotSizeX'],inputdata.description['YLabel'])
if 'RatioPlotYMin' in inputdata.description:
inputdata.description['YMin'] = inputdata.description['RatioPlotYMin']
if 'RatioPlotYMax' in inputdata.description:
inputdata.description['YMax'] = inputdata.description['RatioPlotYMax']
if 'RatioPlotErrorBandColor' not in inputdata.description:
inputdata.description['RatioPlotErrorBandColor'] = 'yellow'
if inputdata.description.get('RatioPlotSameStyle', '0') == '0':
inputdata.histos[self.refdata].description['ErrorBandColor'] = inputdata.description['RatioPlotErrorBandColor']
inputdata.histos[self.refdata].description['ErrorBands'] = '1'
inputdata.histos[self.refdata].description['ErrorBars'] = '0'
inputdata.histos[self.refdata].description['LineStyle'] = 'solid'
inputdata.histos[self.refdata].description['LineColor'] = 'black'
inputdata.histos[self.refdata].description['LineWidth'] = '0.3pt'
inputdata.histos[self.refdata].description['PolyMarker'] = ''
inputdata.histos[self.refdata].description['ConnectGaps'] = '1'
self.calculate_ratios(inputdata)
self.set_borders(inputdata)
self.coors = Coordinates(inputdata)
def draw(self, inputdata):
out = ""
out += ('\n%\n% RatioPlot\n%\n')
out += ('\\psset{yunit=%scm}\n' %(self.yoffset))
out += ('\\rput(0,-1){%\n')
out += ('\\psset{yunit=%scm}\n' %(inputdata.description['PlotSizeY']))
out += self._draw(inputdata)
out += ('}\n')
return out
def calculate_ratios(self, inputdata):
foo = inputdata.description['DrawOnly'].pop(inputdata.description['DrawOnly'].index(self.refdata))
if inputdata.histos[self.refdata].description.get('ErrorBands', '0') == '1':
inputdata.description['DrawOnly'].insert(0,foo)
else:
inputdata.description['DrawOnly'].append(foo)
rpmode = inputdata.description.get('RatioPlotMode', "mcdata")
for i in inputdata.description['DrawOnly']:
if i != self.refdata:
if rpmode == 'deviation':
inputdata.histos[i].deviation(inputdata.histos[self.refdata])
elif rpmode == 'datamc':
inputdata.histos[i].dividereverse(inputdata.histos[self.refdata])
inputdata.histos[i].description['ErrorBars'] = '1'
else:
inputdata.histos[i].divide(inputdata.histos[self.refdata])
if rpmode == 'deviation':
inputdata.histos[self.refdata].deviation(inputdata.histos[self.refdata])
elif rpmode == 'datamc':
inputdata.histos[self.refdata].dividereverse(inputdata.histos[self.refdata])
else:
inputdata.histos[self.refdata].divide(inputdata.histos[self.refdata])
def _draw(self, inputdata):
out = ""
## Draw a white background first
# TODO: Allow specifying in-frame bg color
out += '\n'
out += '\\psframe[linewidth=0pt,linestyle=none,fillstyle=solid,fillcolor=white,dimen=middle](0,0)(1,1)\n'
out += '\n'
for i in inputdata.description['DrawOnly']:
if inputdata.description.get('RatioPlotMode', 'mcdata') == 'datamc':
if i != self.refdata:
out += inputdata.histos[i].draw(self.coors)
else:
out += inputdata.histos[i].draw(self.coors)
frame = Frame()
out += frame.draw(inputdata)
# TODO: so much duplication with MainPlot... yuck!
if inputdata.description.get('XMajorTickMarks', '') != '':
xcustommajortickmarks = int(inputdata.description['XMajorTickMarks'])
else:
xcustommajortickmarks = -1
if inputdata.description.get('XMinorTickMarks', '') != '':
xcustomminortickmarks = int(inputdata.description['XMinorTickMarks'])
else:
xcustomminortickmarks =- 1
xcustommajorticks = None
if 'XCustomMajorTicks' in inputdata.description: # and inputdata.description['XCustomMajorTicks']!='':
xcustommajorticks = []
tickstr = inputdata.description['XCustomMajorTicks'].strip().split() #'\t')
if not len(tickstr) % 2:
for i in range(0, len(tickstr), 2):
xcustommajorticks.append({'Value': float(tickstr[i]), 'Label': tickstr[i+1]})
xcustomminorticks = None
if 'XCustomMinorTicks' in inputdata.description: # and inputdata.description['XCustomMinorTicks']!='':
xcustomminorticks = []
tickstr = inputdata.description['XCustomMinorTicks'].strip().split() #'\t')
for i in range(len(tickstr)):
xcustomminorticks.append({'Value': float(tickstr[i])})
xticks = XTicks(inputdata.description, self.coors)
drawlabels = inputdata.description.get('RatioPlotTickLabels', '1') == '1'
out += xticks.draw(custommajortickmarks=xcustommajortickmarks,
customminortickmarks=xcustomminortickmarks,
custommajorticks=xcustommajorticks,
customminorticks=xcustomminorticks,
drawlabels=drawlabels)
ycustommajortickmarks = inputdata.attr('YMajorTickMarks', '')
ycustommajortickmarks = int(ycustommajortickmarks) if ycustommajortickmarks else -1
ycustomminortickmarks = inputdata.attr('YMinorTickMarks', '')
ycustomminortickmarks = int(ycustomminortickmarks) if ycustomminortickmarks else -1
ycustommajorticks = None
if 'YCustomMajorTicks' in inputdata.description:
ycustommajorticks = []
tickstr = inputdata.description['YCustomMajorTicks'].strip().split() #'\t')
if not len(tickstr) % 2:
for i in range(0, len(tickstr), 2):
ycustommajorticks.append({'Value': float(tickstr[i]), 'Label': tickstr[i+1]})
ycustomminorticks = None
if 'YCustomMinorTicks' in inputdata.description:
ycustomminorticks = []
tickstr = inputdata.description['YCustomMinorTicks'].strip().split() #'\t')
for i in range(len(tickstr)):
ycustomminorticks.append({'Value': float(tickstr[i])})
yticks = YTicks(inputdata.description, self.coors)
out += yticks.draw(custommajortickmarks=ycustommajortickmarks,
customminortickmarks=ycustomminortickmarks,
custommajorticks=ycustommajorticks,
customminorticks=ycustomminorticks)
if not inputdata.attr_bool('MainPlot', True) and inputdata.attr_bool('Legend', False):
legend = Legend(inputdata.description, inputdata.histos, inputdata.functions)
out += legend.draw()
labels = Labels(inputdata.description)
lnames = ['XLabel','YLabel']
if not inputdata.attr_bool('MainPlot', True):
lnames.append("Title")
out += labels.draw(lnames)
return out
class Legend(Described):
def __init__(self, description, histos, functions):
self.histos = histos
self.functions = functions
self.description = description
def draw(self):
out = ""
out += '\n%\n% Legend\n%\n'
out += '\\rput[tr](%s,%s){%%\n' % (self.getLegendXPos(), self.getLegendYPos())
ypos = -0.05*6/self.description['PlotSizeY']
legendordermap = {}
legendlist = self.description['DrawOnly'] + list(self.functions.keys())
if 'LegendOnly' in self.description:
legendlist = []
for legend in self.description['LegendOnly'].strip().split():
if legend in self.histos or legend in self.functions:
legendlist.append(legend)
for legend in legendlist:
order = 0
if legend in self.histos and 'LegendOrder' in self.histos[legend].description:
order = int(self.histos[legend].description['LegendOrder'])
if legend in self.functions and 'LegendOrder' in self.functions[legend].description:
order = int(self.functions[legend].description['LegendOrder'])
if not order in legendordermap:
legendordermap[order] = []
legendordermap[order].append(legend)
foo = []
for i in sorted(legendordermap.keys()):
foo.extend(legendordermap[i])
rel_xpos_sign = 1.0
if self.getLegendAlign() == 'r':
rel_xpos_sign = -1.0
xpos1 = -0.10*rel_xpos_sign
xpos2 = -0.02*rel_xpos_sign
for i in foo:
if i in self.histos:
drawobject = self.histos[i]
elif i in self.functions:
drawobject = self.functions[i]
else:
continue
title = drawobject.getTitle()
if title == '':
continue
else:
out += ('\\rput[B%s](%s,%s){%s}\n' %(self.getLegendAlign(),rel_xpos_sign*0.1,ypos,title))
out += ('\\rput[B%s](%s,%s){%s\n' %(self.getLegendAlign(),rel_xpos_sign*0.1,ypos,'%'))
if drawobject.getErrorBands():
out += ('\\psframe[linewidth=0pt,linestyle=none,fillstyle=solid,fillcolor=%s,opacity=%s]' %(drawobject.getErrorBandColor(),drawobject.getErrorBandOpacity()))
out += ('(%s, 0.033)(%s, 0.001)\n' %(xpos1, xpos2))
out += ('\\psline[linestyle=' + drawobject.getLineStyle() \
+ ', linecolor=' + drawobject.getLineColor() \
+ ', linewidth=' + drawobject.getLineWidth() \
+ ', strokeopacity=' + drawobject.getLineOpacity() \
+ ', opacity=' + drawobject.getFillOpacity())
if drawobject.getLineDash() != '':
out += (', dash=' + drawobject.getLineDash())
if drawobject.getFillStyle()!='none':
out += (', fillstyle=' + drawobject.getFillStyle() \
+ ', fillcolor=' + drawobject.getFillColor() \
+ ', hatchcolor=' + drawobject.getHatchColor() \
+ ']{C-C}(%s, 0.030)(%s, 0.030)(%s, 0.004)(%s, 0.004)(%s, 0.030)\n' \
%(xpos1, xpos2, xpos2, xpos1, xpos1))
else:
out += ('](%s, 0.016)(%s, 0.016)\n' %(xpos1, xpos2))
if drawobject.getPolyMarker() != '':
out += (' \\psdot[dotstyle=' + drawobject.getPolyMarker() \
+ ', dotsize=' + drawobject.getDotSize() \
+ ', dotscale=' + drawobject.getDotScale() \
+ ', linecolor=' + drawobject.getLineColor() \
+ ', linewidth=' + drawobject.getLineWidth() \
+ ', linestyle=' + drawobject.getLineStyle() \
+ ', fillstyle=' + drawobject.getFillStyle() \
+ ', fillcolor=' + drawobject.getFillColor() \
+ ', strokeopacity=' + drawobject.getLineOpacity() \
+ ', opacity=' + drawobject.getFillOpacity() \
+ ', hatchcolor=' + drawobject.getHatchColor())
if drawobject.getFillStyle()!='none':
out += ('](%s, 0.028)\n' % (rel_xpos_sign*-0.06))
else:
out += ('](%s, 0.016)\n' % (rel_xpos_sign*-0.06))
out += ('}\n')
ypos -= 0.075*6/self.description['PlotSizeY']
if 'CustomLegend' in self.description:
for i in self.description['CustomLegend'].strip().split('\\\\'):
out += ('\\rput[B%s](%s,%s){%s}\n' %(self.getLegendAlign(),rel_xpos_sign*0.1,ypos,i))
ypos -= 0.075*6/self.description['PlotSizeY']
out += ('}\n')
return out
def getLegendXPos(self):
return self.description.get('LegendXPos', '0.95' if self.getLegendAlign() == 'r' else '0.53')
def getLegendYPos(self):
return self.description.get('LegendYPos', '0.93')
def getLegendAlign(self):
return self.description.get('LegendAlign', 'l')
class ColorScale(Described):
def __init__(self, description, coors):
self.description = description
self.coors = coors
def draw(self):
out = ''
out += '\n%\n% ColorScale\n%\n'
out += '\\rput(1,0){\n'
out += ' \\psset{xunit=4mm}\n'
out += ' \\rput(0.5,0){\n'
out += ' \\psset{yunit=0.0076923, linestyle=none, fillstyle=solid}\n'
out += ' \\multido{\\ic=0+1,\\id=1+1}{130}{\n'
out += ' \\psframe[fillcolor={gradientcolors!![\\ic]},dimen=inner,linewidth=0.1pt](0, \\ic)(1, \\id)\n'
out += ' }\n'
out += ' }\n'
out += ' \\rput(0.5,0){\n'
out += ' \\psframe[linewidth=0.3pt,dimen=middle](0,0)(1,1)\n'
zcustommajortickmarks = self.attr_int('ZMajorTickMarks', -1)
zcustomminortickmarks = self.attr_int('ZMinorTickMarks', -1)
zcustommajorticks = zcustomminorticks = None
if self.attr('ZCustomMajorTicks'):
zcustommajorticks = []
z_label_pairs = self.attr('ZCustomMajorTicks').strip().split() #'\t')
if len(z_label_pairs) % 2 == 0:
for i in range(0, len(z_label_pairs), 2):
zcustommajorticks.append({'Value': float(x_label_pairs[i]), 'Label': x_label_pairs[i+1]})
else:
print("Warning: ZCustomMajorTicks requires an even number of alternating pos/label entries")
if self.attr('ZCustomMinorTicks'):
zs = self.attr('ZCustomMinorTicks').strip().split() #'\t')
zcustomminorticks = [{'Value': float(x)} for x in xs]
drawzlabels = self.attr_bool('PlotZTickLabels', True)
zticks = ZTicks(self.description, self.coors)
out += zticks.draw(custommajortickmarks=zcustommajortickmarks,\
customminortickmarks=zcustomminortickmarks,\
custommajorticks=zcustommajorticks,\
customminorticks=zcustomminorticks,
drawlabels=drawzlabels)
out += ' }\n'
out += '}\n'
return out
class Labels(Described):
def __init__(self, description):
self.description = description
def draw(self, axis=[]):
out = ""
out += ('\n%\n% Labels\n%\n')
if 'Title' in self.description and (axis.count('Title') or axis==[]):
out += ('\\rput(0,1){\\rput[lB](0, 1.7\\labelsep){\\normalsize '+self.description['Title']+'}}\n')
if 'XLabel' in self.description and (axis.count('XLabel') or axis==[]):
xlabelsep = 4.7
if 'XLabelSep' in self.description:
xlabelsep=float(self.description['XLabelSep'])
out += ('\\rput(1,0){\\rput[rB](0,-%4.3f\\labelsep){\\normalsize '%(xlabelsep) +self.description['XLabel']+'}}\n')
if 'YLabel' in self.description and (axis.count('YLabel') or axis==[]):
ylabelsep = 6.5
if 'YLabelSep' in self.description:
ylabelsep=float(self.description['YLabelSep'])
out += ('\\rput(0,1){\\rput[rB]{90}(-%4.3f\\labelsep,0){\\normalsize '%(ylabelsep) +self.description['YLabel']+'}}\n')
if 'ZLabel' in self.description and (axis.count('ZLabel') or axis==[]):
zlabelsep = 5.3
if 'ZLabelSep' in self.description:
zlabelsep=float(self.description['ZLabelSep'])
out += ('\\rput(1,1){\\rput(%4.3f\\labelsep,0){\\psset{xunit=4mm}\\rput[lB]{270}(1.5,0){\\normalsize '%(zlabelsep) +self.description['ZLabel']+'}}}\n')
return out
class Special(Described):
def __init__(self, f):
self.description = {}
self.data = []
self.read_input(f)
def read_input(self, f):
for line in f:
if is_end_marker(line, 'SPECIAL'):
break
elif is_comment(line):
continue
else:
self.data.append(line)
def draw(self, coors):
out = ""
out += ('\n%\n% Special\n%\n')
import re
regex = re.compile(r'^(.*?)(\\physics[xy]?coor)\(\s?([0-9\.eE+-]+)\s?,\s?([0-9\.eE+-]+)\s?\)(.*)')
# TODO: More precise number string matching, something like this:
# num = r"-?[0-9]*(?:\.[0-9]*)(?:[eE][+-]?\d+]"
# regex = re.compile(r'^(.*?)(\\physics[xy]?coor)\(\s?(' + num + ')\s?,\s?(' + num + ')\s?\)(.*)')
for l in self.data:
while regex.search(l):
match = regex.search(l)
xcoor, ycoor = float(match.group(3)), float(match.group(4))
if match.group(2)[1:] in ["physicscoor", "physicsxcoor"]:
xcoor = coors.phys2frameX(xcoor)
if match.group(2)[1:] in ["physicscoor", "physicsycoor"]:
ycoor = coors.phys2frameY(ycoor)
line = "%s(%f, %f)%s" % (match.group(1), xcoor, ycoor, match.group(5))
l = line
out += l + "\n"
return out
class DrawableObject(Described):
def __init__(self, f):
pass
def getTitle(self):
return self.description.get("Title", "")
def getLineStyle(self):
if 'LineStyle' in self.description:
## I normally like there to be "only one way to do it", but providing
## this dashdotted/dotdashed synonym just seems humane ;-)
if self.description['LineStyle'] in ('dashdotted', 'dotdashed'):
self.description['LineStyle']='dashed'
self.description['LineDash']='3pt 3pt .8pt 3pt'
return self.description['LineStyle']
else:
return 'solid'
def getLineDash(self):
if 'LineDash' in self.description:
# Check if LineStyle=='dashdotted' before returning something
self.getLineStyle()
return self.description['LineDash']
else:
return ''
def getLineWidth(self):
return self.description.get("LineWidth", "0.8pt")
def getLineColor(self):
return self.description.get("LineColor", "black")
def getLineOpacity(self):
return self.description.get("LineOpacity", "1.0")
def getFillColor(self):
return self.description.get("FillColor", "white")
def getFillOpacity(self):
return self.description.get("FillOpacity", "1.0")
def getHatchColor(self):
return self.description.get("HatchColor", "black")
def getFillStyle(self):
return self.description.get("FillStyle", "none")
def getPolyMarker(self):
return self.description.get("PolyMarker", "")
def getDotSize(self):
return self.description.get("DotSize", "2pt 2")
def getDotScale(self):
return self.description.get("DotScale", "1")
def getErrorBars(self):
return bool(int(self.description.get("ErrorBars", "0")))
def getErrorBands(self):
return bool(int(self.description.get("ErrorBands", "0")))
def getErrorBandColor(self):
return self.description.get("ErrorBandColor", "yellow")
def getErrorBandOpacity(self):
return self.description.get("ErrorBandOpacity", "1.0")
def getSmoothLine(self):
return bool(int(self.description.get("SmoothLine", "0")))
def startclip(self):
return '\\psclip{\\psframe[linewidth=0, linestyle=none](0,0)(1,1)}\n'
def stopclip(self):
return '\\endpsclip\n'
def startpsset(self):
out = ""
out += ('\\psset{linecolor='+self.getLineColor()+'}\n')
out += ('\\psset{linewidth='+self.getLineWidth()+'}\n')
out += ('\\psset{linestyle='+self.getLineStyle()+'}\n')
out += ('\\psset{fillstyle='+self.getFillStyle()+'}\n')
out += ('\\psset{fillcolor='+self.getFillColor()+'}\n')
out += ('\\psset{hatchcolor='+self.getHatchColor()+'}\n')
out += ('\\psset{strokeopacity='+self.getLineOpacity()+'}\n')
out += ('\\psset{opacity='+self.getFillOpacity()+'}\n')
if self.getLineDash()!='':
out += ('\\psset{dash='+self.getLineDash()+'}\n')
return out
def stoppsset(self):
out = ""
out += ('\\psset{linecolor=black}\n')
out += ('\\psset{linewidth=0.8pt}\n')
out += ('\\psset{linestyle=solid}\n')
out += ('\\psset{fillstyle=none}\n')
out += ('\\psset{fillcolor=white}\n')
out += ('\\psset{hatchcolor=black}\n')
out += ('\\psset{strokeopacity=1.0}\n')
out += ('\\psset{opacity=1.0}\n')
return out
class Function(DrawableObject, Described):
def __init__(self, f):
self.description = {}
self.read_input(f)
def read_input(self, f):
self.code='def plotfunction(x):\n'
iscode=False
for line in f:
if is_end_marker(line, 'FUNCTION'):
break
elif is_comment(line):
continue
else:
m = pat_property.match(line)
if iscode:
self.code+=' '+line
elif m:
prop, value = m.group(1,2)
if prop=='Code':
iscode=True
else:
self.description[prop] = value
if not iscode:
print('++++++++++ ERROR: No code in function')
else:
foo = compile(self.code, '<string>', 'exec')
exec(foo)
self.plotfunction = plotfunction
def draw(self,coors):
out = ""
out += self.startclip()
out += self.startpsset()
xmin = coors.xmin()
if 'XMin' in self.description and self.description['XMin']:
xmin = float(self.description['XMin'])
xmax=coors.xmax()
if 'XMax' in self.description and self.description['XMax']:
xmax=float(self.description['XMax'])
# TODO: Space sample points logarithmically if LogX=1
dx = (xmax-xmin)/500.
x = xmin-dx
out += '\\pscurve'
if 'FillStyle' in self.description and self.description['FillStyle']!='none':
out += '(%s,%s)\n' % (coors.strphys2frameX(xmin),coors.strphys2frameY(coors.ymin()))
while x < (xmax+2*dx):
y = self.plotfunction(x)
out += ('(%s,%s)\n' % (coors.strphys2frameX(x), coors.strphys2frameY(y)))
x += dx
if 'FillStyle' in self.description and self.description['FillStyle']!='none':
out += '(%s,%s)\n' % (coors.strphys2frameX(xmax),coors.strphys2frameY(coors.ymin()))
out += self.stoppsset()
out += self.stopclip()
return out
class BinData(object):
"""\
Store bin edge and value+error(s) data for a 1D or 2D bin.
TODO: generalise/alias the attr names to avoid mention of x and y
"""
def __init__(self, low, high, val, err):
#print("@", low, high, val, err)
self.low = floatify(low)
self.high = floatify(high)
self.val = float(val)
self.err = floatpair(err)
@property
def is2D(self):
return hasattr(self.low, "__len__") and hasattr(self.high, "__len__")
@property
def isValid(self):
invalid_val = (isnan(self.val) or isnan(self.err[0]) or isnan(self.err[1]))
if invalid_val:
return False
if self.is2D:
invalid_low = any(isnan(x) for x in self.low)
invalid_high = any(isnan(x) for x in self.high)
else:
invalid_low, invalid_high = isnan(self.low), isnan(self.high)
return not (invalid_low or invalid_high)
@property
def xmin(self):
return self.low
@xmin.setter
def xmin(self,x):
self.low = x
@property
def xmax(self):
return self.high
@xmax.setter
def xmax(self,x):
self.high = x
@property
def xmid(self):
# TODO: Generalise to 2D
return (self.xmin + self.xmax) / 2.0
@property
def xwidth(self):
# TODO: Generalise to 2D
assert self.xmin <= self.xmax
return self.xmax - self.xmin
@property
def y(self):
return self.val
@y.setter
def y(self, x):
self.val = x
@property
def ey(self):
return self.err
@ey.setter
def ey(self, x):
self.err = x
@property
def ymin(self):
return self.y - self.ey[0]
@property
def ymax(self):
return self.y + self.ey[1]
def __getitem__(self, key):
"dict-like access for backward compatibility"
if key in ("LowEdge"):
return self.xmin
elif key == ("UpEdge", "HighEdge"):
return self.xmax
elif key == "Content":
return self.y
elif key == "Errors":
return self.ey
class Histogram(DrawableObject, Described):
def __init__(self, f, p=None):
self.description = {}
self.is2dim = False
self.data = []
self.read_input_data(f)
self.sigmabinvalue = None
self.meanbinvalue = None
self.path = p
def read_input_data(self, f):
for line in f:
if is_end_marker(line, 'HISTOGRAM'):
break
elif is_comment(line):
continue
else:
line = line.rstrip()
m = pat_property.match(line)
if m:
prop, value = m.group(1,2)
self.description[prop] = value
else:
## Detect symm errs
linearray = line.split()
if len(linearray) == 4:
self.data.append(BinData(*linearray))
## Detect asymm errs
elif len(linearray) == 5:
self.data.append(BinData(linearray[0], linearray[1], linearray[2], [linearray[3],linearray[4]]))
## Detect two-dimensionality
elif len(linearray) in [6,7]:
self.is2dim = True
# If asymm z error, use the max or average of +- error
err = float(linearray[5])
if len(linearray) == 7:
if self.description.get("ShowMaxZErr", 1):
err = max(err, float(linearray[6]))
else:
err = 0.5 * (err + float(linearray[6]))
self.data.append(BinData([linearray[0], linearray[2]], [linearray[1], linearray[3]], linearray[4], err))
## Unknown histo format
else:
raise RuntimeError("Unknown HISTOGRAM data line format with %d entries" % len(linearray))
def mangle_input(self):
norm2int = self.attr_bool("NormalizeToIntegral", False)
norm2sum = self.attr_bool("NormalizeToSum", False)
if norm2int or norm2sum:
if norm2int and norm2sum:
print("Can't normalize to Integral and to Sum at the same time. Will normalize to the sum.")
foo = 0.0
# TODO: change to "in self.data"?
for i in range(len(self.data)):
if norm2sum:
foo += self.data[i].val
else:
foo += self.data[i].val*(self.data[i].xmax-self.data[i].xmin)
# TODO: change to "in self.data"?
if foo != 0:
for i in range(len(self.data)):
self.data[i].val /= foo
self.data[i].err[0] /= foo
self.data[i].err[1] /= foo
scale = self.attr_float('Scale', 1.0)
if scale != 1.0:
# TODO: change to "in self.data"?
for i in range(len(self.data)):
self.data[i].val *= scale
self.data[i].err[0] *= scale
self.data[i].err[1] *= scale
if self.attr_int("Rebin", 1) > 1:
rebin = self.attr_int("Rebin", 1)
errortype = self.attr("ErrorType", "stat")
newdata = []
for i in range(0, (len(self.data)//rebin)*rebin, rebin):
foo = 0.
barl = 0.
baru = 0.
for j in range(rebin):
binwidth = self.data[i+j].xwidth
foo += self.data[i+j].val * binwidth
if errortype == "stat":
barl += (binwidth * self.data[i+j].err[0])**2
baru += (binwidth * self.data[i+j].err[1])**2
elif errortype == "env":
barl += self.data[i+j].ymin * binwidth
baru += self.data[i+j].ymax * binwidth
else:
logging.error("Rebinning for ErrorType not implemented.")
sys.exit(1)
newbinwidth = self.data[i+rebin-1].xmax - self.data[i].xmin
newcentral = foo/newbinwidth
if errortype == "stat":
newerror = [sqrt(barl)/newbinwidth, sqrt(baru)/newbinwidth]
elif errortype == "env":
newerror = [(foo-barl)/newbinwidth, (baru-foo)/newbinwidth]
newdata.append(BinData(self.data[i].xmin, self.data[i+rebin-1].xmax, newcentral, newerror))
self.data = newdata
def add(self, name):
if len(self.data) != len(name.data):
print('+++ Error in Histogram.add() for %s: different numbers of bins' % self.path)
for i in range(len(self.data)):
if fuzzyeq(self.data[i].xmin, name.data[i].xmin) and \
fuzzyeq(self.data[i].xmax, name.data[i].xmax):
self.data[i].val += name.data[i].val
self.data[i].err[0] = sqrt(self.data[i].err[0]**2 + name.data[i].err[0]**2)
self.data[i].err[1] = sqrt(self.data[i].err[1]**2 + name.data[i].err[1]**2)
else:
print('+++ Error in Histogram.add() for %s: binning of histograms differs' % self.path)
def divide(self, name):
#print(name.path, self.path)
if len(self.data) != len(name.data):
print('+++ Error in Histogram.divide() for %s: different numbers of bins' % self.path)
for i in range(len(self.data)):
if fuzzyeq(self.data[i].xmin, name.data[i].xmin) and \
fuzzyeq(self.data[i].xmax, name.data[i].xmax):
try:
self.data[i].err[0] /= name.data[i].val
except ZeroDivisionError:
self.data[i].err[0]=0.
try:
self.data[i].err[1] /= name.data[i].val
except ZeroDivisionError:
self.data[i].err[1]=0.
try:
self.data[i].val /= name.data[i].val
except ZeroDivisionError:
self.data[i].val=1.
# self.data[i].err[0] = sqrt(self.data[i].err[0]**2 + name.data[i].err[0]**2)
# self.data[i].err[1] = sqrt(self.data[i].err[1]**2 + name.data[i].err[1]**2)
else:
print('+++ Error in Histogram.divide() for %s: binning of histograms differs' % self.path)
def dividereverse(self, name):
if len(self.data) != len(name.data):
print('+++ Error in Histogram.dividereverse() for %s: different numbers of bins' % self.path)
for i in range(len(self.data)):
if fuzzyeq(self.data[i].xmin, name.data[i].xmin) and \
fuzzyeq(self.data[i].xmax, name.data[i].xmax):
try:
self.data[i].err[0] = name.data[i].err[0]/self.data[i].val
except ZeroDivisionError:
self.data[i].err[0]=0.
try:
self.data[i].err[1] = name.data[i].err[1]/self.data[i].val
except ZeroDivisionError:
self.data[i].err[1]=0.
try:
self.data[i].val = name.data[i].val/self.data[i].val
except ZeroDivisionError:
self.data[i].val=1.
else:
print('+++ Error in Histogram.dividereverse(): binning of histograms differs')
def deviation(self, name):
if len(self.data) != len(name.data):
print('+++ Error in Histogram.deviation() for %s: different numbers of bins' % self.path)
for i in range(len(self.data)):
if fuzzyeq(self.data[i].xmin, name.data[i].xmin) and \
fuzzyeq(self.data[i].xmax, name.data[i].xmax):
self.data[i].val -= name.data[i].val
try:
self.data[i].val /= 0.5*sqrt((name.data[i].err[0] + name.data[i].err[1])**2 + \
(self.data[i].err[0] + self.data[i].err[1])**2)
except ZeroDivisionError:
self.data[i].val = 0.0
try:
self.data[i].err[0] /= name.data[i].err[0]
except ZeroDivisionError:
self.data[i].err[0] = 0.0
try:
self.data[i].err[1] /= name.data[i].err[1]
except ZeroDivisionError:
self.data[i].err[1] = 0.0
else:
print('+++ Error in Histogram.deviation() for %s: binning of histograms differs' % self.path)
def getChi2(self, name):
chi2 = 0.
for i in range(len(self.data)):
if fuzzyeq(self.data[i].xmin, name.data[i].xmin) and \
fuzzyeq(self.data[i].xmax, name.data[i].xmax):
try:
chi2 += (self.data[i].val-name.data[i].val)**2/((0.5*self.data[i].err[0]+0.5*self.data[i].err[1])**2 + (0.5*name.data[i].err[0]+0.5*name.data[i].err[1])**2)
except ZeroDivisionError:
pass
else:
print('+++ Error in Histogram.getChi2() for %s: binning of histograms differs' % self.path)
return chi2/len(self.data)
def getSigmaBinValue(self):
if self.sigmabinvalue==None:
self.sigmabinvalue = 0.
sumofweights = 0.
for i in range(len(self.data)):
if self.is2dim:
binwidth = abs( (self.data[i].xmax[0] - self.data[i].xmin[0])
*(self.data[i].xmax[1] - self.data[i].xmin[1]))
else:
binwidth = abs(self.data[i].xmax - self.data[i].xmin)
self.sigmabinvalue += binwidth*(self.data[i].val-self.getMeanBinValue())**2
sumofweights += binwidth
self.sigmabinvalue = sqrt(self.sigmabinvalue/sumofweights)
return self.sigmabinvalue
def getMeanBinValue(self):
if self.meanbinvalue==None:
self.meanbinvalue = 0.
sumofweights = 0.
for i in range(len(self.data)):
if self.is2dim:
binwidth = abs( (self.data[i].xmax[0] - self.data[i].xmin[0])
*(self.data[i].xmax[1] - self.data[i].xmin[1]))
else:
binwidth = abs(self.data[i].xmax - self.data[i].xmin)
self.meanbinvalue += binwidth*self.data[i].val
sumofweights += binwidth
self.meanbinvalue /= sumofweights
return self.meanbinvalue
def getCorrelation(self, name):
correlation = 0.
sumofweights = 0.
for i in range(len(self.data)):
if fuzzyeq(self.data[i].xmin, name.data[i].xmin) and \
fuzzyeq(self.data[i].xmax, name.data[i].xmax):
if self.is2dim:
binwidth = abs( (self.data[i].xmax[0] - self.data[i].xmin[0])
* (self.data[i].xmax[1] - self.data[i].xmin[1]) )
else:
binwidth = abs(self.data[i].xmax - self.data[i].xmin)
correlation += binwidth * ( self.data[i].val - self.getMeanBinValue() ) \
* ( name.data[i].val - name.getMeanBinValue() )
sumofweights += binwidth
else:
print('+++ Error in Histogram.getCorrelation(): binning of histograms differs' % self.path)
correlation /= sumofweights
try:
correlation /= self.getSigmaBinValue()*name.getSigmaBinValue()
except ZeroDivisionError:
correlation = 0
return correlation
def getRMSdistance(self,name):
distance = 0.
sumofweights = 0.
for i in range(len(self.data)):
if fuzzyeq(self.data[i].xmin, name.data[i].xmin) and \
fuzzyeq(self.data[i].xmax, name.data[i].xmax):
if self.is2dim:
binwidth = abs( (self.data[i].xmax[0] - self.data[i].xmin[0])
* (self.data[i].xmax[1] - self.data[i].xmin[1]) )
else:
binwidth = abs(self.data[i].xmax - self.data[i].xmin)
distance += binwidth * ( (self.data[i].val - self.getMeanBinValue())
-(name.data[i].val - name.getMeanBinValue()))**2
sumofweights += binwidth
else:
print('+++ Error in Histogram.getRMSdistance() for %s: binning of histograms differs' % self.path)
distance = sqrt(distance/sumofweights)
return distance
def draw(self,coors):
seen_nan = False
out = ""
out += self.startclip()
out += self.startpsset()
if any(b.isValid for b in self.data):
out += "% START DATA\n"
if self.is2dim:
for b in self.data:
out += ('\\psframe')
color = int(129*coors.phys2frameZ(b.val))
if b.val > coors.zmax():
color = 129
if b.val < coors.zmin():
color = 0
if b.val <= coors.zmin():
out += ('[linewidth=0pt, linestyle=none, fillstyle=solid, fillcolor=white]')
else:
out += ('[linewidth=0pt, linestyle=none, fillstyle=solid, fillcolor={gradientcolors!!['+str(color)+']}]')
out += ('(' + coors.strphys2frameX(b.low[0]) + ', ' \
+ coors.strphys2frameY(b.low[1]) + ')(' \
+ coors.strphys2frameX(b.high[0]) + ', ' \
+ coors.strphys2frameY(b.high[1]) + ')\n')
else:
if self.getErrorBands():
self.description['SmoothLine'] = 0
for b in self.data:
if isnan(b.val) or isnan(b.err[0]) or isnan(b.err[1]):
seen_nan = True
continue
out += ('\\psframe[dimen=inner,linewidth=0pt,linestyle=none,fillstyle=solid,fillcolor=%s,opacity=%s]' % (self.getErrorBandColor(),self.getErrorBandOpacity()))
out += ('(' + coors.strphys2frameX(b.xmin) + ', ' \
+ coors.strphys2frameY(b.val - b.err[0]) + ')(' \
+ coors.strphys2frameX(b.xmax) + ', ' \
+ coors.strphys2frameY(b.val + b.err[1]) + ')\n')
if self.getErrorBars():
for b in self.data:
if isnan(b.val) or isnan(b.err[0]) or isnan(b.err[1]):
seen_nan = True
continue
if b.val == 0. and b.err == [0.,0.]:
continue
out += ('\\psline')
out += ('(' + coors.strphys2frameX(b.xmin) + ', ' \
+ coors.strphys2frameY(b.val) + ')(' \
+ coors.strphys2frameX(b.xmax) + ', ' \
+ coors.strphys2frameY(b.val) + ')\n')
out += ('\\psline')
bincenter = coors.strphys2frameX(.5*(b.xmin+b.xmax))
out += ('(' + bincenter + ', ' \
+ coors.strphys2frameY(b.val-b.err[0]) + ')(' \
+ bincenter + ', ' \
+ coors.strphys2frameY(b.val+b.err[1]) + ')\n')
if self.getSmoothLine():
out += '\\psbezier'
else:
out += '\\psline'
if self.getFillStyle() != 'none': # make sure that filled areas go all the way down to the x-axis
if coors.phys2frameX(self.data[0].xmin) > 1e-4:
out += '(' + coors.strphys2frameX(self.data[0].xmin) + ', -0.1)\n'
else:
out += '(-0.1, -0.1)\n'
for i, b in enumerate(self.data):
if isnan(b.val):
seen_nan = True
continue
if self.getSmoothLine():
out += ('(' + coors.strphys2frameX(0.5*(b.xmin+b.xmax)) + ', ' \
+ coors.strphys2frameY(b.val) + ')\n')
else:
out += ('(' + coors.strphys2frameX(b.xmin) + ', ' \
+ coors.strphys2frameY(b.val) + ')(' \
+ coors.strphys2frameX(b.xmax) + ', ' \
+ coors.strphys2frameY(b.val) + ')\n')
## Join/separate data points, with vertical/diagonal lines
if i+1 < len(self.data): #< If this is not the last point
if self.description.get('ConnectBins', '1') != '1':
out += ('\\psline')
else:
## If bins are joined, but there is a gap in binning, choose whether to fill the gap
if (abs(coors.phys2frameX(b.xmax) - coors.phys2frameX(self.data[i+1].xmin)) > 1e-4):
if self.description.get('ConnectGaps', '0') != '1':
out += ('\\psline')
# TODO: Perhaps use a new dashed line to fill the gap?
if self.getFillStyle() != 'none': # make sure that filled areas go all the way down to the x-axis
if (coors.phys2frameX(self.data[-1].xmax) < 1-1e-4):
out += '(' + coors.strphys2frameX(self.data[-1].xmax) + ', -0.1)\n'
else:
out += '(1.1, -0.1)\n'
#
if self.getPolyMarker() != '':
for b in self.data:
if isnan(b.val):
seen_nan = True
continue
if b.val == 0. and b.err == [0.,0.]:
continue
out += ('\\psdot[dotstyle=%s,dotsize=%s,dotscale=%s](' % (self.getPolyMarker(),self.getDotSize(),self.getDotScale()) \
+ coors.strphys2frameX(.5*(b.xmin+b.xmax)) + ', ' \
+ coors.strphys2frameY(b.val) + ')\n')
out += "% END DATA\n"
else:
print("WARNING: No valid bin value/errors/edges to plot!")
out += "% NO DATA!\n"
out += self.stoppsset()
out += self.stopclip()
if seen_nan:
print("WARNING: NaN-valued value or error bar!")
return out
# def is2dimensional(self):
# return self.is2dim
def getXMin(self):
if not self.data:
return 0
elif self.is2dim:
return min(b.low[0] for b in self.data)
else:
return min(b.xmin for b in self.data)
def getXMax(self):
if not self.data:
return 1
elif self.is2dim:
return max(b.high[0] for b in self.data)
else:
return max(b.xmax for b in self.data)
def getYMin(self, xmin, xmax, logy):
if not self.data:
return 0
elif self.is2dim:
return min(b.low[1] for b in self.data)
else:
yvalues = []
for b in self.data:
if (b.xmax > xmin or b.xmin >= xmin) and (b.xmin < xmax or b.xmax <= xmax):
foo = b.val
if self.getErrorBars() or self.getErrorBands():
foo -= b.err[0]
if not isnan(foo) and (not logy or foo > 0):
yvalues.append(foo)
return min(yvalues) if yvalues else self.data[0].val
def getYMax(self, xmin, xmax):
if not self.data:
return 1
elif self.is2dim:
return max(b.high[1] for b in self.data)
else:
yvalues = []
for b in self.data:
if (b.xmax > xmin or b.xmin >= xmin) and (b.xmin < xmax or b.xmax <= xmax):
foo = b.val
if self.getErrorBars() or self.getErrorBands():
foo += b.err[1]
if not isnan(foo): # and (not logy or foo > 0):
yvalues.append(foo)
return max(yvalues) if yvalues else self.data[0].val
def getZMin(self, xmin, xmax, ymin, ymax):
if not self.is2dim:
return 0
zvalues = []
for b in self.data:
if (b.xmax[0] > xmin and b.xmin[0] < xmax) and (b.xmax[1] > ymin and b.xmin[1] < ymax):
zvalues.append(b.val)
return min(zvalues)
def getZMax(self, xmin, xmax, ymin, ymax):
if not self.is2dim:
return 0
zvalues = []
for b in self.data:
if (b.xmax[0] > xmin and b.xmin[0] < xmax) and (b.xmax[1] > ymin and b.xmin[1] < ymax):
zvalues.append(b.val)
return max(zvalues)
class Value(Histogram):
def read_input_data(self, f):
for line in f:
if is_end_marker(line, 'VALUE'):
break
elif is_comment(line):
continue
else:
line = line.rstrip()
m = pat_property.match(line)
if m:
prop, value = m.group(1,2)
self.description[prop] = value
else:
linearray = line.split()
if len(linearray) == 3:
self.data.append(BinData(0.0, 1.0, linearray[0], [ linearray[1], linearray[2] ])) # dummy x-values
else:
raise Exception('Value does not have the expected number of columns. ' + line)
# TODO: specialise draw() here
class Counter(Histogram):
def read_input_data(self, f):
for line in f:
if is_end_marker(line, 'COUNTER'):
break
elif is_comment(line):
continue
else:
line = line.rstrip()
m = pat_property.match(line)
if m:
prop, value = m.group(1,2)
self.description[prop] = value
else:
linearray = line.split()
if len(linearray) == 2:
self.data.append(BinData(0.0, 1.0, linearray[0], [ linearray[1], linearray[1] ])) # dummy x-values
else:
raise Exception('Counter does not have the expected number of columns. ' + line)
# TODO: specialise draw() here
class Histo1D(Histogram):
def read_input_data(self, f):
for line in f:
if is_end_marker(line, 'HISTO1D'):
break
elif is_comment(line):
continue
else:
line = line.rstrip()
m = pat_property.match(line)
if m:
prop, value = m.group(1,2)
self.description[prop] = value
else:
linearray = line.split()
## Detect symm errs
# TODO: Not sure what the 8-param version is for... auto-compatibility with YODA format?
if len(linearray) in [4,8]:
self.data.append(BinData(linearray[0], linearray[1], linearray[2], linearray[3]))
## Detect asymm errs
elif len(linearray) == 5:
self.data.append(BinData(linearray[0], linearray[1], linearray[2], [linearray[3],linearray[4]]))
else:
raise Exception('Histo1D does not have the expected number of columns. ' + line)
# TODO: specialise draw() here
class Histo2D(Histogram):
def read_input_data(self, f):
self.is2dim = True #< Should really be done in a constructor, but this is easier for now...
for line in f:
if is_end_marker(line, 'HISTO2D'):
break
elif is_comment(line):
continue
else:
line = line.rstrip()
m = pat_property.match(line)
if m:
prop, value = m.group(1,2)
self.description[prop] = value
else:
linearray = line.split()
if len(linearray) in [6,7]:
# If asymm z error, use the max or average of +- error
err = float(linearray[5])
if len(linearray) == 7:
if self.description.get("ShowMaxZErr", 1):
err = max(err, float(linearray[6]))
else:
err = 0.5 * (err + float(linearray[6]))
self.data.append(BinData([linearray[0], linearray[2]], [linearray[1], linearray[3]], float(linearray[4]), err))
else:
raise Exception('Histo2D does not have the expected number of columns. '+line)
# TODO: specialise draw() here
#############################
class Frame(object):
def __init__(self):
self.framelinewidth = '0.3pt'
def draw(self,inputdata):
out = ('\n%\n% Frame\n%\n')
if inputdata.description.get('FrameColor') is not None:
color = inputdata.description['FrameColor']
# We want to draw this frame only once, so set it to False for next time:
inputdata.description['FrameColor']=None
# Calculate how high and wide the overall plot is
height = [0,0]
width = inputdata.attr('PlotSizeX')
if inputdata.attr_bool('RatioPlot', False):
height[1] = -inputdata.description['RatioPlotSizeY']
if not inputdata.attr_bool('MainPlot', True):
height[0] = inputdata.description['PlotSizeY']
else:
height[0] = -height[1]
height[1] = 0
# Get the margin widths
left = inputdata.description['LeftMargin']+0.1
right = inputdata.description['RightMargin']+0.1
top = inputdata.description['TopMargin']+0.1
bottom = inputdata.description['BottomMargin']+0.1
#
out += ('\\rput(0,1){\\psline[linewidth=%scm,linecolor=%s](%scm,%scm)(%scm,%scm)}\n' %(top, color, -left, top/2, width+right, top/2))
out += ('\\rput(0,%scm){\\psline[linewidth=%scm,linecolor=%s](%scm,%scm)(%scm,%scm)}\n' %(height[1], bottom, color, -left, -bottom/2, width+right, -bottom/2))
out += ('\\rput(0,0){\\psline[linewidth=%scm,linecolor=%s](%scm,%scm)(%scm,%scm)}\n' %(left, color, -left/2, height[1]-0.05, -left/2, height[0]+0.05))
out += ('\\rput(1,0){\\psline[linewidth=%scm,linecolor=%s](%scm,%scm)(%scm,%scm)}\n' %(right, color, right/2, height[1]-0.05, right/2, height[0]+0.05))
out += ('\\psframe[linewidth='+self.framelinewidth+',dimen=middle](0,0)(1,1)\n')
return out
class Ticks(object):
def __init__(self, description, coors):
self.majorticklinewidth = '0.3pt'
self.minorticklinewidth = '0.3pt'
self.majorticklength = '9pt'
self.minorticklength = '4pt'
self.description = description
self.coors = coors
def draw_ticks(self, vmin, vmax, plotlog=False, custommajorticks=None, customminorticks=None, custommajortickmarks=-1, customminortickmarks=-1, drawlabels=True, twosided=False):
if vmax <= vmin:
raise Exception("Cannot place tick marks. Inconsistent min=%s and max=%s" % (vmin,vmax))
out = ""
if plotlog:
if vmin <= 0 or vmax <= 0:
raise Exception("Cannot place log axis min or max tick <= 0")
if custommajorticks is None:
x = int(log10(vmin))
n_labels = 0
while x < log10(vmax) + 1:
if 10**x >= vmin:
ticklabel = 10**x
if ticklabel > vmin and ticklabel < vmax:
out += self.draw_majortick(ticklabel,twosided)
if drawlabels:
out += self.draw_majorticklabel(ticklabel)
n_labels += 1
if ticklabel == vmin or ticklabel == vmax:
if drawlabels:
out += self.draw_majorticklabel(ticklabel)
n_labels+=1
for i in range(2,10):
ticklabel = i*10**(x-1)
if ticklabel > vmin and ticklabel < vmax:
out += self.draw_minortick(ticklabel,twosided)
if drawlabels and n_labels == 0:
if (i+1)*10**(x-1) < vmax: # some special care for the last minor tick
out += self.draw_minorticklabel(ticklabel)
else:
out += self.draw_minorticklabel(ticklabel, last=True)
x += 1
else:
print("Warning: custom major ticks not currently supported on log axes -- please contact the developers to request!")
elif custommajorticks is not None or customminorticks is not None:
if custommajorticks:
for i in range(len(custommajorticks)):
value = custommajorticks[i]['Value']
label = custommajorticks[i]['Label']
if value >= vmin and value <= vmax:
out += self.draw_majortick(value,twosided)
if drawlabels:
out += self.draw_majorticklabel(value, label=label)
if customminorticks:
for i in range(len(customminorticks)):
value = customminorticks[i]['Value']
if value >= vmin and value <= vmax:
out += self.draw_minortick(value,twosided)
else:
vrange = vmax - vmin
if isnan(vrange):
vrange, vmin, vmax = 1, 1, 2
digits = int(log10(vrange))+1
if vrange <= 1:
digits -= 1
foo = int(vrange/(10**(digits-1)))
if foo/9. > 0.5:
tickmarks = 10
elif foo/9. > 0.2:
tickmarks = 5
elif foo/9. > 0.1:
tickmarks = 2
if custommajortickmarks > -1:
if custommajortickmarks not in [1, 2, 5, 10, 20]:
print('+++ Error in Ticks.draw_ticks(): MajorTickMarks must be in [1, 2, 5, 10, 20]')
else:
tickmarks = custommajortickmarks
if tickmarks == 2 or tickmarks == 20:
minortickmarks = 3
else:
minortickmarks = 4
if customminortickmarks > -1:
minortickmarks = customminortickmarks
#
x = 0
while x > vmin*10**digits:
x -= tickmarks*100**(digits-1)
while x <= vmax*10**digits:
if x >= vmin*10**digits - tickmarks*100**(digits-1):
ticklabel = 1.*x/10**digits
if int(ticklabel) == ticklabel:
ticklabel = int(ticklabel)
if float(ticklabel-vmin)/vrange >= -1e-5:
if abs(ticklabel-vmin)/vrange > 1e-5 and abs(ticklabel-vmax)/vrange > 1e-5:
out += self.draw_majortick(ticklabel,twosided)
if drawlabels:
out += self.draw_majorticklabel(ticklabel)
xminor = x
for i in range(minortickmarks):
xminor += 1.*tickmarks*100**(digits-1)/(minortickmarks+1)
ticklabel = 1.*xminor/10**digits
if ticklabel > vmin and ticklabel < vmax:
if abs(ticklabel-vmin)/vrange > 1e-5 and abs(ticklabel-vmax)/vrange > 1e-5:
out += self.draw_minortick(ticklabel,twosided)
x += tickmarks*100**(digits-1)
return out
def draw(self):
pass
def draw_minortick(self, ticklabel, twosided):
pass
def draw_majortick(self, ticklabel, twosided):
pass
def draw_majorticklabel(self, ticklabel):
pass
def draw_minorticklabel(self, value, label='', last=False):
return ''
def get_ticklabel(self, value, plotlog=False, minor=False, lastminor=False):
label=''
prefix = ''
if plotlog:
bar = int(log10(value))
if bar < 0:
sign='-'
else:
sign='\\,'
if minor: # The power of ten is only to be added to the last minor tick label
if lastminor:
label = str(int(value/(10**bar))) + "\\cdot" + '10$^{'+sign+'\\text{'+str(abs(bar))+'}}$'
else:
label = str(int(value/(10**bar))) # The naked prefactor
else:
if bar==0:
label = '1'
else:
label = '10$^{'+sign+'\\text{%s}}$' % str(abs(bar))
else:
if fabs(value) < 1e-10:
value = 0
label = '%.3g' % value
if "e" in label:
a, b = label.split("e")
astr = "%2.1f" % float(a)
bstr = str(int(b))
label = "\\smaller{%s $\\!\\cdot 10^{%s} $}" % (astr, bstr)
return label
class XTicks(Ticks):
def draw(self, custommajorticks=None, customminorticks=None, custommajortickmarks=-1, customminortickmarks=-1,drawlabels=True):
twosided = bool(int(self.description.get('XTwosidedTicks', '0')))
out = ""
out += ('\n%\n% X-Ticks\n%\n')
out += ('\\def\\majortickmarkx{\\psline[linewidth='+self.majorticklinewidth+'](0,0)(0,'+self.majorticklength+')}%\n')
out += ('\\def\\minortickmarkx{\\psline[linewidth='+self.minorticklinewidth+'](0,0)(0,'+self.minorticklength+')}%\n')
uselog = self.description['LogX'] and (self.coors.xmin() > 0 and self.coors.xmax() > 0)
out += self.draw_ticks(self.coors.xmin(), self.coors.xmax(),\
plotlog=uselog,\
custommajorticks=custommajorticks,\
customminorticks=customminorticks,\
custommajortickmarks=custommajortickmarks,\
customminortickmarks=customminortickmarks,\
drawlabels=drawlabels,\
twosided=twosided)
return out
def draw_minortick(self, ticklabel, twosided):
out = ''
out += '\\rput('+self.coors.strphys2frameX(ticklabel)+', 0){\\minortickmarkx}\n'
if twosided:
out += '\\rput{180}('+self.coors.strphys2frameX(ticklabel)+', 1){\\minortickmarkx}\n'
return out
def draw_minorticklabel(self, value, label='', last=False):
if not label:
label=self.get_ticklabel(value, int(self.description['LogX']), minor=True, lastminor=last)
if last: # Some more indentation for the last minor label
return ('\\rput('+self.coors.strphys2frameX(value)+', 0){\\rput[B](1.9\\labelsep,-2.3\\labelsep){\\strut{}'+label+'}}\n')
else:
return ('\\rput('+self.coors.strphys2frameX(value)+', 0){\\rput[B](0,-2.3\\labelsep){\\strut{}'+label+'}}\n')
def draw_majortick(self, ticklabel, twosided):
out = ''
out += '\\rput('+self.coors.strphys2frameX(ticklabel)+', 0){\\majortickmarkx}\n'
if twosided:
out += '\\rput{180}('+self.coors.strphys2frameX(ticklabel)+', 1){\\majortickmarkx}\n'
return out
def draw_majorticklabel(self, value, label=''):
if not label:
label = self.get_ticklabel(value, int(self.description['LogX']) and self.coors.xmin() > 0 and self.coors.xmax() > 0)
labelparts = label.split("\\n")
labelcode = label if len(labelparts) == 1 else ("\\shortstack{" + "\\\\ ".join(labelparts) + "}")
rtn = "\\rput(" + self.coors.strphys2frameX(value) + ", 0){\\rput[t](0,-\\labelsep){" + labelcode + "}}\n"
return rtn
class YTicks(Ticks):
def draw(self, custommajorticks=None, customminorticks=None, custommajortickmarks=-1, customminortickmarks=-1, drawlabels=True):
twosided = bool(int(self.description.get('YTwosidedTicks', '0')))
out = ""
out += ('\n%\n% Y-Ticks\n%\n')
out += ('\\def\\majortickmarky{\\psline[linewidth=%s](0,0)(%s,0)}%%\n' % (self.majorticklinewidth, self.majorticklength))
out += ('\\def\\minortickmarky{\\psline[linewidth=%s](0,0)(%s,0)}%%\n' % (self.minorticklinewidth, self.minorticklength))
uselog = self.description['LogY'] and self.coors.ymin() > 0 and self.coors.ymax() > 0
out += self.draw_ticks(self.coors.ymin(), self.coors.ymax(),
plotlog=uselog,
custommajorticks=custommajorticks,
customminorticks=customminorticks,
custommajortickmarks=custommajortickmarks,
customminortickmarks=customminortickmarks,
twosided=twosided,
drawlabels=drawlabels)
return out
def draw_minortick(self, ticklabel, twosided):
out = ''
out += '\\rput(0, '+self.coors.strphys2frameY(ticklabel)+'){\\minortickmarky}\n'
if twosided:
out += '\\rput{180}(1, '+self.coors.strphys2frameY(ticklabel)+'){\\minortickmarky}\n'
return out
def draw_majortick(self, ticklabel, twosided):
out = ''
out += '\\rput(0, '+self.coors.strphys2frameY(ticklabel)+'){\\majortickmarky}\n'
if twosided:
out += '\\rput{180}(1, '+self.coors.strphys2frameY(ticklabel)+'){\\majortickmarky}\n'
return out
def draw_majorticklabel(self, value, label=''):
if not label:
label = self.get_ticklabel(value, int(self.description['LogY']) and self.coors.ymin() > 0 and self.coors.ymax() > 0)
if self.description.get('RatioPlotMode', 'mcdata') == 'deviation' and self.description.get('RatioPlotStage'):
rtn = '\\uput[180]{0}(0, '+self.coors.strphys2frameY(value)+'){\\strut{}'+label+'\\,$\\sigma$}\n'
else:
labelparts = label.split("\\n")
labelcode = label if len(labelparts) == 1 else ("\\shortstack{" + "\\\\ ".join(labelparts) + "}")
rtn = "\\rput(0, " + self.coors.strphys2frameY(value) + "){\\rput[r](-\\labelsep,0){" + labelcode + "}}\n"
return rtn
class ZTicks(Ticks):
def __init__(self, description, coors):
self.majorticklinewidth = '0.3pt'
self.minorticklinewidth = '0.3pt'
self.majorticklength = '6pt'
self.minorticklength = '2.6pt'
self.description = description
self.coors = coors
def draw(self, custommajorticks=None, customminorticks=None, custommajortickmarks=-1, customminortickmarks=-1, drawlabels=True):
out = ""
out += ('\n%\n% Z-Ticks\n%\n')
out += ('\\def\\majortickmarkz{\\psline[linewidth='+self.majorticklinewidth+'](0,0)('+self.majorticklength+',0)}%\n')
out += ('\\def\\minortickmarkz{\\psline[linewidth='+self.minorticklinewidth+'](0,0)('+self.minorticklength+',0)}%\n')
out += self.draw_ticks(self.coors.zmin(), self.coors.zmax(),\
plotlog=self.description['LogZ'],\
custommajorticks=custommajorticks,\
customminorticks=customminorticks,\
custommajortickmarks=custommajortickmarks,\
customminortickmarks=customminortickmarks,\
twosided=False,\
drawlabels=drawlabels)
return out
def draw_minortick(self, ticklabel, twosided):
return '\\rput{180}(1, '+self.coors.strphys2frameZ(ticklabel)+'){\\minortickmarkz}\n'
def draw_majortick(self, ticklabel, twosided):
return '\\rput{180}(1, '+self.coors.strphys2frameZ(ticklabel)+'){\\majortickmarkz}\n'
def draw_majorticklabel(self, value, label=''):
if label=='':
label = self.get_ticklabel(value, int(self.description['LogZ']))
if self.description.get('RatioPlotMode', "mcdata") == 'deviation' and self.description.get('RatioPlotStage'):
return ('\\uput[0]{0}(1, '+self.coors.strphys2frameZ(value)+'){\\strut{}'+label+'\\,$\\sigma$}\n')
else:
return ('\\uput[0]{0}(1, '+self.coors.strphys2frameZ(value)+'){\\strut{}'+label+'}\n')
class Coordinates(object):
def __init__(self, inputdata):
self.description = inputdata.description
def phys2frameX(self, x):
if self.description['LogX']:
if x>0:
result = 1.*(log10(x)-log10(self.xmin()))/(log10(self.xmax())-log10(self.xmin()))
else:
return -10
else:
result = 1.*(x-self.xmin())/(self.xmax()-self.xmin())
if (fabs(result) < 1e-4):
return 0
else:
return min(max(result,-10),10)
def phys2frameY(self, y):
if self.description['LogY']:
if y > 0 and self.ymin() > 0 and self.ymax() > 0:
result = 1.*(log10(y)-log10(self.ymin()))/(log10(self.ymax())-log10(self.ymin()))
else:
return -10
else:
result = 1.*(y-self.ymin())/(self.ymax()-self.ymin())
if (fabs(result) < 1e-4):
return 0
else:
return min(max(result,-10),10)
def phys2frameZ(self, z):
if self.description['LogZ']:
if z>0:
result = 1.*(log10(z)-log10(self.zmin()))/(log10(self.zmax())-log10(self.zmin()))
else:
return -10
else:
result = 1.*(z-self.zmin())/(self.zmax()-self.zmin())
if (fabs(result) < 1e-4):
return 0
else:
return min(max(result,-10),10)
# TODO: Add frame2phys functions (to allow linear function sampling in the frame space rather than the physical space)
def strphys2frameX(self, x):
return str(self.phys2frameX(x))
def strphys2frameY(self, y):
return str(self.phys2frameY(y))
def strphys2frameZ(self, z):
return str(self.phys2frameZ(z))
def xmin(self):
return self.description['Borders'][0]
def xmax(self):
return self.description['Borders'][1]
def ymin(self):
return self.description['Borders'][2]
def ymax(self):
return self.description['Borders'][3]
def zmin(self):
return self.description['Borders'][4]
def zmax(self):
return self.description['Borders'][5]
####################
def try_cmd(args):
"Run the given command + args and return True/False if it succeeds or not"
import subprocess
try:
subprocess.check_output(args, stderr=subprocess.STDOUT)
return True
except:
return False
def have_cmd(cmd):
return try_cmd(["which", cmd])
import shutil, subprocess
def process_datfile(datfile):
global opts
if not os.access(datfile, os.R_OK):
raise Exception("Could not read data file '%s'" % datfile)
datpath = os.path.abspath(datfile)
datfile = os.path.basename(datpath)
datdir = os.path.dirname(datpath)
outdir = opts.OUTPUT_DIR if opts.OUTPUT_DIR else datdir
filename = datfile.replace('.dat','')
## Create a temporary directory
# cwd = os.getcwd()
tempdir = tempfile.mkdtemp('.make-plots')
tempdatpath = os.path.join(tempdir, datfile)
shutil.copy(datpath, tempdir)
if opts.NO_CLEANUP:
logging.info('Keeping temp-files in %s' % tempdir)
## Make TeX file
inputdata = InputData(datpath)
texpath = os.path.join(tempdir, '%s.tex' % filename)
texfile = open(texpath, 'w')
p = Plot(inputdata)
texfile.write(p.write_header(inputdata))
if inputdata.attr_bool("MainPlot", True):
mp = MainPlot(inputdata)
texfile.write(mp.draw(inputdata))
if not inputdata.attr_bool("is2dim", False) and inputdata.attr_bool("RatioPlot", True) and inputdata.attr("RatioPlotReference"): # is not None:
rp = RatioPlot(inputdata)
texfile.write(rp.draw(inputdata))
texfile.write(p.write_footer())
texfile.close()
if opts.OUTPUT_FORMAT != ["TEX"]:
## Check for the required programs
latexavailable = have_cmd("latex")
dvipsavailable = have_cmd("dvips")
convertavailable = have_cmd("convert")
ps2pnmavailable = have_cmd("ps2pnm")
pnm2pngavailable = have_cmd("pnm2png")
# TODO: It'd be nice to be able to control the size of the PNG between thumb and full-size...
# currently defaults (and is used below) to a size suitable for thumbnails
def mkpngcmd(infile, outfile, outsize=450, density=300):
if convertavailable:
pngcmd = ["convert",
"-flatten",
"-density", str(density),
infile,
"-quality", "100",
"-resize", "{size:d}x{size:d}>".format(size=outsize),
#"-sharpen", "0x1.0",
outfile]
#logging.debug(" ".join(pngcmd))
#pngproc = subprocess.Popen(pngcmd, stdout=subprocess.PIPE, cwd=tempdir)
#pngproc.wait()
return pngcmd
else:
raise Exception("Required PNG maker program (convert) not found")
# elif ps2pnmavailable and pnm2pngavailable:
# pstopnm = "pstopnm -stdout -xsize=461 -ysize=422 -xborder=0.01 -yborder=0.01 -portrait " + infile
# p1 = subprocess.Popen(pstopnm.split(), stdout=subprocess.PIPE, stderr=open("/dev/null", "w"), cwd=tempdir)
# p2 = subprocess.Popen(["pnmtopng"], stdin=p1.stdout, stdout=open("%s/%s.png" % (tempdir, outfile), "w"), stderr=open("/dev/null", "w"), cwd=tempdir)
# p2.wait()
# else:
# raise Exception("Required PNG maker programs (convert, or ps2pnm and pnm2png) not found")
## Run LaTeX (in no-stop mode)
logging.debug(os.listdir(tempdir))
texcmd = ["latex", "\scrollmode\input", texpath]
logging.debug("TeX command: " + " ".join(texcmd))
texproc = subprocess.Popen(texcmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=tempdir)
logging.debug(texproc.communicate()[0])
logging.debug(os.listdir(tempdir))
## Run dvips
dvcmd = ["dvips", filename]
if not logging.getLogger().isEnabledFor(logging.DEBUG):
dvcmd.append("-q")
## Handle Minion Font
if opts.OUTPUT_FONT == "MINION":
dvcmd.append('-Pminion')
## Choose format
# TODO: Rationalise... this is a mess! Maybe we can use tex2pix?
if "PS" in opts.OUTPUT_FORMAT:
dvcmd += ["-o", "%s.ps" % filename]
logging.debug(" ".join(dvcmd))
dvproc = subprocess.Popen(dvcmd, stdout=subprocess.PIPE, cwd=tempdir)
dvproc.wait()
if "PDF" in opts.OUTPUT_FORMAT:
dvcmd.append("-f")
logging.debug(" ".join(dvcmd))
dvproc = subprocess.Popen(dvcmd, stdout=subprocess.PIPE, cwd=tempdir)
cnvproc = subprocess.Popen(["ps2pdf", "-"], stdin=dvproc.stdout, stdout=subprocess.PIPE, cwd=tempdir)
f = open(os.path.join(tempdir, "%s.pdf" % filename), "wb")
f.write(cnvproc.communicate()[0])
f.close()
if "EPS" in opts.OUTPUT_FORMAT:
dvcmd.append("-f")
logging.debug(" ".join(dvcmd))
dvproc = subprocess.Popen(dvcmd, stdout=subprocess.PIPE, cwd=tempdir)
cnvproc = subprocess.Popen(["ps2eps"], stdin=dvproc.stdout, stderr=subprocess.PIPE, stdout=subprocess.PIPE, cwd=tempdir)
f = open(os.path.join(tempdir, "%s.eps" % filename), "wb")
f.write(cnvproc.communicate()[0])
f.close()
if "PNG" in opts.OUTPUT_FORMAT:
dvcmd.append("-f")
logging.debug(" ".join(dvcmd))
dvproc = subprocess.Popen(dvcmd, stdout=subprocess.PIPE, cwd=tempdir)
#pngcmd = ["convert", "-flatten", "-density", "110", "-", "-quality", "100", "-sharpen", "0x1.0", "%s.png" % filename]
pngcmd = mkpngcmd("-", "%s.png" % filename)
logging.debug(" ".join(pngcmd))
pngproc = subprocess.Popen(pngcmd, stdin=dvproc.stdout, stdout=subprocess.PIPE, cwd=tempdir)
pngproc.wait()
logging.debug(os.listdir(tempdir))
## Copy results back to main dir
for fmt in opts.OUTPUT_FORMAT:
outname = "%s.%s" % (filename, fmt.lower())
outpath = os.path.join(tempdir, outname)
if os.path.exists(outpath):
shutil.copy(outpath, outdir)
else:
logging.error("No output file '%s' from processing %s" % (outname, datfile))
## Clean up
if not opts.NO_CLEANUP:
shutil.rmtree(tempdir, ignore_errors=True)
####################
if __name__ == '__main__':
## Try to rename the process on Linux
try:
import ctypes
libc = ctypes.cdll.LoadLibrary('libc.so.6')
libc.prctl(15, 'make-plots', 0, 0, 0)
except Exception:
pass
## Try to use Psyco optimiser
try:
import psyco
psyco.full()
except ImportError:
pass
## Find number of (virtual) processing units
import multiprocessing
try:
numcores = multiprocessing.cpu_count()
except:
numcores = 1
## Parse command line options
from optparse import OptionParser, OptionGroup
parser = OptionParser(usage=__doc__)
parser.add_option("-j", "-n", "--num-threads", dest="NUM_THREADS", type="int",
default=numcores, help="max number of threads to be used [%s]" % numcores)
parser.add_option("-o", "--outdir", dest="OUTPUT_DIR", default=None,
help="choose the output directory (default = .dat dir)")
parser.add_option("--font", dest="OUTPUT_FONT", choices="palatino,cm,times,helvetica,minion".split(","),
default="palatino", help="choose the font to be used in the plots")
parser.add_option("--palatino", dest="OUTPUT_FONT", action="store_const", const="palatino", default="palatino",
help="use Palatino as font (default). DEPRECATED: Use --font")
parser.add_option("--cm", dest="OUTPUT_FONT", action="store_const", const="cm", default="palatino",
help="use Computer Modern as font. DEPRECATED: Use --font")
parser.add_option("--times", dest="OUTPUT_FONT", action="store_const", const="times", default="palatino",
help="use Times as font. DEPRECATED: Use --font")
parser.add_option("--minion", dest="OUTPUT_FONT", action="store_const", const="minion", default="palatino",
help="use Adobe Minion Pro as font. Note: You need to set TEXMFHOME first. DEPRECATED: Use --font")
parser.add_option("--helvetica", dest="OUTPUT_FONT", action="store_const", const="helvetica", default="palatino",
help="use Helvetica as font. DEPRECATED: Use --font")
parser.add_option("-f", "--format", dest="OUTPUT_FORMAT", default="PDF",
help="choose plot format, perhaps multiple comma-separated formats e.g. 'pdf' or 'tex,pdf,png' (default = PDF).")
parser.add_option("--ps", dest="OUTPUT_FORMAT", action="store_const", const="PS", default="PDF",
help="create PostScript output (default). DEPRECATED")
parser.add_option("--pdf", dest="OUTPUT_FORMAT", action="store_const", const="PDF", default="PDF",
help="create PDF output. DEPRECATED")
parser.add_option("--eps", dest="OUTPUT_FORMAT", action="store_const", const="EPS", default="PDF",
help="create Encapsulated PostScript output. DEPRECATED")
parser.add_option("--png", dest="OUTPUT_FORMAT", action="store_const", const="PNG", default="PDF",
help="create PNG output. DEPRECATED")
parser.add_option("--pspng", dest="OUTPUT_FORMAT", action="store_const", const="PS,PNG", default="PDF",
help="create PS and PNG output. DEPRECATED")
parser.add_option("--pdfpng", dest="OUTPUT_FORMAT", action="store_const", const="PDF,PNG", default="PDF",
help="create PDF and PNG output. DEPRECATED")
parser.add_option("--epspng", dest="OUTPUT_FORMAT", action="store_const", const="EPS,PNG", default="PDF",
help="create EPS and PNG output. DEPRECATED")
parser.add_option("--tex", dest="OUTPUT_FORMAT", action="store_const", const="TEX", default="PDF",
help="create TeX/LaTeX output.")
parser.add_option("--no-cleanup", dest="NO_CLEANUP", action="store_true", default=False,
help="keep temporary directory and print its filename.")
parser.add_option("--no-subproc", dest="NO_SUBPROC", action="store_true", default=False,
help="don't use subprocesses to render the plots in parallel -- useful for debugging.")
parser.add_option("--full-range", dest="FULL_RANGE", action="store_true", default=False,
help="plot full y range in log-y plots.")
parser.add_option("-c", "--config", dest="CONFIGFILES", action="append", default=None,
help="plot config file to be used. Overrides internal config blocks.")
verbgroup = OptionGroup(parser, "Verbosity control")
verbgroup.add_option("-v", "--verbose", action="store_const", const=logging.DEBUG, dest="LOGLEVEL",
default=logging.INFO, help="print debug (very verbose) messages")
verbgroup.add_option("-q", "--quiet", action="store_const", const=logging.WARNING, dest="LOGLEVEL",
default=logging.INFO, help="be very quiet")
parser.add_option_group(verbgroup)
opts, args = parser.parse_args()
## Tweak the opts output
logging.basicConfig(level=opts.LOGLEVEL, format="%(message)s")
opts.OUTPUT_FONT = opts.OUTPUT_FONT.upper()
opts.OUTPUT_FORMAT = opts.OUTPUT_FORMAT.upper().split(",")
if opts.NUM_THREADS == 1:
opts.NO_SUBPROC = True
## Check for no args
if len(args) == 0:
logging.error(parser.get_usage())
sys.exit(2)
## Check that the files exist
for f in args:
if not os.access(f, os.R_OK):
print("Error: cannot read from %s" % f)
sys.exit(1)
## Test for external programs (kpsewhich, latex, dvips, ps2pdf/ps2eps, and convert)
opts.LATEXPKGS = []
if opts.OUTPUT_FORMAT != ["TEX"]:
try:
## latex
if not have_cmd("latex"):
logging.error("ERROR: required program 'latex' could not be found. Exiting...")
sys.exit(1)
## dvips
if not have_cmd("dvips"):
logging.error("ERROR: required program 'dvips' could not be found. Exiting...")
sys.exit(1)
## ps2pdf / ps2eps
if "PDF" in opts.OUTPUT_FORMAT:
if not have_cmd("ps2pdf"):
logging.error("ERROR: required program 'ps2pdf' (for PDF output) could not be found. Exiting...")
sys.exit(1)
elif "EPS" in opts.OUTPUT_FORMAT:
if not have_cmd("ps2eps"):
logging.error("ERROR: required program 'ps2eps' (for EPS output) could not be found. Exiting...")
sys.exit(1)
## PNG output converter
if "PNG" in opts.OUTPUT_FORMAT:
if not have_cmd("convert"):
logging.error("ERROR: required program 'convert' (for PNG output) could not be found. Exiting...")
sys.exit(1)
## kpsewhich: required for LaTeX package testing
if not have_cmd("kpsewhich"):
logging.warning("WARNING: required program 'kpsewhich' (for LaTeX package checks) could not be found")
else:
## Check minion font
if opts.OUTPUT_FONT == "MINION":
p = subprocess.Popen(["kpsewhich", "minion.sty"], stdout=subprocess.PIPE)
p.wait()
if p.returncode != 0:
logging.warning('Warning: Using "--minion" requires minion.sty to be installed. Ignoring it.')
opts.OUTPUT_FONT = "PALATINO"
## Check for HEP LaTeX packages
# TODO: remove HEP-specifics/non-standards?
for pkg in ["hepnames", "hepunits", "underscore"]:
p = subprocess.Popen(["kpsewhich", "%s.sty" % pkg], stdout=subprocess.PIPE)
p.wait()
if p.returncode == 0:
opts.LATEXPKGS.append(pkg)
## Check for Palatino old style figures and small caps
if opts.OUTPUT_FONT == "PALATINO":
p = subprocess.Popen(["kpsewhich", "ot1pplx.fd"], stdout=subprocess.PIPE)
p.wait()
if p.returncode == 0:
opts.OUTPUT_FONT = "PALATINO_OSF"
except Exception as e:
logging.warning("Problem while testing for external packages. I'm going to try and continue without testing, but don't hold your breath...")
def init_worker():
import signal
signal.signal(signal.SIGINT, signal.SIG_IGN)
## Run rendering jobs
datfiles = args
plotword = "plots" if len(datfiles) > 1 else "plot"
logging.info("Making %d %s" % (len(datfiles), plotword))
if opts.NO_SUBPROC:
init_worker()
for i, df in enumerate(datfiles):
logging.info("Plotting %s (%d/%d remaining)" % (df, len(datfiles)-i, len(datfiles)))
process_datfile(df)
else:
pool = multiprocessing.Pool(opts.NUM_THREADS, init_worker)
try:
for i, _ in enumerate(pool.imap(process_datfile, datfiles)):
logging.info("Plotting %s (%d/%d remaining)" % (datfiles[i], len(datfiles)-i, len(datfiles)))
pool.close()
except KeyboardInterrupt:
print("Caught KeyboardInterrupt, terminating workers")
pool.terminate()
except ValueError as e:
print(e)
print("Perhaps your .dat file is corrupt?")
pool.terminate()
pool.join()
diff --git a/doc/make-plots.txt b/doc/make-plots.txt
--- a/doc/make-plots.txt
+++ b/doc/make-plots.txt
@@ -1,688 +1,689 @@
make-plots
============
About
-----
`make-plots` reads histogram files in a simple text format and converts
them into PostScript or PDF files. This is done by creating a LaTeX file
and running `latex`, `dvips`, and maybe `ps2pdf`.
Usage
-----
To run `make-plots` call
--------------------
make-plots [options] file.dat [file2.dat ...]
--------------------
All available options can be listed by running
--------------------
make-plots --help
--------------------
Configuration files
~~~~~~~~~~~~~~~~~~~
`make-plots` typically takes the plotting instructions and settings from the
input ascii files as described in the "Input Format" chapter.
It is also possible though to pass a global configuration file to `make-plots`
(cf. `--help`) which allows to specify/overwrite settings for certain plots or
histograms in a plot on top of what the input files specify. This could be
useful if the ascii files are generated automatically (e.g. with `rivet-mkhtml`
or `compare-histos`) and you still want to apply custom plotting options.
An example for this looks like:
--------------------
# BEGIN PLOT figures/MC_WJETS/W_mass.dat
XMin=60.0
XMax=100.0
LegendXPos=0.65
# END PLOT
.*myLOrun.aida/D0_2008_S7554427/d01-x01-y01::Scale=1.0
--------------------
Here first the options in the `PLOT` section of a specific ascii file are
being amended/overwritten. The second part shows how to overwrite the `Scale`
property of one specific histogram line using the ID of the histogram.
Input Format
------------
The ascii files which can be read by `make-plots` are divided into sections.
There are four types of sections which are called `PLOT`, `HISTOGRAM`,
`FUNCTION`, and `SPECIAL`. Every file must contain exactly one `PLOT` section
and at least one section of the other three types. There may be multiple
`HISTOGRAM`, `FUNCTION`, and `SPECIAL` sections.
Empty lines and lines starting with `#` are ignored, except for the section
delimiters described below.
PLOT
~~~~
The `PLOT` section starts with
--------------------
# BEGIN PLOT
--------------------
and ends with
--------------------
# END PLOT
--------------------
Every file must have exactly one `PLOT` section. In this section global
parameters are specified, like the axis labels, the plot title, size, ...
An empty `PLOT` section is perfectly legal, though.
In this section the following parameters can be set:
Titles, Labels
^^^^^^^^^^^^^^
--------------------
Title=<title>
--------------------
The title of the plot.
--------------------
XLabel=<label>
YLabel=<label>
ZLabel=<label>
--------------------
Axis labels for the x-, y-, and z-axis.
--------------------
XLabelSep=<distance>
YLabelSep=<distance>
ZLabelSep=<distance>
--------------------
Distance between the axis label and the plot in units of `\labelsep`.
--------------------
XMajorTickMarks=<last_digit>
YMajorTickMarks=<last_digit>
ZMajorTickMarks=<last_digit>
XMinorTickMarks=<nticks>
YMinorTickMarks=<nticks>
ZMinorTickMarks=<nticks>
--------------------
`make-plots` tries to guess the distance between tickmarks automatically.
If you are not satisfied with its result, you can override this by setting
`<last_digit>` to 1, 2, 5, or 10, and `<nticks>` to the number of minor ticks
you like.
_Note_: These options are not available for logarithmic axes.
--------------------
XTwosidedTicks=<0|1>
YTwosidedTicks=<0|1>
--------------------
Draw tickmarks also on the upper and/or right side of the plot.
--------------------
XCustomMajorTicks=<list>
YCustomMajorTicks=<list>
ZCustomMajorTicks=<list>
--------------------
To specify major ticks at arbitrary positions and/or with arbitrary labels.
`<list>` is a whitespace-separated list of format `value1 <spaces_or_tabs> label1 <spaces_or_tabs> value2
<spaces_or_tabs> label2 ...`.
TODO: allow use of YAML-style list syntax to clarify delimiters?
--------------------
XCustomMinorTicks=<list>
YCustomMinorTicks=<list>
ZCustomMinorTicks=<list>
--------------------
To specify minor ticks at arbitrary positions. `<list>` is a tab separated
list of format `value1 <tab> value2 <tab> value3 ...`.
--------------------
PlotXTickLabels=<0|1>
RatioPlotTickLabels=<0|1>
--------------------
Disable/enable plotting of the tick labels in the plot and ratio plot (useful
if multiple plots are to be combined manually later).
Axes
^^^^
--------------------
LogX=<0|1>
LogY=<0|1>
LogZ=<0|1>
+RatioPlotLogY=<0|1>
--------------------
Use a logarithmic x-, y-, or z-axis. Default is linear.
--------------------
XMin=<value>
XMax=<value>
YMin=<value>
YMax=<value>
ZMin=<value>
ZMax=<value>
FullRange=<0|1>
ShowZero=<0|1>
--------------------
Specify the plot range. By default the range is chosen such that all data
is visible in linear plots, and the zero is visible. `ShowZero=0` suppresses
plotting the zero in linear plots and thus zooms into the actual y-value range
of the distribution. In logarithmic plots the automatic choice of `YMin`
is limited to be not smaller than 2e-4*`YMax`, but manually you can specify
any value. `FullRange=1` also overrides the 2e-4*`YMax` limit and plots the
full range in y.
Normalization, Rebinning
^^^^^^^^^^^^^^^^^^^^^^^^
--------------------
NormalizeToIntegral=<1|0>
NormalizeToSum=<1|0>
Scale=<factor>
--------------------
Normalize all histograms to their integral, to their sum of entries, or scale
them by some arbitrary factor. Normalization and scale options in the `PLOT`
section override the corresponding option in the `HISTOGRAM` section.
The scale factor is applied after normalization.
--------------------
Rebin=<nbins>
--------------------
Rebin all histograms in this plot. Syntax and functionality is the same as for
the Rebin option in the `HISTOGRAM` section.
Sizes and Margins
^^^^^^^^^^^^^^^^^
--------------------
PlotSize=<xsize,ysize>
--------------------
Size in x and y direction of the plot. This can be specified in any unit
LaTeX understands.
--------------------
LeftMargin=<size>
RightMargin=<size>
TopMargin=<size>
BottomMargin=<size>
--------------------
Distance between the plot and the paper edge.
--------------------
FrameColor=<color>
--------------------
Background color for the margin around the plot.
Legends
^^^^^^^
--------------------
Legend=<0|1>
--------------------
Display a legend in the plot.
--------------------
CustomLegend=<text>
--------------------
Custom text that is added to the legend.
--------------------
LegendXPos=<pos>
LegendYPos=<pos>
--------------------
Position of the legend within the plot. Anchor point is the top left corner of
the legend, so units typically range between 0.0 and 1.0.
--------------------
LegendAlign=<align>
--------------------
Horizontal alignment of the legend: `LegendAlign=l` is the default and will
create a left-aligned legend, while `LegendAlign=r` is right-aligned with
the keys on the right hand side.
--------------------
LegendOnly=<list>
--------------------
Whitespace separated list of IDs. These can be histograms or functions. The
legend is only shown for the listed objects. Without this option, all plotted
objects which have a title enter the legend. The legend titles
are plotted in the given order, so there are cases in which it makes
sense to use `LegendOnly` together with all histogram IDs.
It is also possible to specify the legend order on an entry-by-entry basis
using the `LegendOrder=<int>` setting for each histogram or function.
Plotting Options
^^^^^^^^^^^^^^^^
--------------------
DrawOnly=<list>
--------------------
Whitespace separated list of histogram IDs. Only the histograms in this list
are plotted, even if there are more histograms defined in the file. The
histograms are plotted in the given order, so there are cases in which it makes
sense to use `DrawOnly` together with all histogram IDs. This is especially
useful for the `Stack` option. It is also possible to specify the plotting order
on a histogram-by-histogram basis using the `PlotOrder=<int>` setting for each
histogram.
--------------------
Stack=<list>
--------------------
Whitespace separated list of histogram IDs. The histograms will be added on top
of each other. This is useful for example to compare data with background if
the background has contributions from several histograms.
--------------------
DrawSpecialFirst=<0|1>
DrawFunctionFirst=<0|1>
--------------------
By default the `SPECIAL` and `FUNCTION` sections are plotted after the
histograms. With these options you can override that behaviour.
--------------------
ConnectGaps=<0|1>
--------------------
If error bars are disabled and you want to bridge gaps in a histogram, you
can set this parameter. By default it is off. Setting it in the `PLOT` section
affects all histograms, but you can also set it in the `HISTOGRAM` section for
individual histograms. The local setting overrides the global setting.
Comparison Plots
^^^^^^^^^^^^^^^^
With the
--------------------
RatioPlot=1
RatioPlotReference=<histogram_ID>
--------------------
options you can create ratio plots for two or more histograms. Note that you
must specify your reference data ID. This option is used by the
link:compare-histos.html[`compare-histos`] script.
--------------------
RatioPlotMode=<default|deviation|datamc>
--------------------
By default, the ratio plot displays MC/Data. You can switch to
(MC-data)/uncertainty (`deviation`) or Data/MC (`datamc`) with this
option.
In ratio plots the following additional options are available and work in
a similar way as their regular counterparts:
--------------------
RatioPlotYLabel=<label>
RatioPlotYMin=<value>
RatioPlotYMax=<value>
RatioPlotSizeY=<size>
RatioPlotErrorBandColor=<color>
--------------------
By default, the reference data is plotted using a yellow error band around the
central value of the ratio plot. If you would rather have it plotted in the
same style as in the main plot (e.g. with black errorbars), you can specify:
--------------------
RatioPlotSameStyle=1
--------------------
If you only want the ratio plot without showing the actual data distribution,
you can switch off the main plot. This option implies `RatioPlot=1`:
--------------------
MainPlot=0
--------------------
Goodness of Fit
^^^^^^^^^^^^^^^
`make-plots` can calculate the goodness of fit between histograms and display the
result in the legend. It is also possible to change the color of the margin around
the plot depending on the GoF. This is useful to provide a quick overview when
looking at many plots.
--------------------
GofType=chi2
--------------------
The type of GoF. The default is `chi2` and currently that's the only option.
--------------------
GofReference=<histogram_ID>
--------------------
specifies the reference histogram to be used for the GoF calculation. If this
option is omitted, the fallback is `RatioPlotReference`.
The GoF calculation is activated by two options:
--------------------
GofLegend=<0|1>
GofFrame=<histogram_ID>
--------------------
`GofLegend` calculates the GoF for all histograms and displays the results in
the legend. With `GofFrame` you can specify a single histogram for which the
GoF result will be shown in the legend and used to assign a color to the plot
margins. Note that `FrameColor` overrides the color choice for the margin.
You can use
--------------------
GofFrameColor=<colorthresholds>
--------------------
to specify the thresholds for the frame color. This option takes a list of
`<threshold>:<color>` pairs, separated by whitespace. The default is
`GofFrameColor=0:green 3:yellow 6:red!70`. Again, if you use `FrameColor`,
this option is disabled.
Color Palettes for 2-dim Plots
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
With the option `ColorSeries` you can define a custom color palette for
2-dimensional plots. The syntax is the same as for the `\definecolorseries`
command in the `xcolor` LaTeX package after the color series name, i.e.
`{core-model}{method}[begin-model]{begin-spec}[end-model]{end-spec}`. For more
information you can consult the
http://www.ctan.org/tex-archive/macros/latex/contrib/xcolor/xcolor.pdf[xcolor documentation].
Here is an example:
--------------------
ColorSeries={rgb}{last}[rgb]{1,0.97,0.94}[rgb]{0.6,0.0,0.05}
--------------------
HISTOGRAM
~~~~~~~~~
The `HISTOGRAM` section starts with
--------------------
# BEGIN HISTOGRAM <ID>
--------------------
and ends with
--------------------
# END HISTOGRAM
--------------------
There can be more than one `HISTOGRAM` section in a file. Histograms are
identified by `<ID>` which can be any string _not_ containing whitespace.
Data Format
^^^^^^^^^^^
Lines starting with a number (positive or negative) are interpreted as data.
Each line specifies one bin. The fields in each line must be separated by tabs,
not spaces (this needs to be fixes some day). For 1-dimensional histograms the
format can be
--------------------
<lowerbinedge> <upperbinedge> <value> <error>
<lowerbinedge> <upperbinedge> <value> <minuserror> <pluserror>
--------------------
2-dimensional histograms are supported, too. They are plotted as colormap
(errors are ignored) and specified as
--------------------
<lowerxbinedge> <upperxbinedge> <lowerybinedge> <upperybinedge> <value> <error>
--------------------
Titles
^^^^^^
--------------------
Title=<title>
--------------------
Title of the histogram. This is used for the legend.
Linestyles
^^^^^^^^^^
--------------------
LineStyle=<style>
--------------------
Any linestyle that is understood by the LaTeX pstricks package, e.g. `solid`,
`dotted`, `dashed`, `none`, as well as a special `dashdotted` (or `dotdashed`)
linestyle which does what you might expect.
--------------------
LineColor=<color>
--------------------
Color of the line. Default is black, but any color that pstricks understands
can be used, including constructions like `red!70!blue!20` (for mixing colors),
`{[rgb]{0.8,0,0.7}}` (for RGB-colors), `{[wave]{580}}` (for wavelengths in
nm), `LineColor={[cmyk]{1,1,0,0}}` for CMYK-colors, or `[hsb]{0.5,1,1}` for
HSB-colors.
--------------------
LineOpacity=<opacity>
--------------------
Set the opacity of the line. Default is 1.0. This might not work for ps output.
--------------------
LineWidth=<width>
--------------------
Width of the line.
--------------------
LineDash=<dashstyle>
--------------------
If `LineStyle` is set to `dashed`, you can specify the dash style with this
option. Anything that is understood by pstrick's `dash=...` option is valid.
An example for a dash-dotted line is `LineDash=3pt 3pt .8pt 3pt`. You can use
`LineStyle=dashdotted` or `LineStyle=dotdashed` as an abbreviation for
`LineStyle=dashed` with `LineDash=3pt 3pt .8pt 3pt`.
--------------------
ConnectBins=<0|1>
--------------------
Choose whether to connect adjacent bins' horizontal lines together by a vertical
line on the bin edge. This is enabled by default, but you may wish to disable
it when plotting reference data with error bars and point markers.
--------------------
ConnectGaps=<0|1>
--------------------
If ConnectBins is enabled and you want to bridge gaps in a histogram, you
can set this parameter. By default it is off. Setting it in the `PLOT` section
affects all histograms, but you can also set it in the `HISTOGRAM` section for
individual histograms. The local setting overrides the global setting.
--------------------
SmoothLine=<0|1>
--------------------
Draw a smooth curve rather than a histogram
Fillstyles
^^^^^^^^^^
--------------------
FillStyle=<style>
FillColor=<color>
--------------------
To fill the area below a histogram, set `FillStyle` and `FillColor` to
something pstricks understands. Examples for the style are `solid` or `vlines`.
See `LineColor` for examples of color definitions.
--------------------
FillOpacity=<opacity>
--------------------
Set the opacity of the solid fillcolor. Default is 1.0. This might not work for
ps output.
--------------------
HatchColor=<color>
--------------------
The color of a hatch pattern used for filling the area below a histogram. This
is used for example when you use `vlines` as style.
Data Points
^^^^^^^^^^^
--------------------
ErrorBars=<0|1>
--------------------
Turn on error bars.
--------------------
ErrorBands=<0|1>
ErrorBandColor=<color>
--------------------
Turn on error bands and set their color (see `LineColor` for a description
of color definitions).
--------------------
ErrorBandOpacity=<opacity>
--------------------
Set the opacity of the error band. Default is 1.0. This might not work for ps
output.
--------------------
PolyMarker=<dotstyle>
--------------------
The marker style of the points. Any dot style which is understood by pstricks
is valid, e.g. `*`, `o`, `triangle`, `diamond`, ...
--------------------
DotSize=<size>
DotScale=<factor>
--------------------
The size of the markers. With `DotSize` you can specify the absolute size, e.g.
in units of `pt`, while `DotScale` is a relative measure with respect to the
default size.
Normalization, Rebinning
^^^^^^^^^^^^^^^^^^^^^^^^
--------------------
NormalizeToIntegral=<1|0>
NormalizeToSum=<1|0>
Scale=<factor>
--------------------
Normalize the histogram to the integral, to the sum of entries, or scale it by
some arbitrary factor. If normalization and a scale factor are given, the scale
factor is applied after normalization. This is useful for stacking histograms
when the ratios are known.
--------------------
Rebin=<nbins>
ErrorType=<stat|env>
--------------------
Rebin the histogram. Starting with the lowest bin <nbins> bins are combined
into a new bin. If the number of bins in the histogram is not a multiple of
<nbins>, the remaining bins at the upper histogram end are silently ignored
(i.e. if the original histogram has 10 bins and <nbins> is 3, the plotted
histogram shows three bins combining the bins 1--9 of the original histogram).
The treatment of the errors is determined by the given ErrorType:
`stat` (default) assumes the errors are of statistical nature and combines
them in quadrature sum, while `env` allows to treat errors as envelope of
various uncertainty runs which are combined linearly.
FUNCTION
~~~~~~~~
`make-plots` can draw arbitrary functions. These functions are defined as
python code sniplets which are evaluated by `make-plots`. The code sniplet
must come after all other options in a `FUNCTION` section and are preceded by
`Code=` on a single line. An example `FUNCTION` section might look like this:
--------------------
# BEGIN FUNCTION f_cc
LineColor=red
Code=
p0=16.4
p1=1.25
p2=0.9832
from scipy.special import erf
x-=0.5
if x<=0:
return 0
else:
return .5*p2*(1.+erf( (x-p0)/sqrt(x*p1) ))
# END FUNCTION
--------------------
Common Options with HISTOGRAM
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following options have the same meaning as in the `HISTOGRAM` section:
--------------------
Title=<title>
LineStyle=<style>
LineColor=<color>
LineWidth=<width>
LineDash=<dashstyle>
FillStyle=<style>
FillColor=<color>
HatchColor=<color>
--------------------
Function Range
^^^^^^^^^^^^^^
You can limit the plot range of functions by specifying
--------------------
XMin=<value>
XMax=<value>
--------------------
SPECIAL
~~~~~~~
The `SPECIAL` sections are used to include any custom pstricks code. This is
useful for drawing arrows and lines, put text at any position into the plot,
etc. The default coordinate system is defined to be `(0,0)` at the lower left
and `(1,1)` at the upper right corner of the plot. By putting the
`\physicscoor` command in front of a coordinate pair, these coordinates are
interpreted not in the pstricks coordinate system, but in the physics
coordinate system of the plot, which is useful e.g. for marking cut values in a
plot. Similar `\physicsxcoor` and `\physicsycoor` commands exist which will only
treat the x or y coordinate respectively as being in physics units.
Hint: If you want to clip your `SPECIAL` code to the plot area, you can use
--------------------
\psclip{\psframe[linewidth=0, linestyle=none](0,0)(1,1)}
...
\endpsclip
--------------------
An example of a `SPECIAL` section might look like this:
--------------------
# BEGIN SPECIAL
\psclip{\psframe[linewidth=0, linestyle=none](0,0)(1,1)}
\psline[linewidth=1.2pt,linecolor=red]{<-}\physicscoor(2.83,2)\physicscoor(2.83,18)
\uput{4pt}[180]{0}\physicscoor(2.83,12){observed}
\psline[linewidth=0.8pt,linecolor=red,linestyle=dashed]\physicscoor( 3.17,0)\physicscoor( 3.17,28.14)
\psline[linewidth=0.8pt,linecolor=red,linestyle=dashed]\physicscoor(-3.59,0)\physicscoor(-3.59,28.14)
\endpsclip
# END SPECIAL
--------------------
diff --git a/doc/writinganalyses.tex b/doc/writinganalyses.tex
--- a/doc/writinganalyses.tex
+++ b/doc/writinganalyses.tex
@@ -1,1008 +1,1008 @@
Hopefully by now you've run Rivet a few times and got the hang of the command
line interface and viewing the resulting analysis data files. Maybe you've got
some ideas of analyses that you would like to see in Rivet's library. If so,
then you'll need to know a little about Rivet's internal workings before you can
start coding: with any luck by the end of this section that won't seem
particularly intimidating.
The core objects in Rivet are ``projections'' and ``analyses''. Hopefully
``analyses'' isn't a surprise --- that's just the collection of routines that
will make histograms to compare with reference data, and the only things that
might differ there from experiences with HZTool\cite{Bromley:1995np} are the new histogramming system
and the fact that we've used some object orientation concepts to make life a bit
easier. The meaning of ``projections'', as applied to event analysis, will
probably be less obvious. We'll discuss them soon, but first a
semi-philosophical aside on the ``right way'' to do physics analyses on and
involving simulated data.
\section{The science and art of physically valid MC analysis}
The world of MC event generators is a wonderfully convenient one for
experimentalists: we are provided with fully exclusive events whose most complex
correlations can be explored and used to optimise analysis algorithms and some
kinds of detector correction effects. It is absolutely true that the majority of
data analyses and detector designs in modern collider physics would be very
different without MC simulation.
But it is very important to remember that it is just simulation: event
generators encode much of known physics and phenomenologically explore the
non-perturbative areas of QCD, but only unadulterated experiment can really tell
us about how the world behaves. The richness and convenience of MC simulation
can be seductive, and it is important that experimental use of MC strives to
understand and minimise systematic biases which may result from use of simulated
data, and to not ``unfold'' imperfect models when measuring the real world. The
canonical example of the latter effect is the unfolding of hadronisation (a
deeply non-perturbative and imperfectly-understood process) at the Tevatron (Run
I), based on MC models. Publishing ``measured quarks'' is not physics --- much
of the data thus published has proven of little use to either theory or
experiment in the following years. In the future we must be alert to such
temptation and avoid such gaffes --- and much more subtle ones.
These concerns on how MC can be abused in treating measured data also apply to
MC validation studies. A key observable in QCD tunings is the \pT of the \PZ
boson, which has no phase space at exactly $\pT = 0$ but a very sharp peak at
$\mathcal{O}(\unit{1-2}{\GeV})$. The exact location of this peak is mostly
sensitive to the width parameter of a nucleon ``intrinsic \pT'' in MC
generators, plus some soft initial state radiation and QED
bremsstrahlung. Unfortunately, all the published Tevatron measurements of this
observable have either ``unfolded'' the QED effects to the ``\PZ \pT'' as
attached to the object in the HepMC/HEPEVT event record with a PDG ID code of
23, or have used MC data to fill regions of phase space where the detector could
not measure. Accordingly, it is very hard to make an accurate and portable MC
analysis to fit this data, without similarly delving into the event record in
search of ``the boson''. While common practice, this approach intrinsically
limits the precision of measured data to the calculational order of the
generator --- often not analytically well-defined. We can do better.
Away from this philosophical propaganda (which nevertheless we hope strikes some
chords in influential places\dots), there are also excellent pragmatic reasons
for MC analyses to avoid treating the MC ``truth'' record as genuine truth. The
key argument is portability: there is no MC generator which is the ideal choice
for all scenarios, and an essential tool for understanding sub-leading
variability in theoretical approaches to various areas of physics is to use
several generators with similar leading accuracies but different sub-leading
formalisms. While the HEPEVT record as written by HERWIG and PYTHIA has become
familiar to many, there are many ambiguities in how it is filled, from the
allowed graph structures to the particle content. Notably, the Sherpa event
generator explicitly elides Feynman diagram propagators from the event record,
perhaps driven by a desire to protect us from our baser analytical
instincts. The Herwig++ event generator takes the almost antipodal approach of
expressing different contributing Feynman diagram topologies in different ways
(\emph{not} physically meaningful!) and seamlessly integrating shower emissions
with the hard process particles. The general trend in MC simulation is to blur
the practically-induced line between the sampled matrix element and the
Markovian parton cascade, challenging many established assumptions about ``how
MC works''. In short, if you want to ``find'' the \PZ to see what its \pT or
$\eta$ spectrum looks like, many new generators may break your honed PYTHIA
code\dots or silently give systematically wrong results. The unfortunate truth
is that most of the event record is intended for generator debugging rather than
physics interpretation.
Fortunately, the situation is not altogether negative: in practice it is usually
as easy to write a highly functional MC analysis using only final state
particles and their physically meaningful on-shell decay parents. These are,
since the release of HepMC 2.5, standardised to have status codes of 1 and 2
respectively. \PZ-finding is then a matter of choosing decay lepton candidates,
windowing their invariant mass around the known \PZ mass, and choosing the best
\PZ candidate: effectively a simplified version of an experimental analysis of
the same quantity. This is a generally good heuristic for a safe MC analysis!
Note that since it's known that you will be running the analysis on signal
events, and there are no detector effects to deal with, almost all the details
that make a real analysis hard can be ignored. The one detail that is worth
including is summing momentum from photons around the charged leptons, before
mass-windowing: this physically corresponds to the indistinguishability of
collinear energy deposits in trackers and calorimeters and would be the ideal
published experimental measurement of Drell-Yan \pT for MC tuning. Note that
similar analyses for \PW bosons have the luxury over a true experiment of being
able to exactly identify the decay neutrino rather than having to mess around
with missing energy. Similarly, detailed unstable hadron (or tau) reconstruction
is unnecessary, due to the presence of these particles in the event record with
status code 2. In short, writing an effective analysis which is automatically
portable between generators is no harder than trying to decipher the variable
structures and multiple particle copies of the debugging-level event
objects. And of course Rivet provides lots of tools to do almost all the
standard fiddly bits for you, so there's no excuse!\\[\lineskip]
\noindent
Good luck, and be careful!
% While the event record "truth" structure may look very
% compellingly like a history of the event processes, it is extremely important to
% understand that this is not the case. For starters, such a picture is not
% quantum mechanically robust: it is impossible to reconcile such a concept of a
% single history with the true picture of contributing and interfering
% amplitudes. A good example of this is in parton showers, where QM interference
% leads to colour coherence. In the HERWIG-type parton showers, this colour
% coherence is implemented as an angular-ordered series of emissions, while in
% PYTHIA-type showers, an angular veto is instead applied. The exact history of
% which particles are emitted in which order is not physically meaningful but
% rather an artefact of the model used by the generator --- and is primarily
% useful for generator authors' debugging rather than physics analysis. This is in
% general true for all particles in the event without status codes of 1, 2 or 4.
% Another problem is that the way in which the event internals is documented is
% not well defined: it is for authors' use and as such they can do anything they
% like with the "non-physics" entities stored within. Some examples:
% * Sherpa does not write matrix element particles (i.e. W, Z, Higgs, ...) into the event record in most processes
% * Herwig++ uses very low-mass Ws in its event record to represent very off-shell weak decay currents of B and D mesons (among others)
% * In Drell-Yan events, Herwig++ sometimes calls the propagating boson a Z, and sometimes a photon, probabilistically depending on the no-mixing admixture terms
% * Sherpa events (and maybe others) can have "bottleneck" particles through which everything flows. Asking if a particle has e.g. a b-quark (NB. an unphysical degree of freedom!) ancestor might always give the answer "yes", depending on the way that the event graph has been implemented
% * Different generators do not even use the same status codes for "documentation" event record entries: newer ones tend to represent all internals as generator-specific particles, and emphasise their lack of physical meaning
% * The generator-level barcodes do not have any reliable meaning: any use of them is based on HEPEVT conventions whihc may break, especially for new generators which have never used HEPEVT
% * Many (all?) generators contain multiple copies of single internal particles, as a bookkeeping tools for various stages of event processing. Determining which (if any) is physically meaningful (e.g. which boosts were or weren't applied, whether QED radiation was included, etc.) is not defined in a cross-generator way.
% * The distinction between "matrix element" and "parton shower" is ill-defined: ideally everything would be emitted from the parton shower and indeed the trend is to head at least partially in this direction (cf. CKKW/POWHEG). You probably can't make a physically useful interpretation of the "hard process", even if particular event records allow you to identify such a thing.
% * Quark and gluon jets aren't as simple as the names imply on the "truth" level: to perform colour neutralisation, jets must include more contributions than a single hard process parton. When you look at event graphs, it becomes hard to define these things on a truth level. Use an observable-based heuristic definition instead.
% Hence, any truth-structure assumptions need to checked and probably modified
% when moving from one generator to another: clearly this can lead to
% prohibitively large maintenance and development hurdles. The best approach,
% whenever possible, is to only use truth information to access the particles
% with status code 1 (and those with status = 2, if decays of physically
% meaningful particles (i.e. hadrons) are being studied. In practice, this
% adds relatively little to most analyses, and the portability of the analyses
% is massively improved, allowing for wider and more reliable physics
% studies. If you need to dig deeper, be very careful!
% A final point of warning, more physical than the technicalities above, is that
% the bosons or similar that are written in the event record are imperfect
% calculational objects, rather than genuine truth. MC techniques are improving
% all the time, and you should be extremely careful if planning to do something
% like "unfolding" of QED radiation or initial state QCD radiation on data, based
% on event record internals: the published end result must be meaningfully
% comparable to future fixed order or N^kLL resummation calculations, particularly
% in precision measurements. If not handled with obsessive care, you may end up
% publishing a measurement of the internals of an MC generator rather than
% physical truth! Again, this is not an absolute prohibition --- there are only
% shades of grey in this area --- but just be very careful and stick to statuses
% 1, 2 and 4 whenever possible.
\section{Projections}
\begin{figure}[p]
\centering
\includegraphics[height=0.98\textheight]{projections.png}
\caption{List of available projections and their inheritance structure.}
\label{fig:projections}
\end{figure}
The name ``projection'' is meant to evoke thoughts of projection operators,
low-dimensional slices/views of high-dimensional spaces, and other things that
might appeal to physicists who view the world through quantum-tinted lenses. A
more mundane, but equally applicable, name would be ``observable calculators'',
but since that's a long name, the things they return aren't \emph{necessarily}
observable, and they all inherit from the \kbd{Projection} base class, we'll
stick to that name. It doesn't take long to get used to using the name as a
synonym for ``calculator'', without being intimidated by ideas that they might
be some sort of high-powered deep magic. 90\% of them is simple and
self-explanatory, as a peek under the bonnet of e.g. the all-important
\kbd{FinalState} projection will reveal.
Projections can be relatively simple things like event shapes (i.e. scalar,
vector or tensor quantities), or arbitrarily complex things like lossy or
selective views of the event final state. Most users will see them attached to
analyses by declarations in each analysis' initialisation, but they can also be
recursively ``nested'' inside other projections\footnote{Provided there are no
dependency loops in the projection chains! Strictly, only acyclic graphs of
projection dependencies are valid, but there is currently no code in Rivet
that will attempt to verify this restriction.} (provided there are no infinite
loops in the nesting chain.) Calling a complex projection in an analysis may
actually transparently execute many projections on each event.
You can find a list of all existing projections and their inheritance structure
in Fig.~\ref{fig:projections}. An up-to-date version of this listing can always
be found in the code documentation at \url{http://rivet.hepforge.org}.
\subsection{Projection caching}
Aside from semantic issues of how the class design assigns the process of
analysing events, projections are important computationally because they live in
a framework which automatically stores (``caches'') their results between
events. This is a crucial feature for the long-term scalability of Rivet, as the
previous experience with HZTool was that HERA validation code ran very slowly
due to repeated calculation of the same $k_\perp$ clustering algorithm (at that
time notorious for scaling as the 3rd power of the number of particles.)
A concrete example may help in understanding how this works. Let's say we have
two analyses which have the same run conditions, i.e. incoming beam types, beam
energies, etc. Each also uses the thrust event shape measure to define a set of
basis vectors for their analysis. For each event that gets passed to Rivet,
whichever analysis gets called first will immediately (although maybe
indirectly) call a \kbd{FinalState} projection to get a list of stable, physical
particles (filtering out the intermediate and book-keeping entries in the HepMC
event record). That FS projection is then ``attached'' to the event. Next, the
first analysis will call a \kbd{Thrust} projection which internally uses the
same final state projection to define the momentum vectors used in calculating
the thrust. Once finished, the thrust projection will also be attached to the
event.
So far, projections have offered no benefits. However, when the second analysis
runs it will similarly try to apply its final state and thrust projections to
the event. Rather than repeat the calculations, Rivet's infrastructure will
detect that an equivalent calculation has already been run and will just return
references to the already-run projections. Since projections can also contain
and use other projections, this model allows some substantial computational
savings, without the analysis author even needing to be particularly aware of
what is going on.
Observant readers may have noticed a problem with all this projection caching
cleverness: what if the final states aren't defined the same way? One might
provide charged final state particles only, or the acceptances (defined in
pseudorapidity range and a IR \pT cutoff) might differ. Rivet handles this by
making each projection provide a comparison operator which is used to decide
whether the cached version is acceptable or if the calculation must be re-run
with different settings. Because projections can be nested, applying a top-level
projection to an event can spark off a cascade of comparisons, calculations and
cache accesses, making use of existing results wherever possible.
\subsection{Using projection caching}
So far this is all theory --- how does one actually use projections in Rivet?
First, you should understand that projections, while semantically stored within
each other, are actually all registered with a central \code{ProjectionHandler}
object.\footnote{As of version 1.1 onwards --- previously, they were stored as
class members inside other \code{Projection}s and \code{Analysis} classes.}
The reason for this central registration is to ensure that all projections'
lifespans are managed in a consistent way, and to protect projection and
analysis authors from some technical subtleties in how C++ polymorphism works.
Inside the constructor of a \code{Projection} or the \code{init} method of an
\code{Analysis} class, you must
call the \code{addProjection} function. This takes two arguments, the projection
to be registered (by \code{const} reference), and a name. The name is local to
the parent object, so you need not worry about name clashes between objects. A
very important point is that the passed \code{Projection} is not the one that is
actually centrally registered --- that distinction belongs to a newly created
heap object which is created within the \code{addProjection} method by means of
the overloaded \code{Projection::clone()} method. Hence it is completely safe
--- and recommended --- to use only local (stack) objects in \code{Projection}
and \code{Analysis} constructors.
\begin{philosophy}
At this point, if you have rightly bought into C++ ideas like super-strong
type-safety, this proliferation of dynamic casting may worry you: the compiler
can't possibly check if a projection of the requested name has been
registered, nor whether the downcast to the requested concrete type is
legal. These are very legitimate concerns!
In truth, we'd like to have this level of extra safety: who wouldn't? But in
the past, when projections were held as members of \code{ProjectionApplier}
classes rather than in the central \code{ProjectionHandler} repository, the
benefits of the strong typing were outweighed by more serious and subtle bugs
relating to projection lifetime and object ``slicing''. At least when the
current approach goes wrong it will throw an unmissable \emph{runtime} error
--- until it's fixed, of course! --- rather than silently do the wrong thing.
Our problems here are a microcosm of the perpetual language battle between
strict and dynamic typing, runtime versus compile time errors. In practice,
this manifests itself as a trade-off between the benefits of static type
safety and the inconvenience of the type-system gymnastics that it engenders.
We take some comfort from the number of very good programs have been and are
still written in dynamically typed, interpreted languages like Python, where
virtually all error checking (barring first-scan parsing errors) must be done
at runtime. By pushing \emph{some} checking to the domain of runtime errors,
Rivet's code is (we believe) in practice safer, and certainly more clear and
elegant. However, we believe that with runtime checking should come a culture
of unit testing, which is not yet in place in Rivet.
As a final thought, one reason for Rivet's internal complexity is that C++ is
just not a very good language for this sort of thing: we are operating on the
boundary between event generator codes, number crunching routines (including
third party libraries like FastJet) and user routines. The former set
unavoidably require native interfaces and benefit from static typing; the
latter benefit from interface flexibility, fast prototyping and syntactic
clarity. Maybe a future version of Rivet will break through the technical
barriers to a hybrid approach and allow users to run compiled projections from
interpreted analysis code. For now, however, we hope that our brand of
``slightly less safe C++'' will be a pleasant compromise.
\end{philosophy}
% \begin{detail}
% \TODO{How projection caching \emph{really} works}
% (skippable, but useful as a reference)
% \end{detail}
% \subsection{Standard projection summary}
% \TODO{foo}
% \subsection{Example projection}
% \TODO{bar}
% \subsection{Cuts and constraints}
% \TODO{baz}
\section{Analyses}
\subsection{Writing a new analysis}
This section provides a recipe that can be followed to write a new analysis
using the Rivet projections.
Every analysis must inherit from \code{Rivet::Analysis} and, in addition to the
constructor, must implement a minimum of three methods. Those methods are
\code{init()}, \code{analyze(const Rivet::Event\&)} and \code{finalize()}, which
are called once at the beginning of the analysis, once per event and once at the
end of the analysis respectively.
The new analysis should include the header for the base analysis class plus
whichever Rivet projections are to be used, and should work under the
\code{Rivet} namespace. Since analyses are hardly ever intended to be inherited
from, they are usually implemented within a single \kbd{.cc} file with no
corresponding header. The skeleton of a new analysis named \code{UserAnalysis}
that uses the \code{FinalState} projection might therefore start off looking
like this, in a file named \kbd{UserAnalysis.cc}:
%
\begin{snippet}
#include "Rivet/Analysis.hh"
namespace Rivet {
class UserAnalysis : public Analysis {
public:
UserAnalysis() : Analysis("USERANA") { }
void init() { ... }
void analyze(const Event& event) { ... }
void finalize() { ... }
};
}
\end{snippet}
The constructor body is usually left empty, as all event loop setup is done in
the \code{init()} method: the one \emph{required} constructor feature is to make
a call to its base \code{Analysis} constructor, passing a string by which the
analysis will \emph{register} itself with the Rivet framework. This name is the
one exposed to a command-line or API user of this analysis: usually it is the
same as the class name, which for official analyses is always in upper case.
\begin{warning}
Early versions of Rivet required the user to declare allowed beam types,
energies, whether a cross-section is required, etc. in the analysis
constructor via methods like \code{setBeams(...)} and
\code{setNeedsCrossSection(...)}. This information is now \emph{much}
preferred to be taken from the \kbd{.info} file for the analysis, and
\emph{must} be done this way in analyses submitted for inclusion in future
Rivet releases.
\end{warning}
% for the \code{UserAnalysis} may impose certain
% requirements upon the events that the analysis will work with. A call to the
% \code{setBeams} method declares that the analysis may only be run on events with
% specific types of beam particles, for example adding the line
% %
% \begin{snippet}
% setBeams(PROTON, PROTON);
% \end{snippet}
% %
% \noindent ensures that the analysis can only be run on events from proton-proton
% collisions. Other types of beam particles that may be used include
% \code{ANTIPROTON}, \code{ELECTRON}, \code{POSITRON}, \code{MUON} and \code{ALL}.
% The latter of these declares that the analysis is suitable for use with any type
% of collision and is the default.
% Some analyses need to know the interaction cross section that was generated by
% the Monte Carlo generator, typically in order to normalise histograms.
% Depending on the Monte Carlo that is used and its interface to Rivet, the cross
% section may or may not be known. An analysis can therefore declare at the
% beginning of a run that it will need the cross section information during the
% finalisation stages. Such a declaration can be used to prevent what would
% otherwise be fruitless analyses from running. An analysis sets itself as
% requiring the cross section by calling inside the constructor
% %
% \begin{snippet}
% setNeedsCrossSection(true);
% \end{snippet}
% %
% \noindent In the absence of this call the default is to assume that the analysis
% does not need to know the cross section.
The \code{init()} method for the \code{UserAnalysis} class should add to the analysis all
of the projections that will be used. Projections can be added to an analysis
with a call to \code{addProjection(Projection, std::string)}, which takes as
argument the projection to be added and a name by which that projection can
later be referenced. For this example the \code{FinalState} projection is to be
referenced by the string \code{"FS"} to provide access to all of the final state
particles inside a detector pseudorapidity coverage of $\pm 5.0$. The syntax to
create and add that projection is as follows:
%
\begin{snippet}
init() {
const FinalState fs(-5.0, 5.0);
addProjection(fs, "FS");
}
\end{snippet}
%
A second task of the \code{init()} method is the booking of all histograms which
are later to be filled in the analysis code. Information about the histogramming
system can be found in Section~\ref{section:histogramming}.
% It is often the case that an analysis is only appropriate for a limited range of
% Monte Carlo kinematic settings. For example, an analysis may only be suitable
% if the minimum \pT in the hard scatter is above a certain value. A mechanism
% exists with the \code{Analysis} object to declare the existence of such a cut.
% However, the relevant information must be made available by the Monte Carlo
% generator and, given the potentially large number of such generator-dependent
% cuts, this information is not currently checked by the AGILe generator
% interface. Nevertheless, an analysis can add a cut in the constructor with a
% call to \code{addCut(const string\&, const Comparison\&, const double)}, which
% takes as its arguments the name of the cut, the comparison operator and a value
% to compare the cut quantity with. For example, to add a cut stating that the
% hard scatter \pT must be above \unit{3}{\GeV} one should call
% \begin{snippet}
% addCut("PT", MORE_EQ, 3.0*GeV);
% \end{snippet}
\begin{philosophy}
We are often asked if there is a way to pass parameters to Rivet analyses, to
change their behaviour. This is potentially very useful when e.g. protopying
an analysis or optimising cuts. We have resisted it, however, because it would
jeopardise the core Rivet mission of preserving experimental analyses which
``do the right thing'' to reproduce experimental results without any specific
parameter-passing being necessary: we fear that if parameterised analyses
become ``normal'', it will be much harder to do broad validation and testing
against large swathes of the analysis collection. Maybe we are too pessimistic.
Anyway, you can still pass parameters to non-preservation analyses via
environment variables, and in fact we provide a \code{getEnvParam} function to
help you with this. For example, you might put in your code: \code{double x =
getEnvParam<double>("X", 10.0)}, and then on the command-line call
\kbd{X=17.5 rivet -a MYANALYSIS}: the \kbd{X} variable will be read, converted
to a double, and stored in the \code{x} variable; if it is not set, the value
will default to 10. Hopefully this will satisfy the most enthusiastic
analysis-parametriser!
\end{philosophy}
\subsection{Utility classes and functions}
Rivet provides quite a few object types for physics purposes, such as three- and
four-vectors, matrices and Lorentz boosts, and convenience proxy objects for
e.g. particles and jets. We now briefly summarise the most important features of
some of these objects; more complete interface descriptions can be found in the
generated Doxygen web pages on the Rivet web site, or simply by browsing the
relevant header files.
\subsubsection{\code{FourMomentum}}
The \code{FourMomentum} class is the main physics vector that you will encounter
when writing Rivet analyses. Its functionality and interface are similar to the
CLHEP \code{HepLorentzVector} with which many users will be familiar, but
without some of the historical baggage.
\paragraph{Vector components}%
The \code{FourMomentum} \code{E()}, \code{px()}, \code{py()}, \code{pz()} \&
\code{mass()} methods are (unsurprisingly) accessors for the vector's energy,
momentum components and mass. The \code{vector3()} method returns a spatial
\code{Vector3} object, i.e. the 3 spatial components of the 4-vector.
\paragraph{Useful properties}%
The \code{pT()} and \code{Et()} methods are used to calculate the transverse
momentum and transverse energy. Angular variables are accessed via the
\code{eta()}, \code{phi()} and \code{theta()} for the pseudorapidity, azimuthal
angle and polar angle respectively. More explicitly named versions of these also
exist, named \code{pseudorapidity()}, \code{azimuthalAngle()} and
\code{polarAngle()}. Finally, the true rapidity is accessed via the
\code{rapidity()} method. Many of these functions are also available as external
functions, as are algebraic functions such as \code{cross(vec3a, vec3b)}, which
is perhaps more palatable than \code{vec3a.cross(vec3b)}.
\paragraph{Distances}%
The $\eta$--$\phi$ distance between any two four-vectors (and/or three-vectors)
can be computed using a range of overloaded external functions of the type
\code{deltaR(vec1, vec2)}. Angles between such vectors can be calculated via the
similar \code{angle(vec1, vec2)} functions.
\begin{warning}
Developers' note: We should be specific about the type of rapidity used in
$\Delta{R}$ calculations\dots and change the default? Pseudorapidity naively
corresponds better to detector geometry than rapidity, but it has been shown
that this is not true for jets (and presumably also composite particles).
\end{warning}
\subsubsection{\code{Cut}s}
The \code{Cut} system is a very powerful innovation in Rivet, allowing clear and
self-documenting expression of arbitrarily complex kinematic cuts without
needing lots of function overloads, or falling foul of type ambiguities.
First, let's explain the problem with the original \code{FinalState}
constructor: \code{FinalState(double, double, double)}. What do these parameters
mean? Without reading the code -- which would reveal, perhaps unintuitively,
that the order is $(\eta_\text{min}, \eta_\text{max}, \p_\perp^\text{min})$ --
we simply have no way of knowing. This is bad for readability and
maintainability of analysis code, since everyone will forget the order at some
point, and the compiler will be of no help since it cannot tell when you get the
order wrong: a double is a double, regardless of whether its value doesn't make
sense as a \pT.
A second problem is what to do with disjoint ranges, e.g.~excluding crack
regions in the ATLAS calorimeters: do we need a separate \code{FinalState} for
each $\eta$ range?! In fact, \code{FinalState} had a highly inconvenient-to-use
constructor accepting a vector of $\eta$ min/max pairs for this reason --
yuck. Wouldn't it be nice if we could just use logical ANDs and ORs?
The \code{Cut} classes do exactly this, and are best demonstrated with an
example: \code{fs.particles(Cuts::pT > 10*GeV \&\& Cuts::abseta < 2.5)}. There
are a range of physical quantities like \code{Cuts::pT}, \code{Cuts::eta},
\code{Cuts::absrap}, \code{Cuts::pid}, \code{Cuts::pid}, etc. which you will
find in the Doxygen documentation. All can be paired with a value using standard
equality and inequality operators, and each cut name--value pair can be combined
with another cut via standard boolean operators: they can be nested arbitrarily
deep, to make clear and readable cut definitions of any complexity.
All \code{Cut} quantities will work on any object that can convert itself to a
\code{FourMomentum}, e.g. particles and jets (see below). Some, such as the PID
quantities, will only work for selection of \code{Particle}s. Many functions in
Rivet for selecting or filtering particles or general four-momenta accept a
single (potentially composite) \code{Cut} object as an argument, and usually
also have a variant which will accept any function object that takes a
\code{Particle}/\code{FourMomentum} and returns a bool.
% and selector functions
\subsubsection{\code{Particle}}
This class is a wrapper around the HepMC \code{GenParticle}
class. \code{Particle} objects are usually obtained as a vector from the
\code{particles()} method of a \code{FinalState} projection. Rather than having
to directly use the HepMC objects, and e.g.~translate HepMC four-vectors into
the Rivet equivalent, several key properties are accessed directly via the
\code{Particle} interface (and more may be added).
The main methods of interest are \code{momentum()}, which returns a
\code{FourMomentum}, and \code{pdgId()}, which returns the PDG particle ID
code. The PDG code can be used to access particle properties by using functions
such as \code{PID::isHadron()}, \code{PID::threeCharge()}, etc. (these are
defined in \kbd{Rivet/Tools/ParticleIDMethods.hh}.) \code{Particle}s can be
implicitly cast to \code{FourMomentum}.
Particle ancestry and children can be accessed via the \code{parents()},
\code{children()}, \code{ancestors()} and \code{allDescendants()} methods. These
can all be filtered via \code{Cut}s and filter functions, and be restricted to
physical particles (i.e.~not with generator-specific HepMC IDs or statuses) if
desired. Properties of relatives can also be tested without explicitly
retrieving the particles, e.g.~via \code{hasAncestorWith()} and similar
functions, or \code{isLastWith()} and similar, which are useful for identifying
interesting points in decay chains: all these functions take functions or
function objects as arguments.
From Rivet version 2.6.0, \code{Particle} can have internal structure -- much
like a jet. The constituent list of \code{Particle}s is accessed with the
\code{constituents()} method, which is non-empty if
\code{Particle::isComposite()} is true. The \code{constituents()} method can be
\subsubsection{\code{Jet}}
Jets are obtained from one of the jet accessor methods of a projection that
implements the \code{JetAlg} interface, e.g. \code{FastJets::jetsByPt()} (this
returns the jets sorted by \pT, such that the first element in the vector is the
hardest jet --- usually what you want.) \code{Jet}s can be implicitly cast to
\code{FourMomentum}.
The most useful methods are \code{particles()}, \code{momentum()} (a
representative \code{FourMomentum}), and many checks on the jet contents, of
which the most useful are \code{bTagged()} and \code{bTags()} (there are
equivalent functions for charm and tau tagging). The tagging functions, like
many functions in Rivet, accept \code{Cut}s and filter function objects as
optional arguments, e.g.~\code{j.bTags(Cuts::pT > 5*GeV)} will return the subset
of ghost-associated tagging $b$-hadrons with $\pT > 5~\GeV$.
\subsubsection{Filter functions and filtering functors}
Rivet contains a suite of useful functions for filtering of lists of
\code{Particle}, \code{Jet}, and \code{FourMomentum} objects (aka
-\code{Particles}, \code{Jets}, and \code{FourMomenta}): \code{filter\_select} \&
-\code{filter\_discard}, and \code{ifilter\_*} equivalents.
+\code{Particles}, \code{Jets}, and \code{FourMomenta}): \code{filter\_select},
+\code{filter\_discard}, and their \code{ifilter\_*} equivalents.
The \code{filter\_*} functions operate on a const list, and return a new one
with a selection criterion applied; the ``select'' variant keeps objects for
which the criterion evaluates as true, while the ``discard'' ones keep those for
which it is false, e.g.~\code{Particles filtered = filter_select(unfiltered,
Cuts::absrap < 3)} will return the subset of particles with $|y| < 3$. The
\code{ifilter\_} versions operate in-place on a non-const list (hence avoiding
copying and being a bit more efficient, if you can tolerate having non-const
lists lying around).
These filtering functions accept either \code{Cut} objects or general function
objects to define the selection/rejection criterion. So you can also pass in
simple one-argument \code{Particle} $\to$ \code{bool} functions,
e.g.~\code{ifilter\_select(allparticles, isNeutral)} (see the
\kbd{Rivet/Tools/ParticleUtils.hh} header for more such functions). C++11 lambda
functions also work nicely, but are a bit syntactically ugly: in many cases you
will be able to more elegantly use stateful function objects like this:
\code{filter\_discard(jets, hasBTag(Cuts::pT > 5*GeV))} (see
\kbd{Rivet/Tools/JetUtils.hh}), or even an elegant approach to jet/lepton
isolation like this:
%
\begin{snippet}
Particles leptons = leptonfs.particles();
- for (const Jet\& j : jets())
+ for (const Jet& j : jets())
ifilter_discard(leptons, deltaRLess(j, 0.4));
\end{snippet}
(see \kbd{Rivet/Tools/ParticleBaseUtils.hh} for lots more kinematic function
objects which can be applied to all types that can be cast to
\code{FourMomentum}).
% \subsubsection{Smearing and efficiency functions}
% TODO
\subsubsection{Mathematical utilities}
The \kbd{Rivet/Math/MathUtils.hh} header defines a variety of mathematical
utility functions. These include functions such as \code{isZero(a)},
\code{fuzzyEquals(a, b)}, \code{inRange(a, low, high)} and \code{binIndex(val,
binedges)}, whose purposes are hopefully self-evident, and angular range-mapping
functions such as \code{mapAngle0To2Pi(a)}, \code{mapAngleMPiToPi(a)}, etc.
\subsection{Histogramming}
\label{section:histogramming}
Rivet's histogramming uses the YODA system, composed of ``analysis object''
classes \code{Histo1D}, \code{Profile1D}, \code{Scatter2D}, and less-used 2D
histograms and profiles, and 1D and 3D scatter plots. These can be created
directly in the analysis code, but to hook fully into the multiple-event-weight
and other machinery in Rivet it's normal to book them through \code{Analysis} class methods, to be called in the \code{init}
step of your analysis routine:
%
\begin{snippet}
void init() {
_h_one = bookHisto1D(2, 1, 1);
_h_two = bookProfile1D(3, 1, 2);
_h_three = bookHisto1D("d00-x00-y00", logscale(50, 1.0, 100.0));
}
\end{snippet}
%
Here the first two bookings have a rather cryptic 3-integer sequence as the
first arguments. This is the recommended scheme, which corresponds to the
HepData structure of 1D histograms as a combination of $x$ and $y$ axes in a
dataset $d$, giving names of the form \kbd{d\val{d}-x\val{x}-y\val{y}}. This
auto-booking of histograms saves you from having to copy out reams of bin edges
and values into your code, and makes sure that any data bug-fixes in HepData are
easily propagated to Rivet. The reference data files which are used for these
booking methods are distributed and installed with Rivet, you can find them in
the \kbd{\val{installdir}/share/Rivet} directory of your installation. The third
booking is for a histogram for which there is no such HepData entry: it uses the
usual scheme of specifying the name, number of bins and the min/max $x$-axis
limits manually.
Filling the histograms is done in the \code{MyAnalysis::analyse()}
function. Remember to specify the event weight as you fill:
%
\begin{snippet}
void analyze(const Event& e) {
[projections, cuts, etc.]
...
_h_one->fill(pT, event.weight());
_h_two->fill(pT, Nch, event.weight());
_h_three->fill(fabs(eta), event.weight());
}
\end{snippet}
Finally, histogram normalisations, scalings, divisions etc. are done in the
\code{MyAnalysis::\-finalize()} method. For normalisations and scalings you will
find appropriate convenience methods \code{Analysis::normalize(histo, norm)} and
\code{Analysis::scale(histo, scalefactor)}. Many analyses need to be scaled to
the generator cross-section, with the number of event weights to pass cuts being
included in the normalisation factor: for this you will have to track the
passed-cuts weight sum yourself via a member variable, but the analysis class
provides \code{Analysis::crossSection()} and \code{Analysis::sumOfWeights()}
methods to access the pre-cuts cross-section and weight sum respectively.
\subsection{Analysis metadata}
To keep the analysis source code uncluttered, and to allow for iteration of data
plot presentation without re-compilation and/or re-running, Rivet prefers that
analysis metadata is provided via separate files rather than hard-coded into the
analysis library. There are two such files: an \emph{analysis info} file, with
the suffix \kbd{.info}, and a \emph{plot styling} file, with the suffix
\kbd{.plot}.
\subsubsection{Analysis info files}
The analysis info files are in YAML format: a simple data format intended to be
cleaner and more human-readable/writeable than XML. As well as the analysis name
(which must coincide with the filename and the name provided to the
\kbd{Analysis} constructor, this file stores details of the collider,
experiment, date of the analysis, Rivet/data analysis authors and contact email
addresses, one-line and more complete descriptions of the analysis, advice on
how to run it, suggested generator-level cuts, and BibTeX keys and entries for
this user manual. It is also where the validation status of the analysis is declared:
See the standard analyses' info files for guidance on how to populate this
file. Info files are searched for in the paths known to the
\kbd{Rivet::getAnalysisInfoPaths()} function, which many be prepended to using
the \var{RIVET_INFO_PATH} environment variable: the first matching file to be
found will be used.
\subsubsection{Plot styling files}
The \kbd{.plot} files are in the header format for the \kbd{make-plots} plotting
system and are picked up and merged with the plot data by the Rivet
\kbd{compare-histos} script which produces the \kbd{make-plots} input data
files. All the analysis' plots should have a \kbd{BEGIN PLOT ... END PLOT}
section in this file, specifying the title and $x$/$y$-axis labels (the
\kbd{Title}, and \kbd{XLabel}/\kbd{YLabel} directives). In addition, you can use
this file to choose whether the $x$ and/or $y$ axes should be shown with a log
scale (\kbd{LogX}, \kbd{LogY}), to position the legend box to minimise clashes
with the data points and MC lines (\kbd{LegendXPos}, \kbd{LegendYPos}) and any
other valid \kbd{make-plots} directives including special text labels or forced
plot range boundaries. Regular expressions may be used to apply a directive to
all analysis names matching a pattern rather than having to specify the same
directive repeatedly for many plots.
See the standard analyses' plot files and the \kbd{make-plots} documentation
(e.g. on the Rivet website) for guidance on how to write these files. Plot info
files are searched for in the paths known to the
\kbd{Rivet::getAnalysisPlotPaths()} function, which many be prepended to using
the \var{RIVET_PLOT_PATH} environment variable. As usual, the first matching
file to be found will be used.
\subsection{Pluggable analyses}
Rivet's standard analyses are not actually built into the main \kbd{libRivet}
library: they are loaded dynamically at runtime as an analysis \emph{plugin
library}. While you don't need to worry too much about the technicalities of
this, it does mean that you can similarly write analyses of your own, compile
them into a similar plugin library and run them from \kbd{rivet} without ever
having to modify any of the main Rivet sources or build system. This means that
you can write and run your own analyses with a system-installed copy of Rivet,
and not have to re-patch the main library when a newer version comes out
(although chances are you will have to recompile, since the binary interface usually
change between releases.)
To get started writing your analysis and understand the plugin system better,
you should check out the documentation in the wiki on the Rivet website:
\url{http://rivet.hepforge.org/trac/wiki/}. The standard
\kbd{rivet-mkanalysis} and \kbd{rivet-buildplugin} scripts can respectively be
used to make an analysis template with many ``boilerplate'' details filled in
(including bibliographic information from Inspire if available), and to build a
plugin library with the appropriate compiler options.
\subsubsection{Plugin paths}
To load pluggable analyses you will need to set the \var{RIVET_ANALYSIS_PATH}
environment variable: this is a standard colon-separated UNIX path, specifying
directories in which analysis plugin libraries may be found. If it is
unspecified, the Rivet loader system will assume that the only entry is the
\kbd{lib} directory in the Rivet installation area. Specifying the variable adds
new paths for searching \emph{before} the standard library area, and they will
be searched in the left-to-right order in the path variable.
If analyses with duplicate names are found, a warning message is issued and the
first version to have been found will be used. This allows you to override
standard analyses with same-named variants of your own, provided they are loaded
from different directories.
\begin{change}
In Rivet 2.1.0 and later, this \var{RIVET_ANALYSIS_PATH} variable (and the
others described below) have an special extra syntax feature: if the
environment variable ends with a double separator, i.e. \kbd{::}, then the
default path will not be appended at all. This can be useful if you want to
make absolutely certain not to fall back to the default locations, for example
to avoid the ``duplicate analysis'' warnings if you are getting a lot of them.
\end{change}
Several further environment variables are used to load analysis reference data
and metadata files:
\begin{description}
\item[\var{RIVET_REF_PATH}:] A standard colon-separated path list, whose
elements are searched in order for reference histogram files. If the required
file is not found in this path, Rivet will fall back to looking in the
analysis library paths (for convenience, as it is normal for plugin analysis
developers to put analysis library and data files in the same directory and it
would be annoying to have to set several variables to make this work), and
then the standard Rivet installation data directory.
\item[\var{RIVET_INFO_PATH}:] The path list searched first for analysis
\kbd{.info} metadata files. The search fallback mechanism works as for
\var{RIVET_REF_PATH}.
\item[\var{RIVET_PLOT_PATH}:] The path list searched first for analysis
\kbd{.plot} presentation style files. The search fallbacks again work as for
\var{RIVET_REF_PATH}.
\end{description}
%
These paths can be accessed from the API using the
\kbd{Rivet::getAnalysisLibPaths()} etc. functions, and can be searched for files
using the Rivet lookup rules via the
\kbd{Rivet::find\-Analysis\-LibFile(filename)} etc. functions. See the Doxygen
documentation for more details. In the lookups using these paths, if the
variable ends with a double separator, i.e. \kbd{::}, then the default path will
not be appended: this may be useful in some situations. These functions are also
available in the Python \kbd{rivet} module, with the same behaviours.
\section{Using Rivet as a library}
You don't have to use Rivet via the provided command-line programmes: for some
applications you may want to have more direct control of how Rivet processes
events. Here are some possible reasons:
%
\begin{itemize}
\item You need to not waste CPU cycles and I/O resources on rendering HepMC
events to a string representation which is immediately read back in. The FIFO
idiom (Section~\ref{sec:fifo-idiom}) is not perfect: we use it in circumstances
where the convenience and decoupling outweighs the CPU cost.
\item You don't want to write out histograms to file, preferring to use them as
code objects. Perhaps for applications which want to manipulate histogram data
periodically before the end of the run.
\item You enjoy tormenting Rivet developers who know their API is far from
perfect, by complaining if it changes!
\item \dots and many more!
\end{itemize}
The Rivet API (application programming interface) has been designed in the hope
of very simple integration into other applications: all you have to do is create
a \code{Rivet::Analysis\-Handler} object, tell it which analyses to apply on the
events, and then call its \code{analyse(evt)} method for each HepMC event --
wherever they come from. The API is (we hope) stable, with the exception of the
histogramming parts.
\begin{warning}
The histogramming interfaces in Rivet have long been advertised as marked for
replacement, and while progress in that area has lagger far behind our
ambitions, it \emph{will} happen with the 2.0.0 release, with unavoidable
impact on the related parts of the API. You have been warned!
\end{warning}
The API is available for C++ and, in a more restricted form, Python. We will
explain the C++ version here; if you wish to operate Rivet (or e.g. use its
path-searching capabilities to find Rivet-related files in the standard way)
from Python then take a look inside the \kbd{rivet} and \kbd{rivet-*} Python
scripts (e.g. \kbd{less `which rivet`}) or use the module documentation cf.
%
\begin{snippet}
> python
>>> import rivet
>>> help(rivet)
\end{snippet}
And now the C++ API. The best way to explain is, of course, by example. Here is
a simple C++ example based on the \kbd{test/testApi.cc} source which we use in
development to ensure continuing API functionality:
%
\begin{snippet}
#include "Rivet/AnalysisHandler.hh"
#include "HepMC/GenEvent.h"
#include "HepMC/IO_GenEvent.h"
using namespace std;
int main() {
// Create analysis handler
Rivet::AnalysisHandler rivet;
// Specify the analyses to be used
rivet.addAnalysis("D0_2008_S7554427");
vector<string> moreanalyses(1, "D0_2007_S7075677");
rivet.addAnalyses(moreanalyses);
// The usual mess of reading from a HepMC file!
std::istream* file = new std::fstream("testApi.hepmc", std::ios::in);
HepMC::IO_GenEvent hepmcio(*file);
HepMC::GenEvent* evt = hepmcio.read_next_event();
double sum_of_weights = 0.0;
while (evt) {
// Analyse the current event
rivet.analyze(*evt);
sum_of_weights += evt->weights()[0];
// Clean up and get next event
delete evt; evt = 0;
hepmcio >> evt;
}
delete file; file = 0;
rivet.setCrossSection(1.0);
rivet.setSumOfWeights(sum_of_weights); // not necessary, but allowed
rivet.finalize();
rivet.writeData("out");
return 0;
}
\end{snippet}
Compilation of this, if placed in a file called \kbd{myrivet.cc}, into an
executable called \kbd{myrivet} is simplest and most robust with use of the
\kbd{rivet-config} script:
%
\begin{snippet}
g++ myrivet.cc -o myrivet `rivet-config --cppflags --ldflags --libs`
\end{snippet}
%
It \emph{should} just work!
If you are doing something a bit more advanced, for example using the AGILe
package's similar API to generate Fortran generator Pythia events and pass them
directly to the Rivet analysis handler, you will need to also add the various
compiler and linker flags for the extra libraries, e.g.
%
\begin{snippet}
g++ myrivet.cc -o myrivet \
`rivet-config --cppflags --ldflags --libs` \
`agile-config --cppflags --ldflags --libs`
\end{snippet}
%
would be needed to compile the following AGILe+Rivet code:
%
\goodbreak
\begin{snippet}
#include "AGILe/Loader.hh"
#include "AGILe/Generator.hh"
#include "Rivet/AnalysisHandler.hh"
#include "HepMC/GenEvent.h"
#include "HepMC/IO_GenEvent.h"
using namespace std;
int main() {
// Have a look what generators are available
AGILe::Loader::initialize();
const vector<string> gens = AGILe::Loader::getAvailableGens();
foreach (const string& gen, gens) {
cout << gen << endl;
}
// Load libraries for a specific generator and instantiate it
AGILe::Loader::loadGenLibs("Pythia6:425");
AGILe::Generator* generator = AGILe::Loader::createGen();
cout << "Running " << generator->getName()
<< " version " << generator->getVersion() << endl;
// Set generator initial state for LEP
const int particle1 = AGILe::ELECTRON;
const int particle2 = AGILe::POSITRON;
const double sqrts = 91;
generator->setInitialState(particle1, energy1, sqrts/2.0, sqrts/2.0);
generator->setSeed(14283);
// Set some parameters
generator->setParam("MSTP(5)", "320"); //< PYTHIA tune
// ...
// Set up Rivet with a LEP analysis
Rivet::AnalysisHandler rivet;
rivet.addAnalysis("DELPHI_1996_S3430090");
// Run events
const int EVTMAX = 10000;
HepMC::GenEvent evt;
for (int i = 0; i < EVTMAX; ++i) {
generator->makeEvent(evt);
rivet.analyze(evt);
}
// Finalize Rivet and generator
rivet.finalize();
rivet.writeData("out.yoda");
generator->finalize();
return 0;
}
\end{snippet}
% \cleardoublepage
% \part{How Rivet \emph{really} works}
% \label{part:internals}
%
% In time this will be the place to look for all the nitty gritty on what Rivet is
% doing internally. Not very many people need to know that, and the few that do
% currently don't need a manual for it!
%
% \section{Projection caching}
% \TODO{TODO}
%
% \subsection{Writing a Projection comparison operator}
% \TODO{TODO}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 3:58 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805063
Default Alt Text
(412 KB)

Event Timeline