CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VoronoiAlgorithm.h
Go to the documentation of this file.
1 #ifndef __VoronoiAlgorithm_h__
2 #define __VoronoiAlgorithm_h__
3 
4 #include <cmath>
5 
6 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
7 #include <CGAL/Delaunay_triangulation_2.h>
8 #include <CGAL/Voronoi_diagram_2.h>
9 #include <CGAL/Delaunay_triangulation_adaptation_traits_2.h>
10 #include <CGAL/Delaunay_triangulation_adaptation_policies_2.h>
11 #include <CGAL/Polygon_2.h>
12 
13 #include <boost/multi_array.hpp>
14 
18 
20 private:
21  //
22  typedef CGAL::Delaunay_triangulation_2<
23  CGAL::Exact_predicates_inexact_constructions_kernel>
26  class particle_t {
27  public:
30  double area;
33  std::set<std::vector<particle_t>::iterator> incident;
35  unsigned int i, double a = NAN,
36  double ps = NAN)
40  incident(std::set<std::vector<particle_t>::
41  iterator>())
42  {
43  }
44  inline operator point_2d_t(void) const
45  {
46  return point_2d_t(momentum.Eta(), momentum.Phi());
47  }
48  };
49  typedef std::vector<particle_t> event_t;
50  // Remaining CGAL classes
51  typedef CGAL::Voronoi_diagram_2<
53  CGAL::Delaunay_triangulation_adaptation_traits_2<
55  CGAL::
56  Delaunay_triangulation_caching_degeneracy_removal_policy_2<
58  typedef CGAL::Polygon_2<
59  CGAL::Exact_predicates_inexact_constructions_kernel>
61 public:
62  static const size_t nreduced_particle_flow_id = 3;
63  static const size_t nfourier = 5;
64 protected:
65  std::vector<double> _edge_pseudorapidity;
66  std::vector<double> _cms_hcal_edge_pseudorapidity;
67  std::vector<double> _cms_ecal_edge_pseudorapidity;
69  std::pair<double, double> _equalization_threshold;
74  boost::multi_array<double, 4> *_perp_fourier;
75  std::vector<double> _feature;
76  std::vector<bool> _active;
77  std::vector<std::pair<size_t, size_t> > _recombine;
78  std::vector<std::vector<size_t> > _recombine_index;
79  std::vector<std::vector<size_t> > _recombine_unsigned;
80  std::vector<double> _recombine_tie;
81  size_t _ncost;
82  std::vector<size_t> _nblock_subtract;
84  void *_lp_problem;
85  // calibrations
86  const UECalibration *ue;
87 private:
88  void initialize_geometry(void);
89  void allocate(void);
90  void deallocate(void);
91  void event_fourier(void);
92  void feature_extract(void);
93  void voronoi_area_incident(void);
94  void subtract_momentum(void);
95  void recombine_link(void);
96  void lp_populate(void *lp_problem);
97  void equalize(void);
98  void remove_nonpositive(void);
99  void subtract_if_necessary(void);
100 public:
102  const UECalibration *ue,
103  const double dr_max,
104  const std::pair<double, double> equalization_threshold =
105  std::pair<double, double>(5.0, 35.0),
106  const bool remove_nonpositive = true);
107  ~VoronoiAlgorithm(void);
117  void push_back_particle(
118  const double perp, const double pseudorapidity,
119  const double azimuth,
120  const unsigned int reduced_particle_flow_id);
124  void clear(void);
130  std::vector<double> subtracted_equalized_perp(void);
131  std::vector<double> subtracted_unequalized_perp(void);
138  std::vector<double> particle_area(void);
147  std::vector<std::set<size_t> > particle_incident(void);
148  std::vector<double> perp_fourier(void);
149  size_t nedge_pseudorapidity(void) const;
150 };
151 
152 #endif
std::vector< bool > _active
std::vector< std::vector< size_t > > _recombine_index
int i
Definition: DBlmapReader.cc:9
math::PtEtaPhiELorentzVector momentum
std::vector< double > perp_fourier(void)
void subtract_momentum(void)
void event_fourier(void)
CGAL::Voronoi_diagram_2< delaunay_triangulation_t, CGAL::Delaunay_triangulation_adaptation_traits_2< delaunay_triangulation_t >, CGAL::Delaunay_triangulation_caching_degeneracy_removal_policy_2< delaunay_triangulation_t > > voronoi_diagram_t
double _positive_bound_scale
void remove_nonpositive(void)
std::vector< double > _edge_pseudorapidity
void initialize_geometry(void)
std::pair< double, double > Point
Definition: CaloEllipse.h:18
std::vector< double > _recombine_tie
particle_t(math::PtEtaPhiELorentzVector p, unsigned int i, double a=NAN, double ps=NAN)
const UECalibration * ue
delaunay_triangulation_t::Point point_2d_t
std::vector< double > _cms_ecal_edge_pseudorapidity
std::vector< double > particle_area(void)
void lp_populate(void *lp_problem)
void subtract_if_necessary(void)
void push_back_particle(const double perp, const double pseudorapidity, const double azimuth, const unsigned int reduced_particle_flow_id)
std::vector< particle_t > event_t
std::vector< std::pair< size_t, size_t > > _recombine
static const size_t nreduced_particle_flow_id
std::vector< std::set< size_t > > particle_incident(void)
static const size_t nfourier
std::vector< size_t > _nblock_subtract
std::vector< double > _feature
double _radial_distance_square_max
boost::multi_array< double, 4 > * _perp_fourier
PtEtaPhiELorentzVectorD PtEtaPhiELorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:27
std::vector< std::vector< size_t > > _recombine_unsigned
void feature_extract(void)
VoronoiAlgorithm(const UECalibration *ue, const double dr_max, const std::pair< double, double > equalization_threshold=std::pair< double, double >(5.0, 35.0), const bool remove_nonpositive=true)
T perp() const
Magnitude of transverse component.
void voronoi_area_incident(void)
double a
Definition: hdecay.h:121
std::pair< double, double > _equalization_threshold
size_t nedge_pseudorapidity(void) const
std::vector< double > _cms_hcal_edge_pseudorapidity
CGAL::Polygon_2< CGAL::Exact_predicates_inexact_constructions_kernel > polygon_t
std::vector< double > subtracted_unequalized_perp(void)
std::set< std::vector< particle_t >::iterator > incident
std::vector< double > subtracted_equalized_perp(void)
CGAL::Delaunay_triangulation_2< CGAL::Exact_predicates_inexact_constructions_kernel > delaunay_triangulation_t