FastJet 3.4.1
Public Member Functions | List of all members
fastjet::NNBase< I > Class Template Referenceabstract

Helps solve closest pair problems with generic interparticle and particle-beam distances. More...

#include <fastjet/NNBase.hh>

Inheritance diagram for fastjet::NNBase< I >:
Inheritance graph
[legend]
Collaboration diagram for fastjet::NNBase< I >:
Collaboration graph
[legend]

Public Member Functions

 NNBase ()
 Default constructor. More...
 
 NNBase (I *info)
 Constuctor with additional Info. More...
 
virtual void start (const std::vector< PseudoJet > &jets)=0
 initialisation from a given list of particles More...
 
virtual double dij_min (int &iA, int &iB)=0
 returns the dij_min and indices iA, iB, for the corresponding jets. More...
 
virtual void remove_jet (int iA)=0
 removes the jet pointed to by index iA More...
 
virtual void merge_jets (int iA, int iB, const PseudoJet &jet, int jet_index)=0
 merges the jets pointed to by indices A and B and replaces them with jet, assigning it an index jet_index. More...
 
- Public Member Functions inherited from fastjet::NNInfo< _NoInfo >
 NNInfo (_NoInfo *)
 
template<class BJ >
void init_jet (BJ *briefjet, const fastjet::PseudoJet &jet, int index)
 

Detailed Description

template<class I = _NoInfo>
class fastjet::NNBase< I >

Helps solve closest pair problems with generic interparticle and particle-beam distances.

Description and derived classes:

This is an abstract base class which defines the interface for several classes that help carry out nearest-neighbour clustering:

If you can use NNFJN2Plain it will usually be faster than NNH. NNFJN2Tiled, where it can be used, will be faster for multiplicities above a few tens of particles.

NOTE: IN ALL CASES, THE DISTANCE MUST BE SYMMETRIC (dij=dji)!!!

Underlying BriefJet (BJ) class:

All derived classes must be templated with a BriefJet (BJ) class — BJ should basically cache the minimal amount of information that is needed to efficiently calculate interparticle distances and particle-beam distances.

This class can be used with or without an extra "Information" template, i.e. NN*<BJ> or NN*<BJ,I>. Accordingly BJ must provide one of the two following init functions:

void BJ::init(const PseudoJet & jet); // initialise with a PseudoJet
void BJ::init(const PseudoJet & jet, I * info); // initialise with a PseudoJet + info
Class to contain pseudojets, including minimal information of use to jet-clustering routines.
Definition: PseudoJet.hh:68

where info might be a pointer to a class that contains, e.g., information about R, or other parameters of the jet algorithm

The BJ then provides information about interparticle and particle-beam distances. The exact requirements depend on whether you use NNH, NNFJN2Plain or NNFJN2Tiled. (See the corresponding classes for details).

Workflow:

In all cases, the usage of NNBase classes works as follows:

First, from the list of particles, create an NN*<BJ> object of the appropriate type with the appropriate BJ class (and optional extra info).

Then, cluster using a loop like this (assuming a FastJet plugin)

while (njets > 0) {
int i, j, k;
// get the i and j that minimize the distance
double dij = nn.dij_min(i, j);
// do the appropriate recombination and update the nn
if (j >= 0) { // interparticle recombination
cs.plugin_record_ij_recombination(i, j, dij, k);
nn.merge_jets(i, j, cs.jets()[k], k);
} else { // bbeam recombination
double diB = cs.jets()[i].E()*cs.jets()[i].E(); // get new diB
cs.plugin_record_iB_recombination(i, diB);
nn.remove_jet(i);
}
njets--;
}

For an example of how the NNH<BJ> class is used, see the JadePlugin or EECambridgePlugin.

Definition at line 164 of file NNBase.hh.

Constructor & Destructor Documentation

◆ NNBase() [1/2]

template<class I = _NoInfo>
fastjet::NNBase< I >::NNBase ( )
inline

Default constructor.

Definition at line 167 of file NNBase.hh.

◆ NNBase() [2/2]

template<class I = _NoInfo>
fastjet::NNBase< I >::NNBase ( I *  info)
inline

Constuctor with additional Info.

Definition at line 169 of file NNBase.hh.

◆ ~NNBase()

template<class I = _NoInfo>
virtual fastjet::NNBase< I >::~NNBase ( )
inlinevirtual

Definition at line 185 of file NNBase.hh.

Member Function Documentation

◆ start()

template<class I = _NoInfo>
virtual void fastjet::NNBase< I >::start ( const std::vector< PseudoJet > &  jets)
pure virtual

initialisation from a given list of particles

Implemented in fastjet::NNFJN2Plain< BJ, I >, fastjet::NNFJN2Tiled< BJ, I >, and fastjet::NNH< BJ, I >.

◆ dij_min()

template<class I = _NoInfo>
virtual double fastjet::NNBase< I >::dij_min ( int &  iA,
int &  iB 
)
pure virtual

returns the dij_min and indices iA, iB, for the corresponding jets.

If iB < 0 then iA recombines with the beam

Implemented in fastjet::NNFJN2Plain< BJ, I >, fastjet::NNFJN2Tiled< BJ, I >, and fastjet::NNH< BJ, I >.

◆ remove_jet()

template<class I = _NoInfo>
virtual void fastjet::NNBase< I >::remove_jet ( int  iA)
pure virtual

removes the jet pointed to by index iA

Implemented in fastjet::NNFJN2Plain< BJ, I >, fastjet::NNFJN2Tiled< BJ, I >, and fastjet::NNH< BJ, I >.

◆ merge_jets()

template<class I = _NoInfo>
virtual void fastjet::NNBase< I >::merge_jets ( int  iA,
int  iB,
const PseudoJet jet,
int  jet_index 
)
pure virtual

merges the jets pointed to by indices A and B and replaces them with jet, assigning it an index jet_index.

Implemented in fastjet::NNFJN2Plain< BJ, I >, fastjet::NNFJN2Tiled< BJ, I >, and fastjet::NNH< BJ, I >.


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