rivet is hosted by Hepforge, IPPP Durham
Rivet Namespace Reference

Namespaces

namespace  Cuts
 

Namespace used for ambiguous identifiers.


namespace  Kin
namespace  Nsubjettiness
namespace  PID

Classes

class  MC_JetAnalysis
 Base class providing common functionality for MC jet validation analyses. More...
class  MC_JetSplittings
 Base class providing common functionality for MC jet validation analyses. More...
class  MC_ParticleAnalysis
 Base class providing common functionality for MC particle species validation analyses. More...
class  Analysis
 This is the base class of all analysis classes in Rivet. More...
struct  CmpAnaHandle
class  AnalysisHandler
class  AnalysisInfo
class  AnalysisLoader
 Internal class which loads and registers analyses from plugin libs. More...
class  Event
class  Jet
 Representation of a clustered jet of particles. More...
class  LorentzTransform
 Object implementing Lorentz transform calculations and boosts. More...
class  Matrix3
 Specialisation of MatrixN to aid 3 dimensional rotations. More...
class  EigenSystem
 Handy object containing results of a diagonalization. More...
struct  EigenPairCmp
 Comparison functor for "eigen-pairs". More...
class  Matrix
 General $ N $-dimensional mathematical matrix object. More...
class  Vector3
 Three-dimensional specialisation of Vector. More...
class  FourVector
 Specialisation of VectorN to a general (non-momentum) Lorentz 4-vector. More...
class  FourMomentum
 Specialized version of the FourVector with momentum/energy functionality. More...
class  Vector
 A minimal base class for $ N $-dimensional vectors. More...
class  Particle
 Particle representation, either from a HepMC::GenEvent or reconstructed. More...
class  ParticleBase
 Base class for particle-like things like Particle and Jet. More...
class  Projection
 Base class for all Rivet projections. More...
class  ProjectionApplier
 Common base class for Projection and Analysis, used for internal polymorphism. More...
class  ProjectionHandler
 The projection handler is a central repository for projections to be used in a Rivet analysis run. More...
class  AxesDefinition
 Base class for projections which define a spatial basis. More...
class  Beam
 Project out the incoming beams. More...
class  BeamThrust
class  CentralEtHCM
 Summed $ E_\perp $ of central particles in HCM system. More...
class  ChargedFinalState
 Project only charged final state particles. More...
class  ChargedLeptons
 Get charged final-state leptons. More...
class  ConstRandomFilter
 Functor used to implement constant random lossiness. More...
class  ConstLossyFinalState
 Randomly lose a constant fraction of particles. More...
class  DISFinalState
 Final state particles boosted to the hadronic center of mass system. More...
class  DISKinematics
 Get the DIS kinematic variables and relevant boosts for an event. More...
class  DISLepton
 Get the incoming and outgoing leptons in a DIS event. More...
class  DressedLepton
class  DressedLeptons
 Cluster photons from a given FS to all charged particles (typically leptons) More...
class  FastJets
 Project out jets found using the FastJet package jet algorithms. More...
class  FinalPartons
class  FinalState
 Project out all final-state particles in an event. Probably the most important projection in Rivet! More...
class  FoxWolframMoments
 Calculate Fox-Wolfram moments. More...
class  FParameter
class  HadronicFinalState
 Project only hadronic final state particles. More...
class  HeavyHadrons
 Project out the last pre-decay b and c hadrons. More...
class  Hemispheres
 Calculate the hemisphere masses and broadenings. More...
class  IdentifiedFinalState
 Produce a final state which only contains specified particle IDs. More...
class  InitialQuarks
 Project out quarks from the hard process in $ e^+ e^- \to Z^0 $ events. More...
class  InvMassFinalState
 Identify particles which can be paired to fit within a given invariant mass window. More...
class  JetAlg
 Abstract base class for projections which can return a set of Jets. More...
class  JetShape
class  LeadingParticlesFinalState
 Get the highest-pT occurrences of FS particles with the specified PDG IDs. More...
class  LossyFinalState
 Templated FS projection which can lose some of the supplied particles. More...
class  MergedFinalState
 Get final state particles merged from two FinalState projections. More...
class  MissingMomentum
 Calculate missing $ E $, $ E_\perp $ etc. More...
class  NeutralFinalState
 Project only neutral final state particles. More...
class  NonHadronicFinalState
 Project only hadronic final state particles. More...
class  NonPromptFinalState
 Find final state particles NOT directly connected to the hard process. More...
class  ParisiTensor
 Calculate the Parisi event shape tensor (or linear momentum tensor). More...
class  ParticleFinder
 Base class for projections which return subsets of an event's particles. More...
class  PartonicTops
 Convenience finder of partonic top quarks. More...
class  PrimaryHadrons
 Project out the first hadrons from hadronisation. More...
class  PromptFinalState
 Find final state particles directly connected to the hard process. More...
class  SmearedJets
 Wrapper projection for smearing Jets with detector resolutions and efficiencies. More...
class  SmearedMET
 Wrapper projection for smearing missing (transverse) energy/momentum with detector resolutions. More...
class  SmearedParticles
 Wrapper projection for smearing Jets with detector resolutions and efficiencies. More...
class  Sphericity
 Calculate the sphericity event shape. More...
class  Spherocity
 Get the transverse spherocity scalars for hadron-colliders. More...
class  TauFinder
 Convenience finder of unstable taus. More...
class  Thrust
 Get the e+ e- thrust basis and the thrust, thrust major and thrust minor scalars. More...
class  TriggerCDFRun0Run1
 Access to the min bias triggers used by CDF in Run 0 and Run 1. More...
class  TriggerCDFRun2
 Access to the min bias triggers used by CDF in Run 0 and Run 1. More...
class  TriggerUA5
 Access to the min bias triggers used by UA5. More...
class  UnstableParticles
 Project out all physical-but-decayed particles in an event. More...
class  VetoedFinalState
 FS modifier to exclude classes of particles from the final state. More...
class  VisibleFinalState
 Final state modifier excluding particles which are not experimentally visible. More...
class  WFinder
 Convenience finder of leptonically decaying W. More...
class  ZFinder
 Convenience finder of leptonically decaying Zs. More...
class  Run
 Interface to handle a run of events read from a HepMC stream or file. More...
class  BinnedHistogram
class  CentralityEstimator
 Base class for projections giving the value of an observable sensitive to the centrality of a collision. More...
struct  CentralityBinTraits
struct  MergeDistance
class  CentralityBinner
struct  CentralityBinTraits< Profile1DPtr >
 Traits specialization for Profile histograms. More...
struct  CentralityBinTraits< Profile2DPtr >
 Traits specialization for Profile histograms. More...
struct  CentralityBinTraits< vector< T > >
struct  TupleCentralityBinTraitsHelper
struct  TupleCentralityBinTraitsHelper< 0, Types...>
struct  CentralityBinTraits< tuple< Types...> >
class  GeneratedCentrality
class  Cmp
class  Cmp< Projection >
 Specialization of Cmp for checking the ordering of two {Projection}s. More...
class  Cmp< double >
 Specialization of Cmp for checking the ordering of two floating point numbers. More...
struct  Cutflow
 A tracker of numbers & fractions of events passing sequential cuts. More...
struct  Cutflows
 A container for several Cutflow objects, with some convenient batch access. More...
class  CutBase
struct  Error
 Generic runtime Rivet error. More...
struct  RangeError
 Error for e.g. use of invalid bin ranges. More...
struct  LogicError
 Error specialisation for places where alg logic has failed. More...
struct  PidError
 Error specialisation for failures relating to particle ID codes. More...
struct  InfoError
 Error specialisation for failures relating to analysis info. More...
struct  WeightError
 Errors relating to event/bin weights. More...
struct  UserError
 Error specialisation for where the problem is between the chair and the computer. More...
struct  JET_EFF_CONST
 Take a Jet and return a constant efficiency. More...
struct  JET_BTAG_EFFS
 b-tagging efficiency functor, for more readable b-tag effs and mistag rates Note several constructors, allowing for optional specification of charm, tau, and light jet mistag rates More...
struct  JetEffSmearFn
 Functor for simultaneous efficiency-filtering and smearing of Jets. More...
struct  JetEffFilter
 A functor to return true if Jet j survives a random efficiency selection. More...
struct  BoolJetFunctor
 Base type for Jet -> bool functors. More...
struct  BoolJetAND
 Functor for and-combination of selector logic. More...
struct  BoolJetOR
 Functor for or-combination of selector logic. More...
struct  BoolJetNOT
 Functor for inverting selector logic. More...
struct  HasBTag
 B-tagging functor, with a tag selection cut as the stored state. More...
struct  HasCTag
 C-tagging functor, with a tag selection cut as the stored state. More...
class  Log
struct  P4_EFF_CONST
 Take a FourMomentum and return a constant number. More...
struct  P3_EFF_CONST
 Take a Vector3 and return a constant number. More...
struct  BoolParticleBaseFunctor
 Base type for Particle -> bool functors. More...
struct  PtGtr
 Transverse momentum greater-than functor. More...
struct  PtLess
 Transverse momentum less-than functor. More...
struct  PtInRange
 Transverse momentum in-range functor. More...
struct  EtaGtr
 Pseudorapidity greater-than functor. More...
struct  EtaLess
 Pseudorapidity less-than functor. More...
struct  EtaInRange
 Pseudorapidity in-range functor. More...
struct  AbsEtaGtr
 Abs pseudorapidity greater-than functor. More...
struct  AbsEtaLess
 Abs pseudorapidity momentum less-than functor. More...
struct  AbsEtaInRange
 Abs pseudorapidity in-range functor. More...
struct  RapGtr
 Rapidity greater-than functor. More...
struct  RapLess
 Rapidity momentum less-than functor. More...
struct  RapInRange
 Rapidity in-range functor. More...
struct  AbsRapGtr
 Abs rapidity greater-than functor. More...
struct  AbsRapLess
 Abs rapidity momentum less-than functor. More...
struct  AbsRapInRange
 Abs rapidity in-range functor. More...
struct  DeltaRGtr
 $ \Delta R $ (with respect to another 4-momentum, vec) greater-than functor More...
struct  DeltaRLess
 $ \Delta R $ (with respect to another 4-momentum, vec) less-than functor More...
struct  DeltaRInRange
 $ \Delta R $ (with respect to another 4-momentum, vec) in-range functor More...
struct  DeltaPhiGtr
 $ |\Delta \phi| $ (with respect to another momentum, vec) greater-than functor More...
struct  DeltaPhiLess
 $ |\Delta \phi| $ (with respect to another momentum, vec) less-than functor More...
struct  DeltaPhiInRange
 $ \Delta \phi $ (with respect to another 4-momentum, vec) in-range functor More...
struct  DeltaEtaGtr
 $ |\Delta \eta| $ (with respect to another momentum, vec) greater-than functor More...
struct  DeltaEtaLess
 $ |\Delta \eta| $ (with respect to another momentum, vec) less-than functor More...
struct  DeltaEtaInRange
 $ \Delta \eta $ (with respect to another 4-momentum, vec) in-range functor More...
struct  DeltaRapGtr
 $ |\Delta y| $ (with respect to another momentum, vec) greater-than functor More...
struct  DeltaRapLess
 $ |\Delta y| $ (with respect to another momentum, vec) less-than functor More...
struct  DeltaRapInRange
 $ \Delta y $ (with respect to another 4-momentum, vec) in-range functor More...
struct  DoubleParticleBaseFunctor
 Base type for Particle -> double functors. More...
struct  DeltaRWRT
 Calculator of $ \Delta R $ with respect to a given momentum. More...
struct  DeltaPhiWRT
 Calculator of $ \Delta \phi $ with respect to a given momentum. More...
struct  DeltaEtaWRT
 Calculator of $ \Delta \eta $ with respect to a given momentum. More...
struct  AbsDeltaEtaWRT
 Calculator of $ |\Delta \eta| $ with respect to a given momentum. More...
struct  DeltaRapWRT
 Calculator of $ \Delta y $ with respect to a given momentum. More...
struct  AbsDeltaRapWRT
 Calculator of $ |\Delta y| $ with respect to a given momentum. More...
struct  PARTICLE_EFF_CONST
 Take a Particle and return a constant number. More...
struct  ParticleEffSmearFn
 Functor for simultaneous efficiency-filtering and smearing of Particles. More...
struct  ParticleEffFilter
struct  BoolParticleFunctor
 Base type for Particle -> bool functors. More...
struct  BoolParticleAND
 Functor for and-combination of selector logic. More...
struct  BoolParticleOR
 Functor for or-combination of selector logic. More...
struct  BoolParticleNOT
 Functor for inverting selector logic. More...
struct  HasPID
 PID matching functor. More...
struct  HasAbsPID
 |PID| matching functor More...
struct  FirstParticleWith
 Determine whether a particle is the first in a decay chain to meet the cut/function. More...
struct  FirstParticleWithout
 Determine whether a particle is the first in a decay chain not to meet the cut/function. More...
struct  LastParticleWith
 Determine whether a particle is the last in a decay chain to meet the cut/function. More...
struct  LastParticleWithout
 Determine whether a particle is the last in a decay chain not to meet the cut/function. More...
struct  HasParticleAncestorWith
 Determine whether a particle has an ancestor which meets the cut/function. More...
struct  HasParticleAncestorWithout
 Determine whether a particle has an ancestor which doesn't meet the cut/function. More...
struct  HasParticleParentWith
 Determine whether a particle has an parent which meets the cut/function. More...
struct  HasParticleParentWithout
 Determine whether a particle has an parent which doesn't meet the cut/function. More...
struct  HasParticleChildWith
 Determine whether a particle has a child which meets the cut/function. More...
struct  HasParticleChildWithout
 Determine whether a particle has a child which doesn't meet the cut/function. More...
struct  HasParticleDescendantWith
 Determine whether a particle has a descendant which meets the cut/function. More...
struct  HasParticleDescendantWithout
 Determine whether a particle has a descendant which doesn't meet the cut/function. More...
struct  GenVertexIterRangeC
struct  bad_lexical_cast

Typedefs

typedef std::shared_ptr< AnalysisAnaHandle
typedef Matrix< 4 > Matrix4
typedef Vector3 ThreeVector
typedef FourVector Vector4
typedef ProjectionProjectionPtr
typedef const ProjectionConstProjectionPtr
typedef std::shared_ptr< const
Projection
ProjHandle
 Typedef for Projection (smart) pointer.
typedef Cmp< ProjectionPCmp
 Typedef for Cmp<Projection>
typedef std::shared_ptr< CutBaseCut
 Main cut object.
typedef Error Exception
 Rivet::Exception is a synonym for Rivet::Error.
typedef std::vector< PseudoJet > PseudoJets
typedef std::shared_ptr
< YODA::AnalysisObject > 
AnalysisObjectPtr
typedef std::shared_ptr
< YODA::Counter > 
CounterPtr
typedef std::shared_ptr
< YODA::Histo1D > 
Histo1DPtr
typedef std::shared_ptr
< YODA::Histo2D > 
Histo2DPtr
typedef std::shared_ptr
< YODA::Profile1D > 
Profile1DPtr
typedef std::shared_ptr
< YODA::Profile2D > 
Profile2DPtr
typedef std::shared_ptr
< YODA::Scatter1D > 
Scatter1DPtr
typedef std::shared_ptr
< YODA::Scatter2D > 
Scatter2DPtr
typedef std::shared_ptr
< YODA::Scatter3D > 
Scatter3DPtr
Jet declarations
typedef std::vector< JetJets
Typedefs of vector types to short names
Todo:
Switch canonical and alias names
typedef Vector3 X3
typedef FourVector X4
typedef FourMomentum P4
Typedefs for lists of vector types
typedef std::vector< FourVectorFourVectors
typedef std::vector< FourMomentumFourMomenta
typedef std::vector< X4X4s
typedef std::vector< P4P4a
Particle declarations
typedef std::vector< ParticleParticles
typedef Particles ParticleVector
typedef std::pair< Particle,
Particle
ParticlePair
 Typedef for a pair of Particle objects.
PdgId declarations
typedef int PdgId
 Typedefs for a PDG ID code.
typedef std::pair< PdgId, PdgIdPdgIdPair
 Typedef for a pair of particle names.
Typedef for Jet smearing functions/functors
typedef function< Jet(const Jet &)> JetSmearFn
Typedef for FourMomentum smearing functions/functors
typedef std::function
< FourMomentum(const
FourMomentum &)> 
P4SmearFn
Typedef for Particle smearing functions/functors
typedef function< Particle(const
Particle &)> 
ParticleSmearFn

Enumerations

enum  Sign { MINUS = -1, ZERO = 0, PLUS = 1 }
 Enum for signs of numbers. More...
enum  RapScheme { PSEUDORAPIDITY = 0, ETARAP = 0, RAPIDITY = 1, YRAP = 1 }
 Enum for rapidity variable to be used in calculating $ R $, applying rapidity cuts, etc. More...
enum  PhiMapping { MINUSPI_PLUSPI, ZERO_2PI, ZERO_PI }
 Enum for range of $ \phi $ to be mapped into. More...
enum  CmpState {
  UNDEFINED = -2, ASC = -1, ORDERED = -1, EQUAL = 0,
  EQUIVALENT = 0, DESC = 1, ANTIORDERED = 1, UNORDERED = 1,
  UNEQUAL = 2, INEQUIVALENT = 2
}
 Enumerate the possible states of a Cmp object. More...

Functions

std::string toString (const AnalysisInfo &ai)
 String representation.
std::ostream & operator<< (std::ostream &os, const AnalysisInfo &ai)
 Stream an AnalysisInfo as a text description.
LorentzTransform inverse (const LorentzTransform &lt)
LorentzTransform combine (const LorentzTransform &a, const LorentzTransform &b)
FourVector transform (const LorentzTransform &lt, const FourVector &v4)
string toString (const LorentzTransform &lt)
ostream & operator<< (std::ostream &out, const LorentzTransform &lt)
double mT (double pT1, double pT2, double dphi)
template<size_t N>
EigenSystem< N > diagonalize (const Matrix< N > &m)
template<size_t N>
const string toString (const typename EigenSystem< N >::EigenPair &e)
template<size_t N>
ostream & operator<< (std::ostream &out, const typename EigenSystem< N >::EigenPair &e)
template<size_t N>
Matrix< N > multiply (const Matrix< N > &a, const Matrix< N > &b)
template<size_t N>
Matrix< N > divide (const Matrix< N > &, const double)
template<size_t N>
Matrix< N > operator* (const Matrix< N > &a, const Matrix< N > &b)
template<size_t N>
Matrix< N > add (const Matrix< N > &a, const Matrix< N > &b)
template<size_t N>
Matrix< N > subtract (const Matrix< N > &a, const Matrix< N > &b)
template<size_t N>
Matrix< N > operator+ (const Matrix< N > a, const Matrix< N > &b)
template<size_t N>
Matrix< N > operator- (const Matrix< N > a, const Matrix< N > &b)
template<size_t N>
Matrix< N > multiply (const double a, const Matrix< N > &m)
template<size_t N>
Matrix< N > multiply (const Matrix< N > &m, const double a)
template<size_t N>
Matrix< N > operator* (const double a, const Matrix< N > &m)
template<size_t N>
Matrix< N > operator* (const Matrix< N > &m, const double a)
template<size_t N>
Vector< N > multiply (const Matrix< N > &a, const Vector< N > &b)
template<size_t N>
Vector< N > operator* (const Matrix< N > &a, const Vector< N > &b)
template<size_t N>
Matrix< N > transpose (const Matrix< N > &m)
template<size_t N>
Matrix< N > inverse (const Matrix< N > &m)
template<size_t N>
double det (const Matrix< N > &m)
template<size_t N>
double trace (const Matrix< N > &m)
template<size_t N>
string toString (const Matrix< N > &m)
 Make string representation.
template<size_t N>
ostream & operator<< (std::ostream &out, const Matrix< N > &m)
 Stream out string representation.
template<size_t N>
bool fuzzyEquals (const Matrix< N > &ma, const Matrix< N > &mb, double tolerance=1E-5)
 Compare two matrices by index, allowing for numerical precision.
template<size_t N>
bool isZero (const Matrix< N > &m, double tolerance=1E-5)
 External form of numerically safe nullness check.
Vector3 multiply (const double, const Vector3 &)
Vector3 multiply (const Vector3 &, const double)
Vector3 add (const Vector3 &, const Vector3 &)
Vector3 operator* (const double, const Vector3 &)
Vector3 operator* (const Vector3 &, const double)
Vector3 operator/ (const Vector3 &, const double)
Vector3 operator+ (const Vector3 &, const Vector3 &)
Vector3 operator- (const Vector3 &, const Vector3 &)
double dot (const Vector3 &a, const Vector3 &b)
Vector3 cross (const Vector3 &a, const Vector3 &b)
Vector3 subtract (const Vector3 &a, const Vector3 &b)
double angle (const Vector3 &a, const Vector3 &b)
 Angle (in radians) between two 3-vectors.
double contract (const FourVector &a, const FourVector &b)
 Contract two 4-vectors, with metric signature (+ - - -).
double dot (const FourVector &a, const FourVector &b)
 Contract two 4-vectors, with metric signature (+ - - -).
FourVector multiply (const double a, const FourVector &v)
FourVector multiply (const FourVector &v, const double a)
FourVector operator* (const double a, const FourVector &v)
FourVector operator* (const FourVector &v, const double a)
FourVector operator/ (const FourVector &v, const double a)
FourVector add (const FourVector &a, const FourVector &b)
FourVector operator+ (const FourVector &a, const FourVector &b)
FourVector operator- (const FourVector &a, const FourVector &b)
double invariant (const FourVector &lv)
double angle (const FourVector &a, const FourVector &b)
 Angle (in radians) between spatial parts of two Lorentz vectors.
double angle (const Vector3 &a, const FourVector &b)
 Angle (in radians) between spatial parts of two Lorentz vectors.
double angle (const FourVector &a, const Vector3 &b)
 Angle (in radians) between spatial parts of two Lorentz vectors.
FourMomentum multiply (const double a, const FourMomentum &v)
FourMomentum multiply (const FourMomentum &v, const double a)
FourMomentum operator* (const double a, const FourMomentum &v)
FourMomentum operator* (const FourMomentum &v, const double a)
FourMomentum operator/ (const FourMomentum &v, const double a)
FourMomentum add (const FourMomentum &a, const FourMomentum &b)
FourMomentum operator+ (const FourMomentum &a, const FourMomentum &b)
FourMomentum operator- (const FourMomentum &a, const FourMomentum &b)
template<size_t N>
bool fuzzyEquals (const Vector< N > &va, const Vector< N > &vb, double tolerance=1E-5)
 Compare two vectors by index, allowing for numerical precision.
template<size_t N>
bool isZero (const Vector< N > &v, double tolerance=1E-5)
 External form of numerically safe nullness check.
template<typename PROJ >
const PROJ & pcast (const Projection &p)
 Convenience method for casting to a const Projection reference.
template<typename PROJ >
const PROJ * pcast (const Projection *p)
 Convenience method for casting to a const Projection pointer.
std::string version ()
 A function to get the Rivet version string.
bool compatible (PdgId p, PdgId allowed)
bool compatible (const PdgIdPair &pair, const PdgIdPair &allowedpair)
bool compatible (const ParticlePair &ppair, const PdgIdPair &allowedpair)
 Check particle compatibility of Particle pairs.
bool compatible (const PdgIdPair &allowedpair, const ParticlePair &ppair)
 Check particle compatibility of Particle pairs (for symmetric completeness)
bool compatible (const PdgIdPair &pair, const set< PdgIdPair > &allowedpairs)
set< PdgIdPairintersection (const set< PdgIdPair > &a, const set< PdgIdPair > &b)
 Return the intersection of two sets of {PdgIdPair}s.
template<typename T >
Cmp< T > cmp (const T &t1, const T &t2)
 Global helper function for easy creation of Cmp objects.
Cmp< Projectionpcmp (const Projection &p1, const Projection &p2)
 Global helper function for easy creation of Cmp<Projection> objects.
Cmp< Projectionpcmp (const Projection &parent1, const Projection &parent2, const string &pname)
Cmp< Projectionpcmp (const Projection *parent1, const Projection &parent2, const string &pname)
Cmp< Projectionpcmp (const Projection &parent1, const Projection *parent2, const string &pname)
Cmp< Projectionpcmp (const Projection *parent1, const Projection *parent2, const string &pname)
ostream & operator<< (ostream &os, const Cutflow &cf)
 Print a Cutflow to a stream.
ostream & operator<< (ostream &os, const Cutflows &cfs)
 Print a Cutflows to a stream.
bool operator== (const Cut &a, const Cut &b)
 Compare two cuts for equality, forwards to the cut-specific implementation.
std::ostream & operator<< (std::ostream &os, const Cut &cptr)
 String representation.
std::ostream & operator<< (Log &log, int level)
 Streaming output to a logger must have a Log::Level/int as its first argument.
mt19937 & rng ()
 Return a thread-safe random number generator (mainly for internal use)
double rand01 ()
 Return a uniformly sampled random number between 0 and 1.
double randnorm (double loc, double scale)
 Return a Gaussian/normal sampled random number with the given mean and width.
double randlognorm (double loc, double scale)
 Return a log-normal sampled random number.
Vector3 momentum3 (const fastjet::PseudoJet &pj)
 Make a 3-momentum vector from a FastJet pseudojet.
FourMomentum momentum (const fastjet::PseudoJet &pj)
 Make a 4-momentum vector from a FastJet pseudojet.
std::vector< GenParticle const * > particles (const GenEvent *ge)
std::vector< GenParticlePtrparticles (GenEvent *ge)
std::vector< const GenVertex * > vertices (const GenEvent *ge)
std::vector< GenVertex * > vertices (GenEvent *ge)
std::vector< const GenParticle * > particles (const GenVertex *gv, HepMC::IteratorRange range=HepMC::relatives)
std::vector< GenParticle * > particles (GenVertex *gv, HepMC::IteratorRange range=HepMC::relatives)
GenVertexIterRangeC particles_in (const GenVertex *gv)
GenVertexIterRangeC particles_out (const GenVertex *gv)
std::vector< const GenParticle * > particles_in (const GenParticle *gp, HepMC::IteratorRange range=HepMC::ancestors)
 Get the direct parents or all-ancestors of GenParticle gp.
std::vector< GenParticle * > particles_in (GenParticle *gp, HepMC::IteratorRange range=HepMC::ancestors)
 Get the direct parents or all-ancestors of GenParticle gp.
std::vector< const GenParticle * > particles_out (const GenParticle *gp, HepMC::IteratorRange range=HepMC::descendants)
 Get the direct children or all-descendents of GenParticle gp.
std::vector< GenParticle * > particles_out (GenParticle *gp, HepMC::IteratorRange range=HepMC::descendants)
 Get the direct children or all-descendents of GenParticle gp.
std::vector< const GenParticle * > particles (const GenParticle *gp, HepMC::IteratorRange range=HepMC::ancestors)
 Get any relatives of GenParticle gp.
double mT2Sq (const FourMomentum &a, const FourMomentum &b, const Vector3 &ptmiss, double invisiblesMass, double invisiblesMass2=-1)
 Compute asymm mT2**2 using the bisection method.
double mT2Sq (const FourMomentum &a, const FourMomentum &b, const FourMomentum &ptmiss, double invisiblesMass, double invisiblesMass2=-1)
 Override for mT2Sq with FourMomentum ptmiss.
double mT2 (const FourMomentum &a, const FourMomentum &b, const Vector3 &ptmiss, double invisiblesMass, double invisiblesMass2=-1)
 Compute asymm mT2 using the bisection method.
double mT2 (const FourMomentum &a, const FourMomentum &b, const FourMomentum &ptmiss, double invisiblesMass, double invisiblesMass2=-1)
 Override for mT2 with FourMomentum ptmiss.
bool fileexists (const std::string &path)
 Convenience function for determining if a filesystem path exists.
map< string, AnalysisObjectPtrgetRefData (const string &papername)
 Function to get a map of all the refdata in a paper with the given papername.
string getDatafilePath (const string &papername)
 Get the file system path to the reference file for this paper.
template<typename T >
getEnvParam (const std::string name, const T &fallback)
 Get a parameter from a named environment variable, with automatic type conversion.
String representation and streaming support
std::ostream & operator<< (std::ostream &os, const Jet &j)
 Allow a Jet to be passed to an ostream.
std::ostream & operator<< (std::ostream &os, const Particle &p)
 Allow a Particle to be passed to an ostream.
std::ostream & operator<< (std::ostream &os, const ParticlePair &pp)
 Allow ParticlePair to be passed to an ostream.
Comparison functions for safe (floating point) equality tests
template<typename NUM >
std::enable_if
< std::is_floating_point< NUM >
::value, bool >::type 
isZero (NUM val, double tolerance=1e-8)
 Compare a number to zero.
template<typename N1 , typename N2 >
std::enable_if
< std::is_arithmetic< N1 >
::value &&std::is_arithmetic
< N2 >::value
&&(std::is_floating_point< N1 >
::value||std::is_floating_point
< N2 >::value), bool >::type 
fuzzyEquals (N1 a, N2 b, double tolerance=1e-5)
 Compare two numbers for equality with a degree of fuzziness.
template<typename N1 , typename N2 >
std::enable_if
< std::is_arithmetic< N1 >
::value &&std::is_arithmetic
< N2 >::value, bool >::type 
fuzzyGtrEquals (N1 a, N2 b, double tolerance=1e-5)
 Compare two numbers for >= with a degree of fuzziness.
template<typename N1 , typename N2 >
std::enable_if
< std::is_arithmetic< N1 >
::value &&std::is_arithmetic
< N2 >::value, bool >::type 
fuzzyLessEquals (N1 a, N2 b, double tolerance=1e-5)
 Compare two floating point numbers for <= with a degree of fuzziness.
Miscellaneous numerical helpers
Todo:
Add pair-based versions of the named range-boundary functions
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, NUM >::type 
sqr (NUM a)
 Named number-type squaring operation.
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, NUM >::type 
add_quad (NUM a, NUM b)
 Named number-type addition in quadrature operation.
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, NUM >::type 
add_quad (NUM a, NUM b, NUM c)
double safediv (double num, double den, double fail=0.0)
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, NUM >::type 
intpow (NUM val, unsigned int exp)
 A more efficient version of pow for raising numbers to integer powers.
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, int >::type 
sign (NUM val)
 Find the sign of a number.
Physics statistical distributions
double cdfBW (double x, double mu, double gamma)
 CDF for the Breit-Wigner distribution.
double invcdfBW (double p, double mu, double gamma)
 Inverse CDF for the Breit-Wigner distribution.
Binning helper functions
vector< double > linspace (size_t nbins, double start, double end, bool include_end=true)
 Make a list of nbins + 1 values equally spaced between start and end inclusive.
vector< double > logspace (size_t nbins, double start, double end, bool include_end=true)
 Make a list of nbins + 1 values exponentially spaced between start and end inclusive.
vector< double > bwspace (size_t nbins, double start, double end, double mu, double gamma)
 Make a list of nbins + 1 values spaced for equal area Breit-Wigner binning between start and end inclusive. mu and gamma are the Breit-Wigner parameters.
template<typename NUM , typename CONTAINER >
std::enable_if
< std::is_arithmetic< NUM >
::value &&std::is_arithmetic
< typename
CONTAINER::value_type >::value,
int >::type 
_binIndex (NUM val, const CONTAINER &binedges, bool allow_overflow=false)
 Actual helper implementation of binIndex (so generic and specific overloading can work)
template<typename NUM1 , typename NUM2 >
std::enable_if
< std::is_arithmetic< NUM1 >
::value &&std::is_arithmetic
< NUM2 >::value, int >::type 
binIndex (NUM1 val, std::initializer_list< NUM2 > binedges, bool allow_overflow=false)
 Return the bin index of the given value, val, given a vector of bin edges.
template<typename NUM , typename CONTAINER >
std::enable_if
< std::is_arithmetic< NUM >
::value &&std::is_arithmetic
< typename
CONTAINER::value_type >::value,
int >::type 
binIndex (NUM val, const CONTAINER &binedges, bool allow_overflow=false)
 Return the bin index of the given value, val, given a vector of bin edges.
Discrete statistics functions
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, NUM >::type 
median (const vector< NUM > &sample)
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, double >::type 
mean (const vector< NUM > &sample)
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, double >::type 
mean_err (const vector< NUM > &sample)
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, double >::type 
covariance (const vector< NUM > &sample1, const vector< NUM > &sample2)
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, double >::type 
covariance_err (const vector< NUM > &sample1, const vector< NUM > &sample2)
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, double >::type 
correlation (const vector< NUM > &sample1, const vector< NUM > &sample2)
template<typename NUM >
std::enable_if
< std::is_arithmetic< NUM >
::value, double >::type 
correlation_err (const vector< NUM > &sample1, const vector< NUM > &sample2)
Angle range mappings
double _mapAngleM2PITo2Pi (double angle)
 Reduce any number to the range [-2PI, 2PI].
double mapAngleMPiToPi (double angle)
 Map an angle into the range (-PI, PI].
double mapAngle0To2Pi (double angle)
 Map an angle into the range [0, 2PI).
double mapAngle0ToPi (double angle)
 Map an angle into the range [0, PI].
double mapAngle (double angle, PhiMapping mapping)
 Map an angle into the enum-specified range.
Phase-space measure helpers
double deltaPhi (double phi1, double phi2)
 Calculate the difference between two angles in radians.
double deltaEta (double eta1, double eta2)
double deltaRap (double y1, double y2)
double deltaR2 (double rap1, double phi1, double rap2, double phi2)
double deltaR (double rap1, double phi1, double rap2, double phi2)
double rapidity (double E, double pz)
 Calculate a rapidity value from the supplied energy E and longitudinal momentum pz.
\f$ |\Delta eta| \f$ calculations from 3-vectors
double deltaEta (const Vector3 &a, const Vector3 &b)
 Calculate the difference in pseudorapidity between two spatial vectors.
double deltaEta (const Vector3 &v, double eta2)
 Calculate the difference in pseudorapidity between two spatial vectors.
double deltaEta (double eta1, const Vector3 &v)
 Calculate the difference in pseudorapidity between two spatial vectors.
\f$ \Delta phi \f$ calculations from 3-vectors
double deltaPhi (const Vector3 &a, const Vector3 &b)
 Calculate the difference in azimuthal angle between two spatial vectors.
double deltaPhi (const Vector3 &v, double phi2)
 Calculate the difference in azimuthal angle between two spatial vectors.
double deltaPhi (double phi1, const Vector3 &v)
 Calculate the difference in azimuthal angle between two spatial vectors.
\f$ \Delta R \f$ calculations from 3-vectors
double deltaR2 (const Vector3 &a, const Vector3 &b)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.
double deltaR (const Vector3 &a, const Vector3 &b)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.
double deltaR2 (const Vector3 &v, double eta2, double phi2)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.
double deltaR (const Vector3 &v, double eta2, double phi2)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.
double deltaR2 (double eta1, double phi1, const Vector3 &v)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.
double deltaR (double eta1, double phi1, const Vector3 &v)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.
\f$ \Delta R \f$ calculations from 4-vectors
double deltaR2 (const FourVector &a, const FourVector &b, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.
double deltaR (const FourVector &a, const FourVector &b, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.
double deltaR2 (const FourVector &v, double eta2, double phi2, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.
double deltaR (const FourVector &v, double eta2, double phi2, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.
double deltaR2 (double eta1, double phi1, const FourVector &v, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.
double deltaR (double eta1, double phi1, const FourVector &v, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.
double deltaR2 (const FourMomentum &a, const FourMomentum &b, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.
double deltaR (const FourMomentum &a, const FourMomentum &b, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.
double deltaR2 (const FourMomentum &v, double eta2, double phi2, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.
double deltaR (const FourMomentum &v, double eta2, double phi2, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.
double deltaR2 (double eta1, double phi1, const FourMomentum &v, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.
double deltaR (double eta1, double phi1, const FourMomentum &v, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.
double deltaR2 (const FourMomentum &a, const FourVector &b, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.
double deltaR (const FourMomentum &a, const FourVector &b, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.
double deltaR2 (const FourVector &a, const FourMomentum &b, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.
double deltaR (const FourVector &a, const FourMomentum &b, RapScheme scheme=PSEUDORAPIDITY)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.
double deltaR2 (const FourMomentum &a, const Vector3 &b)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.
double deltaR (const FourMomentum &a, const Vector3 &b)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.
double deltaR2 (const Vector3 &a, const FourMomentum &b)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.
double deltaR (const Vector3 &a, const FourMomentum &b)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.
double deltaR2 (const FourVector &a, const Vector3 &b)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.
double deltaR (const FourVector &a, const Vector3 &b)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.
double deltaR2 (const Vector3 &a, const FourVector &b)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.
double deltaR (const Vector3 &a, const FourVector &b)
 Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.
\f$ \Delta phi \f$ calculations from 4-vectors
double deltaPhi (const FourMomentum &a, const FourMomentum &b)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (const FourMomentum &v, double phi2)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (double phi1, const FourMomentum &v)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (const FourVector &a, const FourVector &b)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (const FourVector &v, double phi2)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (double phi1, const FourVector &v)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (const FourVector &a, const FourMomentum &b)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (const FourMomentum &a, const FourVector &b)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (const FourVector &a, const Vector3 &b)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (const Vector3 &a, const FourVector &b)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (const FourMomentum &a, const Vector3 &b)
 Calculate the difference in azimuthal angle between two vectors.
double deltaPhi (const Vector3 &a, const FourMomentum &b)
 Calculate the difference in azimuthal angle between two vectors.
\f$ |\Delta eta| \f$ calculations from 4-vectors
double deltaEta (const FourMomentum &a, const FourMomentum &b)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (const FourMomentum &v, double eta2)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (double eta1, const FourMomentum &v)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (const FourVector &a, const FourVector &b)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (const FourVector &v, double eta2)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (double eta1, const FourVector &v)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (const FourVector &a, const FourMomentum &b)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (const FourMomentum &a, const FourVector &b)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (const FourVector &a, const Vector3 &b)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (const Vector3 &a, const FourVector &b)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (const FourMomentum &a, const Vector3 &b)
 Calculate the difference in pseudorapidity between two vectors.
double deltaEta (const Vector3 &a, const FourMomentum &b)
 Calculate the difference in pseudorapidity between two vectors.
\f$ |\Delta y| \f$ calculations from 4-momentum vectors
double deltaRap (const FourMomentum &a, const FourMomentum &b)
 Calculate the difference in rapidity between two 4-momentum vectors.
double deltaRap (const FourMomentum &v, double y2)
 Calculate the difference in rapidity between two 4-momentum vectors.
double deltaRap (double y1, const FourMomentum &v)
 Calculate the difference in rapidity between two 4-momentum vectors.
4-vector comparison functions (for sorting)
bool cmpMomByPt (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by decreasing pT.
bool cmpMomByAscPt (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by increasing pT.
bool cmpMomByP (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by decreasing 3-momentum magnitude |p|.
bool cmpMomByAscP (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by increasing 3-momentum magnitude |p|.
bool cmpMomByEt (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by decreasing transverse energy.
bool cmpMomByAscEt (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by increasing transverse energy.
bool cmpMomByE (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by decreasing energy.
bool cmpMomByAscE (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by increasing energy.
bool cmpMomByMass (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by decreasing mass.
bool cmpMomByAscMass (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by increasing mass.
bool cmpMomByEta (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by increasing eta (pseudorapidity)
bool cmpMomByDescEta (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by decreasing eta (pseudorapidity)
bool cmpMomByAbsEta (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by increasing absolute eta (pseudorapidity)
bool cmpMomByDescAbsEta (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by increasing absolute eta (pseudorapidity)
bool cmpMomByRap (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by increasing rapidity.
bool cmpMomByDescRap (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by decreasing rapidity.
bool cmpMomByAbsRap (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by increasing absolute rapidity.
bool cmpMomByDescAbsRap (const FourMomentum &a, const FourMomentum &b)
 Comparison to give a sorting by decreasing absolute rapidity.
template<typename MOMS , typename CMP >
MOMS & sortBy (MOMS &pbs, const CMP &cmp)
 Sort a container of momenta by cmp and return by reference for non-const inputs.
template<typename MOMS , typename CMP >
MOMS sortBy (const MOMS &pbs, const CMP &cmp)
 Sort a container of momenta by cmp and return by value for const inputs.
template<typename MOMS >
MOMS & sortByPt (MOMS &pbs)
 Sort a container of momenta by pT (decreasing) and return by reference for non-const inputs.
template<typename MOMS >
MOMS sortByPt (const MOMS &pbs)
 Sort a container of momenta by pT (decreasing) and return by value for const inputs.
template<typename MOMS >
MOMS & sortByE (MOMS &pbs)
 Sort a container of momenta by E (decreasing) and return by reference for non-const inputs.
template<typename MOMS >
MOMS sortByE (const MOMS &pbs)
 Sort a container of momenta by E (decreasing) and return by value for const inputs.
template<typename MOMS >
MOMS & sortByEt (MOMS &pbs)
 Sort a container of momenta by Et (decreasing) and return by reference for non-const inputs.
template<typename MOMS >
MOMS sortByEt (const MOMS &pbs)
 Sort a container of momenta by Et (decreasing) and return by value for const inputs.
MT calculation
double mT (const Vector3 &vis, const Vector3 &invis)
 Calculate transverse mass of a visible and an invisible 3-vector.
double mT (const FourMomentum &vis, const FourMomentum &invis)
 Calculate transverse mass of a visible and an invisible 4-vector.
double mT (const FourMomentum &vis, const Vector3 &invis)
 Calculate transverse mass of a visible 4-vector and an invisible 3-vector.
double mT (const Vector3 &vis, const FourMomentum &invis)
 Calculate transverse mass of a visible 4-vector and an invisible 3-vector.
4-vector string representations
std::string toString (const FourVector &lv)
 Render a 4-vector as a string.
std::ostream & operator<< (std::ostream &out, const FourVector &lv)
 Write a 4-vector to an ostream.
String representations of vectors
template<size_t N>
const string toString (const Vector< N > &v)
 Make string representation.
template<size_t N>
std::ostream & operator<< (std::ostream &out, const Vector< N > &v)
 Stream out string representation.
deltaR, deltaEta, deltaPhi functions specifically for Particle/Jet arguments
double deltaR (const ParticleBase &p1, const ParticleBase &p2, RapScheme scheme=PSEUDORAPIDITY)
double deltaR (const ParticleBase &p, const FourMomentum &v, RapScheme scheme=PSEUDORAPIDITY)
double deltaR (const ParticleBase &p, const FourVector &v, RapScheme scheme=PSEUDORAPIDITY)
double deltaR (const ParticleBase &p, const Vector3 &v)
double deltaR (const ParticleBase &p, double eta, double phi)
double deltaR (const FourMomentum &v, const ParticleBase &p, RapScheme scheme=PSEUDORAPIDITY)
double deltaR (const FourVector &v, const ParticleBase &p, RapScheme scheme=PSEUDORAPIDITY)
double deltaR (const Vector3 &v, const ParticleBase &p)
double deltaR (double eta, double phi, const ParticleBase &p)
double deltaPhi (const ParticleBase &p1, const ParticleBase &p2)
double deltaPhi (const ParticleBase &p, const FourMomentum &v)
double deltaPhi (const ParticleBase &p, const FourVector &v)
double deltaPhi (const ParticleBase &p, const Vector3 &v)
double deltaPhi (const ParticleBase &p, double phi)
double deltaPhi (const FourMomentum &v, const ParticleBase &p)
double deltaPhi (const FourVector &v, const ParticleBase &p)
double deltaPhi (const Vector3 &v, const ParticleBase &p)
double deltaPhi (double phi, const ParticleBase &p)
double deltaEta (const ParticleBase &p1, const ParticleBase &p2)
double deltaEta (const ParticleBase &p, const FourMomentum &v)
double deltaEta (const ParticleBase &p, const FourVector &v)
double deltaEta (const ParticleBase &p, const Vector3 &v)
double deltaEta (const ParticleBase &p, double eta)
double deltaEta (const FourMomentum &v, const ParticleBase &p)
double deltaEta (const FourVector &v, const ParticleBase &p)
double deltaEta (const Vector3 &v, const ParticleBase &p)
double deltaEta (double eta, const ParticleBase &p)
double deltaRap (const ParticleBase &p1, const ParticleBase &p2)
double deltaRap (const ParticleBase &p, const FourMomentum &v)
double deltaRap (const ParticleBase &p, double y)
double deltaRap (const FourMomentum &v, const ParticleBase &p)
double deltaRap (double y, const ParticleBase &p)
Standalone beam kinematics functions
ParticlePair beams (const Event &e)
 Get beam particles from an event.
PdgIdPair beamIds (const ParticlePair &beams)
PdgIdPair beamIds (const Event &e)
double sqrtS (const FourMomentum &pa, const FourMomentum &pb)
 Get beam centre-of-mass energy from a pair of beam momenta.
double sqrtS (const ParticlePair &beams)
 Get beam centre-of-mass energy from a pair of Particles.
double sqrtS (const Event &e)
 Get beam centre-of-mass energy from an Event.
double asqrtS (const FourMomentum &pa, const FourMomentum &pb)
double asqrtS (const ParticlePair &beams)
double asqrtS (const Event &e)
FourMomentum cmsBoostVec (const FourMomentum &pa, const FourMomentum &pb)
 Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of beam momenta.
FourMomentum cmsBoostVec (const ParticlePair &beams)
 Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of Particles.
FourMomentum acmsBoostVec (const FourMomentum &pa, const FourMomentum &pb)
 Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of beam momenta.
FourMomentum acmsBoostVec (const ParticlePair &beams)
 Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of Particles.
Vector3 cmsBetaVec (const FourMomentum &pa, const FourMomentum &pb)
 Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of beam momenta.
Vector3 cmsBetaVec (const ParticlePair &beams)
 Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of Particles.
Vector3 acmsBetaVec (const FourMomentum &pa, const FourMomentum &pb)
Vector3 acmsBetaVec (const ParticlePair &beams)
Vector3 cmsGammaVec (const FourMomentum &pa, const FourMomentum &pb)
 Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of beam momenta.
Vector3 cmsGammaVec (const ParticlePair &beams)
 Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of Particles.
Vector3 acmsGammaVec (const FourMomentum &pa, const FourMomentum &pb)
Vector3 acmsGammaVec (const ParticlePair &beams)
LorentzTransform cmsTransform (const FourMomentum &pa, const FourMomentum &pb)
 Get the Lorentz transformation to the beam centre-of-mass system (CMS) from a pair of beam momenta.
LorentzTransform cmsTransform (const ParticlePair &beams)
 Get the Lorentz transformation to the beam centre-of-mass system (CMS) from a pair of Particles.
LorentzTransform acmsTransform (const FourMomentum &pa, const FourMomentum &pb)
LorentzTransform acmsTransform (const ParticlePair &beams)
Cut constructors
Cut operator== (Cuts::Quantity, double)
Cut operator!= (Cuts::Quantity, double)
Cut operator< (Cuts::Quantity, double)
Cut operator> (Cuts::Quantity, double)
Cut operator<= (Cuts::Quantity, double)
Cut operator>= (Cuts::Quantity, double)
Cut operator== (Cuts::Quantity qty, int i)
Cut operator!= (Cuts::Quantity qty, int i)
Cut operator< (Cuts::Quantity qty, int i)
Cut operator> (Cuts::Quantity qty, int i)
Cut operator<= (Cuts::Quantity qty, int i)
Cut operator>= (Cuts::Quantity qty, int i)
Cut combiners
Cut operator&& (const Cut &aptr, const Cut &bptr)
Cut operator|| (const Cut &aptr, const Cut &bptr)
Cut operator! (const Cut &cptr)
 Logical NOT operation on a cut.
Cut operator& (const Cut &aptr, const Cut &bptr)
 Logical AND operation on two cuts.
Cut operator| (const Cut &aptr, const Cut &bptr)
 Logical OR operation on two cuts.
Cut operator~ (const Cut &cptr)
 Logical NOT operation on a cut.
Cut operator^ (const Cut &aptr, const Cut &bptr)
 Logical XOR operation on two cuts.
Unbound functions for converting between Jets, Particles and PseudoJets
PseudoJets mkPseudoJets (const Particles &ps)
Jets mkJets (const PseudoJets &pjs)
Jet classifier -> bool functors
BoolJetAND operator&& (const JetSelector &a, const JetSelector &b)
 Operator syntactic sugar for AND construction.
BoolJetOR operator|| (const JetSelector &a, const JetSelector &b)
 Operator syntactic sugar for OR construction.
BoolJetNOT operator! (const JetSelector &a)
 Operator syntactic sugar for NOT construction.
Unbound functions for filtering jets
Jetsifilter_select (Jets &jets, const Cut &c)
 Filter a jet collection in-place to the subset that passes the supplied Cut.
JetsifilterBy (Jets &jets, const Cut &c)
Jets filter_select (const Jets &jets, const Cut &c)
 Filter a jet collection in-place to the subset that passes the supplied Cut.
Jets filterBy (const Jets &jets, const Cut &c)
Jets filter_select (const Jets &jets, const Cut &c, Jets &out)
 Filter a jet collection in-place to the subset that passes the supplied Cut.
Jets filterBy (const Jets &jets, const Cut &c, Jets &out)
Jetsifilter_discard (Jets &jets, const Cut &c)
 Filter a jet collection in-place to the subset that fails the supplied Cut.
Jets filter_discard (const Jets &jets, const Cut &c)
 Filter a jet collection in-place to the subset that fails the supplied Cut.
Jets filter_discard (const Jets &jets, const Cut &c, Jets &out)
 Filter a jet collection in-place to the subset that fails the supplied Cut.
FourMomentum efficiency and smearing functions
double P3_EFF_ZERO (const Vector3 &p)
 Take a Vector3 and return 0.
double P3_FN0 (const Vector3 &p)
double P3_EFF_ONE (const Vector3 &p)
 Take a Vector3 and return 1.
double P3_FN1 (const Vector3 &p)
Vector3 P3_SMEAR_IDENTITY (const Vector3 &p)
 Take a Vector3 and return it unmodified.
Vector3 P3_SMEAR_PERFECT (const Vector3 &p)
 Alias for P3_SMEAR_IDENTITY.
Vector3 P3_SMEAR_LEN_GAUSS (const Vector3 &p, double resolution)
 Smear a Vector3's length using a Gaussian of absolute width resolution.
Isolation helper routines
template<typename PBCONTAINER1 , typename PBCONTAINER2 >
void idiscardIfAnyDeltaRLess (PBCONTAINER1 &tofilter, const PBCONTAINER2 &tocompare, double dR)
template<typename PBCONTAINER1 , typename PBCONTAINER2 >
PBCONTAINER1 discardIfAnyDeltaRLess (const PBCONTAINER1 &tofilter, const PBCONTAINER2 &tocompare, double dR)
template<typename PBCONTAINER1 , typename PBCONTAINER2 >
void idiscardIfAnyDeltaPhiLess (PBCONTAINER1 &tofilter, const PBCONTAINER2 &tocompare, double dphi)
template<typename PBCONTAINER1 , typename PBCONTAINER2 >
PBCONTAINER1 discardIfAnyDeltaPhiLess (const PBCONTAINER1 &tofilter, const PBCONTAINER2 &tocompare, double dphi)
Particle classifier functions
int pid (const Particle &p)
 Unbound function access to PID code.
int abspid (const Particle &p)
 Unbound function access to abs PID code.
Particle pair classifiers

Is this particle species charged?

Is this particle species neutral? Is this a neutrino? Determine if the PID is that of a charged lepton Determine if the PID is that of a lepton (charged or neutral) Determine if the PID is that of a photon Determine if the PID is that of an electron or positron Determine if the PID is that of an muon or antimuon Determine if the PID is that of an tau or antitau Determine if the PID is that of a hadron Determine if the PID is that of a meson Determine if the PID is that of a baryon Determine if the PID is that of a quark Determine if the PID is that of a parton (quark or gluon) Determine if the PID is that of a W+ Determine if the PID is that of a W- Determine if the PID is that of a W+- Determine if the PID is that of a Z0 Determine if the PID is that of an SM/lightest SUSY Higgs Determine if the PID is that of an s/sbar Determine if the PID is that of a c/cbar Determine if the PID is that of a b/bbar Determine if the PID is that of a t/tbar Determine if the particle is a heavy flavour hadron or parton Determine if the PID is that of a heavy parton (c,b,t) Determine if the PID is that of a light parton (u,d,s) Determine if the PID is that of a heavy flavour (b or c) meson Determine if the PID is that of a heavy flavour (b or c) baryon Determine if the PID is that of a heavy flavour (b or c) hadron Determine if the PID is that of a light flavour (not b or c) meson Determine if the PID is that of a light flavour (not b or c) baryon Determine if the PID is that of a light flavour (not b or c) hadron Determine if the PID is that of a b-meson. Determine if the PID is that of a b-baryon. Determine if the PID is that of a b-hadron. Determine if the PID is that of a c-meson.

Specifically, the _heaviest_ quark is a c: a B_c is a b-meson and NOT a c-meson. Charmonia (closed charm) are counted as c-mesons here. Determine if the PID is that of a c-baryon.

Specifically, the _heaviest_ quark is a c: a baryon containing a b & c is a b-baryon and NOT a c-baryon. To test for the simpler case, just use a combination of hasCharm() and isBaryon(). Determine if the PID is that of a c-hadron. Is this a pomeron, odderon, or generic reggeon? Determine if the PID is that of a diquark (used in hadronization models) Determine if the PID is that of a pentaquark (hypothetical hadron) Is this a fundamental SUSY particle? Is this an R-hadron? Is this a technicolor particle? Is this an excited (composite) quark or lepton? Is this a Kaluza-Klein excitation? Is this a graviton? Is this a BSM particle (including graviton)? Determine if the PID is in the generator-specific range Determine if the PID is that of an EW scale resonance Check the PID for usability in transport codes like Geant4 Does this particle contain an up quark? Does this particle contain a down quark? Does this particle contain a strange quark? Does this particle contain a charm quark? Does this particle contain a bottom quark? Does this particle contain a top quark? jSpin returns 2J+1, where J is the total spin sSpin returns 2S+1, where S is the spin lSpin returns 2L+1, where L is the orbital angular momentum Return the charge Return 3 times the charge (3 x quark charge is an int) Return the absolute charge Return 3 times the abs charge (3 x quark charge is an int) Alias for charge3

Deprecated:
Use charge3

Get the atomic number (number of protons) in a nucleus/ion Get the atomic weight (number of nucleons) in a nucleus/ion If this is a nucleus (ion), get nLambda

Todo:
Make versions that work on ParticlePair?
bool isSameSign (const Particle &a, const Particle &b)
bool isOppSign (const Particle &a, const Particle &b)
bool isSameFlav (const Particle &a, const Particle &b)
bool isOppFlav (const Particle &a, const Particle &b)
bool isOSSF (const Particle &a, const Particle &b)
bool isSSSF (const Particle &a, const Particle &b)
bool isOSOF (const Particle &a, const Particle &b)
bool isSSOF (const Particle &a, const Particle &b)
Particle charge/sign comparison functions
bool oppSign (const Particle &a, const Particle &b)
 Return true if Particles a and b have the opposite charge sign.
bool sameSign (const Particle &a, const Particle &b)
bool oppCharge (const Particle &a, const Particle &b)
bool sameCharge (const Particle &a, const Particle &b)
bool diffCharge (const Particle &a, const Particle &b)
 Return true if Particles a and b have a different (not necessarily opposite) charge.
Non-PID particle properties, via unbound functions
bool isFirstWith (const Particle &p, const ParticleSelector &f)
 Determine whether a particle is the first in a decay chain to meet the function requirement.
bool isFirstWithout (const Particle &p, const ParticleSelector &f)
 Determine whether a particle is the first in a decay chain not to meet the function requirement.
bool isLastWith (const Particle &p, const ParticleSelector &f)
 Determine whether a particle is the last in a decay chain to meet the function requirement.
bool isLastWithout (const Particle &p, const ParticleSelector &f)
 Determine whether a particle is the last in a decay chain not to meet the function requirement.
bool hasAncestorWith (const Particle &p, const ParticleSelector &f)
 Determine whether a particle has an ancestor which meets the function requirement.
bool hasAncestorWithout (const Particle &p, const ParticleSelector &f)
 Determine whether a particle has an ancestor which doesn't meet the function requirement.
bool hasParentWith (const Particle &p, const ParticleSelector &f)
 Determine whether a particle has a parent which meets the function requirement.
bool hasParentWithout (const Particle &p, const ParticleSelector &f)
 Determine whether a particle has a parent which doesn't meet the function requirement.
bool hasChildWith (const Particle &p, const ParticleSelector &f)
 Determine whether a particle has a child which meets the function requirement.
bool hasChildWithout (const Particle &p, const ParticleSelector &f)
 Determine whether a particle has a child which doesn't meet the function requirement.
bool hasDescendantWith (const Particle &p, const ParticleSelector &f)
 Determine whether a particle has a descendant which meets the function requirement.
bool hasDescendantWithout (const Particle &p, const ParticleSelector &f)
 Determine whether a particle has a descendant which doesn't meet the function requirement.
bool hasStableDescendantWith (const Particle &p, const ParticleSelector &f)
 Determine whether a particle has a stable descendant which meets the function requirement.
bool hasStableDescendantWithout (const Particle &p, const ParticleSelector &f)
 Determine whether a particle has a stable descendant which doesn't meet the function requirement.
bool isVisible (const Particle &p)
 Is this particle potentially visible in a detector?
bool isDirect (const Particle &p, bool allow_from_direct_tau=false, bool allow_from_direct_mu=false)
 Decide if a given particle is direct, via Particle::isDirect()
bool isPrompt (const Particle &p, bool allow_from_prompt_tau=false, bool allow_from_prompt_mu=false)
 Decide if a given particle is prompt, via Particle::isPrompt()
bool isStable (const Particle &p)
 Decide if a given particle is stable, via Particle::isStable()
bool hasHadronicDecay (const Particle &p)
 Decide if a given particle decays hadronically.
bool hasLeptonicDecay (const Particle &p)
 Decide if a given particle decays leptonically (decays, and no hadrons)
bool hasAncestor (const Particle &p, PdgId pid)
bool fromBottom (const Particle &p)
 Determine whether the particle is from a b-hadron decay.
bool fromCharm (const Particle &p)
 Determine whether the particle is from a c-hadron decay.
bool fromHadron (const Particle &p)
 Determine whether the particle is from a hadron decay.
bool fromTau (const Particle &p, bool prompt_taus_only=false)
 Determine whether the particle is from a tau decay.
bool fromPromptTau (const Particle &p)
 Determine whether the particle is from a prompt tau decay.
bool fromDecay (const Particle &p)
 Determine whether the particle is from a hadron or tau decay.
Particle classifier -> bool functors

To be passed to any() or all() e.g. any(p.children(), HasPID(PID::MUON))

BoolParticleAND operator&& (const ParticleSelector &a, const ParticleSelector &b)
 Operator syntactic sugar for AND construction.
BoolParticleOR operator|| (const ParticleSelector &a, const ParticleSelector &b)
 Operator syntactic sugar for OR construction.
BoolParticleNOT operator! (const ParticleSelector &a)
 Operator syntactic sugar for NOT construction.
Particle pair functions
PdgIdPair pids (const ParticlePair &pp)
Installation directory paths
std::string getLibPath ()
 Get library install path.
std::string getDataPath ()
 Get data install path.
std::string getRivetDataPath ()
 Get Rivet data install path.
Analysis library search paths
std::vector< std::string > getAnalysisLibPaths ()
 Get Rivet analysis plugin library search paths.
void setAnalysisLibPaths (const std::vector< std::string > &paths)
 Set the Rivet analysis plugin library search paths.
void addAnalysisLibPath (const std::string &extrapath)
 Add a Rivet analysis plugin library search path.
std::string findAnalysisLibFile (const std::string &filename)
 Find the first file of the given name in the analysis library search dirs.
Analysis data/metadata paths and search functions
std::vector< std::string > getAnalysisDataPaths ()
 Get Rivet analysis reference data search paths.
void setAnalysisDataPaths (const std::vector< std::string > &paths)
 Set the Rivet data file search paths.
void addAnalysisDataPath (const std::string &extrapath)
 Add a Rivet data file search path.
std::string findAnalysisDataFile (const std::string &filename, const std::vector< std::string > &pathprepend=std::vector< std::string >(), const std::vector< std::string > &pathappend=std::vector< std::string >())
 Find the first file of the given name in the general data file search dirs.
std::vector< std::string > getAnalysisRefPaths ()
 Get Rivet analysis reference data search paths.
std::string findAnalysisRefFile (const std::string &filename, const std::vector< std::string > &pathprepend=std::vector< std::string >(), const std::vector< std::string > &pathappend=std::vector< std::string >())
 Find the first file of the given name in the ref data file search dirs.
std::vector< std::string > getAnalysisInfoPaths ()
 Get Rivet analysis info metadata search paths.
std::string findAnalysisInfoFile (const std::string &filename, const std::vector< std::string > &pathprepend=std::vector< std::string >(), const std::vector< std::string > &pathappend=std::vector< std::string >())
 Find the first file of the given name in the analysis info file search dirs.
std::vector< std::string > getAnalysisPlotPaths ()
 Get Rivet analysis plot style search paths.
std::string findAnalysisPlotFile (const std::string &filename, const std::vector< std::string > &pathprepend=std::vector< std::string >(), const std::vector< std::string > &pathappend=std::vector< std::string >())
 Find the first file of the given name in the analysis plot file search dirs.
Streaming containers as string reps
Todo:

Make these named toStr rather than operator<<

Make these generic to any iterable

template<typename T >
std::ostream & operator<< (std::ostream &os, const std::vector< T > &vec)
 Convenient function for streaming out vectors of any streamable object.
template<typename T >
std::ostream & operator<< (std::ostream &os, const std::list< T > &vec)
 Convenient function for streaming out lists of any streamable object.
Boolean-return container searching
bool contains (const std::string &s, const std::string &sub)
 Does s contain sub as a substring?
template<typename T >
bool contains (const std::initializer_list< T > &il, const T &x)
 Does the init list il contain x?
template<typename T >
bool contains (const std::vector< T > &v, const T &x)
 Does the vector v contain x?
template<typename T >
bool contains (const std::list< T > &l, const T &x)
 Does the list l contain x?
template<typename T >
bool contains (const std::set< T > &s, const T &x)
 Does the set s contain x?
template<typename K , typename T >
bool has_key (const std::map< K, T > &m, const K &key)
 Does the map m contain the key key?
template<typename K , typename T >
bool has_value (const std::map< K, T > &m, const T &val)
 Does the map m contain the value val?
Electron efficiency and smearing functions
double ELECTRON_EFF_ATLAS_RUN1 (const Particle &e)
double ELECTRON_EFF_ATLAS_RUN2 (const Particle &e)
double ELECTRON_IDEFF_ATLAS_RUN2_LOOSE (const Particle &e)
 ATLAS Run 2 'loose' electron identification/selection efficiency.
double ELECTRON_IDEFF_ATLAS_RUN1_MEDIUM (const Particle &e)
 ATLAS Run 1 'medium' electron identification/selection efficiency.
double ELECTRON_IDEFF_ATLAS_RUN2_MEDIUM (const Particle &e)
 ATLAS Run 2 'medium' electron identification/selection efficiency.
double ELECTRON_IDEFF_ATLAS_RUN1_TIGHT (const Particle &e)
 ATLAS Run 1 'tight' electron identification/selection efficiency.
double ELECTRON_IDEFF_ATLAS_RUN2_TIGHT (const Particle &e)
 ATLAS Run 2 'tight' electron identification/selection efficiency.
Particle ELECTRON_SMEAR_ATLAS_RUN1 (const Particle &e)
 ATLAS Run 1 electron reco smearing.
Particle ELECTRON_SMEAR_ATLAS_RUN2 (const Particle &e)
double ELECTRON_EFF_CMS_RUN1 (const Particle &e)
double ELECTRON_EFF_CMS_RUN2 (const Particle &e)
Particle ELECTRON_SMEAR_CMS_RUN1 (const Particle &e)
 CMS electron energy smearing, preserving direction.
Particle ELECTRON_SMEAR_CMS_RUN2 (const Particle &e)
Photon efficiency and smearing functions
double PHOTON_EFF_ATLAS_RUN1 (const Particle &y)
double PHOTON_EFF_ATLAS_RUN2 (const Particle &y)
double PHOTON_EFF_CMS_RUN1 (const Particle &y)
double PHOTON_EFF_CMS_RUN2 (const Particle &y)
Particle PHOTON_SMEAR_ATLAS_RUN1 (const Particle &y)
Particle PHOTON_SMEAR_ATLAS_RUN2 (const Particle &y)
Particle PHOTON_SMEAR_CMS_RUN1 (const Particle &y)
Particle PHOTON_SMEAR_CMS_RUN2 (const Particle &y)
Muon efficiency and smearing functions
double MUON_EFF_ATLAS_RUN1 (const Particle &m)
 ATLAS Run 1 muon reco efficiency.
double MUON_EFF_ATLAS_RUN2 (const Particle &m)
Particle MUON_SMEAR_ATLAS_RUN1 (const Particle &m)
 ATLAS Run 1 muon reco smearing.
Particle MUON_SMEAR_ATLAS_RUN2 (const Particle &m)
double MUON_EFF_CMS_RUN1 (const Particle &m)
 CMS Run 1 muon reco efficiency.
double MUON_EFF_CMS_RUN2 (const Particle &m)
Particle MUON_SMEAR_CMS_RUN1 (const Particle &m)
 CMS Run 1 muon reco smearing.
Particle MUON_SMEAR_CMS_RUN2 (const Particle &m)
Tau efficiency and smearing functions
double TAU_EFF_ATLAS_RUN1 (const Particle &t)
 ATLAS Run 1 8 TeV tau efficiencies (medium working point)
double TAU_EFF_ATLAS_RUN2 (const Particle &t)
 ATLAS Run 2 13 TeV tau efficiencies (medium working point)
Particle TAU_SMEAR_ATLAS_RUN1 (const Particle &t)
Particle TAU_SMEAR_ATLAS_RUN2 (const Particle &t)
double TAU_EFF_CMS_RUN2 (const Particle &t)
double TAU_EFF_CMS_RUN1 (const Particle &t)
Particle TAU_SMEAR_CMS_RUN1 (const Particle &t)
Particle TAU_SMEAR_CMS_RUN2 (const Particle &t)
Jet efficiency and smearing functions
double JET_BTAG_ATLAS_RUN1 (const Jet &j)
 Return the ATLAS Run 1 jet flavour tagging efficiency for the given Jet.
double JET_BTAG_ATLAS_RUN2_MV2C20 (const Jet &j)
 Return the ATLAS Run 2 MC2c20 jet flavour tagging efficiency for the given Jet.
double JET_BTAG_ATLAS_RUN2_MV2C10 (const Jet &j)
 Return the ATLAS Run 2 MC2c10 jet flavour tagging efficiency for the given Jet.
Jet JET_SMEAR_ATLAS_RUN1 (const Jet &j)
 ATLAS Run 1 jet smearing.
Jet JET_SMEAR_ATLAS_RUN2 (const Jet &j)
Jet JET_SMEAR_CMS_RUN2 (const Jet &j)
ETmiss smearing functions
Vector3 MET_SMEAR_IDENTITY (const Vector3 &met, double)
Vector3 MET_SMEAR_ATLAS_RUN1 (const Vector3 &met, double set)
 ATLAS Run 1 ETmiss smearing.
Vector3 MET_SMEAR_ATLAS_RUN2 (const Vector3 &met, double set)
Vector3 MET_SMEAR_CMS_RUN1 (const Vector3 &met, double set)
Vector3 MET_SMEAR_CMS_RUN2 (const Vector3 &met, double set)
Tracking efficiency and smearing functions
double TRK_EFF_ATLAS_RUN1 (const Particle &p)
 ATLAS Run 1 tracking efficiency.
double TRK_EFF_ATLAS_RUN2 (const Particle &p)
double TRK_EFF_CMS_RUN1 (const Particle &p)
 CMS Run 1 tracking efficiency.
double TRK_EFF_CMS_RUN2 (const Particle &p)
String utils
template<typename T , typename U >
lexical_cast (const U &in)
 Convert between any types via stringstream.
template<typename T >
string to_str (const T &x)
 Convert any object to a string.
template<typename T >
string toString (const T &x)
 Convert any object to a string.
string & replace_first (string &str, const string &patt, const string &repl)
 Replace the first instance of patt with repl.
string & replace_all (string &str, const string &patt, const string &repl)
 Replace all instances of patt with repl.
int nocase_cmp (const string &s1, const string &s2)
 Case-insensitive string comparison function.
bool nocase_equals (const string &s1, const string &s2)
 Case-insensitive string equality function.
string toLower (const string &s)
 Convert a string to lower-case.
string toUpper (const string &s)
 Convert a string to upper-case.
bool startsWith (const string &s, const string &start)
 Check whether a string start is found at the start of s.
bool endsWith (const string &s, const string &end)
 Check whether a string end is found at the end of s.
template<typename T >
string join (const vector< T > &v, const string &sep=" ")
 Make a string containing the string representations of each item in v, separated by sep.
template<typename T >
string join (const set< T > &s, const string &sep=" ")
 Make a string containing the string representations of each item in s, separated by sep.
vector< string > split (const string &s, const string &sep)
 Split a string on a specified separator string.
Path utils
vector< string > pathsplit (const string &path)
 Split a path string with colon delimiters.
string pathjoin (const vector< string > &paths)
 Join several filesystem paths together with the standard ':' delimiter.
string operator/ (const string &a, const string &b)
 Operator for joining strings a and b with filesystem separators.
string basename (const string &p)
 Get the basename (i.e. terminal file name) from a path p.
string dirname (const string &p)
 Get the dirname (i.e. path to the penultimate directory) from a path p.
string file_stem (const string &f)
 Get the stem (i.e. part without a file extension) from a filename f.
string file_extn (const string &f)
 Get the file extension from a filename f.
Container utils
template<typename CONTAINER >
unsigned int count (const CONTAINER &c)
 Return number of true elements in the container c .
template<typename CONTAINER , typename FN >
unsigned int count (const CONTAINER &c, const FN &f)
 Return number of elements in the container c for which f(x) is true.
template<typename CONTAINER >
bool any (const CONTAINER &c)
 Return true if x is true for any x in container c, otherwise false.
template<typename CONTAINER , typename FN >
bool any (const CONTAINER &c, const FN &f)
 Return true if f(x) is true for any x in container c, otherwise false.
template<typename CONTAINER >
bool all (const CONTAINER &c)
 Return true if x is true for all x in container c, otherwise false.
template<typename CONTAINER , typename FN >
bool all (const CONTAINER &c, const FN &f)
 Return true if f(x) is true for all x in container c, otherwise false.
template<typename CONTAINER >
bool none (const CONTAINER &c)
 Return true if x is false for all x in container c, otherwise false.
template<typename CONTAINER , typename FN >
bool none (const CONTAINER &c, const FN &f)
 Return true if f(x) is false for all x in container c, otherwise false.
template<typename C1 , typename C2 , typename FN >
const C2 & transform (const C1 &in, C2 &out, const FN &f)
 A single-container-arg version of std::transform, aka map.
template<typename C1 , typename T , typename FN >
accumulate (const C1 &in, const T &init, const FN &f)
 A single-container-arg version of std::accumulate, aka reduce.
template<typename CONTAINER , typename T >
sum (const CONTAINER &c, const T &start=T())
 Generic sum function, adding x for all x in container c, starting with start.
template<typename CONTAINER , typename FN , typename T >
sum (const CONTAINER &c, const FN &f, const T &start=T())
 Generic sum function, adding fn(x) for all x in container c, starting with start.
template<typename CONTAINER , typename FN >
CONTAINER & ifilter_discard (CONTAINER &c, const FN &f)
 Filter a collection in-place, removing the subset that passes the supplied function.
template<typename CONTAINER , typename FN >
CONTAINER filter_discard (const CONTAINER &c, const FN &f)
 Filter a collection by copy, removing the subset that passes the supplied function.
template<typename CONTAINER , typename FN >
CONTAINER & filter_discard (const CONTAINER &c, const FN &f, CONTAINER &out)
template<typename CONTAINER , typename FN >
CONTAINER & ifilter_select (CONTAINER &c, const FN &f)
 Filter a collection in-place, keeping the subset that passes the supplied function.
template<typename CONTAINER , typename FN >
CONTAINER filter_select (const CONTAINER &c, const FN &f)
 Filter a collection by copy, keeping the subset that passes the supplied function.
template<typename CONTAINER , typename FN >
CONTAINER & filter_select (const CONTAINER &c, const FN &f, CONTAINER &out)
template<typename CONTAINER >
CONTAINER slice (const CONTAINER &c, int i, int j)
 Slice of the container elements cf. Python's [i:j] syntax.
template<typename CONTAINER >
CONTAINER slice (const CONTAINER &c, int i)
 Tail slice of the container elements cf. Python's [i:] syntax.
template<typename CONTAINER >
CONTAINER head (const CONTAINER &c, int n)
 Head slice of the n first container elements.
template<typename CONTAINER >
CONTAINER tail (const CONTAINER &c, int n)
 Tail slice of the n last container elements.
double min (const vector< double > &in, double errval=DBL_NAN)
 Find the minimum value in the vector.
double max (const vector< double > &in, double errval=DBL_NAN)
 Find the maximum value in the vector.
pair< double, double > minmax (const vector< double > &in, double errval=DBL_NAN)
 Find the minimum and maximum values in the vector.
int min (const vector< int > &in, int errval=-1)
 Find the minimum value in the vector.
int max (const vector< int > &in, int errval=-1)
 Find the maximum value in the vector.
pair< int, int > minmax (const vector< int > &in, int errval=-1)
 Find the minimum and maximum values in the vector.

Variables

static const double pi = 3.14159265358979323846
static const double twopi = 2*pi
static const double halfpi = pi/2
static const double pi2 = pi*pi
static const double Avogadro = 6.0221367e+23/mole
static const double c_light = 2.99792458e+8 * m/s
static const double c_squared = c_light * c_light
static const double h_Planck = 6.6260755e-34 * joule*s
static const double hbar_Planck = h_Planck/twopi
static const double hbarc = hbar_Planck * c_light
static const double hbarc_squared = hbarc * hbarc
static const double electron_charge = - eplus
static const double e_squared = eplus * eplus
static const double electron_mass_c2 = 0.51099906 * MeV
static const double proton_mass_c2 = 938.27231 * MeV
static const double neutron_mass_c2 = 939.56563 * MeV
static const double amu_c2 = 931.49432 * MeV
static const double amu = amu_c2/c_squared
static const double mu0 = 4*pi*1.e-7 * henry/m
static const double epsilon0 = 1./(c_squared*mu0)
static const double elm_coupling = e_squared/(4*pi*epsilon0)
static const double fine_structure_const = elm_coupling/hbarc
static const double classic_electr_radius = elm_coupling/electron_mass_c2
static const double electron_Compton_length = hbarc/electron_mass_c2
static const double Bohr_radius = electron_Compton_length/fine_structure_const
static const double alpha_rcl2
static const double twopi_mc2_rcl2
static const double k_Boltzmann = 8.617385e-11 * MeV/kelvin
static const double STP_Temperature = 273.15*kelvin
static const double STP_Pressure = 1.*atmosphere
static const double kGasThreshold = 10.*mg/cm3
static const double universe_mean_density = 1.e-25*g/cm3
static const double MAXDOUBLE = DBL_MAX
static const double MAXINT = INT_MAX
static const double PI = M_PI
 A pre-defined value of $ \pi $.
static const double TWOPI = 2*M_PI
 A pre-defined value of $ 2\pi $.
static const double HALFPI = M_PI_2
 A pre-defined value of $ \pi/2 $.
static const double millimeter = 1.
static const double millimeter2 = millimeter*millimeter
static const double millimeter3 = millimeter*millimeter*millimeter
static const double centimeter = 10.*millimeter
static const double centimeter2 = centimeter*centimeter
static const double centimeter3 = centimeter*centimeter*centimeter
static const double meter = 1000.*millimeter
static const double meter2 = meter*meter
static const double meter3 = meter*meter*meter
static const double kilometer = 1000.*meter
static const double kilometer2 = kilometer*kilometer
static const double kilometer3 = kilometer*kilometer*kilometer
static const double parsec = 3.0856775807e+16*meter
static const double micrometer = 1.e-6 *meter
static const double nanometer = 1.e-9 *meter
static const double angstrom = 1.e-10*meter
static const double picometer = 1.e-12*meter
static const double femtometer = 1.e-15*meter
static const double attometer = 1.e-18*meter
static const double fermi = femtometer
static const double mm = millimeter
static const double mm2 = millimeter2
static const double mm3 = millimeter3
static const double cm = centimeter
static const double cm2 = centimeter2
static const double cm3 = centimeter3
static const double m = meter
static const double m2 = meter2
static const double m3 = meter3
static const double km = kilometer
static const double km2 = kilometer2
static const double km3 = kilometer3
static const double pc = parsec
static const double picobarn = 1.0
static const double barn = 1.0e+12* picobarn
static const double millibarn = 1.0e-3 * barn
static const double microbarn = 1.0e-6 * barn
static const double nanobarn = 1.0e-9 * barn
static const double femtobarn = 1.0e-15 * barn
static const double attobarn = 1.0e-18 * barn
static const double radian = 1.
static const double milliradian = 1.e-3*radian
static const double degree = (3.14159265358979323846/180.0)*radian
static const double steradian = 1.
static const double rad = radian
static const double mrad = milliradian
static const double sr = steradian
static const double deg = degree
static const double nanosecond = 1.0
static const double second = 1.e+9 *nanosecond
static const double millisecond = 1.e-3 *second
static const double microsecond = 1.e-6 *second
static const double picosecond = 1.e-12*second
static const double hertz = 1.0/second
static const double kilohertz = 1.e+3*hertz
static const double megahertz = 1.e+6*hertz
static const double ns = nanosecond
static const double s = second
static const double ms = millisecond
static const double eplus = 1.0
static const double e_SI = 1.60217733e-19
static const double coulomb = eplus/e_SI
static const double gigaelectronvolt = 1.
static const double electronvolt = 1.e-9*gigaelectronvolt
static const double kiloelectronvolt = 1.e-6*gigaelectronvolt
static const double megaelectronvolt = 1.e-3*gigaelectronvolt
static const double teraelectronvolt = 1.e+3*gigaelectronvolt
static const double petaelectronvolt = 1.e+6*gigaelectronvolt
static const double joule = electronvolt/e_SI
static const double eV = electronvolt
static const double keV = kiloelectronvolt
static const double MeV = megaelectronvolt
static const double GeV = gigaelectronvolt
static const double TeV = teraelectronvolt
static const double PeV = petaelectronvolt
static const double eV2 = eV*eV
static const double keV2 = keV*keV
static const double MeV2 = MeV*MeV
static const double GeV2 = GeV*GeV
static const double TeV2 = TeV*TeV
static const double PeV2 = PeV*PeV
static const double kilogram = joule*second*second/(meter*meter)
static const double gram = 1.e-3*kilogram
static const double milligram = 1.e-3*gram
static const double kg = kilogram
static const double g = gram
static const double mg = milligram
static const double watt = joule/second
static const double newton = joule/meter
static const double hep_pascal = newton/m2
static const double bar = 100000*pascal
static const double atmosphere = 101325*pascal
static const double ampere = coulomb/second
static const double milliampere = 1.e-3*ampere
static const double microampere = 1.e-6*ampere
static const double nanoampere = 1.e-9*ampere
static const double megavolt = megaelectronvolt/eplus
static const double kilovolt = 1.e-3*megavolt
static const double volt = 1.e-6*megavolt
static const double ohm = volt/ampere
static const double farad = coulomb/volt
static const double millifarad = 1.e-3*farad
static const double microfarad = 1.e-6*farad
static const double nanofarad = 1.e-9*farad
static const double picofarad = 1.e-12*farad
static const double weber = volt*second
static const double tesla = volt*second/meter2
static const double gauss = 1.e-4*tesla
static const double kilogauss = 1.e-1*tesla
static const double henry = weber/ampere
static const double kelvin = 1.
static const double mole = 1.
static const double becquerel = 1./second
static const double curie = 3.7e+10 * becquerel
static const double gray = joule/kilogram
static const double candela = 1.
static const double lumen = candela*steradian
static const double lux = lumen/meter2
static const double perCent = 0.01
static const double perThousand = 0.001
static const double perMillion = 0.000001
static constexpr double DBL_NAN = std::numeric_limits<double>::quiet_NaN()
 Convenient const for getting the double NaN value.

Ranges and intervals

enum  RangeBoundary { OPEN = 0, SOFT = 0, CLOSED = 1, HARD = 1 }
template<typename N1 , typename N2 , typename N3 >
std::enable_if
< std::is_arithmetic< N1 >
::value &&std::is_arithmetic
< N2 >::value
&&std::is_arithmetic< N3 >
::value, bool >::type 
inRange (N1 value, N2 low, N3 high, RangeBoundary lowbound=CLOSED, RangeBoundary highbound=OPEN)
 Determine if value is in the range low to high, for floating point numbers.
template<typename N1 , typename N2 , typename N3 >
std::enable_if
< std::is_arithmetic< N1 >
::value &&std::is_arithmetic
< N2 >::value
&&std::is_arithmetic< N3 >
::value, bool >::type 
fuzzyInRange (N1 value, N2 low, N3 high, RangeBoundary lowbound=CLOSED, RangeBoundary highbound=OPEN)
 Determine if value is in the range low to high, for floating point numbers.
template<typename N1 , typename N2 , typename N3 >
std::enable_if
< std::is_arithmetic< N1 >
::value &&std::is_arithmetic
< N2 >::value
&&std::is_arithmetic< N3 >
::value, bool >::type 
inRange (N1 value, pair< N2, N3 > lowhigh, RangeBoundary lowbound=CLOSED, RangeBoundary highbound=OPEN)
 Alternative version of inRange which accepts a pair for the range arguments.
template<typename N1 , typename N2 , typename N3 >
std::enable_if
< std::is_arithmetic< N1 >
::value &&std::is_arithmetic
< N2 >::value
&&std::is_arithmetic< N3 >
::value, bool >::type 
in_range (N1 val, N2 low, N3 high)
 Boolean function to determine if value is within the given range.
template<typename N1 , typename N2 , typename N3 >
std::enable_if
< std::is_arithmetic< N1 >
::value &&std::is_arithmetic
< N2 >::value
&&std::is_arithmetic< N3 >
::value, bool >::type 
in_closed_range (N1 val, N2 low, N3 high)
 Boolean function to determine if value is within the given range.
template<typename N1 , typename N2 , typename N3 >
std::enable_if
< std::is_arithmetic< N1 >
::value &&std::is_arithmetic
< N2 >::value
&&std::is_arithmetic< N3 >
::value, bool >::type 
in_open_range (N1 val, N2 low, N3 high)
 Boolean function to determine if value is within the given range.

Typedef for Jet efficiency functions/functors

typedef function< double(const
Jet &)> 
JetEffFn
double JET_EFF_ZERO (const Jet &p)
 Return a constant 0 given a Jet as argument.
double JET_EFF_ONE (const Jet &p)
 Return a constant 1 given a Jet as argument.
double JET_BTAG_PERFECT (const Jet &j)
 Return 1 if the given Jet contains a b, otherwise 0.
double JET_CTAG_PERFECT (const Jet &j)
 Return 1 if the given Jet contains a c, otherwise 0.
Jet JET_SMEAR_IDENTITY (const Jet &j)
Jet JET_SMEAR_PERFECT (const Jet &j)
 Alias for JET_SMEAR_IDENTITY.
template<typename FN >
bool efffilt (const Jet &j, FN &feff)
 Return true if Jet j is chosen to survive a random efficiency selection.

Typedef for FourMomentum efficiency functions/functors

typedef std::function< double(const
FourMomentum &)> 
P4EffFn
double P4_EFF_ZERO (const FourMomentum &)
 Take a FourMomentum and return 0.
double P4_FN0 (const FourMomentum &)
double P4_EFF_ONE (const FourMomentum &)
 Take a FourMomentum and return 1.
double P4_FN1 (const FourMomentum &)
FourMomentum P4_SMEAR_IDENTITY (const FourMomentum &p)
 Take a FourMomentum and return it unmodified.
FourMomentum P4_SMEAR_PERFECT (const FourMomentum &p)
 Alias for P4_SMEAR_IDENTITY.
FourMomentum P4_SMEAR_E_GAUSS (const FourMomentum &p, double resolution)
FourMomentum P4_SMEAR_PT_GAUSS (const FourMomentum &p, double resolution)
 Smear a FourMomentum's transverse momentum using a Gaussian of absolute width resolution.
FourMomentum P4_SMEAR_MASS_GAUSS (const FourMomentum &p, double resolution)
 Smear a FourMomentum's mass using a Gaussian of absolute width resolution.

Typedef for Particle efficiency functions/functors

typedef function< double(const
Particle &)> 
ParticleEffFn
double PARTICLE_EFF_ZERO (const Particle &)
 Take a Particle and return 0.
double PARTICLE_EFF_0 (const Particle &)
 Alias for PARTICLE_EFF_ZERO.
double PARTICLE_FN0 (const Particle &)
 Alias for PARTICLE_EFF_ZERO.
double PARTICLE_EFF_ONE (const Particle &)
 Take a Particle and return 1.
double PARTICLE_EFF_1 (const Particle &)
 Alias for PARTICLE_EFF_ONE.
double PARTICLE_EFF_PERFECT (const Particle &)
 Alias for PARTICLE_EFF_ONE.
double PARTICLE_FN1 (const Particle &)
 Alias for PARTICLE_EFF_ONE.
Particle PARTICLE_SMEAR_IDENTITY (const Particle &p)
 Take a Particle and return it unmodified.
Particle PARTICLE_SMEAR_PERFECT (const Particle &p)
 Alias for PARTICLE_SMEAR_IDENTITY.
bool efffilt (const Particle &p, const ParticleEffFn &feff)
 Return true if Particle p is chosen to survive a random efficiency selection.

Detailed Description

Todo:
Is there a reason that this stuff can't go into Projection.hh?

Typedef Documentation

typedef std::shared_ptr<Analysis> AnaHandle

Definition at line 14 of file AnalysisHandler.hh.

typedef std::shared_ptr<YODA::AnalysisObject> AnalysisObjectPtr

Definition at line 17 of file RivetYODA.hh.

Definition at line 14 of file Projection.fhh.

typedef std::shared_ptr<YODA::Counter> CounterPtr

Definition at line 18 of file RivetYODA.hh.

typedef std::shared_ptr<CutBase> Cut

Main cut object.

Definition at line 14 of file Cuts.fhh.

typedef Error Exception

Rivet::Exception is a synonym for Rivet::Error.

Definition at line 18 of file Exceptions.hh.

typedef std::vector<FourMomentum> FourMomenta

Definition at line 1543 of file Vector4.hh.

typedef std::vector<FourVector> FourVectors

Definition at line 1542 of file Vector4.hh.

typedef std::shared_ptr<YODA::Histo1D> Histo1DPtr

Definition at line 19 of file RivetYODA.hh.

typedef std::shared_ptr<YODA::Histo2D> Histo2DPtr

Definition at line 20 of file RivetYODA.hh.

typedef function<double(const Jet&)> JetEffFn

Definition at line 20 of file JetSmearingFunctions.hh.

typedef std::vector<Jet> Jets

Definition at line 16 of file Jet.fhh.

typedef function<Jet(const Jet&)> JetSmearFn

Definition at line 17 of file JetSmearingFunctions.hh.

typedef Matrix<4> Matrix4

Definition at line 14 of file MatrixN.hh.

typedef FourMomentum P4

Definition at line 1537 of file Vector4.hh.

typedef std::vector<P4> P4a

Definition at line 1545 of file Vector4.hh.

typedef std::function<double(const FourMomentum&)> P4EffFn

Definition at line 18 of file MomentumSmearingFunctions.hh.

typedef std::function<FourMomentum(const FourMomentum&)> P4SmearFn

Definition at line 15 of file MomentumSmearingFunctions.hh.

typedef function<double(const Particle&)> ParticleEffFn

Definition at line 19 of file ParticleSmearingFunctions.hh.

typedef std::pair<Particle, Particle> ParticlePair

Typedef for a pair of Particle objects.

Definition at line 35 of file Particle.fhh.

typedef std::vector<Particle> Particles

Definition at line 15 of file Particle.fhh.

typedef function<Particle(const Particle&)> ParticleSmearFn

Definition at line 16 of file ParticleSmearingFunctions.hh.

Deprecated:
Old name: use Particles instead. Will be removed

Definition at line 32 of file Particle.fhh.

typedef Cmp<Projection> PCmp

Typedef for Cmp<Projection>

Definition at line 291 of file Cmp.hh.

typedef int PdgId

Typedefs for a PDG ID code.

Definition at line 56 of file Particle.fhh.

typedef std::pair<PdgId, PdgId> PdgIdPair

Typedef for a pair of particle names.

Definition at line 60 of file Particle.fhh.

typedef std::shared_ptr<YODA::Profile1D> Profile1DPtr

Definition at line 21 of file RivetYODA.hh.

typedef std::shared_ptr<YODA::Profile2D> Profile2DPtr

Definition at line 22 of file RivetYODA.hh.

Definition at line 12 of file Projection.fhh.

typedef std::shared_ptr<const Projection> ProjHandle

Typedef for Projection (smart) pointer.

Definition at line 12 of file ProjectionHandler.hh.

typedef std::vector<PseudoJet> PseudoJets

Typedef for a collection of PseudoJet objects.

Todo:
Make into an explicit container with conversion to Jets and FourMomenta?

Definition at line 21 of file RivetFastJet.hh.

typedef std::shared_ptr<YODA::Scatter1D> Scatter1DPtr

Definition at line 23 of file RivetYODA.hh.

typedef std::shared_ptr<YODA::Scatter2D> Scatter2DPtr

Definition at line 24 of file RivetYODA.hh.

typedef std::shared_ptr<YODA::Scatter3D> Scatter3DPtr

Definition at line 25 of file RivetYODA.hh.

Definition at line 11 of file Vector3.hh.

Definition at line 14 of file Vector4.hh.

typedef Vector3 X3

Definition at line 375 of file Vector3.hh.

typedef FourVector X4

Definition at line 1536 of file Vector4.hh.

typedef std::vector<X4> X4s

Definition at line 1544 of file Vector4.hh.


Enumeration Type Documentation

enum CmpState

Enumerate the possible states of a Cmp object.

Enumerator:
UNDEFINED 

Undefined state.

ASC 

The two objects are ordered (in ascending order).

ORDERED 

The two objects are ordered (in ascending order).

EQUAL 

The two objects are equivalent.

EQUIVALENT 

The two objects are equivalent.

DESC 

The two objects are anti-ordered (in descending order).

ANTIORDERED 

The two objects are anti-ordered (in descending order).

UNORDERED 

The two objects are anti-ordered (in descending order). // DEPRECATED!

UNEQUAL 

The two objects are unequal, without ordering implications.

INEQUIVALENT 

The two objects are unequal, without ordering implications.

Definition at line 14 of file Cmp.fhh.

                {
    UNDEFINED = -2,   ///< Undefined state.
    ASC = -1,         ///< The two objects are ordered (in ascending order).
    ORDERED = -1,     ///< The two objects are ordered (in ascending order).
    EQUAL = 0,        ///< The two objects are equivalent.
    EQUIVALENT = 0,   ///< The two objects are equivalent.
    DESC = 1,         ///< The two objects are anti-ordered (in descending order).
    ANTIORDERED = 1,  ///< The two objects are anti-ordered (in descending order).
    UNORDERED = 1,    ///< The two objects are anti-ordered (in descending order). // DEPRECATED!
    UNEQUAL = 2,      ///< The two objects are unequal, without ordering implications.
    INEQUIVALENT = 2, ///< The two objects are unequal, without ordering implications.
  };
enum PhiMapping

Enum for range of $ \phi $ to be mapped into.

Enumerator:
MINUSPI_PLUSPI 
ZERO_2PI 
ZERO_PI 

Definition at line 31 of file MathHeader.hh.

Represents whether an interval is open (non-inclusive) or closed (inclusive).

For example, the interval $ [0, \pi) $ is closed (an inclusive boundary) at 0, and open (a non-inclusive boundary) at $ \pi $.

Enumerator:
OPEN 
SOFT 
CLOSED 
HARD 

Definition at line 95 of file MathUtils.hh.

{ OPEN=0, SOFT=0, CLOSED=1, HARD=1 };
enum RapScheme

Enum for rapidity variable to be used in calculating $ R $, applying rapidity cuts, etc.

Enumerator:
PSEUDORAPIDITY 
ETARAP 
RAPIDITY 
YRAP 

Definition at line 28 of file MathHeader.hh.

{ PSEUDORAPIDITY = 0, ETARAP = 0, RAPIDITY = 1, YRAP = 1 };
enum Sign

Enum for signs of numbers.

Enumerator:
MINUS 
ZERO 
PLUS 

Definition at line 25 of file MathHeader.hh.

{ MINUS = -1, ZERO = 0, PLUS = 1 };

Function Documentation

std::enable_if<std::is_arithmetic<NUM>::value && std::is_arithmetic<typename CONTAINER::value_type>::value, int>::type Rivet::_binIndex ( NUM  val,
const CONTAINER &  binedges,
bool  allow_overflow = false 
) [inline]

Actual helper implementation of binIndex (so generic and specific overloading can work)

< Below/out of histo range

< Above/out of histo range

Definition at line 338 of file MathUtils.hh.

                                                                           {
    if (val < *begin(binedges)) return -1; ///< Below/out of histo range
    // CONTAINER::iterator_type itend =
    if (val >= *(end(binedges)-1)) return allow_overflow ? int(binedges.size())-1 : -1; ///< Above/out of histo range
    auto it = std::upper_bound(begin(binedges), end(binedges), val);
    return std::distance(begin(binedges), --it);
  }
double Rivet::_mapAngleM2PITo2Pi ( double  angle) [inline]

Reduce any number to the range [-2PI, 2PI].

Achieved by repeated addition or subtraction of 2PI as required. Used to normalise angular measures.

Definition at line 511 of file MathUtils.hh.

                                                 {
    double rtn = fmod(angle, TWOPI);
    if (isZero(rtn)) return 0;
    assert(rtn >= -TWOPI && rtn <= TWOPI);
    return rtn;
  }
int Rivet::abspid ( const Particle &  p) [inline]

Unbound function access to abs PID code.

Definition at line 23 of file ParticleUtils.hh.

{ return p.abspid(); }
T Rivet::accumulate ( const C1 &  in,
const T &  init,
const FN &  f 
) [inline]

A single-container-arg version of std::accumulate, aka reduce.

Definition at line 338 of file Utils.hh.

                                                                {
    const T rtn = std::accumulate(in.begin(), in.end(), init, f);
    return rtn;
  }
Vector3 Rivet::acmsBetaVec ( const FourMomentum &  pa,
const FourMomentum &  pb 
)

Get the Lorentz boost to the per-nucleon beam centre-of-mass system (ACMS) from a pair of beam momenta

Note:
Uses a nominal nucleon mass of 0.939 GeV to convert masses to A
Vector3 Rivet::acmsBetaVec ( const ParticlePair &  beams)

Get the Lorentz boost to the per-nucleon beam centre-of-mass system (ACMS) from a pair of Particles

Note:
Uses the sum of nuclear mass numbers A for each beam
FourMomentum Rivet::acmsBoostVec ( const FourMomentum &  pa,
const FourMomentum &  pb 
)

Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of beam momenta.

FourMomentum Rivet::acmsBoostVec ( const ParticlePair &  beams)

Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of Particles.

Vector3 Rivet::acmsGammaVec ( const FourMomentum &  pa,
const FourMomentum &  pb 
)

Get the Lorentz boost to the per-nucleon beam centre-of-mass system (ACMS) from a pair of beam momenta

Note:
Uses a nominal nucleon mass of 0.939 GeV to convert masses to A
Vector3 Rivet::acmsGammaVec ( const ParticlePair &  beams)

Get the Lorentz boost to the per-nucleon beam centre-of-mass system (ACMS) from a pair of Particles

Note:
Uses the sum of nuclear mass numbers A for each beam
LorentzTransform Rivet::acmsTransform ( const FourMomentum &  pa,
const FourMomentum &  pb 
)

Get the Lorentz transformation to the per-nucleon beam centre-of-mass system (CMS) from a pair of beam momenta

Note:
Uses a nominal nucleon mass of 0.939 GeV to convert masses to A
LorentzTransform Rivet::acmsTransform ( const ParticlePair &  beams)

Get the Lorentz transformation to the per-nucleon beam centre-of-mass system (CMS) from a pair of Particles

Note:
Uses the sum of nuclear mass numbers A for each beam
Vector3 add ( const Vector3 &  a,
const Vector3 &  b 
) [inline]

Definition at line 263 of file Vector3.hh.

                                                         {
    Vector3 result;
    result._vec = a._vec + b._vec;
    return result;
  }
FourVector Rivet::add ( const FourVector &  a,
const FourVector &  b 
) [inline]

Definition at line 261 of file Vector4.hh.

                                                                  {
    FourVector result;
    result._vec = a._vec + b._vec;
    return result;
  }
Matrix<N> Rivet::add ( const Matrix< N > &  a,
const Matrix< N > &  b 
) [inline]

Definition at line 264 of file MatrixN.hh.

                                                               {
    Matrix<N> result;
    result._matrix = a._matrix + b._matrix;
    return result;
  }
FourMomentum Rivet::add ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Definition at line 844 of file Vector4.hh.

                                                                        {
    FourMomentum result;
    result._vec = a._vec + b._vec;
    return result;
  }
std::enable_if<std::is_arithmetic<NUM>::value, NUM>::type Rivet::add_quad ( NUM  a,
NUM  b 
) [inline]

Named number-type addition in quadrature operation.

Note:
Result has the sqrt operation applied.
Todo:
When std::common_type can be used, generalise to multiple numeric types with appropriate return type.

Definition at line 201 of file MathUtils.hh.

                         {
    return sqrt(a*a + b*b);
  }
std::enable_if<std::is_arithmetic<NUM>::value, NUM>::type Rivet::add_quad ( NUM  a,
NUM  b,
NUM  c 
) [inline]

Named number-type addition in quadrature operation.

Note:
Result has the sqrt operation applied.
Todo:
When std::common_type can be used, generalise to multiple numeric types with appropriate return type.

Definition at line 213 of file MathUtils.hh.

                                {
    return sqrt(a*a + b*b + c*c);
  }
void Rivet::addAnalysisDataPath ( const std::string &  extrapath)

Add a Rivet data file search path.

void Rivet::addAnalysisLibPath ( const std::string &  extrapath)

Add a Rivet analysis plugin library search path.

bool Rivet::all ( const CONTAINER &  c) [inline]

Return true if x is true for all x in container c, otherwise false.

Definition at line 301 of file Utils.hh.

                                      {
    // return std::all_of(std::begin(c), std::end(c), [](const auto& x){return bool(x);});
    for (const auto& x : c) if (!bool(x)) return false;
    return true;
  }
bool Rivet::all ( const CONTAINER &  c,
const FN &  f 
) [inline]

Return true if f(x) is true for all x in container c, otherwise false.

Definition at line 309 of file Utils.hh.

                                                   {
    return std::all_of(std::begin(c), std::end(c), f);
  }
double Rivet::angle ( const FourVector &  a,
const FourVector &  b 
) [inline]

Angle (in radians) between spatial parts of two Lorentz vectors.

Definition at line 282 of file Vector4.hh.

                                                                {
    return a.angle(b);
  }
double Rivet::angle ( const Vector3 &  a,
const Vector3 &  b 
) [inline]

Angle (in radians) between two 3-vectors.

Definition at line 286 of file Vector3.hh.

                                                          {
    return a.angle(b);
  }
double Rivet::angle ( const Vector3 &  a,
const FourVector &  b 
) [inline]

Angle (in radians) between spatial parts of two Lorentz vectors.

Definition at line 287 of file Vector4.hh.

                                                             {
    return angle( a, b.vector3() );
  }
double Rivet::angle ( const FourVector &  a,
const Vector3 &  b 
) [inline]

Angle (in radians) between spatial parts of two Lorentz vectors.

Definition at line 292 of file Vector4.hh.

                                                             {
    return a.angle(b);
  }
bool Rivet::any ( const CONTAINER &  c) [inline]

Return true if x is true for any x in container c, otherwise false.

Definition at line 287 of file Utils.hh.

                                      {
    // return std::any_of(std::begin(c), std::end(c), [](const auto& x){return bool(x);});
    for (const auto& x : c) if (bool(x)) return true;
    return false;
  }
bool Rivet::any ( const CONTAINER &  c,
const FN &  f 
) [inline]

Return true if f(x) is true for any x in container c, otherwise false.

Definition at line 295 of file Utils.hh.

                                                   {
    return std::any_of(std::begin(c), std::end(c), f);
  }
double Rivet::asqrtS ( const FourMomentum &  pa,
const FourMomentum &  pb 
)

Get per-nucleon beam centre-of-mass energy from a pair of beam momenta

Note:
Uses a nominal nucleon mass of 0.939 GeV to convert masses to A
double Rivet::asqrtS ( const ParticlePair &  beams)

Get per-nucleon beam centre-of-mass energy from a pair of Particles

Note:
Uses the sum of nuclear mass numbers A for each beam
double Rivet::asqrtS ( const Event &  e) [inline]

Get per-nucleon beam centre-of-mass energy from an Event

Note:
Uses the sum of nuclear mass numbers A for each beam

Definition at line 50 of file Beam.hh.

{ return asqrtS(beams(e)); }
string Rivet::basename ( const string &  p) [inline]

Get the basename (i.e. terminal file name) from a path p.

Definition at line 241 of file Utils.hh.

                                          {
    if (!contains(p, "/")) return p;
    return p.substr(p.rfind("/")+1);
  }
PdgIdPair Rivet::beamIds ( const ParticlePair &  beams) [inline]

Get beam particle IDs from a pair of Particles

Deprecated:
Use pids(beams)

Definition at line 21 of file Beam.hh.

{ return pids(beams); }
PdgIdPair Rivet::beamIds ( const Event &  e) [inline]

Get beam particle IDs from an event

Deprecated:
Use pids(e.beams())

Definition at line 25 of file Beam.hh.

{ return pids(beams(e)); }
ParticlePair Rivet::beams ( const Event &  e)

Get beam particles from an event.

std::enable_if<std::is_arithmetic<NUM1>::value && std::is_arithmetic<NUM2>::value, int>::type Rivet::binIndex ( NUM1  val,
std::initializer_list< NUM2 >  binedges,
bool  allow_overflow = false 
) [inline]

Return the bin index of the given value, val, given a vector of bin edges.

An underflow always returns -1. If allow_overflow is false (default) an overflow also returns -1, otherwise it returns the Nedge-1, the index of an inclusive bin starting at the last edge.

Note:
The binedges vector must be sorted
Todo:
Use std::common_type<NUM1, NUM2>::type x = val; ?

Definition at line 356 of file MathUtils.hh.

                                                                                    {
    return _binIndex(val, binedges, allow_overflow);
  }
std::enable_if<std::is_arithmetic<NUM>::value && std::is_arithmetic<typename CONTAINER::value_type>::value, int>::type Rivet::binIndex ( NUM  val,
const CONTAINER &  binedges,
bool  allow_overflow = false 
) [inline]

Return the bin index of the given value, val, given a vector of bin edges.

An underflow always returns -1. If allow_overflow is false (default) an overflow also returns -1, otherwise it returns the Nedge-1, the index of an inclusive bin starting at the last edge.

Note:
The binedges vector must be sorted
Todo:
Use std::common_type<NUM1, NUM2>::type x = val; ?

Definition at line 370 of file MathUtils.hh.

                                                                          {
    return _binIndex(val, binedges, allow_overflow);
  }
vector<double> Rivet::bwspace ( size_t  nbins,
double  start,
double  end,
double  mu,
double  gamma 
) [inline]

Make a list of nbins + 1 values spaced for equal area Breit-Wigner binning between start and end inclusive. mu and gamma are the Breit-Wigner parameters.

Todo:
geomspace
Note:
The arg ordering and the meaning of the nbins variable is "histogram-like", as opposed to the Numpy/Matlab version, and the start and end arguments are expressed in "normal" space.

Definition at line 319 of file MathUtils.hh.

                                                                                                 {
    assert(end >= start);
    assert(nbins > 0);
    const double pmin = cdfBW(start, mu, gamma);
    const double pmax = cdfBW(end,   mu, gamma);
    const vector<double> edges = linspace(nbins, pmin, pmax);
    assert(edges.size() == nbins+1);
    vector<double> rtn;
    for (double edge : edges) {
      rtn.push_back(invcdfBW(edge, mu, gamma));
    }
    assert(rtn.size() == nbins+1);
    return rtn;
  }
double Rivet::cdfBW ( double  x,
double  mu,
double  gamma 
) [inline]

CDF for the Breit-Wigner distribution.

Definition at line 249 of file MathUtils.hh.

                                                         {
    // normalize to (0;1) distribution
    const double xn = (x - mu)/gamma;
    return std::atan(xn)/M_PI + 0.5;
  }
Cmp<T> Rivet::cmp ( const T &  t1,
const T &  t2 
) [inline]

Global helper function for easy creation of Cmp objects.

Definition at line 285 of file Cmp.hh.

                                              {
    return Cmp<T>(t1, t2);
  }
bool Rivet::cmpMomByAbsEta ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by increasing absolute eta (pseudorapidity)

Definition at line 1397 of file Vector4.hh.

                                                                           {
    return fabs(a.eta()) < fabs(b.eta());
  }
bool Rivet::cmpMomByAbsRap ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by increasing absolute rapidity.

Definition at line 1417 of file Vector4.hh.

                                                                           {
    return fabs(a.rapidity()) < fabs(b.rapidity());
  }
bool Rivet::cmpMomByAscE ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by increasing energy.

Definition at line 1373 of file Vector4.hh.

                                                                         {
    return a.E() < b.E();
  }
bool Rivet::cmpMomByAscEt ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by increasing transverse energy.

Definition at line 1364 of file Vector4.hh.

                                                                          {
    return a.Et() < b.Et();
  }
bool Rivet::cmpMomByAscMass ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by increasing mass.

Definition at line 1382 of file Vector4.hh.

                                                                            {
    return a.mass() < b.mass();
  }
bool Rivet::cmpMomByAscP ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by increasing 3-momentum magnitude |p|.

Definition at line 1355 of file Vector4.hh.

                                                                         {
    return a.vector3().mod() < b.vector3().mod();
  }
bool Rivet::cmpMomByAscPt ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by increasing pT.

Definition at line 1346 of file Vector4.hh.

                                                                          {
    return a.pt() < b.pt();
  }
bool Rivet::cmpMomByDescAbsEta ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by increasing absolute eta (pseudorapidity)

Definition at line 1402 of file Vector4.hh.

                                                                               {
    return fabs(a.eta()) > fabs(b.eta());
  }
bool Rivet::cmpMomByDescAbsRap ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by decreasing absolute rapidity.

Definition at line 1422 of file Vector4.hh.

                                                                               {
    return fabs(a.rapidity()) > fabs(b.rapidity());
  }
bool Rivet::cmpMomByDescEta ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by decreasing eta (pseudorapidity)

Definition at line 1392 of file Vector4.hh.

                                                                            {
    return a.pseudorapidity() > b.pseudorapidity();
  }
bool Rivet::cmpMomByDescRap ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by decreasing rapidity.

Definition at line 1412 of file Vector4.hh.

                                                                            {
    return a.rapidity() > b.rapidity();
  }
bool Rivet::cmpMomByE ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by decreasing energy.

Definition at line 1369 of file Vector4.hh.

                                                                      {
    return a.E() > b.E();
  }
bool Rivet::cmpMomByEt ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by decreasing transverse energy.

Definition at line 1360 of file Vector4.hh.

                                                                       {
    return a.Et() > b.Et();
  }
bool Rivet::cmpMomByEta ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by increasing eta (pseudorapidity)

Definition at line 1387 of file Vector4.hh.

                                                                        {
    return a.eta() < b.eta();
  }
bool Rivet::cmpMomByMass ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by decreasing mass.

Definition at line 1378 of file Vector4.hh.

                                                                         {
    return a.mass() > b.mass();
  }
bool Rivet::cmpMomByP ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by decreasing 3-momentum magnitude |p|.

Definition at line 1351 of file Vector4.hh.

                                                                      {
    return a.vector3().mod() > b.vector3().mod();
  }
bool Rivet::cmpMomByPt ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by decreasing pT.

Definition at line 1342 of file Vector4.hh.

                                                                       {
    return a.pt() > b.pt();
  }
bool Rivet::cmpMomByRap ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Comparison to give a sorting by increasing rapidity.

Definition at line 1407 of file Vector4.hh.

                                                                        {
    return a.rapidity() < b.rapidity();
  }
Vector3 Rivet::cmsBetaVec ( const FourMomentum &  pa,
const FourMomentum &  pb 
)

Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of beam momenta.

Vector3 Rivet::cmsBetaVec ( const ParticlePair &  beams) [inline]

Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of Particles.

Definition at line 74 of file Beam.hh.

                                                       {
    return cmsBetaVec(beams.first, beams.second);
  }
FourMomentum Rivet::cmsBoostVec ( const FourMomentum &  pa,
const FourMomentum &  pb 
) [inline]

Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of beam momenta.

Definition at line 54 of file Beam.hh.

                                                                                  {
    return pa + pb;
  }
FourMomentum Rivet::cmsBoostVec ( const ParticlePair &  beams) [inline]

Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of Particles.

Definition at line 59 of file Beam.hh.

                                                             {
    return cmsBoostVec(beams.first, beams.second);
  }
Vector3 Rivet::cmsGammaVec ( const FourMomentum &  pa,
const FourMomentum &  pb 
)

Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of beam momenta.

Vector3 Rivet::cmsGammaVec ( const ParticlePair &  beams) [inline]

Get the Lorentz boost to the beam centre-of-mass system (CMS) from a pair of Particles.

Definition at line 92 of file Beam.hh.

                                                        {
    return cmsGammaVec(beams.first, beams.second);
  }
LorentzTransform Rivet::cmsTransform ( const FourMomentum &  pa,
const FourMomentum &  pb 
)

Get the Lorentz transformation to the beam centre-of-mass system (CMS) from a pair of beam momenta.

LorentzTransform Rivet::cmsTransform ( const ParticlePair &  beams) [inline]

Get the Lorentz transformation to the beam centre-of-mass system (CMS) from a pair of Particles.

Definition at line 110 of file Beam.hh.

                                                                  {
    return cmsTransform(beams.first, beams.second);
  }
LorentzTransform Rivet::combine ( const LorentzTransform &  a,
const LorentzTransform &  b 
) [inline]

Definition at line 266 of file LorentzTrans.hh.

                                                                                        {
    return a.combine(b);
  }
bool Rivet::compatible ( PdgId  p,
PdgId  allowed 
) [inline]

Find whether ParticleName p is compatible with the template ParticleName allowed. Effectively this is asking whether p is a subset of allowed.

Definition at line 13 of file BeamConstraint.hh.

                                                 {
    return (allowed == PID::ANY || p == allowed);
  }
bool Rivet::compatible ( const PdgIdPair &  pair,
const PdgIdPair &  allowedpair 
) [inline]

Find whether PdgIdPair pair is compatible with the template PdgIdPair allowedpair. This assesses whether either of the two possible pairings of pair's constituents is compatible.

Definition at line 20 of file BeamConstraint.hh.

                                                                              {
    bool oneToOne = compatible(pair.first, allowedpair.first);
    bool twoToTwo = compatible(pair.second, allowedpair.second);
    bool oneToTwo = compatible(pair.first, allowedpair.second);
    bool twoToOne = compatible(pair.second, allowedpair.first);
    return (oneToOne && twoToTwo) || (oneToTwo && twoToOne);
  }
bool Rivet::compatible ( const ParticlePair &  ppair,
const PdgIdPair &  allowedpair 
) [inline]

Check particle compatibility of Particle pairs.

Definition at line 30 of file BeamConstraint.hh.

                                                       {
    return compatible(PID::make_pdgid_pair(ppair.first.pid(),
                                           ppair.second.pid()), allowedpair);
  }
bool Rivet::compatible ( const PdgIdPair &  allowedpair,
const ParticlePair &  ppair 
) [inline]

Check particle compatibility of Particle pairs (for symmetric completeness)

Definition at line 36 of file BeamConstraint.hh.

                                                    {
    return compatible(ppair, allowedpair);
  }
bool Rivet::compatible ( const PdgIdPair &  pair,
const set< PdgIdPair > &  allowedpairs 
) [inline]

Find whether a PdgIdPair pair is compatible with at least one template beam pair in a set allowedpairs.

Definition at line 44 of file BeamConstraint.hh.

                                                                                    {
    for (set<PdgIdPair>::const_iterator bp = allowedpairs.begin(); bp != allowedpairs.end(); ++bp) {
      if (compatible(pair, *bp)) return true;
    }
    return false;
  }
bool Rivet::contains ( const std::string &  s,
const std::string &  sub 
) [inline]

Does s contain sub as a substring?

Todo:
Use SFINAE, Boost.Range, or other template trickery for more generic container matching?

Definition at line 76 of file RivetSTL.hh.

                                                                 {
    return s.find(sub) != string::npos;
  }
bool Rivet::contains ( const std::initializer_list< T > &  il,
const T &  x 
) [inline]

Does the init list il contain x?

Definition at line 82 of file RivetSTL.hh.

                                                                     {
    return find(begin(il), end(il), x) != end(il);
  }
bool Rivet::contains ( const std::vector< T > &  v,
const T &  x 
) [inline]

Does the vector v contain x?

Definition at line 88 of file RivetSTL.hh.

                                                          {
    return find(begin(v), end(v), x) != end(v);
  }
bool Rivet::contains ( const std::list< T > &  l,
const T &  x 
) [inline]

Does the list l contain x?

Definition at line 94 of file RivetSTL.hh.

                                                        {
    return find(begin(l), end(l), x) != end(l);
  }
bool Rivet::contains ( const std::set< T > &  s,
const T &  x 
) [inline]

Does the set s contain x?

Definition at line 100 of file RivetSTL.hh.

                                                       {
    return find(begin(s), end(s), x) != end(s);
  }
double Rivet::contract ( const FourVector &  a,
const FourVector &  b 
) [inline]

Contract two 4-vectors, with metric signature (+ - - -).

Definition at line 230 of file Vector4.hh.

                                                                   {
    return a.contract(b);
  }
std::enable_if<std::is_arithmetic<NUM>::value, double>::type Rivet::correlation ( const vector< NUM > &  sample1,
const vector< NUM > &  sample2 
) [inline]

Calculate the correlation strength between two samples

Todo:
Support multiple container types via SFINAE

Definition at line 467 of file MathUtils.hh.

                                                                      {
    const double cov = covariance(sample1, sample2);
    const double var1 = covariance(sample1, sample1);
    const double var2 = covariance(sample2, sample2);
    const double correlation = cov/sqrt(var1*var2);
    const double corr_strength = correlation*sqrt(var2/var1);
    return corr_strength;
  }
std::enable_if<std::is_arithmetic<NUM>::value, double>::type Rivet::correlation_err ( const vector< NUM > &  sample1,
const vector< NUM > &  sample2 
) [inline]

Calculate the error of the correlation strength between two samples assuming Poissonian errors

Todo:
Support multiple container types via SFINAE

Definition at line 480 of file MathUtils.hh.

                                                                          {
    const double cov = covariance(sample1, sample2);
    const double var1 = covariance(sample1, sample1);
    const double var2 = covariance(sample2, sample2);
    const double cov_e = covariance_err(sample1, sample2);
    const double var1_e = covariance_err(sample1, sample1);
    const double var2_e = covariance_err(sample2, sample2);

    // Calculate the correlation
    const double correlation = cov/sqrt(var1*var2);
    // Calculate the error on the correlation
    const double correlation_err = cov_e/sqrt(var1*var2) -
      cov/(2*pow(3./2., var1*var2)) * (var1_e * var2 + var1 * var2_e);

    // Calculate the error on the correlation strength
    const double corr_strength_err = correlation_err*sqrt(var2/var1) +
      correlation/(2*sqrt(var2/var1)) * (var2_e/var1 - var2*var1_e/pow(2, var2));

    return corr_strength_err;
  }
unsigned int Rivet::count ( const CONTAINER &  c) [inline]

Return number of true elements in the container c .

Definition at line 272 of file Utils.hh.

                                                {
    // return std::count_if(std::begin(c), std::end(c), [](const typename CONTAINER::value_type& x){return bool(x);});
    unsigned int rtn = 0;
    for (const auto& x : c) if (bool(x)) rtn += 1;
    return rtn;
  }
unsigned int Rivet::count ( const CONTAINER &  c,
const FN &  f 
) [inline]

Return number of elements in the container c for which f(x) is true.

Definition at line 281 of file Utils.hh.

                                                             {
    return std::count_if(std::begin(c), std::end(c), f);
  }
std::enable_if<std::is_arithmetic<NUM>::value, double>::type Rivet::covariance ( const vector< NUM > &  sample1,
const vector< NUM > &  sample2 
) [inline]

Calculate the covariance (variance) between two samples

Todo:
Support multiple container types via SFINAE

Definition at line 425 of file MathUtils.hh.

                                                                     {
    if (sample1.empty() || sample2.empty()) throw RangeError("Can't compute covariance of an empty set");
    if (sample1.size() != sample2.size()) throw RangeError("Sizes of samples must be equal for covariance calculation");
    const double mean1 = mean(sample1);
    const double mean2 = mean(sample2);
    const size_t N = sample1.size();
    double cov = 0.0;
    for (size_t i = 0; i < N; i++) {
      const double cov_i = (sample1[i] - mean1)*(sample2[i] - mean2);
      cov += cov_i;
    }
    if (N > 1) return cov/(N-1);
    else return 0.0;
  }
std::enable_if<std::is_arithmetic<NUM>::value, double>::type Rivet::covariance_err ( const vector< NUM > &  sample1,
const vector< NUM > &  sample2 
) [inline]

Calculate the error on the covariance (variance) of two samples, assuming poissonian errors

Todo:
Support multiple container types via SFINAE

Definition at line 444 of file MathUtils.hh.

                                                                         {
    if (sample1.empty() || sample2.empty()) throw RangeError("Can't compute covariance_err of an empty set");
    if (sample1.size() != sample2.size()) throw RangeError("Sizes of samples must be equal for covariance_err calculation");
    const double mean1 = mean(sample1);
    const double mean2 = mean(sample2);
    const double mean1_e = mean_err(sample1);
    const double mean2_e = mean_err(sample2);
    const size_t N = sample1.size();
    double cov_e = 0.0;
    for (size_t i = 0; i < N; i++) {
      const double cov_i = (sqrt(sample1[i]) - mean1_e)*(sample2[i] - mean2) +
        (sample1[i] - mean1)*(sqrt(sample2[i]) - mean2_e);
      cov_e += cov_i;
    }
    if (N > 1) return cov_e/(N-1);
    else return 0.0;
  }
Vector3 Rivet::cross ( const Vector3 &  a,
const Vector3 &  b 
) [inline]

Definition at line 237 of file Vector3.hh.

                                                           {
    return a.cross(b);
  }
double Rivet::deltaEta ( const ParticleBase &  p1,
const ParticleBase &  p2 
) [inline]

Definition at line 232 of file ParticleBase.hh.

                                                                         {
    return deltaEta(p1.momentum(), p2.momentum());
  }
double Rivet::deltaEta ( const ParticleBase &  p,
const FourMomentum &  v 
) [inline]

Definition at line 236 of file ParticleBase.hh.

                                                                       {
    return deltaEta(p.momentum(), v);
  }
double Rivet::deltaEta ( const ParticleBase &  p,
const FourVector &  v 
) [inline]

Definition at line 240 of file ParticleBase.hh.

                                                                     {
    return deltaEta(p.momentum(), v);
  }
double Rivet::deltaEta ( const ParticleBase &  p,
const Vector3 &  v 
) [inline]

Definition at line 244 of file ParticleBase.hh.

                                                                  {
    return deltaEta(p.momentum(), v);
  }
double Rivet::deltaEta ( const ParticleBase &  p,
double  eta 
) [inline]

Definition at line 248 of file ParticleBase.hh.

                                                            {
    return deltaEta(p.momentum(), eta);
  }
double Rivet::deltaEta ( const FourMomentum &  v,
const ParticleBase &  p 
) [inline]

Definition at line 252 of file ParticleBase.hh.

                                                                       {
    return deltaEta(v, p.momentum());
  }
double Rivet::deltaEta ( const FourVector &  v,
const ParticleBase &  p 
) [inline]

Definition at line 256 of file ParticleBase.hh.

                                                                     {
    return deltaEta(v, p.momentum());
  }
double Rivet::deltaEta ( const Vector3 &  v,
const ParticleBase &  p 
) [inline]

Definition at line 260 of file ParticleBase.hh.

                                                                  {
    return deltaEta(v, p.momentum());
  }
double Rivet::deltaEta ( double  eta,
const ParticleBase &  p 
) [inline]

Definition at line 264 of file ParticleBase.hh.

                                                            {
    return deltaEta(eta, p.momentum());
  }
double Rivet::deltaEta ( const Vector3 &  a,
const Vector3 &  b 
) [inline]

Calculate the difference in pseudorapidity between two spatial vectors.

Definition at line 296 of file Vector3.hh.

                                                             {
    return deltaEta(a.pseudorapidity(), b.pseudorapidity());
  }
double Rivet::deltaEta ( const Vector3 &  v,
double  eta2 
) [inline]

Calculate the difference in pseudorapidity between two spatial vectors.

Definition at line 301 of file Vector3.hh.

                                                        {
    return deltaEta(v.pseudorapidity(), eta2);
  }
double Rivet::deltaEta ( double  eta1,
const Vector3 &  v 
) [inline]

Calculate the difference in pseudorapidity between two spatial vectors.

Definition at line 306 of file Vector3.hh.

                                                        {
    return deltaEta(eta1, v.pseudorapidity());
  }
double Rivet::deltaEta ( double  eta1,
double  eta2 
) [inline]

Calculate the abs difference between two pseudorapidities

Note:
Just a cosmetic name for analysis code clarity.

Definition at line 576 of file MathUtils.hh.

                                                   {
    return fabs(eta1 - eta2);
  }
double Rivet::deltaEta ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1252 of file Vector4.hh.

                                                                       {
    return deltaEta(a.vector3(), b.vector3());
  }
double Rivet::deltaEta ( const FourMomentum &  v,
double  eta2 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1257 of file Vector4.hh.

                                                             {
    return deltaEta(v.vector3(), eta2);
  }
double Rivet::deltaEta ( double  eta1,
const FourMomentum &  v 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1262 of file Vector4.hh.

                                                             {
    return deltaEta(eta1, v.vector3());
  }
double Rivet::deltaEta ( const FourVector &  a,
const FourVector &  b 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1267 of file Vector4.hh.

                                                                   {
    return deltaEta(a.vector3(), b.vector3());
  }
double Rivet::deltaEta ( const FourVector &  v,
double  eta2 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1272 of file Vector4.hh.

                                                           {
    return deltaEta(v.vector3(), eta2);
  }
double Rivet::deltaEta ( double  eta1,
const FourVector &  v 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1277 of file Vector4.hh.

                                                           {
    return deltaEta(eta1, v.vector3());
  }
double Rivet::deltaEta ( const FourVector &  a,
const FourMomentum &  b 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1282 of file Vector4.hh.

                                                                     {
    return deltaEta(a.vector3(), b.vector3());
  }
double Rivet::deltaEta ( const FourMomentum &  a,
const FourVector &  b 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1287 of file Vector4.hh.

                                                                     {
    return deltaEta(a.vector3(), b.vector3());
  }
double Rivet::deltaEta ( const FourVector &  a,
const Vector3 &  b 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1292 of file Vector4.hh.

                                                                {
    return deltaEta(a.vector3(), b);
  }
double Rivet::deltaEta ( const Vector3 &  a,
const FourVector &  b 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1297 of file Vector4.hh.

                                                                {
    return deltaEta(a, b.vector3());
  }
double Rivet::deltaEta ( const FourMomentum &  a,
const Vector3 &  b 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1302 of file Vector4.hh.

                                                                  {
    return deltaEta(a.vector3(), b);
  }
double Rivet::deltaEta ( const Vector3 &  a,
const FourMomentum &  b 
) [inline]

Calculate the difference in pseudorapidity between two vectors.

Definition at line 1307 of file Vector4.hh.

                                                                  {
    return deltaEta(a, b.vector3());
  }
double Rivet::deltaPhi ( const ParticleBase &  p1,
const ParticleBase &  p2 
) [inline]

Definition at line 195 of file ParticleBase.hh.

                                                                         {
    return deltaPhi(p1.momentum(), p2.momentum());
  }
double Rivet::deltaPhi ( const ParticleBase &  p,
const FourMomentum &  v 
) [inline]

Definition at line 199 of file ParticleBase.hh.

                                                                       {
    return deltaPhi(p.momentum(), v);
  }
double Rivet::deltaPhi ( const ParticleBase &  p,
const FourVector &  v 
) [inline]

Definition at line 203 of file ParticleBase.hh.

                                                                     {
    return deltaPhi(p.momentum(), v);
  }
double Rivet::deltaPhi ( const ParticleBase &  p,
const Vector3 &  v 
) [inline]

Definition at line 207 of file ParticleBase.hh.

                                                                  {
    return deltaPhi(p.momentum(), v);
  }
double Rivet::deltaPhi ( const ParticleBase &  p,
double  phi 
) [inline]

Definition at line 211 of file ParticleBase.hh.

                                                            {
    return deltaPhi(p.momentum(), phi);
  }
double Rivet::deltaPhi ( const FourMomentum &  v,
const ParticleBase &  p 
) [inline]

Definition at line 215 of file ParticleBase.hh.

                                                                       {
    return deltaPhi(v, p.momentum());
  }
double Rivet::deltaPhi ( const FourVector &  v,
const ParticleBase &  p 
) [inline]

Definition at line 219 of file ParticleBase.hh.

                                                                     {
    return deltaPhi(v, p.momentum());
  }
double Rivet::deltaPhi ( const Vector3 &  v,
const ParticleBase &  p 
) [inline]

Definition at line 223 of file ParticleBase.hh.

                                                                  {
    return deltaPhi(v, p.momentum());
  }
double Rivet::deltaPhi ( double  phi,
const ParticleBase &  p 
) [inline]

Definition at line 227 of file ParticleBase.hh.

                                                            {
    return deltaPhi(phi, p.momentum());
  }
double Rivet::deltaPhi ( const Vector3 &  a,
const Vector3 &  b 
) [inline]

Calculate the difference in azimuthal angle between two spatial vectors.

Definition at line 317 of file Vector3.hh.

                                                             {
    return deltaPhi(a.azimuthalAngle(), b.azimuthalAngle());
  }
double Rivet::deltaPhi ( const Vector3 &  v,
double  phi2 
) [inline]

Calculate the difference in azimuthal angle between two spatial vectors.

Definition at line 322 of file Vector3.hh.

                                                        {
    return deltaPhi(v.azimuthalAngle(), phi2);
  }
double Rivet::deltaPhi ( double  phi1,
const Vector3 &  v 
) [inline]

Calculate the difference in azimuthal angle between two spatial vectors.

Definition at line 327 of file Vector3.hh.

                                                        {
    return deltaPhi(phi1, v.azimuthalAngle());
  }
double Rivet::deltaPhi ( double  phi1,
double  phi2 
) [inline]

Calculate the difference between two angles in radians.

Returns in the range [0, PI].

Definition at line 569 of file MathUtils.hh.

                                                   {
    return mapAngle0ToPi(phi1 - phi2);
  }
double Rivet::deltaPhi ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1183 of file Vector4.hh.

                                                                       {
    return deltaPhi(a.vector3(), b.vector3());
  }
double Rivet::deltaPhi ( const FourMomentum &  v,
double  phi2 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1188 of file Vector4.hh.

                                                             {
    return deltaPhi(v.vector3(), phi2);
  }
double Rivet::deltaPhi ( double  phi1,
const FourMomentum &  v 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1193 of file Vector4.hh.

                                                             {
    return deltaPhi(phi1, v.vector3());
  }
double Rivet::deltaPhi ( const FourVector &  a,
const FourVector &  b 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1198 of file Vector4.hh.

                                                                   {
    return deltaPhi(a.vector3(), b.vector3());
  }
double Rivet::deltaPhi ( const FourVector &  v,
double  phi2 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1203 of file Vector4.hh.

                                                           {
    return deltaPhi(v.vector3(), phi2);
  }
double Rivet::deltaPhi ( double  phi1,
const FourVector &  v 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1208 of file Vector4.hh.

                                                           {
    return deltaPhi(phi1, v.vector3());
  }
double Rivet::deltaPhi ( const FourVector &  a,
const FourMomentum &  b 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1213 of file Vector4.hh.

                                                                     {
    return deltaPhi(a.vector3(), b.vector3());
  }
double Rivet::deltaPhi ( const FourMomentum &  a,
const FourVector &  b 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1218 of file Vector4.hh.

                                                                     {
    return deltaPhi(a.vector3(), b.vector3());
  }
double Rivet::deltaPhi ( const FourVector &  a,
const Vector3 &  b 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1223 of file Vector4.hh.

                                                                {
    return deltaPhi(a.vector3(), b);
  }
double Rivet::deltaPhi ( const Vector3 &  a,
const FourVector &  b 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1228 of file Vector4.hh.

                                                                {
    return deltaPhi(a, b.vector3());
  }
double Rivet::deltaPhi ( const FourMomentum &  a,
const Vector3 &  b 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1233 of file Vector4.hh.

                                                                  {
    return deltaPhi(a.vector3(), b);
  }
double Rivet::deltaPhi ( const Vector3 &  a,
const FourMomentum &  b 
) [inline]

Calculate the difference in azimuthal angle between two vectors.

Definition at line 1238 of file Vector4.hh.

                                                                  {
    return deltaPhi(a, b.vector3());
  }
double Rivet::deltaR ( const ParticleBase &  p1,
const ParticleBase &  p2,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Definition at line 153 of file ParticleBase.hh.

                                                          {
    return deltaR(p1.momentum(), p2.momentum(), scheme);
  }
double Rivet::deltaR ( const ParticleBase &  p,
const FourMomentum &  v,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Definition at line 158 of file ParticleBase.hh.

                                                          {
    return deltaR(p.momentum(), v, scheme);
  }
double Rivet::deltaR ( const ParticleBase &  p,
const FourVector &  v,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Definition at line 163 of file ParticleBase.hh.

                                                          {
    return deltaR(p.momentum(), v, scheme);
  }
double Rivet::deltaR ( const ParticleBase &  p,
const Vector3 &  v 
) [inline]

Definition at line 168 of file ParticleBase.hh.

                                                                {
    return deltaR(p.momentum(), v);
  }
double Rivet::deltaR ( const ParticleBase &  p,
double  eta,
double  phi 
) [inline]

Definition at line 172 of file ParticleBase.hh.

                                                                      {
    return deltaR(p.momentum(), eta, phi);
  }
double Rivet::deltaR ( const FourMomentum &  v,
const ParticleBase &  p,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Definition at line 176 of file ParticleBase.hh.

                                                          {
    return deltaR(v, p.momentum(), scheme);
  }
double Rivet::deltaR ( const FourVector &  v,
const ParticleBase &  p,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Definition at line 181 of file ParticleBase.hh.

                                                          {
    return deltaR(v, p.momentum(), scheme);
  }
double Rivet::deltaR ( const Vector3 &  v,
const ParticleBase &  p 
) [inline]

Definition at line 186 of file ParticleBase.hh.

                                                                {
    return deltaR(v, p.momentum());
  }
double Rivet::deltaR ( double  eta,
double  phi,
const ParticleBase &  p 
) [inline]

Definition at line 190 of file ParticleBase.hh.

                                                                      {
    return deltaR(eta, phi, p.momentum());
  }
double Rivet::deltaR ( const Vector3 &  a,
const Vector3 &  b 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.

Definition at line 344 of file Vector3.hh.

                                                           {
    return sqrt(deltaR2(a,b));
  }
double Rivet::deltaR ( const Vector3 &  v,
double  eta2,
double  phi2 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.

Definition at line 354 of file Vector3.hh.

                                                                   {
    return sqrt(deltaR2(v, eta2, phi2));
  }
double Rivet::deltaR ( double  eta1,
double  phi1,
const Vector3 &  v 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.

Definition at line 364 of file Vector3.hh.

                                                                   {
    return sqrt(deltaR2(eta1, phi1, v));
  }
double Rivet::deltaR ( double  rap1,
double  phi1,
double  rap2,
double  phi2 
) [inline]

Calculate the distance between two points in 2D rapidity-azimuthal ("\f$ \eta-\phi \f$") space. The phi values are given in radians.

Definition at line 596 of file MathUtils.hh.

                                                                           {
    return sqrt(deltaR2(rap1, phi1, rap2, phi2));
  }
double Rivet::deltaR ( const FourVector &  a,
const FourVector &  b,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.

There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter. Use of this scheme option is discouraged in this case since RAPIDITY is only a valid option for vectors whose type is really the FourMomentum derived class.

Definition at line 901 of file Vector4.hh.

                                                        {
    return sqrt(deltaR2(a, b, scheme));
  }
double Rivet::deltaR ( const FourVector &  v,
double  eta2,
double  phi2,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.

There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 940 of file Vector4.hh.

                                                        {
    return sqrt(deltaR2(v, eta2, phi2, scheme));
  }
double Rivet::deltaR ( double  eta1,
double  phi1,
const FourVector &  v,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.

There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 979 of file Vector4.hh.

                                                        {
    return sqrt(deltaR2(eta1, phi1, v, scheme));
  }
double Rivet::deltaR ( const FourMomentum &  a,
const FourMomentum &  b,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.

There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 1010 of file Vector4.hh.

                                                        {
    return sqrt(deltaR2(a, b, scheme));
  }
double Rivet::deltaR ( const FourMomentum &  v,
double  eta2,
double  phi2,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 1039 of file Vector4.hh.

                                                        {
    return sqrt(deltaR2(v, eta2, phi2, scheme));
  }
double Rivet::deltaR ( double  eta1,
double  phi1,
const FourMomentum &  v,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 1069 of file Vector4.hh.

                                                         {
    return sqrt(deltaR2(eta1, phi1, v, scheme));
  }
double Rivet::deltaR ( const FourMomentum &  a,
const FourVector &  b,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 1098 of file Vector4.hh.

                                                        {
    return sqrt(deltaR2(a, b, scheme));
  }
double Rivet::deltaR ( const FourVector &  a,
const FourMomentum &  b,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 1119 of file Vector4.hh.

                                                        {
    return deltaR(b, a, scheme); //< note reversed args
  }
double Rivet::deltaR ( const FourMomentum &  a,
const Vector3 &  b 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.

Definition at line 1133 of file Vector4.hh.

                                                                {
    return deltaR(a.vector3(), b);
  }
double Rivet::deltaR ( const Vector3 &  a,
const FourMomentum &  b 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.

Definition at line 1145 of file Vector4.hh.

                                                                {
    return deltaR(a, b.vector3());
  }
double Rivet::deltaR ( const FourVector &  a,
const Vector3 &  b 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.

Definition at line 1157 of file Vector4.hh.

                                                              {
    return deltaR(a.vector3(), b);
  }
double Rivet::deltaR ( const Vector3 &  a,
const FourVector &  b 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.

Definition at line 1169 of file Vector4.hh.

                                                              {
    return deltaR(a, b.vector3());
  }
double Rivet::deltaR2 ( const Vector3 &  a,
const Vector3 &  b 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.

Definition at line 338 of file Vector3.hh.

                                                            {
    return deltaR2(a.pseudorapidity(), a.azimuthalAngle(),
                   b.pseudorapidity(), b.azimuthalAngle());
  }
double Rivet::deltaR2 ( const Vector3 &  v,
double  eta2,
double  phi2 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.

Definition at line 349 of file Vector3.hh.

                                                                    {
    return deltaR2(v.pseudorapidity(), v.azimuthalAngle(), eta2, phi2);
  }
double Rivet::deltaR2 ( double  eta1,
double  phi1,
const Vector3 &  v 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two spatial vectors.

Definition at line 359 of file Vector3.hh.

                                                                    {
    return deltaR2(eta1, phi1, v.pseudorapidity(), v.azimuthalAngle());
  }
double Rivet::deltaR2 ( double  rap1,
double  phi1,
double  rap2,
double  phi2 
) [inline]

Calculate the squared distance between two points in 2D rapidity-azimuthal ("\f$ \eta-\phi \f$") space. The phi values are given in radians.

Definition at line 589 of file MathUtils.hh.

                                                                            {
    const double dphi = deltaPhi(phi1, phi2);
    return sqr(rap1-rap2) + sqr(dphi);
  }
double Rivet::deltaR2 ( const FourVector &  a,
const FourVector &  b,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.

There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter. Use of this scheme option is discouraged in this case since RAPIDITY is only a valid option for vectors whose type is really the FourMomentum derived class.

Definition at line 873 of file Vector4.hh.

                                                        {
    switch (scheme) {
    case PSEUDORAPIDITY :
      return deltaR2(a.vector3(), b.vector3());
    case RAPIDITY:
      {
        const FourMomentum* ma = dynamic_cast<const FourMomentum*>(&a);
        const FourMomentum* mb = dynamic_cast<const FourMomentum*>(&b);
        if (!ma || !mb) {
          string err = "deltaR with scheme RAPIDITY can only be called with FourMomentum objects, not FourVectors";
          throw std::runtime_error(err);
        }
        return deltaR2(*ma, *mb, scheme);
      }
    default:
      throw std::runtime_error("The specified deltaR scheme is not yet implemented");
    }
  }
double Rivet::deltaR2 ( const FourVector &  v,
double  eta2,
double  phi2,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.

There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 914 of file Vector4.hh.

                                                        {
    switch (scheme) {
    case PSEUDORAPIDITY :
      return deltaR2(v.vector3(), eta2, phi2);
    case RAPIDITY:
      {
        const FourMomentum* mv = dynamic_cast<const FourMomentum*>(&v);
        if (!mv) {
          string err = "deltaR with scheme RAPIDITY can only be called with FourMomentum objects, not FourVectors";
          throw std::runtime_error(err);
        }
        return deltaR2(*mv, eta2, phi2, scheme);
      }
    default:
      throw std::runtime_error("The specified deltaR scheme is not yet implemented");
    }
  }
double Rivet::deltaR2 ( double  eta1,
double  phi1,
const FourVector &  v,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.

There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 953 of file Vector4.hh.

                                                         {
    switch (scheme) {
    case PSEUDORAPIDITY :
      return deltaR2(eta1, phi1, v.vector3());
    case RAPIDITY:
      {
        const FourMomentum* mv = dynamic_cast<const FourMomentum*>(&v);
        if (!mv) {
          string err = "deltaR with scheme RAPIDITY can only be called with FourMomentum objects, not FourVectors";
          throw std::runtime_error(err);
        }
        return deltaR2(eta1, phi1, *mv, scheme);
      }
    default:
      throw std::runtime_error("The specified deltaR scheme is not yet implemented");
    }
  }
double Rivet::deltaR2 ( const FourMomentum &  a,
const FourMomentum &  b,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors.

There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 992 of file Vector4.hh.

                                                        {
    switch (scheme) {
    case PSEUDORAPIDITY:
      return deltaR2(a.vector3(), b.vector3());
    case RAPIDITY:
      return deltaR2(a.rapidity(), a.azimuthalAngle(), b.rapidity(), b.azimuthalAngle());
    default:
      throw std::runtime_error("The specified deltaR scheme is not yet implemented");
    }
  }
double Rivet::deltaR2 ( const FourMomentum &  v,
double  eta2,
double  phi2,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 1021 of file Vector4.hh.

                                                         {
    switch (scheme) {
    case PSEUDORAPIDITY:
      return deltaR2(v.vector3(), eta2, phi2);
    case RAPIDITY:
      return deltaR2(v.rapidity(), v.azimuthalAngle(), eta2, phi2);
    default:
      throw std::runtime_error("The specified deltaR scheme is not yet implemented");
    }
  }
double Rivet::deltaR2 ( double  eta1,
double  phi1,
const FourMomentum &  v,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 1051 of file Vector4.hh.

                                                         {
    switch (scheme) {
    case PSEUDORAPIDITY:
      return deltaR2(eta1, phi1, v.vector3());
    case RAPIDITY:
      return deltaR2(eta1, phi1, v.rapidity(), v.azimuthalAngle());
    default:
      throw std::runtime_error("The specified deltaR scheme is not yet implemented");
    }
  }
double Rivet::deltaR2 ( const FourMomentum &  a,
const FourVector &  b,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the squared 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 1081 of file Vector4.hh.

                                                         {
    switch (scheme) {
    case PSEUDORAPIDITY:
      return deltaR2(a.vector3(), b.vector3());
    case RAPIDITY:
      return deltaR2(a.rapidity(), a.azimuthalAngle(), FourMomentum(b).rapidity(), b.azimuthalAngle());
    default:
      throw std::runtime_error("The specified deltaR scheme is not yet implemented");
    }
  }
double Rivet::deltaR2 ( const FourVector &  a,
const FourMomentum &  b,
RapScheme  scheme = PSEUDORAPIDITY 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between two four-vectors. There is a scheme ambiguity for momentum-type four vectors as to whether the pseudorapidity (a purely geometric concept) or the rapidity (a relativistic energy-momentum quantity) is to be used: this can be chosen via the optional scheme parameter.

Definition at line 1109 of file Vector4.hh.

                                                         {
    return deltaR2(b, a, scheme); //< note reversed args
  }
double Rivet::deltaR2 ( const FourMomentum &  a,
const Vector3 &  b 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.

Definition at line 1127 of file Vector4.hh.

                                                                 {
    return deltaR2(a.vector3(), b);
  }
double Rivet::deltaR2 ( const Vector3 &  a,
const FourMomentum &  b 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.

Definition at line 1139 of file Vector4.hh.

                                                                 {
    return deltaR2(a, b.vector3());
  }
double Rivet::deltaR2 ( const FourVector &  a,
const Vector3 &  b 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.

Definition at line 1151 of file Vector4.hh.

                                                               {
    return deltaR2(a.vector3(), b);
  }
double Rivet::deltaR2 ( const Vector3 &  a,
const FourVector &  b 
) [inline]

Calculate the 2D rapidity-azimuthal ("eta-phi") distance between a three-vector and a four-vector.

Definition at line 1163 of file Vector4.hh.

                                                               {
    return deltaR2(a, b.vector3());
  }
double Rivet::deltaRap ( const ParticleBase &  p1,
const ParticleBase &  p2 
) [inline]

Definition at line 269 of file ParticleBase.hh.

                                                                         {
    return deltaRap(p1.momentum(), p2.momentum());
  }
double Rivet::deltaRap ( const ParticleBase &  p,
const FourMomentum &  v 
) [inline]

Definition at line 273 of file ParticleBase.hh.

                                                                       {
    return deltaRap(p.momentum(), v);
  }
double Rivet::deltaRap ( const ParticleBase &  p,
double  y 
) [inline]

Definition at line 277 of file ParticleBase.hh.

                                                          {
    return deltaRap(p.momentum(), y);
  }
double Rivet::deltaRap ( const FourMomentum &  v,
const ParticleBase &  p 
) [inline]

Definition at line 281 of file ParticleBase.hh.

                                                                       {
    return deltaRap(v, p.momentum());
  }
double Rivet::deltaRap ( double  y,
const ParticleBase &  p 
) [inline]

Definition at line 285 of file ParticleBase.hh.

                                                          {
    return deltaRap(y, p.momentum());
  }
double Rivet::deltaRap ( double  y1,
double  y2 
) [inline]

Calculate the abs difference between two rapidities

Note:
Just a cosmetic name for analysis code clarity.

Definition at line 583 of file MathUtils.hh.

                                               {
    return fabs(y1 - y2);
  }
double Rivet::deltaRap ( const FourMomentum &  a,
const FourMomentum &  b 
) [inline]

Calculate the difference in rapidity between two 4-momentum vectors.

Definition at line 1318 of file Vector4.hh.

                                                                       {
    return deltaRap(a.rapidity(), b.rapidity());
  }
double Rivet::deltaRap ( const FourMomentum &  v,
double  y2 
) [inline]

Calculate the difference in rapidity between two 4-momentum vectors.

Definition at line 1323 of file Vector4.hh.

                                                           {
    return deltaRap(v.rapidity(), y2);
  }
double Rivet::deltaRap ( double  y1,
const FourMomentum &  v 
) [inline]

Calculate the difference in rapidity between two 4-momentum vectors.

Definition at line 1328 of file Vector4.hh.

                                                           {
    return deltaRap(y1, v.rapidity());
  }
double Rivet::det ( const Matrix< N > &  m) [inline]

Definition at line 355 of file MatrixN.hh.

                                        {
    return m.determinant();
  }
EigenSystem< N > diagonalize ( const Matrix< N > &  m)

Diagonalize an NxN matrix, returning a collection of pairs of eigenvalues and eigenvectors, ordered decreasing in eigenvalue.

Definition at line 88 of file MatrixDiag.hh.

                                               {
  EigenSystem<N> esys;

  // Make a GSL matrix.
  gsl_matrix* A = gsl_matrix_alloc(N, N);
  for (size_t i = 0; i < N; ++i) {
    for (size_t j = 0; j < N; ++j) {
      gsl_matrix_set(A, i, j, m.get(i, j));
    }
  }

  // Use GSL diagonalization.
  gsl_matrix* vecs = gsl_matrix_alloc(N, N);
  gsl_vector* vals = gsl_vector_alloc(N);
  gsl_eigen_symmv_workspace* workspace = gsl_eigen_symmv_alloc(N);
  gsl_eigen_symmv(A, vals, vecs, workspace);
  gsl_eigen_symmv_sort(vals, vecs, GSL_EIGEN_SORT_VAL_DESC);

  // Build the vector of "eigen-pairs".
  typename EigenSystem<N>::EigenPairs eigensolns;
  for (size_t i = 0; i < N; ++i) {
    typename EigenSystem<N>::EigenPair ep;
    ep.first = gsl_vector_get(vals, i);
    Vector<N> ev;
    for (size_t j = 0; j < N; ++j) {
      ev.set(j, gsl_matrix_get(vecs, j, i));
    }
    ep.second = ev;
    eigensolns.push_back(ep);
  }

  // Free GSL memory.
  gsl_eigen_symmv_free(workspace);
  gsl_matrix_free(A);
  gsl_matrix_free(vecs);
  gsl_vector_free(vals);

  // Populate the returned object.
  esys._eigenPairs = eigensolns;
  return esys;
}
bool Rivet::diffCharge ( const Particle &  a,
const Particle &  b 
) [inline]

Return true if Particles a and b have a different (not necessarily opposite) charge.

Definition at line 315 of file ParticleUtils.hh.

                                                               {
    return a.charge3() != b.charge3();
  }
string Rivet::dirname ( const string &  p) [inline]

Get the dirname (i.e. path to the penultimate directory) from a path p.

Definition at line 247 of file Utils.hh.

                                         {
    if (!contains(p, "/")) return "";
    return p.substr(0, p.rfind("/"));
  }
PBCONTAINER1 Rivet::discardIfAnyDeltaPhiLess ( const PBCONTAINER1 &  tofilter,
const PBCONTAINER2 &  tocompare,
double  dphi 
)

Definition at line 498 of file ParticleBaseUtils.hh.

                                                                                                                  {
    PBCONTAINER1 tmp{tofilter};
    idiscardIfAnyDeltaPhiLess(tmp, tocompare, dphi);
    return tmp;
  }
PBCONTAINER1 Rivet::discardIfAnyDeltaRLess ( const PBCONTAINER1 &  tofilter,
const PBCONTAINER2 &  tocompare,
double  dR 
)

Definition at line 485 of file ParticleBaseUtils.hh.

                                                                                                              {
    PBCONTAINER1 tmp{tofilter};
    idiscardIfAnyDeltaRLess(tmp, tocompare, dR);
    return tmp;
  }
Matrix< N > divide ( const Matrix< N > &  m,
const double  a 
) [inline]

Definition at line 298 of file MatrixN.hh.

                                                              {
    return multiply(1/a, m);
  }
double Rivet::dot ( const Vector3 &  a,
const Vector3 &  b 
) [inline]

Definition at line 233 of file Vector3.hh.

                                                        {
    return a.dot(b);
  }
double Rivet::dot ( const FourVector &  a,
const FourVector &  b 
) [inline]

Contract two 4-vectors, with metric signature (+ - - -).

Definition at line 235 of file Vector4.hh.

                                                              {
    return contract(a, b);
  }
bool Rivet::efffilt ( const Particle &  p,
const ParticleEffFn &  feff 
) [inline]

Return true if Particle p is chosen to survive a random efficiency selection.

Definition at line 97 of file ParticleSmearingFunctions.hh.

                                                                    {
    return rand01() < feff(p);
  }
bool Rivet::efffilt ( const Jet &  j,
FN &  feff 
) [inline]

Return true if Jet j is chosen to survive a random efficiency selection.

Definition at line 117 of file JetSmearingFunctions.hh.

                                              {
    return rand01() < feff(j);
  }
double Rivet::ELECTRON_EFF_ATLAS_RUN1 ( const Particle &  e) [inline]

ATLAS Run 1 electron reconstruction efficiency

Todo:

Include reco eff (but no e/y discrimination) in forward region

How to use this in combination with tracking eff?

Definition at line 18 of file SmearingFunctions.hh.

                                                           {
    if (e.abseta() > 2.5) return 0;
    if (e.pT() < 10*GeV) return 0;
    return (e.abseta() < 1.5) ? 0.95 : 0.85;
  }
double Rivet::ELECTRON_EFF_ATLAS_RUN2 ( const Particle &  e) [inline]

ATLAS Run 2 electron reco efficiency

Todo:
Currently just a copy of Run 1: fix!

Definition at line 26 of file SmearingFunctions.hh.

                                                           {
    return ELECTRON_EFF_ATLAS_RUN1(e);
  }
double Rivet::ELECTRON_EFF_CMS_RUN1 ( const Particle &  e) [inline]
Todo:
Add charge flip efficiency?

CMS Run 1 electron reconstruction efficiency

Todo:
How to use this in combination with tracking eff?

Definition at line 203 of file SmearingFunctions.hh.

                                                         {
    if (e.abseta() > 2.5) return 0;
    if (e.pT() < 10*GeV) return 0;
    return (e.abseta() < 1.5) ? 0.95 : 0.85;
  }
double Rivet::ELECTRON_EFF_CMS_RUN2 ( const Particle &  e) [inline]

CMS Run 2 electron reco efficiency

Todo:
Currently just a copy of Run 1: fix!

Definition at line 212 of file SmearingFunctions.hh.

                                                         {
    return ELECTRON_EFF_CMS_RUN1(e);
  }
double Rivet::ELECTRON_IDEFF_ATLAS_RUN1_MEDIUM ( const Particle &  e) [inline]

ATLAS Run 1 'medium' electron identification/selection efficiency.

Definition at line 54 of file SmearingFunctions.hh.

                                                                    {

    const static vector<double> eta_edges_10 = {0.000, 0.049, 0.454, 1.107, 1.46, 1.790, 2.277, 2.500};
    const static vector<double> eta_vals_10  = {0.730, 0.757, 0.780, 0.771, 0.77, 0.777, 0.778};

    const static vector<double> eta_edges_15 = {0.000, 0.053, 0.456, 1.102, 1.463, 1.783, 2.263, 2.500};
    const static vector<double> eta_vals_15  = {0.780, 0.800, 0.819, 0.759, 0.749, 0.813, 0.829};

    const static vector<double> eta_edges_20 = {0.000, 0.065, 0.362, 0.719, 0.980, 1.289, 1.455, 1.681, 1.942, 2.239, 2.452, 2.500};
    const static vector<double> eta_vals_20  = {0.794, 0.806, 0.816, 0.806, 0.797, 0.774, 0.764, 0.788, 0.793, 0.806, 0.825};

    const static vector<double> eta_edges_25 = {0.000, 0.077, 0.338, 0.742, 1.004, 1.265, 1.467, 1.692, 1.940, 2.227, 2.452, 2.500};
    const static vector<double> eta_vals_25  = {0.833, 0.843, 0.853, 0.845, 0.839, 0.804, 0.790, 0.825, 0.830, 0.833, 0.839};

    const static vector<double> eta_edges_30 = {0.000, 0.077, 0.350, 0.707, 0.980, 1.289, 1.479, 1.681, 1.942, 2.239, 2.441, 2.500};
    const static vector<double> eta_vals_30  = {0.863, 0.872, 0.881, 0.874, 0.870, 0.824, 0.808, 0.847, 0.845, 0.840, 0.842};

    const static vector<double> eta_edges_35 = {0.000, 0.058, 0.344, 0.700, 1.009, 1.270, 1.458, 1.685, 1.935, 2.231, 2.468, 2.500};
    const static vector<double> eta_vals_35  = {0.878, 0.889, 0.901, 0.895, 0.893, 0.849, 0.835, 0.868, 0.863, 0.845, 0.832};

    const static vector<double> eta_edges_40 = {0.000, 0.047, 0.355, 0.699, 0.983, 1.280, 1.446, 1.694, 1.943, 2.227, 2.441, 2.500};
    const static vector<double> eta_vals_40  = {0.894, 0.901, 0.909, 0.905, 0.904, 0.875, 0.868, 0.889, 0.876, 0.848, 0.827};

    const static vector<double> eta_edges_45 = {0.000, 0.058, 0.356, 0.712, 0.997, 1.282, 1.459, 1.686, 1.935, 2.220, 2.444, 2.500};
    const static vector<double> eta_vals_45  = {0.900, 0.911, 0.923, 0.918, 0.917, 0.897, 0.891, 0.904, 0.894, 0.843, 0.796};

    const static vector<double> eta_edges_50 = {0.000, 0.059, 0.355, 0.711, 0.983, 1.280, 1.469, 1.682, 1.919, 2.227, 2.441, 2.500};
    const static vector<double> eta_vals_50  = {0.903, 0.913, 0.923, 0.922, 0.923, 0.903, 0.898, 0.908, 0.895, 0.831, 0.774};

    const static vector<double> eta_edges_60 = {0.000, 0.053, 0.351, 0.720, 1.006, 1.291, 1.469, 1.696, 1.946, 2.243, 2.455, 2.500};
    const static vector<double> eta_vals_60  = {0.903, 0.917, 0.928, 0.924, 0.927, 0.915, 0.911, 0.915, 0.899, 0.827, 0.760};

    const static vector<double> eta_edges_80 = {0.000, 0.053, 0.351, 0.720, 0.994, 1.292, 1.482, 1.708, 1.934, 2.220, 2.458, 2.500};
    const static vector<double> eta_vals_80  = {0.936, 0.942, 0.952, 0.956, 0.956, 0.934, 0.931, 0.944, 0.933, 0.940, 0.948};

    const static vector<double> et_edges = { 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 80 };
    const static vector< vector<double> > et_eta_edges = { eta_edges_10, eta_edges_15, eta_edges_20, eta_edges_25, eta_edges_30, eta_edges_35, eta_edges_40, eta_edges_45, eta_edges_50, eta_edges_60, eta_edges_80 };
    const static vector< vector<double> > et_eta_vals  = { eta_vals_10, eta_vals_15, eta_vals_20, eta_vals_25, eta_vals_30, eta_vals_35, eta_vals_40, eta_vals_45, eta_vals_50, eta_vals_60, eta_vals_80 };

    if (e.abseta() > 2.5 || e.Et() < 10*GeV) return 0.0;
    const int i_et = binIndex(e.Et()/GeV, et_edges, true);
    const int i_eta = binIndex(e.abseta(), et_eta_edges[i_et]);
    return et_eta_vals[i_et][i_eta];
  }
double Rivet::ELECTRON_IDEFF_ATLAS_RUN1_TIGHT ( const Particle &  e) [inline]

ATLAS Run 1 'tight' electron identification/selection efficiency.

Definition at line 107 of file SmearingFunctions.hh.

                                                                   {

    const static vector<double> eta_edges_10 = {0.000, 0.049, 0.459, 1.100, 1.461, 1.789, 2.270, 2.500};
    const static vector<double> eta_vals_10  = {0.581, 0.632, 0.668, 0.558, 0.548, 0.662, 0.690};

    const static vector<double> eta_edges_15 = {0.000, 0.053, 0.450, 1.096, 1.463, 1.783, 2.269, 2.500};
    const static vector<double> eta_vals_15 =  {0.630, 0.678, 0.714, 0.633, 0.616, 0.700, 0.733};

    const static vector<double> eta_edges_20 = {0.000, 0.065, 0.362, 0.719, 0.992, 1.277, 1.479, 1.692, 1.930, 2.227, 2.464, 2.500};
    const static vector<double> eta_vals_20 =  {0.653, 0.695, 0.735, 0.714, 0.688, 0.635, 0.625, 0.655, 0.680, 0.691, 0.674};

    const static vector<double> eta_edges_25 = {0.000, 0.077, 0.362, 0.719, 0.992, 1.300, 1.479, 1.692, 1.942, 2.227, 2.464, 2.500};
    const static vector<double> eta_vals_25 =  {0.692, 0.732, 0.768, 0.750, 0.726, 0.677, 0.667, 0.692, 0.710, 0.706, 0.679};

    const static vector<double> eta_edges_30 = {0.000, 0.053, 0.362, 0.719, 1.004, 1.277, 1.467, 1.681, 1.954, 2.239, 2.452, 2.500};
    const static vector<double> eta_vals_30 =  {0.724, 0.763, 0.804, 0.789, 0.762, 0.702, 0.690, 0.720, 0.731, 0.714, 0.681};

    const static vector<double> eta_edges_35 = {0.000, 0.044, 0.342, 0.711, 0.971, 1.280, 1.456, 1.683, 1.944, 2.218, 2.442, 2.500};
    const static vector<double> eta_vals_35 =  {0.736, 0.778, 0.824, 0.811, 0.784, 0.730, 0.718, 0.739, 0.743, 0.718, 0.678};

    const static vector<double> eta_edges_40 = {0.000, 0.047, 0.355, 0.699, 0.983, 1.268, 1.457, 1.671, 1.931, 2.204, 2.453, 2.500};
    const static vector<double> eta_vals_40 =  {0.741, 0.774, 0.823, 0.823, 0.802, 0.764, 0.756, 0.771, 0.771, 0.734, 0.684};

    const static vector<double> eta_edges_45 = {0.000, 0.056, 0.354, 0.711, 0.984, 1.280, 1.458, 1.684, 1.945, 2.207, 2.442, 2.500};
    const static vector<double> eta_vals_45 =  {0.758, 0.792, 0.841, 0.841, 0.823, 0.792, 0.786, 0.796, 0.794, 0.734, 0.663};

    const static vector<double> eta_edges_50 = {0.000, 0.059, 0.355, 0.699, 0.983, 1.268, 1.446, 1.682, 1.943, 2.216, 2.453, 2.500};
    const static vector<double> eta_vals_50 =  {0.771, 0.806, 0.855, 0.858, 0.843, 0.810, 0.800, 0.808, 0.802, 0.730, 0.653};

    const static vector<double> eta_edges_60 = {0.000, 0.050, 0.350, 0.707, 0.981, 1.278, 1.468, 1.694, 1.944, 2.242, 2.453, 2.500};
    const static vector<double> eta_vals_60 =  {0.773, 0.816, 0.866, 0.865, 0.853, 0.820, 0.812, 0.817, 0.804, 0.726, 0.645};

    const static vector<double> eta_edges_80 = {0.000, 0.051, 0.374, 0.720, 0.981, 1.279, 1.468, 1.707, 1.945, 2.207, 2.457, 2.500};
    const static vector<double> eta_vals_80 =  {0.819, 0.855, 0.899, 0.906, 0.900, 0.869, 0.865, 0.873, 0.869, 0.868, 0.859};

    const static vector<double> et_edges = { 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 80 };
    const static vector< vector<double> > et_eta_edges = { eta_edges_10, eta_edges_15, eta_edges_20, eta_edges_25, eta_edges_30, eta_edges_35, eta_edges_40, eta_edges_45, eta_edges_50, eta_edges_60, eta_edges_80 };
    const static vector< vector<double> > et_eta_vals  = { eta_vals_10, eta_vals_15, eta_vals_20, eta_vals_25, eta_vals_30, eta_vals_35, eta_vals_40, eta_vals_45, eta_vals_50, eta_vals_60, eta_vals_80 };

    if (e.abseta() > 2.5 || e.Et() < 10*GeV) return 0.0;
    const int i_et = binIndex(e.Et()/GeV, et_edges, true);
    const int i_eta = binIndex(e.abseta(), et_eta_edges[i_et]);
    return et_eta_vals[i_et][i_eta];
  }
double Rivet::ELECTRON_IDEFF_ATLAS_RUN2_LOOSE ( const Particle &  e) [inline]

ATLAS Run 2 'loose' electron identification/selection efficiency.

Values read from Fig 3 of ATL-PHYS-PUB-2015-041

Todo:
What about faking by jets or non-electrons?

Definition at line 35 of file SmearingFunctions.hh.

                                                                   {

    // Manually symmetrised eta eff histogram
    const static vector<double> edges_eta = { 0.0,   0.1,   0.8,   1.37,  1.52,  2.01,  2.37,  2.47 };
    const static vector<double> effs_eta  = { 0.950, 0.965, 0.955, 0.885, 0.950, 0.935, 0.90 };
    // Et eff histogram (10-20 is a guess)
    const static vector<double> edges_et = { 0,   10,   20,   25,   30,   35,   40,    45,    50,   60,  80 };
    const static vector<double> effs_et  = { 0.0, 0.90, 0.91, 0.92, 0.94, 0.95, 0.955, 0.965, 0.97, 0.98 };

    if (e.abseta() > 2.47) return 0.0; // no ID outside the tracker

    const int i_eta = binIndex(e.abseta(), edges_eta);
    const int i_et = binIndex(e.Et()/GeV, edges_et, true);
    const double eff = effs_et[i_et] * effs_eta[i_eta] / 0.95; //< norm factor as approximate double differential
    return min(eff, 1.0);
  }
double Rivet::ELECTRON_IDEFF_ATLAS_RUN2_MEDIUM ( const Particle &  e) [inline]

ATLAS Run 2 'medium' electron identification/selection efficiency.

Todo:
Currently just a copy of Run 1: fix!

Definition at line 101 of file SmearingFunctions.hh.

double Rivet::ELECTRON_IDEFF_ATLAS_RUN2_TIGHT ( const Particle &  e) [inline]

ATLAS Run 2 'tight' electron identification/selection efficiency.

Todo:
Currently just a copy of Run 1: fix!

Definition at line 154 of file SmearingFunctions.hh.

Particle Rivet::ELECTRON_SMEAR_ATLAS_RUN1 ( const Particle &  e) [inline]

ATLAS Run 1 electron reco smearing.

Definition at line 161 of file SmearingFunctions.hh.

                                                               {
    static const vector<double> edges_eta = {0., 2.5, 3.};
    static const vector<double> edges_pt = {0., 0.1, 25.};
    static const vector<double> e2s = {0.000, 0.015, 0.005,
                                       0.005, 0.005, 0.005,
                                       0.107, 0.107, 0.107};
    static const vector<double> es = {0.00, 0.00, 0.05,
                                      0.05, 0.05, 0.05,
                                      2.08, 2.08, 2.08};
    static const vector<double> cs = {0.00, 0.00, 0.25,
                                      0.25, 0.25, 0.25,
                                      0.00, 0.00, 0.00};

    const int i_eta = binIndex(e.abseta(), edges_eta, true);
    const int i_pt = binIndex(e.pT()/GeV, edges_pt, true);
    const int i = i_eta*edges_pt.size() + i_pt;

    // Calculate absolute resolution in GeV
    const double c1 = sqr(e2s[i]), c2 = sqr(es[i]), c3 = sqr(cs[i]);
    const double resolution = sqrt(c1*e.E2() + c2*e.E() + c3) * GeV;

    // normal_distribution<> d(e.E(), resolution);
    // const double mass = e.mass2() > 0 ? e.mass() : 0; //< numerical carefulness...
    // const double smeared_E = max(d(gen), mass); //< can't let the energy go below the mass!
    // return Particle(e.pid(), FourMomentum::mkEtaPhiME(e.eta(), e.phi(), mass, smeared_E));
    return Particle(e.pid(), P4_SMEAR_E_GAUSS(e, resolution));
  }
Particle Rivet::ELECTRON_SMEAR_ATLAS_RUN2 ( const Particle &  e) [inline]

ATLAS Run 2 electron reco smearing

Todo:
Currently just a copy of the Run 1 version: fix!

Definition at line 192 of file SmearingFunctions.hh.

                                                               {
    return ELECTRON_SMEAR_ATLAS_RUN1(e);
  }
Particle Rivet::ELECTRON_SMEAR_CMS_RUN1 ( const Particle &  e) [inline]

CMS electron energy smearing, preserving direction.

Calculate resolution for pT > 0.1 GeV, E resolution = |eta| < 0.5 -> sqrt(0.06^2 + pt^2 * 1.3e-3^2) |eta| < 1.5 -> sqrt(0.10^2 + pt^2 * 1.7e-3^2) |eta| < 2.5 -> sqrt(0.25^2 + pt^2 * 3.1e-3^2)

Definition at line 223 of file SmearingFunctions.hh.

                                                             {
    // Calculate absolute resolution in GeV from functional form
    double resolution = 0;
    const double abseta = e.abseta();
    if (e.pT() > 0.1*GeV && abseta < 2.5) { //< should be a given from efficiencies
      if (abseta < 0.5) {
        resolution = add_quad(0.06, 1.3e-3 * e.pT()/GeV) * GeV;
      } else if (abseta < 1.5) {
        resolution = add_quad(0.10, 1.7e-3 * e.pT()/GeV) * GeV;
      } else { // still |eta| < 2.5
        resolution = add_quad(0.25, 3.1e-3 * e.pT()/GeV) * GeV;
      }
    }

    // normal_distribution<> d(e.E(), resolution);
    // const double mass = e.mass2() > 0 ? e.mass() : 0; //< numerical carefulness...
    // const double smeared_E = max(d(gen), mass); //< can't let the energy go below the mass!
    // return Particle(e.pid(), FourMomentum::mkEtaPhiME(e.eta(), e.phi(), mass, smeared_E));
    return Particle(e.pid(), P4_SMEAR_E_GAUSS(e, resolution));
  }
Particle Rivet::ELECTRON_SMEAR_CMS_RUN2 ( const Particle &  e) [inline]

CMS Run 2 electron reco smearing

Todo:
Currently just a copy of the Run 1 version: fix!

Definition at line 247 of file SmearingFunctions.hh.

                                                             {
    return ELECTRON_SMEAR_CMS_RUN1(e);
  }
bool Rivet::endsWith ( const string &  s,
const string &  end 
) [inline]

Check whether a string end is found at the end of s.

Definition at line 167 of file Utils.hh.

                                                           {
    if (s.length() < end.length()) return false;
    return s.substr(s.length() - end.length()) == end;
  }
string Rivet::file_extn ( const string &  f) [inline]

Get the file extension from a filename f.

Definition at line 259 of file Utils.hh.

                                           {
    if (!contains(f, ".")) return "";
    return f.substr(f.rfind(".")+1);
  }
string Rivet::file_stem ( const string &  f) [inline]

Get the stem (i.e. part without a file extension) from a filename f.

Definition at line 253 of file Utils.hh.

                                           {
    if (!contains(f, ".")) return f;
    return f.substr(0, f.rfind("."));
  }
bool Rivet::fileexists ( const std::string &  path) [inline]

Convenience function for determining if a filesystem path exists.

Definition at line 12 of file RivetPaths.hh.

                                                {
    return (access(path.c_str(), R_OK) == 0);
  }
Jets Rivet::filter_discard ( const Jets &  jets,
const Cut &  c 
) [inline]

Filter a jet collection in-place to the subset that fails the supplied Cut.

Filter a particle collection in-place to the subset that fails the supplied Cut.

Definition at line 155 of file JetUtils.hh.

                                                             {
    Jets rtn = jets;
    return ifilter_discard(rtn, c);
  }
Jets Rivet::filter_discard ( const Jets &  jets,
const Cut &  c,
Jets &  out 
) [inline]

Filter a jet collection in-place to the subset that fails the supplied Cut.

Filter a particle collection in-place to the subset that fails the supplied Cut.

Definition at line 161 of file JetUtils.hh.

                                                                        {
    out = filter_discard(jets, c);
    return out;
  }
CONTAINER Rivet::filter_discard ( const CONTAINER &  c,
const FN &  f 
) [inline]

Filter a collection by copy, removing the subset that passes the supplied function.

<

Todo:
More efficient would be copy_if with back_inserter...

Definition at line 370 of file Utils.hh.

                                                                   {
    CONTAINER rtn = c;
    return ifilter_discard(rtn, f); ///< @todo More efficient would be copy_if with back_inserter...
  }
CONTAINER& Rivet::filter_discard ( const CONTAINER &  c,
const FN &  f,
CONTAINER &  out 
) [inline]

Filter a collection by copy into a supplied container, removing the subset that passes the supplied function

Note:
New container will be replaced, not appended to

Definition at line 378 of file Utils.hh.

                                                                                    {
    out = filter_discard(c, f);
    return out;
  }
Jets Rivet::filter_select ( const Jets &  jets,
const Cut &  c 
) [inline]

Filter a jet collection in-place to the subset that passes the supplied Cut.

Filter a particle collection in-place to the subset that passes the supplied Cut.

Definition at line 133 of file JetUtils.hh.

                                                            {
    Jets rtn = jets;
    return ifilter_select(rtn, c);
  }
Jets Rivet::filter_select ( const Jets &  jets,
const Cut &  c,
Jets &  out 
) [inline]

Filter a jet collection in-place to the subset that passes the supplied Cut.

Filter a particle collection in-place to the subset that passes the supplied Cut.

Definition at line 142 of file JetUtils.hh.

                                                                       {
    out = filter_select(jets, c);
    return out;
  }
CONTAINER Rivet::filter_select ( const CONTAINER &  c,
const FN &  f 
) [inline]

Filter a collection by copy, keeping the subset that passes the supplied function.

<

Todo:
More efficient would be copy_if with back_inserter ... but is that equally container agnostic?

Definition at line 394 of file Utils.hh.

                                                                  {
    CONTAINER rtn = c;
    return ifilter_select(rtn, f); ///< @todo More efficient would be copy_if with back_inserter ... but is that equally container agnostic?
  }
CONTAINER& Rivet::filter_select ( const CONTAINER &  c,
const FN &  f,
CONTAINER &  out 
) [inline]

Filter a collection by copy into a supplied container, keeping the subset that passes the supplied function

Note:
New container will be replaced, not appended to

Definition at line 402 of file Utils.hh.

                                                                                   {
    out = filter_select(c, f);
    return out;
  }
Jets Rivet::filterBy ( const Jets &  jets,
const Cut &  c 
) [inline]

Alias for ifilter_select

Deprecated:
Use filter_select

Alias for ifilter_select

Deprecated:
Use filter_select

Definition at line 139 of file JetUtils.hh.

{ return filter_select(jets, c); }
Jets Rivet::filterBy ( const Jets &  jets,
const Cut &  c,
Jets &  out 
) [inline]

Alias for ifilter_select

Deprecated:
Use filter_select

Alias for ifilter_select

Deprecated:
Use filter_select

Definition at line 148 of file JetUtils.hh.

{ return filter_select(jets, c, out); }
std::string Rivet::findAnalysisDataFile ( const std::string &  filename,
const std::vector< std::string > &  pathprepend = std::vector< std::string >(),
const std::vector< std::string > &  pathappend = std::vector< std::string >() 
)

Find the first file of the given name in the general data file search dirs.

Note:
If none found, returns an empty string
std::string Rivet::findAnalysisInfoFile ( const std::string &  filename,
const std::vector< std::string > &  pathprepend = std::vector< std::string >(),
const std::vector< std::string > &  pathappend = std::vector< std::string >() 
)

Find the first file of the given name in the analysis info file search dirs.

Note:
If none found, returns an empty string
std::string Rivet::findAnalysisLibFile ( const std::string &  filename)

Find the first file of the given name in the analysis library search dirs.

Note:
If none found, returns an empty string
std::string Rivet::findAnalysisPlotFile ( const std::string &  filename,
const std::vector< std::string > &  pathprepend = std::vector< std::string >(),
const std::vector< std::string > &  pathappend = std::vector< std::string >() 
)

Find the first file of the given name in the analysis plot file search dirs.

Note:
If none found, returns an empty string
std::string Rivet::findAnalysisRefFile ( const std::string &  filename,
const std::vector< std::string > &  pathprepend = std::vector< std::string >(),
const std::vector< std::string > &  pathappend = std::vector< std::string >() 
)

Find the first file of the given name in the ref data file search dirs.

Note:
If none found, returns an empty string
bool Rivet::fromBottom ( const Particle &  p) [inline]

Determine whether the particle is from a b-hadron decay.

Definition at line 457 of file ParticleUtils.hh.

{ return p.fromBottom(); }
bool Rivet::fromCharm ( const Particle &  p) [inline]

Determine whether the particle is from a c-hadron decay.

Definition at line 460 of file ParticleUtils.hh.

{ return p.fromCharm(); }
bool Rivet::fromDecay ( const Particle &  p) [inline]

Determine whether the particle is from a hadron or tau decay.

Deprecated:
Too vague: use fromHadron or fromHadronicTau

Definition at line 475 of file ParticleUtils.hh.

{ return p.fromDecay(); }
bool Rivet::fromHadron ( const Particle &  p) [inline]

Determine whether the particle is from a hadron decay.

Definition at line 463 of file ParticleUtils.hh.

{ return p.fromHadron(); }
bool Rivet::fromPromptTau ( const Particle &  p) [inline]

Determine whether the particle is from a prompt tau decay.

Definition at line 471 of file ParticleUtils.hh.

{ return p.fromPromptTau(); }
bool Rivet::fromTau ( const Particle &  p,
bool  prompt_taus_only = false 
) [inline]

Determine whether the particle is from a tau decay.

Definition at line 466 of file ParticleUtils.hh.

                                                                      {
    return p.fromTau(prompt_taus_only);
  }
std::enable_if< std::is_integral< N1 >::value &&std::is_integral< N2 >::value, bool >::type fuzzyEquals ( N1  a,
N2  b,
double  tolerance = 1e-5 
) [inline]

Compare two numbers for equality with a degree of fuzziness.

This version for floating point types (if any argument is FP) has a degree of fuzziness expressed by the fractional tolerance parameter, for floating point safety.

Simpler SFINAE template specialisation for integers, since there is no FP precision issue.

Definition at line 45 of file MathUtils.hh.

                                                 {
    const double absavg = (std::abs(a) + std::abs(b))/2.0;
    const double absdiff = std::abs(a - b);
    const bool rtn = (isZero(a) && isZero(b)) || absdiff < tolerance*absavg;
    return rtn;
  }
bool Rivet::fuzzyEquals ( const Vector< N > &  va,
const Vector< N > &  vb,
double  tolerance = 1E-5 
) [inline]

Compare two vectors by index, allowing for numerical precision.

Definition at line 172 of file VectorN.hh.

                                                                                           {
    for (size_t i = 0; i < N; ++i) {
      const double a = va.get(i);
      const double b = vb.get(i);
      if (!Rivet::fuzzyEquals(a, b, tolerance)) return false;
    }
    return true;
  }
bool Rivet::fuzzyEquals ( const Matrix< N > &  ma,
const Matrix< N > &  mb,
double  tolerance = 1E-5 
) [inline]

Compare two matrices by index, allowing for numerical precision.

Definition at line 399 of file MatrixN.hh.

                                                                                           {
    for (size_t i = 0; i < N; ++i) {
      for (size_t j = 0; j < N; ++j) {
        const double a = ma.get(i, j);
        const double b = mb.get(i, j);
        if (!Rivet::fuzzyEquals(a, b, tolerance)) return false;
      }
    }
    return true;
  }
std::enable_if< std::is_arithmetic<N1>::value && std::is_arithmetic<N2>::value, bool>::type Rivet::fuzzyGtrEquals ( N1  a,
N2  b,
double  tolerance = 1e-5 
) [inline]

Compare two numbers for >= with a degree of fuzziness.

The tolerance parameter on the equality test is as for fuzzyEquals.

Definition at line 70 of file MathUtils.hh.

                                                    {
    return a > b || fuzzyEquals(a, b, tolerance);
  }
std::enable_if< std::is_arithmetic<N1>::value && std::is_arithmetic<N2>::value && std::is_arithmetic<N3>::value, bool>::type Rivet::fuzzyInRange ( N1  value,
N2  low,
N3  high,
RangeBoundary  lowbound = CLOSED,
RangeBoundary  highbound = OPEN 
) [inline]

Determine if value is in the range low to high, for floating point numbers.

Interval boundary types are defined by lowbound and highbound. Closed intervals are compared fuzzily.

Definition at line 123 of file MathUtils.hh.

                                                                            {
    if (lowbound == OPEN && highbound == OPEN) {
      return (value > low && value < high);
    } else if (lowbound == OPEN && highbound == CLOSED) {
      return (value > low && fuzzyLessEquals(value, high));
    } else if (lowbound == CLOSED && highbound == OPEN) {
      return (fuzzyGtrEquals(value, low) && value < high);
    } else { // if (lowbound == CLOSED && highbound == CLOSED) {
      return (fuzzyGtrEquals(value, low) && fuzzyLessEquals(value, high));
    }
  }
std::enable_if< std::is_arithmetic<N1>::value && std::is_arithmetic<N2>::value, bool>::type Rivet::fuzzyLessEquals ( N1  a,
N2  b,
double  tolerance = 1e-5 
) [inline]

Compare two floating point numbers for <= with a degree of fuzziness.

The tolerance parameter on the equality test is as for fuzzyEquals.

Definition at line 81 of file MathUtils.hh.

                                                     {
    return a < b || fuzzyEquals(a, b, tolerance);
  }
std::vector<std::string> Rivet::getAnalysisDataPaths ( )

Get Rivet analysis reference data search paths.

std::vector<std::string> Rivet::getAnalysisInfoPaths ( )

Get Rivet analysis info metadata search paths.

std::vector<std::string> Rivet::getAnalysisLibPaths ( )

Get Rivet analysis plugin library search paths.

std::vector<std::string> Rivet::getAnalysisPlotPaths ( )

Get Rivet analysis plot style search paths.

std::vector<std::string> Rivet::getAnalysisRefPaths ( )

Get Rivet analysis reference data search paths.

string Rivet::getDatafilePath ( const string &  papername)

Get the file system path to the reference file for this paper.

std::string Rivet::getDataPath ( )

Get data install path.

T Rivet::getEnvParam ( const std::string  name,
const T &  fallback 
)

Get a parameter from a named environment variable, with automatic type conversion.

Note:
Return fallback if the variable is not defined, otherwise convert its string to the template type
Todo:
Should the param name have to be specific to an analysis? Can specialise as an Analysis member fn.

Definition at line 506 of file Utils.hh.

                                                         {
    char* env = getenv(name.c_str());
    return env ? lexical_cast<T>(env) : fallback;
  }
std::string Rivet::getLibPath ( )

Get library install path.

map<string, AnalysisObjectPtr> Rivet::getRefData ( const string &  papername)

Function to get a map of all the refdata in a paper with the given papername.

std::string Rivet::getRivetDataPath ( )

Get Rivet data install path.

bool Rivet::has_key ( const std::map< K, T > &  m,
const K &  key 
) [inline]

Does the map m contain the key key?

Definition at line 106 of file RivetSTL.hh.

                                                           {
    return m.find(key) != end(m);
  }
bool Rivet::has_value ( const std::map< K, T > &  m,
const T &  val 
) [inline]

Does the map m contain the value val?

Definition at line 112 of file RivetSTL.hh.

                                                             {
    for (typename std::map<K,T>::const_iterator it = begin(m); it != end(m); ++it) {
      if (it->second == val) return true;
    }
    return false;
  }
bool Rivet::hasAncestor ( const Particle &  p,
PdgId  pid 
) [inline]

Check whether a given PID is found in the particle's ancestor list

Deprecated:
Prefer hasAncestorWith

Definition at line 454 of file ParticleUtils.hh.

{ return p.hasAncestor(pid); }
bool Rivet::hasAncestorWith ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle has an ancestor which meets the function requirement.

Definition at line 354 of file ParticleUtils.hh.

                                                                            {
    return p.hasAncestorWith(f);
  }
bool Rivet::hasAncestorWithout ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle has an ancestor which doesn't meet the function requirement.

Definition at line 359 of file ParticleUtils.hh.

                                                                               {
    return p.hasAncestorWithout(f);
  }
bool Rivet::hasChildWith ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle has a child which meets the function requirement.

Definition at line 376 of file ParticleUtils.hh.

                                                                         {
    return p.hasChildWith(f);
  }
bool Rivet::hasChildWithout ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle has a child which doesn't meet the function requirement.

Definition at line 381 of file ParticleUtils.hh.

                                                                            {
    return p.hasChildWithout(f);
  }
bool Rivet::hasDescendantWith ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle has a descendant which meets the function requirement.

Definition at line 387 of file ParticleUtils.hh.

                                                                              {
    return p.hasDescendantWith(f);
    // return !p.allDescendants(f).empty();
  }
bool Rivet::hasDescendantWithout ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle has a descendant which doesn't meet the function requirement.

Definition at line 393 of file ParticleUtils.hh.

                                                                                 {
    return p.hasDescendantWithout(f);
  }
bool Rivet::hasHadronicDecay ( const Particle &  p) [inline]

Decide if a given particle decays hadronically.

Definition at line 438 of file ParticleUtils.hh.

                                                  {
    if (p.isStable()) return false;
    if (p.hasChildWith(isHadron)) return true;
    return false;
  }
bool Rivet::hasLeptonicDecay ( const Particle &  p) [inline]

Decide if a given particle decays leptonically (decays, and no hadrons)

Definition at line 445 of file ParticleUtils.hh.

                                                  {
    if (p.isStable()) return false;
    if (p.hasChildWith(isHadron)) return false;
    return true;
  }
bool Rivet::hasParentWith ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle has a parent which meets the function requirement.

Definition at line 365 of file ParticleUtils.hh.

                                                                          {
    return p.hasParentWith(f);
  }
bool Rivet::hasParentWithout ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle has a parent which doesn't meet the function requirement.

Definition at line 370 of file ParticleUtils.hh.

                                                                             {
    return p.hasParentWithout(f);
  }
bool Rivet::hasStableDescendantWith ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle has a stable descendant which meets the function requirement.

Definition at line 399 of file ParticleUtils.hh.

                                                                                    {
    return p.hasStableDescendantWith(f);
  }
bool Rivet::hasStableDescendantWithout ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle has a stable descendant which doesn't meet the function requirement.

Definition at line 404 of file ParticleUtils.hh.

                                                                                       {
    return p.hasStableDescendantWithout(f);
  }
CONTAINER Rivet::head ( const CONTAINER &  c,
int  n 
) [inline]

Head slice of the n first container elements.

Negative n means to take the head excluding the {n}-element tail

Definition at line 436 of file Utils.hh.

                                                   {
    // if (n > c.size()) throw RangeError("Requested head longer than container");
    if (n < 0) n = std::max(0, (int)c.size()+n);
    n = std::min(n, (int)c.size());
    return slice(c, 0, n);
  }
void Rivet::idiscardIfAnyDeltaPhiLess ( PBCONTAINER1 &  tofilter,
const PBCONTAINER2 &  tocompare,
double  dphi 
)

Definition at line 492 of file ParticleBaseUtils.hh.

                                                                                                     {
    for (const ParticleBase& pb : tocompare)
      ifilter_discard(tofilter, deltaPhiLess(pb, dphi));
  }
void Rivet::idiscardIfAnyDeltaRLess ( PBCONTAINER1 &  tofilter,
const PBCONTAINER2 &  tocompare,
double  dR 
)

Definition at line 479 of file ParticleBaseUtils.hh.

                                                                                                 {
    for (const ParticleBase& pb : tocompare)
      ifilter_discard(tofilter, deltaRLess(pb, dR));
  }
Jets& Rivet::ifilter_discard ( Jets &  jets,
const Cut &  c 
)

Filter a jet collection in-place to the subset that fails the supplied Cut.

Filter a particle collection in-place to the subset that fails the supplied Cut.

CONTAINER& Rivet::ifilter_discard ( CONTAINER &  c,
const FN &  f 
) [inline]

Filter a collection in-place, removing the subset that passes the supplied function.

Definition at line 362 of file Utils.hh.

                                                               {
    const auto newend = std::remove_if(std::begin(c), std::end(c), f);
    c.erase(newend, c.end());
    return c;
  }
Jets& Rivet::ifilter_select ( Jets &  jets,
const Cut &  c 
)

Filter a jet collection in-place to the subset that passes the supplied Cut.

Filter a particle collection in-place to the subset that passes the supplied Cut.

CONTAINER& Rivet::ifilter_select ( CONTAINER &  c,
const FN &  f 
) [inline]

Filter a collection in-place, keeping the subset that passes the supplied function.

Definition at line 386 of file Utils.hh.

                                                              {
    //using value_type = typename std::remove_reference<decltype(*std::begin(std::declval<typename std::add_lvalue_reference<CONTAINER>::type>()))>::type;
    auto invf = [&](const typename CONTAINER::value_type& x){ return !f(x); };
    return ifilter_discard(c, invf);
  }
Jets& Rivet::ifilterBy ( Jets &  jets,
const Cut &  c 
) [inline]

Alias for ifilter_select

Deprecated:
Use ifilter_select

Alias for ifilter_select

Deprecated:
Use ifilter_select

Definition at line 130 of file JetUtils.hh.

{ return ifilter_select(jets, c); }
std::enable_if< std::is_arithmetic<N1>::value && std::is_arithmetic<N2>::value && std::is_arithmetic<N3>::value, bool>::type Rivet::in_closed_range ( N1  val,
N2  low,
N3  high 
) [inline]

Boolean function to determine if value is within the given range.

Note:
The interval is closed at both ends.

Definition at line 164 of file MathUtils.hh.

                                           {
    return inRange(val, low, high, CLOSED, CLOSED);
  }
std::enable_if< std::is_arithmetic<N1>::value && std::is_arithmetic<N2>::value && std::is_arithmetic<N3>::value, bool>::type Rivet::in_open_range ( N1  val,
N2  low,
N3  high 
) [inline]

Boolean function to determine if value is within the given range.

Note:
The interval is open at both ends.

Definition at line 174 of file MathUtils.hh.

                                         {
    return inRange(val, low, high, OPEN, OPEN);
  }
std::enable_if< std::is_arithmetic<N1>::value && std::is_arithmetic<N2>::value && std::is_arithmetic<N3>::value, bool>::type Rivet::in_range ( N1  val,
N2  low,
N3  high 
) [inline]

Boolean function to determine if value is within the given range.

Note:
The interval is closed (inclusive) at the low end, and open (exclusive) at the high end.

Definition at line 154 of file MathUtils.hh.

                                    {
    return inRange(val, low, high, CLOSED, OPEN);
  }
std::enable_if< std::is_arithmetic<N1>::value && std::is_arithmetic<N2>::value && std::is_arithmetic<N3>::value, bool>::type Rivet::inRange ( N1  value,
N2  low,
N3  high,
RangeBoundary  lowbound = CLOSED,
RangeBoundary  highbound = OPEN 
) [inline]

Determine if value is in the range low to high, for floating point numbers.

Interval boundary types are defined by lowbound and highbound.

Definition at line 103 of file MathUtils.hh.

                                                                       {
    if (lowbound == OPEN && highbound == OPEN) {
      return (value > low && value < high);
    } else if (lowbound == OPEN && highbound == CLOSED) {
      return (value > low && value <= high);
    } else if (lowbound == CLOSED && highbound == OPEN) {
      return (value >= low && value < high);
    } else { // if (lowbound == CLOSED && highbound == CLOSED) {
      return (value >= low && value <= high);
    }
  }
std::enable_if< std::is_arithmetic<N1>::value && std::is_arithmetic<N2>::value && std::is_arithmetic<N3>::value, bool>::type Rivet::inRange ( N1  value,
pair< N2, N3 >  lowhigh,
RangeBoundary  lowbound = CLOSED,
RangeBoundary  highbound = OPEN 
) [inline]

Alternative version of inRange which accepts a pair for the range arguments.

Definition at line 140 of file MathUtils.hh.

                                                                       {
    return inRange(value, lowhigh.first, lowhigh.second, lowbound, highbound);
  }
set<PdgIdPair> Rivet::intersection ( const set< PdgIdPair > &  a,
const set< PdgIdPair > &  b 
) [inline]

Return the intersection of two sets of {PdgIdPair}s.

Definition at line 52 of file BeamConstraint.hh.

                                                                                       {
    set<PdgIdPair> ret;
    for (set<PdgIdPair>::const_iterator bp = a.begin(); bp != a.end(); ++bp) {
      if (compatible(*bp, b)) ret.insert(*bp);
    }
    return ret;
  }
std::enable_if<std::is_arithmetic<NUM>::value, NUM>::type Rivet::intpow ( NUM  val,
unsigned int  exp 
) [inline]

A more efficient version of pow for raising numbers to integer powers.

Definition at line 226 of file MathUtils.hh.

                                    {
    assert(exp >= 0);
    if (exp == 0) return (NUM) 1;
    else if (exp == 1) return val;
    return val * intpow(val, exp-1);
  }
double Rivet::invariant ( const FourVector &  lv) [inline]

Calculate the Lorentz self-invariant of a 4-vector. $ v_\mu v^\mu = g_{\mu\nu} x^\mu x^\nu $.

Definition at line 277 of file Vector4.hh.

                                                {
    return lv.invariant();
  }
double Rivet::invcdfBW ( double  p,
double  mu,
double  gamma 
) [inline]

Inverse CDF for the Breit-Wigner distribution.

Definition at line 256 of file MathUtils.hh.

                                                            {
    const double xn = std::tan(M_PI*(p-0.5));
    return gamma*xn + mu;
  }
LorentzTransform Rivet::inverse ( const LorentzTransform &  lt) [inline]

Definition at line 262 of file LorentzTrans.hh.

                                                              {
    return lt.inverse();
  }
Matrix<N> Rivet::inverse ( const Matrix< N > &  m) [inline]

Definition at line 350 of file MatrixN.hh.

                                               {
    return m.inverse();
  }
bool Rivet::isDirect ( const Particle &  p,
bool  allow_from_direct_tau = false,
bool  allow_from_direct_mu = false 
) [inline]

Decide if a given particle is direct, via Particle::isDirect()

A "direct" particle is one directly connected to the hard process. It is a preferred alias for "prompt", since it has no confusing implications about distinguishability by timing information.

The boolean arguments allow a decay lepton to be considered direct if its parent was a "real" direct lepton.

Definition at line 421 of file ParticleUtils.hh.

                                                                                                             {
    return p.isDirect(allow_from_direct_tau, allow_from_direct_mu);
  }
bool Rivet::isFirstWith ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle is the first in a decay chain to meet the function requirement.

Definition at line 331 of file ParticleUtils.hh.

                                                                        {
    return p.isFirstWith(f);
  }
bool Rivet::isFirstWithout ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle is the first in a decay chain not to meet the function requirement.

Definition at line 336 of file ParticleUtils.hh.

                                                                           {
    return p.isFirstWithout(f);
  }
bool Rivet::isLastWith ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle is the last in a decay chain to meet the function requirement.

Definition at line 342 of file ParticleUtils.hh.

                                                                       {
    return p.isLastWith(f);
  }
bool Rivet::isLastWithout ( const Particle &  p,
const ParticleSelector &  f 
) [inline]

Determine whether a particle is the last in a decay chain not to meet the function requirement.

Definition at line 347 of file ParticleUtils.hh.

                                                                          {
    return p.isLastWithout(f);
  }
bool Rivet::isOppFlav ( const Particle &  a,
const Particle &  b 
) [inline]

Definition at line 277 of file ParticleUtils.hh.

{ return PID::isOppFlav(a.pid(), b.pid()); }
bool Rivet::isOppSign ( const Particle &  a,
const Particle &  b 
) [inline]

Definition at line 275 of file ParticleUtils.hh.

{ return PID::isOppSign(a.pid(), b.pid()); }
bool Rivet::isOSOF ( const Particle &  a,
const Particle &  b 
) [inline]

Definition at line 281 of file ParticleUtils.hh.

{ return PID::isOSOF(a.pid(), b.pid()); }
bool Rivet::isOSSF ( const Particle &  a,
const Particle &  b 
) [inline]

Definition at line 279 of file ParticleUtils.hh.

{ return PID::isOSSF(a.pid(), b.pid()); }
bool Rivet::isPrompt ( const Particle &  p,
bool  allow_from_prompt_tau = false,
bool  allow_from_prompt_mu = false 
) [inline]

Decide if a given particle is prompt, via Particle::isPrompt()

The boolean arguments allow a decay lepton to be considered prompt if its parent was a "real" prompt lepton.

Definition at line 429 of file ParticleUtils.hh.

                                                                                                             {
    return p.isPrompt(allow_from_prompt_tau, allow_from_prompt_mu);
  }
bool Rivet::isSameFlav ( const Particle &  a,
const Particle &  b 
) [inline]

Definition at line 276 of file ParticleUtils.hh.

{ return PID::isSameFlav(a.pid(), b.pid()); }
bool Rivet::isSameSign ( const Particle &  a,
const Particle &  b 
) [inline]

Definition at line 274 of file ParticleUtils.hh.

{ return PID::isSameSign(a.pid(), b.pid()); }
bool Rivet::isSSOF ( const Particle &  a,
const Particle &  b 
) [inline]

Definition at line 282 of file ParticleUtils.hh.

{ return PID::isSSOF(a.pid(), b.pid()); }
bool Rivet::isSSSF ( const Particle &  a,
const Particle &  b 
) [inline]

Definition at line 280 of file ParticleUtils.hh.

{ return PID::isSSSF(a.pid(), b.pid()); }
bool Rivet::isStable ( const Particle &  p) [inline]

Decide if a given particle is stable, via Particle::isStable()

Definition at line 435 of file ParticleUtils.hh.

{ return p.isStable(); }
bool Rivet::isVisible ( const Particle &  p) [inline]

Is this particle potentially visible in a detector?

Definition at line 411 of file ParticleUtils.hh.

{ return p.isVisible(); }
std::enable_if< std::is_integral< NUM >::value, bool >::type isZero ( NUM  val,
double  tolerance = 1e-8 
) [inline]

Compare a number to zero.

This version for floating point types has a degree of fuzziness expressed by the absolute tolerance parameter, for floating point safety.

SFINAE template specialisation for integers, since there is no FP precision issue.

Definition at line 21 of file MathUtils.hh.

                                         {
    return fabs(val) < tolerance;
  }
bool Rivet::isZero ( const Vector< N > &  v,
double  tolerance = 1E-5 
) [inline]

External form of numerically safe nullness check.

Definition at line 184 of file VectorN.hh.

                                                                {
    return v.isZero(tolerance);
  }
bool Rivet::isZero ( const Matrix< N > &  m,
double  tolerance = 1E-5 
) [inline]

External form of numerically safe nullness check.

Definition at line 413 of file MatrixN.hh.

                                                                {
    return m.isZero(tolerance);
  }
double Rivet::JET_BTAG_ATLAS_RUN1 ( const Jet &  j) [inline]

Return the ATLAS Run 1 jet flavour tagging efficiency for the given Jet.

Todo:
This form drops past ~100 GeV, asymptotically to zero efficiency... really?!

Definition at line 505 of file SmearingFunctions.hh.

                                                  {
    /// @todo This form drops past ~100 GeV, asymptotically to zero efficiency... really?!
    if (j.abseta() > 2.5) return 0;
    const auto ftagsel = [&](const Particle& p){ return p.pT() > 5*GeV && deltaR(p,j) < 0.3; };
    if (j.bTagged(ftagsel)) return 0.80*tanh(0.003*j.pT()/GeV)*(30/(1+0.0860*j.pT()/GeV));
    if (j.cTagged(ftagsel)) return 0.20*tanh(0.020*j.pT()/GeV)*( 1/(1+0.0034*j.pT()/GeV));
    return 0.002 + 7.3e-6*j.pT()/GeV;
  }
double Rivet::JET_BTAG_ATLAS_RUN2_MV2C10 ( const Jet &  j) [inline]

Return the ATLAS Run 2 MC2c10 jet flavour tagging efficiency for the given Jet.

Definition at line 521 of file SmearingFunctions.hh.

                                                         {
    if (j.abseta() > 2.5) return 0;
    if (j.bTagged(Cuts::pT > 5*GeV)) return 0.77;
    if (j.cTagged(Cuts::pT > 5*GeV)) return 1/6.0;
    return 1/134.;
  }
double Rivet::JET_BTAG_ATLAS_RUN2_MV2C20 ( const Jet &  j) [inline]

Return the ATLAS Run 2 MC2c20 jet flavour tagging efficiency for the given Jet.

Definition at line 514 of file SmearingFunctions.hh.

                                                         {
    if (j.abseta() > 2.5) return 0;
    if (j.bTagged(Cuts::pT > 5*GeV)) return 0.77;
    if (j.cTagged(Cuts::pT > 5*GeV)) return 1/4.5;
    return 1/140.;
  }
double Rivet::JET_BTAG_PERFECT ( const Jet &  j) [inline]

Return 1 if the given Jet contains a b, otherwise 0.

Definition at line 38 of file JetSmearingFunctions.hh.

{ return j.bTagged() ? 1 : 0; }
double Rivet::JET_CTAG_PERFECT ( const Jet &  j) [inline]

Return 1 if the given Jet contains a c, otherwise 0.

Definition at line 41 of file JetSmearingFunctions.hh.

{ return j.cTagged() ? 1 : 0; }
double Rivet::JET_EFF_ONE ( const Jet &  p) [inline]

Return a constant 1 given a Jet as argument.

Definition at line 27 of file JetSmearingFunctions.hh.

{ return 1; }
double Rivet::JET_EFF_ZERO ( const Jet &  p) [inline]

Return a constant 0 given a Jet as argument.

Definition at line 25 of file JetSmearingFunctions.hh.

{ return 0; }
Jet Rivet::JET_SMEAR_ATLAS_RUN1 ( const Jet &  j) [inline]

ATLAS Run 1 jet smearing.

Todo:
Also need a JES uncertainty component?
Todo:
Is this the best way to smear? Should we preserve the energy, or pT, or direction?

Definition at line 530 of file SmearingFunctions.hh.

                                                {
    // Jet energy resolution lookup
    //   Implemented by Matthias Danninger for GAMBIT, based roughly on
    //   https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/CONFNOTES/ATLAS-CONF-2015-017/
    //   Parameterisation can be still improved, but eta dependence is minimal
    /// @todo Also need a JES uncertainty component?
    static const vector<double> binedges_pt = {0., 50., 70., 100., 150., 200., 1000., 10000.};
    static const vector<double> jer = {0.145, 0.115, 0.095, 0.075, 0.07, 0.05, 0.04, 0.04}; //< note overflow value
    const int ipt = binIndex(j.pT()/GeV, binedges_pt, true);
    if (ipt < 0) return j;
    const double resolution = jer.at(ipt);

    // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
    /// @todo Is this the best way to smear? Should we preserve the energy, or pT, or direction?
    const double fsmear = max(randnorm(1., resolution), 0.);
    const double mass = j.mass2() > 0 ? j.mass() : 0; //< numerical carefulness...
    Jet rtn(FourMomentum::mkXYZM(j.px()*fsmear, j.py()*fsmear, j.pz()*fsmear, mass));
    //if (deltaPhi(j, rtn) > 0.01) cout << "jdphi: " << deltaPhi(j, rtn) << endl;
    return rtn;
  }
Jet Rivet::JET_SMEAR_ATLAS_RUN2 ( const Jet &  j) [inline]

ATLAS Run 2 jet smearing

Todo:
Just a copy of the Run 1 one: improve!!

Definition at line 553 of file SmearingFunctions.hh.

                                                {
    return JET_SMEAR_ATLAS_RUN1(j);
  }
Jet Rivet::JET_SMEAR_CMS_RUN2 ( const Jet &  j) [inline]

CMS Run 2 jet smearing

Todo:
Just a copy of the suboptimal ATLAS one: improve!!

Definition at line 559 of file SmearingFunctions.hh.

                                              {
    return JET_SMEAR_ATLAS_RUN1(j);
  }
Jet Rivet::JET_SMEAR_IDENTITY ( const Jet &  j) [inline]

Take a jet and return an unmodified copy

Todo:

Modify constituent particle vectors for consistency

Set a null PseudoJet if the Jet is smeared?

Definition at line 63 of file JetSmearingFunctions.hh.

{ return j; }
Jet Rivet::JET_SMEAR_PERFECT ( const Jet &  j) [inline]

Alias for JET_SMEAR_IDENTITY.

Definition at line 65 of file JetSmearingFunctions.hh.

{ return j; }
string Rivet::join ( const vector< T > &  v,
const string &  sep = " " 
) [inline]

Make a string containing the string representations of each item in v, separated by sep.

Definition at line 175 of file Utils.hh.

                                                                {
    string rtn;
    for (size_t i = 0; i < v.size(); ++i) {
      if (i != 0) rtn += sep;
      rtn += to_str(v[i]);
    }
    return rtn;
  }
string Rivet::join ( const set< T > &  s,
const string &  sep = " " 
) [inline]

Make a string containing the string representations of each item in s, separated by sep.

Definition at line 186 of file Utils.hh.

                                                             {
    string rtn;
    for (const T& x : s) {
      if (rtn.size() > 0) rtn += sep;
      rtn += to_str(x);
    }
    return rtn;
  }
T Rivet::lexical_cast ( const U &  in)

Convert between any types via stringstream.

Definition at line 66 of file Utils.hh.

                              {
    try {
      std::stringstream ss;
      ss << in;
      T out;
      ss >> out;
      return out;
    } catch (const std::exception& e) {
      throw bad_lexical_cast(e.what());
    }
  }
vector<double> Rivet::linspace ( size_t  nbins,
double  start,
double  end,
bool  include_end = true 
) [inline]

Make a list of nbins + 1 values equally spaced between start and end inclusive.

NB. The arg ordering and the meaning of the nbins variable is "histogram-like", as opposed to the Numpy/Matlab version.

Definition at line 271 of file MathUtils.hh.

                                                                                                {
    assert(end >= start);
    assert(nbins > 0);
    vector<double> rtn;
    const double interval = (end-start)/static_cast<double>(nbins);
    for (size_t i = 0; i < nbins; ++i) {
      rtn.push_back(start + i*interval);
    }
    assert(rtn.size() == nbins);
    if (include_end) rtn.push_back(end); //< exact end, not result of n * interval
    return rtn;
  }
vector<double> Rivet::logspace ( size_t  nbins,
double  start,
double  end,
bool  include_end = true 
) [inline]

Make a list of nbins + 1 values exponentially spaced between start and end inclusive.

NB. The arg ordering and the meaning of the nbins variable is "histogram-like", as opposed to the Numpy/Matlab version, and the start and end arguments are expressed in "normal" space, rather than as the logarithms of the start/end values as in Numpy/Matlab.

Definition at line 290 of file MathUtils.hh.

                                                                                                {
    assert(end >= start);
    assert(start > 0);
    assert(nbins > 0);
    const double logstart = std::log(start);
    const double logend = std::log(end);
    const vector<double> logvals = linspace(nbins, logstart, logend, false);
    assert(logvals.size() == nbins);
    vector<double> rtn; rtn.reserve(nbins+1);
    rtn.push_back(start); //< exact start, not exp(log(start))
    for (size_t i = 1; i < logvals.size(); ++i) {
      rtn.push_back(std::exp(logvals[i]));
    }
    assert(rtn.size() == nbins);
    if (include_end) rtn.push_back(end); //< exact end, not exp(n * loginterval)
    return rtn;
  }
double Rivet::mapAngle ( double  angle,
PhiMapping  mapping 
) [inline]

Map an angle into the enum-specified range.

Definition at line 547 of file MathUtils.hh.

                                                           {
    switch (mapping) {
    case MINUSPI_PLUSPI:
      return mapAngleMPiToPi(angle);
    case ZERO_2PI:
      return mapAngle0To2Pi(angle);
    case ZERO_PI:
      return mapAngle0To2Pi(angle);
    default:
      throw Rivet::UserError("The specified phi mapping scheme is not implemented");
    }
  }
double Rivet::mapAngle0To2Pi ( double  angle) [inline]

Map an angle into the range [0, 2PI).

Definition at line 529 of file MathUtils.hh.

                                             {
    double rtn = _mapAngleM2PITo2Pi(angle);
    if (isZero(rtn)) return 0;
    if (rtn < 0) rtn += TWOPI;
    if (rtn == TWOPI) rtn = 0;
    assert(rtn >= 0 && rtn < TWOPI);
    return rtn;
  }
double Rivet::mapAngle0ToPi ( double  angle) [inline]

Map an angle into the range [0, PI].

Definition at line 539 of file MathUtils.hh.

                                            {
    double rtn = fabs(mapAngleMPiToPi(angle));
    if (isZero(rtn)) return 0;
    assert(rtn > 0 && rtn <= PI);
    return rtn;
  }
double Rivet::mapAngleMPiToPi ( double  angle) [inline]

Map an angle into the range (-PI, PI].

Definition at line 519 of file MathUtils.hh.

                                              {
    double rtn = _mapAngleM2PITo2Pi(angle);
    if (isZero(rtn)) return 0;
    if (rtn > PI) rtn -= TWOPI;
    if (rtn <= -PI) rtn += TWOPI;
    assert(rtn > -PI && rtn <= PI);
    return rtn;
  }
double Rivet::max ( const vector< double > &  in,
double  errval = DBL_NAN 
) [inline]

Find the maximum value in the vector.

Definition at line 465 of file Utils.hh.

                                                                     {
    const auto e = std::max_element(in.begin(), in.end());
    return e != in.end() ? *e : errval;
  }
int Rivet::max ( const vector< int > &  in,
int  errval = -1 
) [inline]

Find the maximum value in the vector.

Definition at line 486 of file Utils.hh.

                                                       {
    const auto e = std::max_element(in.begin(), in.end());
    return e != in.end() ? *e : errval;
  }
std::enable_if<std::is_arithmetic<NUM>::value, double>::type Rivet::mean ( const vector< NUM > &  sample) [inline]

Calculate the mean of a sample

Todo:
Support multiple container types via SFINAE

Definition at line 398 of file MathUtils.hh.

                                  {
    if (sample.empty()) throw RangeError("Can't compute mean of an empty set");
    double mean = 0.0;
    for (size_t i = 0; i < sample.size(); ++i) {
      mean += sample[i];
    }
    return mean/sample.size();
  }
std::enable_if<std::is_arithmetic<NUM>::value, double>::type Rivet::mean_err ( const vector< NUM > &  sample) [inline]
Todo:
Support multiple container types via SFINAE

Defini