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// For more details, see http://projects.hepforge.org/siscone //
7// //
8// Copyright (c) 2006 Gavin Salam and Gregory Soyez //
9// //
10// This program is free software; you can redistribute it and/or modify //
11// it under the terms of the GNU General Public License as published by //
12// the Free Software Foundation; either version 2 of the License, or //
13// (at your option) any later version. //
14// //
15// This program is distributed in the hope that it will be useful, //
16// but WITHOUT ANY WARRANTY; without even the implied warranty of //
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
18// GNU General Public License for more details. //
19// //
20// You should have received a copy of the GNU General Public License //
21// along with this program; if not, write to the Free Software //
22// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
23// //
24// $Revision:: $//
25// $Date:: $//
27
28#ifndef __PROTOCONES_H__
29#define __PROTOCONES_H__
30
31#include "momentum.h"
32#include "vicinity.h"
33#include <stdio.h>
34#include <vector>
35#include <list>
36#include "hash.h"
37
38#include "defines.h"
39
40namespace siscone{
41
54public:
56 Cborder_store(Cmomentum * momentum, double centre_eta, double centre_phi) :
57 mom(momentum), is_in(false) {
58 angle = atan2(mom->phi - centre_phi, mom->eta - centre_eta);
59 }
60
62 double angle;
63 bool is_in;
64};
65
66
69inline bool operator<(const Cborder_store & a, const Cborder_store & b) {
70 return a.angle < b.angle;
71}
72
73
82class Cstable_cones : public Cvicinity{
83 public:
86
88 Cstable_cones(std::vector<Cmomentum> &_particle_list);
89
92
97 void init(std::vector<Cmomentum> &_particle_list);
98
106 int get_stable_cones(double _radius);
107
109 std::vector<Cmomentum> protocones;
110
113
116#ifdef DEBUG_STABLE_CONES
117 int nb_hash_cones, nb_hash_occupied;
118#endif
119
120 protected:
122 double R;
123
125 double R2;
126
127 private:
130 Cmomentum cone;
131
133 Cmomentum *child;
134
136 Cvicinity_elm *centre;
137
139 unsigned int centre_idx;
140
142 unsigned int first_cone;
143
149 int init_cone();
150
157 int test_cone();
158
164 int update_cone();
165
166 /*
167 * run through the vicinity of the current parent and for each child
168 * indicate which members are cocircular...
169 */
170 void prepare_cocircular_lists();
171
179 bool cocircular_check();
180
185 void test_cone_cocircular(Cmomentum & borderless_cone,
186 std::list<Cmomentum *> & border_list);
187
194 void test_stability(Cmomentum & candidate,
195 const std::vector<Cborder_store> & border_vect);
196
203 void compute_cone_contents();
204
210 void recompute_cone_contents();
211
212 /*
213 * if we have gone beyond the acceptable threshold of change, compute
214 * the cone momentum from particle list. in this version, we use the
215 * 'pincluded' information from the Cvicinity class, but we don't
216 * change the member cone, only the locally supplied one
217 */
218 void recompute_cone_contents_if_needed(Cmomentum & this_cone, double & this_dpt);
219
225 int proceed_with_stability();
226
227 /*
228 * circle intersection.
229 * computes the intersection with a circle of given centre and radius.
230 * The output takes the form of a checkxor of the intersection's particles
231 * - cx circle centre x coordinate
232 * - cy circle centre y coordinate
233 * return the checkxor for the intersection
234 ******************************************************************/
235 Creference circle_intersect(double cx, double cy);
236
238 Cmomentum cone_candidate;
239
241 std::vector<Cmomentum*> child_list;
242
245 std::vector< std::pair<Creference,Creference> > multiple_centre_done;
246
247 // information for updating cone contents to avoid rounding errors
248 double dpt;
249
258 inline bool is_inside(Cmomentum *centre, Cmomentum *v);
259};
260
261/*
262 * compute the absolute value of the difference between 2 angles.
263 * We take care of the 2pi periodicity
264 * \param angle1 first angle
265 * \param angle2 second angle
266 * \return the absolute value of the difference between the angles
267 *****************************************************************/
268inline double abs_dangle(double &angle1, double &angle2);
269
270}
271#endif
class for storing a border momentum (in context of co-circularity checks).
Definition: protocones.h:53
Cborder_store(Cmomentum *momentum, double centre_eta, double centre_phi)
default ctor
Definition: protocones.h:56
double angle
angle w.r.t. circle centre
Definition: protocones.h:62
bool is_in
inclusion status of the particle
Definition: protocones.h:63
Cmomentum * mom
particle momentum
Definition: protocones.h:61
base class for dynamic coordinates management
Definition: momentum.h:49
double eta
particle pseudo-rapidity
Definition: momentum.h:114
double phi
particle azimuthal angle
Definition: momentum.h:115
references used for checksums.
Definition: reference.h:43
Computes the list of stable comes from a particle list.
Definition: protocones.h:82
void init(std::vector< Cmomentum > &_particle_list)
initialisation
Definition: protocones.cpp:114
int nb_tot
total number of tested cones
Definition: protocones.h:115
Cstable_cones()
default ctor
Definition: protocones.cpp:89
std::vector< Cmomentum > protocones
list of stable cones
Definition: protocones.h:109
double R2
cone radius SQUARED
Definition: protocones.h:125
double R
cone radius
Definition: protocones.h:122
int get_stable_cones(double _radius)
compute stable cones.
Definition: protocones.cpp:141
hash_cones * hc
list of candidates
Definition: protocones.h:112
~Cstable_cones()
default dtor
Definition: protocones.cpp:105
Cstable_cones(std::vector< Cmomentum > &_particle_list)
ctor with initialisation (sse init for details)
element in the vicinity of a parent.
Definition: vicinity.h:63
list of element in the vicinity of a parent.
Definition: vicinity.h:95
list of cones candidates.
Definition: hash.h:62

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