SISCone  2.0.6
vicinity.h
1 // -*- C++ -*-
3 // File: vicinity.h //
4 // Description: header file for particle vicinity (Cvicinity class) //
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:: 123 $//
25 // $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007) $//
27 
28 #ifndef __VICINITY_H__
29 #define __VICINITY_H__
30 
31 #include <vector>
32 #include <list>
33 #include "momentum.h"
34 #include "defines.h"
35 #include "quadtree.h"
36 
37 namespace siscone{
38 
39 
40 
47 public:
49  Cvicinity_inclusion() : cone(false), cocirc(false) {}
50 
51  bool cone;
52  bool cocirc;
53 };
54 
55 
64  public:
67 
70 
71  // centre variables
72  double eta;
73  double phi;
74  double angle;
75  bool side;
77 
81  std::list<Cvicinity_elm * > cocircular;
82 };
83 
85 bool ve_less(Cvicinity_elm *ve1, Cvicinity_elm *ve2);
86 
87 
95 class Cvicinity{
96  public:
98  Cvicinity();
99 
101  Cvicinity(std::vector<Cmomentum> &_particle_list);
102 
104  ~Cvicinity();
105 
110  void set_particle_list(std::vector<Cmomentum> &_particle_list);
111 
117  void build(Cmomentum *_parent, double _VR);
118 
119  // cone kinematical information
121  double VR;
122  double VR2;
123  double R;
124  double R2;
127 
128  // particle list information
129  int n_part;
130  std::vector<Cmomentum> plist;
131  std::vector<Cvicinity_inclusion> pincluded;
133 #ifdef USE_QUADTREE_FOR_STABILITY_TEST
134  Cquadtree *quadtree;
135 #endif
136 
137  // vicinity information
138  std::vector<Cvicinity_elm*> vicinity;
139  unsigned int vicinity_size;
140 
141  protected:
147  void append_to_vicinity(Cmomentum *v);
148 
149  // internal variables
150  double pcx;
151  double pcy;
152 };
153 
154 }
155 
156 #endif
siscone::Cvicinity::build
void build(Cmomentum *_parent, double _VR)
build the vicinity list from the list of points.
Definition: vicinity.cpp:175
siscone::Cvicinity::set_particle_list
void set_particle_list(std::vector< Cmomentum > &_particle_list)
set the particle_list
Definition: vicinity.cpp:102
siscone::Cvicinity_elm::phi
double phi
phi coordinate of the center
Definition: vicinity.h:73
siscone::Cvicinity_elm::cocircular_range
double cocircular_range
amount by which the angle can be varied while maintaining this point within co-circularity margin
Definition: vicinity.h:76
siscone::Cmomentum
base class for dynamic coordinates management
Definition: momentum.h:49
siscone::Cvicinity::ve_list
Cvicinity_elm * ve_list
list of vicinity elements built from particle list (size=2*n)
Definition: vicinity.h:132
siscone::Cvicinity::pcy
double pcy
parent centre (phi)
Definition: vicinity.h:151
siscone::Cvicinity::parent
Cmomentum * parent
parent vector
Definition: vicinity.h:120
siscone::Cvicinity_inclusion::Cvicinity_inclusion
Cvicinity_inclusion()
default ctor
Definition: vicinity.h:49
siscone::Cvicinity_elm::angle
double angle
angle with parent
Definition: vicinity.h:74
siscone::Cvicinity_inclusion::cocirc
bool cocirc
flag for particle inclusion in the border
Definition: vicinity.h:52
siscone::Cquadtree
Implementation of a 2D quadtree.
Definition: quadtree.h:43
defines.h
siscone::Cvicinity_elm::v
Cmomentum * v
pointer to the second borderline particle
Definition: vicinity.h:66
siscone::Cvicinity::plist
std::vector< Cmomentum > plist
the list of particles
Definition: vicinity.h:130
siscone::Cvicinity_elm
element in the vicinity of a parent.
Definition: vicinity.h:63
siscone::Cvicinity::pcx
double pcx
parent centre (eta)
Definition: vicinity.h:150
siscone::Cvicinity::pincluded
std::vector< Cvicinity_inclusion > pincluded
the inclusion state of particles
Definition: vicinity.h:131
siscone::Cvicinity_inclusion
a class to keep track of inclusion status in cone and in cocircular region while using minimal resour...
Definition: vicinity.h:46
siscone::Cvicinity::R2
double R2
squared normal radius
Definition: vicinity.h:124
siscone::Cvicinity::vicinity
std::vector< Cvicinity_elm * > vicinity
list of points in parent's vicinity
Definition: vicinity.h:138
siscone::Cvicinity::vicinity_size
unsigned int vicinity_size
number of elements in vicinity
Definition: vicinity.h:139
siscone::Cvicinity_elm::side
bool side
true if angle on the positive side, false otherwise
Definition: vicinity.h:75
siscone::Cvicinity::inv_R_2EPS_COCIRC
double inv_R_2EPS_COCIRC
R / (2*EPSILON_COCIRCULAR)
Definition: vicinity.h:126
siscone::Cvicinity::VR2
double VR2
squared radius of the vicinity
Definition: vicinity.h:122
siscone::Cvicinity::append_to_vicinity
void append_to_vicinity(Cmomentum *v)
append a particle to the 'vicinity' list after having tested it and computed the angular-ordering qua...
Definition: vicinity.cpp:219
siscone::Cvicinity
list of element in the vicinity of a parent.
Definition: vicinity.h:95
siscone::Cvicinity_elm::eta
double eta
eta coordinate of the center
Definition: vicinity.h:72
siscone::Cvicinity::inv_R_EPS_COCIRC
double inv_R_EPS_COCIRC
R / EPSILON_COCIRCULAR.
Definition: vicinity.h:125
siscone::Cvicinity_inclusion::cone
bool cone
flag for particle inclusion in the cone
Definition: vicinity.h:51
siscone::Cvicinity::R
double R
normal radius
Definition: vicinity.h:123
siscone::Cvicinity::~Cvicinity
~Cvicinity()
default destructor
Definition: vicinity.cpp:87
siscone::Cvicinity_elm::cocircular
std::list< Cvicinity_elm * > cocircular
list of elements co-circular with this one NB: empty list uses less mem than vector
Definition: vicinity.h:81
siscone::Cvicinity::VR
double VR
radius of the vicinity
Definition: vicinity.h:121
siscone::Cvicinity_elm::is_inside
Cvicinity_inclusion * is_inside
variable to tell if the particle is inside or outside the cone
Definition: vicinity.h:69
siscone::Cvicinity::Cvicinity
Cvicinity()
default constructor
Definition: vicinity.cpp:60
siscone::Cvicinity::n_part
int n_part
number of particles
Definition: vicinity.h:129
The SISCone project has been developed by Gavin Salam and Gregory Soyez
Documentation generated for SISCone by  Doxygen 1.8.17