DAS  3.0
Das Analysis System
ClusterSequence

#include <fjcore.hh>

+ Collaboration diagram for ClusterSequence:

Classes

class  _Line
 
class  _Parabola
 
struct  BriefJet
 
struct  EEBriefJet
 
class  Extras
 
struct  history_element
 
struct  Tile
 
class  TiledJet
 

Public Types

enum  JetType { Invalid =-3, InexistentParent = -2, BeamJet = -1 }
 
typedef ClusterSequenceStructure StructureType
 

Public Member Functions

 ClusterSequence ()
 
template<class L >
 ClusterSequence (const std::vector< L > &pseudojets, const JetDefinition &jet_def, const bool &writeout_combinations=false)
 
 ClusterSequence (const ClusterSequence &cs)
 
ClusterSequenceoperator= (const ClusterSequence &cs)
 
virtual ~ClusterSequence ()
 
std::vector< PseudoJetinclusive_jets (const double ptmin=0.0) const
 
int n_exclusive_jets (const double dcut) const
 
std::vector< PseudoJetexclusive_jets (const double dcut) const
 
std::vector< PseudoJetexclusive_jets (const int njets) const
 
std::vector< PseudoJetexclusive_jets_up_to (const int njets) const
 
double exclusive_dmerge (const int njets) const
 
double exclusive_dmerge_max (const int njets) const
 
double exclusive_ymerge (int njets) const
 
double exclusive_ymerge_max (int njets) const
 
int n_exclusive_jets_ycut (double ycut) const
 
std::vector< PseudoJetexclusive_jets_ycut (double ycut) const
 
std::vector< PseudoJetexclusive_subjets (const PseudoJet &jet, const double dcut) const
 
int n_exclusive_subjets (const PseudoJet &jet, const double dcut) const
 
std::vector< PseudoJetexclusive_subjets (const PseudoJet &jet, int nsub) const
 
std::vector< PseudoJetexclusive_subjets_up_to (const PseudoJet &jet, int nsub) const
 
double exclusive_subdmerge (const PseudoJet &jet, int nsub) const
 
double exclusive_subdmerge_max (const PseudoJet &jet, int nsub) const
 
double Q () const
 
double Q2 () const
 
bool object_in_jet (const PseudoJet &object, const PseudoJet &jet) const
 
bool has_parents (const PseudoJet &jet, PseudoJet &parent1, PseudoJet &parent2) const
 
bool has_child (const PseudoJet &jet, PseudoJet &child) const
 
bool has_child (const PseudoJet &jet, const PseudoJet *&childp) const
 
bool has_partner (const PseudoJet &jet, PseudoJet &partner) const
 
std::vector< PseudoJetconstituents (const PseudoJet &jet) const
 
void print_jets_for_root (const std::vector< PseudoJet > &jets, std::ostream &ostr=std::cout) const
 
void print_jets_for_root (const std::vector< PseudoJet > &jets, const std::string &filename, const std::string &comment="") const
 
void add_constituents (const PseudoJet &jet, std::vector< PseudoJet > &subjet_vector) const
 
Strategy strategy_used () const
 
std::string strategy_string () const
 
std::string strategy_string (Strategy strategy_in) const
 
const JetDefinitionjet_def () const
 
void delete_self_when_unused ()
 
bool will_delete_self_when_unused () const
 
void signal_imminent_self_deletion () const
 
double jet_scale_for_algorithm (const PseudoJet &jet) const
 
void plugin_record_ij_recombination (int jet_i, int jet_j, double dij, int &newjet_k)
 
void plugin_record_ij_recombination (int jet_i, int jet_j, double dij, const PseudoJet &newjet, int &newjet_k)
 
void plugin_record_iB_recombination (int jet_i, double diB)
 
void plugin_associate_extras (Extras *extras_in)
 
bool plugin_activated () const
 
const Extrasextras () const
 
template<class GBJ >
void plugin_simple_N2_cluster ()
 
const std::vector< PseudoJet > & jets () const
 
const std::vector< history_element > & history () const
 
unsigned int n_particles () const
 
std::vector< int > particle_jet_indices (const std::vector< PseudoJet > &) const
 
std::vector< int > unique_history_order () const
 
std::vector< PseudoJetunclustered_particles () const
 
std::vector< PseudoJetchildless_pseudojets () const
 
bool contains (const PseudoJet &object) const
 
void transfer_from_sequence (const ClusterSequence &from_seq, const FunctionOfPseudoJet< PseudoJet > *action_on_jets=0)
 
const SharedPtr< PseudoJetStructureBase > & structure_shared_ptr () const
 
template<class BJ >
FJCORE_BEGIN_NAMESPACE void _simple_N2_cluster ()
 
template<>
void _bj_set_jetinfo (EEBriefJet *const jetA, const int _jets_index) const
 
template<>
double _bj_dist (const EEBriefJet *const jeta, const EEBriefJet *const jetb) const
 

Static Public Member Functions

static void print_banner ()
 
static void set_fastjet_banner_stream (std::ostream *ostr)
 
static std::ostream * fastjet_banner_stream ()
 

Protected Member Functions

template<class L >
void _transfer_input_jets (const std::vector< L > &pseudojets)
 
void _initialise_and_run (const JetDefinition &jet_def, const bool &writeout_combinations)
 
void _initialise_and_run_no_decant ()
 
void _decant_options (const JetDefinition &jet_def, const bool &writeout_combinations)
 
void _decant_options_partial ()
 
void _fill_initial_history ()
 
void _do_ij_recombination_step (const int jet_i, const int jet_j, const double dij, int &newjet_k)
 
void _do_iB_recombination_step (const int jet_i, const double diB)
 
void _set_structure_shared_ptr (PseudoJet &j)
 
void _update_structure_use_count ()
 
Strategy _best_strategy () const
 
void get_subhist_set (std::set< const history_element * > &subhist, const PseudoJet &jet, double dcut, int maxjet) const
 

Protected Attributes

JetDefinition _jet_def
 
std::vector< PseudoJet_jets
 
std::vector< history_element_history
 
bool _writeout_combinations
 
int _initial_n
 
double _Rparam
 
double _R2
 
double _invR2
 
double _Qtot
 
Strategy _strategy
 
JetAlgorithm _jet_algorithm
 
SharedPtr< PseudoJetStructureBase_structure_shared_ptr
 
int _structure_use_count_after_construction
 
bool _deletes_self_when_unused
 

Private Types

typedef std::pair< int, int > TwoVertices
 
typedef std::pair< double, TwoVerticesDijEntry
 
typedef std::multimap< double, TwoVerticesDistMap
 

Private Member Functions

void _really_dumb_cluster ()
 
void _delaunay_cluster ()
 
template<class BJ >
void _simple_N2_cluster ()
 
void _tiled_N2_cluster ()
 
void _faster_tiled_N2_cluster ()
 
void _minheap_faster_tiled_N2_cluster ()
 
void _CP2DChan_cluster ()
 
void _CP2DChan_cluster_2pi2R ()
 
void _CP2DChan_cluster_2piMultD ()
 
void _CP2DChan_limited_cluster (double D)
 
void _do_Cambridge_inclusive_jets ()
 
void _fast_NsqrtN_cluster ()
 
void _add_step_to_history (const int parent1, const int parent2, const int jetp_index, const double dij)
 
void _extract_tree_children (int pos, std::valarray< bool > &, const std::valarray< int > &, std::vector< int > &) const
 
void _extract_tree_parents (int pos, std::valarray< bool > &, const std::valarray< int > &, std::vector< int > &) const
 
void _add_ktdistance_to_map (const int ii, DistMap &DijMap, const DynamicNearestNeighbours *DNN)
 
template<class J >
void _bj_set_jetinfo (J *const jet, const int _jets_index) const
 
void _bj_remove_from_tiles (TiledJet *const jet) const
 
template<class J >
double _bj_dist (const J *const jeta, const J *const jetb) const
 
template<class J >
double _bj_diJ (const J *const jeta) const
 
template<class J >
J * _bj_of_hindex (const int hist_index, J *const head, J *const tail) const
 
template<class J >
void _bj_set_NN_nocross (J *const jeta, J *const head, const J *const tail) const
 
template<class J >
void _bj_set_NN_crosscheck (J *const jeta, J *const head, const J *const tail) const
 
int _tile_index (int ieta, int iphi) const
 
int _tile_index (const double eta, const double phi) const
 
void _tj_set_jetinfo (TiledJet *const jet, const int _jets_index)
 
void _bj_remove_from_tiles (TiledJet *const jet)
 
void _initialise_tiles ()
 
void _print_tiles (TiledJet *briefjets) const
 
void _add_neighbours_to_tile_union (const int tile_index, std::vector< int > &tile_union, int &n_near_tiles) const
 
void _add_untagged_neighbours_to_tile_union (const int tile_index, std::vector< int > &tile_union, int &n_near_tiles)
 
void _simple_N2_cluster_BriefJet ()
 
void _simple_N2_cluster_EEBriefJet ()
 

Private Attributes

bool _plugin_activated
 
SharedPtr< Extras_extras
 
std::vector< Tile_tiles
 
double _tiles_eta_min
 
double _tiles_eta_max
 
double _tile_size_eta
 
double _tile_size_phi
 
int _n_tiles_phi
 
int _tiles_ieta_min
 
int _tiles_ieta_max
 

Static Private Attributes

static std::ostream * _fastjet_banner_ostr = &cout
 
static bool _first_time = true
 
static LimitedWarning _exclusive_warnings
 
static LimitedWarning _changed_strategy_warning
 
static const int n_tile_neighbours = 9
 

Member Typedef Documentation

◆ DijEntry

typedef std::pair<double,TwoVertices> DijEntry
private

◆ DistMap

typedef std::multimap<double,TwoVertices> DistMap
private

◆ StructureType

◆ TwoVertices

typedef std::pair<int,int> TwoVertices
private

Member Enumeration Documentation

◆ JetType

enum JetType
Enumerator
Invalid 
InexistentParent 
BeamJet 
1490 {Invalid=-3, InexistentParent = -2, BeamJet = -1};

Constructor & Destructor Documentation

◆ ClusterSequence() [1/3]

ClusterSequence ( )
inline
1384 : _deletes_self_when_unused(false) {}

◆ ClusterSequence() [2/3]

ClusterSequence ( const std::vector< L > &  pseudojets,
const JetDefinition jet_def,
const bool &  writeout_combinations = false 
)
1665  :
1666  _jet_def(jet_def_in), _writeout_combinations(writeout_combinations),
1668 {
1669  _transfer_input_jets(pseudojets);
1672 }

◆ ClusterSequence() [3/3]

ClusterSequence ( const ClusterSequence cs)
inline
1389  : _deletes_self_when_unused(false) {
1391  }

◆ ~ClusterSequence()

~ClusterSequence ( )
virtual
1412  {
1413  if (_structure_shared_ptr){
1415  assert(csi != NULL);
1416  csi->set_associated_cs(NULL);
1420  }
1421  }
1422 }

Member Function Documentation

◆ _add_ktdistance_to_map()

void _add_ktdistance_to_map ( const int  ii,
DistMap DijMap,
const DynamicNearestNeighbours DNN 
)
private
2547  {
2548  double yiB = jet_scale_for_algorithm(_jets[ii]);
2549  if (yiB == 0.0) {
2550  DijMap.insert(DijEntry(yiB, TwoVertices(ii,-1)));
2551  } else {
2552  double DeltaR2 = DNN->NearestNeighbourDistance(ii) * _invR2;
2553  if (DeltaR2 > 1.0) {
2554  DijMap.insert(DijEntry(yiB, TwoVertices(ii,-1)));
2555  } else {
2556  double kt2i = jet_scale_for_algorithm(_jets[ii]);
2557  int jj = DNN->NearestNeighbourIndex(ii);
2558  if (kt2i <= jet_scale_for_algorithm(_jets[jj])) {
2559  double dij = DeltaR2 * kt2i;
2560  DijMap.insert(DijEntry(dij, TwoVertices(ii,jj)));
2561  }
2562  }
2563  }
2564 }

◆ _add_neighbours_to_tile_union()

void _add_neighbours_to_tile_union ( const int  tile_index,
std::vector< int > &  tile_union,
int &  n_near_tiles 
) const
private
2843  {
2844  for (Tile * const * near_tile = _tiles[tile_index].begin_tiles;
2845  near_tile != _tiles[tile_index].end_tiles; near_tile++){
2846  tile_union[n_near_tiles] = *near_tile - & _tiles[0];
2847  n_near_tiles++;
2848  }
2849 }

◆ _add_step_to_history()

void _add_step_to_history ( const int  parent1,
const int  parent2,
const int  jetp_index,
const double  dij 
)
private
2137  {
2138  history_element element;
2139  element.parent1 = parent1;
2140  element.parent2 = parent2;
2141  element.jetp_index = jetp_index;
2142  element.child = Invalid;
2143  element.dij = dij;
2144  element.max_dij_so_far = max(dij,_history[_history.size()-1].max_dij_so_far);
2145  _history.push_back(element);
2146  int local_step = _history.size()-1;
2147  assert(parent1 >= 0);
2148  if (_history[parent1].child != Invalid){
2149  throw InternalError("trying to recomine an object that has previsously been recombined");
2150  }
2151  _history[parent1].child = local_step;
2152  if (parent2 >= 0) {
2153  if (_history[parent2].child != Invalid){
2154  throw InternalError("trying to recomine an object that has previsously been recombined");
2155  }
2156  _history[parent2].child = local_step;
2157  }
2158  if (jetp_index != Invalid) {
2159  assert(jetp_index >= 0);
2160  _jets[jetp_index].set_cluster_hist_index(local_step);
2161  _set_structure_shared_ptr(_jets[jetp_index]);
2162  }
2163  if (_writeout_combinations) {
2164  cout << local_step << ": "
2165  << parent1 << " with " << parent2
2166  << "; y = "<< dij<<endl;
2167  }
2168 }

◆ _add_untagged_neighbours_to_tile_union()

void _add_untagged_neighbours_to_tile_union ( const int  tile_index,
std::vector< int > &  tile_union,
int &  n_near_tiles 
)
inlineprivate
2852  {
2853  for (Tile ** near_tile = _tiles[tile_index].begin_tiles;
2854  near_tile != _tiles[tile_index].end_tiles; near_tile++){
2855  if (! (*near_tile)->tagged) {
2856  (*near_tile)->tagged = true;
2857  tile_union[n_near_tiles] = *near_tile - & _tiles[0];
2858  n_near_tiles++;
2859  }
2860  }
2861 }

◆ _best_strategy()

Strategy _best_strategy ( ) const
protected
1676  {
1677  int N = _jets.size();
1678  double bounded_R = max(_Rparam, 0.1);
1679  if (N <= 30 || N <= 39.0/(bounded_R + 0.6)) {
1680  return N2Plain;
1681  }
1682  const static _Parabola N_Tiled_to_MHT_lowR (-45.4947,54.3528,44.6283);
1683  const static _Parabola L_MHT_to_MHTLazy9_lowR (0.677807,-1.05006,10.6994);
1684  const static _Parabola L_MHTLazy9_to_MHTLazy25_akt_lowR(0.169967,-0.512589,12.1572);
1685  const static _Parabola L_MHTLazy9_to_MHTLazy25_kt_lowR (0.16237,-0.484612,12.3373);
1686  const static _Parabola L_MHTLazy9_to_MHTLazy25_cam_lowR = L_MHTLazy9_to_MHTLazy25_kt_lowR;
1687  const static _Parabola L_MHTLazy25_to_NlnN_akt_lowR (0.0472051,-0.22043,15.9196);
1688  const static _Parabola L_MHTLazy25_to_NlnN_kt_lowR (0.118609,-0.326811,14.8287);
1689  const static _Parabola L_MHTLazy25_to_NlnN_cam_lowR (0.10119,-0.295748,14.3924);
1690  const static _Line L_Tiled_to_MHTLazy9_medR (-1.31304,7.29621);
1691  const static _Parabola L_MHTLazy9_to_MHTLazy25_akt_medR = L_MHTLazy9_to_MHTLazy25_akt_lowR;
1692  const static _Parabola L_MHTLazy9_to_MHTLazy25_kt_medR = L_MHTLazy9_to_MHTLazy25_kt_lowR;
1693  const static _Parabola L_MHTLazy9_to_MHTLazy25_cam_medR = L_MHTLazy9_to_MHTLazy25_cam_lowR;
1694  const static _Parabola L_MHTLazy25_to_NlnN_akt_medR = L_MHTLazy25_to_NlnN_akt_lowR;
1695  const static _Parabola L_MHTLazy25_to_NlnN_kt_medR = L_MHTLazy25_to_NlnN_kt_lowR;
1696  const static _Parabola L_MHTLazy25_to_NlnN_cam_medR = L_MHTLazy25_to_NlnN_cam_lowR;
1697  const static double N_Plain_to_MHTLazy9_largeR = 75;
1698  const static double N_MHTLazy9_to_MHTLazy25_akt_largeR = 700;
1699  const static double N_MHTLazy9_to_MHTLazy25_kt_largeR = 1000;
1700  const static double N_MHTLazy9_to_MHTLazy25_cam_largeR = 1000;
1701  const static double N_MHTLazy25_to_NlnN_akt_largeR = 100000;
1702  const static double N_MHTLazy25_to_NlnN_kt_largeR = 40000;
1703  const static double N_MHTLazy25_to_NlnN_cam_largeR = 15000;
1704  JetAlgorithm jet_algorithm;
1706  double p = jet_def().extra_param();
1707  if (p < 0.0) jet_algorithm = antikt_algorithm;
1708  else jet_algorithm = kt_algorithm;
1710  jet_algorithm = kt_algorithm;
1711  } else {
1712  jet_algorithm = _jet_algorithm;
1713  }
1714  if (bounded_R < 0.65) {
1715  if (N < N_Tiled_to_MHT_lowR(bounded_R)) return N2Tiled;
1716  double logN = log(double(N));
1717  if (logN < L_MHT_to_MHTLazy9_lowR(bounded_R)) return N2MinHeapTiled;
1718  else {
1719  if (jet_algorithm == antikt_algorithm){
1720  if (logN < L_MHTLazy9_to_MHTLazy25_akt_lowR(bounded_R)) return N2MHTLazy9;
1721  else if (logN < L_MHTLazy25_to_NlnN_akt_lowR(bounded_R)) return N2MHTLazy25;
1722  else return NlnN;
1723  } else if (jet_algorithm == kt_algorithm){
1724  if (logN < L_MHTLazy9_to_MHTLazy25_kt_lowR(bounded_R)) return N2MHTLazy9;
1725  else if (logN < L_MHTLazy25_to_NlnN_kt_lowR(bounded_R)) return N2MHTLazy25;
1726  else return NlnN;
1727  } else if (jet_algorithm == cambridge_algorithm) {
1728  if (logN < L_MHTLazy9_to_MHTLazy25_cam_lowR(bounded_R)) return N2MHTLazy9;
1729  else if (logN < L_MHTLazy25_to_NlnN_cam_lowR(bounded_R)) return N2MHTLazy25;
1730  else return NlnNCam;
1731  }
1732  }
1733  } else if (bounded_R < 0.5*pi) {
1734  double logN = log(double(N));
1735  if (logN < L_Tiled_to_MHTLazy9_medR(bounded_R)) return N2Tiled;
1736  else {
1737  if (jet_algorithm == antikt_algorithm){
1738  if (logN < L_MHTLazy9_to_MHTLazy25_akt_medR(bounded_R)) return N2MHTLazy9;
1739  else if (logN < L_MHTLazy25_to_NlnN_akt_medR(bounded_R)) return N2MHTLazy25;
1740  else return NlnN;
1741  } else if (jet_algorithm == kt_algorithm){
1742  if (logN < L_MHTLazy9_to_MHTLazy25_kt_medR(bounded_R)) return N2MHTLazy9;
1743  else if (logN < L_MHTLazy25_to_NlnN_kt_medR(bounded_R)) return N2MHTLazy25;
1744  else return NlnN;
1745  } else if (jet_algorithm == cambridge_algorithm) {
1746  if (logN < L_MHTLazy9_to_MHTLazy25_cam_medR(bounded_R)) return N2MHTLazy9;
1747  else if (logN < L_MHTLazy25_to_NlnN_cam_medR(bounded_R)) return N2MHTLazy25;
1748  else return NlnNCam;
1749  }
1750  }
1751  } else {
1752  if (N < N_Plain_to_MHTLazy9_largeR) return N2Plain;
1753  else {
1754  if (jet_algorithm == antikt_algorithm){
1755  if (N < N_MHTLazy9_to_MHTLazy25_akt_largeR) return N2MHTLazy9;
1756  else if (N < N_MHTLazy25_to_NlnN_akt_largeR) return N2MHTLazy25;
1757  else return NlnN;
1758  } else if (jet_algorithm == kt_algorithm){
1759  if (N < N_MHTLazy9_to_MHTLazy25_kt_largeR) return N2MHTLazy9;
1760  else if (N < N_MHTLazy25_to_NlnN_kt_largeR) return N2MHTLazy25;
1761  else return NlnN;
1762  } else if (jet_algorithm == cambridge_algorithm) {
1763  if (N < N_MHTLazy9_to_MHTLazy25_cam_largeR) return N2MHTLazy9;
1764  else if (N < N_MHTLazy25_to_NlnN_cam_largeR) return N2MHTLazy25;
1765  else return NlnNCam;
1766  }
1767  }
1768  }
1769  assert(0 && "Code should never reach here");
1770  return N2MHTLazy9;
1771 }

◆ _bj_diJ()

double _bj_diJ ( const J *const  jeta) const
inlineprivate
1719  {
1720  double kt2 = jet->kt2;
1721  if (jet->NN != NULL) {if (jet->NN->kt2 < kt2) {kt2 = jet->NN->kt2;}}
1722  return jet->NN_dist * kt2;
1723 }

◆ _bj_dist() [1/2]

double _bj_dist ( const EEBriefJet *const  jeta,
const EEBriefJet *const  jetb 
) const
2651  {
2652  double dist = 1.0
2653  - jeta->nx*jetb->nx
2654  - jeta->ny*jetb->ny
2655  - jeta->nz*jetb->nz;
2656  dist *= 2; // distance is _2_*min(Ei^2,Ej^2)*(1-cos theta)
2657  return dist;
2658 }

◆ _bj_dist() [2/2]

double _bj_dist ( const J *const  jeta,
const J *const  jetb 
) const
inlineprivate
1708  {
1709 #ifndef FJCORE_NEW_DELTA_PHI
1710  double dphi = std::abs(jetA->phi - jetB->phi);
1711  double deta = (jetA->eta - jetB->eta);
1712  if (dphi > pi) {dphi = twopi - dphi;}
1713 #else
1714  double dphi = pi-std::abs(pi-std::abs(jetA->phi - jetB->phi));
1715  double deta = (jetA->eta - jetB->eta);
1716 #endif
1717  return dphi*dphi + deta*deta;
1718 }

◆ _bj_of_hindex()

J* _bj_of_hindex ( const int  hist_index,
J *const  head,
J *const  tail 
) const
inlineprivate
1609  {
1610  J * res;
1611  for(res = head; res<tail; res++) {
1612  if (_jets[res->_jets_index].cluster_hist_index() == hist_index) {break;}
1613  }
1614  return res;
1615  }

◆ _bj_remove_from_tiles() [1/2]

void _bj_remove_from_tiles ( TiledJet *const  jet)
private
2750  {
2751  Tile * tile = & _tiles[jet->tile_index];
2752  if (jet->previous == NULL) {
2753  tile->head = jet->next;
2754  } else {
2755  jet->previous->next = jet->next;
2756  }
2757  if (jet->next != NULL) {
2758  jet->next->previous = jet->previous;
2759  }
2760 }

◆ _bj_remove_from_tiles() [2/2]

void _bj_remove_from_tiles ( TiledJet *const  jet) const
private

◆ _bj_set_jetinfo() [1/2]

void _bj_set_jetinfo ( EEBriefJet *const  jetA,
const int  _jets_index 
) const
inline
2618  {
2619  double E = _jets[_jets_index].E();
2620  double scale = E*E; // the default energy scale for the kt alg
2621  double p = jet_def().extra_param(); // in case we're ee_genkt
2622  switch (_jet_algorithm) {
2623  case ee_kt_algorithm:
2624  assert(_Rparam > 2.0); // force this to be true! [not best place, but works]
2625  break;
2626  case ee_genkt_algorithm:
2627  if (p <= 0 && scale < 1e-300) scale = 1e-300; // same dodgy safety as genkt
2628  scale = pow(scale,p);
2629  break;
2630  default:
2631  throw Error("Unrecognised jet algorithm");
2632  }
2633  jetA->kt2 = scale; // "kt2" might one day be renamed as "scale" or some such
2634  double norm = _jets[_jets_index].modp2();
2635  if (norm > 0) {
2636  norm = 1.0/sqrt(norm);
2637  jetA->nx = norm * _jets[_jets_index].px();
2638  jetA->ny = norm * _jets[_jets_index].py();
2639  jetA->nz = norm * _jets[_jets_index].pz();
2640  } else {
2641  jetA->nx = 0.0;
2642  jetA->ny = 0.0;
2643  jetA->nz = 1.0;
2644  }
2645  jetA->_jets_index = _jets_index;
2646  jetA->NN_dist = _R2;
2647  jetA->NN = NULL;
2648 }

◆ _bj_set_jetinfo() [2/2]

void _bj_set_jetinfo ( J *const  jet,
const int  _jets_index 
) const
inlineprivate
1699  {
1700  jetA->eta = _jets[_jets_index].rap();
1701  jetA->phi = _jets[_jets_index].phi_02pi();
1702  jetA->kt2 = jet_scale_for_algorithm(_jets[_jets_index]);
1703  jetA->_jets_index = _jets_index;
1704  jetA->NN_dist = _R2;
1705  jetA->NN = NULL;
1706 }

◆ _bj_set_NN_crosscheck()

void _bj_set_NN_crosscheck ( J *const  jeta,
J *const  head,
const J *const  tail 
) const
inlineprivate
1750  {
1751  double NN_dist = _R2;
1752  J * NN = NULL;
1753  for (J * jetB = head; jetB != tail; jetB++) {
1754  double dist = _bj_dist(jet,jetB);
1755  if (dist < NN_dist) {
1756  NN_dist = dist;
1757  NN = jetB;
1758  }
1759  if (dist < jetB->NN_dist) {
1760  jetB->NN_dist = dist;
1761  jetB->NN = jet;
1762  }
1763  }
1764  jet->NN = NN;
1765  jet->NN_dist = NN_dist;
1766 }

◆ _bj_set_NN_nocross()

void _bj_set_NN_nocross ( J *const  jeta,
J *const  head,
const J *const  tail 
) const
inlineprivate
1725  {
1726  double NN_dist = _R2;
1727  J * NN = NULL;
1728  if (head < jet) {
1729  for (J * jetB = head; jetB != jet; jetB++) {
1730  double dist = _bj_dist(jet,jetB);
1731  if (dist < NN_dist) {
1732  NN_dist = dist;
1733  NN = jetB;
1734  }
1735  }
1736  }
1737  if (tail > jet) {
1738  for (J * jetB = jet+1; jetB != tail; jetB++) {
1739  double dist = _bj_dist(jet,jetB);
1740  if (dist < NN_dist) {
1741  NN_dist = dist;
1742  NN = jetB;
1743  }
1744  }
1745  }
1746  jet->NN = NN;
1747  jet->NN_dist = NN_dist;
1748 }

◆ _CP2DChan_cluster()

void _CP2DChan_cluster ( )
private
2380  {
2381  if (_jet_algorithm != cambridge_algorithm) throw Error("_CP2DChan_cluster called for a jet-finder that is not the cambridge algorithm");
2382  unsigned int n = _jets.size();
2383  vector<MirrorInfo> coordIDs(2*n); // link from original to mirror indices
2384  vector<int> jetIDs(2*n); // link from mirror to original indices
2385  vector<Coord2D> coords(2*n); // our coordinates (and copies)
2386  double minrap = numeric_limits<double>::max();
2387  double maxrap = -minrap;
2388  int coord_index = 0;
2389  for (unsigned i = 0; i < n; i++) {
2390  if (_jets[i].E() == abs(_jets[i].pz()) && _jets[i].perp2() == 0.0) {
2391  coordIDs[i] = MirrorInfo(BeamJet,BeamJet);
2392  } else {
2393  coordIDs[i].orig = coord_index;
2394  coordIDs[i].mirror = coord_index+1;
2395  coords[coord_index] = Coord2D(_jets[i].rap(), _jets[i].phi_02pi());
2396  coords[coord_index+1] = Coord2D(_jets[i].rap(), _jets[i].phi_02pi()+twopi);
2397  jetIDs[coord_index] = i;
2398  jetIDs[coord_index+1] = i;
2399  minrap = min(coords[coord_index].x,minrap);
2400  maxrap = max(coords[coord_index].x,maxrap);
2401  coord_index += 2;
2402  }
2403  }
2404  for (unsigned i = n; i < 2*n; i++) {coordIDs[i].orig = Invalid;}
2405  coords.resize(coord_index);
2406  Coord2D left_edge(minrap-1.0, 0.0);
2407  Coord2D right_edge(maxrap+1.0, 2*twopi);
2408  ClosestPair2D cp(coords, left_edge, right_edge);
2409  vector<Coord2D> new_points(2);
2410  vector<unsigned int> cIDs_to_remove(4);
2411  vector<unsigned int> new_cIDs(2);
2412  do {
2413  unsigned int cID1, cID2;
2414  double distance2;
2415  cp.closest_pair(cID1,cID2,distance2);
2416  distance2 *= _invR2;
2417  if (distance2 > 1.0) {break;}
2418  int jet_i = jetIDs[cID1];
2419  int jet_j = jetIDs[cID2];
2420  assert (jet_i != jet_j); // to catch issue of recombining with mirror point
2421  int newjet_k;
2422  _do_ij_recombination_step(jet_i, jet_j, distance2, newjet_k);
2423  cIDs_to_remove[0] = coordIDs[jet_i].orig;
2424  cIDs_to_remove[1] = coordIDs[jet_i].mirror;
2425  cIDs_to_remove[2] = coordIDs[jet_j].orig;
2426  cIDs_to_remove[3] = coordIDs[jet_j].mirror;
2427  new_points[0] = Coord2D(_jets[newjet_k].rap(),_jets[newjet_k].phi_02pi());
2428  new_points[1] = Coord2D(_jets[newjet_k].rap(),_jets[newjet_k].phi_02pi()+twopi);
2429  new_cIDs[0] = cp.replace(cIDs_to_remove[0], cIDs_to_remove[2], new_points[0]);
2430  new_cIDs[1] = cp.replace(cIDs_to_remove[1], cIDs_to_remove[3], new_points[1]);
2431  coordIDs[jet_i].orig = Invalid;
2432  coordIDs[jet_j].orig = Invalid;
2433  coordIDs[newjet_k] = MirrorInfo(new_cIDs[0], new_cIDs[1]);
2434  jetIDs[new_cIDs[0]] = newjet_k;
2435  jetIDs[new_cIDs[1]] = newjet_k;
2436  n--;
2437  if (n == 1) {break;}
2438  } while(true);
2440 }

◆ _CP2DChan_cluster_2pi2R()

void _CP2DChan_cluster_2pi2R ( )
private
2369  {
2370  if (_jet_algorithm != cambridge_algorithm) throw Error("CP2DChan clustering method called for a jet-finder that is not the cambridge algorithm");
2373 }

◆ _CP2DChan_cluster_2piMultD()

void _CP2DChan_cluster_2piMultD ( )
private
2374  {
2375  if (_Rparam >= 0.39) {
2376  _CP2DChan_limited_cluster(min(_Rparam/2,0.3));
2377  }
2379 }

◆ _CP2DChan_limited_cluster()

void _CP2DChan_limited_cluster ( double  D)
private
2300  {
2301  unsigned int n = _initial_n;
2302  vector<MirrorInfo> coordIDs(2*n); // coord IDs of a given jetID
2303  vector<int> jetIDs(2*n); // jet ID for a given coord ID
2304  vector<Coord2D> coords(2*n); // our coordinates (and copies)
2305  double Dlim4mirror = min(Dlim,pi);
2306  double minrap = numeric_limits<double>::max();
2307  double maxrap = -minrap;
2308  int coord_index = -1;
2309  int n_active = 0;
2310  for (unsigned jet_i = 0; jet_i < _jets.size(); jet_i++) {
2311  if (_history[_jets[jet_i].cluster_hist_index()].child != Invalid ||
2312  (_jets[jet_i].E() == abs(_jets[jet_i].pz()) &&
2313  _jets[jet_i].perp2() == 0.0)
2314  ) {continue;}
2315  n_active++;
2316  coordIDs[jet_i].orig = ++coord_index;
2317  coords[coord_index] = Coord2D(_jets[jet_i].rap(), _jets[jet_i].phi_02pi());
2318  jetIDs[coord_index] = jet_i;
2319  minrap = min(coords[coord_index].x,minrap);
2320  maxrap = max(coords[coord_index].x,maxrap);
2321  Coord2D mirror_point(coords[coord_index]);
2322  if (make_mirror(mirror_point, Dlim4mirror)) {
2323  coordIDs[jet_i].mirror = ++coord_index;
2324  coords[coord_index] = mirror_point;
2325  jetIDs[coord_index] = jet_i;
2326  } else {
2327  coordIDs[jet_i].mirror = Invalid;
2328  }
2329  }
2330  coords.resize(coord_index+1);
2331  Coord2D left_edge(minrap-1.0, -3.15); // a security margin below -pi
2332  Coord2D right_edge(maxrap+1.0, 9.45); // a security margin above 3*pi
2333  ClosestPair2D cp(coords, left_edge, right_edge);
2334  vector<Coord2D> new_points(2);
2335  vector<unsigned int> cIDs_to_remove(4);
2336  vector<unsigned int> new_cIDs(2);
2337  do {
2338  unsigned int cID1, cID2;
2339  double distance2;
2340  cp.closest_pair(cID1,cID2,distance2);
2341  if (distance2 > Dlim*Dlim) {break;}
2342  distance2 *= _invR2;
2343  int jet_i = jetIDs[cID1];
2344  int jet_j = jetIDs[cID2];
2345  assert (jet_i != jet_j); // to catch issue of recombining with mirror point
2346  int newjet_k;
2347  _do_ij_recombination_step(jet_i, jet_j, distance2, newjet_k);
2348  if (--n_active == 1) {break;}
2349  cIDs_to_remove.resize(0);
2350  cIDs_to_remove.push_back(coordIDs[jet_i].orig);
2351  cIDs_to_remove.push_back(coordIDs[jet_j].orig);
2352  if (coordIDs[jet_i].mirror != Invalid)
2353  cIDs_to_remove.push_back(coordIDs[jet_i].mirror);
2354  if (coordIDs[jet_j].mirror != Invalid)
2355  cIDs_to_remove.push_back(coordIDs[jet_j].mirror);
2356  Coord2D new_point(_jets[newjet_k].rap(),_jets[newjet_k].phi_02pi());
2357  new_points.resize(0);
2358  new_points.push_back(new_point);
2359  if (make_mirror(new_point, Dlim4mirror)) new_points.push_back(new_point); //< same warning as before concerning the mirroring
2360  cp.replace_many(cIDs_to_remove, new_points, new_cIDs);
2361  coordIDs[newjet_k].orig = new_cIDs[0];
2362  jetIDs[new_cIDs[0]] = newjet_k;
2363  if (new_cIDs.size() == 2) {
2364  coordIDs[newjet_k].mirror = new_cIDs[1];
2365  jetIDs[new_cIDs[1]] = newjet_k;
2366  } else {coordIDs[newjet_k].mirror = Invalid;}
2367  } while(true);
2368 }

◆ _decant_options()

void _decant_options ( const JetDefinition jet_def,
const bool &  writeout_combinations 
)
protected
1581  {
1582  _jet_def = jet_def_in;
1583  _writeout_combinations = writeout_combinations;
1586 }

◆ _decant_options_partial()

void _decant_options_partial ( )
protected
1587  {
1588  print_banner();
1590  _Rparam = _jet_def.R(); _R2 = _Rparam*_Rparam; _invR2 = 1.0/_R2;
1592  _plugin_activated = false;
1593  _update_structure_use_count(); // make sure it's correct already here
1594 }

◆ _delaunay_cluster()

void _delaunay_cluster ( )
private
2463  {
2464  int n = _jets.size();
2465  vector<EtaPhi> points(n); // recall EtaPhi is just a typedef'd pair<double>
2466  for (int i = 0; i < n; i++) {
2467  points[i] = EtaPhi(_jets[i].rap(),_jets[i].phi_02pi());
2468  points[i].sanitize(); // make sure things are in the right range
2469  }
2471  const bool verbose = false;
2472 #ifndef __FJCORE_DROP_CGAL // strategy = NlnN* are not supported if we drop CGAL...
2473  bool ignore_nearest_is_mirror = (_Rparam < twopi);
2474  if (_strategy == NlnN4pi) {
2475  DNN.reset(new Dnn4piCylinder(points,verbose));
2476  } else if (_strategy == NlnN3pi) {
2477  DNN.reset(new Dnn3piCylinder(points,ignore_nearest_is_mirror,verbose));
2478  } else if (_strategy == NlnN) {
2479  DNN.reset(new Dnn2piCylinder(points,ignore_nearest_is_mirror,verbose));
2480  } else
2481 #else
2482  if (_strategy == NlnN4pi || _strategy == NlnN3pi || _strategy == NlnN) {
2483  ostringstream err;
2484  err << "ERROR: Requested strategy "<<strategy_string()<<" but it is not"<<endl;
2485  err << " supported because FastJet was compiled without CGAL"<<endl;
2486  throw Error(err.str());
2487  } else
2488 #endif // __FJCORE_DROP_CGAL
2489  {
2490  assert(false);
2491  }
2492  DistMap DijMap;
2493  for (int ii = 0; ii < n; ii++) {
2494  _add_ktdistance_to_map(ii, DijMap, DNN.get());
2495  }
2496  for (int i=0;i<n;i++) {
2497  TwoVertices SmallestDijPair;
2498  int jet_i, jet_j;
2499  double SmallestDij;
2500  bool Valid2;
2501  bool recombine_with_beam;
2502  do {
2503  SmallestDij = DijMap.begin()->first;
2504  SmallestDijPair = DijMap.begin()->second;
2505  jet_i = SmallestDijPair.first;
2506  jet_j = SmallestDijPair.second;
2507  if (verbose) cout << "CS_Delaunay found recombination candidate: " << jet_i << " " << jet_j << " " << SmallestDij << endl; // GPS debugging
2508  DijMap.erase(DijMap.begin());
2509  recombine_with_beam = (jet_j == BeamJet);
2510  if (!recombine_with_beam) {Valid2 = DNN->Valid(jet_j);}
2511  else {Valid2 = true;}
2512  if (verbose) cout << "CS_Delaunay validities i & j: " << DNN->Valid(jet_i) << " " << Valid2 << endl;
2513  } while ( !DNN->Valid(jet_i) || !Valid2);
2514  if (! recombine_with_beam) {
2515  int nn; // will be index of new jet
2516  if (verbose) cout << "CS_Delaunay call _do_ij_recomb: " << jet_i << " " << jet_j << " " << SmallestDij << endl; // GPS debug
2517  _do_ij_recombination_step(jet_i, jet_j, SmallestDij, nn);
2518  EtaPhi newpoint(_jets[nn].rap(), _jets[nn].phi_02pi());
2519  newpoint.sanitize(); // make sure it is in correct range
2520  points.push_back(newpoint);
2521  } else {
2522  if (verbose) cout << "CS_Delaunay call _do_iB_recomb: " << jet_i << " " << SmallestDij << endl; // GPS debug
2523  _do_iB_recombination_step(jet_i, SmallestDij);
2524  }
2525  if (i == n-1) {break;}
2526  vector<int> updated_neighbours;
2527  if (! recombine_with_beam) {
2528  int point3;
2529  DNN->RemoveCombinedAddCombination(jet_i, jet_j,
2530  points[points.size()-1], point3,
2531  updated_neighbours);
2532  if (static_cast<unsigned int> (point3) != points.size()-1) {
2533  throw Error("INTERNAL ERROR: point3 != points.size()-1");}
2534  } else {
2535  DNN->RemovePoint(jet_i, updated_neighbours);
2536  }
2537  vector<int>::iterator it = updated_neighbours.begin();
2538  for (; it != updated_neighbours.end(); ++it) {
2539  int ii = *it;
2540  _add_ktdistance_to_map(ii, DijMap, DNN.get());
2541  }
2542  } // end clustering loop
2543 }

◆ _do_Cambridge_inclusive_jets()

void _do_Cambridge_inclusive_jets ( )
private
2441  {
2442  unsigned int n = _history.size();
2443  for (unsigned int hist_i = 0; hist_i < n; hist_i++) {
2444  if (_history[hist_i].child == Invalid) {
2445  _do_iB_recombination_step(_history[hist_i].jetp_index, 1.0);
2446  }
2447  }
2448 }

◆ _do_iB_recombination_step()

void _do_iB_recombination_step ( const int  jet_i,
const double  diB 
)
protected
2259  {
2260  _add_step_to_history(_jets[jet_i].cluster_hist_index(),BeamJet,
2261  Invalid, diB);
2262 }

◆ _do_ij_recombination_step()

void _do_ij_recombination_step ( const int  jet_i,
const int  jet_j,
const double  dij,
int &  newjet_k 
)
protected
2246  {
2247  PseudoJet newjet(false);
2248  _jet_def.recombiner()->recombine(_jets[jet_i], _jets[jet_j], newjet);
2249  _jets.push_back(newjet);
2250  newjet_k = _jets.size()-1;
2251  int newstep_k = _history.size();
2252  _jets[newjet_k].set_cluster_hist_index(newstep_k);
2253  int hist_i = _jets[jet_i].cluster_hist_index();
2254  int hist_j = _jets[jet_j].cluster_hist_index();
2255  _add_step_to_history(min(hist_i, hist_j), max(hist_i,hist_j),
2256  newjet_k, dij);
2257 }

◆ _extract_tree_children()

void _extract_tree_children ( int  pos,
std::valarray< bool > &  extracted,
const std::valarray< int > &  lowest_constituent,
std::vector< int > &  unique_tree 
) const
private
2194  {
2195  if (!extracted[position]) {
2196  _extract_tree_parents(position,extracted,lowest_constituent,unique_tree);
2197  }
2198  int child = _history[position].child;
2199  if (child >= 0) _extract_tree_children(child,extracted,lowest_constituent,unique_tree);
2200 }

◆ _extract_tree_parents()

void _extract_tree_parents ( int  pos,
std::valarray< bool > &  extracted,
const std::valarray< int > &  lowest_constituent,
std::vector< int > &  unique_tree 
) const
private
2227  {
2228  if (!extracted[position]) {
2229  int parent1 = _history[position].parent1;
2230  int parent2 = _history[position].parent2;
2231  if (parent1 >= 0 && parent2 >= 0) {
2232  if (lowest_constituent[parent1] > lowest_constituent[parent2])
2233  std::swap(parent1, parent2);
2234  }
2235  if (parent1 >= 0 && !extracted[parent1])
2236  _extract_tree_parents(parent1,extracted,lowest_constituent,unique_tree);
2237  if (parent2 >= 0 && !extracted[parent2])
2238  _extract_tree_parents(parent2,extracted,lowest_constituent,unique_tree);
2239  unique_tree.push_back(position);
2240  extracted[position] = true;
2241  }
2242 }

◆ _fast_NsqrtN_cluster()

void _fast_NsqrtN_cluster ( )
private

◆ _faster_tiled_N2_cluster()

void _faster_tiled_N2_cluster ( )
private
3016  {
3018  int n = _jets.size();
3019  TiledJet * briefjets = new TiledJet[n];
3020  TiledJet * jetA = briefjets, * jetB;
3021  TiledJet oldB;
3022  oldB.tile_index=0; // prevents a gcc warning
3023  vector<int> tile_union(3*n_tile_neighbours);
3024  for (int i = 0; i< n; i++) {
3025  _tj_set_jetinfo(jetA, i);
3026  jetA++; // move on to next entry of briefjets
3027  }
3028  TiledJet * head = briefjets; // a nicer way of naming start
3029  vector<Tile>::const_iterator tile;
3030  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
3031  for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
3032  for (jetB = tile->head; jetB != jetA; jetB = jetB->next) {
3033  double dist = _bj_dist(jetA,jetB);
3034  if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
3035  if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
3036  }
3037  }
3038  for (Tile ** RTile = tile->RH_tiles; RTile != tile->end_tiles; RTile++) {
3039  for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
3040  for (jetB = (*RTile)->head; jetB != NULL; jetB = jetB->next) {
3041  double dist = _bj_dist(jetA,jetB);
3042  if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
3043  if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
3044  }
3045  }
3046  }
3047  }
3048  struct diJ_plus_link {
3049  double diJ; // the distance
3050  TiledJet * jet; // the jet (i) for which we've found this distance
3051  };
3052  diJ_plus_link * diJ = new diJ_plus_link[n];
3053  jetA = head;
3054  for (int i = 0; i < n; i++) {
3055  diJ[i].diJ = _bj_diJ(jetA); // kt distance * R^2
3056  diJ[i].jet = jetA; // our compact diJ table will not be in
3057  jetA->diJ_posn = i; // one-to-one corresp. with non-compact jets,
3058  jetA++; // have jetA follow i
3059  }
3060  int history_location = n-1;
3061  while (n > 0) {
3062  diJ_plus_link * best, *stop; // pointers a bit faster than indices
3063  double diJ_min = diJ[0].diJ; // initialise the best one here.
3064  best = diJ; // and here
3065  stop = diJ+n;
3066  for (diJ_plus_link * here = diJ+1; here != stop; here++) {
3067  if (here->diJ < diJ_min) {best = here; diJ_min = here->diJ;}
3068  }
3069  history_location++;
3070  jetA = best->jet;
3071  jetB = jetA->NN;
3072  diJ_min *= _invR2;
3073  if (jetB != NULL) {
3074  if (jetA < jetB) {std::swap(jetA,jetB);}
3075  int nn; // new jet index
3076  _do_ij_recombination_step(jetA->_jets_index, jetB->_jets_index, diJ_min, nn);
3077  _bj_remove_from_tiles(jetA);
3078  oldB = * jetB; // take a copy because we will need it...
3079  _bj_remove_from_tiles(jetB);
3080  _tj_set_jetinfo(jetB, nn); // cause jetB to become _jets[nn]
3081  } else {
3082  _do_iB_recombination_step(jetA->_jets_index, diJ_min);
3083  _bj_remove_from_tiles(jetA);
3084  }
3085  int n_near_tiles = 0;
3087  tile_union, n_near_tiles);
3088  if (jetB != NULL) {
3089  if (jetB->tile_index != jetA->tile_index) {
3090  _add_untagged_neighbours_to_tile_union(jetB->tile_index,
3091  tile_union,n_near_tiles);
3092  }
3093  if (oldB.tile_index != jetA->tile_index &&
3094  oldB.tile_index != jetB->tile_index) {
3096  tile_union,n_near_tiles);
3097  }
3098  }
3099  n--;
3100  diJ[n].jet->diJ_posn = jetA->diJ_posn;
3101  diJ[jetA->diJ_posn] = diJ[n];
3102  for (int itile = 0; itile < n_near_tiles; itile++) {
3103  Tile * tile_ptr = &_tiles[tile_union[itile]];
3104  tile_ptr->tagged = false; // reset tag, since we're done with unions
3105  for (TiledJet * jetI = tile_ptr->head; jetI != NULL; jetI = jetI->next) {
3106  // see if jetI had jetA or jetB as a NN -- if so recalculate the NN
3107  if (jetI->NN == jetA || (jetI->NN == jetB && jetB != NULL)) {
3108  jetI->NN_dist = _R2;
3109  jetI->NN = NULL;
3110  // now go over tiles that are neighbours of I (include own tile)
3111  for (Tile ** near_tile = tile_ptr->begin_tiles;
3112  near_tile != tile_ptr->end_tiles; near_tile++) {
3113  // and then over the contents of that tile
3114  for (TiledJet * jetJ = (*near_tile)->head;
3115  jetJ != NULL; jetJ = jetJ->next) {
3116  double dist = _bj_dist(jetI,jetJ);
3117  if (dist < jetI->NN_dist && jetJ != jetI) {
3118  jetI->NN_dist = dist; jetI->NN = jetJ;
3119  }
3120  }
3121  }
3122  diJ[jetI->diJ_posn].diJ = _bj_diJ(jetI); // update diJ kt-dist
3123  }
3124  // check whether new jetB is closer than jetI's current NN and
3125  // if jetI is closer than jetB's current (evolving) nearest
3126  // neighbour. Where relevant update things
3127  if (jetB != NULL) {
3128  double dist = _bj_dist(jetI,jetB);
3129  if (dist < jetI->NN_dist) {
3130  if (jetI != jetB) {
3131  jetI->NN_dist = dist;
3132  jetI->NN = jetB;
3133  diJ[jetI->diJ_posn].diJ = _bj_diJ(jetI); // update diJ...
3134  }
3135  }
3136  if (dist < jetB->NN_dist) {
3137  if (jetI != jetB) {
3138  jetB->NN_dist = dist;
3139  jetB->NN = jetI;}
3140  }
3141  }
3142  }
3143  }
3144  if (jetB != NULL) {diJ[jetB->diJ_posn].diJ = _bj_diJ(jetB);}
3145  }
3146  delete[] diJ;
3147  delete[] briefjets;
3148 }

◆ _fill_initial_history()

void _fill_initial_history ( )
protected
1595  {
1596  _jets.reserve(_jets.size()*2);
1597  _history.reserve(_jets.size()*2);
1598  _Qtot = 0;
1599  for (int i = 0; i < static_cast<int>(_jets.size()) ; i++) {
1600  history_element element;
1601  element.parent1 = InexistentParent;
1602  element.parent2 = InexistentParent;
1603  element.child = Invalid;
1604  element.jetp_index = i;
1605  element.dij = 0.0;
1606  element.max_dij_so_far = 0.0;
1607  _history.push_back(element);
1609  _jets[i].set_cluster_hist_index(i);
1611  _Qtot += _jets[i].E();
1612  }
1613  _initial_n = _jets.size();
1614  _deletes_self_when_unused = false;
1615 }

◆ _initialise_and_run()

void _initialise_and_run ( const JetDefinition jet_def,
const bool &  writeout_combinations 
)
protected
1429  {
1430  _decant_options(jet_def_in, writeout_combinations);
1432 }

◆ _initialise_and_run_no_decant()

void _initialise_and_run_no_decant ( )
protected
1433  {
1435  if (n_particles() == 0) return;
1437  _plugin_activated = true;
1438  _jet_def.plugin()->run_clustering( (*this) );
1439  _plugin_activated = false;
1441  return;
1442  } else if (_jet_algorithm == ee_kt_algorithm ||
1444  _strategy = N2Plain;
1446  assert(_Rparam > 2.0);
1447  _invR2 = 1.0;
1448  } else {
1449  if (_Rparam > pi) {
1450  // choose a value that ensures that back-to-back particles will
1451  // always recombine
1452  //_R2 = 4.0000000000001;
1453  _R2 = 2 * ( 3.0 + cos(_Rparam) );
1454  } else {
1455  _R2 = 2 * ( 1.0 - cos(_Rparam) );
1456  }
1457  _invR2 = 1.0/_R2;
1458  }
1460  return;
1461  } else if (_jet_algorithm == undefined_jet_algorithm) {
1462  throw Error("A ClusterSequence cannot be created with an uninitialised JetDefinition");
1463  }
1464  if (_strategy == Best) {
1466 #ifdef __FJCORE_DROP_CGAL
1467  if (_strategy == NlnN) _strategy = N2MHTLazy25;
1468 #endif // __FJCORE_DROP_CGAL
1469  } else if (_strategy == BestFJ30) {
1470  int N = _jets.size();
1471  if (min(1.0,max(0.1,_Rparam)*3.3)*N <= 30) {
1472  _strategy = N2Plain;
1473  } else if (N > 6200/pow(_Rparam,2.0) && _jet_def.jet_algorithm() == cambridge_algorithm) {
1474  _strategy = NlnNCam;
1475 #ifndef __FJCORE_DROP_CGAL
1476  } else if ((N > 16000/pow(_Rparam,1.15) && _jet_def.jet_algorithm() != antikt_algorithm)
1477  || N > 35000/pow(_Rparam,1.15)) {
1478  _strategy = NlnN;
1479 #endif // __FJCORE_DROP_CGAL
1480  } else if (N <= 450) {
1481  _strategy = N2Tiled;
1482  } else {
1484  }
1485  }
1486  if (_Rparam >= twopi) {
1487  if ( _strategy == NlnN
1488  || _strategy == NlnN3pi
1489  || _strategy == NlnNCam
1490  || _strategy == NlnNCam2pi2R
1491  || _strategy == NlnNCam4pi) {
1492 #ifdef __FJCORE_DROP_CGAL
1494 #else
1495  _strategy = NlnN4pi;
1496 #endif
1497  }
1498  if (_jet_def.strategy() != Best && _strategy != _jet_def.strategy()) {
1499  ostringstream oss;
1500  oss << "Cluster strategy " << strategy_string(_jet_def.strategy())
1501  << " automatically changed to " << strategy_string()
1502  << " because the former is not supported for R = " << _Rparam
1503  << " >= 2pi";
1504  _changed_strategy_warning.warn(oss.str());
1505  }
1506  }
1507  if (_strategy == N2Plain) {
1509  } else if (_strategy == N2Tiled) {
1510  this->_faster_tiled_N2_cluster();
1511  } else if (_strategy == N2MinHeapTiled) {
1513  } else if (_strategy == N2MHTLazy9Alt) {
1514  _plugin_activated = true;
1515  LazyTiling9Alt tiling(*this);
1516  tiling.run();
1517  _plugin_activated = false;
1518  } else if (_strategy == N2MHTLazy25) {
1519  _plugin_activated = true;
1520  LazyTiling25 tiling(*this);
1521  tiling.run();
1522  _plugin_activated = false;
1523  } else if (_strategy == N2MHTLazy9) {
1524  _plugin_activated = true;
1525  LazyTiling9 tiling(*this);
1526  tiling.run();
1527  _plugin_activated = false;
1528  } else if (_strategy == N2MHTLazy9AntiKtSeparateGhosts) {
1529  throw Error("N2MHTLazy9AntiKtSeparateGhosts strategy not supported with FJCORE");
1530  } else if (_strategy == NlnN) {
1531  this->_delaunay_cluster();
1532  } else if (_strategy == NlnNCam) {
1534  } else if (_strategy == NlnN3pi || _strategy == NlnN4pi ) {
1535  this->_delaunay_cluster();
1536  } else if (_strategy == N3Dumb ) {
1537  this->_really_dumb_cluster();
1538  } else if (_strategy == N2PoorTiled) {
1539  this->_tiled_N2_cluster();
1540  } else if (_strategy == NlnNCam4pi) {
1541  this->_CP2DChan_cluster();
1542  } else if (_strategy == NlnNCam2pi2R) {
1543  this->_CP2DChan_cluster_2pi2R();
1544  } else {
1545  ostringstream err;
1546  err << "Unrecognised value for strategy: "<<_strategy;
1547  throw Error(err.str());
1548  }
1549 }

◆ _initialise_tiles()

void _initialise_tiles ( )
private
2761  {
2762  double default_size = max(0.1,_Rparam);
2763  _tile_size_eta = default_size;
2764  _n_tiles_phi = max(3,int(floor(twopi/default_size)));
2765  _tile_size_phi = twopi / _n_tiles_phi; // >= _Rparam and fits in 2pi
2766  TilingExtent tiling_analysis(*this);
2767  _tiles_eta_min = tiling_analysis.minrap();
2768  _tiles_eta_max = tiling_analysis.maxrap();
2774  for (int ieta = _tiles_ieta_min; ieta <= _tiles_ieta_max; ieta++) {
2775  for (int iphi = 0; iphi < _n_tiles_phi; iphi++) {
2776  Tile * tile = & _tiles[_tile_index(ieta,iphi)];
2777  tile->head = NULL; // first element of tiles points to itself
2778  tile->begin_tiles[0] = tile;
2779  Tile ** pptile = & (tile->begin_tiles[0]);
2780  pptile++;
2781  tile->surrounding_tiles = pptile;
2782  if (ieta > _tiles_ieta_min) {
2783  // with the itile subroutine, we can safely run tiles from
2784  // idphi=-1 to idphi=+1, because it takes care of
2785  // negative and positive boundaries
2786  for (int idphi = -1; idphi <=+1; idphi++) {
2787  *pptile = & _tiles[_tile_index(ieta-1,iphi+idphi)];
2788  pptile++;
2789  }
2790  }
2791  *pptile = & _tiles[_tile_index(ieta,iphi-1)];
2792  pptile++;
2793  tile->RH_tiles = pptile;
2794  *pptile = & _tiles[_tile_index(ieta,iphi+1)];
2795  pptile++;
2796  if (ieta < _tiles_ieta_max) {
2797  for (int idphi = -1; idphi <= +1; idphi++) {
2798  *pptile = & _tiles[_tile_index(ieta+1,iphi+idphi)];
2799  pptile++;
2800  }
2801  }
2802  tile->end_tiles = pptile;
2803  tile->tagged = false;
2804  }
2805  }
2806 }

◆ _minheap_faster_tiled_N2_cluster()

void _minheap_faster_tiled_N2_cluster ( )
private
3149  {
3151  int n = _jets.size();
3152  TiledJet * briefjets = new TiledJet[n];
3153  TiledJet * jetA = briefjets, * jetB;
3154  TiledJet oldB;
3155  oldB.tile_index=0; // prevents a gcc warning
3156  vector<int> tile_union(3*n_tile_neighbours);
3157  for (int i = 0; i< n; i++) {
3158  _tj_set_jetinfo(jetA, i);
3159  jetA++; // move on to next entry of briefjets
3160  }
3161  TiledJet * head = briefjets; // a nicer way of naming start
3162  vector<Tile>::const_iterator tile;
3163  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
3164  for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
3165  for (jetB = tile->head; jetB != jetA; jetB = jetB->next) {
3166  double dist = _bj_dist(jetA,jetB);
3167  if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
3168  if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
3169  }
3170  }
3171  for (Tile ** RTile = tile->RH_tiles; RTile != tile->end_tiles; RTile++) {
3172  for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
3173  for (jetB = (*RTile)->head; jetB != NULL; jetB = jetB->next) {
3174  double dist = _bj_dist(jetA,jetB);
3175  if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
3176  if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
3177  }
3178  }
3179  }
3180  }
3181  vector<double> diJs(n);
3182  for (int i = 0; i < n; i++) {
3183  diJs[i] = _bj_diJ(&briefjets[i]);
3184  briefjets[i].label_minheap_update_done();
3185  }
3186  MinHeap minheap(diJs);
3187  vector<TiledJet *> jets_for_minheap;
3188  jets_for_minheap.reserve(n);
3189  int history_location = n-1;
3190  while (n > 0) {
3191  double diJ_min = minheap.minval() *_invR2;
3192  jetA = head + minheap.minloc();
3193  history_location++;
3194  jetB = jetA->NN;
3195  if (jetB != NULL) {
3196  if (jetA < jetB) {std::swap(jetA,jetB);}
3197  int nn; // new jet index
3198  _do_ij_recombination_step(jetA->_jets_index, jetB->_jets_index, diJ_min, nn);
3199  _bj_remove_from_tiles(jetA);
3200  oldB = * jetB; // take a copy because we will need it...
3201  _bj_remove_from_tiles(jetB);
3202  _tj_set_jetinfo(jetB, nn); // cause jetB to become _jets[nn]
3203  } else {
3204  _do_iB_recombination_step(jetA->_jets_index, diJ_min);
3205  _bj_remove_from_tiles(jetA);
3206  }
3207  minheap.remove(jetA-head);
3208  int n_near_tiles = 0;
3210  tile_union, n_near_tiles);
3211  if (jetB != NULL) {
3212  if (jetB->tile_index != jetA->tile_index) {
3213  _add_untagged_neighbours_to_tile_union(jetB->tile_index,
3214  tile_union,n_near_tiles);
3215  }
3216  if (oldB.tile_index != jetA->tile_index &&
3217  oldB.tile_index != jetB->tile_index) {
3218  // GS: the line below generates a warning that oldB.tile_index
3219  // may be used uninitialised. However, to reach this point, we
3220  // ned jetB != NULL (see test a few lines above) and is jetB
3221  // !=NULL, one would have gone through "oldB = *jetB before
3222  // (see piece of code ~20 line above), so the index is
3223  // initialised. We do not do anything to avoid the warning to
3224  // avoid any potential speed impact.
3226  tile_union,n_near_tiles);
3227  }
3228  jetB->label_minheap_update_needed();
3229  jets_for_minheap.push_back(jetB);
3230  }
3231  for (int itile = 0; itile < n_near_tiles; itile++) {
3232  Tile * tile_ptr = &_tiles[tile_union[itile]];
3233  tile_ptr->tagged = false; // reset tag, since we're done with unions
3234  for (TiledJet * jetI = tile_ptr->head; jetI != NULL; jetI = jetI->next) {
3235  // see if jetI had jetA or jetB as a NN -- if so recalculate the NN
3236  if (jetI->NN == jetA || (jetI->NN == jetB && jetB != NULL)) {
3237  jetI->NN_dist = _R2;
3238  jetI->NN = NULL;
3239  // label jetI as needing heap action...
3240  if (!jetI->minheap_update_needed()) {
3241  jetI->label_minheap_update_needed();
3242  jets_for_minheap.push_back(jetI);}
3243  // now go over tiles that are neighbours of I (include own tile)
3244  for (Tile ** near_tile = tile_ptr->begin_tiles;
3245  near_tile != tile_ptr->end_tiles; near_tile++) {
3246  // and then over the contents of that tile
3247  for (TiledJet * jetJ = (*near_tile)->head;
3248  jetJ != NULL; jetJ = jetJ->next) {
3249  double dist = _bj_dist(jetI,jetJ);
3250  if (dist < jetI->NN_dist && jetJ != jetI) {
3251  jetI->NN_dist = dist; jetI->NN = jetJ;
3252  }
3253  }
3254  }
3255  }
3256  // check whether new jetB is closer than jetI's current NN and
3257  // if jetI is closer than jetB's current (evolving) nearest
3258  // neighbour. Where relevant update things
3259  if (jetB != NULL) {
3260  double dist = _bj_dist(jetI,jetB);
3261  if (dist < jetI->NN_dist) {
3262  if (jetI != jetB) {
3263  jetI->NN_dist = dist;
3264  jetI->NN = jetB;
3265  // label jetI as needing heap action...
3266  if (!jetI->minheap_update_needed()) {
3267  jetI->label_minheap_update_needed();
3268  jets_for_minheap.push_back(jetI);}
3269  }
3270  }
3271  if (dist < jetB->NN_dist) {
3272  if (jetI != jetB) {
3273  jetB->NN_dist = dist;
3274  jetB->NN = jetI;}
3275  }
3276  }
3277  }
3278  }
3279  while (jets_for_minheap.size() > 0) {
3280  TiledJet * jetI = jets_for_minheap.back();
3281  jets_for_minheap.pop_back();
3282  minheap.update(jetI-head, _bj_diJ(jetI));
3283  jetI->label_minheap_update_done();
3284  }
3285  n--;
3286  }
3287  delete[] briefjets;
3288 }

◆ _print_tiles()

void _print_tiles ( TiledJet briefjets) const
private
2829  {
2830  for (vector<Tile>::const_iterator tile = _tiles.begin();
2831  tile < _tiles.end(); tile++) {
2832  cout << "Tile " << tile - _tiles.begin()<<" = ";
2833  vector<int> list;
2834  for (TiledJet * jetI = tile->head; jetI != NULL; jetI = jetI->next) {
2835  list.push_back(jetI-briefjets);
2836  }
2837  sort(list.begin(),list.end());
2838  for (unsigned int i = 0; i < list.size(); i++) {cout <<" "<<list[i];}
2839  cout <<"\n";
2840  }
2841 }

◆ _really_dumb_cluster()

void _really_dumb_cluster ( )
private
2572  {
2573  vector<PseudoJet *> jetsp(_jets.size());
2574  vector<int> indices(_jets.size());
2575  for (size_t i = 0; i<_jets.size(); i++) {
2576  jetsp[i] = & _jets[i];
2577  indices[i] = i;
2578  }
2579  for (int n = jetsp.size(); n > 0; n--) {
2580  int ii, jj;
2581  double ymin = jet_scale_for_algorithm(*(jetsp[0]));
2582  ii = 0; jj = -2;
2583  for (int i = 0; i < n; i++) {
2584  double yiB = jet_scale_for_algorithm(*(jetsp[i]));
2585  if (yiB < ymin) {
2586  ymin = yiB; ii = i; jj = -2;}
2587  }
2588  for (int i = 0; i < n-1; i++) {
2589  for (int j = i+1; j < n; j++) {
2590  //double y = jetsp[i]->kt_distance(*jetsp[j])*_invR2;
2591  double y = min(jet_scale_for_algorithm(*(jetsp[i])),
2592  jet_scale_for_algorithm(*(jetsp[j])))
2593  * jetsp[i]->plain_distance(*jetsp[j])*_invR2;
2594  if (y < ymin) {ymin = y; ii = i; jj = j;}
2595  }
2596  }
2597  int newn = 2*jetsp.size() - n;
2598  if (jj >= 0) {
2599  int nn; // new jet index
2600  _do_ij_recombination_step(jetsp[ii]-&_jets[0],
2601  jetsp[jj]-&_jets[0], ymin, nn);
2602  jetsp[ii] = &_jets[nn];
2603  jetsp[jj] = jetsp[n-1];
2604  indices[ii] = newn;
2605  indices[jj] = indices[n-1];
2606  } else {
2607  _do_iB_recombination_step(jetsp[ii]-&_jets[0], ymin);
2608  jetsp[ii] = jetsp[n-1];
2609  indices[ii] = indices[n-1];
2610  }
2611  }
2612 }

◆ _set_structure_shared_ptr()

void _set_structure_shared_ptr ( PseudoJet j)
protected

◆ _simple_N2_cluster() [1/2]

FJCORE_BEGIN_NAMESPACE void _simple_N2_cluster ( )
94  {
95  int n = _jets.size();
96  BJ * briefjets = new BJ[n];
97  BJ * jetA = briefjets, * jetB;
98  for (int i = 0; i< n; i++) {
99  _bj_set_jetinfo(jetA, i);
100  jetA++; // move on to next entry of briefjets
101  }
102  BJ * tail = jetA; // a semaphore for the end of briefjets
103  BJ * head = briefjets; // a nicer way of naming start
104  for (jetA = head + 1; jetA != tail; jetA++) {
105  _bj_set_NN_crosscheck(jetA, head, jetA);
106  }
107  double * diJ = new double[n];
108  jetA = head;
109  for (int i = 0; i < n; i++) {
110  diJ[i] = _bj_diJ(jetA);
111  jetA++; // have jetA follow i
112  }
113  int history_location = n-1;
114  while (tail != head) {
115  double diJ_min = diJ[0];
116  int diJ_min_jet = 0;
117  for (int i = 1; i < n; i++) {
118  if (diJ[i] < diJ_min) {diJ_min_jet = i; diJ_min = diJ[i];}
119  }
120  history_location++;
121  jetA = & briefjets[diJ_min_jet];
122  jetB = static_cast<BJ *>(jetA->NN);
123  diJ_min *= _invR2;
124  if (jetB != NULL) {
125  if (jetA < jetB) {std::swap(jetA,jetB);}
126  int nn; // new jet index
127  _do_ij_recombination_step(jetA->_jets_index, jetB->_jets_index, diJ_min, nn);
128  _bj_set_jetinfo(jetB, nn);
129  } else {
130  _do_iB_recombination_step(jetA->_jets_index, diJ_min);
131  }
132  tail--; n--;
133  *jetA = *tail;
134  diJ[jetA - head] = diJ[tail-head];
135  for (BJ * jetI = head; jetI != tail; jetI++) {
136  if (jetI->NN == jetA || jetI->NN == jetB) {
137  _bj_set_NN_nocross(jetI, head, tail);
138  diJ[jetI-head] = _bj_diJ(jetI); // update diJ
139  }
140  if (jetB != NULL) {
141  double dist = _bj_dist(jetI,jetB);
142  if (dist < jetI->NN_dist) {
143  if (jetI != jetB) {
144  jetI->NN_dist = dist;
145  jetI->NN = jetB;
146  diJ[jetI-head] = _bj_diJ(jetI); // update diJ...
147  }
148  }
149  if (dist < jetB->NN_dist) {
150  if (jetI != jetB) {
151  jetB->NN_dist = dist;
152  jetB->NN = jetI;}
153  }
154  }
155  if (jetI->NN == tail) {jetI->NN = jetA;}
156  }
157  if (jetB != NULL) {diJ[jetB-head] = _bj_diJ(jetB);}
158  }
159  delete[] diJ;
160  delete[] briefjets;
161 }

◆ _simple_N2_cluster() [2/2]

void _simple_N2_cluster ( )
private

◆ _simple_N2_cluster_BriefJet()

void _simple_N2_cluster_BriefJet ( )
private
2659  {
2660  _simple_N2_cluster<BriefJet>();
2661 }

◆ _simple_N2_cluster_EEBriefJet()

void _simple_N2_cluster_EEBriefJet ( )
private
2662  {
2663  _simple_N2_cluster<EEBriefJet>();
2664 }

◆ _tile_index() [1/2]

int _tile_index ( const double  eta,
const double  phi 
) const
private
2807  {
2808  int ieta, iphi;
2809  if (eta <= _tiles_eta_min) {ieta = 0;}
2810  else if (eta >= _tiles_eta_max) {ieta = _tiles_ieta_max-_tiles_ieta_min;}
2811  else {
2812  ieta = int(((eta - _tiles_eta_min) / _tile_size_eta));
2813  if (ieta > _tiles_ieta_max-_tiles_ieta_min) {
2815  }
2816  iphi = int((phi+twopi)/_tile_size_phi) % _n_tiles_phi;
2817  return (iphi + ieta * _n_tiles_phi);
2818 }

◆ _tile_index() [2/2]

int _tile_index ( int  ieta,
int  iphi 
) const
inlineprivate
1633  {
1634  return (ieta-_tiles_ieta_min)*_n_tiles_phi
1635  + (iphi+_n_tiles_phi) % _n_tiles_phi;
1636  }

◆ _tiled_N2_cluster()

void _tiled_N2_cluster ( )
private
2862  {
2864  int n = _jets.size();
2865  TiledJet * briefjets = new TiledJet[n];
2866  TiledJet * jetA = briefjets, * jetB;
2867  TiledJet oldB;
2868  oldB.tile_index=0; // prevents a gcc warning
2869  vector<int> tile_union(3*n_tile_neighbours);
2870  for (int i = 0; i< n; i++) {
2871  _tj_set_jetinfo(jetA, i);
2872  jetA++; // move on to next entry of briefjets
2873  }
2874  TiledJet * tail = jetA; // a semaphore for the end of briefjets
2875  TiledJet * head = briefjets; // a nicer way of naming start
2876  vector<Tile>::const_iterator tile;
2877  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
2878  for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
2879  for (jetB = tile->head; jetB != jetA; jetB = jetB->next) {
2880  double dist = _bj_dist(jetA,jetB);
2881  if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
2882  if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
2883  }
2884  }
2885  for (Tile ** RTile = tile->RH_tiles; RTile != tile->end_tiles; RTile++) {
2886  for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
2887  for (jetB = (*RTile)->head; jetB != NULL; jetB = jetB->next) {
2888  double dist = _bj_dist(jetA,jetB);
2889  if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
2890  if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
2891  }
2892  }
2893  }
2894  }
2895  double * diJ = new double[n];
2896  jetA = head;
2897  for (int i = 0; i < n; i++) {
2898  diJ[i] = _bj_diJ(jetA);
2899  jetA++; // have jetA follow i
2900  }
2901  int history_location = n-1;
2902  while (tail != head) {
2903  double diJ_min = diJ[0];
2904  int diJ_min_jet = 0;
2905  for (int i = 1; i < n; i++) {
2906  if (diJ[i] < diJ_min) {diJ_min_jet = i; diJ_min = diJ[i];}
2907  }
2908  history_location++;
2909  jetA = & briefjets[diJ_min_jet];
2910  jetB = jetA->NN;
2911  diJ_min *= _invR2;
2912  if (jetB != NULL) {
2913  if (jetA < jetB) {std::swap(jetA,jetB);}
2914  int nn; // new jet index
2915  _do_ij_recombination_step(jetA->_jets_index, jetB->_jets_index, diJ_min, nn);
2916  _bj_remove_from_tiles(jetA);
2917  oldB = * jetB; // take a copy because we will need it...
2918  _bj_remove_from_tiles(jetB);
2919  _tj_set_jetinfo(jetB, nn); // also registers the jet in the tiling
2920  } else {
2921  _do_iB_recombination_step(jetA->_jets_index, diJ_min);
2922  _bj_remove_from_tiles(jetA);
2923  }
2924  int n_near_tiles = 0;
2925  _add_neighbours_to_tile_union(jetA->tile_index, tile_union, n_near_tiles);
2926  if (jetB != NULL) {
2927  bool sort_it = false;
2928  if (jetB->tile_index != jetA->tile_index) {
2929  sort_it = true;
2930  _add_neighbours_to_tile_union(jetB->tile_index,tile_union,n_near_tiles);
2931  }
2932  if (oldB.tile_index != jetA->tile_index &&
2933  oldB.tile_index != jetB->tile_index) {
2934  sort_it = true;
2935  _add_neighbours_to_tile_union(oldB.tile_index,tile_union,n_near_tiles);
2936  }
2937  if (sort_it) {
2938  // sort the tiles before then compressing the list
2939  sort(tile_union.begin(), tile_union.begin()+n_near_tiles);
2940  // and now condense the list
2941  int nnn = 1;
2942  for (int i = 1; i < n_near_tiles; i++) {
2943  if (tile_union[i] != tile_union[nnn-1]) {
2944  tile_union[nnn] = tile_union[i];
2945  nnn++;
2946  }
2947  }
2948  n_near_tiles = nnn;
2949  }
2950  }
2951  tail--; n--;
2952  if (jetA == tail) {
2953  } else {
2954  *jetA = *tail;
2955  diJ[jetA - head] = diJ[tail-head];
2956  if (jetA->previous == NULL) {
2957  _tiles[jetA->tile_index].head = jetA;
2958  } else {
2959  jetA->previous->next = jetA;
2960  }
2961  if (jetA->next != NULL) {jetA->next->previous = jetA;}
2962  }
2963  for (int itile = 0; itile < n_near_tiles; itile++) {
2964  Tile * tile_ptr = &_tiles[tile_union[itile]];
2965  for (TiledJet * jetI = tile_ptr->head; jetI != NULL; jetI = jetI->next) {
2966  // see if jetI had jetA or jetB as a NN -- if so recalculate the NN
2967  if (jetI->NN == jetA || (jetI->NN == jetB && jetB != NULL)) {
2968  jetI->NN_dist = _R2;
2969  jetI->NN = NULL;
2970  // now go over tiles that are neighbours of I (include own tile)
2971  for (Tile ** near_tile = tile_ptr->begin_tiles;
2972  near_tile != tile_ptr->end_tiles; near_tile++) {
2973  // and then over the contents of that tile
2974  for (TiledJet * jetJ = (*near_tile)->head;
2975  jetJ != NULL; jetJ = jetJ->next) {
2976  double dist = _bj_dist(jetI,jetJ);
2977  if (dist < jetI->NN_dist && jetJ != jetI) {
2978  jetI->NN_dist = dist; jetI->NN = jetJ;
2979  }
2980  }
2981  }
2982  diJ[jetI-head] = _bj_diJ(jetI); // update diJ
2983  }
2984  // check whether new jetB is closer than jetI's current NN and
2985  // if need to update things
2986  if (jetB != NULL) {
2987  double dist = _bj_dist(jetI,jetB);
2988  if (dist < jetI->NN_dist) {
2989  if (jetI != jetB) {
2990  jetI->NN_dist = dist;
2991  jetI->NN = jetB;
2992  diJ[jetI-head] = _bj_diJ(jetI); // update diJ...
2993  }
2994  }
2995  if (dist < jetB->NN_dist) {
2996  if (jetI != jetB) {
2997  jetB->NN_dist = dist;
2998  jetB->NN = jetI;}
2999  }
3000  }
3001  }
3002  }
3003  if (jetB != NULL) {diJ[jetB-head] = _bj_diJ(jetB);}
3004  for (Tile ** near_tile = _tiles[tail->tile_index].begin_tiles;
3005  near_tile!= _tiles[tail->tile_index].end_tiles; near_tile++){
3006  for (TiledJet * jetJ = (*near_tile)->head;
3007  jetJ != NULL; jetJ = jetJ->next) {
3008  if (jetJ->NN == tail) {jetJ->NN = jetA;}
3009  }
3010  }
3011  if (jetB != NULL) {diJ[jetB-head] = _bj_diJ(jetB);}
3012  }
3013  delete[] diJ;
3014  delete[] briefjets;
3015 }

◆ _tj_set_jetinfo()

void _tj_set_jetinfo ( TiledJet *const  jet,
const int  _jets_index 
)
inlineprivate
2820  {
2821  _bj_set_jetinfo<>(jet, _jets_index);
2822  jet->tile_index = _tile_index(jet->eta, jet->phi);
2823  Tile * tile = &_tiles[jet->tile_index];
2824  jet->previous = NULL;
2825  jet->next = tile->head;
2826  if (jet->next != NULL) {jet->next->previous = jet;}
2827  tile->head = jet;
2828 }

◆ _transfer_input_jets()

void _transfer_input_jets ( const std::vector< L > &  pseudojets)
protected
1657  {
1658  _jets.reserve(pseudojets.size()*2);
1659  for (unsigned int i = 0; i < pseudojets.size(); i++) {
1660  _jets.push_back(pseudojets[i]);}
1661 }

◆ _update_structure_use_count()

void _update_structure_use_count ( )
protected

◆ add_constituents()

void add_constituents ( const PseudoJet jet,
std::vector< PseudoJet > &  subjet_vector 
) const
2121  {
2122  int i = jet.cluster_hist_index();
2123  int parent1 = _history[i].parent1;
2124  int parent2 = _history[i].parent2;
2125  if (parent1 == InexistentParent) {
2126  subjet_vector.push_back(_jets[i]);
2127  return;
2128  }
2129  add_constituents(_jets[_history[parent1].jetp_index], subjet_vector);
2130  if (parent2 != BeamJet) {
2131  add_constituents(_jets[_history[parent2].jetp_index], subjet_vector);
2132  }
2133 }

◆ childless_pseudojets()

vector< PseudoJet > childless_pseudojets ( ) const
2209  {
2210  vector<PseudoJet> unclustered;
2211  for (unsigned i = 0; i < _history.size() ; i++) {
2212  if ((_history[i].child == Invalid) && (_history[i].parent2 != BeamJet))
2213  unclustered.push_back(_jets[_history[i].jetp_index]);
2214  }
2215  return unclustered;
2216 }

◆ constituents()

vector< PseudoJet > constituents ( const PseudoJet jet) const
2075  {
2076  vector<PseudoJet> subjets;
2077  add_constituents(jet, subjets);
2078  return subjets;
2079 }

◆ contains()

bool contains ( const PseudoJet object) const
2217  {
2218  return jet.cluster_hist_index() >= 0
2219  && jet.cluster_hist_index() < int(_history.size())
2220  && jet.has_valid_cluster_sequence()
2221  && jet.associated_cluster_sequence() == this;
2222 }

◆ delete_self_when_unused()

void delete_self_when_unused ( )
2271  {
2273  if (new_count <= 0) {
2274  throw Error("delete_self_when_unused may only be called if at least one object outside the CS (e.g. a jet) is already associated with the CS");
2275  }
2276  _structure_shared_ptr.set_count(new_count);
2278 }

◆ exclusive_dmerge()

double exclusive_dmerge ( const int  njets) const
1919  {
1920  assert(njets >= 0);
1921  if (njets >= _initial_n) {return 0.0;}
1922  return _history[2*_initial_n-njets-1].dij;
1923 }

◆ exclusive_dmerge_max()

double exclusive_dmerge_max ( const int  njets) const
1924  {
1925  assert(njets >= 0);
1926  if (njets >= _initial_n) {return 0.0;}
1927  return _history[2*_initial_n-njets-1].max_dij_so_far;
1928 }

◆ exclusive_jets() [1/2]

vector< PseudoJet > exclusive_jets ( const double  dcut) const
1868  {
1869  int njets = n_exclusive_jets(dcut);
1870  return exclusive_jets(njets);
1871 }

◆ exclusive_jets() [2/2]

vector< PseudoJet > exclusive_jets ( const int  njets) const
1872  {
1873  if (njets > _initial_n) {
1874  ostringstream err;
1875  err << "Requested " << njets << " exclusive jets, but there were only "
1876  << _initial_n << " particles in the event";
1877  throw Error(err.str());
1878  }
1879  return exclusive_jets_up_to(njets);
1880 }

◆ exclusive_jets_up_to()

vector< PseudoJet > exclusive_jets_up_to ( const int  njets) const
1881  {
1882  if (( _jet_def.jet_algorithm() != kt_algorithm) &&
1887  (_jet_def.extra_param() <0)) &&
1890  _exclusive_warnings.warn("dcut and exclusive jets for jet-finders other than kt, C/A or genkt with p>=0 should be interpreted with care.");
1891  }
1892  int stop_point = 2*_initial_n - njets;
1893  if (stop_point < _initial_n) stop_point = _initial_n;
1894  if (2*_initial_n != static_cast<int>(_history.size())) {
1895  ostringstream err;
1896  err << "2*_initial_n != _history.size() -- this endangers internal assumptions!\n";
1897  throw Error(err.str());
1898  }
1899  vector<PseudoJet> jets_local;
1900  for (unsigned int i = stop_point; i < _history.size(); i++) {
1901  int parent1 = _history[i].parent1;
1902  if (parent1 < stop_point) {
1903  jets_local.push_back(_jets[_history[parent1].jetp_index]);
1904  }
1905  int parent2 = _history[i].parent2;
1906  if (parent2 < stop_point && parent2 > 0) {
1907  jets_local.push_back(_jets[_history[parent2].jetp_index]);
1908  }
1909  }
1910  if (int(jets_local.size()) != min(_initial_n, njets)) {
1911  ostringstream err;
1912  err << "ClusterSequence::exclusive_jets: size of returned vector ("
1913  <<jets_local.size()<<") does not coincide with requested number of jets ("
1914  <<njets<<")";
1915  throw Error(err.str());
1916  }
1917  return jets_local;
1918 }

◆ exclusive_jets_ycut()

std::vector<PseudoJet> exclusive_jets_ycut ( double  ycut) const
inline
1404  {
1405  int njets = n_exclusive_jets_ycut(ycut);
1406  return exclusive_jets(njets);
1407  }

◆ exclusive_subdmerge()

double exclusive_subdmerge ( const PseudoJet jet,
int  nsub 
) const
1972  {
1973  set<const history_element*> subhist;
1974  get_subhist_set(subhist, jet, -1.0, nsub);
1975  set<const history_element*>::iterator highest = subhist.end();
1976  highest--;
1977  return (*highest)->dij;
1978 }

◆ exclusive_subdmerge_max()

double exclusive_subdmerge_max ( const PseudoJet jet,
int  nsub 
) const
1979  {
1980  set<const history_element*> subhist;
1981  get_subhist_set(subhist, jet, -1.0, nsub);
1982  set<const history_element*>::iterator highest = subhist.end();
1983  highest--;
1984  return (*highest)->max_dij_so_far;
1985 }

◆ exclusive_subjets() [1/2]

std::vector< PseudoJet > exclusive_subjets ( const PseudoJet jet,
const double  dcut 
) const
1930  {
1931  set<const history_element*> subhist;
1932  get_subhist_set(subhist, jet, dcut, 0);
1933  vector<PseudoJet> subjets;
1934  subjets.reserve(subhist.size());
1935  for (set<const history_element*>::iterator elem = subhist.begin();
1936  elem != subhist.end(); elem++) {
1937  subjets.push_back(_jets[(*elem)->jetp_index]);
1938  }
1939  return subjets;
1940 }

◆ exclusive_subjets() [2/2]

std::vector< PseudoJet > exclusive_subjets ( const PseudoJet jet,
int  nsub 
) const
1948  {
1949  vector<PseudoJet> subjets = exclusive_subjets_up_to(jet, nsub);
1950  if (int(subjets.size()) < nsub) {
1951  ostringstream err;
1952  err << "Requested " << nsub << " exclusive subjets, but there were only "
1953  << subjets.size() << " particles in the jet";
1954  throw Error(err.str());
1955  }
1956  return subjets;
1957 }

◆ exclusive_subjets_up_to()

std::vector< PseudoJet > exclusive_subjets_up_to ( const PseudoJet jet,
int  nsub 
) const
1959  {
1960  set<const history_element*> subhist;
1961  vector<PseudoJet> subjets;
1962  if (nsub < 0) throw Error("Requested a negative number of subjets. This is nonsensical.");
1963  if (nsub == 0) return subjets;
1964  get_subhist_set(subhist, jet, -1.0, nsub);
1965  subjets.reserve(subhist.size());
1966  for (set<const history_element*>::iterator elem = subhist.begin();
1967  elem != subhist.end(); elem++) {
1968  subjets.push_back(_jets[(*elem)->jetp_index]);
1969  }
1970  return subjets;
1971 }

◆ exclusive_ymerge()

double exclusive_ymerge ( int  njets) const
inline
1401 {return exclusive_dmerge(njets) / Q2();}

◆ exclusive_ymerge_max()

double exclusive_ymerge_max ( int  njets) const
inline
1402 {return exclusive_dmerge_max(njets)/Q2();}

◆ extras()

const Extras* extras ( ) const
inline
1471 {return _extras.get();}

◆ fastjet_banner_stream()

static std::ostream* fastjet_banner_stream ( )
inlinestatic
1507 {return _fastjet_banner_ostr;}

◆ get_subhist_set()

void get_subhist_set ( std::set< const history_element * > &  subhist,
const PseudoJet jet,
double  dcut,
int  maxjet 
) const
protected
1988  {
1989  assert(contains(jet));
1990  subhist.clear();
1991  subhist.insert(&(_history[jet.cluster_hist_index()]));
1992  int njet = 1;
1993  while (true) {
1994  set<const history_element*>::iterator highest = subhist.end();
1995  assert (highest != subhist.begin());
1996  highest--;
1997  const history_element* elem = *highest;
1998  if (njet == maxjet) break;
1999  if (elem->parent1 < 0) break;
2000  if (elem->max_dij_so_far <= dcut) break;
2001  subhist.erase(highest);
2002  subhist.insert(&(_history[elem->parent1]));
2003  subhist.insert(&(_history[elem->parent2]));
2004  njet++;
2005  }
2006 }

◆ has_child() [1/2]

bool has_child ( const PseudoJet jet,
const PseudoJet *&  childp 
) const
2049  {
2050  const history_element & hist = _history[jet.cluster_hist_index()];
2051  if (hist.child >= 0 && _history[hist.child].jetp_index >= 0) {
2052  childp = &(_jets[_history[hist.child].jetp_index]);
2053  return true;
2054  } else {
2055  childp = NULL;
2056  return false;
2057  }
2058 }

◆ has_child() [2/2]

bool has_child ( const PseudoJet jet,
PseudoJet child 
) const
2038  {
2039  const PseudoJet * childp;
2040  bool res = has_child(jet, childp);
2041  if (res) {
2042  child = *childp;
2043  return true;
2044  } else {
2045  child = PseudoJet(0.0,0.0,0.0,0.0);
2046  return false;
2047  }
2048 }

◆ has_parents()

bool has_parents ( const PseudoJet jet,
PseudoJet parent1,
PseudoJet parent2 
) const
2023  {
2024  const history_element & hist = _history[jet.cluster_hist_index()];
2025  assert ((hist.parent1 >= 0 && hist.parent2 >= 0) ||
2026  (hist.parent1 < 0 && hist.parent2 < 0));
2027  if (hist.parent1 < 0) {
2028  parent1 = PseudoJet(0.0,0.0,0.0,0.0);
2029  parent2 = parent1;
2030  return false;
2031  } else {
2032  parent1 = _jets[_history[hist.parent1].jetp_index];
2033  parent2 = _jets[_history[hist.parent2].jetp_index];
2034  if (parent1.perp2() < parent2.perp2()) std::swap(parent1,parent2);
2035  return true;
2036  }
2037 }

◆ has_partner()

bool has_partner ( const PseudoJet jet,
PseudoJet partner 
) const
2060  {
2061  const history_element & hist = _history[jet.cluster_hist_index()];
2062  if (hist.child >= 0 && _history[hist.child].parent2 >= 0) {
2063  const history_element & child_hist = _history[hist.child];
2064  if (child_hist.parent1 == jet.cluster_hist_index()) {
2065  partner = _jets[_history[child_hist.parent2].jetp_index];
2066  } else {
2067  partner = _jets[_history[child_hist.parent1].jetp_index];
2068  }
2069  return true;
2070  } else {
2071  partner = PseudoJet(0.0,0.0,0.0,0.0);
2072  return false;
2073  }
2074 }

◆ history()

const std::vector< ClusterSequence::history_element > & history ( ) const
inline
1676  {
1677  return _history;
1678 }

◆ inclusive_jets()

vector< PseudoJet > inclusive_jets ( const double  ptmin = 0.0) const
1820  {
1821  double dcut = ptmin*ptmin;
1822  int i = _history.size() - 1; // last jet
1823  vector<PseudoJet> jets_local;
1824  if (_jet_algorithm == kt_algorithm) {
1825  while (i >= 0) {
1826  if (_history[i].max_dij_so_far < dcut) {break;}
1827  if (_history[i].parent2 == BeamJet && _history[i].dij >= dcut) {
1828  // for beam jets
1829  int parent1 = _history[i].parent1;
1830  jets_local.push_back(_jets[_history[parent1].jetp_index]);}
1831  i--;
1832  }
1833  } else if (_jet_algorithm == cambridge_algorithm) {
1834  while (i >= 0) {
1835  if (_history[i].parent2 != BeamJet) {break;}
1836  int parent1 = _history[i].parent1;
1837  const PseudoJet & jet = _jets[_history[parent1].jetp_index];
1838  if (jet.perp2() >= dcut) {jets_local.push_back(jet);}
1839  i--;
1840  }
1841  } else if (_jet_algorithm == plugin_algorithm
1847  while (i >= 0) {
1848  if (_history[i].parent2 == BeamJet) {
1849  int parent1 = _history[i].parent1;
1850  const PseudoJet & jet = _jets[_history[parent1].jetp_index];
1851  if (jet.perp2() >= dcut) {jets_local.push_back(jet);}
1852  }
1853  i--;
1854  }
1855  } else {throw Error("cs::inclusive_jets(...): Unrecognized jet algorithm");}
1856  return jets_local;
1857 }

◆ jet_def()

const JetDefinition& jet_def ( ) const
inline
1437 {return _jet_def;}

◆ jet_scale_for_algorithm()

double jet_scale_for_algorithm ( const PseudoJet jet) const
1657  {
1658  if (_jet_algorithm == kt_algorithm) {return jet.kt2();}
1659  else if (_jet_algorithm == cambridge_algorithm) {return 1.0;}
1660  else if (_jet_algorithm == antikt_algorithm) {
1661  double kt2=jet.kt2();
1662  return kt2 > 1e-300 ? 1.0/kt2 : 1e300;
1663  } else if (_jet_algorithm == genkt_algorithm) {
1664  double kt2 = jet.kt2();
1665  double p = jet_def().extra_param();
1666  if (p <= 0 && kt2 < 1e-300) kt2 = 1e-300; // dodgy safety check
1667  return pow(kt2, p);
1669  double kt2 = jet.kt2();
1670  double lim = _jet_def.extra_param();
1671  if (kt2 < lim*lim && kt2 != 0.0) {
1672  return 1.0/kt2;
1673  } else {return 1.0;}
1674  } else {throw Error("Unrecognised jet algorithm");}
1675 }

◆ jets()

const std::vector< PseudoJet > & jets ( ) const
inline
1673  {
1674  return _jets;
1675 }

◆ n_exclusive_jets()

int n_exclusive_jets ( const double  dcut) const
1858  {
1859  int i = _history.size() - 1; // last jet
1860  while (i >= 0) {
1861  if (_history[i].max_dij_so_far <= dcut) {break;}
1862  i--;
1863  }
1864  int stop_point = i + 1;
1865  int njets = 2*_initial_n - stop_point;
1866  return njets;
1867 }

◆ n_exclusive_jets_ycut()

int n_exclusive_jets_ycut ( double  ycut) const
inline
1403 {return n_exclusive_jets(ycut*Q2());}

◆ n_exclusive_subjets()

int n_exclusive_subjets ( const PseudoJet jet,
const double  dcut 
) const
1942  {
1943  set<const history_element*> subhist;
1944  get_subhist_set(subhist, jet, dcut, 0);
1945  return subhist.size();
1946 }

◆ n_particles()

unsigned int n_particles ( ) const
inline
1679 {return _initial_n;}

◆ object_in_jet()

bool object_in_jet ( const PseudoJet object,
const PseudoJet jet 
) const
2008  {
2009  assert(contains(object) && contains(jet));
2010  const PseudoJet * this_object = &object;
2011  const PseudoJet * childp;
2012  while(true) {
2013  if (this_object->cluster_hist_index() == jet.cluster_hist_index()) {
2014  return true;
2015  } else if (has_child(*this_object, childp)) {
2016  this_object = childp;
2017  } else {
2018  return false;
2019  }
2020  }
2021 }

◆ operator=()

ClusterSequence & operator= ( const ClusterSequence cs)
1772  {
1773  if (&cs != this) {
1774  _deletes_self_when_unused = false;
1776  }
1777  return *this;
1778 }

◆ particle_jet_indices()

vector< int > particle_jet_indices ( const std::vector< PseudoJet > &  jets_in) const
2106  {
2107  vector<int> indices(n_particles());
2108  for (unsigned ipart = 0; ipart < n_particles(); ipart++)
2109  indices[ipart] = -1;
2110  for (unsigned ijet = 0; ijet < jets_in.size(); ijet++) {
2111  vector<PseudoJet> jet_constituents(constituents(jets_in[ijet]));
2112  for (unsigned ip = 0; ip < jet_constituents.size(); ip++) {
2113  unsigned iclust = jet_constituents[ip].cluster_hist_index();
2114  unsigned ipart = history()[iclust].jetp_index;
2115  indices[ipart] = ijet;
2116  }
2117  }
2118  return indices;
2119 }

◆ plugin_activated()

bool plugin_activated ( ) const
inline
1470 {return _plugin_activated;}

◆ plugin_associate_extras()

void plugin_associate_extras ( Extras extras_in)
inline
1459  {
1460  _extras.reset(extras_in);
1461  }

◆ plugin_record_iB_recombination()

void plugin_record_iB_recombination ( int  jet_i,
double  diB 
)
inline
1450  {
1451  assert(plugin_activated());
1452  _do_iB_recombination_step(jet_i, diB);
1453  }

◆ plugin_record_ij_recombination() [1/2]

void plugin_record_ij_recombination ( int  jet_i,
int  jet_j,
double  dij,
const PseudoJet newjet,
int &  newjet_k 
)
1813  {
1814  plugin_record_ij_recombination(jet_i, jet_j, dij, newjet_k);
1815  int tmp_index = _jets[newjet_k].cluster_hist_index();
1816  _jets[newjet_k] = newjet;
1817  _jets[newjet_k].set_cluster_hist_index(tmp_index);
1818  _set_structure_shared_ptr(_jets[newjet_k]);
1819 }

◆ plugin_record_ij_recombination() [2/2]

void plugin_record_ij_recombination ( int  jet_i,
int  jet_j,
double  dij,
int &  newjet_k 
)
inline
1443  {
1444  assert(plugin_activated());
1445  _do_ij_recombination_step(jet_i, jet_j, dij, newjet_k);
1446  }

◆ plugin_simple_N2_cluster()

void plugin_simple_N2_cluster ( )
inline
1472  {
1473  assert(plugin_activated());
1474  _simple_N2_cluster<GBJ>();
1475  }

◆ print_banner()

void print_banner ( )
static
1555  {
1556  if (!_first_time) {return;}
1557  _first_time = false;
1558  ostream * ostr = _fastjet_banner_ostr;
1559  if (!ostr) return;
1560  (*ostr) << "#--------------------------------------------------------------------------\n";
1561  (*ostr) << "# FastJet release " << fastjet_version << " [fjcore]" << endl;
1562  (*ostr) << "# M. Cacciari, G.P. Salam and G. Soyez \n";
1563  (*ostr) << "# A software package for jet finding and analysis at colliders \n";
1564  (*ostr) << "# http://fastjet.fr \n";
1565  (*ostr) << "# \n";
1566  (*ostr) << "# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package\n";
1567  (*ostr) << "# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210]. \n";
1568  (*ostr) << "# \n";
1569  (*ostr) << "# FastJet is provided without warranty under the terms of the GNU GPLv2.\n";
1570  (*ostr) << "# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code";
1571 #ifndef __FJCORE_DROP_CGAL
1572  (*ostr) << ",\n# CGAL ";
1573 #else
1574  (*ostr) << "\n# ";
1575 #endif // __FJCORE_DROP_CGAL
1576  (*ostr) << "and 3rd party plugin jet algorithms. See COPYING file for details.\n";
1577  (*ostr) << "#--------------------------------------------------------------------------\n";
1578  ostr->flush();
1579 }

◆ print_jets_for_root() [1/2]

void print_jets_for_root ( const std::vector< PseudoJet > &  jets,
const std::string &  filename,
const std::string &  comment = "" 
) const
2100  {
2101  std::ofstream ostr(filename.c_str());
2102  if (comment != "") ostr << "# " << comment << endl;
2103  print_jets_for_root(jets_in, ostr);
2104 }

◆ print_jets_for_root() [2/2]

void print_jets_for_root ( const std::vector< PseudoJet > &  jets,
std::ostream &  ostr = std::cout 
) const
2081  {
2082  for (unsigned i = 0; i < jets_in.size(); i++) {
2083  ostr << i << " "
2084  << jets_in[i].px() << " "
2085  << jets_in[i].py() << " "
2086  << jets_in[i].pz() << " "
2087  << jets_in[i].E() << endl;
2088  vector<PseudoJet> cst = constituents(jets_in[i]);
2089  for (unsigned j = 0; j < cst.size() ; j++) {
2090  ostr << " " << j << " "
2091  << cst[j].rap() << " "
2092  << cst[j].phi() << " "
2093  << cst[j].perp() << endl;
2094  }
2095  ostr << "#END" << endl;
2096  }
2097 }

◆ Q()

double Q ( ) const
inline
1418 {return _Qtot;}

◆ Q2()

double Q2 ( ) const
inline
1419 {return _Qtot*_Qtot;}

◆ set_fastjet_banner_stream()

static void set_fastjet_banner_stream ( std::ostream *  ostr)
inlinestatic
1506 {_fastjet_banner_ostr = ostr;}

◆ signal_imminent_self_deletion()

void signal_imminent_self_deletion ( ) const
1423  {
1424  assert(_deletes_self_when_unused);
1425  _deletes_self_when_unused = false;
1426 }

◆ strategy_string() [1/2]

std::string strategy_string ( ) const
inline
1435 {return strategy_string(_strategy);}

◆ strategy_string() [2/2]

string strategy_string ( Strategy  strategy_in) const
1616  {
1617  string strategy;
1618  switch(strategy_in) {
1619  case NlnN:
1620  strategy = "NlnN"; break;
1621  case NlnN3pi:
1622  strategy = "NlnN3pi"; break;
1623  case NlnN4pi:
1624  strategy = "NlnN4pi"; break;
1625  case N2Plain:
1626  strategy = "N2Plain"; break;
1627  case N2Tiled:
1628  strategy = "N2Tiled"; break;
1629  case N2MinHeapTiled:
1630  strategy = "N2MinHeapTiled"; break;
1631  case N2PoorTiled:
1632  strategy = "N2PoorTiled"; break;
1633  case N2MHTLazy9:
1634  strategy = "N2MHTLazy9"; break;
1635  case N2MHTLazy9Alt:
1636  strategy = "N2MHTLazy9Alt"; break;
1637  case N2MHTLazy25:
1638  strategy = "N2MHTLazy25"; break;
1640  strategy = "N2MHTLazy9AntiKtSeparateGhosts"; break;
1641  case N3Dumb:
1642  strategy = "N3Dumb"; break;
1643  case NlnNCam4pi:
1644  strategy = "NlnNCam4pi"; break;
1645  case NlnNCam2pi2R:
1646  strategy = "NlnNCam2pi2R"; break;
1647  case NlnNCam:
1648  strategy = "NlnNCam"; break; // 2piMultD
1649  case plugin_strategy:
1650  strategy = "plugin strategy"; break;
1651  default:
1652  strategy = "Unrecognized";
1653  }
1654  return strategy;
1655 }

◆ strategy_used()

Strategy strategy_used ( ) const
inline
1434 {return _strategy;}

◆ structure_shared_ptr()

const SharedPtr<PseudoJetStructureBase>& structure_shared_ptr ( ) const
inline
1501  {
1502  return _structure_shared_ptr;
1503  }

◆ transfer_from_sequence()

void transfer_from_sequence ( const ClusterSequence from_seq,
const FunctionOfPseudoJet< PseudoJet > *  action_on_jets = 0 
)
1780  {
1782  throw(Error("cannot use CS::transfer_from_sequence after a call to delete_self_when_unused()"));
1783  _jet_def = from_seq._jet_def ;
1785  _initial_n = from_seq._initial_n ;
1786  _Rparam = from_seq._Rparam ;
1787  _R2 = from_seq._R2 ;
1788  _invR2 = from_seq._invR2 ;
1789  _strategy = from_seq._strategy ;
1790  _jet_algorithm = from_seq._jet_algorithm ;
1792  if (action_on_jets)
1793  _jets = (*action_on_jets)(from_seq._jets);
1794  else
1795  _jets = from_seq._jets;
1796  _history = from_seq._history;
1797  _extras = from_seq._extras;
1798  if (_structure_shared_ptr) {
1799  if (_deletes_self_when_unused) throw Error("transfer_from_sequence cannot be used for a cluster sequence that deletes self when unused");
1801  assert(csi != NULL);
1802  csi->set_associated_cs(NULL);
1803  }
1806  for (unsigned int i=0; i<_jets.size(); i++){
1807  _jets[i].set_cluster_hist_index(from_seq._jets[i].cluster_hist_index());
1809  }
1810 }

◆ unclustered_particles()

vector< PseudoJet > unclustered_particles ( ) const
2201  {
2202  vector<PseudoJet> unclustered;
2203  for (unsigned i = 0; i < n_particles() ; i++) {
2204  if (_history[i].child == Invalid)
2205  unclustered.push_back(_jets[_history[i].jetp_index]);
2206  }
2207  return unclustered;
2208 }

◆ unique_history_order()

vector< int > unique_history_order ( ) const
2169  {
2170  valarray<int> lowest_constituent(_history.size());
2171  int hist_n = _history.size();
2172  lowest_constituent = hist_n; // give it a large number
2173  for (int i = 0; i < hist_n; i++) {
2174  lowest_constituent[i] = min(lowest_constituent[i],i);
2175  if (_history[i].child > 0) lowest_constituent[_history[i].child]
2176  = min(lowest_constituent[_history[i].child],lowest_constituent[i]);
2177  }
2178  valarray<bool> extracted(_history.size()); extracted = false;
2179  vector<int> unique_tree;
2180  unique_tree.reserve(_history.size());
2181  for (unsigned i = 0; i < n_particles(); i++) {
2182  if (!extracted[i]) {
2183  unique_tree.push_back(i);
2184  extracted[i] = true;
2185  _extract_tree_children(i, extracted, lowest_constituent, unique_tree);
2186  }
2187  }
2188  return unique_tree;
2189 }

◆ will_delete_self_when_unused()

bool will_delete_self_when_unused ( ) const
inline
1439 {return _deletes_self_when_unused;}

Member Data Documentation

◆ _changed_strategy_warning

LimitedWarning _changed_strategy_warning
staticprivate

◆ _deletes_self_when_unused

bool _deletes_self_when_unused
mutableprotected

◆ _exclusive_warnings

LimitedWarning _exclusive_warnings
staticprivate

◆ _extras

SharedPtr<Extras> _extras
private

◆ _fastjet_banner_ostr

std::ostream * _fastjet_banner_ostr = &cout
staticprivate

◆ _first_time

bool _first_time = true
staticprivate

◆ _history

std::vector<history_element> _history
protected

◆ _initial_n

int _initial_n
protected

◆ _invR2

double _invR2
protected

◆ _jet_algorithm

JetAlgorithm _jet_algorithm
protected

◆ _jet_def

JetDefinition _jet_def
protected

◆ _jets

std::vector<PseudoJet> _jets
protected

◆ _n_tiles_phi

int _n_tiles_phi
private

◆ _plugin_activated

bool _plugin_activated
private

◆ _Qtot

double _Qtot
protected

◆ _R2

double _R2
protected

◆ _Rparam

double _Rparam
protected

◆ _strategy

Strategy _strategy
protected

◆ _structure_shared_ptr

SharedPtr<PseudoJetStructureBase> _structure_shared_ptr
protected

◆ _structure_use_count_after_construction

int _structure_use_count_after_construction
protected

◆ _tile_size_eta

double _tile_size_eta
private

◆ _tile_size_phi

double _tile_size_phi
private

◆ _tiles

std::vector<Tile> _tiles
private

◆ _tiles_eta_max

double _tiles_eta_max
private

◆ _tiles_eta_min

double _tiles_eta_min
private

◆ _tiles_ieta_max

int _tiles_ieta_max
private

◆ _tiles_ieta_min

int _tiles_ieta_min
private

◆ _writeout_combinations

bool _writeout_combinations
protected

◆ n_tile_neighbours

const int n_tile_neighbours = 9
staticprivate

The documentation for this class was generated from the following files:
genkt_algorithm
@ genkt_algorithm
Definition: fjcore.hh:1041
ClusterSequence::add_constituents
void add_constituents(const PseudoJet &jet, std::vector< PseudoJet > &subjet_vector) const
Definition: fjcore.cc:2120
PseudoJet::cluster_hist_index
int cluster_hist_index() const
Definition: fjcore.hh:704
NlnNCam2pi2R
@ NlnNCam2pi2R
Definition: fjcore.hh:1032
TiledJet
Definition: fjcore.cc:829
SharedPtr
Definition: fjcore.hh:294
TiledJet::phi
double phi
Definition: fjcore.cc:831
ClusterSequence::_tiles_eta_min
double _tiles_eta_min
Definition: fjcore.hh:1630
plugin_strategy
@ plugin_strategy
Definition: fjcore.hh:1035
JetDefinition::extra_param
double extra_param() const
Definition: fjcore.hh:1150
LimitedWarning::warn
void warn(const char *warning)
Definition: fjcore.hh:432
ClusterSequence::_tj_set_jetinfo
void _tj_set_jetinfo(TiledJet *const jet, const int _jets_index)
Definition: fjcore.cc:2819
ClusterSequence::contains
bool contains(const PseudoJet &object) const
Definition: fjcore.cc:2217
ClusterSequence::_set_structure_shared_ptr
void _set_structure_shared_ptr(PseudoJet &j)
Definition: fjcore.cc:2264
ClusterSequence::_decant_options_partial
void _decant_options_partial()
Definition: fjcore.cc:1587
Step::verbose
static bool verbose
Definition: Step.h:40
ClusterSequence::_bj_set_NN_crosscheck
void _bj_set_NN_crosscheck(J *const jeta, J *const head, const J *const tail) const
Definition: fjcore.hh:1749
ClusterSequence::_add_neighbours_to_tile_union
void _add_neighbours_to_tile_union(const int tile_index, std::vector< int > &tile_union, int &n_near_tiles) const
Definition: fjcore.cc:2842
ee_kt_algorithm
@ ee_kt_algorithm
Definition: fjcore.hh:1044
ClusterSequence::Invalid
@ Invalid
Definition: fjcore.hh:1490
ClusterSequence::InexistentParent
@ InexistentParent
Definition: fjcore.hh:1490
ClusterSequence::_initialise_tiles
void _initialise_tiles()
Definition: fjcore.cc:2761
ClusterSequence::_R2
double _R2
Definition: fjcore.hh:1547
ClusterSequence::_tiled_N2_cluster
void _tiled_N2_cluster()
Definition: fjcore.cc:2862
ClusterSequence::_tiles_eta_max
double _tiles_eta_max
Definition: fjcore.hh:1630
JetDefinition::recombiner
const Recombiner * recombiner() const
Definition: fjcore.hh:1157
ClusterSequence::_really_dumb_cluster
void _really_dumb_cluster()
Definition: fjcore.cc:2572
MinHeap
Definition: fjcore.cc:647
ClusterSequence::TiledJet::NN_dist
double NN_dist
Definition: fjcore.hh:1593
fastjet_version
FJCORE_BEGIN_NAMESPACE const char * fastjet_version
Definition: fjcore.cc:88
pi
FJCORE_BEGIN_NAMESPACE const double pi
Definition: fjcore.hh:191
Tile
Definition: fjcore.cc:840
NlnN4pi
@ NlnN4pi
Definition: fjcore.hh:1030
ClusterSequence::exclusive_jets_up_to
std::vector< PseudoJet > exclusive_jets_up_to(const int njets) const
Definition: fjcore.cc:1881
Ntupliser_cfg.p
p
Definition: Ntupliser_cfg.py:174
ClusterSequence::DijEntry
std::pair< double, TwoVertices > DijEntry
Definition: fjcore.hh:1578
N2Plain
@ N2Plain
Definition: fjcore.hh:1025
ClusterSequence::transfer_from_sequence
void transfer_from_sequence(const ClusterSequence &from_seq, const FunctionOfPseudoJet< PseudoJet > *action_on_jets=0)
Definition: fjcore.cc:1779
ClusterSequence::will_delete_self_when_unused
bool will_delete_self_when_unused() const
Definition: fjcore.hh:1439
ClusterSequence::_do_ij_recombination_step
void _do_ij_recombination_step(const int jet_i, const int jet_j, const double dij, int &newjet_k)
Definition: fjcore.cc:2243
ClusterSequence::_structure_shared_ptr
SharedPtr< PseudoJetStructureBase > _structure_shared_ptr
Definition: fjcore.hh:1551
ClusterSequence::_tile_size_eta
double _tile_size_eta
Definition: fjcore.hh:1631
TiledJet::label_minheap_update_done
void label_minheap_update_done()
Definition: fjcore.cc:836
kt_algorithm
@ kt_algorithm
Definition: fjcore.hh:1038
ClusterSequence::n_exclusive_jets_ycut
int n_exclusive_jets_ycut(double ycut) const
Definition: fjcore.hh:1403
ClusterSequence::_CP2DChan_limited_cluster
void _CP2DChan_limited_cluster(double D)
Definition: fjcore.cc:2300
DAS::ymin
static const double ymin
Definition: binnings.h:48
ClusterSequence::Q2
double Q2() const
Definition: fjcore.hh:1419
ClusterSequence::_bj_set_NN_nocross
void _bj_set_NN_nocross(J *const jeta, J *const head, const J *const tail) const
Definition: fjcore.hh:1724
ClusterSequence::_tiles
std::vector< Tile > _tiles
Definition: fjcore.hh:1629
Private::make_mirror
bool make_mirror(Coord2D &point, double Dlim)
Definition: fjcore.cc:2293
Tile::RH_tiles
TileFnPair * RH_tiles
Definition: fjcore.cc:846
ClusterSequence::_best_strategy
Strategy _best_strategy() const
Definition: fjcore.cc:1676
undefined_jet_algorithm
@ undefined_jet_algorithm
Definition: fjcore.hh:1047
ClusterSequenceStructure::set_associated_cs
virtual void set_associated_cs(const ClusterSequence *new_cs)
Definition: fjcore.hh:1347
TiledJet::NN_dist
double NN_dist
Definition: fjcore.cc:831
ClusterSequence::_decant_options
void _decant_options(const JetDefinition &jet_def, const bool &writeout_combinations)
Definition: fjcore.cc:1580
ClusterSequence::TiledJet::next
TiledJet * next
Definition: fjcore.hh:1594
ClusterSequence::TiledJet::previous
TiledJet * previous
Definition: fjcore.hh:1594
JetDefinition::Plugin::run_clustering
virtual void run_clustering(ClusterSequence &) const =0
ClusterSequence::exclusive_dmerge
double exclusive_dmerge(const int njets) const
Definition: fjcore.cc:1919
ClusterSequence::_history
std::vector< history_element > _history
Definition: fjcore.hh:1542
ClusterSequence::_first_time
static bool _first_time
Definition: fjcore.hh:1583
TiledJet::_jets_index
int _jets_index
Definition: fjcore.cc:833
N3Dumb
@ N3Dumb
Definition: fjcore.hh:1026
ClusterSequence::_CP2DChan_cluster_2pi2R
void _CP2DChan_cluster_2pi2R()
Definition: fjcore.cc:2369
ClusterSequence::_bj_set_jetinfo
void _bj_set_jetinfo(J *const jet, const int _jets_index) const
Definition: fjcore.hh:1698
antikt_algorithm
@ antikt_algorithm
Definition: fjcore.hh:1040
ClusterSequence::_jets
std::vector< PseudoJet > _jets
Definition: fjcore.hh:1541
TiledJet::next
TiledJet * next
Definition: fjcore.cc:832
Tile::tagged
bool tagged
Definition: fjcore.cc:849
ClusterSequence::_delaunay_cluster
void _delaunay_cluster()
Definition: fjcore.cc:2463
JetDefinition::Recombiner::preprocess
virtual void preprocess(PseudoJet &) const
Definition: fjcore.hh:1171
TiledJet::tile_index
int tile_index
Definition: fjcore.cc:833
NlnN3pi
@ NlnN3pi
Definition: fjcore.hh:1029
JetDefinition::Plugin::exclusive_sequence_meaningful
virtual bool exclusive_sequence_meaningful() const
Definition: fjcore.hh:1199
ClusterSequence::_jet_algorithm
JetAlgorithm _jet_algorithm
Definition: fjcore.hh:1550
Tile::surrounding_tiles
TileFnPair * surrounding_tiles
Definition: fjcore.cc:845
PseudoJet::perp2
double perp2() const
Definition: fjcore.hh:566
ClusterSequence::n_tile_neighbours
static const int n_tile_neighbours
Definition: fjcore.hh:1620
ClusterSequence::_initial_n
int _initial_n
Definition: fjcore.hh:1546
ClusterSequence::_add_step_to_history
void _add_step_to_history(const int parent1, const int parent2, const int jetp_index, const double dij)
Definition: fjcore.cc:2134
ClusterSequence::_changed_strategy_warning
static LimitedWarning _changed_strategy_warning
Definition: fjcore.hh:1585
ClusterSequence::has_child
bool has_child(const PseudoJet &jet, PseudoJet &child) const
Definition: fjcore.cc:2038
ClusterSequence::_plugin_activated
bool _plugin_activated
Definition: fjcore.hh:1555
ClusterSequence::_do_Cambridge_inclusive_jets
void _do_Cambridge_inclusive_jets()
Definition: fjcore.cc:2441
PseudoJet::kt2
double kt2() const
Definition: fjcore.hh:569
N2MHTLazy9
@ N2MHTLazy9
Definition: fjcore.hh:1019
ClusterSequence::_bj_dist
double _bj_dist(const J *const jeta, const J *const jetb) const
Definition: fjcore.hh:1707
ClusterSequence::TwoVertices
std::pair< int, int > TwoVertices
Definition: fjcore.hh:1577
Tile::head
TiledJet * head
Definition: fjcore.cc:848
ClusterSequence::_add_ktdistance_to_map
void _add_ktdistance_to_map(const int ii, DistMap &DijMap, const DynamicNearestNeighbours *DNN)
Definition: fjcore.cc:2544
NlnN
@ NlnN
Definition: fjcore.hh:1028
N2MHTLazy9AntiKtSeparateGhosts
@ N2MHTLazy9AntiKtSeparateGhosts
Definition: fjcore.hh:1018
ClusterSequence::plugin_record_ij_recombination
void plugin_record_ij_recombination(int jet_i, int jet_j, double dij, int &newjet_k)
Definition: fjcore.hh:1442
JetDefinition::jet_algorithm
JetAlgorithm jet_algorithm() const
Definition: fjcore.hh:1147
SharedPtr::get
T * get() const
Definition: fjcore.hh:342
Tile::end_tiles
TileFnPair * end_tiles
Definition: fjcore.cc:847
TiledJet::previous
TiledJet * previous
Definition: fjcore.cc:832
Coord2D
Definition: fjcore.cc:675
ClusterSequence::plugin_activated
bool plugin_activated() const
Definition: fjcore.hh:1470
ClusterSequence::_n_tiles_phi
int _n_tiles_phi
Definition: fjcore.hh:1632
ClusterSequenceStructure
Definition: fjcore.hh:1333
ClusterSequence::_transfer_input_jets
void _transfer_input_jets(const std::vector< L > &pseudojets)
Definition: fjcore.hh:1656
ClusterSequence::_initialise_and_run_no_decant
void _initialise_and_run_no_decant()
Definition: fjcore.cc:1433
SharedPtr::set_count
void set_count(const long &count)
Definition: fjcore.hh:364
ClusterSequence::_update_structure_use_count
void _update_structure_use_count()
Definition: fjcore.cc:2268
Private::MirrorInfo
Definition: fjcore.cc:2287
ClusterSequence::_jet_def
JetDefinition _jet_def
Definition: fjcore.hh:1511
ClusterSequence::_tiles_ieta_min
int _tiles_ieta_min
Definition: fjcore.hh:1632
ClusterSequence::_invR2
double _invR2
Definition: fjcore.hh:1547
ClusterSequence::_faster_tiled_N2_cluster
void _faster_tiled_N2_cluster()
Definition: fjcore.cc:3016
ClusterSequence::strategy_string
std::string strategy_string() const
Definition: fjcore.hh:1435
ClusterSequence::_tile_size_phi
double _tile_size_phi
Definition: fjcore.hh:1631
swap
void swap(SharedPtr< T > &a, SharedPtr< T > &b)
Definition: fjcore.hh:412
plugin_algorithm
@ plugin_algorithm
Definition: fjcore.hh:1046
DAS::ptmin
static const double ptmin
Definition: binnings.h:46
DynamicNearestNeighbours::RemovePoint
void RemovePoint(const int index, std::vector< int > &indices_of_updated_neighbours)
Definition: fjcore.cc:195
DynamicNearestNeighbours::Valid
virtual bool Valid(const int index) const =0
PseudoJet
Definition: fjcore.hh:535
ClusterSequence::_add_untagged_neighbours_to_tile_union
void _add_untagged_neighbours_to_tile_union(const int tile_index, std::vector< int > &tile_union, int &n_near_tiles)
Definition: fjcore.cc:2850
NlnNCam4pi
@ NlnNCam4pi
Definition: fjcore.hh:1031
ClusterSequence::_tile_index
int _tile_index(int ieta, int iphi) const
Definition: fjcore.hh:1633
LazyTiling9Alt
Definition: fjcore.cc:891
ClusterSequence::exclusive_jets
std::vector< PseudoJet > exclusive_jets(const double dcut) const
Definition: fjcore.cc:1868
ClusterSequence::_exclusive_warnings
static LimitedWarning _exclusive_warnings
Definition: fjcore.hh:1584
ClusterSequence::exclusive_dmerge_max
double exclusive_dmerge_max(const int njets) const
Definition: fjcore.cc:1924
ClusterSequence::exclusive_subjets_up_to
std::vector< PseudoJet > exclusive_subjets_up_to(const PseudoJet &jet, int nsub) const
Definition: fjcore.cc:1959
ClusterSequence::n_exclusive_jets
int n_exclusive_jets(const double dcut) const
Definition: fjcore.cc:1858
ClusterSequence::_structure_use_count_after_construction
int _structure_use_count_after_construction
Definition: fjcore.hh:1552
JetAlgorithm
JetAlgorithm
Definition: fjcore.hh:1037
N2MHTLazy25
@ N2MHTLazy25
Definition: fjcore.hh:1020
PseudoJet::set_structure_shared_ptr
void set_structure_shared_ptr(const SharedPtr< PseudoJetStructureBase > &structure)
Definition: fjcore.cc:3981
JetDefinition::R
double R() const
Definition: fjcore.hh:1149
DynamicNearestNeighbours::NearestNeighbourIndex
virtual int NearestNeighbourIndex(const int ii) const =0
ClusterSequence::_do_iB_recombination_step
void _do_iB_recombination_step(const int jet_i, const double diB)
Definition: fjcore.cc:2258
ClusterSequence::jet_scale_for_algorithm
double jet_scale_for_algorithm(const PseudoJet &jet) const
Definition: fjcore.cc:1656
Error
Definition: fjcore.hh:462
ClusterSequence::BeamJet
@ BeamJet
Definition: fjcore.hh:1490
ClusterSequence::DistMap
std::multimap< double, TwoVertices > DistMap
Definition: fjcore.hh:1579
ClusterSequence::_simple_N2_cluster_EEBriefJet
void _simple_N2_cluster_EEBriefJet()
Definition: fjcore.cc:2662
SharedPtr::reset
void reset()
Definition: fjcore.hh:308
cambridge_algorithm
@ cambridge_algorithm
Definition: fjcore.hh:1039
ee_genkt_algorithm
@ ee_genkt_algorithm
Definition: fjcore.hh:1045
ClusterSequence::print_banner
static void print_banner()
Definition: fjcore.cc:1555
ClusterSequence::constituents
std::vector< PseudoJet > constituents(const PseudoJet &jet) const
Definition: fjcore.cc:2075
DynamicNearestNeighbours::NearestNeighbourDistance
virtual double NearestNeighbourDistance(const int ii) const =0
DynamicNearestNeighbours::RemoveCombinedAddCombination
void RemoveCombinedAddCombination(const int index1, const int index2, const EtaPhi &newpoint, int &index3, std::vector< int > &indices_of_updated_neighbours)
Definition: fjcore.cc:204
ClusterSequence::print_jets_for_root
void print_jets_for_root(const std::vector< PseudoJet > &jets, std::ostream &ostr=std::cout) const
Definition: fjcore.cc:2080
ClusterSequence::_bj_diJ
double _bj_diJ(const J *const jeta) const
Definition: fjcore.hh:1719
ClusterSequence::_bj_remove_from_tiles
void _bj_remove_from_tiles(TiledJet *const jet) const
NlnNCam
@ NlnNCam
Definition: fjcore.hh:1033
ClusterSequence::history
const std::vector< history_element > & history() const
Definition: fjcore.hh:1676
TiledJet::NN
TiledJet * NN
Definition: fjcore.cc:832
twopi
const double twopi
Definition: fjcore.hh:192
ClusterSequence::_CP2DChan_cluster_2piMultD
void _CP2DChan_cluster_2piMultD()
Definition: fjcore.cc:2374
N2Tiled
@ N2Tiled
Definition: fjcore.hh:1023
N2MHTLazy9Alt
@ N2MHTLazy9Alt
Definition: fjcore.hh:1021
ClusterSequence::n_particles
unsigned int n_particles() const
Definition: fjcore.hh:1679
N2MinHeapTiled
@ N2MinHeapTiled
Definition: fjcore.hh:1022
ClusterSequence::_tiles_ieta_max
int _tiles_ieta_max
Definition: fjcore.hh:1632
LazyTiling9
Definition: fjcore.cc:978
TiledJet::eta
double eta
Definition: fjcore.cc:831
ClusterSequence::_Rparam
double _Rparam
Definition: fjcore.hh:1547
JetDefinition::Recombiner::recombine
virtual void recombine(const PseudoJet &pa, const PseudoJet &pb, PseudoJet &pab) const =0
ClusterSequence::jet_def
const JetDefinition & jet_def() const
Definition: fjcore.hh:1437
ClusterSequence::_simple_N2_cluster_BriefJet
void _simple_N2_cluster_BriefJet()
Definition: fjcore.cc:2659
Tile::begin_tiles
TileFnPair begin_tiles[n_tile_neighbours]
Definition: fjcore.cc:844
ClusterSequence::get_subhist_set
void get_subhist_set(std::set< const history_element * > &subhist, const PseudoJet &jet, double dcut, int maxjet) const
Definition: fjcore.cc:1986
JetDefinition::strategy
Strategy strategy() const
Definition: fjcore.hh:1151
TilingExtent
Definition: fjcore.cc:1151
ClusterSequence::_fastjet_banner_ostr
static std::ostream * _fastjet_banner_ostr
Definition: fjcore.hh:1509
N2PoorTiled
@ N2PoorTiled
Definition: fjcore.hh:1024
InternalError
Definition: fjcore.hh:483
ClusterSequence::_writeout_combinations
bool _writeout_combinations
Definition: fjcore.hh:1545
ClusterSequence::_minheap_faster_tiled_N2_cluster
void _minheap_faster_tiled_N2_cluster()
Definition: fjcore.cc:3149
ClusterSequence::_Qtot
double _Qtot
Definition: fjcore.hh:1548
JetDefinition::plugin
const Plugin * plugin() const
Definition: fjcore.hh:1145
ClusterSequence::_extract_tree_children
void _extract_tree_children(int pos, std::valarray< bool > &, const std::valarray< int > &, std::vector< int > &) const
Definition: fjcore.cc:2190
ClusterSequence::_extras
SharedPtr< Extras > _extras
Definition: fjcore.hh:1556
jmarExample.eta
eta
DeepAK8/ParticleNet tagging.
Definition: jmarExample.py:19
ClusterSequence::_strategy
Strategy _strategy
Definition: fjcore.hh:1549
SharedPtr::use_count
long use_count() const
Definition: fjcore.hh:349
LazyTiling25
Definition: fjcore.cc:1065
ClusterSequence::_CP2DChan_cluster
void _CP2DChan_cluster()
Definition: fjcore.cc:2380
cambridge_for_passive_algorithm
@ cambridge_for_passive_algorithm
Definition: fjcore.hh:1042
EtaPhi
Definition: fjcore.cc:172
ClosestPair2D
Definition: fjcore.cc:732
ClusterSequence::_deletes_self_when_unused
bool _deletes_self_when_unused
Definition: fjcore.hh:1553
ClusterSequence::_extract_tree_parents
void _extract_tree_parents(int pos, std::valarray< bool > &, const std::valarray< int > &, std::vector< int > &) const
Definition: fjcore.cc:2223
Best
@ Best
Definition: fjcore.hh:1027
BestFJ30
@ BestFJ30
Definition: fjcore.hh:1034
ClusterSequence::_fill_initial_history
void _fill_initial_history()
Definition: fjcore.cc:1595