siscone is hosted by Hepforge, IPPP Durham

The SISCone Jet Algorithm

Version 3.0.6



SISCone 3.0.6
protocones.h
1// -*- C++ -*-
3// File: protocones.h //
4// Description: header file for stable cones determination (Cstable_cones) //
5// This file is part of the SISCone project. //
6// WARNING: this is not the main SISCone trunk but //
7// an adaptation to spherical coordinates //
8// For more details, see http://projects.hepforge.org/siscone //
9// //
10// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez //
11// //
12// This program is free software; you can redistribute it and/or modify //
13// it under the terms of the GNU General Public License as published by //
14// the Free Software Foundation; either version 2 of the License, or //
15// (at your option) any later version. //
16// //
17// This program is distributed in the hope that it will be useful, //
18// but WITHOUT ANY WARRANTY; without even the implied warranty of //
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
20// GNU General Public License for more details. //
21// //
22// You should have received a copy of the GNU General Public License //
23// along with this program; if not, write to the Free Software //
24// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
25// //
26// $Revision:: $//
27// $Date:: $//
29
30#ifndef __SPH_PROTOCONES_H__
31#define __SPH_PROTOCONES_H__
32
33#include "momentum.h"
34#include "vicinity.h"
35#include <stdio.h>
36#include <vector>
37#include <list>
38#include "hash.h"
39
40#include <siscone/defines.h>
41
42namespace siscone_spherical{
43
56public:
58 CSphborder_store(CSphmomentum * momentum, CSph3vector &centre, CSph3vector &angl_dir1, CSph3vector &angl_dir2) :
59 mom(momentum), is_in(false) {
60 CSph3vector diff = (*momentum) - centre;
61 angle = atan2(dot_product3(diff, angl_dir2), dot_product3(diff, angl_dir1));
62#ifdef DEBUG_STABLE_CONES
63 std::cout << " adding point " << momentum->_theta << ", " << momentum->_phi
64 << " at an angle of " << angle << std::endl;
65#endif
66 }
67
69 double angle;
70 bool is_in;
71};
72
73
76inline bool operator<(const CSphborder_store & a, const CSphborder_store & b) {
77 return a.angle < b.angle;
78}
79
80
90 public:
93
95 CSphstable_cones(std::vector<CSphmomentum> &_particle_list);
96
99
104 void init(std::vector<CSphmomentum> &_particle_list);
105
113 int get_stable_cones(double _radius);
114
116 std::vector<CSphmomentum> protocones;
117
120
123#ifdef DEBUG_STABLE_CONES
124 int nb_hash_cones, nb_hash_occupied;
125#endif
126
127 protected:
129 double R;
130
132 double R2;
133
135 double tan2R;
136
137 private:
140 CSphmomentum cone;
141
143 CSphmomentum *child;
144
146 CSphvicinity_elm *centre;
147
149 unsigned int centre_idx;
150
152 unsigned int first_cone;
153
159 int init_cone();
160
167 int test_cone();
168
174 int update_cone();
175
176 /*
177 * run through the vicinity of the current parent and for each child
178 * indicate which members are cocircular...
179 */
180 void prepare_cocircular_lists();
181
189 bool cocircular_check();
190
195 void test_cone_cocircular(CSphmomentum & borderless_cone,
196 std::list<CSphmomentum *> & border_list);
197
204 void test_stability(CSphmomentum & candidate,
205 const std::vector<CSphborder_store> & border_vect);
206
213 void compute_cone_contents();
214
220 void recompute_cone_contents();
221
222 /*
223 * if we have gone beyond the acceptable threshold of change, compute
224 * the cone momentum from particle list. in this version, we use the
225 * 'pincluded' information from the CSphvicinity class, but we don't
226 * change the member cone, only the locally supplied one
227 */
228 void recompute_cone_contents_if_needed(CSphmomentum & this_cone, double & this_dpt);
229
235 int proceed_with_stability();
236
237 /*
238 * circle intersection.
239 * computes the intersection with a circle of given centre and radius.
240 * The output takes the form of a checkxor of the intersection's particles
241 * - cx circle centre x coordinate
242 * - cy circle centre y coordinate
243 * return the checkxor for the intersection
244 ******************************************************************/
245 siscone::Creference circle_intersect(CSph3vector &cone_centre);
246
248 CSphmomentum cone_candidate;
249
251 std::vector<CSphmomentum*> child_list;
252
255 std::vector< std::pair<siscone::Creference,siscone::Creference> > multiple_centre_done;
256
257 // information for updating cone contents to avoid rounding errors
258 double dpt;
259};
260
261}
262#endif
references used for checksums.
Definition: reference.h:43
base class for managing the spatial part of Cmomentum (defined after)
Definition: momentum.h:54
double _theta
particle theta angle (available ONLY after a call to build_thetaphi)
Definition: momentum.h:136
double _phi
particle phi angle (available ONLY after a call to build_thetaphi)
Definition: momentum.h:137
class for storing a border momentum (in context of co-circularity checks).
Definition: protocones.h:55
bool is_in
inclusion status of the particle
Definition: protocones.h:70
CSphborder_store(CSphmomentum *momentum, CSph3vector &centre, CSph3vector &angl_dir1, CSph3vector &angl_dir2)
default ctor
Definition: protocones.h:58
CSphmomentum * mom
particle momentum
Definition: protocones.h:68
double angle
angle w.r.t. circle centre
Definition: protocones.h:69
base class for dynamic coordinates management
Definition: momentum.h:158
Computes the list of stable comes from a particle list.
Definition: protocones.h:89
void init(std::vector< CSphmomentum > &_particle_list)
initialisation
Definition: protocones.cpp:116
int get_stable_cones(double _radius)
compute stable cones.
Definition: protocones.cpp:143
double tan2R
squared tangent of the cone radius
Definition: protocones.h:135
sph_hash_cones * hc
list of candidates
Definition: protocones.h:119
CSphstable_cones(std::vector< CSphmomentum > &_particle_list)
ctor with initialisation (sse init for details)
double R2
cone radius SQUARED
Definition: protocones.h:132
int nb_tot
total number of tested cones
Definition: protocones.h:122
std::vector< CSphmomentum > protocones
list of stable cones
Definition: protocones.h:116
element in the vicinity of a parent.
Definition: vicinity.h:52
list of element in the vicinity of a parent.
Definition: vicinity.h:83
list of cones candidates.
Definition: hash.h:61

The SISCone project has been developed by Gavin Salam and Gregory Soyez
Documentation generated on Tue Jun 20 2023 18:08:37 for SISCone by  Doxygen 1.9.4