1 #ifndef __FASTJET_SELECTOR_HH__ 
    2 #define __FASTJET_SELECTOR_HH__ 
   34 #include "fastjet/PseudoJet.hh" 
   36 #include "fastjet/RangeDefinition.hh"   
   41 FASTJET_BEGIN_NAMESPACE      
 
   84   virtual void terminator(std::vector<const PseudoJet *> & jets)
 const {
 
   85     for (
unsigned i = 0; i < jets.size(); i++) {
 
   86       if (jets[i] && !pass(*jets[i])) jets[i] = NULL;
 
   94   virtual std::string 
description()
 const {
return "missing description";}
 
  107     throw Error(
"set_reference(...) cannot be used for a selector worker that does not take a reference");
 
  115     throw Error(
"this SelectorWorker has nothing to copy");
 
  124     rapmax = std::numeric_limits<double>::infinity();
 
  133   virtual bool has_finite_area() 
const;
 
  140     throw Error(
"this selector has no computable area");
 
  179     if (!validated_worker()->applies_jet_by_jet()) {
 
  180       throw Error(
"Cannot apply this selector to an individual jet");
 
  182     return _worker->pass(jet);
 
  194   unsigned int count(
const std::vector<PseudoJet> & jets) 
const;
 
  200   PseudoJet sum(
const std::vector<PseudoJet> & jets) 
const;
 
  206   double scalar_pt_sum(
const std::vector<PseudoJet> & jets) 
const;
 
  210   void sift(
const std::vector<PseudoJet> & jets,
 
  211                   std::vector<PseudoJet> & jets_that_pass,
 
  212                   std::vector<PseudoJet> & jets_that_fail) 
const;
 
  216     return validated_worker()->applies_jet_by_jet();
 
  220   std::vector<PseudoJet> operator()(
const std::vector<PseudoJet> & jets) 
const;
 
  228     validated_worker()->terminator(jets);
 
  233     return validated_worker()->get_rapidity_extent(rapmin, rapmax);
 
  238     return validated_worker()->description();
 
  244     return validated_worker()->is_geometric();
 
  251     return validated_worker()->has_finite_area();
 
  273   double area(
double ghost_area) 
const;
 
  288     return validated_worker()->takes_reference();
 
  295     if (! validated_worker()->takes_reference()){
 
  301     _copy_worker_if_needed();
 
  303     _worker->set_reference(reference);
 
  318     InvalidArea() : 
Error(
"Attempt to obtain area from Selector for which this is not meaningful") {}
 
  341     if (_worker.unique()) 
return;
 
  345     _worker.reset(_worker->copy());
 
  365 Selector SelectorIdentity();
 
  378 Selector 
operator ||(
const Selector & s1, 
const Selector & s2);
 
  388 Selector 
operator&&(
const Selector & s1, 
const Selector & s2);
 
  398 Selector 
operator*(
const Selector & s1, 
const Selector & s2);
 
  467 Selector 
SelectorRectangle(
const double half_rap_width, 
const double half_phi_width);
 
  490 FASTJET_END_NAMESPACE      
 
  492 #endif // __FASTJET_SELECTOR_HH__ 
 
bool operator()(const PseudoJet &jet) const
an operator way of knowing whether a given jet passes the selection or not
 
Selector SelectorAbsRapMax(double absrapmax)
select objects with |rap| <= absrapmax
 
virtual bool takes_reference() const
returns true if the worker is defined with respect to a reference jet
 
virtual SelectorWorker * copy()
return a copy of the current object.
 
Selector SelectorRectangle(const double half_rap_width, const double half_phi_width)
select objets within rapidity distance 'half_rap_width' from the reference jet and azimuthal-angle di...
 
Selector operator||(const Selector &s1, const Selector &s2)
logical or between two selectors
 
bool is_geometric() const
returns true if it is a geometric selector (i.e.
 
Selector SelectorAbsEtaMax(double absetamax)
select objects with |eta| <= absetamax
 
bool applies_jet_by_jet() const
returns true if this can be applied jet by jet
 
bool takes_reference() const
returns true if this can be applied jet by jet
 
virtual bool has_known_area() const
check if it has an analytically computable area
 
Selector SelectorNHardest(unsigned int n)
select the n hardest objects
 
Selector SelectorPtRange(double ptmin, double ptmax)
select objects with ptmin <= pt <= ptmax
 
Selector SelectorEtRange(double Etmin, double Etmax)
select objects with Etmin <= Et <= Etmax
 
virtual ~SelectorWorker()
default dtor
 
Selector SelectorAbsEtaMin(double absetamin)
select objects with |eta| >= absetamin
 
Selector SelectorEtaMin(double etamin)
select objects with eta >= etamin
 
const SelectorWorker * validated_worker() const
returns a worker if there is a valid one, otherwise throws an InvalidWorker error
 
Selector SelectorEtMax(double Etmax)
select objects with Et <= Etmax
 
void get_rapidity_extent(double &rapmin, double &rapmax) const
returns the rapidity range for which it may return "true"
 
std::string description() const
returns a textual description of the selector
 
Selector operator&&(const Selector &s1, const Selector &s2)
logical and between two selectors
 
Selector SelectorStrip(const double half_width)
select objets within a rapidity distance 'half_width' from the location of the reference jet,...
 
Selector operator*(const Selector &s1, const Selector &s2)
successive application of 2 selectors
 
Selector(SelectorWorker *worker_in)
constructor that causes the Selector to use the supplied worker
 
Selector SelectorAbsRapMin(double absrapmin)
select objects with |rap| >= absrapmin
 
void _copy_worker_if_needed()
Helper for copying selector workers if needed.
 
Selector SelectorCircle(const double radius)
select objets within a distance 'radius' from the location of the reference jet, set by Selector::set...
 
Selector SelectorPtFractionMin(double fraction)
select objects that carry at least a fraction "fraction" of the reference jet.
 
virtual bool pass(const PseudoJet &jet) const =0
returns true if a given object passes the selection criterion, and is the main function that needs to...
 
Selector SelectorMassMax(double mmax)
select objects with Mass <= Mmax
 
Selector SelectorRapRange(double rapmin, double rapmax)
select objects with rapmin <= rap <= rapmax
 
Selector SelectorEMax(double Emax)
select objects with E <= Emax
 
Selector SelectorRapPhiRange(double rapmin, double rapmax, double phimin, double phimax)
select objects with rapmin <= rap <= rapmax && phimin <= phi <= phimax
 
An implementation of shared pointers that is broadly similar to C++11 shared_ptr (https://en....
 
Selector SelectorAbsEtaRange(double absetamin, double absetamax)
select objects with absetamin <= |eta| <= absetamax
 
virtual void terminator(std::vector< const PseudoJet * > &jets) const
For each jet that does not pass the cuts, this routine sets the pointer to 0.
 
const Selector & set_reference(const PseudoJet &reference)
set the reference jet for this Selector
 
Selector SelectorEtMin(double Etmin)
select objects with Et >= Etmin
 
class that gets thrown when a Selector is applied despite it not having a valid underlying worker.
 
class that gets thrown when the area is requested from a Selector for which the area is not meaningfu...
 
default selector worker is an abstract virtual base class
 
Selector SelectorPtMin(double ptmin)
select objects with pt >= ptmin
 
Selector SelectorEMin(double Emin)
select objects with E >= Emin
 
virtual bool applies_jet_by_jet() const
returns true if this can be applied jet by jet
 
Selector SelectorEtaRange(double etamin, double etamax)
select objects with etamin <= eta <= etamax
 
Selector SelectorMassRange(double mmin, double mmax)
select objects with Mmin <= Mass <= Mmax
 
virtual std::string description() const
returns a description of the worker
 
Selector SelectorRapMax(double rapmax)
select objects with rap <= rapmax
 
const SharedPtr< SelectorWorker > & worker() const
returns a (reference to) the underlying worker's shared pointer
 
Class to contain pseudojets, including minimal information of use to jet-clustering routines.
 
virtual bool is_geometric() const
check if it is a geometric selector (i.e.
 
virtual void set_reference(const PseudoJet &)
sets the reference jet for the selector NB: "reference" is commented to avoid unused-variable compile...
 
Class that encodes information about cuts and other selection criteria that can be applied to PseudoJ...
 
virtual ~Selector()
dummy virtual dtor
 
Selector SelectorAbsRapRange(double rapmin, double rapmax)
select objects with absrapmin <= |rap| <= absrapmax
 
bool has_finite_area() const
returns true if it has a meaningful and finite area (i.e.
 
Selector operator!(const Selector &s)
logical not applied on a selector
 
bool pass(const PseudoJet &jet) const
return true if the jet passes the selection
 
class for holding a range definition specification, given by limits on rapidity and azimuth.
 
Selector SelectorERange(double Emin, double Emax)
select objects with Emin <= E <= Emax
 
Selector SelectorPhiRange(double phimin, double phimax)
select objects with phimin <= phi <= phimax
 
virtual void nullify_non_selected(std::vector< const PseudoJet * > &jets) const
For each jet that does not pass the cuts, this routine sets the pointer to 0.
 
Selector SelectorIsZero()
select PseudoJet with 0 momentum
 
Selector SelectorIsPureGhost()
select objects that are (or are only made of) ghosts.
 
Selector SelectorPtMax(double ptmax)
select objects with pt <= ptmax
 
virtual double known_area() const
if it has a computable area, return it
 
virtual void get_rapidity_extent(double &rapmin, double &rapmax) const
returns the rapidity range for which it may return "true"
 
base class corresponding to errors that can be thrown by FastJet
 
Selector SelectorMassMin(double mmin)
select objects with Mass >= Mmin
 
Selector()
default constructor produces a Selector whose action is undefined (any attempt to use it will lead to...
 
Selector SelectorDoughnut(const double radius_in, const double radius_out)
select objets with distance from the reference jet is between 'radius_in' and 'radius_out'; the refer...
 
Selector SelectorEtaMax(double etamax)
select objects with eta <= etamax
 
Selector SelectorRapMin(double rapmin)
select objects with rap >= rapmin