Loading...
Searching...
No Matches
fastjet::Selector Class Reference
Selectors

Class that encodes information about cuts and other selection criteria that can be applied to PseudoJet(s). More...

`#include <fastjet/Selector.hh>`

## Classes

class | InvalidWorker
| class that gets thrown when a Selector is applied despite it not having a valid underlying worker. More...
class | InvalidArea
| class that gets thrown when the area is requested from a Selector for which the area is not meaningful More...

## Public Member Functions

| Selector ()
| default constructor produces a Selector whose action is undefined (any attempt to use it will lead to an error)
| Selector (SelectorWorker *worker_in)
| constructor that causes the Selector to use the supplied worker
| Selector (const RangeDefinition &range)
| ctor from a RangeDefinition
virtual | ~Selector ()
| dummy virtual dtor
bool | pass (const PseudoJet &jet) const
| return true if the jet passes the selection
bool | operator() (const PseudoJet &jet) const
| an operator way of knowing whether a given jet passes the selection or not
unsigned int | count (const std::vector< PseudoJet > &jets) const
| Return a count of the objects that pass the selection.
PseudoJet | sum (const std::vector< PseudoJet > &jets) const
| Return the 4-vector sum of the objects that pass the selection.
double | scalar_pt_sum (const std::vector< PseudoJet > &jets) const
| Return the scalar pt sum of the objects that pass the selection.
void | sift (const std::vector< PseudoJet > &jets, std::vector< PseudoJet > &jets_that_pass, std::vector< PseudoJet > &jets_that_fail) const
| sift the input jets into two vectors – those that pass the selector and those that do not
bool | applies_jet_by_jet () const
| returns true if this can be applied jet by jet
std::vector< PseudoJet > | operator() (const std::vector< PseudoJet > &jets) const
| returns a vector with the jets that pass the selection
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.
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
bool | is_geometric () const
| returns true if it is a geometric selector (i.e.
bool | has_finite_area () const
| returns true if it has a meaningful and finite area (i.e.
double | area () const
| returns the rapidity-phi area associated with the Selector (throws InvalidArea if the area does not make sense).
double | area (double ghost_area) const
| returns the rapidity-phi area associated with the Selector (throws InvalidArea if the area does not make sense).
const SharedPtr< SelectorWorker > & | worker () const
| returns a (reference to) the underlying worker's shared pointer
const SelectorWorker * | validated_worker () const
| returns a worker if there is a valid one, otherwise throws an InvalidWorker error
bool | takes_reference () const
| returns true if this can be applied jet by jet
const Selector & | set_reference (const PseudoJet &reference)
| set the reference jet for this Selector
Selector & | operator&= (const Selector &b)
| For 2 Selectors a and b, a &= b is eauivalent to a = a && b;.
Selector & | operator|= (const Selector &b)
| For 2 Selectors a and b, a |= b is eauivalent to a = a || b;.

## Protected Member Functions

void | _copy_worker_if_needed ()
| Helper for copying selector workers if needed.

## Detailed Description

Class that encodes information about cuts and other selection criteria that can be applied to PseudoJet(s).

Definition at line 149 of file Selector.hh.

## Constructor & Destructor Documentation

## Selector() [1/3]

fastjet::Selector::Selector | ( |  | ) |

inline

default constructor produces a Selector whose action is undefined (any attempt to use it will lead to an error)

Definition at line 153 of file Selector.hh.

## Selector() [2/3]

fastjet::Selector::Selector | ( | SelectorWorker * | worker_in | ) |

inline

constructor that causes the Selector to use the supplied worker

Note that the Selector takes ownership of the pointer to the worker (and so will delete automatically when appropriate).

Definition at line 159 of file Selector.hh.

## Selector() [3/3]

fastjet::Selector::Selector | ( | const RangeDefinition & | range | ) |

ctor from a RangeDefinition

This is provided for backward compatibility and will be removed in a future major release of FastJet

Watch out that the Selector will only hold a pointer to the range so the selector will crash if one tries to use it after the range has gone out of scope. We thus strongly advise against the direct use of this constructor.

Definition at line 1475 of file Selector.cc.

## ~Selector()

virtual fastjet::Selector::~Selector | ( |  | ) |

inline virtual

dummy virtual dtor

Definition at line 175 of file Selector.hh.

## Member Function Documentation

## pass()

bool fastjet::Selector::pass | ( | const PseudoJet & | jet | ) | const

inline

return true if the jet passes the selection

Definition at line 178 of file Selector.hh.

## operator()() [1/2]

bool fastjet::Selector::operator() | ( | const PseudoJet & | jet | ) | const

inline

an operator way of knowing whether a given jet passes the selection or not

Definition at line 186 of file Selector.hh.

## count()

unsigned int fastjet::Selector::count | ( | const std::vector< PseudoJet > & | jets | ) | const

Return a count of the objects that pass the selection.

This will often be more efficient that getting the vector of objects that passes and then evaluating the size of the vector

Definition at line 76 of file Selector.cc.

## sum()

PseudoJet fastjet::Selector::sum | ( | const std::vector< PseudoJet > & | jets | ) | const

Return the 4-vector sum of the objects that pass the selection.

This will often be more efficient that getting the vector of objects that passes and then evaluating the size of the vector

Definition at line 101 of file Selector.cc.

## scalar_pt_sum()

double fastjet::Selector::scalar_pt_sum | ( | const std::vector< PseudoJet > & | jets | ) | const

Return the scalar pt sum of the objects that pass the selection.

This will often be more efficient that getting the vector of objects that passes and then evaluating the size of the vector

Definition at line 126 of file Selector.cc.

## sift()

void fastjet::Selector::sift | ( | const std::vector< PseudoJet > & | jets,
|  | std::vector< PseudoJet > & | jets_that_pass,
|  | std::vector< PseudoJet > & | jets_that_fail ) const

sift the input jets into two vectors – those that pass the selector and those that do not

Definition at line 153 of file Selector.cc.

## applies_jet_by_jet()

bool fastjet::Selector::applies_jet_by_jet | ( |  | ) | const

inline

returns true if this can be applied jet by jet

Definition at line 215 of file Selector.hh.

## operator()() [2/2]

std::vector< PseudoJet > fastjet::Selector::operator() | ( | const std::vector< PseudoJet > & | jets | ) | const

returns a vector with the jets that pass the selection

Definition at line 48 of file Selector.cc.

## nullify_non_selected()

virtual void fastjet::Selector::nullify_non_selected | ( | std::vector< const PseudoJet * > & | jets | ) | const

inline virtual

For each jet that does not pass the cuts, this routine sets the pointer to 0.

It is legitimate for some (or all) of the pointers that are passed to already be NULL.

Definition at line 227 of file Selector.hh.

## get_rapidity_extent()

void fastjet::Selector::get_rapidity_extent | ( | double & | rapmin,
|  | double & | rapmax ) const

inline

returns the rapidity range for which it may return "true"

Definition at line 232 of file Selector.hh.

## description()

std::string fastjet::Selector::description | ( |  | ) | const

inline

returns a textual description of the selector

Definition at line 237 of file Selector.hh.

## is_geometric()

bool fastjet::Selector::is_geometric | ( |  | ) | const

inline

returns true if it is a geometric selector (i.e.

one that only puts constraints on rapidities and azimuthal angles)

Definition at line 243 of file Selector.hh.

## has_finite_area()

bool fastjet::Selector::has_finite_area | ( |  | ) | const

inline

returns true if it has a meaningful and finite area (i.e.

the Selector has the property that is_geometric() returns true and the rapidity extent is finite).

Definition at line 250 of file Selector.hh.

## area() [1/2]

double fastjet::Selector::area | ( |  | ) | const

returns the rapidity-phi area associated with the Selector (throws InvalidArea if the area does not make sense).

If the result is not known analytically, the area will be estimated using a pseudo Monte Carlo method (as for jet areas), using the default ghost area from the GhostedAreaSpec class (0.01). The Monte Carlo estimate involves a time penalty proportional to the ratio of the rapidity extent of the Selector divided by the ghost area.

Definition at line 189 of file Selector.cc.

## area() [2/2]

double fastjet::Selector::area | ( | double | ghost_area | ) | const

returns the rapidity-phi area associated with the Selector (throws InvalidArea if the area does not make sense).

The behaviour is the as with the area() call, but with the ability to additionally specify the ghost area to be used in the case of a Monte Carlo area evaluation.

Definition at line 194 of file Selector.cc.

## worker()

const SharedPtr< SelectorWorker > & fastjet::Selector::worker | ( |  | ) | const

inline

returns a (reference to) the underlying worker's shared pointer

Definition at line 277 of file Selector.hh.

## validated_worker()

const SelectorWorker * fastjet::Selector::validated_worker | ( |  | ) | const

inline

returns a worker if there is a valid one, otherwise throws an InvalidWorker error

Definition at line 280 of file Selector.hh.

## takes_reference()

bool fastjet::Selector::takes_reference | ( |  | ) | const

inline

returns true if this can be applied jet by jet

Definition at line 287 of file Selector.hh.

## set_reference()

const Selector & fastjet::Selector::set_reference | ( | const PseudoJet & | reference | ) |

inline

set the reference jet for this Selector

Definition at line 292 of file Selector.hh.

## operator&=()

Selector & fastjet::Selector::operator&= | ( | const Selector & | b | ) |

For 2 Selectors a and b, a &= b is eauivalent to a = a && b;.

Definition at line 1486 of file Selector.cc.

## operator|=()

Selector & fastjet::Selector::operator|= | ( | const Selector & | b | ) |

For 2 Selectors a and b, a |= b is eauivalent to a = a || b;.

Definition at line 1493 of file Selector.cc.

## _copy_worker_if_needed()

void fastjet::Selector::_copy_worker_if_needed | ( |  | ) |

inline protected

Helper for copying selector workers if needed.

The following is needed if we want to modify a selectors that shares a worker with another selector. In that case, we need to get another copy of the worker to avoid interferences

Note that any non-const operation has to call this to behave correctly w.r.t shared workers!

Definition at line 339 of file Selector.hh.

The documentation for this class was generated from the following files:

- include/fastjet/Selector.hh
- src/Selector.cc