gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-252-gf9a3f78
a Global And Modular Bsm Inference Tool
Utils.hpp File Reference
#include "HEPUtils/MathUtils.h"
#include "HEPUtils/BinnedFn.h"
#include "HEPUtils/Event.h"
#include "HEPUtils/FastJet.h"
#include <functional>
#include <memory>
Include dependency graph for Utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Gambit
 TODO: see if we can use this one:
 
 Gambit::ColliderBit
 

Typedefs

typedef std::vector< HEPUtils::Particle * > Gambit::ColliderBit::ParticlePtrs
 Typedef for a vector of Particle pointers. More...
 
typedef std::vector< const HEPUtils::Particle * > Gambit::ColliderBit::ConstParticlePtrs
 Typedef for a vector of const Particle pointers. More...
 
typedef std::vector< HEPUtils::Jet * > Gambit::ColliderBit::JetPtrs
 Typedef for a vector of Jet pointers. More...
 
typedef std::vector< const HEPUtils::Jet * > Gambit::ColliderBit::ConstJetPtrs
 Typedef for a vector of const Jet pointers. More...
 

Functions

Particle-list filtering by cuts
template<typename CONTAINER , typename RMFN >
void Gambit::ColliderBit::iremoveerase (CONTAINER &c, const RMFN &fn)
 Convenience combination of remove_if and erase. More...
 
void Gambit::ColliderBit::ifilter_reject (ParticlePtrs &particles, std::function< bool(Particle *)> rejfn, bool do_delete=true)
 In-place filter a supplied particle vector by rejecting those which fail a supplied cut. More...
 
void Gambit::ColliderBit::ifilter_select (ParticlePtrs &particles, std::function< bool(Particle *)> selfn, bool do_delete=true)
 In-place filter a supplied particle vector by keeping those which pass a supplied cut. More...
 
ParticlePtrs Gambit::ColliderBit::filter_reject (const ParticlePtrs &particles, std::function< bool(Particle *)> rejfn, bool do_delete=true)
 Filter a supplied particle vector by rejecting those which fail a supplied cut. More...
 
ParticlePtrs Gambit::ColliderBit::filter_select (const ParticlePtrs &particles, std::function< bool(Particle *)> selfn, bool do_delete=true)
 Filter a supplied particle vector by keeping those which pass a supplied cut. More...
 
Jet-list filtering by cuts
void Gambit::ColliderBit::ifilter_reject (JetPtrs &jets, std::function< bool(Jet *)> rejfn, bool do_delete=true)
 In-place filter a supplied jet vector by rejecting those which fail a supplied cut. More...
 
void Gambit::ColliderBit::ifilter_select (JetPtrs &jets, std::function< bool(Jet *)> selfn, bool do_delete=true)
 In-place filter a supplied jet vector by keeping those which pass a supplied cut. More...
 
JetPtrs Gambit::ColliderBit::filter_reject (const JetPtrs &jets, std::function< bool(Jet *)> rejfn, bool do_delete=true)
 Filter a supplied particle vector by rejecting those which fail a supplied cut. More...
 
JetPtrs Gambit::ColliderBit::filter_select (const JetPtrs &jets, std::function< bool(Jet *)> selfn, bool do_delete=true)
 Filter a supplied particle vector by keeping those which pass a supplied cut. More...
 
Random booleans sampled from efficiency maps
bool Gambit::ColliderBit::random_bool (double eff)
 Return a random true/false at a success rate given by a number. More...
 
bool Gambit::ColliderBit::random_bool (const HEPUtils::BinnedFn1D< double > &effmap, double x)
 Return a random true/false at a success rate given by a 1D efficiency map. More...
 
bool Gambit::ColliderBit::random_bool (const HEPUtils::BinnedFn2D< double > &effmap, double x, double y)
 Return a random true/false at a success rate given by a 2D efficiency map. More...
 
Random filtering by efficiency
void Gambit::ColliderBit::filtereff (std::vector< HEPUtils::Particle *> &particles, double eff, bool do_delete=false)
 Utility function for filtering a supplied particle vector by sampling wrt an efficiency scalar. More...
 
void Gambit::ColliderBit::filtereff (std::vector< HEPUtils::Particle *> &particles, std::function< double(HEPUtils::Particle *)> eff_fn, bool do_delete=false)
 Utility function for filtering a supplied particle vector by sampling an efficiency returned by a provided function object. More...
 
void Gambit::ColliderBit::filtereff_pt (std::vector< HEPUtils::Particle *> &particles, const HEPUtils::BinnedFn1D< double > &eff_pt, bool do_delete=false)
 Utility function for filtering a supplied particle vector by sampling wrt a binned 1D efficiency map in pT. More...
 
void Gambit::ColliderBit::filtereff_etapt (std::vector< HEPUtils::Particle *> &particles, const HEPUtils::BinnedFn2D< double > &eff_etapt, bool do_delete=false)
 Utility function for filtering a supplied particle vector by sampling wrt a binned 2D efficiency map in |eta| and pT. More...
 
Tagging
bool Gambit::ColliderBit::has_tag (const HEPUtils::BinnedFn2D< double > &effmap, double eta, double pt)
 Randomly get a tag result (can be anything) from a 2D |eta|-pT efficiency map. More...
 
template<typename NUM1 , typename NUM2 >
size_t Gambit::ColliderBit::binIndex (NUM1 val, const std::vector< NUM2 > &binedges, bool allow_overflow=false)
 
std::vector< doubleGambit::ColliderBit::mk_bin_values (const std::vector< double > &binEdgeValues)
 Make a vector of central bin values from a vector of bin edge values using linear interpolation. More...
 
std::vector< doubleGambit::ColliderBit::makeBinValues (const std::vector< double > &binEdgeValues)
 Alias. More...
 
template<typename MOM >
std::vector< std::shared_ptr< HEPUtils::Jet > > Gambit::ColliderBit::get_jets (const std::vector< MOM *> &moms, double R, double ptmin=0 *GeV, FJNS::JetAlgorithm alg=FJNS::antikt_algorithm)
 Run jet clustering from any P4-compatible momentum type. More...
 
bool Gambit::ColliderBit::object_in_cone (const HEPUtils::Event &e, const HEPUtils::P4 &p4, double ptmin, double rmax, double rmin=0.05)
 Check if there's a physics object above ptmin in an annulus rmin..rmax around the given four-momentum p4. More...
 
template<typename MOMPTRS1 , typename MOMPTRS2 >
void Gambit::ColliderBit::removeOverlap (MOMPTRS1 &momstofilter, const MOMPTRS2 &momstocmp, double deltaRMax, bool use_rapidity=false)
 Overlap removal – discard from first list if within deltaRMax of any from the second list. More...
 
template<typename CONTAINER , typename FN >
bool Gambit::ColliderBit::all_of (const CONTAINER &c, const FN &f)
 Non-iterator version of std::all_of. More...
 
template<typename CONTAINER , typename FN >
bool Gambit::ColliderBit::any_of (const CONTAINER &c, const FN &f)
 Non-iterator version of std::any_of. More...
 
template<typename CONTAINER , typename FN >
bool Gambit::ColliderBit::none_of (const CONTAINER &c, const FN &f)
 Non-iterator version of std::none_of. More...
 
std::vector< std::vector< HEPUtils::Particle * > > Gambit::ColliderBit::getSFOSpairs (std::vector< HEPUtils::Particle *> particles)
 Utility function for returning a collection of same-flavour, oppsosite-sign particle pairs. More...
 
std::vector< std::vector< HEPUtils::Particle * > > Gambit::ColliderBit::getOSpairs (std::vector< HEPUtils::Particle *> particles)
 Utility function for returning a collection of oppsosite-sign particle pairs. More...
 
std::vector< std::vector< HEPUtils::Particle * > > Gambit::ColliderBit::getSSpairs (std::vector< HEPUtils::Particle *> particles)
 Utility function for returning a collection of same-sign particle pairs. More...
 
Sorting
void Gambit::ColliderBit::sortBy (ParticlePtrs &particles, std::function< bool(const Particle *, const Particle *)> cmpfn)
 Particle-sorting function. More...
 
bool Gambit::ColliderBit::cmpParticlesByPt (const HEPUtils::Particle *lep1, const HEPUtils::Particle *lep2)
 Comparison function to give a particles sorting order decreasing by pT. More...
 
void Gambit::ColliderBit::sortByPt (ParticlePtrs &particles)
 
void Gambit::ColliderBit::sortBy (JetPtrs &jets, std::function< bool(const Jet *, const Jet *)> cmpfn)
 Jet-sorting function. More...
 
bool Gambit::ColliderBit::cmpJetsByPt (const HEPUtils::Jet *jet1, const HEPUtils::Jet *jet2)
 Comparison function to give a jets sorting order decreasing by pT. More...