1 #ifndef __FASTJET_LAZYTILING25_HH__
2 #define __FASTJET_LAZYTILING25_HH__
37 #include "fastjet/internal/MinHeap.hh"
38 #include "fastjet/ClusterSequence.hh"
39 #include "fastjet/internal/LazyTiling9Alt.hh"
40 #include "fastjet/internal/LazyTiling9.hh"
44 FASTJET_BEGIN_NAMESPACE
46 typedef Tile2Base<25> Tile25;
77 LazyTiling25(ClusterSequence & cs);
82 ClusterSequence & _cs;
83 const std::vector<PseudoJet> & _jets;
84 std::vector<Tile25> _tiles;
91 double _Rparam, _R2, _invR2;
92 double _tiles_eta_min, _tiles_eta_max;
93 double _tile_size_eta, _tile_size_phi;
94 double _tile_half_size_eta, _tile_half_size_phi;
95 int _n_tiles_phi,_tiles_ieta_min,_tiles_ieta_max;
97 std::vector<TiledJet *> _jets_for_minheap;
101 void _initialise_tiles();
105 inline int _tile_index (
int ieta,
int iphi)
const {
108 return (ieta-_tiles_ieta_min)*_n_tiles_phi
109 + (iphi+_n_tiles_phi) % _n_tiles_phi;
112 void _bj_remove_from_tiles(TiledJet *
const jet);
115 int _tile_index(
const double eta,
const double phi)
const;
118 void _tj_set_jetinfo(TiledJet *
const jet,
const int _jets_index);
120 void _print_tiles(TiledJet * briefjets )
const;
121 void _add_neighbours_to_tile_union(
const int tile_index,
122 std::vector<int> & tile_union,
int & n_near_tiles)
const;
123 void _add_untagged_neighbours_to_tile_union(
const int tile_index,
124 std::vector<int> & tile_union,
int & n_near_tiles);
125 void _add_untagged_neighbours_to_tile_union_using_max_info(
const TiledJet *
const jet,
126 std::vector<int> & tile_union,
int & n_near_tiles);
127 double _distance_to_tile(
const TiledJet * bj,
const Tile25 *)
133 void _update_jetX_jetI_NN(TiledJet * jetX, TiledJet * jetI, std::vector<TiledJet *> & jets_for_minheap);
135 void _set_NN(TiledJet * jetI, std::vector<TiledJet *> & jets_for_minheap);
139 template <
class J>
double _bj_diJ(
const J *
const jet)
const {
140 double kt2 = jet->kt2;
141 if (jet->NN != NULL) {
if (jet->NN->kt2 < kt2) {kt2 = jet->NN->kt2;}}
142 return jet->NN_dist * kt2;
147 template <
class J>
inline void _bj_set_jetinfo(
148 J *
const jetA,
const int _jets_index)
const {
149 jetA->eta = _jets[_jets_index].rap();
150 jetA->phi = _jets[_jets_index].phi_02pi();
151 jetA->kt2 = _cs.jet_scale_for_algorithm(_jets[_jets_index]);
152 jetA->_jets_index = _jets_index;
160 template <
class J>
inline double _bj_dist(
161 const J *
const jetA,
const J *
const jetB)
168 double dphi = std::abs(jetA->phi - jetB->phi);
169 double deta = (jetA->eta - jetB->eta);
170 if (dphi > pi) {dphi = twopi - dphi;}
171 return dphi*dphi + deta*deta;
176 template <
class J>
inline double _bj_dist_not_periodic(
177 const J *
const jetA,
const J *
const jetB)
185 double dphi = jetA->phi - jetB->phi;
186 double deta = (jetA->eta - jetB->eta);
187 return dphi*dphi + deta*deta;
193 FASTJET_END_NAMESPACE
195 #endif // __FASTJET_LAZYTILING25_HH__