ATLAS Offline Software
Loading...
Searching...
No Matches
cyl_geom.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#define CY_GEOM_CPP
6#include "JetUtils/cyl_geom.h"
7
8namespace JetGeom {
10 // helper function for findConvexHull
11 point_list_t::iterator it_prev = hull.end();--it_prev;
12 point_list_t::iterator it_pprev = it_prev; --it_pprev;
13 line_t l(*it_pprev, *it_prev);
14 // std::cout << " hull : "<< hull.size()<< " p.phi ="<<p.second <<std::endl;
15 // std::cout << " "<< (*it_prev).first<< " " << (*it_prev).second << std::endl;
16 // std::cout << " "<< (*it_pprev).first << " "<<(*it_pprev).second << std::endl;
17 // std::cout << " -> "<< p.first << " "<< p.second << std::endl;
18 if ( ! l.is_left(p) && (hull.size()>2)){
19 //std::cout << " is right !" << std::endl;
20 hull.pop_back(); // remove last
21 testHullLine(hull, p);
22 }else{
23 //std::cout << " is left !" << std::endl;
24 hull.push_back(p);
25 }
26}
27void listToSet(point_list_t &inList, point_set_t &outSet){
28 point_list_t::iterator it = inList.begin();
29 point_list_t::iterator itE = inList.end();
30 point_set_t::iterator s_it = outSet.begin();
31 for(; it!=itE; ++it){
32 s_it = outSet.insert(s_it, *it);
33 }
34}
35
36}
oriented segment/line in a simplistic way
Definition cyl_geom.h:37
Very basic point objects.
Definition cyl_geom.h:25
A collection of routines for geometric tasks in 2D and on a cylinder.
Definition cyl_geom.h:22
void listToSet(point_list_t &inList, point_set_t &outSet)
Definition cyl_geom.cxx:27
void testHullLine(point_list_t &hull, point_t p)
Definition cyl_geom.cxx:9
std::list< point_t > point_list_t
Definition cyl_geom.h:32