Index: tags/siscone-3.0.5/siscone/ranlux.cpp =================================================================== --- tags/siscone-3.0.5/siscone/ranlux.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/ranlux.cpp (revision 426) @@ -0,0 +1,171 @@ +// file: ranlux.xpp +#include "ranlux.h" +#include +#include + +/* This is a lagged fibonacci generator with skipping developed by Luescher. + The sequence is a series of 24-bit integers, x_n, + + x_n = d_n + b_n + + where d_n = x_{n-10} - x_{n-24} - c_{n-1}, b_n = 0 if d_n >= 0 and + b_n = 2^24 if d_n < 0, c_n = 0 if d_n >= 0 and c_n = 1 if d_n < 0, + where after 24 samples a group of p integers are "skipped", to + reduce correlations. By default p = 199, but can be increased to + 365. + + The period of the generator is around 10^171. + + From: M. Luescher, "A portable high-quality random number generator + for lattice field theory calculations", Computer Physics + Communications, 79 (1994) 100-110. + + Available on the net as hep-lat/9309020 at http://xxx.lanl.gov/ + + See also, + + F. James, "RANLUX: A Fortran implementation of the high-quality + pseudo-random number generator of Luscher", Computer Physics + Communications, 79 (1994) 111-114 + + Kenneth G. Hamilton, F. James, "Acceleration of RANLUX", Computer + Physics Communications, 101 (1997) 241-248 + + Kenneth G. Hamilton, "Assembler RANLUX for PCs", Computer Physics + Communications, 101 (1997) 249-253 */ + +namespace siscone{ + +static const unsigned long int mask_lo = 0x00ffffffUL; // 2^24 - 1 +static const unsigned long int mask_hi = ~0x00ffffffUL; +static const unsigned long int two24 = 16777216; // 2^24 + + +// internal generator structure +//------------------------------ +typedef struct { + unsigned int i; + unsigned int j; + unsigned int n; + unsigned int skip; + unsigned int carry; + unsigned long int u[24]; +} ranlux_state_t; + + +// internal generator state +//-------------------------- +ranlux_state_t local_ranlux_state; + + +// incrementation of the generator state +//--------------------------------------- +static inline unsigned long int increment_state(){ + unsigned int i = local_ranlux_state.i; + unsigned int j = local_ranlux_state.j; + long int delta = local_ranlux_state.u[j] - local_ranlux_state.u[i] + - local_ranlux_state.carry; + + if (delta & mask_hi){ + local_ranlux_state.carry = 1; + delta &= mask_lo; + } else { + local_ranlux_state.carry = 0; + } + + local_ranlux_state.u[i] = delta; + + if (i==0) + i = 23; + else + i--; + + local_ranlux_state.i = i; + + if (j == 0) + j = 23; + else + j--; + + local_ranlux_state.j = j; + + return delta; +} + + +// set generator state +//--------------------- +static void ranlux_set(unsigned long int s){ + int i; + long int seed; + + if (s==0) + s = 314159265; /* default seed is 314159265 */ + + seed = s; + + /* This is the initialization algorithm of F. James, widely in use + for RANLUX. */ + + for (i=0;i<24;i++){ + unsigned long int k = seed/53668; + seed = 40014*(seed-k*53668)-k*12211; + if (seed<0){ + seed += 2147483563; + } + local_ranlux_state.u[i] = seed%two24; + } + + local_ranlux_state.i = 23; + local_ranlux_state.j = 9; + local_ranlux_state.n = 0; + local_ranlux_state.skip = 389-24; // 389 => best decorrelation + + if (local_ranlux_state.u[23]&mask_hi){ + local_ranlux_state.carry = 1; + } else { + local_ranlux_state.carry = 0; + } +} + + +// generator initialization +//-------------------------- +void ranlux_init(){ + // seed the generator + ranlux_set(0); +} + + +// get random number +//------------------- +unsigned long int ranlux_get(){ + const unsigned int skip = local_ranlux_state.skip; + unsigned long int r = increment_state(); + + local_ranlux_state.n++; + + if (local_ranlux_state.n == 24){ + unsigned int i; + local_ranlux_state.n = 0; + for (i = 0; i < skip; i++) + increment_state(); + } + + return r; +} + +// print generator state +//----------------------- +void ranlux_print_state(){ + size_t i; + unsigned char *p = (unsigned char *) (&local_ranlux_state); + const size_t n = sizeof (ranlux_state_t); + + for (i=0;i +#include +#include + +namespace siscone{ + +using namespace std; + +/******************************************************************* + * Cquadtree implementation * + * Implementation of a 2D quadtree. * + * This class implements the traditional two-dimensional quadtree. * + * The elements at each node are of 'Cmomentum' type. * + *******************************************************************/ + +// default ctor +//-------------- +Cquadtree::Cquadtree(){ + v = NULL; + + children[0][0] = children[0][1] = children[1][0] = children[1][1] = NULL; + has_child = false; +} + + +// ctor with initialisation (see init for details) +//-------------------------- +Cquadtree::Cquadtree(double _x, double _y, double _half_size_x, double _half_size_y){ + v = NULL; + + children[0][0] = children[0][1] = children[1][0] = children[1][1] = NULL; + has_child = false; + + init(_x, _y, _half_size_x, _half_size_y); +} + + +// default destructor +// at destruction, everything is destroyed except +// physical values at the leaves +//------------------------------------------------ +Cquadtree::~Cquadtree(){ + if (has_child){ + if (v!=NULL) delete v; + delete children[0][0]; + delete children[0][1]; + delete children[1][0]; + delete children[1][1]; + } +} + + +/* + * init the tree. + * By initializing the tree, we mean setting the cell parameters + * and preparing the object to act as a seed for a new tree. + * - _x x-position of the center + * - _y y-position of the center + * - half_size_x half x-size of the cell + * - half_size_y half y-size of the cell + * return 0 on success, 1 on error. Note that if the cell + * is already filled, we return an error. + ******************************************************************/ +int Cquadtree::init(double _x, double _y, double _half_size_x, double _half_size_y){ + if (v!=NULL) + return 1; + + centre_x = _x; + centre_y = _y; + half_size_x = _half_size_x; + half_size_y = _half_size_y; + + return 0; +} + + +/* + * adding a particle to the tree. + * This method adds one vector to the quadtree structure which + * is updated consequently. + * - v vector to add + * return 0 on success 1 on error + ******************************************************************/ +int Cquadtree::add(Cmomentum *v_add){ + // Description of the method: + // -------------------------- + // the addition process goes as follows: + // 1. check if the cell is empty, in which case, add the particle + // here and leave. + // 2. If there is a unique particle already inside, + // (a) create children + // (b) forward the existing particle to the appropriate child + // 3. Add current particle to this cell and forward to the + // adequate child + // NOTE: we assume in the whole procedure that the particle is + // indeed inside the cell ! + + // step 1: the case of empty cells + if (v==NULL){ + v = v_add; + return 0; + } + + // step 2: additional work if 1! particle already present + // we use the fact that only 1-particle systems have no child + if (!has_child){ + double new_half_size_x = 0.5*half_size_x; + double new_half_size_y = 0.5*half_size_y; + // create children + children[0][0] = new Cquadtree(centre_x-new_half_size_x, centre_y-new_half_size_y, + new_half_size_x, new_half_size_y); + children[0][1] = new Cquadtree(centre_x-new_half_size_x, centre_y+new_half_size_y, + new_half_size_x, new_half_size_y); + children[1][0] = new Cquadtree(centre_x+new_half_size_x, centre_y-new_half_size_y, + new_half_size_x, new_half_size_y); + children[1][1] = new Cquadtree(centre_x+new_half_size_x, centre_y+new_half_size_y, + new_half_size_x, new_half_size_y); + + has_child = true; + + // forward to child + //? The following line assumes 'true'==1 and 'false'==0 + // Note: v being a single particle, eta and phi are correct + children[v->eta>centre_x][v->phi>centre_y]->add(v); + + // copy physical params + v = new Cmomentum(*v); + } + + // step 3: add new particle + // Note: v_add being a single particle, eta and phi are correct + children[v_add->eta>centre_x][v_add->phi>centre_y]->add(v_add); + *v+=*v_add; + + return 0; +} + + +/* + * circle intersection. + * computes the intersection with a circle of given centre and radius. + * The output takes the form of a quadtree with all squares included + * in the circle. + * - cx circle centre x coordinate + * - cy circle centre y coordinate + * - cR2 circle radius SQUARED + * return the checksum for the intersection + ******************************************************************/ +Creference Cquadtree::circle_intersect(double cx, double cy, double cR2){ + // Description of the method: + // -------------------------- + // 1. check if cell is empty => no intersection + // 2. if cell has 1! particle, check if it is inside the circle. + // If yes, add it and return, if not simply return. + // 3. check if the circle intersects the square. If not, return. + // 4. check if the square is inside the circle. + // If yes, add it to qt and return. + // 5. check intersections with children. + + // step 1: if there is no particle inside te square, no reason to go further + if (v==NULL) + return Creference(); + + double dx, dy; + + // step 2: if there is only one particle inside the square, test if it is in + // the circle, in which case return associated reference + if (!has_child){ + // compute the distance + // Note: v has only one particle => eta and phi are defined + dx = cx - v->eta; + dy = fabs(cy - v->phi); + if (dy>M_PI) + dy -= 2.0*M_PI; + + // test distance + if (dx*dx+dy*dyref; + } + + return Creference(); + } + + // step 3: check if there is an intersection + //double ryp, rym; + double dx_c, dy_c; + + // store distance with the centre of the square + dx_c = fabs(cx-centre_x); + dy_c = fabs(cy-centre_y); + if (dy_c>M_PI) dy_c = 2.0*M_PI-dy_c; + + // compute (minimal) the distance (pay attention to the periodicity in phi). + dx = dx_c-half_size_x; + if (dx<0) dx=0; + dy = dy_c-half_size_y; + if (dy<0) dy=0; + + // check the distance + if (dx*dx+dy*dy>=cR2){ + // no intersection + return Creference(); + } + + // step 4: check if included + + // compute the (maximal) distance + dx = dx_c+half_size_x; + dy = dy_c+half_size_y; + if (dy>M_PI) dy = M_PI; + + // compute the distance + if (dx*dx+dy*dyref; + } + + // step 5: the square is not fully in. Recurse to children + return children[0][0]->circle_intersect(cx, cy, cR2) + + children[0][1]->circle_intersect(cx, cy, cR2) + + children[1][0]->circle_intersect(cx, cy, cR2) + + children[1][1]->circle_intersect(cx, cy, cR2); +} + + +/* + * output a data file for drawing the grid. + * This can be used to output a data file containing all the + * grid subdivisions. The file contents is as follows: + * first and second columns give center of the cell, the third + * gives the size. + * - flux opened stream to write to + * return 0 on success, 1 on error + ******************************************************************/ +int Cquadtree::save(FILE *flux){ + + if (flux==NULL) + return 1; + + if (has_child){ + fprintf(flux, "%e\t%e\t%e\t%e\n", centre_x, centre_y, half_size_x, half_size_y); + children[0][0]->save(flux); + children[0][1]->save(flux); + children[1][0]->save(flux); + children[1][1]->save(flux); + } + + return 0; +} + + +/* + * output a data file for drawing the tree leaves. + * This can be used to output a data file containing all the + * tree leaves. The file contents is as follows: + * first and second columns give center of the cell, the third + * gives the size. + * - flux opened stream to write to + * return 0 on success, 1 on error + ******************************************************************/ +int Cquadtree::save_leaves(FILE *flux){ + + if (flux==NULL) + return 1; + + if (has_child){ + if (children[0][0]!=NULL) children[0][0]->save_leaves(flux); + if (children[0][1]!=NULL) children[0][1]->save_leaves(flux); + if (children[1][0]!=NULL) children[1][0]->save_leaves(flux); + if (children[1][1]!=NULL) children[1][1]->save_leaves(flux); + } else { + fprintf(flux, "%e\t%e\t%e\t%e\n", centre_x, centre_y, half_size_x, half_size_y); + } + + return 0; +} + +} Property changes on: tags/siscone-3.0.5/siscone/quadtree.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/split_merge.cpp =================================================================== --- tags/siscone-3.0.5/siscone/split_merge.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/split_merge.cpp (revision 426) @@ -0,0 +1,1186 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: split_merge.cpp // +// Description: source file for splitting/merging (contains the CJet class) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include "split_merge.h" +#include "siscone_error.h" +#include "momentum.h" +#include // for max +#include +#include +#include +#include +#include + +namespace siscone{ + +using namespace std; + +/******************************************************** + * class Cjet implementation * + * real Jet information. * + * This class contains information for one single jet. * + * That is, first, its momentum carrying information * + * about its centre and pT, and second, its particle * + * contents * + ********************************************************/ +// default ctor +//-------------- +Cjet::Cjet(){ + n = 0; + v = Cmomentum(); + pt_tilde = 0.0; + sm_var2 = 0.0; + pass = CJET_INEXISTENT_PASS; // initialised to a value that should + // notappear in the end (after clustering) +} + +// default dtor +//-------------- +Cjet::~Cjet(){ + +} + +// ordering of jets in pt (e.g. used in final jets ordering) +//----------------------------------------------------------- +bool jets_pt_less(const Cjet &j1, const Cjet &j2){ + return j1.v.perp2() > j2.v.perp2(); +} + + +/******************************************************** + * Csplit_merge_ptcomparison implementation * + * This deals with the ordering of the jets candidates * + ********************************************************/ + +// odering of two jets +// The variable of the ordering is pt or mt +// depending on 'split_merge_scale' choice +// +// with EPSILON_SPLITMERGE defined, this attempts to identify +// delicate cases where two jets have identical momenta except for +// softish particles -- the difference of pt's may not be correctly +// identified normally and so lead to problems for the fate of the +// softish particle. +// +// NB: there is a potential issue in momentum-conserving events, +// whereby the harder of two jets becomes ill-defined when a soft +// particle is emitted --- this may have a knock-on effect on +// subsequent split-merge steps in cases with sufficiently large R +// (but we don't know what the limit is...) +//------------------------------------------------------------------ +bool Csplit_merge_ptcomparison::operator ()(const Cjet &jet1, const Cjet &jet2) const{ + double q1, q2; + + // compute the value for comparison for both jets + // This depends on the choice of variable (mt is the default) + q1 = jet1.sm_var2; + q2 = jet2.sm_var2; + + bool res = q1 > q2; + + // if we enable the refined version of the comparison (see defines.h), + // we compute the difference more precisely when the two jets are very + // close in the ordering variable. +#ifdef EPSILON_SPLITMERGE + if ( (fabs(q1-q2) < EPSILON_SPLITMERGE*max(q1,q2)) && + (jet1.v.ref != jet2.v.ref) ) { + // get the momentum of the difference + Cmomentum difference; + double pt_tilde_difference; + get_difference(jet1,jet2,&difference,&pt_tilde_difference); + + // use the following relation: pt1^2 - pt2^2 = (pt1+pt2)*(pt1-pt2) + double qdiff; + Cmomentum sum = jet1.v ; + sum += jet2.v; + double pt_tilde_sum = jet1.pt_tilde + jet2.pt_tilde; + + // depending on the choice of ordering variable, set the result + switch (split_merge_scale){ + case SM_mt: + qdiff = sum.E*difference.E - sum.pz*difference.pz; + break; + case SM_pt: + qdiff = sum.px*difference.px + sum.py*difference.py; + break; + case SM_pttilde: + qdiff = pt_tilde_sum*pt_tilde_difference; + break; + case SM_Et: + // diff = E^2 (dpt^2 pz^2- pt^2 dpz^2) + // + dE^2 (pt^2+pz^2) pt2^2 + // where, unless explicitely specified the variables + // refer to the first jet or differences jet1-jet2. + qdiff = jet1.v.E*jet1.v.E* + ((sum.px*difference.px + sum.py*difference.py)*jet1.v.pz*jet1.v.pz + -jet1.v.perp2()*sum.pz*difference.pz) + +sum.E*difference.E*(jet1.v.perp2()+jet1.v.pz*jet1.v.pz)*jet2.v.perp2(); + break; + default: + throw Csiscone_error("Unsupported split-merge scale choice: " + + SM_scale_name()); + } + res = qdiff > 0; + } +#endif // EPSILON_SPLITMERGE + + return res; +} + + +/// return a name for the sm scale choice +/// NB: used internally and also by fastjet +std::string split_merge_scale_name(Esplit_merge_scale sms) { + switch(sms) { + case SM_pt: + return "pt (IR unsafe)"; + case SM_Et: + return "Et (boost dep.)"; + case SM_mt: + return "mt (IR safe except for pairs of identical decayed heavy particles)"; + case SM_pttilde: + return "pttilde (scalar sum of pt's)"; + default: + return "[SM scale without a name]"; + } +} + + +// get the difference between 2 jets +// - j1 first jet +// - j2 second jet +// - v jet1-jet2 +// - pt_tilde jet1-jet2 pt_tilde +// return true if overlapping, false if disjoint +//----------------------------------------------- +void Csplit_merge_ptcomparison::get_difference(const Cjet &j1, const Cjet &j2, Cmomentum *v, double *pt_tilde) const { + int i1,i2; + + // initialise + i1=i2=0; + *v = Cmomentum(); + *pt_tilde = 0.0; + + // compute overlap + // at the same time, we store union in indices + do{ + if (j1.contents[i1]==j2.contents[i2]) { + i1++; + i2++; + } else if (j1.contents[i1]j2.contents[i2]){ + (*v) -= (*particles)[j2.contents[i2]]; + (*pt_tilde) -= (*pt)[j2.contents[i2]]; + i2++; + } else { + throw Csiscone_error("get_non_overlap reached part it should never have seen..."); + } + } while ((i1(ptcomparison)); + + // no hardest cut (col-unsafe) + SM_var2_hardest_cut_off = -numeric_limits::max(); + + // no pt cutoff for the particles to put in p_uncol_hard + stable_cone_soft_pt2_cutoff = -1.0; + + // no pt-weighted splitting + use_pt_weighted_splitting = false; +} + + +// default dtor +//-------------- +Csplit_merge::~Csplit_merge(){ + full_clear(); +} + + +// initialisation function +// - _particles list of particles +// - protocones list of protocones (initial jet candidates) +// - R2 cone radius (squared) +// - ptmin minimal pT allowed for jets +//------------------------------------------------------------- +int Csplit_merge::init(vector & /*_particles*/, vector *protocones, double R2, double ptmin){ + // browse protocones + return add_protocones(protocones, R2, ptmin); +} + + +// initialisation function for particle list +// - _particles list of particles +//------------------------------------------------------------- +int Csplit_merge::init_particles(vector &_particles){ + full_clear(); + + // compute the list of particles + // here, we do not need to throw away particles + // with infinite rapidity (colinear with the beam) + particles = _particles; + n = particles.size(); + + // build the vector of particles' pt + pt.resize(n); + for (int i=0;i(ptcomparison)); + + // start off with huge number + most_ambiguous_split = numeric_limits::max(); + + jets.clear(); +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + if (merge_identical_protocones) + cand_refs.clear(); +#endif + + p_remain.clear(); + + return 0; +} + + +// full clearance +//---------------- +int Csplit_merge::full_clear(){ + partial_clear(); + + // clear previously allocated memory + if (indices != NULL){ + delete[] indices; + } + particles.clear(); + + return 0; +} + + +// build the list 'p_uncol_hard' from p_remain by clustering collinear particles +// note that thins in only used for stable-cone detection +// so the parent_index field is unnecessary +//------------------------------------------------------------------------- +int Csplit_merge::merge_collinear_and_remove_soft(){ + int i,j; + vector p_sorted; + bool collinear; + double dphi; + + p_uncol_hard.clear(); + + // we first sort the particles according to their rapidity + for (i=0;iM_PI) dphi = twopi-dphi; + if (dphi *protocones, double R2, double ptmin){ + int i; + Cmomentum *c; + Cmomentum *v; + double eta, phi; + double dx, dy; + double R; + Cjet jet; + + if (protocones->size()==0) + return 1; + + pt_min2 = ptmin*ptmin; + R = sqrt(R2); + + // browse protocones + // for each of them, build the list of particles in them + for (vector::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){ + // initialise variables + c = &(*p_it); + + // note: cones have been tested => their (eta,phi) coordinates are computed + eta = c->eta; + phi = c->phi; + + // browse particles to create cone contents + // note that jet is always initialised with default values at this level + jet.v = Cmomentum(); + jet.pt_tilde=0; + jet.contents.clear(); + for (i=0;ipz)!=v->E){ + dx = eta - v->eta; + dy = fabs(phi - v->phi); + if (dy>M_PI) + dy -= twopi; + if (dx*dx+dy*dyparent_index); + jet.v+= *v; + jet.pt_tilde+= pt[v->parent_index]; + v->index=0; + } + } + jet.n=jet.contents.size(); + + // set the momentum in protocones + // (it was only known through eta and phi up to now) + *c = jet.v; + c->eta = eta; // restore exact original coords + c->phi = phi; // to avoid rounding error inconsistencies + + // set the jet range + jet.range=Ceta_phi_range(eta,phi,R); + +#ifdef DEBUG_SPLIT_MERGE + cout << "adding jet: "; + for (int i2=0;i2 *protocones, double R2, double ptmin){ + + int i; + Cmomentum *c; + Cmomentum *v; + double eta, phi; + double dx, dy; + double R; + Cjet jet, jet_candidate; + bool found_jet = false; + + if (protocones->size()==0) + return 1; + + pt_min2 = ptmin*ptmin; + R = sqrt(R2); + + // browse protocones + // for each of them, build the list of particles in them + for (vector::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){ + // initialise variables + c = &(*p_it); + + // note: cones have been tested => their (eta,phi) coordinates are computed + eta = c->eta; + phi = c->phi; + + // NOTE: this is common to this method and add_protocones, so it + // could be moved into a 'build_jet_from_protocone' method + // + // browse particles to create cone contents + jet_candidate.v = Cmomentum(); + jet_candidate.pt_tilde=0; + jet_candidate.contents.clear(); + for (i=0;ipz)!=v->E){ + dx = eta - v->eta; + dy = fabs(phi - v->phi); + if (dy>M_PI) + dy -= twopi; + if (dx*dx+dy*dyparent_index); + jet_candidate.v+= *v; + jet_candidate.pt_tilde+= pt[v->parent_index]; + v->index=0; + } + } + jet_candidate.n=jet_candidate.contents.size(); + + // set the momentum in protocones + // (it was only known through eta and phi up to now) + *c = jet_candidate.v; + c->eta = eta; // restore exact original coords + c->phi = phi; // to avoid rounding error inconsistencies + + // set the jet range + jet_candidate.range=Ceta_phi_range(eta,phi,R); + + // check that the protojet has large enough pt + if (jet_candidate.v.perp2()is_larger(jet_candidate, jet) + : ptcomparison(jet_candidate, jet))){ + jet = jet_candidate; + found_jet = true; + } + } + + // make sure at least one of the jets has passed the selection + if (!found_jet) return 1; + + // add the jet to the list of jets + jets.push_back(jet); + jets[jets.size()-1].v.build_etaphi(); + +#ifdef DEBUG_SPLIT_MERGE + cout << "PR-Jet " << jets.size() << " [size " << jet.contents.size() << "]:"; +#endif + + // update the list of what particles are left + int p_remain_index = 0; + int contents_index = 0; + //sort(next_jet.contents.begin(),next_jet.contents.end()); + for (int index=0;indexsize()==0) + return 0; + + if (overlap_tshold>=1.0 || overlap_tshold <= 0) { + ostringstream message; + message << "Illegal value for overlap_tshold, f = " << overlap_tshold; + message << " (legal values are 0size()>0){ + // browse for the first jet + j1 = candidates->begin(); + + // if hardest jet does not pass threshold then nothing else will + // either so one stops the split merge. + if (j1->sm_var2end()){ +#ifdef DEBUG_SPLIT_MERGE + show(); +#endif + // check overlapping + if (get_overlap(*j1, *j2, &overlap2)){ + // check if overlapping energy passes threshold + // Note that this depends on the ordering variable +#ifdef DEBUG_SPLIT_MERGE + cout << "overlap between cdt 1 and cdt " << j2_relindex+1 << " with overlap " + << sqrt(overlap2/j2->sm_var2) << endl<sm_var2){ + // split jets + split(j1, j2); + + // update iterators + j2 = j1 = candidates->begin(); + j2_relindex = 0; + } else { + // merge jets + merge(j1, j2); + + // update iterators + j2 = j1 = candidates->begin(); + j2_relindex = 0; + } + } + // watch out: split/merge might have caused new jets with pt < + // ptmin to disappear, so the total number of jets may + // have changed by more than expected and j2 might already by + // the end of the candidates list... + j2_relindex++; + if (j2 != candidates->end()) j2++; + } // end of loop on the second jet + + if (j1 != candidates->end()) { + // all "second jet" passed without overlapping + // (otherwise we won't leave the j2 loop) + // => store jet 1 as real jet + jets.push_back(*j1); + jets[jets.size()-1].v.build_etaphi(); + // a bug where the contents has non-zero size has been cropping + // up in many contexts -- so catch it! + assert(j1->contents.size() > 0); + jets[jets.size()-1].pass = particles[j1->contents[0]].index; +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + cand_refs.erase(j1->v.ref); +#endif + candidates->erase(j1); + + //// test that the hardest jet pass the potential cut-off + //if ((candidates->size()!=0) && + // (candidates->begin()->sm_var2clear(); + //} + } + } + } while (candidates->size()>0); + + // sort jets by pT + sort(jets.begin(), jets.end(), jets_pt_less); +#ifdef DEBUG_SPLIT_MERGE + show(); +#endif + + return jets.size(); +} + + + +// save the event on disk +// - flux stream used to save jet contents +//-------------------------------------------- +int Csplit_merge::save_contents(FILE *flux){ + jet_iterator it_j; + Cjet *j1; + int i1, i2; + + fprintf(flux, "# %d jets found\n", (int) jets.size()); + fprintf(flux, "# columns are: eta, phi, pt and number of particles for each jet\n"); + for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ + j1 = &(*it_j); + j1->v.build_etaphi(); + fprintf(flux, "%f\t%f\t%e\t%d\n", + j1->v.eta, j1->v.phi, j1->v.perp(), j1->n); + } + + fprintf(flux, "# jet contents\n"); + fprintf(flux, "# columns are: eta, phi, pt, particle index and jet number\n"); + for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ + j1 = &(*it_j); + for (i2=0;i2n;i2++) + fprintf(flux, "%f\t%f\t%e\t%d\t%d\n", + particles[j1->contents[i2]].eta, particles[j1->contents[i2]].phi, + particles[j1->contents[i2]].perp(), j1->contents[i2], i1); + } + + return 0; +} + + +// show current jets/candidate status +//------------------------------------ +int Csplit_merge::show(){ + jet_iterator it_j; + cjet_iterator it_c; + Cjet *j; + const Cjet *c; + int i1, i2; + + for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ + j = &(*it_j); + fprintf(stdout, "jet %2d: %e\t%e\t%e\t%e\t", i1+1, + j->v.px, j->v.py, j->v.pz, j->v.E); + for (i2=0;i2n;i2++) + fprintf(stdout, "%d ", j->contents[i2]); + fprintf(stdout, "\n"); + } + + for (it_c = candidates->begin(), i1=0 ; it_c != candidates->end() ; it_c++, i1++){ + c = &(*it_c); + fprintf(stdout, "cdt %2d: %e\t%e\t%e\t%e\t%e\t", i1+1, + c->v.px, c->v.py, c->v.pz, c->v.E, sqrt(c->sm_var2)); + for (i2=0;i2n;i2++) + fprintf(stdout, "%d ", c->contents[i2]); + fprintf(stdout, "\n"); + } + + fprintf(stdout, "\n"); + return 0; +} + + +// get the overlap between 2 jets +// - j1 first jet +// - j2 second jet +// - overlap2 returned overlap^2 (determined by the choice of SM variable) +// return true if overlapping, false if disjoint +//--------------------------------------------------------------------- +bool Csplit_merge::get_overlap(const Cjet &j1, const Cjet &j2, double *overlap2){ + // check if ranges overlap + if (!is_range_overlap(j1.range,j2.range)) + return false; + + int i1,i2; + bool is_overlap; + + // initialise + i1=i2=idx_size=0; + is_overlap = false; + Cmomentum v; + double pt_tilde=0.0; + + // compute overlap + // at the same time, we store union in indices + do{ + if (j1.contents[i1]j2.contents[i2]){ + indices[idx_size] = j2.contents[i2]; + i2++; + } else { // (j1.contents[i1]==j2.contents[i2]) + v += particles[j1.contents[i1]]; + pt_tilde += pt[j1.contents[i1]]; + indices[idx_size] = j1.contents[i1]; + i1++; + i2++; + is_overlap = true; + } + idx_size++; + } while ((i1" all over the place + const Cjet & j1 = * it_j1; + const Cjet & j2 = * it_j2; + + i1=i2=0; + jet2.v = jet1.v = Cmomentum(); + jet2.pt_tilde = jet1.pt_tilde = 0.0; + + // compute centroids + // When use_pt_weighted_splitting is activated, the + // "geometrical" distance is weighted by the inverse + // of the pt of the protojet + // This is stored in pt{1,2}_weight + tmp = j1.v; + tmp.build_etaphi(); + eta1 = tmp.eta; + phi1 = tmp.phi; + pt1_weight = (use_pt_weighted_splitting) ? 1.0/tmp.perp2() : 1.0; + + tmp = j2.v; + tmp.build_etaphi(); + eta2 = tmp.eta; + phi2 = tmp.phi; + pt2_weight = (use_pt_weighted_splitting) ? 1.0/tmp.perp2() : 1.0; + + jet1.v = jet2.v = Cmomentum(); + + // compute jet splitting + do{ + if (j1.contents[i1]eta,v->phi); + } else if (j1.contents[i1]>j2.contents[i2]){ + // particle i2 belong only to jet 2 + v = &(particles[j2.contents[i2]]); + jet2.contents.push_back(j2.contents[i2]); + jet2.v += *v; + jet2.pt_tilde += pt[j2.contents[i2]]; + i2++; + jet2.range.add_particle(v->eta,v->phi); + } else { // (j1.contents[i1]==j2.contents[i2]) + // common particle, decide which is the closest centre + v = &(particles[j1.contents[i1]]); + + // distance w.r.t. centroid 1 + dx1 = eta1 - v->eta; + dy1 = fabs(phi1 - v->phi); + if (dy1>M_PI) + dy1 -= twopi; + + // distance w.r.t. centroid 2 + dx2 = eta2 - v->eta; + dy2 = fabs(phi2 - v->phi); + if (dy2>M_PI) + dy2 -= twopi; + + //? what when == ? + // When use_pt_weighted_splitting is activated, the + // "geometrical" distance is weighted by the inverse + // of the pt of the protojet + double d1sq = (dx1*dx1+dy1*dy1)*pt1_weight; + double d2sq = (dx2*dx2+dy2*dy2)*pt2_weight; + // do bookkeeping on most ambiguous split + if (fabs(d1sq-d2sq) < most_ambiguous_split) + most_ambiguous_split = fabs(d1sq-d2sq); + + if (d1sqeta,v->phi); + } else { + // particle i2 belong only to jet 2 + jet2.contents.push_back(j2.contents[i2]); + jet2.v += *v; + jet2.pt_tilde += pt[j2.contents[i2]]; + jet2.range.add_particle(v->eta,v->phi); + } + + i1++; + i2++; + } + } while ((i1eta,v->phi); + } + while (i2eta,v->phi); + } + + // finalise jets + jet1.n = jet1.contents.size(); + jet2.n = jet2.contents.size(); + + //jet1.range = j1.range; + //jet2.range = j2.range; + + // remove previous jets +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + cand_refs.erase(j1.v.ref); + cand_refs.erase(j2.v.ref); +#endif + candidates->erase(it_j1); + candidates->erase(it_j2); + + // reinsert new ones + insert(jet1); + insert(jet2); + + return true; +} + +// merge the two given jet. +// during this procedure, the jets j1 & j2 are replaced +// by 1 single jets containing both of them. +// - it_j1 iterator of the first jet in 'candidates' +// - it_j2 iterator of the second jet in 'candidates' +// return true on success, false on error +//////////////////////////////////////////////////////////////// +bool Csplit_merge::merge(cjet_iterator &it_j1, cjet_iterator &it_j2){ + Cjet jet; + int i; + + // build new jet + // note: particles within j1 & j2 have already been stored in indices + for (i=0;irange, it_j2->range); + + // remove old candidates +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + if (merge_identical_protocones){ + cand_refs.erase(it_j1->v.ref); + cand_refs.erase(it_j2->v.ref); + } +#endif + candidates->erase(it_j1); + candidates->erase(it_j2); + + // reinsert new candidate + insert(jet); + + return true; +} + +/** + * Check whether or not a jet has to be inserted in the + * list of protojets. If it has, set its sm_variable and + * insert it to the list of protojets. + */ +bool Csplit_merge::insert(Cjet &jet){ + + // eventually check that no other candidate are present with the + // same cone contents. We recall that this automatic merging of + // identical protocones can lead to infrared-unsafe situations. +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + if ((merge_identical_protocones) && (!cand_refs.insert(jet.v.ref).second)) + return false; +#endif + + // check that the protojet has large enough pt + if (jet.v.perp2()insert(jet); + + return true; +} + +/** + * given a 4-momentum and its associated pT, return the + * variable that has to be used for SM + * \param v 4 momentum of the protojet + * \param pt_tilde pt_tilde of the protojet + */ +double Csplit_merge::get_sm_var2(Cmomentum &v, double &pt_tilde){ + switch(ptcomparison.split_merge_scale) { + case SM_pt: return v.perp2(); + case SM_mt: return v.perpmass2(); + case SM_pttilde: return pt_tilde*pt_tilde; + case SM_Et: return v.Et2(); + default: + throw Csiscone_error("Unsupported split-merge scale choice: " + + ptcomparison.SM_scale_name()); + } + + //return 0.0; +} + +} Property changes on: tags/siscone-3.0.5/siscone/split_merge.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/geom_2d.cpp =================================================================== --- tags/siscone-3.0.5/siscone/geom_2d.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/geom_2d.cpp (revision 426) @@ -0,0 +1,150 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: geom_2d.cpp // +// Description: source file for two-dimensional geometry tools // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include "geom_2d.h" +#include + +namespace siscone{ + +#define PHI_RANGE_MASK 0xFFFFFFFF + +/********************************************************* + * class Ceta_phi_range implementation * + * class for holding a covering range in eta-phi * + * * + * This class deals with ranges in the eta-phi plane. It * + * implements methods to test if two ranges overlap and * + * to take the union of two overlapping intervals. * + *********************************************************/ + +using namespace std; + +// static member default init +//---------------------------- +double Ceta_phi_range::eta_min = -100.0; +double Ceta_phi_range::eta_max = 100.0; + +// default ctor +//-------------- +Ceta_phi_range::Ceta_phi_range(){ + eta_range = 0; + phi_range = 0; +} + +// ctor with initialisation +// we initialise with a centre (in eta,phi) and a radius +// - c_eta eta coordinate of the centre +// - c_phi phi coordinate of the centre +// - R radius +//------------------------------------------------------- +Ceta_phi_range::Ceta_phi_range(double c_eta, double c_phi, double R){ + // determination of the eta range + //------------------------------- + double xmin = max(c_eta-R,eta_min+0.0001); + double xmax = min(c_eta+R,eta_max-0.0001); + + unsigned int cell_min = get_eta_cell(xmin); + unsigned int cell_max = get_eta_cell(xmax); + + // warning: if cell_max==2^31, 2*cell_max==0 hence, + // even if the next formula is formally (2*cell_max-cell_min), + // expressing it as (cell_max-cell_min)+cell_max is safe. + eta_range = (cell_max-cell_min)+cell_max; + + // determination of the phi range + // !! taking care of periodicity !! + //--------------------------------- + xmin = phi_in_range(c_phi-R); + xmax = phi_in_range(c_phi+R); + + cell_min = get_phi_cell(xmin); + cell_max = get_phi_cell(xmax); + + // Also, if the interval goes through pi, inversion is needed + if (xmax>xmin) + phi_range = (cell_max-cell_min)+cell_max; + else { + phi_range = (cell_min==cell_max) + ? PHI_RANGE_MASK + : ((PHI_RANGE_MASK^(cell_min-cell_max)) + cell_max); + } +} + +// assignment of range +// - r range to assign to current one +//--------------------------------------- +Ceta_phi_range& Ceta_phi_range::operator = (const Ceta_phi_range &r){ + eta_range = r.eta_range; + phi_range = r.phi_range; + + return *this; +} + +// add a particle to the range +// - eta eta coordinate of the particle +// - phi phi coordinate of the particle +// \return 0 on success, 1 on error +//---------------------------------------- +int Ceta_phi_range::add_particle(const double eta, const double phi){ + // deal with the eta coordinate + eta_range |= get_eta_cell(eta); + + // deal with the phi coordinate + phi_range |= get_phi_cell(phi); + + return 0; +} + + +// test overlap +// - r1 first range +// - r2 second range +// return true if overlap, false otherwise. +//------------------------------------------ +bool is_range_overlap(const Ceta_phi_range &r1, const Ceta_phi_range &r2){ + // check overlap in eta AND phi + return ((r1.eta_range & r2.eta_range) && (r1.phi_range & r2.phi_range)); +} + +// compute union +// Note: we assume that the two intervals overlap +// - r1 first range +// - r2 second range +// \return union of the two ranges +//------------------------------------------ +const Ceta_phi_range range_union (const Ceta_phi_range &r1, const Ceta_phi_range &r2){ + Ceta_phi_range tmp; + + // compute union in eta + tmp.eta_range = r1.eta_range | r2.eta_range; + + // compute union in phi + tmp.phi_range = r1.phi_range | r2.phi_range; + + return tmp; +} + +} Property changes on: tags/siscone-3.0.5/siscone/geom_2d.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Revision \ No newline at end of property Index: tags/siscone-3.0.5/siscone/circulator.h =================================================================== --- tags/siscone-3.0.5/siscone/circulator.h (revision 0) +++ tags/siscone-3.0.5/siscone/circulator.h (revision 426) @@ -0,0 +1,90 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: circulator.h // +// Description: header file for circulator (circulator class) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: 103 $// +// $Date:: 2007-02-18 17:07:34 +0100 (Sun, 18 Feb 2007) $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __CIRCULATOR_H__ +#define __CIRCULATOR_H__ + +namespace siscone{ + +/// \class circulator +/// a circulator that is foreseen to take as template member either a +/// pointer or an iterator; +template class circulator { + +public: + /// ctor with iniitalisation from iterators + /// \param here the current position + /// \param begin the first position + /// \param end the last position + inline circulator(T here, T begin, T end) : m_here(here), m_begin(begin), m_end(end) {} + + /// copy ctor + /// \param other the circulator to copy + inline circulator(const circulator & other) : m_here(other.m_here), m_begin(other.m_begin), m_end(other.m_end) {} + + /// set just the position without resetting the begin and end elements + /// \param other the circulator to grab position from + void set_position(const circulator & other) {m_here = other.m_here;} + + /// set just the position without resetting the begin and end elements + /// \param pointer the iterator to use as the new position + void set_position(T pointer) {m_here = pointer;} + + /// get the current object + T operator()() {return m_here;} + + /// position incrementation + inline circulator & operator++() { + ++m_here; + if (m_here == m_end) m_here = m_begin; + return *this; + } + + /// position decrementation + inline circulator & operator--() { + if (m_here == m_begin) m_here = m_end; + --m_here; + return *this; + } + + /// check if the current elements are the same + /// NB: for efficiency, this checks only the here element + /// \param other the circulator to compare to the current one + bool operator==(const circulator & other) const {return m_here == other.m_here;} + + /// check if the current elements are different + /// NB: for efficiency, this checks only the here element + /// \param other the circulator to compare to the current one + bool operator!=(const circulator & other) const {return m_here != other.m_here;} + +private: + T m_here, m_begin, m_end; ///< the current, beginning and ending iterators/pointers +}; + +} + +#endif // __CIRCULATOR_H__ Index: tags/siscone-3.0.5/siscone/siscone_error.cpp =================================================================== --- tags/siscone-3.0.5/siscone/siscone_error.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/siscone_error.cpp (revision 426) @@ -0,0 +1,33 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: siscone_error.cpp // +// Description: source file for SISCone error messages (Csiscone_error) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include "siscone_error.h" + +namespace siscone{ + +bool Csiscone_error::m_print_errors = true; + +} Property changes on: tags/siscone-3.0.5/siscone/siscone_error.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/area.h =================================================================== --- tags/siscone-3.0.5/siscone/area.h (revision 0) +++ tags/siscone-3.0.5/siscone/area.h (revision 426) @@ -0,0 +1,139 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: area.h // +// Description: header file for the computation of jet area // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: 149 $// +// $Date:: 2007-03-15 00:13:58 +0100 (Thu, 15 Mar 2007) $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __SISCONE_AREA_H__ +#define __SISCONE_AREA_H__ + +#include "momentum.h" +#include "siscone.h" + +namespace siscone{ + +/** + * \class Cjet_area + * real Jet information, including its area(s) + * + * This class contains information for one single jet. + * That is, first, its momentum carrying information + * about its centre and pT, and second, its particle + * contents. + * Compared to the Cjet class, it also includes the + * passive and active areas of the jet computed using + * the Carea class. + */ +class Cjet_area : public Cjet{ + public: + /// default ctor + Cjet_area(); + + /// jet-initialised ctor + Cjet_area(Cjet &j); + + /// default dtor + ~Cjet_area(); + + // area information + double passive_area; ///< passive area + double active_area; ///< active area +}; + +/** + * \class Carea + * class for the computation of jet areas. + * + * This is the class user should use whenever you want to compute + * the jet area (passive and active). . + * It uses the SISCone algorithm to perform the jet analysis. + */ +class Carea : public Csiscone{ + public: + /// default ctor + Carea(); + + /// default dtor + ~Carea(); + + /** + * compute the jet areas from a given particle set. + * The parameters of this method are the ones which control the jet clustering alghorithn. + * Note that the pt_min is not allowed here soince the jet-area determination involves soft + * particles/jets and thus is used internally. + * \param _particles list of particles + * \param _radius cone radius + * \param _f shared energy threshold for splitting&merging + * \param _n_pass_max maximum number of passes (0=full search, the default) + * \param _split_merge_scale the scale choice for the split-merge procedure + * NOTE: SM_pt leads to IR unsafety for some events with momentum conservation. + * SM_Et is IR safe but not boost invariant and not implemented(!) + * SM_mt is IR safe for hadronic events, but not for decays of two + * back-to-back particles of identical mass + * SM_pttilde + * is always IR safe, and also boost invariant (default) + * \param _hard_only when this is set on, only hard jets are computed + * and not the purely ghosted jets (default: false) + * \return the number of jets (including pure-ghost ones if they are included) + */ + int compute_areas(std::vector &_particles, double _radius, double _f, + int _n_pass_max=0, Esplit_merge_scale _split_merge_scale=SM_pttilde, + bool _hard_only=false); + + /** + * compute the jet active areas from a given particle set. + * The parameters of this method are the ones which control the jet clustering alghorithn. + * Note that the pt_min is not allowed here soince the jet-area determination involves soft + * particles/jets and thus is used internally. + * See compute_areas for paramters definition. + * \return the number of jets (including pure-ghost ones if they are included) + */ + int compute_active_areas(std::vector &_particles, double _radius, double _f, + int _n_pass_max=0, Esplit_merge_scale _split_merge_scale=SM_pttilde, + bool _hard_only=false); + + /** + * compute the jet passive areas from a given particle set. + * The parameters of this method are the ones which control the jet clustering alghorithn. + * Note that the pt_min is not allowed here soince the jet-area determination involves soft + * particles/jets and thus is used internally. + * See compute_areas for paramters definition. + */ + int compute_passive_areas(std::vector &_particles, double _radius, double _f, + int _n_pass_max=0, Esplit_merge_scale _split_merge_scale=SM_pttilde); + + int grid_size; ///< size of the grid we add soft particles on (N_soft=(grid_size^2)) + double grid_eta_max; ///< maximal value of eta we add soft particles on + double grid_shift; ///< fractional (random) displacement of the points om the grid + + double pt_soft; ///< pt of the soft particles added + double pt_shift; ///< amplitude of the pt random shift + double pt_soft_min; ///< pt_min used in SM to compute passive areas + + /// jets with their areas + std::vector jet_areas; +}; + +} +#endif Index: tags/siscone-3.0.5/siscone/ranlux.h =================================================================== --- tags/siscone-3.0.5/siscone/ranlux.h (revision 0) +++ tags/siscone-3.0.5/siscone/ranlux.h (revision 426) @@ -0,0 +1,49 @@ +//! \file ranlux.h + +#ifndef __RANLUX_H__ +#define __RANLUX_H__ + +/* This is a lagged fibonacci generator with skipping developed by Luescher. + The sequence is a series of 24-bit integers, x_n, + + x_n = d_n + b_n + + where d_n = x_{n-10} - x_{n-24} - c_{n-1}, b_n = 0 if d_n >= 0 and + b_n = 2^24 if d_n < 0, c_n = 0 if d_n >= 0 and c_n = 1 if d_n < 0, + where after 24 samples a group of p integers are "skipped", to + reduce correlations. By default p = 199, but can be increased to + 365. + + The period of the generator is around 10^171. + + From: M. Luescher, "A portable high-quality random number generator + for lattice field theory calculations", Computer Physics + Communications, 79 (1994) 100-110. + + Available on the net as hep-lat/9309020 at http://xxx.lanl.gov/ + + See also, + + F. James, "RANLUX: A Fortran implementation of the high-quality + pseudo-random number generator of Luscher", Computer Physics + Communications, 79 (1994) 111-114 + + Kenneth G. Hamilton, F. James, "Acceleration of RANLUX", Computer + Physics Communications, 101 (1997) 241-248 + + Kenneth G. Hamilton, "Assembler RANLUX for PCs", Computer Physics + Communications, 101 (1997) 249-253 */ + +namespace siscone{ + +/// initialize 'ranlux' generator +void ranlux_init(); + +/// generate random value (24 bits) +unsigned long int ranlux_get(); + +/// save state of the generator +void ranlux_print_state(); + +} +#endif Property changes on: tags/siscone-3.0.5/siscone/ranlux.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/split_merge.h =================================================================== --- tags/siscone-3.0.5/siscone/split_merge.h (revision 0) +++ tags/siscone-3.0.5/siscone/split_merge.h (revision 426) @@ -0,0 +1,477 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: split_merge.h // +// Description: header file for splitting/merging (contains the CJet class) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __SPLIT_MERGE_H__ +#define __SPLIT_MERGE_H__ + +#include +#include "defines.h" +#include "geom_2d.h" +#include "momentum.h" +#include +#include +#include +#include +#include + +namespace siscone{ + +const int CJET_INEXISTENT_PASS = -2; + +/** + * \class Cjet + * real Jet information. + * + * This class contains information for one single jet. + * That is, first, its momentum carrying information + * about its centre and pT, and second, its particle + * contents + */ +class Cjet{ + public: + /// default ctor + Cjet(); + + /// default dtor + ~Cjet(); + + Cmomentum v; ///< jet momentum + double pt_tilde; ///< p-scheme pt + int n; ///< number of particles inside + std::vector contents; ///< particle contents (list of indices) + + /// ordering variable used for ordering and overlap in the + /// split--merge. This variable is automatically set either to + /// pt_tilde, or to mt or to pt, depending on the siscone + /// parameter. Note that the default behaviour is pt_tilde and that + /// other chices may lead to infrared unsafe situations. + /// Note: we use the square of the varible rather than the variable itself + double sm_var2; + + /// covered range in eta-phi + Ceta_phi_range range; + + /// pass at which the jet has been found + /// It starts at 0 (first pass), -1 means infinite rapidity + /// (it will be initialised to "CJET_INEXISTENT_PASS" which should + /// never appear after clustering) + int pass; +}; + +/// ordering of jets in pt (e.g. used in final jets ordering) +bool jets_pt_less(const Cjet &j1, const Cjet &j2); + + +/// the choices of scale variable that can be used in the split-merge +/// step, both for ordering the protojets and for measuing their +/// overlap; pt, Et and mt=sqrt(pt^2+m^2) are all defined in E-scheme +/// (4-momentum) recombination; pttilde = \sum_{i\in jet} |p_{t,i}| +/// +/// NB: if one changes the order here, one _MUST_ also change the order +/// in the SISCone plugin +enum Esplit_merge_scale { + SM_pt, ///< transverse momentum (E-scheme), IR unsafe + SM_Et, ///< transverse energy (E-scheme), not long. boost inv. + ///< original run-II choice [may not be implemented] + SM_mt, ///< transverse mass (E-scheme), IR safe except + ///< in decays of two identical narrow heavy particles + SM_pttilde ///< pt-scheme pt = \sum_{i in jet} |p_{ti}|, should + ///< be IR safe in all cases +}; + +/// return the name of the split-merge scale choice +std::string split_merge_scale_name(Esplit_merge_scale sms); + +/** + * \class Csplit_merge_ptcomparison + * comparison of jets for split--merge ordering + * + * a class that allows us to carry out comparisons of pt of jets, using + * information from exact particle contents where necessary. + */ +class Csplit_merge_ptcomparison{ +public: + /// default ctor + Csplit_merge_ptcomparison() : + particles(0), split_merge_scale(SM_pttilde){}; + + /// return the name corresponding to the SM scale variable + std::string SM_scale_name() const { + return split_merge_scale_name(split_merge_scale);} + + std::vector * particles; ///< pointer to the list of particles + std::vector * pt; ///< pointer to the pt of the particles + + /// comparison between 2 jets + bool operator()(const Cjet &jet1, const Cjet &jet2) const; + + /** + * get the difference between 2 jets, calculated such that rounding + * errors will not affect the result even if the two jets have + * almost the same content (so that the difference is below the + * rounding errors) + * + * \param j1 first jet + * \param j2 second jet + * \param v jet1-jet2 + * \param pt_tilde jet1-jet2 pt_tilde + */ + void get_difference(const Cjet &j1, const Cjet &j2, Cmomentum *v, double *pt_tilde) const; + + /// the following parameter controls the variable we're using for + /// the split-merge process i.e. the variable we use for + /// 1. ordering jet candidates; + /// 2. computing the overlap fraction of two candidates. + /// The default value uses pttile (p-scheme pt). Other alternatives are + /// pt, mt=sqrt(pt^2+m^2)=sqrt(E^2-pz^2) or Et. + /// NOTE: Modifying the default choice can have nasty effects: + /// - using pt leads to some IR unsafety when we have two jets, + /// e.g. back-to-back, with the same pt. In that case, their ordering + /// in pt is random and can be affected by the addition of a + /// soft particle. Hence, we highly recommand to keep this to + /// the default value i.e. to use pt only for the purpose of + /// investigating the IR issue + /// - using Et is safe but does not respect boost invariance + /// - using mt solves the IR unsafety issues with the pt variable + /// for QCD jets but the IR unsafety remains for nack-to-back + /// jets of unstable narrow-width particles (e.g. Higgs). + /// Therefore, keeping the default value is strongly advised. + Esplit_merge_scale split_merge_scale; +}; + + +// iterator types +/// iterator definition for the jet candidates structure +typedef std::multiset::iterator cjet_iterator; + +/// iterator definition for the jet structure +typedef std::vector::iterator jet_iterator; + + + +/** + * \class Csplit_merge + * Class used to split and merge jets. + */ +class Csplit_merge{ + public: + /// default ctor + Csplit_merge(); + + /// default dtor + ~Csplit_merge(); + + + ////////////////////////////// + // initialisation functions // + ////////////////////////////// + + /** + * initialisation function + * \param _particles list of particles + * \param protocones list of protocones (initial jet candidates) + * \param R2 cone radius (squared) + * \param ptmin minimal pT allowed for jets + * \return 0 on success, 1 on error + */ + int init(std::vector &_particles, std::vector *protocones, double R2, double ptmin=0.0); + + /** + * initialisation function for particle list + * \param _particles list of particles + * \return 0 on success, 1 on error + */ + int init_particles(std::vector &_particles); + + /** + * build initial list of left particles + */ + int init_pleft(); + + /** + * use a pt-dependent boundary for splitting + * When called with true, the criterium for splitting two protojets + * will be to compare D1^2/kt1^2 vs. D2^2/kt2^2, the (anti-)kt-weighted + * distance instead of the plain distance D1^2 vs. D2^2. + * This can be set in order to produce more circular hard jets, + * with the same underlying philosophy as for the anti-kt algorithm. + * We thus expect a behaviour closer to the IterativeCone one. + * By default, we use the standard D1^2 vs. D2^2 comparison and this + * function is not called. + */ + inline int set_pt_weighted_splitting(bool _use_pt_weighted_splitting){ + use_pt_weighted_splitting = _use_pt_weighted_splitting; + return 0; + } + + //////////////////////// + // cleaning functions // + //////////////////////// + + /// partial clearance + int partial_clear(); + + /// full clearance + int full_clear(); + + /////////////////////////////////////// + // user-defined stable-cone ordering // + /////////////////////////////////////// + + /// \class Cuser_scale_base + /// base class for user-defined ordering of stable cones + /// + /// derived classes have to implement the () operator that returns + /// the scale associated with a given jet. + class Cuser_scale_base{ + public: + /// empty virtual dtor + virtual ~Cuser_scale_base(){} + + /// the scale associated with a given jet + /// + /// "progressive removal" iteratively removes the stable cone with + /// the largest scale + virtual double operator()(const Cjet & jet) const = 0; + + /// returns true when the scale associated with jet a is larger than + /// the scale associated with jet b + /// + /// By default this does a simple direct comparison but it can be + /// overloaded for higher precision [recommended if possible] + /// + /// This function assumes that a.sm_var2 and b.sm_var2 have been + /// correctly initialised with the signed squared output of + /// operator(), as is by default the case when is_larger is called + /// from within siscone. + virtual bool is_larger(const Cjet & a, const Cjet & b) const{ + return (a.sm_var2 > b.sm_var2); + } + }; + + /// associate a user-defined scale to order the stable cones + /// + /// Note that this is only used in "progressive-removal mode", + /// e.g. in add_hardest_protocone_to_jets(). + void set_user_scale(const Cuser_scale_base * user_scale_in){ + _user_scale = user_scale_in; + } + + /// return the user-defined scale (NULL if none) + const Cuser_scale_base * user_scale() const { return _user_scale; } + + + ///////////////////////////////// + // main parts of the algorithm // + ///////////////////////////////// + + /** + * build the list 'p_uncol_hard' from p_remain by clustering + * collinear particles and removing particles softer than + * stable_cone_soft_pt2_cutoff + * note that thins in only used for stable-cone detection + * so the parent_index field is unnecessary + */ + int merge_collinear_and_remove_soft(); + + /** + * add a list of protocones + * \param protocones list of protocones (initial jet candidates) + * \param R2 cone radius (squared) + * \param ptmin minimal pT allowed for jets + * \return 0 on success, 1 on error + */ + int add_protocones(std::vector *protocones, double R2, double ptmin=0.0); + + /** + * remove the hardest protocone and declare it a jet + * \param protocones list of protocones (initial jet candidates) + * \param R2 cone radius (squared) + * \param ptmin minimal pT allowed for jets + * \return 0 on success, 1 on error + * + * The list of remaining particles (and the uncollinear-hard ones) + * is updated. + */ + int add_hardest_protocone_to_jets(std::vector *protocones, double R2, double ptmin=0.0); + + /** + * really do the splitting and merging + * At the end, the vector jets is filled with the jets found. + * the 'contents' field of each jets contains the indices + * of the particles included in that jet. + * \param overlap_tshold threshold for splitting/merging transition + * \param ptmin minimal pT allowed for jets + * \return the number of jets is returned + */ + int perform(double overlap_tshold, double ptmin=0.0); + + + ////////////////////////////// + // save and debug functions // + ////////////////////////////// + + /// save final jets + /// \param flux stream to save the jet contentss + int save_contents(FILE *flux); + + /// show jets/candidates status + int show(); + + // particle information + int n; ///< number of particles + std::vector particles; ///< list of particles + std::vector pt; ///< list of particles' pt + int n_left; ///< numer of particles that does not belong to any jet + std::vector p_remain; ///< list of particles remaining to deal with + std::vector p_uncol_hard; ///< list of particles remaining with collinear clustering + int n_pass; ///< index of the run + + /// minimal difference in squared distance between a particle and + /// two overlapping protojets when doing a split (useful when + /// testing approx. collinear safety) + double most_ambiguous_split; + + // jets information + std::vector jets; ///< list of jets + + // working entries + int *indices; ///< maximal size array for indices works + int idx_size; ///< number of elements in indices1 + + /// The following flag indicates that identical protocones + /// are to be merged automatically each time around the split-merge + /// loop and before anything else happens. + /// + /// This flag is only effective if ALLOW_MERGE_IDENTICAL_PROTOCONES + /// is set in 'defines.h' + /// Note that this lead to infrared-unsafety so it is disabled + /// by default + bool merge_identical_protocones; + + /// member used for detailed comparisons of pt's + Csplit_merge_ptcomparison ptcomparison; + + /// stop split--merge or progressive-removal when the squared SM_var + /// of the hardest protojet is below this cut-off. Note that this is + /// a signed square (ie SM_var*|SM_var|) to be able to handle + /// negative values. + /// + /// Note that the cut-off is set on the variable squared. + double SM_var2_hardest_cut_off; + + /// pt cutoff for the particles to put in p_uncol_hard + /// this is meant to allow removing soft particles in the + /// stable-cone search. + /// + /// This is not collinear-safe so you should not use this + /// variable unless you really know what you are doing + /// Note that the cut-off is set on the variable squared. + double stable_cone_soft_pt2_cutoff; + + private: + /** + * get the overlap between 2 jets + * \param j1 first jet + * \param j2 second jet + * \param v returned overlap^2 (determined by the choice of SM variable) + * \return true if overlapping, false if disjoint + */ + bool get_overlap(const Cjet &j1, const Cjet &j2, double *v); + + + /** + * split the two given jets. + * during this procedure, the jets j1 & j2 are replaced + * by 2 new jets. Common particles are associted to the + * closest initial jet. + * \param it_j1 iterator of the first jet in 'candidates' + * \param it_j2 iterator of the second jet in 'candidates' + * \param j1 first jet (Cjet instance) + * \param j2 second jet (Cjet instance) + * \return true on success, false on error + */ + bool split(cjet_iterator &it_j1, cjet_iterator &it_j2); + + /** + * merge the two given jet. + * during this procedure, the jets j1 & j2 are replaced + * by 1 single jets containing both of them. + * \param it_j1 iterator of the first jet in 'candidates' + * \param it_j2 iterator of the second jet in 'candidates' + * \return true on success, false on error + */ + bool merge(cjet_iterator &it_j1, cjet_iterator &it_j2); + + /** + * Check whether or not a jet has to be inserted in the + * list of protojets. If it has, set its sm_variable and + * insert it to the list of protojets. + * \param jet jet to insert + */ + bool insert(Cjet &jet); + + /** + * given a 4-momentum and its associated pT, return the + * variable tht has to be used for SM + * \param v 4 momentum of the protojet + * \param pt_tilde pt_tilde of the protojet + */ + double get_sm_var2(Cmomentum &v, double &pt_tilde); + + // jet information + /// list of jet candidates +#ifdef SISCONE_USES_UNIQUE_PTR_AS_AUTO_PTR + std::unique_ptr > candidates; +#else + std::auto_ptr > candidates; +#endif + + /// minimal pt2 + double pt_min2; + + /** + * do we have or not to use the pt-weighted splitting + * (see description for set_pt_weighted_splitting) + * This will be false by default + */ + bool use_pt_weighted_splitting; + + /// use a user-defined scale to order the stable cones and jet + /// candidates + const Cuser_scale_base *_user_scale; + +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + /// checkxor for the candidates (to avoid having twice the same contents) + std::set cand_refs; +#endif +}; + +} + + +#endif Property changes on: tags/siscone-3.0.5/siscone/split_merge.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/quadtree.h =================================================================== --- tags/siscone-3.0.5/siscone/quadtree.h (revision 0) +++ tags/siscone-3.0.5/siscone/quadtree.h (revision 426) @@ -0,0 +1,124 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: quadtree.h // +// Description: header file for quadtree management (Cquadtree class) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __QUADTREE_H__ +#define __QUADTREE_H__ + +#include "momentum.h" +#include + +namespace siscone{ + +/** + * \class Cquadtree + * \brief Implementation of a 2D quadtree. + * + * This class implements the traditional two-dimensional quadtree. + * The elements at each node are of 'Cmomentum' type. + */ +class Cquadtree{ + public: + /// default ctor + Cquadtree(); + + /// ctor with initialisation (see init for details) + Cquadtree(double _x, double _y, double _half_size_x, double _half_size_y); + + /// default destructor + /// at destruction, everything is destroyed except + /// physical values at the leaves + ~Cquadtree(); + + /** + * init the tree. + * By initializing the tree, we mean setting the cell parameters + * and preparing the object to act as a seed for a new tree. + * \param _x x-position of the center + * \param _y y-position of the center + * \param _half_size_x x-size of the cell + * \param _half_size_y y-size of the cell + * \return 0 on success, 1 on error. Note that if the cell or its + * parent is already filled, we return an error. + */ + int init(double _x, double _y, double _half_size_x, double _half_size_y); + + /** + * adding a particle to the tree. + * This method adds one vector to the quadtree structure which + * is updated consequently. + * \param v_add vector to add + * \return 0 on success 1 on error + */ + int add(Cmomentum *v_add); + + /** + * circle intersection. + * computes the intersection with a circle of given centre and radius. + * The output takes the form of a quadtree with all squares included + * in the circle. + * \param cx circle centre x coordinate + * \param cy circle centre y coordinate + * \param cR2 circle radius SQUARED + * \return the checksum for that intersection + */ + Creference circle_intersect(double cx, double cy, double cR2); + + /** + * output a data file for drawing the grid. + * This can be used to output a data file containing all the + * grid subdivisions. The file contents is as follows: + * first and second columns give center of the cell, the third + * gives the size. + * \param flux opened stream to write to + * \return 0 on success, 1 on error + */ + int save(FILE *flux); + + /** + * output a data file for drawing the tree leaves. + * This can be used to output a data file containing all the + * tree leaves. The file contents is as follows: + * first and second columns give center of the cell, the third + * gives the size. + * \param flux opened stream to write to + * \return 0 on success, 1 on error + */ + int save_leaves(FILE *flux); + + double centre_x; ///< x-position of the centre of the cell + double centre_y; ///< y-position of the centre of the cell + double half_size_x; ///< HALF size of the cell + double half_size_y; ///< HALF size of the cell + + Cmomentum *v; ///< physical contents + + Cquadtree* children[2][2]; ///< sub-cells ( 0,1->left-right; 0,1->bottom,top) + bool has_child; ///< true if not a leaf +}; + +} +#endif Property changes on: tags/siscone-3.0.5/siscone/quadtree.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/siscone_error.h =================================================================== --- tags/siscone-3.0.5/siscone/siscone_error.h (revision 0) +++ tags/siscone-3.0.5/siscone/siscone_error.h (revision 426) @@ -0,0 +1,64 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: siscone_error.h // +// Description: header file for SISCone error messages (Csiscone_error) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __SISCONE_ERROR_H__ +#define __SISCONE_ERROR_H__ + +#include +#include + +namespace siscone{ + +/// \class Csiscone_error +/// class corresponding to errors that will be thrown by siscone +class Csiscone_error { +public: + /// default ctor + Csiscone_error() {;}; + + /// ctor with a given error message + /// \param message_in the error message to be printed + Csiscone_error(const std::string & message_in) { + m_message = message_in; + if (m_print_errors) std::cerr << "siscone::Csiscone_error: "<< message_in << std::endl; + }; + + /// access to the error message + std::string message() const {return m_message;}; + + /// switch on/off the error message printing + /// \param print_errors errors will be printed when true + static void setm_print_errors(bool print_errors) { + m_print_errors = print_errors;}; + +private: + std::string m_message; ///< the error message + static bool m_print_errors; ///< do we print error messages? +}; + +} +#endif Property changes on: tags/siscone-3.0.5/siscone/siscone_error.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/geom_2d.h =================================================================== --- tags/siscone-3.0.5/siscone/geom_2d.h (revision 0) +++ tags/siscone-3.0.5/siscone/geom_2d.h (revision 426) @@ -0,0 +1,179 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: geom_2d.h // +// Description: header file for two-dimensional geometry tools // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __GEOM_2D_H__ +#define __GEOM_2D_H__ + +#include +#include +#include "defines.h" + +#ifndef M_PI +#define M_PI 3.141592653589793238462643383279502884197 +#endif + +namespace siscone{ + +/// return a result that corresponds to phi, but in the +/// range (-pi..pi]; the result is only correct if -3pi < phi <= 3pi +inline double phi_in_range(double phi) { + if (phi <= -M_PI) phi += twopi; + else if (phi > M_PI) phi -= twopi; + return phi; +} + +/// return the difference between the two phi values, +/// placed in the correct range (-pi..pi], , assuming that phi1,phi2 +/// are already in the correct range. +inline double dphi(double phi1, double phi2) { + return phi_in_range(phi1-phi2); +} + + +/// return the absolute difference between the two phi values, +/// placed in the correct range, assuming that phi1,phi2 are already +/// in the correct range. +inline double abs_dphi(double phi1, double phi2) { + double delta = fabs(phi1-phi2); + return delta > M_PI ? twopi-delta : delta; +} + +/// return the square of the argument +inline double pow2(double x) {return x*x;} + + +/** + * \class Ctwovect + * \brief class for holding a two-vector + */ +class Ctwovect { +public: + /// default ctor + Ctwovect() : x(0.0), y(0.0) {} + + /// ctor with initialisation + /// \param _x first coordinate + /// \param _y second coordinate + Ctwovect(double _x, double _y) : x(_x), y(_y) {} + + /// vector coordinates + double x, y; + + /// norm (modulud square) of the vector + inline double mod2() const {return pow2(x)+pow2(y);} + + /// modulus of the vector + inline double modulus() const {return sqrt(mod2());} +}; + + +/// dot product of two 2-vectors +/// \param a first 2-vect +/// \param b second 2-vect +/// \return a.b is returned +inline double dot_product(const Ctwovect & a, const Ctwovect & b) { + return a.x*b.x + a.y*b.y; +} + + +/// cross product of two 2-vectors +/// \param a first 2-vect +/// \param b second 2-vect +/// \return a x b is returned +inline double cross_product(const Ctwovect & a, const Ctwovect & b) { + return a.x*b.y - a.y*b.x; +} + + +/** + * \class Ceta_phi_range + * \brief class for holding a covering range in eta-phi + * + * This class deals with ranges in the eta-phi plane. It + * implements methods to test if two ranges overlap and + * to take the union of two overlapping intervals. + */ +class Ceta_phi_range{ +public: + /// default ctor + Ceta_phi_range(); + + /// ctor with initialisation + /// we initialise with a centre (in eta,phi) and a radius + /// \param c_eta eta coordinate of the centre + /// \param c_phi phi coordinate of the centre + /// \param R radius + Ceta_phi_range(double c_eta, double c_phi, double R); + + /// assignment of range + /// \param r range to assign to current one + Ceta_phi_range& operator = (const Ceta_phi_range &r); + + /// add a particle to the range + /// \param eta eta coordinate of the particle + /// \param phi phi coordinate of the particle + /// \return 0 on success, 1 on error + int add_particle(const double eta, const double phi); + + /// eta range as a binary coding of covered cells + unsigned int eta_range; + + /// phi range as a binary coding of covered cells + unsigned int phi_range; + + // extremal value for eta + static double eta_min; ///< minimal value for eta + static double eta_max; ///< maximal value for eta + +private: + /// return the cell index corrsponding to an eta value + inline unsigned int get_eta_cell(double eta){ + return (unsigned int) (1u << ((int) (32*((eta-eta_min)/(eta_max-eta_min))))); + } + + /// return the cell index corrsponding to a phi value + inline unsigned int get_phi_cell(double phi){ + return (unsigned int) (1u << ((int) (32*phi/twopi+16)%32)); + } +}; + +/// test overlap +/// \param r1 first range +/// \param r2 second range +/// \return true if overlap, false otherwise. +bool is_range_overlap(const Ceta_phi_range &r1, const Ceta_phi_range &r2); + +/// compute union +/// Note: we assume that the two intervals overlap +/// \param r1 first range +/// \param r2 second range +/// \return union of the two ranges +const Ceta_phi_range range_union(const Ceta_phi_range &r1, const Ceta_phi_range &r2); + +} + +#endif Property changes on: tags/siscone-3.0.5/siscone/geom_2d.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Revision \ No newline at end of property Index: tags/siscone-3.0.5/siscone/defines.h =================================================================== --- tags/siscone-3.0.5/siscone/defines.h (revision 0) +++ tags/siscone-3.0.5/siscone/defines.h (revision 426) @@ -0,0 +1,128 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: defines.h // +// Description: header file for generic parameters definitions // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +//! \file defines.h +#ifndef __DEFINES_H__ +#define __DEFINES_H__ + +/// program name +// we get "SISCone" by calling +// siscone::siscone_package_name +// defined in siscone.h +// Otherwise, config.h +// It is also defined as "SISCONE_PACKAGE_NAME" in config.h but this method +// might lead to conflicts +//#define PROGRAM SISCONE_PACKAGE_NAME + +// program version +// we get it from +// siscone::siscone_version +// defined in siscone.h +// It is also defined as "SISCONE_VERSION" in config.h but this method +// might lead to conflicts + +/// perform final stability check using the quadtree +/// With the following define enabled, the final check for stability +/// is performed using the quadtree rather than the explicit list of +/// particles (see Cstable_cone::proceed_with_stability()) +//#define USE_QUADTREE_FOR_STABILITY_TEST + + +/// threshold for recomoutation of the cone (see Cstable_cones::update_cone()) +/// When traversing cone candidates along the angular ordering, +/// the momentum of the protojet candidate is computed incrementally +/// from the particles that enter and leave the cone. +/// When the cumulative change in "|px|+|py|" exceeds the cone "|px|+|py|" +/// we explicitely recompute the cone contents +#define PT_TSHOLD 1000.0 + + +/// The following parameter controls collinear safety. For the set of +/// particles used in the search of stable cones, we gather particles +/// if their distance in eta and phi is smaller than EPSILON_COLLINEAR. +/// +/// NB: for things to behave sensibly one requires +/// 1e-15 << EPSILON_COCIRCULAR << EPSILON_COLLINEAR << 1 +/// +/// among the scales that appear in practice (e.g. in deciding to use +/// special strategies), we have EPSILON_COLLINEAR, EPSILON_COCIRCULAR, +/// sqrt(EPSILON_COCIRCULAR) and EPSILON_COLLINEAR / EPSILON_COCIRCULAR. +/// +#define EPSILON_COLLINEAR 1e-8 + + +/// The following parameter controls cocircular situations. +/// When consecutive particles in the ordered vicinity list are separated +/// (in angle) by less that that limit, we consider that we face a situation +/// of cocircularity. +#define EPSILON_COCIRCULAR 1e-12 + + +/// The following define enables you to allow for identical protocones +/// to be merged automatically after each split-merge step before +/// anything else happens. Whether this happens depends on teh value +/// of the merge_identical_protocones flag in Csplit_merge. +/// +/// It we allow such a merging and define allow +/// MERGE_IDENTICAL_PROTOCONES_DEFAULT_TRUE then the +/// 'merge_identical_protocones' flag in Csplit_merge to be set to +/// 'true'. It may be manually reset to false in which case the +/// merging of identical protocones (protojets) will be turned off. +/// +/// Note that this merging identical protocones makes the algorithm +/// infrared-unsafe, so it should be disabled except for testing +/// purposes. +//#define ALLOW_MERGE_IDENTICAL_PROTOCONES +//#define MERGE_IDENTICAL_PROTOCONES_DEFAULT_TRUE + + +/// if EPSILON_SPLITMERGE is defined then, during the split-merge +/// step, when two jets are found with PTs that are identical to +/// within a relative difference of EPSILON_SPLITMERGE they are +/// compared element-by-element to see where the differences are, and +/// one then uses pt1^2-pt2^2 = (pt1-pt2).(pt1+pt2) as an estimator of +/// which is harder. NB: in unfortunate cases, this can take the split +/// merge step up to N n * ln N time, though on normal events there +/// don't seem to have been any major problems yet. +#define EPSILON_SPLITMERGE 1e-12 + +/// definition of 2*M_PI which is useful a bit everyhere! +const double twopi = 6.283185307179586476925286766559005768394; + +/// debugging information +//#define DEBUG_STABLE_CONES ///< debug messages in stable cones search +//#define DEBUG_SPLIT_MERGE ///< debug messages in split-merge +//#define DEBUG ///< all debug messages ! + +// in case all debug massages allowed, allow them in practice ! +#ifdef DEBUG +#define DEBUG_STABLE_CONES +#define DEBUG_SPLIT_MERGE +#endif + +#endif // __DEFINES_H__ + Property changes on: tags/siscone-3.0.5/siscone/defines.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/makefile.static =================================================================== --- tags/siscone-3.0.5/siscone/makefile.static (revision 0) +++ tags/siscone-3.0.5/siscone/makefile.static (revision 426) @@ -0,0 +1,58 @@ +SUBDIRS = spherical +CC = g++ +LIBOUT = libsiscone.a +CFLAGS = -Wall -g -O3 -ffast-math + +LDFLAGS = -lm #-lprofiler -lpthread -ltcmalloc +ifeq ($(shell whoami),salam) + # needed for Gavin to include tcmalloc + LDFLAGS += -L/ada1/lpthe/salam/software/local/lib +endif + +OBJS = ranlux.o reference.o geom_2d.o momentum.o hash.o quadtree.o \ + vicinity.o protocones.o split_merge.o siscone.o siscone_error.o area.o + +SRCS = $(patsubst %.o,%.cpp,$(OBJS)) + + +%.o: %.cpp %.h + $(CC) -c $(CFLAGS) $< + +%.o: %.cpp + $(CC) -c $(CFLAGS) $< + +all: $(OBJS) $(SUBDIRS) + ar cru $(LIBOUT) $(OBJS) + ranlib $(LIBOUT) + +.PHONY: clean $(SUBDIRS) + +clean: $(SUBDIRS) + rm -f *.o *~ + +spherical: + @cd spherical && $(MAKE) -f makefile.static $(MAKECMDGOALS) + +# note the -Y option below avoids including all the standard +# include directories (which change from one system to another) +depend: $(SUBDIRS) + makedepend -f makefile.static -- -Y -- $(SRCS) +# DO NOT DELETE + +ranlux.o: ranlux.h +reference.o: reference.h ranlux.h +geom_2d.o: geom_2d.h defines.h +momentum.o: momentum.h reference.h geom_2d.h defines.h +hash.o: hash.h momentum.h reference.h geom_2d.h defines.h +quadtree.o: quadtree.h momentum.h reference.h geom_2d.h defines.h +vicinity.o: vicinity.h momentum.h reference.h geom_2d.h defines.h quadtree.h +protocones.o: protocones.h momentum.h reference.h geom_2d.h defines.h +protocones.o: vicinity.h quadtree.h hash.h siscone_error.h circulator.h +split_merge.o: split_merge.h defines.h geom_2d.h momentum.h reference.h +split_merge.o: siscone_error.h +siscone.o: config.h ranlux.h momentum.h reference.h geom_2d.h defines.h +siscone.o: siscone.h protocones.h vicinity.h quadtree.h hash.h split_merge.h +siscone.o: siscone_error.h +siscone_error.o: siscone_error.h +area.o: area.h momentum.h reference.h geom_2d.h defines.h siscone.h +area.o: protocones.h vicinity.h quadtree.h hash.h split_merge.h Index: tags/siscone-3.0.5/siscone/hash.cpp =================================================================== --- tags/siscone-3.0.5/siscone/hash.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/hash.cpp (revision 426) @@ -0,0 +1,230 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: hash.cpp // +// Description: source file for classes hash_element and hash_cones // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include "hash.h" +#include + +namespace siscone{ + +using namespace std; + +/************************************************************** + * implementation of hash_cones * + * list of cones candidates. * + * We store in this class all the hash_elements and give * + * functions to manipulate them. * + **************************************************************/ + +// constructor with initialisation +// - _Np number of particles +// - _R2 cone radius (squared) +//----------------------------------- +hash_cones::hash_cones(int _Np, double _R2){ + int i; + + n_cones = 0; +#ifdef DEBUG_STABLE_CONES + n_occupied_cells = 0; +#endif + + // determine hash size + // for a ymax=5 and R=0.7, we observed an occupancy around 1/8 N^2 ~ N2 R2/4 + //mask = 1 << (int) (2*log(double(_Np))/log(2.0)); + //if (mask<=1) mask=2; + int nbits = (int) (log(_Np*_R2*_Np/4.0)/log(2.0)); + if (nbits<1) nbits=1; + mask = 1 << nbits; + + // create hash + hash_array = new hash_element*[mask]; + mask--; + + // set the array to 0 + //? needed ? + for (i=0;inext; + delete elm; + } + } + + delete[] hash_array; +} + + +/* + * insert a new candidate into the hash. + * - v 4-momentum of the cone to add + * - parent parent particle defining the cone + * - child child particle defining the cone + * - p_io whether the parent has to belong to the cone or not + * - c_io whether the child has to belong to the cone or not + * return 0 on success, 1 on error + ***********************************************************************/ +int hash_cones::insert(Cmomentum *v, Cmomentum *parent, Cmomentum *child, bool p_io, bool c_io){ + hash_element *elm; + int index = (v->ref.ref[0]) & mask; + + // check the array cell corresponding to our reference + elm = hash_array[index]; + +#ifdef DEBUG_STABLE_CONES + if (elm==NULL) + n_occupied_cells++; +#endif + + do{ + // if it is not present, add it + if (elm==NULL){ + // create element + elm = new hash_element; + + // set its varibles + // Note: at this level, eta and phi have already been computed + // through Cmomentum::build_etaphi. + elm->ref = v->ref; + + //compute vectors centre + v->build_etaphi(); + elm->eta = v->eta; + elm->phi = v->phi; + // if at least one of the two is_inside tests gives a result != from the expected, + // the || will be true hence !(...) false as wanted + elm->is_stable = !((is_inside(v, parent)^p_io)||(is_inside(v, child)^c_io)); + //cout << "-- new status of " << v->ref[0] << ":" << elm->is_stable << endl; + + // update hash + elm->next = hash_array[index]; + hash_array[index] = elm; + + n_cones++; + return 0; + } + + // if the cone is already there, simply update stability status + if (v->ref == elm->ref){ + // there is only an update to perform to see if the cone is still stable + if (elm->is_stable){ + v->build_etaphi(); + elm->is_stable = !((is_inside(v, parent)^p_io)||(is_inside(v, child)^c_io)); + //cout << " parent/child: " + // << parent->ref[0] << ":" << is_inside(v, parent) << ":" << p_io << " " + // << child->ref[0] << ":" << is_inside(v, child) << ":" << c_io << endl; + //cout << "-- rep status of " << v->ref[0] << ":" << elm->is_stable << endl; + //cout << v->eta << " " << v->phi << endl; + //cout << (child->eta) << " " << child->phi << endl; + } + return 0; + } + + elm = elm->next; + } while (1); + + return 1; +} + +/* + * insert a new candidate into the hash. + * - v 4-momentum of te cone to add + * Note, in this case, we assume stability. We also assume + * that eta and phi are computed for v + * return 0 on success, 1 on error + ***********************************************************************/ +int hash_cones::insert(Cmomentum *v){ + hash_element *elm; + int index = (v->ref.ref[0]) & mask; + //cout << "-- stable candidate: " << v->ref[0] << ":" << endl; + + // check the array cell corresponding to our reference + elm = hash_array[index]; + do{ + // if it is not present, add it + if (elm==NULL){ + // create element + elm = new hash_element; + + // set its varibles + // Note: at this level, eta and phi have already been computed + // through Cmomentum::build_etaphi. + elm->ref = v->ref; + elm->eta = v->eta; + elm->phi = v->phi; + elm->is_stable = true; + + // update hash + elm->next = hash_array[index]; + hash_array[index] = elm; + + n_cones++; + return 0; + } + + // if the cone is already there, we have nothing to do + if (v->ref == elm->ref){ + return 0; + } + + elm = elm->next; + } while (1); + + return 1; +} + +/* + * test if a particle is inside a cone of given centre. + * check if the particle of coordinates 'v' is inside the circle of radius R + * centered at 'centre'. + * - centre centre of the circle + * - v particle to test + * return true if inside, false if outside + ******************************************************************************/ +inline bool hash_cones::is_inside(Cmomentum *centre, Cmomentum *v){ + double dx, dy; + + dx = centre->eta - v->eta; + dy = fabs(centre->phi - v->phi); + if (dy>M_PI) + dy -= 2.0*M_PI; + + return dx*dx+dy*dy +#include +#include "geom_2d.h" +#include "momentum.h" +#include +#include +#include +#include +#include + +namespace siscone_spherical{ + +const int CJET_INEXISTENT_PASS = -2; + +/** + * \class CSphjet + * real Jet information. + * + * This class contains information for one single jet. + * That is, first, its momentum carrying information + * about its centre and pT, and second, its particle + * contents + */ +class CSphjet{ + public: + /// default ctor + CSphjet(); + + /// default dtor + ~CSphjet(); + + CSphmomentum v; ///< jet momentum + double E_tilde; ///< sum of E_i [ 1 +|p_i x p_J|^2/(|p_i|^2 E_J^2)] + int n; ///< number of particles inside + std::vector contents; ///< particle contents (list of indices) + + /// ordering variable used for ordering and overlap in the + /// split--merge. This variable is automatically set either to + /// E_tilde or E depending on the siscone parameter. + /// + /// Note that the default behaviour is E_tilde and that other + /// choices may lead to infrared unsafe situations. + /// + /// Note: we use the square of the varible rather than the variable + /// itself + /// + /// Note 2: for the overlap computation, we shall use the jet energy! + double sm_var2; + + /// covered range in eta-phi + CSphtheta_phi_range range; + + /// pass at which the jet has been found + /// It starts at 0 (first pass), -1 means infinite rapidity + /// (it will be initialised to "CJET_INEXISTENT_PASS" which should + /// never appear after clustering) + int pass; +}; + +/// ordering of jets in pt +///bool jets_pt_less(const CSphjet &j1, const CSphjet &j2); + +/// ordering of jets in energy (e.g. used in final jets ordering) +bool jets_E_less(const CSphjet &j1, const CSphjet &j2); + + +/// the choices of scale variable that can be used in the split-merge +/// step, both for ordering the protojets and for measuing their +/// overlap; E is defined in E-scheme (4-momentum) recombination; +/// Etilde = \sum_{i\in jet} E_i [1+sin^2(theta_{i,jet})] +/// +/// NB: if one changes the order here, one _MUST_ also change the order +/// in the SISCone plugin +enum Esplit_merge_scale { + SM_E, ///< Energy (IR unsafe with momentum conservation) + SM_Etilde ///< sum_{i \in jet} E_i [1+sin^2(theta_iJ)] +}; + +/// return the name of the split-merge scale choice +std::string split_merge_scale_name(Esplit_merge_scale sms); + +/** + * \class CSphsplit_merge_ptcomparison + * a class that allows us to carry out comparisons of pt of jets, using + * information from exact particle contents where necessary. + */ +class CSphsplit_merge_ptcomparison{ +public: + /// default ctor + CSphsplit_merge_ptcomparison() : + particles(0), split_merge_scale(SM_Etilde){}; + + /// return the name corresponding to the SM scale variable + std::string SM_scale_name() const { + return split_merge_scale_name(split_merge_scale);} + + std::vector * particles; ///< pointer to the list of particles + std::vector * particles_norm2; ///< pointer to the particles's norm^2 + + /// comparison of 2 CSphjet + bool operator()(const CSphjet &jet1, const CSphjet &jet2) const; + + /** + * get the difference between 2 jets, calculated such that rounding + * errors will not affect the result even if the two jets have + * almost the same content (so that the difference is below the + * rounding errors) + * + * \param j1 first jet + * \param j2 second jet + * \param v jet1-jet2 + * \param E_tilde jet1-jet2 E_tilde + */ + void get_difference(const CSphjet &j1, const CSphjet &j2, CSphmomentum *v, double *E_tilde) const; + + /// the following parameter controls the variable we're using for + /// the split-merge process i.e. the variable we use for + /// 1. ordering jet candidates; + /// 2. computing the overlap fraction of two candidates. + /// The default value uses Etilde. The other alternative is E + /// NOTE: Modifying the default choice can have nasty effects: + /// - using E is IR-safe for QCD jets but the IR unsafety remains + /// for back-to-back jets of unstable narrow-width particles + /// (e.g. Higgs). + /// Therefore, keeping the default value is strongly advised. + Esplit_merge_scale split_merge_scale; +}; + + +// iterator types +/// iterator definition for the jet candidates structure +typedef std::multiset::iterator cjet_iterator; + +/// iterator definition for the jet structure +typedef std::vector::iterator jet_iterator; + + + +/** + * \class CSphsplit_merge + * Class used to split and merge jets. + */ +class CSphsplit_merge{ + public: + /// default ctor + CSphsplit_merge(); + + /// default dtor + ~CSphsplit_merge(); + + + ////////////////////////////// + // initialisation functions // + ////////////////////////////// + + /** + * initialisation function + * \param _particles list of particles + * \param protocones list of protocones (initial jet candidates) + * \param R2 cone radius (squared) + * \param Emin minimal energy allowed for jets + * \return 0 on success, 1 on error + */ + int init(std::vector &_particles, std::vector *protocones, double R2, double Emin=0.0); + + /** + * initialisation function for particle list + * \param _particles list of particles + * \return 0 on success, 1 on error + */ + int init_particles(std::vector &_particles); + + /** + * build initial list of left particles + */ + int init_pleft(); + + /** + * use an energy-dependent boundary for splitting + * When called with true, the criterium for splitting two protojets + * will be to compare D1^2/kt1^2 vs. D2^2/kt2^2, the (anti-)kt-weighted + * distance instead of the plain distance D1^2 vs. D2^2. + * This can be set in order to produce more circular hard jets, + * with the same underlying philosophy as for the anti-kt algorithm. + * We thus expect a behaviour closer to the IterativeCone one. + * By default, we use the standard D1^2 vs. D2^2 comparison and this + * function is not called. + */ + inline int set_E_weighted_splitting(bool _use_E_weighted_splitting){ + use_E_weighted_splitting = _use_E_weighted_splitting; + return 0; + } + + //////////////////////// + // cleaning functions // + //////////////////////// + + /// partial clearance + int partial_clear(); + + /// full clearance + int full_clear(); + + /////////////////////////////////////// + // user-defined stable-cone ordering // + /////////////////////////////////////// + + /// \class Cuser_scale_base + /// base class for user-defined ordering of stable cones + /// + /// derived classes have to implement the () operator that returns + /// the scale associated with a given jet. + class Cuser_scale_base{ + public: + /// empty virtual dtor + virtual ~Cuser_scale_base(){} + + /// the scale associated with a given jet + /// + /// "progressive removal" iteratively removes the stable cone with + /// the largest scale + virtual double operator()(const CSphjet & jet) const = 0; + + /// returns true when the scale associated with jet a is larger than + /// the scale associated with jet b + /// + /// By default this does a simple direct comparison but it can be + /// overloaded for higher precision [recommended if possible] + /// + /// This function assumes that a.sm_var2 and b.sm_var2 have been + /// correctly initialised with the signed squared output of + /// operator(), as is by default the case when is_larger is called + /// from within siscone. + virtual bool is_larger(const CSphjet & a, const CSphjet & b) const{ + return (a.sm_var2 > b.sm_var2); + } + }; + + /// associate a user-defined scale to order the stable cones + /// + /// Note that this is only used in "progressive-removal mode", + /// e.g. in add_hardest_protocone_to_jets(). + void set_user_scale(const Cuser_scale_base * user_scale_in){ + _user_scale = user_scale_in; + } + + /// return the user-defined scale (NULL if none) + const Cuser_scale_base * user_scale() const { return _user_scale; } + + + ///////////////////////////////// + // main parts of the algorithm // + ///////////////////////////////// + + /** + * build the list 'p_uncol_hard' from p_remain by clustering + * collinear particles + * note that thins in only used for stable-cone detection + * so the parent_index field is unnecessary + * + * Note that soft particles are not removed here + * This is just a remnant from the trunk version + */ + int merge_collinear_and_remove_soft(); + + /** + * add a list of protocones + * \param protocones list of protocones (initial jet candidates) + * \param R2 cone radius (squared) + * \param Emin minimal emergy allowed for jets + * \return 0 on success, 1 on error + */ + int add_protocones(std::vector *protocones, double R2, double Emin=0.0); + + /** + * remove the hardest protocone and declare it a a jet + * \param protocones list of protocones (initial jet candidates) + * \param R2 cone radius (squared) + * \param Emin minimal emergy allowed for jets + * \return 0 on success, 1 on error + * + * The list of remaining particles (and the uncollinear-hard ones) + * is updated. + */ + int add_hardest_protocone_to_jets(std::vector *protocones, double R2, double Emin=0.0); + + /** + * really do the splitting and merging + * At the end, the vector jets is filled with the jets found. + * the 'contents' field of each jets contains the indices + * of the particles included in that jet. + * \param overlap_tshold threshold for splitting/merging transition + * \param Emin minimal energy allowed for jets + * \return the number of jets is returned + */ + int perform(double overlap_tshold, double Emin=0.0); + + + ////////////////////////////// + // save and debug functions // + ////////////////////////////// + + /// save final jets + /// \param flux stream to save the jet contentss + int save_contents(FILE *flux); + + /// show jets/candidates status + int show(); + + // particle information + int n; ///< number of particles + std::vector particles; ///< list of particles + std::vector particles_norm2; ///< norm^2 of the particle (3-vect part) + int n_left; ///< numer of particles that does not belong to any jet + std::vector p_remain; ///< list of particles remaining to deal with + std::vector p_uncol_hard; ///< list of particles remaining with collinear clustering + int n_pass; ///< index of the run + + /// minimal difference in squared distance between a particle and + /// two overlapping protojets when doing a split (useful when + /// testing approx. collinear safety) + double most_ambiguous_split; + + // jets information + std::vector jets; ///< list of jets + + // working entries + int *indices; ///< maximal size array for indices works + int idx_size; ///< number of elements in indices1 + + /// The following flag indicates that identical protocones + /// are to be merged automatically each time around the split-merge + /// loop and before anything else happens. + /// + /// This flag is only effective if ALLOW_MERGE_IDENTICAL_PROTOCONES + /// is set in 'defines.h' + /// Note that this lead to infrared-unsafety so it is disabled + /// by default + bool merge_identical_protocones; + + /// member used for detailed comparisons of pt's + CSphsplit_merge_ptcomparison ptcomparison; + + /// stop split--merge or progressive-removal when the squared SM_var + /// of the hardest protojet is below this cut-off. Note that this is + /// a signed square (ie SM_var*|SM_var|) to be able to handle + /// negative values. + /// + /// Note that the cut-off is set on the variable squared. + double SM_var2_hardest_cut_off; + + /// Energy cutoff for the particles to put in p_uncol_hard + /// this is meant to allow removing soft particles in the + /// stable-cone search. + /// + /// This is not collinear-safe so you should not use this + /// variable unless you really know what you are doing + /// Note that the cut-off is set on the variable squared. + double stable_cone_soft_E2_cutoff; + + private: + /** + * get the overlap between 2 jets + * \param j1 first jet + * \param j2 second jet + * \param v returned overlap^2 (determined by the choice of SM variable) + * \return true if overlapping, false if disjoint + */ + bool get_overlap(const CSphjet &j1, const CSphjet &j2, double *v); + + + /** + * split the two given jets. + * during this procedure, the jets j1 & j2 are replaced + * by 2 new jets. Common particles are associted to the + * closest initial jet. + * \param it_j1 iterator of the first jet in 'candidates' + * \param it_j2 iterator of the second jet in 'candidates' + * \param j1 first jet (CSphjet instance) + * \param j2 second jet (CSphjet instance) + * \return true on success, false on error + */ + bool split(cjet_iterator &it_j1, cjet_iterator &it_j2); + + /** + * merge the two given jet. + * during this procedure, the jets j1 & j2 are replaced + * by 1 single jets containing both of them. + * \param it_j1 iterator of the first jet in 'candidates' + * \param it_j2 iterator of the second jet in 'candidates' + * \return true on success, false on error + */ + bool merge(cjet_iterator &it_j1, cjet_iterator &it_j2); + + /** + * Check whether or not a jet has to be inserted in the + * list of protojets. If it has, set its sm_variable and + * insert it to the list of protojets. + * \param jet jet to insert + */ + bool insert(CSphjet &jet); + + /** + * given a 4-momentum and its associated pT, return the + * variable tht has to be used for SM + * \param v 4 momentum of the protojet + * \param E_tilde E_tilde of the protojet + */ + double get_sm_var2(CSphmomentum &v, double &E_tilde); + + /// compute Etilde for a given jet + void compute_Etilde(CSphjet &j); + + // jet information + /// list of jet candidates +#ifdef SISCONE_USES_UNIQUE_PTR_AS_AUTO_PTR + std::unique_ptr > candidates; +#else + std::auto_ptr > candidates; +#endif + + /// minimal E + double E_min; + + /** + * do we have or not to use the energy-weighted splitting + * (see description for set_E_weighted_splitting) + * This will be false by default + */ + bool use_E_weighted_splitting; + + /// use a user-defined scale to order the stable cones and jet + /// candidates + const Cuser_scale_base *_user_scale; + +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + /// checkxor for the candidates (to avoid having twice the same contents) + std::set cand_refs; +#endif +}; + +} + + +#endif Property changes on: tags/siscone-3.0.5/siscone/spherical/split_merge.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/geom_2d.h =================================================================== --- tags/siscone-3.0.5/siscone/spherical/geom_2d.h (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/geom_2d.h (revision 426) @@ -0,0 +1,112 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: geom_2d.h // +// Description: header file for two-dimensional geometry tools // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __SPH_GEOM_2D_H__ +#define __SPH_GEOM_2D_H__ + +#include +#include +#include +#include + +#ifndef M_PI +#define M_PI 3.141592653589793238462643383279502884197 +#endif + +namespace siscone_spherical{ + +/** + * \class CSphtheta_phi_range + * \brief class for holding a covering range in eta-phi + * + * This class deals with ranges in the eta-phi plane. It + * implements methods to test if two ranges overlap and + * to take the union of two overlapping intervals. + */ +class CSphtheta_phi_range{ +public: + /// default ctor + CSphtheta_phi_range(); + + /// ctor with initialisation + /// we initialise with a centre (in theta,phi) and a radius + /// \param c_theta theta coordinate of the centre + /// \param c_phi phi coordinate of the centre + /// \param R radius + CSphtheta_phi_range(double c_theta, double c_phi, double R); + + /// assignment of range + /// \param r range to assign to current one + CSphtheta_phi_range& operator = (const CSphtheta_phi_range &r); + + /// add a particle to the range + /// \param theta theta coordinate of the particle + /// \param phi phi coordinate of the particle + /// \return 0 on success, 1 on error + int add_particle(const double theta, const double phi); + + /// theta range as a binary coding of covered cells + unsigned int theta_range; + + /// phi range as a binary coding of covered cells + unsigned int phi_range; + + /// extremal value for theta + static double theta_min; ///< minimal value for theta (set to 0) + static double theta_max; ///< maximal value for theta (set to pi) + +private: + /// return the cell index corrsponding to a theta value + inline unsigned int get_theta_cell(double theta){ + if (theta>=theta_max) return 1u<<31; + return (unsigned int) (1u << ((int) (32*((theta-theta_min)/(theta_max-theta_min))))); + } + + /// return the cell index corrsponding to a phi value + inline unsigned int get_phi_cell(double phi){ + return (unsigned int) (1u << ((int) (32*phi/twopi+16)%32)); + } +}; + +/// test overlap +/// \param r1 first range +/// \param r2 second range +/// \return true if overlap, false otherwise. +bool is_range_overlap(const CSphtheta_phi_range &r1, const CSphtheta_phi_range &r2); + +/// compute union +/// Note: we assume that the two intervals overlap +/// \param r1 first range +/// \param r2 second range +/// \return union of the two ranges +const CSphtheta_phi_range range_union(const CSphtheta_phi_range &r1, const CSphtheta_phi_range &r2); + +} + +#endif Property changes on: tags/siscone-3.0.5/siscone/spherical/geom_2d.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Revision \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/makefile.static =================================================================== --- tags/siscone-3.0.5/siscone/spherical/makefile.static (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/makefile.static (revision 426) @@ -0,0 +1,64 @@ +CC = g++ +LIBOUT = libsiscone_spherical.a +CFLAGS = -Wall -g -O3 -ffast-math -I../.. + +LDFLAGS = -lm #-lprofiler -lpthread -ltcmalloc +ifeq ($(shell whoami),salam) + # needed for Gavin to include tcmalloc + LDFLAGS += -L/ada1/lpthe/salam/software/local/lib +endif + +OBJS = geom_2d.o momentum.o hash.o\ + vicinity.o protocones.o split_merge.o siscone.o + +SRCS = $(patsubst %.o,%.cpp,$(OBJS)) + + +%.o: %.cpp %.h + $(CC) -c $(CFLAGS) $< + +%.o: %.cpp + $(CC) -c $(CFLAGS) $< + +all: $(OBJS) + ar cru $(LIBOUT) $(OBJS) + ranlib $(LIBOUT) + +.PHONY: clean + +clean: + rm -f *.o *~ + + +# note the -Y option below avoids including all the standard +# include directories (which change from one system to another) +depend: + makedepend -I../.. -f makefile.static -- -Y -- $(SRCS) +# DO NOT DELETE + +geom_2d.o: geom_2d.h ../../siscone/defines.h ../../siscone/geom_2d.h +geom_2d.o: ../../siscone/defines.h +momentum.o: momentum.h ../../siscone/reference.h geom_2d.h +momentum.o: ../../siscone/defines.h ../../siscone/geom_2d.h +momentum.o: ../../siscone/defines.h +hash.o: hash.h momentum.h ../../siscone/reference.h geom_2d.h +hash.o: ../../siscone/defines.h ../../siscone/geom_2d.h +hash.o: ../../siscone/defines.h +vicinity.o: vicinity.h ../../siscone/vicinity.h momentum.h +vicinity.o: ../../siscone/reference.h geom_2d.h ../../siscone/defines.h +vicinity.o: ../../siscone/geom_2d.h ../../siscone/defines.h +vicinity.o: ../../siscone/quadtree.h +protocones.o: ../../siscone/defines.h ../../siscone/siscone_error.h +protocones.o: ../../siscone/circulator.h protocones.h momentum.h +protocones.o: ../../siscone/reference.h geom_2d.h ../../siscone/geom_2d.h +protocones.o: ../../siscone/defines.h vicinity.h ../../siscone/vicinity.h +protocones.o: ../../siscone/quadtree.h hash.h +split_merge.o: ../../siscone/siscone_error.h split_merge.h +split_merge.o: ../../siscone/defines.h geom_2d.h ../../siscone/geom_2d.h +split_merge.o: ../../siscone/defines.h momentum.h ../../siscone/reference.h +siscone.o: ../../siscone/config.h ../../siscone/ranlux.h +siscone.o: ../../siscone/siscone_error.h ../../siscone/defines.h momentum.h +siscone.o: ../../siscone/reference.h geom_2d.h ../../siscone/geom_2d.h +siscone.o: ../../siscone/defines.h siscone.h protocones.h vicinity.h +siscone.o: ../../siscone/vicinity.h ../../siscone/quadtree.h hash.h +siscone.o: split_merge.h Index: tags/siscone-3.0.5/siscone/spherical/hash.cpp =================================================================== --- tags/siscone-3.0.5/siscone/spherical/hash.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/hash.cpp (revision 426) @@ -0,0 +1,207 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: hash.cpp // +// Description: source file for classes sph_hash_element and sph_hash_cones // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include "hash.h" +#include + +namespace siscone_spherical{ + +using namespace std; + +/************************************************************** + * implementation of sph_hash_cones * + * list of cones candidates. * + * We store in this class all the sph_hash_element and give * + * functions to manipulate them. * + **************************************************************/ + +// constructor with initialisation +// - _Np number of particles +// - _radius cone radius +//----------------------------------- +sph_hash_cones::sph_hash_cones(int _Np, double _radius){ + int i; + + n_cones = 0; +#ifdef DEBUG_STABLE_CONES + n_occupied_cells = 0; +#endif + + // determine hash size + // for a ymax=5 and R=0.7, we observed an occupancy around 1/8 N^2 ~ N2 R2/4 + //mask = 1 << (int) (2*log(double(_Np))/log(2.0)); + //if (mask<=1) mask=2; + int nbits = (int) (log(_Np*_radius*_radius*_Np/4.0)/log(2.0)); + if (nbits<1) nbits=1; + mask = 1 << nbits; + + // create hash + hash_array = new sph_hash_element*[mask]; + mask--; + + // set the array to 0 + //? needed ? + for (i=0;inext; + delete elm; + } + } + + delete[] hash_array; +} + + +/* + * insert a new candidate into the hash. + * - v 4-momentum of the cone to add + * - parent parent particle defining the cone + * - child child particle defining the cone + * - p_io whether the parent has to belong to the cone or not + * - c_io whether the child has to belong to the cone or not + * return 0 on success, 1 on error + ***********************************************************************/ +int sph_hash_cones::insert(CSphmomentum *v, CSphmomentum *parent, CSphmomentum *child, bool p_io, bool c_io){ + sph_hash_element *elm; + int index = (v->ref.ref[0]) & mask; + + // check the array cell corresponding to our reference + elm = hash_array[index]; + +#ifdef DEBUG_STABLE_CONES + if (elm==NULL) + n_occupied_cells++; +#endif + + do{ + // if it is not present, add it + if (elm==NULL){ + // create element + elm = new sph_hash_element; + + // set its varibles + // Note: at this level, eta and phi have already been computed + // through CSphmomentum::build_thetaphi. + elm->centre = *v; + + // if at least one of the two is_closer tests gives a result != from the expected, + // the || will be true hence !(...) false as wanted + elm->is_stable = !((is_closer(v, parent, tan2R)^p_io)||(is_closer(v, child, tan2R)^c_io)); + //cout << "-- new status of " << v->ref[0] << ":" << elm->is_stable << endl; + + // update hash + elm->next = hash_array[index]; + hash_array[index] = elm; + + n_cones++; + return 0; + } + + // if the cone is already there, simply update stability status + if (v->ref == elm->centre.ref){ + // there is only an update to perform to see if the cone is still stable + if (elm->is_stable){ + elm->is_stable = !((is_closer(v, parent, tan2R)^p_io)||(is_closer(v, child, tan2R)^c_io)); + //cout << " parent/child: " + // << parent->ref[0] << ":" << is_closer(v, parent) << ":" << p_io << " " + // << child->ref[0] << ":" << is_closer(v, child) << ":" << c_io << endl; + //cout << "-- rep status of " << v->ref[0] << ":" << elm->is_stable << endl; + //cout << v->eta << " " << v->phi << endl; + //cout << (child->eta) << " " << child->phi << endl; + } + return 0; + } + + elm = elm->next; + } while (1); + + return 1; +} + +/* + * insert a new candidate into the hash. + * - v 4-momentum of te cone to add + * Note, in this case, we assume stability. We also assume + * that eta and phi are computed for v + * return 0 on success, 1 on error + ***********************************************************************/ +int sph_hash_cones::insert(CSphmomentum *v){ + sph_hash_element *elm; + int index = (v->ref.ref[0]) & mask; + //cout << "-- stable candidate: " << v->ref[0] << ":" << endl; + + // check the array cell corresponding to our reference + elm = hash_array[index]; + do{ + // if it is not present, add it + if (elm==NULL){ + // create element + elm = new sph_hash_element; + + // set its varibles + // Note: at this level, eta and phi have already been computed + // through CSphmomentum::build_thetaphi. + elm->centre = *v; + elm->is_stable = true; + + // update hash + elm->next = hash_array[index]; + hash_array[index] = elm; + + n_cones++; + return 0; + } + + // if the cone is already there, we have nothing to do + if (v->ref == elm->centre.ref){ + return 0; + } + + elm = elm->next; + } while (1); + + return 1; +} + +} Property changes on: tags/siscone-3.0.5/siscone/spherical/hash.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/.gitignore =================================================================== --- tags/siscone-3.0.5/siscone/spherical/.gitignore (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/.gitignore (revision 426) @@ -0,0 +1,4 @@ +/Makefile.in +/.deps +/Makefile +/.libs Index: tags/siscone-3.0.5/siscone/spherical/Makefile.am =================================================================== --- tags/siscone-3.0.5/siscone/spherical/Makefile.am (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/Makefile.am (revision 426) @@ -0,0 +1,25 @@ +# build information for the SISCone library +# this is built as a libtool lib. +lib_LTLIBRARIES = libsiscone_spherical.la + +# On top of the configured flags, we need to access the the +# top dir for includes of the form to work +# Note that we use "siscone/..." for clarity. +# Then we need to access the config.h file which is one step away +# since we use (for consistency), this means ../.. +libsiscone_spherical_la_CXXFLAGS = $(AM_CXXFLAGS) -I$(srcdir)/../.. -I../.. +libsiscone_spherical_la_SOURCES = geom_2d.cpp momentum.cpp hash.cpp\ + vicinity.cpp protocones.cpp split_merge.cpp siscone.cpp +libsiscone_spherical_la_LIBADD = ../libsiscone.la + +EXTRA_DIST = makefile.static + +# install the SISCone headers +sisconeincludedir = $(includedir)/siscone/spherical +sisconeinclude_HEADERS = geom_2d.h\ + hash.h\ + momentum.h\ + protocones.h\ + siscone.h\ + split_merge.h\ + vicinity.h Index: tags/siscone-3.0.5/siscone/spherical/hash.h =================================================================== --- tags/siscone-3.0.5/siscone/spherical/hash.h (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/hash.h (revision 426) @@ -0,0 +1,113 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: hash.h // +// Description: header file for classes hash_element and hash_cones // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __SPH_HASH_H__ +#define __SPH_HASH_H__ + +#include "momentum.h" + +namespace siscone_spherical{ + +/** + * \class sph_hash_element + * information on store cones candidates. + * + * We store in this class the information used to count all + * protocones in a first pass. This first pass only count + * cones with different references and test their stbility + * with the parent-child particles (border particles). + */ +class sph_hash_element{ + public: + CSph3vector centre; ///< centre of the cone + bool is_stable; ///< true if stable w.r.t. "border particles" + + sph_hash_element *next; ///< pointer to the next element +}; + +/** + * \class sph_hash_cones + * list of cones candidates. + * + * We store in this class all the hash_elements and give + * functions to manipulate them. + */ +class sph_hash_cones{ + public: + /// \param _Np number of particles + /// \param _radius cone radius + sph_hash_cones(int _Np, double _radius); + + /// destructor + ~sph_hash_cones(); + + /** + * insert a new candidate into the hash. + * \param v 4-momentum of te cone to add + * \param parent parent particle defining the cone + * \param child child particle defining the cone + * \param p_io whether the parent has to belong to the cone or not + * \param c_io whether the child has to belong to the cone or not + * \return 0 on success, 1 on error + */ + int insert(CSphmomentum *v, CSphmomentum *parent, CSphmomentum *child, bool p_io, bool c_io); + + /** + * insert a new candidate into the hash. + * \param v 4-momentum of te cone to add + * Note, in this case, we assume stability. We also assume + * that eta and phi are computed for v + * \return 0 on success, 1 on error + */ + int insert(CSphmomentum *v); + + /// the cone data itself + sph_hash_element **hash_array; + + /// number of elements + int n_cones; + + /// number of occupied cells +#ifdef DEBUG_STABLE_CONES + int n_occupied_cells; +#endif + + /// number of cells-1 + int mask; + + /// circle radius (squared) + /// NOTE: need to be set before any call to 'insert' + double R2; + + /// its squreed tangent + double tan2R; +}; + +} +#endif Property changes on: tags/siscone-3.0.5/siscone/spherical/hash.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/protocones.cpp =================================================================== --- tags/siscone-3.0.5/siscone/spherical/protocones.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/protocones.cpp (revision 426) @@ -0,0 +1,862 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: protocones.cpp // +// Description: source file for stable cones determination (Cstable_cones) // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +/******************************************************* + * Introductory note: * + * Since this file has many member functions, we have * + * structured them in categories: * + * INITIALISATION FUNCTIONS * + * - ctor() * + * - ctor(particle_list) * + * - dtor() * + * - init(particle_list) * + * ALGORITHM MAIN ENTRY * + * - get_stable_cone(radius) * + * ALGORITHM MAIN STEPS * + * - init_cone() * + * - test_cone() * + * - update_cone() * + * - proceed_with_stability() * + * ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS * + * - cocircular_pt_less(v1, v2) * + * - prepare_cocircular_list() * + * - test_cone_cocircular() * + * - test_stability(candidate, border_list) * + * - updat_cone_cocircular() * + * RECOMPUTATION OF CONE CONTENTS * + * - compute_cone_contents() * + * - recompute_cone_contents() * + * - recompute_cone_contents_if_needed() * + * VARIOUS TOOLS * + * - circle_intersect() * + * - is_inside() * + * - abs_dangle() * + *******************************************************/ + +#include +#include +#include +#include "protocones.h" +#include +#include +#include + +namespace siscone_spherical{ + +using namespace std; + +/********************************************************************** + * CSphstable_cones implementation * + * Computes the list of stable comes from a particle list. * + * This class does the first fundamental task of te cone algorithm: * + * it is used to compute the list of stable cones given a list * + * of particles. * + **********************************************************************/ + +//////////////////////////////////////////////////////// +// INITIALISATION FUNCTIONS // +// - ctor() // +// - ctor(particle_list) // +// - dtor() // +// - init(particle_list) // +//////////////////////////////////////////////////////// + +// default ctor +//-------------- +CSphstable_cones::CSphstable_cones(){ + nb_tot = 0; + hc = NULL; +} + +// ctor with initialisation +//-------------------------- +CSphstable_cones::CSphstable_cones(vector &_particle_list) + : CSphvicinity(_particle_list){ + + nb_tot = 0; + hc = NULL; +} + +// default dtor +//-------------- +CSphstable_cones::~CSphstable_cones(){ + if (hc!=NULL) delete hc; +} + +/* + * initialisation + * - _particle_list list of particles + * - _n number of particles + *********************************************************************/ +void CSphstable_cones::init(vector &_particle_list){ + // check already allocated mem + if (hc!=NULL){ + delete hc; + } + if (protocones.size()!=0) + protocones.clear(); + + multiple_centre_done.clear(); + + // initialisation + set_particle_list(_particle_list); +} + + +//////////////////////////////////////////////////////// +// ALGORITHM MAIN ENTRY // +// - get_stable_cone(radius) // +//////////////////////////////////////////////////////// + +/* + * compute stable cones. + * This function really does the job i.e. computes + * the list of stable cones (in a seedless way) + * - _radius: radius of the cones + * The number of stable cones found is returned + *********************************************************************/ +int CSphstable_cones::get_stable_cones(double _radius){ + int p_idx; + + // check if everything is correctly initialised + if (n_part==0){ + return 0; + } + + R = _radius; + R2 = R*R; + tan2R = tan(R); + tan2R *= tan2R; + + // allow hash for cones candidates + hc = new sph_hash_cones(n_part, R); + + // browse all particles + for (p_idx=0;p_idx_phi << ", " << parent->_theta << endl; +#endif + + // step 1: initialise with the first cone candidate + init_cone(); + + do{ + // step 2: test cone stability for that pair (P,C) + test_cone(); + + // step 3: go to the next cone child candidate C + } while (!update_cone()); + } + + return proceed_with_stability(); +} + + +//////////////////////////////////////////////////////// +// ALGORITHM MAIN STEPS // +// - init_cone() // +// - test_cone() // +// - update_cone() // +// - proceed_with_stability() // +//////////////////////////////////////////////////////// + +/* + * initialise the cone. + * We take the first particle in the angular ordering to compute + * this one + * return 0 on success, 1 on error + *********************************************************************/ +int CSphstable_cones::init_cone(){ + // The previous version of the algorithm was starting the + // loop around vicinity elements with the "most isolated" child. + // given the nodist method to calculate the cone contents, we no + // longer need to worry about which cone comes first... + first_cone=0; + + // now make sure we have lists of the cocircular particles + prepare_cocircular_lists(); + + //TODO? deal with a configuration with only degeneracies ? + // The only possibility seems a regular hexagon with a parent point + // in the centre. And this situation is by itself unclear. + // Hence, we do nothing here ! + + // init set child C + centre = vicinity[first_cone]; + child = centre->v; + centre_idx = first_cone; + + // build the initial cone (nodist: avoids calculating distances -- + // just deduces contents by circulating around all in/out operations) + // this function also sets the list of included particles + compute_cone_contents(); + + return 0; +} + + +/* + * test cones. + * We check if the cone(s) built with the present parent and child + * are stable + * return 0 on success 1 on error + *********************************************************************/ +int CSphstable_cones::test_cone(){ + siscone::Creference weighted_cone_ref; + + // depending on the side we are taking the child particle, + // we test different configuration. + // Each time, two configurations are tested in such a way that + // all 4 possible cases (parent or child in or out the cone) + // are tested when taking the pair of particle parent+child + // and child+parent. + + // here are the tests entering the first series: + // 1. check if the cone is already inserted + // 2. check cone stability for the parent and child particles + + //UPDATED(see below): if (centre->side){ + //UPDATED(see below): // test when both particles are not in the cone + //UPDATED(see below): // or when both are in. + //UPDATED(see below): // Note: for the totally exclusive case, test emptyness before + //UPDATED(see below): cone_candidate = cone; + //UPDATED(see below): if (cone.ref.not_empty()){ + //UPDATED(see below): hc->insert(&cone_candidate, parent, child, false, false); + //UPDATED(see below): } + //UPDATED(see below): + //UPDATED(see below): cone_candidate = cone; + //UPDATED(see below): cone_candidate+= *parent + *child; + //UPDATED(see below): hc->insert(&cone_candidate, parent, child, true, true); + //UPDATED(see below): } else { + //UPDATED(see below): // test when 1! of the particles is in the cone + //UPDATED(see below): cone_candidate = cone + *parent; + //UPDATED(see below): hc->insert(&cone_candidate, parent, child, true, false); + //UPDATED(see below): + //UPDATED(see below): cone_candidate = cone + *child; + //UPDATED(see below): hc->insert(&cone_candidate, parent, child, false, true); + //UPDATED(see below): } + //UPDATED(see below): + //UPDATED(see below): nb_tot+=2; + + // instead of testing 2 inclusion/exclusion states for every pair, we test the 4 of them + // when the parent has an energy bigger than the child + if (parent->E >= child->E){ + // test when both particles are not in the cone + // Note: for the totally exclusive case, test emptiness before + cone_candidate = cone; + if (cone.ref.not_empty()){ + hc->insert(&cone_candidate, parent, child, false, false); + } + + // test when 1! of the particles is in the cone + cone_candidate += *parent; + hc->insert(&cone_candidate, parent, child, true, false); + + cone_candidate = cone; + cone_candidate += *child; + hc->insert(&cone_candidate, parent, child, false, true); + + // test when both are in. + cone_candidate += *parent; + hc->insert(&cone_candidate, parent, child, true, true); + + nb_tot += 4; + } + + + return 0; +} + + +/* + * update the cone + * go to the next child for that parent and update 'cone' appropriately + * return 0 if update candidate found, 1 otherwise + ***********************************************************************/ +int CSphstable_cones::update_cone(){ +#ifdef DEBUG_STABLE_CONES + cout << "call 'circles_plot.gp' '" << centre->centre.px << "' '" + << centre->centre.py << "' '" << centre->centre.pz << "'" << endl + << "pause -1 '(" << centre->angle << " " << (centre->side ? '+' : '-') << ")"; +#endif + + // get the next child and centre + centre_idx++; + if (centre_idx==vicinity_size) + centre_idx=0; + if (centre_idx==first_cone) + return 1; + + // update the cone w.r.t. the old child + // only required if the old child is entering inside in which + // case we need to add it. We also know that the child is + // inside iff its side is -. + if (!centre->side){ +#ifdef DEBUG_STABLE_CONES + cout << " old_enter"; +#endif + // update cone + cone += (*child); + + // update info on particles inside + centre->is_inside->cone = true; + + // update stability check quantities + dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); + } + + // update centre and child to correspond to the new position + centre = vicinity[centre_idx]; + child = centre->v; + + // check cocircularity + // note that if cocirculaity is detected (i.e. if we receive 1 + // in the next test), we need to recall 'update_cone' directly + // since tests and remaining part of te update has been performed + //if (cocircular_check()) + if (cocircular_check()){ +#ifdef DEBUG_STABLE_CONES + cout << " Co-circular case detected" << endl; +#endif + return update_cone(); + } + + // update the cone w.r.t. the new child + // only required if the new child was already inside in which + // case we need to remove it. We also know that the child is + // inside iff its side is +. + if ((centre->side) && (cone.ref.not_empty())){ +#ifdef DEBUG_STABLE_CONES + cout << " new exit"; +#endif + + // update cone + cone -= (*child); + + // update info on particles inside + centre->is_inside->cone = false; + + // update stability check quantities + dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); //child->perp2(); + } + + // check that the addition and subtraction of vectors does + // not lead to too much rounding error + // for that, we compute the sum of pt modifications and of |pt| + // since last recomputation and once the ratio overpasses a threshold + // we recompute vicinity. + if ((dpt>PT_TSHOLD*(fabs(cone.px)+fabs(cone.py)+fabs(cone.pz))) && (cone.ref.not_empty())){ + recompute_cone_contents(); + } + if (cone.ref.is_empty()){ + cone = CSphmomentum(); + dpt=0.0; + } + +#ifdef DEBUG_STABLE_CONES + cout << "'" << endl; +#endif + + return 0; +} + + +/* + * compute stability of all enumerated candidates. + * For all candidate cones which are stable w.r.t. their border particles, + * pass the last test: stability with quadtree intersection + ************************************************************************/ +int CSphstable_cones::proceed_with_stability(){ + int i; + sph_hash_element *elm; + + for (i=0;i<=hc->mask;i++){ + // test ith cell of the hash array + elm = hc->hash_array[i]; + + // browse elements therein + while (elm!=NULL){ + // test stability + if (elm->is_stable){ + // stability is not ensured by all pairs of "edges" already browsed +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + // => testing stability with quadtree intersection + if (quadtree->circle_intersect(elm->eta, elm->phi, R2)==elm->ref) +#else + // => testing stability with the particle-list intersection + if (circle_intersect(elm->centre)==elm->centre.ref) +#endif + protocones.push_back(CSphmomentum(elm->centre,1.0)); + } + + // jump to the next one + elm = elm->next; + } + } + + // free hash + // we do that at this level because hash eats rather a lot of memory + // we want to free it before running the split/merge algorithm +#ifdef DEBUG_STABLE_CONES + nb_hash_cones = hc->n_cones; + nb_hash_occupied = hc->n_occupied_cells; +#endif + + delete hc; + hc=NULL; + + return protocones.size(); +} + + +//////////////////////////////////////////////////////// +// ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS // +// - cocircular_pt_less(v1, v2) // +// - prepare_cocircular_list() // +// - test_cone_cocircular() // +// - test_stability(candidate, border_vect) // +// - updat_cone_cocircular() // +//////////////////////////////////////////////////////// + +/// pt-ordering of momenta used for the cocircular case +//NEVER USED +//bool cocircular_pt_less(CSphmomentum *v1, CSphmomentum *v2){ +// return v1->perp2() < v2->perp2(); +//} + +/* + * run through the vicinity of the current parent and for each child + * establish which other members are cocircular... Note that the list + * associated with each child contains references to vicinity + * elements: thus two vicinity elements each associated with one given + * particle may appear in a list -- this needs to be watched out for + * later on... + **********************************************************************/ +void CSphstable_cones::prepare_cocircular_lists() { + siscone::circulator::iterator > here(vicinity.begin(), + vicinity.begin(), + vicinity.end()); + + siscone::circulator::iterator > search(here); + + do { + CSphvicinity_elm* here_pntr = *here(); + search.set_position(here); + + // search forwards for things that should have "here" included in + // their cocircularity list + while (true) { + ++search; + if ( siscone::abs_dphi((*search())->angle, here_pntr->angle) < + here_pntr->cocircular_range + && search() != here()) { + (*search())->cocircular.push_back(here_pntr); + } else { + break; + } + } + + // search backwards + search.set_position(here); + while (true) { + --search; + if ( siscone::abs_dphi((*search())->angle, here_pntr->angle) < + here_pntr->cocircular_range + && search() != here()) { + (*search())->cocircular.push_back(here_pntr); + } else { + break; + } + } + + ++here; + } while (here() != vicinity.begin()); +} + +/* + * Testing cocircular configurations in p^3 time, + * rather than 2^p time; we will test all contiguous subsets of points + * on the border --- note that this is till probably overkill, since + * in principle we only have to test situations where up to a + * half-circle is filled (but going to a full circle is simpler) + ******************************************************************/ +void CSphstable_cones::test_cone_cocircular(CSphmomentum & borderless_cone, + list & border_list) { + // in spherical coordinates, we don't have a universal x-y axis system + // to measure the angles. So we first determine one minimising + // the uncertainties + CSph3vector angl_dir1, angl_dir2; + centre->centre.get_angular_directions(angl_dir1, angl_dir2); + angl_dir1/=angl_dir1._norm; + angl_dir2/=angl_dir2._norm; + + // now we have te reference axis, create the CSphborder_store structure + vector border_vect; + border_vect.reserve(border_list.size()); + for (list::iterator it = border_list.begin(); + it != border_list.end(); it++) { + border_vect.push_back(CSphborder_store(*it, centre->centre, angl_dir1, angl_dir2)); + } + + // get them into order of angle + sort(border_vect.begin(), border_vect.end()); + + // set up some circulators, since these will help us go around the + // circle easily + siscone::circulator::iterator > + start(border_vect.begin(), border_vect.begin(),border_vect.end()); + siscone::circulator::iterator > mid(start), end(start); + + // test the borderless cone + CSphmomentum candidate = borderless_cone; + //candidate.build_etaphi(); + if (candidate.ref.not_empty()) + test_stability(candidate, border_vect); + + do { + // reset status wrt inclusion in the cone + mid = start; + do { + mid()->is_in = false; + } while (++mid != start); + + // now run over all inclusion possibilities with this starting point + candidate = borderless_cone; + while (++mid != start) { + // will begin with start+1 and go up to start-1 + mid()->is_in = true; + candidate += *(mid()->mom); + test_stability(candidate, border_vect); + } + + } while (++start != end); + + // mid corresponds to momentum that we need to include to get the + // full cone + mid()->is_in = true; + candidate += *(mid()->mom); + test_stability(candidate, border_vect); +} + + +/** + * carry out the computations needed for the stability check of the + * candidate, using the border_vect to indicate which particles + * should / should not be in the stable cone; if the cone is stable + * insert it into the hash. + **********************************************************************/ +void CSphstable_cones::test_stability(CSphmomentum & candidate, const vector & border_vect) { + + // this almost certainly has not been done... + //candidate.build_etaphi(); + + bool stable = true; + for (unsigned i = 0; i < border_vect.size(); i++) { + if (is_closer(&candidate, border_vect[i].mom,tan2R) ^ (border_vect[i].is_in)) { + stable = false; + break; // it's unstable so there's no point continuing + } + } + + if (stable) hc->insert(&candidate); +} + +/* + * check if we are in a situation of cocircularity. + * if it is the case, update and test in the corresponding way + * return 'false' if no cocircularity detected, 'true' otherwise + * Note that if cocircularity is detected, we need to + * recall 'update' from 'update' !!! + ***************************************************************/ +bool CSphstable_cones::cocircular_check(){ + // check if many configurations have the same centre. + // if this is the case, branch on the algorithm for this + // special case. + // Note that those situation, being considered separately in + // test_cone_multiple, must only be considered here if all + // angles are on the same side (this avoid multiple counting) + + if (centre->cocircular.empty()) return false; + + // first get cone into status required at end... + if ((centre->side) && (cone.ref.not_empty())){ + // update cone + cone -= (*child); + + // update info on particles inside + centre->is_inside->cone = false; + + // update stability check quantities + dpt += fabs(child->px)+fabs(child->py)+fabs(child->pz); //child->perp2(); + } + + + // now establish the list of unique children in the list + // first make sure parent and child are in! + + list removed_from_cone; + list put_in_border; + list border_list; + + CSphmomentum cone_removal; + CSphmomentum border = *parent; + border_list.push_back(parent); + + // make sure child appears in the border region + centre->cocircular.push_back(centre); + + // now establish the full contents of the cone minus the cocircular + // region and of the cocircular region itself + for(list::iterator it = centre->cocircular.begin(); + it != centre->cocircular.end(); it++) { + + if ((*it)->is_inside->cone) { + cone_removal += *((*it)->v); + (*it)->is_inside->cone = false; + removed_from_cone.push_back((*it)->is_inside); + } + + // if a point appears twice (i.e. with + and - sign) in the list of + // points on the border, we take care not to include it twice. + // Note that this situation may appear when a point is at a distance + // close to 2R from the parent + if (!(*it)->is_inside->cocirc) { + border += *((*it)->v); + (*it)->is_inside->cocirc = true; + put_in_border.push_back((*it)->is_inside); + border_list.push_back((*it)->v); + //cout << " adding particle " << (*it)->v->_theta << ", " << (*it)->v->_phi << " to the border list" << endl; + } + } + + + // figure out whether this pairing has been observed before + CSphmomentum borderless_cone = cone; + borderless_cone -= cone_removal; + bool consider = true; + for (unsigned int i=0;i(borderless_cone.ref, + border.ref)); + + // first figure out whether our cone momentum is good + double local_dpt = fabs(cone_removal.px) + fabs(cone_removal.py); + double total_dpt = dpt + local_dpt; + + recompute_cone_contents_if_needed(borderless_cone, total_dpt); + if (total_dpt == 0) { + // a recomputation has taken place -- so take advantage of this + // and update the member cone momentum + cone = borderless_cone + cone_removal; + dpt = local_dpt; + } + + test_cone_cocircular(borderless_cone, border_list); + } + + + // relabel things that were in the cone but got removed + for(list::iterator is_in = removed_from_cone.begin(); + is_in != removed_from_cone.end(); is_in++) { + (*is_in)->cone = true; + } + + // relabel things that got put into the border + for(list::iterator is_in = put_in_border.begin(); + is_in != put_in_border.end(); is_in++) { + (*is_in)->cocirc = false; + } + + // we're done with everything -- return true to signal to user that we've + // been through the co-circularity rigmarole + return true; +} + + +//////////////////////////////////////////////////////// +// RECOMPUTATION OF CONE CONTENTS // +// - compute_cone_contents() // +// - recompute_cone_contents() // +// - recompute_cone_contents_if_needed() // +//////////////////////////////////////////////////////// + +/** + * compute the cone contents by going once around the full set of + * circles and tracking the entry/exit status each time + * given parent, child and centre compute the momentum + * of the particle inside the cone + * This sets up the inclusion information, which can then be directly + * used to calculate the cone momentum. + **********************************************************************/ +void CSphstable_cones::compute_cone_contents() { + siscone::circulator::iterator > + start(vicinity.begin()+first_cone, vicinity.begin(), vicinity.end()); + + siscone::circulator::iterator > here(start); + + // note that in the following algorithm, the cone contents never includes + // the child. Indeed, if it has positive sign, then it will be set as + // outside at the last step in the loop. If it has negative sign, then the + // loop will at some point go to the corresponding situation with positive + // sign and set the inclusion status to 0. + + do { + // as we leave this position a particle enters if its side is + // negative (i.e. the centre is the one at -ve angle wrt to the + // parent-child line + if (!(*here())->side) ((*here())->is_inside->cone) = 1; + + // move on to the next position + ++here; + + // as we arrive at this position a particle leaves if its side is positive + if ((*here())->side) ((*here())->is_inside->cone) = 0; + } while (here != start); + + // once we've reached the start the 'is_inside' information should be + // 100% complete, so we can use it to calculate the cone contents + // and then exit + recompute_cone_contents(); + return; + +} + + +/* + * compute the cone momentum from particle list. + * in this version, we use the 'pincluded' information + * from the CSphvicinity class + */ +void CSphstable_cones::recompute_cone_contents(){ + unsigned int i; + + // set momentum to 0 + cone = CSphmomentum(); + + // Important note: we can browse only the particles + // in vicinity since all particles in the cone are + // withing a distance 2R w.r.t. parent hence in vicinity. + // Among those, we only add the particles for which 'is_inside' is true ! + // This methos rather than a direct comparison avoids rounding errors + for (i=0;iside) && (vicinity[i]->is_inside->cone)) + cone += *vicinity[i]->v; + } + + // set check variables back to 0 + dpt = 0.0; +} + + +/* + * if we have gone beyond the acceptable threshold of change, compute + * the cone momentum from particle list. in this version, we use the + * 'pincluded' information from the CSphvicinity class, but we don't + * change the member cone, only the locally supplied one + */ +void CSphstable_cones::recompute_cone_contents_if_needed(CSphmomentum & this_cone, + double & this_dpt){ + + if (this_dpt > PT_TSHOLD*(fabs(this_cone.px)+fabs(this_cone.py))) { + if (cone.ref.is_empty()) { + this_cone = CSphmomentum(); + } else { + // set momentum to 0 + this_cone = CSphmomentum(); + + // Important note: we can browse only the particles + // in vicinity since all particles in the this_cone are + // withing a distance 2R w.r.t. parent hence in vicinity. + // Among those, we only add the particles for which 'is_inside' is true ! + // This methos rather than a direct comparison avoids rounding errors + for (unsigned int i=0;iside) && (vicinity[i]->is_inside->cone)) + this_cone += *vicinity[i]->v; + } + + } + // set check variables back to 0 + this_dpt = 0.0; + } + +} + + +//////////////////////////////////////////////////////// +// VARIOUS TOOLS // +// - circle_intersect() // +// - is_inside() // +// - abs_dangle() // +//////////////////////////////////////////////////////// + + +/* + * circle intersection. + * computes the intersection with a circle of given centre and radius. + * The output takes the form of a checkxor of the intersection's particles + * - cx circle centre x coordinate + * - cy circle centre y coordinate + * return the checkxor for the intersection + ******************************************************************/ +siscone::Creference CSphstable_cones::circle_intersect(CSph3vector &cone_centre){ + siscone::Creference intersection; + int i; + + for (i=0;i +#include +#include + +namespace siscone_spherical{ + +using namespace std; + +/************************************************************* + * CSphvicinity_elm implementation * + * element in the vicinity of a parent. * + * class used to manage one points in the vicinity * + * of a parent point. * + *************************************************************/ + +// ordering pointers to CSphvicinity_elm +//--------------------------------------- +bool ve_less(CSphvicinity_elm *ve1, CSphvicinity_elm *ve2){ + return ve1->angle < ve2->angle; +} + + +/************************************************************* + * CSphvicinity implementation * + * list of element in the vicinity of a parent. * + * class used to manage the points which are in the vicinity * + * of a parent point. The construction of the list can be * + * made from a list of points or from a quadtree. * + *************************************************************/ + +// default constructor +//--------------------- +CSphvicinity::CSphvicinity(){ + n_part = 0; + + ve_list = NULL; +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + quadtree = NULL; +#endif + + parent = NULL; + VR2 = VR = 0.0; + +} + +// constructor with initialisation +//--------------------------------- +CSphvicinity::CSphvicinity(vector &_particle_list){ + parent = NULL; + ve_list = NULL; +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + quadtree = NULL; +#endif + cosVR = VR2 = tan2R = VR = 0.0; + + set_particle_list(_particle_list); +} + +// default destructor +//-------------------- +CSphvicinity::~CSphvicinity(){ + if (ve_list!=NULL) + delete[] ve_list; + +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + if (quadtree!=NULL) + delete quadtree; +#endif +} + +/* + * set the particle_list + * - particle_list list of particles (type CSphmomentum) + * - n number of particles in the list + ************************************************************/ +void CSphvicinity::set_particle_list(vector &_particle_list){ + int i,j; +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + double eta_max=0.0; +#endif + + // if the particle list is not empty, destroy it ! + if (ve_list!=NULL){ + delete[] ve_list; + } + vicinity.clear(); +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + if (quadtree!=NULL) + delete quadtree; +#endif + + // allocate memory array for particles + // Note: - we compute max for |eta| + // - we allocate indices to particles + n_part = 0; + plist.clear(); + pincluded.clear(); + for (i=0;i<(int) _particle_list.size();i++){ + // if a particle is colinear with the beam (infinite rapidity) + // we do not take it into account + //if (fabs(_particle_list[i].pz)!=_particle_list[i].E){ + plist.push_back(_particle_list[i]); + pincluded.push_back(siscone::Cvicinity_inclusion()); // zero inclusion status + + // the parent_index is handled in the split_merge because + // of our multiple-pass procedure. + // Hence, it is not required here any longer. + // plist[n_part].parent_index = i; + plist[n_part].index = n_part; + + // make sure the reference is randomly created + plist[n_part].ref.randomize(); + +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + if (fabs(plist[n_part].eta)>eta_max) eta_max=fabs(plist[n_part].eta); +#endif + n_part++; + //} + } + + // allocate quadtree and vicinity_elm list + // note: we set phi in [-pi:pi] as it is the natural range for atan2! + ve_list = new CSphvicinity_elm[2*n_part]; +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + eta_max+=0.1; + quadtree = new siscone::Cquadtree(0.0, 0.0, eta_max, M_PI); +#endif + + // append particle to the vicinity_elm list + j = 0; + for (i=0;iadd(&plist[i]); +#endif + ve_list[j].v = ve_list[j+1].v = &plist[i]; + ve_list[j].is_inside = ve_list[j+1].is_inside = &(pincluded[i]); + j+=2; + } + +} + + +/* + * build the vicinity list from a list of points. + * - _parent reference particle + * - _VR vicinity radius + ************************************************************/ +void CSphvicinity::build(CSphmomentum *_parent, double _VR){ + int i; + + // set parent and radius + parent = _parent; + + VR = _VR; + VR2 = VR*VR; + cosVR = cos(VR); + R2 = 0.25*VR2; + R = 0.5*VR; + double tmp = tan(R); + tan2R = tmp*tmp; + + D2_R = 2.0*(1-cos(R)); + //tmp = sqrt(D2_R); + inv_R_EPS_COCIRC = 1.0 / R / EPSILON_COCIRCULAR; + inv_R_2EPS_COCIRC = 0.5 / R / EPSILON_COCIRCULAR; + + // clear vicinity + vicinity.clear(); + + // init parent variables + // we cpte the direction of the centre and two orthogonal ones + // to measure the angles. Those are taken orthogonal to the + // axis of smallest components (of the centre) to increase precision + parent_centre = (*parent)/parent->_norm; + parent_centre.get_angular_directions(angular_dir1, angular_dir2); + angular_dir1 /= angular_dir1._norm; + angular_dir2 /= angular_dir2._norm; + + // really browse the particle list + for (i=0;i0) ? 0.0 : 2.0; + double t=c/s; + return (s>0) ? 1-t/(1+fabs(t)) : 3-t/(1+fabs(t)); +} + + +/* + * append a particle to the 'vicinity' list after + * having computed the angular-ordering quantities + * - v vector to test + **********************************************************/ +void CSphvicinity::append_to_vicinity(CSphmomentum *v){ + // skip the particle itself) + if (v==parent) + return; + + int i=2*(v->index); + + // compute the distance of the i-th particle with the parent + double dot = dot_product3(parent_centre,*v); + CSph3vector vnormal = *v; + vnormal/=v->_norm; + dot/=v->_norm; + + // really check if the distance is less than VR + if (dot>cosVR){ + CSph3vector cross = cross_product3(parent_centre,vnormal); + + // for the centres + CSph3vector median = (parent_centre+vnormal); + double amplT = sqrt((tan2R*(1+dot)+(dot-1))*(1+dot)); + CSph3vector transverse = amplT*cross/cross._norm; + + // first angle (+) + ve_list[i].centre = median + transverse; + ve_list[i].centre.build_norm(); + ve_list[i].centre/=ve_list[i].centre._norm; + CSph3vector diff = ve_list[i].centre - parent_centre; + //ve_list[i].angle = atan2(dot_product3(angular_dir2, diff),dot_product3(angular_dir1, diff)); + ve_list[i].angle = sort_angle(dot_product3(angular_dir2, diff),dot_product3(angular_dir1, diff)); + ve_list[i].side = true; + ve_list[i].cocircular.clear(); + vicinity.push_back(&(ve_list[i])); + + // second angle (-) + ve_list[i+1].centre = median - transverse; + ve_list[i+1].centre.build_norm(); + ve_list[i+1].centre/=ve_list[i+1].centre._norm; + diff = ve_list[i+1].centre - parent_centre; + ve_list[i+1].angle = sort_angle(dot_product3(angular_dir2, diff),dot_product3(angular_dir1, diff)); + ve_list[i+1].side = false; + ve_list[i+1].cocircular.clear(); + vicinity.push_back(&(ve_list[i+1])); + + // now work out the cocircularity range for the two points (range + // of angle within which the points stay within a distance + // EPSILON_COCIRCULAR of circule + // P = parent; C = child; O = Origin (center of circle) + CSph3vector OP = parent_centre - ve_list[i+1].centre; + CSph3vector OC = vnormal - ve_list[i+1].centre; + + // two sources of error are (GPS CCN29-19) epsilon/(R sin theta) + // and sqrt(2*epsilon/(R (1-cos theta))) and the way things work + // out, it is the _smaller_ of the two that is relevant [NB have + // changed definition of theta here relative to that used in + // CCN29] [NB2: write things so as to avoid zero denominators and + // to minimize the multiplications, divisions and above all sqrts + // -- that means that c & s are defined including a factor of VR2] + double inv_err1 = cross_product3(OP,OC)._norm * inv_R_EPS_COCIRC; + double inv_err2_sq = (D2_R-dot_product3(OP,OC)) * inv_R_2EPS_COCIRC; + ve_list[i].cocircular_range = siscone::pow2(inv_err1) > inv_err2_sq ? + 1.0/inv_err1 : + sqrt(1.0/inv_err2_sq); + ve_list[i+1].cocircular_range = ve_list[i].cocircular_range; + } +} + +} Property changes on: tags/siscone-3.0.5/siscone/spherical/vicinity.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/protocones.h =================================================================== --- tags/siscone-3.0.5/siscone/spherical/protocones.h (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/protocones.h (revision 426) @@ -0,0 +1,262 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: protocones.h // +// Description: header file for stable cones determination (Cstable_cones) // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __SPH_PROTOCONES_H__ +#define __SPH_PROTOCONES_H__ + +#include "momentum.h" +#include "vicinity.h" +#include +#include +#include +#include "hash.h" + +#include + +namespace siscone_spherical{ + +/** + * \class CSphborder_store + * + * class for storing a border momentum (in context of co-circularity + * checks). + + * This class essentially calculates angle of border point w.r.t. + * circle center (eta & phi), and provides a store of information + * about whether we are currently including this point in the + * candidate + */ +class CSphborder_store{ +public: + /// default ctor + CSphborder_store(CSphmomentum * momentum, CSph3vector ¢re, CSph3vector &angl_dir1, CSph3vector &angl_dir2) : + mom(momentum), is_in(false) { + CSph3vector diff = (*momentum) - centre; + angle = atan2(dot_product3(diff, angl_dir2), dot_product3(diff, angl_dir1)); +#ifdef DEBUG_STABLE_CONES + std::cout << " adding point " << momentum->_theta << ", " << momentum->_phi + << " at an angle of " << angle << std::endl; +#endif + } + + CSphmomentum * mom; ///< particle momentum + double angle; ///< angle w.r.t. circle centre + bool is_in; ///< inclusion status of the particle +}; + + +/// allows easy sorting of CSphborder_store objects (which need to be +/// ordered in angle). +inline bool operator<(const CSphborder_store & a, const CSphborder_store & b) { + return a.angle < b.angle; +} + + +/** + * \class CSphstable_cones + * \brief Computes the list of stable comes from a particle list. + * + * This class does the first fundamental task of te cone algorithm: + * it is used to compute the list of stable cones given a list + * of particles. + */ +class CSphstable_cones : public CSphvicinity{ + public: + /// default ctor + CSphstable_cones(); + + /// ctor with initialisation (sse init for details) + CSphstable_cones(std::vector &_particle_list); + + /// default dtor + ~CSphstable_cones(); + + /** + * initialisation + * \param _particle_list list of particles + */ + void init(std::vector &_particle_list); + + /** + * compute stable cones. + * This function really does the job i.e. computes + * the list of stable cones (in a seedless way) + * \param _radius radius of the cones + * \return The number of stable cones found is returned + */ + int get_stable_cones(double _radius); + + /// list of stable cones + std::vector protocones; + + /// list of candidates + sph_hash_cones *hc; + + /// total number of tested cones + int nb_tot; +#ifdef DEBUG_STABLE_CONES + int nb_hash_cones, nb_hash_occupied; +#endif + + protected: + /// cone radius + double R; + + /// cone radius SQUARED + double R2; + + /// squared tangent of the cone radius + double tan2R; + + private: + /// cone with a given particle as parent + /// this reduction to a single vector assumes we trust the checksums + CSphmomentum cone; + + /// child particle, taken in the 'vicinity' list + CSphmomentum *child; + + /// centre of the tested cone + CSphvicinity_elm *centre; + + /// index in the particle list; + unsigned int centre_idx; + + /// first cone used in the vicinity list + unsigned int first_cone; + + /** + * initialise the cone. + * We take the first particle in the angular ordering to compute this one + * \return 0 on success, 1 on error + */ + int init_cone(); + + /** + * test cones. + * We check if the cone(s) build with the present parent and child + * are stable + * \return 0 on success 1 on error + */ + int test_cone(); + + /** + * update the cone + * go to the next child for that parent and update 'cone' appropriately + * \return 0 if update candidate found, 1 otherwise + */ + int update_cone(); + + /* + * run through the vicinity of the current parent and for each child + * indicate which members are cocircular... + */ + void prepare_cocircular_lists(); + + /** + * check if we are in a situation of cocircularity. + * if it is the case, update and test in the corresponding way + * \return 'false' if no cocircularity detected, 'true' otherwise + * Note that if cocircularity is detected, we need to + * recall 'update' from 'update' !!! + */ + bool cocircular_check(); + + /** + * Routine for testing cocircular configurations in p^3 time, + * rather than 2^p time; + */ + void test_cone_cocircular(CSphmomentum & borderless_cone, + std::list & border_list); + + /** + * carry out the computations needed for the stability check of the + * candidate, using the border_vect to indicate which particles + * should / should not be in the stable cone; if the cone is stable + * insert it into the hash. + */ + void test_stability(CSphmomentum & candidate, + const std::vector & border_vect); + + /** + * compute the cone contents by going once around the full set of + * circles and tracking the entry/exit status each time -- this sets + * up the inclusion information, which can then be directly used to + * calculate the cone momentum. + */ + void compute_cone_contents(); + + /** + * compute the cone momentum from particle list. + * in this version, we use the 'pincluded' information + * from the CSphvicinity class + */ + void recompute_cone_contents(); + + /* + * if we have gone beyond the acceptable threshold of change, compute + * the cone momentum from particle list. in this version, we use the + * 'pincluded' information from the CSphvicinity class, but we don't + * change the member cone, only the locally supplied one + */ + void recompute_cone_contents_if_needed(CSphmomentum & this_cone, double & this_dpt); + + /** + * compute stability of all enumerated candidates. + * For all candidate cones which are stable w.r.t. their border particles, + * pass the last test: stability with quadtree intersection + */ + int proceed_with_stability(); + + /* + * circle intersection. + * computes the intersection with a circle of given centre and radius. + * The output takes the form of a checkxor of the intersection's particles + * - cx circle centre x coordinate + * - cy circle centre y coordinate + * return the checkxor for the intersection + ******************************************************************/ + siscone::Creference circle_intersect(CSph3vector &cone_centre); + + /// present candidate cone + CSphmomentum cone_candidate; + + /// in case of co-circular points, vector for them + std::vector child_list; + + /// list of cocircular enclusures already studied + /// first element if cone contents, second is cone border + std::vector< std::pair > multiple_centre_done; + + // information for updating cone contents to avoid rounding errors + double dpt; ///< sums of Delta P_t +}; + +} +#endif Property changes on: tags/siscone-3.0.5/siscone/spherical/protocones.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/momentum.cpp =================================================================== --- tags/siscone-3.0.5/siscone/spherical/momentum.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/momentum.cpp (revision 426) @@ -0,0 +1,294 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: momentum.cpp // +// Description: source file for 4-momentum class Cmomentum // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include "momentum.h" +#include +#include + +namespace siscone_spherical{ + +/************************************************************************* + * class CSph3vector * + * This class contains the information for particle or group of * + * particles management. * + *************************************************************************/ + +// default ctor +//-------------- +CSph3vector::CSph3vector(){ + _theta = _phi = _norm = 0.0; + px = py = pz = 0.0; + ref = siscone::Creference(); +} + +// ctor with initialisation +//-------------------------- +CSph3vector::CSph3vector(double _px, double _py, double _pz){ + px = _px; + py = _py; + pz = _pz; + + // compute the norm + build_norm(); + + ref = siscone::Creference(); +} + +// default dtor +//-------------- +CSph3vector::~CSph3vector(){ + +} + + +// assignment of vectors +//----------------------- +CSph3vector& CSph3vector::operator = (const CSph3vector &v){ + px = v.px; + py = v.py; + pz = v.pz; + + _norm = v._norm; + _theta = v._theta; + _phi = v._phi; + + ref = v.ref; + return *this; +} + +// addition of vectors +//------------------------------------------------ +const CSph3vector CSph3vector::operator + (const CSph3vector &v){ + CSph3vector tmp = *this; + return tmp+=v; +} + +// subtraction of vectors +//------------------------------------------------ +const CSph3vector CSph3vector::operator - (const CSph3vector &v){ + CSph3vector tmp = *this; + return tmp-=v; +} + +// division by constant +//------------------------------------------------ +const CSph3vector CSph3vector::operator / (const double &r){ + CSph3vector tmp = *this; + return tmp/=r; +} + +// incrementation +//------------------------------------------------ +CSph3vector& CSph3vector::operator += (const CSph3vector &v){ + px+=v.px; + py+=v.py; + pz+=v.pz; + + return *this; +} + +// decrementation +//------------------------------------------------ +CSph3vector& CSph3vector::operator -= (const CSph3vector &v){ + px-=v.px; + py-=v.py; + pz-=v.pz; + + return *this; +} + +// multiplication by a constant +//------------------------------------------------ +CSph3vector& CSph3vector::operator *= (const double &r){ + px*=r; + py*=r; + pz*=r; + + return *this; +} + +// division by a constant +//------------------------------------------------ +CSph3vector& CSph3vector::operator /= (const double &r){ + px/=r; + py/=r; + pz/=r; + + _norm/=r; + + return *this; +} + +// build norm from 3-momentum info +void CSph3vector::build_norm(){ + _norm = norm(); +} + +// build norm from 3-momentum info +void CSph3vector::build_thetaphi(){ + _theta = theta(); + _phi = phi(); +} + + +// for this direction, compute the two reference directions +// used to measure angles +void CSph3vector::get_angular_directions(CSph3vector &angular_dir1, CSph3vector &angular_dir2){ + if (px < py){ + if (pz < px){ + // z smallest + angular_dir1 = CSph3vector(-py, px, 0.0); + } else { + // x smallest + angular_dir1 = CSph3vector(0.0, -pz, py); + } + } else { + if (pz < py){ + // z smallest + angular_dir1 = CSph3vector(-py, px, 0.0); + } else { + // y smallest + angular_dir1 = CSph3vector(-pz, 0.0, px); + } + } + angular_dir2 = cross_product3(*this, angular_dir1); + // We'll simply take x & y so the reflection symmetry is not broken + //angular_dir1 = CSph3vector(0.0, -pz, py); + //angular_dir2 = CSph3vector(-pz, 0.0, -px); +} + +/************************************************************************* + * class CSphmomentum * + * This class contains the information for particle or group of * + * particles management. * + * It includes all Lorentz properties as well as tools for summing them. * + *************************************************************************/ + +// default ctor +//-------------- +CSphmomentum::CSphmomentum(){ + E=0.0; + index = -1; +} + +// ctor with initialisation +//-------------------------- +CSphmomentum::CSphmomentum(double _px, double _py, double _pz, double _E) + : CSph3vector(_px, _py, _pz) { + E = _E; + + // compute the angles + build_thetaphi(); +} + +// ctor with initialisation +//-------------------------- +CSphmomentum::CSphmomentum(CSph3vector &_v, double _E) + : CSph3vector(_v.px, _v.py, _v.pz) { + E = _E; +} + +// default dtor +//-------------- +CSphmomentum::~CSphmomentum(){ + +} + +// assignment of vectors +//----------------------- +CSphmomentum& CSphmomentum::operator = (const CSphmomentum &v){ + px = v.px; + py = v.py; + pz = v.pz; + E = v.E; + + _norm = v._norm; + _theta = v._theta; + _phi = v._phi; + + ref = v.ref; + return *this; +} + +// addition of vectors +// !!! WARNING !!! no updating of eta and phi !!! +//------------------------------------------------ +const CSphmomentum CSphmomentum::operator + (const CSphmomentum &v){ + CSphmomentum tmp = *this; + return tmp+=v; +} + +// incrementation of vectors +// !!! WARNING !!! no updating of eta and phi !!! +//------------------------------------------------ +CSphmomentum& CSphmomentum::operator += (const CSphmomentum &v){ + px+=v.px; + py+=v.py; + pz+=v.pz; + E +=v.E; + + ref+=v.ref; + + return *this; +} + +// decrementation of vectors +// !!! WARNING !!! no updating of eta and phi !!! +//------------------------------------------------ +CSphmomentum& CSphmomentum::operator -= (const CSphmomentum &v){ + px-=v.px; + py-=v.py; + pz-=v.pz; + E -=v.E; + + ref-=v.ref; + return *this; +} + + +// ordering of two vectors +// the default ordering is w.r.t. their references +//------------------------------------------------- +bool operator < (const CSphmomentum &v1, const CSphmomentum &v2){ + return v1.ref < v2.ref; +} + +// ordering of vectors in eta (e.g. used in collinear tests) +//----------------------------------------------------------- +bool momentum_theta_less(const CSphmomentum &v1, const CSphmomentum &v2){ + return v1._theta < v2._theta; +} + +// ordering of vectors in pt +//--------------------------- +bool momentum_pt_less(const CSphmomentum &v1, const CSphmomentum &v2){ + return v1.perp2() < v2.perp2(); +} + +} + Property changes on: tags/siscone-3.0.5/siscone/spherical/momentum.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/vicinity.h =================================================================== --- tags/siscone-3.0.5/siscone/spherical/vicinity.h (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/vicinity.h (revision 426) @@ -0,0 +1,149 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: vicinity.h // +// Description: header file for particle vicinity (Cvicinity class) // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __SPH_VICINITY_H__ +#define __SPH_VICINITY_H__ + +#include +#include +#include +#include "momentum.h" +#include +#ifdef USE_QUADTREE_FOR_STABILITY_TEST +#include +#endif + +namespace siscone_spherical{ + + +/** + * \class CSphvicinity_elm + * \brief element in the vicinity of a parent. + * + * class used to manage one points in the vicinity + * of a parent point. + */ +class CSphvicinity_elm{ + public: + /// pointer to the second borderline particle + CSphmomentum *v; + + /// variable to tell if the particle is inside or outside the cone + siscone::Cvicinity_inclusion *is_inside; + + // centre variables + CSph3vector centre; ///< direction of the centre + double angle; ///< angle with parent + bool side; ///< true if angle on the positive side, false otherwise + double cocircular_range; ///< amount by which the angle can be varied while + ///< maintaining this point within co-circularity margin + + /// list of elements co-circular with this one + /// NB: empty list uses less mem than vector + std::list cocircular; +}; + +/// ordering pointers to CSphvicinity_elm +bool ve_less(CSphvicinity_elm *ve1, CSphvicinity_elm *ve2); + + +/** + * \class CSphvicinity + * \brief list of element in the vicinity of a parent. + * + * class used to manage the points which are in the vicinity + * of a parent point. + */ +class CSphvicinity{ + public: + /// default constructor + CSphvicinity(); + + /// constructor with initialisation (see set_particle_list) + CSphvicinity(std::vector &_particle_list); + + /// default destructor + ~CSphvicinity(); + + /** + * set the particle_list + * \param _particle_list list of particles (type CSphmomentum) + */ + void set_particle_list(std::vector &_particle_list); + + /** + * build the vicinity list from the list of points. + * \param _parent reference particle + * \param _VR vicinity radius + */ + void build(CSphmomentum *_parent, double _VR); + + // cone kinematical information + CSphmomentum *parent; ///< parent vector + double VR; ///< radius of the vicinity + double VR2; ///< squared radius of the vicinity + double cosVR; ///< cosine of the radius of the vicinity + double R; ///< normal radius + double R2; ///< squared normal radius + double tan2R; ///< squared tangent of the normal radius + double D2_R; ///< euclidian distance (squared) corresp. to the arc R + double inv_R_EPS_COCIRC; ///< R / EPSILON_COCIRCULAR + double inv_R_2EPS_COCIRC; ///< R / (2*EPSILON_COCIRCULAR) + + // particle list information + int n_part; ///< number of particles + std::vector plist; ///< the list of particles + /// the inclusion state of particles + std::vector pincluded; + CSphvicinity_elm *ve_list; ///< list of vicinity elements built from particle list (size=2*n) +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + siscone::Cquadtree *quadtree; ///< quadtree used for final stability tests +#endif + + // vicinity information + std::vector vicinity; ///< list of points in parent's vicinity + unsigned int vicinity_size; ///< number of elements in vicinity + + protected: + /** + * append a particle to the 'vicinity' list after + * having tested it and computed the angular-ordering quantities + * \param v vector to test + */ + void append_to_vicinity(CSphmomentum *v); + + // internal variables + CSph3vector parent_centre; ///< parent centre + CSph3vector angular_dir1; ///< main direction to measure angles + CSph3vector angular_dir2; ///< second direction to measure angles (sign) +}; + +} + +#endif Property changes on: tags/siscone-3.0.5/siscone/spherical/vicinity.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/siscone.cpp =================================================================== --- tags/siscone-3.0.5/siscone/spherical/siscone.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/siscone.cpp (revision 426) @@ -0,0 +1,297 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: siscone.cpp // +// Description: source file for the main SISCone class // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include "momentum.h" +#include "siscone.h" +#include +#include +#include + +namespace siscone_spherical{ +using namespace std; + +/*************************************************************** + * CSphsiscone implementation * + * final class: gather everything to compute the jet contents. * + * * + * This is the class user should use. * + * It computes the jet contents of a list of particles * + * given a cone radius and a threshold for splitting/merging. * + ***************************************************************/ + +// default ctor +//-------------- +CSphsiscone::CSphsiscone(){ + rerun_allowed = false; +} + +// default dtor +//-------------- +CSphsiscone::~CSphsiscone(){ + rerun_allowed = false; +} + +bool CSphsiscone::init_done=false; +std::ostream* CSphsiscone::_banner_ostr=&cout; + +/* + * compute the jets from a given particle set doing multiple passes + * such pass N looks for jets among all particles not put into jets + * during previous passes. + * - _particles list of particles + * - _radius cone radius + * - _f shared energy threshold for splitting&merging + * - _n_pass_max maximum number of runs + * - _Emin minimum energy of the protojets + * - _split_merge_scale the scale choice for the split-merge procedure + * NOTE: using pt leads to IR unsafety for some events with momentum + * conservation. So we strongly advise not to change the default + * value. + * return the number of jets found. + **********************************************************************/ +int CSphsiscone::compute_jets(vector &_particles, double _radius, double _f, + int _n_pass_max, double _Emin, + Esplit_merge_scale _split_merge_scale){ + // make sure things are initialised + _initialise_if_needed(); + + // run some general safety tests (NB: f will be checked in split-merge) + if (_radius <= 0.0 || _radius >= 0.5*M_PI) { + ostringstream message; + message << "Illegal value for cone radius, R = " << _radius + << " (legal values are 00) && (_n_pass_max!=0)); + + rerun_allowed = true; + + // split & merge + return perform(_f, _Emin); +} + +/* + * compute the jets from a given particle set doing multiple passes + * such pass N looks for jets among all particles not put into jets + * during previous passes. + * - _particles list of particles + * - _radius cone radius + * - _n_pass_max maximum number of runs + * - _Emin minimum energy of the protojets + * - _ordering_scale the ordering scale to decide which stable + * cone is removed + * return the number of jets found. + **********************************************************************/ +int CSphsiscone::compute_jets_progressive_removal(vector &_particles, double _radius, + int _n_pass_max, double _Emin, + Esplit_merge_scale _ordering_scale){ + // make sure things are initialised + _initialise_if_needed(); + + // run some general safety tests (NB: f will be checked in split-merge) + if (_radius <= 0.0 || _radius >= 0.5*M_PI) { + ostringstream message; + message << "Illegal value for cone radius, R = " << _radius + << " (legal values are 00) && (_n_pass_max!=0)); + + // split & merge + return jets.size(); +} +/* + * recompute the jets with a different overlap parameter. + * we use the same particles and R as in the preceeding call. + * - _f shared energy threshold for splitting&merging + * - _Emin minimum Energy of the protojets + * - _split_merge_scale the scale choice for the split-merge procedure + * NOTE: using pt leads to IR unsafety for some events with momentum + * conservation. So we strongly advise not to change the default + * value. + * return the number of jets found, -1 if recomputation not allowed. + ********************************************************************/ +int CSphsiscone::recompute_jets(double _f, double _Emin, + Esplit_merge_scale _split_merge_scale){ + if (!rerun_allowed) + return -1; + + ptcomparison.split_merge_scale = _split_merge_scale; + + // restore particle list + partial_clear(); + init_pleft(); + + // initialise split/merge algorithm + unsigned int i; + for (i=0;iflags()); + + (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl; + (*_banner_ostr) << "# SISCone version " << setw(28) << left << siscone_version() << "o" << endl; + (*_banner_ostr) << "# http://projects.hepforge.org/siscone o" << endl; + (*_banner_ostr) << "# o" << endl; + (*_banner_ostr) << "# This is SISCone: the Seedless Infrared Safe Cone Jet Algorithm o" << endl; + (*_banner_ostr) << "# SISCone was written by Gavin Salam and Gregory Soyez o" << endl; + (*_banner_ostr) << "# It is released under the terms of the GNU General Public License o" << endl; + (*_banner_ostr) << "# o" << endl; + (*_banner_ostr) << "# !!! WARNING !!! o" << endl; + (*_banner_ostr) << "# This is the version of SISCone using spherical coordinates o" << endl; + (*_banner_ostr) << "# o" << endl; + (*_banner_ostr) << "# A description of the algorithm is available in the publication o" << endl; + (*_banner_ostr) << "# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)]. o" << endl; + (*_banner_ostr) << "# Please cite it if you use SISCone. o" << endl; + (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl; + (*_banner_ostr) << endl; + + _banner_ostr->flush(); + _banner_ostr->flags(flags_to_restore); + } +} + +// finally, a bunch of functions to access to +// basic information (package name, version) +//--------------------------------------------- + +/* + * return SISCone package name. + * This is nothing but "SISCone", it is a replacement to the + * SISCONE_PACKAGE_NAME string defined in config.h and which is not + * guaranteed to be public. + * return the SISCone name as a string + */ +string siscone_package_name(){ + return SISCONE_PACKAGE_NAME; +} + +/* + * return SISCone version number. + * return a string of the form "X.Y.Z" with possible additional tag + * (alpha, beta, devel) to mention stability status + */ +string siscone_version(){ + return SISCONE_VERSION; +} + +} Property changes on: tags/siscone-3.0.5/siscone/spherical/siscone.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/momentum.h =================================================================== --- tags/siscone-3.0.5/siscone/spherical/momentum.h (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/momentum.h (revision 426) @@ -0,0 +1,312 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: momentum.h // +// Description: header file for 4-momentum class Cmomentum // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __SPH_VECTOR_H__ +#define __SPH_VECTOR_H__ + +#include +#include +#include +#include "geom_2d.h" +#include + +namespace siscone_spherical{ + +/** + * \class CSph3vector + * \brief base class for managing the spatial part of Cmomentum (defined after) + * + * This class contains the information for particle or group of + * particles management. + * It is adapted to use spherical geometry, where, for our purposes, + * the only time-consuming operation we need is the computation of + * the norm. To compute it once-and-for-all and store it in a local + * variable, you should call the 'build_norm' method. + * On top of that, the angle phi is computed from the x-axis + * and theta from the "north pole". + */ +class CSph3vector{ + public: + /// default ctor + CSph3vector(); + + /// ctor with initialisation + CSph3vector(double _px, double _py, double _pz); + + /// default dtor + ~CSph3vector(); + + /// assignment of vectors + CSph3vector& operator = (const CSph3vector &v); + + /// addition of vectors + /// WARNING= norm is not updated + const CSph3vector operator + (const CSph3vector &v); + + /// subtraction of vectors + /// WARNING= norm is not updated + const CSph3vector operator - (const CSph3vector &v); + + /// division by a constant + /// WARNING= norm is not updated + const CSph3vector operator / (const double &r); + + /// incrementation of vectors + /// WARNING= norm is not updated + CSph3vector& operator += (const CSph3vector &v); + + /// decrementation of vectors + /// WARNING= norm is not updated + CSph3vector& operator -= (const CSph3vector &v); + + /// multiplication by a constant + /// WARNING= norm is not updated + CSph3vector& operator *= (const double &r); + + /// division by a constant + /// WARNING= norm is not updated + CSph3vector& operator /= (const double &r); + + /// computes pT + inline double perp() const {return sqrt(perp2());} + + /// computes pT^2 + inline double perp2() const {return px*px+py*py;} + + /// 3-vect norm + inline double norm() const {return sqrt(px*px+py*py+pz*pz);} + + /// 3-vect norm squared + inline double norm2() const {return px*px+py*py+pz*pz;} + + /// 3-vect azimuthal angle + inline double phi() const {return atan2(py, px);} + + /// 3-vect polar angle + inline double theta() const {return atan2(perp(),pz);} + + /// build the spatial normfrom 4-momentum info + /// !!! WARNING !!! + /// !!! computing the norm is the only time-consuming !!! + /// !!! information we need in all computations. !!! + /// !!! use this whenever you need repeated access !!! + /// !!! to the norm to store it in the local variable !!! + void build_norm(); + + /// just a useful tool to store theta and phi + /// locally (in _theta and _phi) in case you need + /// repeated access + void build_thetaphi(); + + /// for this direction, compute the two reference directions + /// used to measure angles + void get_angular_directions(CSph3vector &angular_dir1, CSph3vector &angular_dir2); + + double px; ///< x-momentum + double py; ///< y-momentum + double pz; ///< z-momentum + + double _norm; ///< particle spatial norm (available ONLY after a call to build_norm) + double _theta; ///< particle theta angle (available ONLY after a call to build_thetaphi) + double _phi; ///< particle phi angle (available ONLY after a call to build_thetaphi) + + ////////////////////////////////////////////// + // the following part is used for checksums // + ////////////////////////////////////////////// + siscone::Creference ref; ///< reference number for the vector +}; + +/** + * \class CSphmomentum + * \brief base class for dynamic coordinates management + * + * This class contains the information for particle or group of + * particles management. + * It is adapted to use spherical geometry, where, for our purposes, + * the only time-consuming operation we need is the computation of + * the norm. To compute it once-and-for-all and store it in a local + * variable, you should call the 'build_norm' method. + * On top of that, the angle phi is computed from the x-axis + * and theta from the "north pole". + */ +class CSphmomentum : public CSph3vector{ + public: + /// default ctor + CSphmomentum(); + + /// init from a 3-vect + CSphmomentum(CSph3vector &init, double E=0.0); + + /// ctor with initialisation + CSphmomentum(double _px, double _py, double _pz, double _E); + + /// ctor with detailed initialisation + //CSphmomentum(double _eta, double _phi, siscone::Creference _ref); + + /// default dtor + ~CSphmomentum(); + + /// computes m + inline double mass() const {return sqrt(mass2());} + + /// computes m^2 + inline double mass2() const {return perpmass2()-perp2();} + + /// transverse mass, mt = sqrt(pt^2+m^2) = sqrt(E^2 - pz^2) + inline double perpmass() const {return sqrt((E-pz)*(E+pz));} + + /// transverse mass squared, mt^2 = pt^2+m^2 = E^2 - pz^2 + inline double perpmass2() const {return (E-pz)*(E+pz);} + + /// computes transverse energy + inline double Et() const {return E/sqrt(1.0+pz*pz/perp2());} + + /// computes transverse energy (squared) + inline double Et2() const {return E*E/(1.0+pz*pz/perp2());} + + /// assignment of vectors + CSphmomentum& operator = (const CSphmomentum &v); + + /// addition of vectors + /// !!! WARNING !!! no updating of eta and phi !!! + const CSphmomentum operator + (const CSphmomentum &v); + + /// incrementation of vectors + /// !!! WARNING !!! no updating of eta and phi !!! + CSphmomentum& operator += (const CSphmomentum &v); + + /// decrementation of vectors + /// !!! WARNING !!! no updating of eta and phi !!! + CSphmomentum& operator -= (const CSphmomentum &v); + + double E; ///< energy + + int parent_index; ///< particle number in the parent list + int index; ///< internal particle number +}; + +/// ordering of two vectors +/// this is by default done w.r.t. their references +bool operator < (const CSphmomentum &v1, const CSphmomentum &v2); + +/// ordering of vectors in eta (e.g. used in collinear tests) +bool momentum_theta_less(const CSphmomentum &v1, const CSphmomentum &v2); + +/// ordering of vectors in pt +bool momentum_pt_less(const CSphmomentum &v1, const CSphmomentum &v2); + + +////////////////////////// +// some handy utilities // +////////////////////////// + +/// square +inline double sqr(double x){return x*x;} + +/// dot product for te spatial 3-vect +/// \param v1 first 4-vect +/// \param v2 second 4-vect +inline double dot_product3(const CSph3vector &v1, const CSph3vector &v2){ + //double tmp = v1.px*v2.px + v1.py*v2.py + v1.pz*v2.pz; + //if (!isfinite(tmp)){ + // std::cout << "dot_product inf: " << std::endl; + // std::cout << " angles: " << v1._theta << " " << v1._phi << " and " << v2._theta << " " << v2._phi << std::endl; + // std::cout << " moms : " << v1.px << " " << v1.py << " " << v1.pz + // << " and " << v2.px << " " << v2.py << " " << v2.pz << std::endl; + //} + return v1.px*v2.px + v1.py*v2.py + v1.pz*v2.pz; +} + +/// cross product for the spatial 3-vect +/// \param v1 first 4-vect +/// \param v2 second 4-vect +inline CSph3vector cross_product3(const CSph3vector &v1, const CSph3vector &v2){ + //CSph3vector tmp; + //tmp.px = v1.py*v2.pz-v1.pz*v2.py; + //tmp.py = v1.pz*v2.px-v1.px*v2.pz; + //tmp.pz = v1.px*v2.py-v1.py*v2.px; + //return tmp; + return CSph3vector(v1.py*v2.pz-v1.pz*v2.py, + v1.pz*v2.px-v1.px*v2.pz, + v1.px*v2.py-v1.py*v2.px); +} + +/// squared norm of the cross product for the spatial 3-vect (energy is set to 0) +/// \param v1 first 4-vect +/// \param v2 second 4-vect +inline double norm2_cross_product3(const CSph3vector &v1, const CSph3vector &v2){ + return sqr(v1.py*v2.pz-v1.pz*v2.py) + sqr(v1.pz*v2.px-v1.px*v2.pz) + sqr(v1.px*v2.py-v1.py*v2.px); +} + +/// get tangent squared of the spherical distance between two vectors +/// \param v1 vector defining the first point +/// \param v2 vector defining the second point +inline double get_tan2_distance(const CSphmomentum &v1, const CSphmomentum &v2){ + return norm2_cross_product3(v1,v2)/sqr(dot_product3(v1,v2)); +} + +/// get spherical distance between to vectors +/// \param v1 vector defining the first point +/// \param v2 vector defining the second point +inline double get_distance(const CSph3vector *v1, const CSph3vector *v2){ + return atan2(sqrt(norm2_cross_product3(*v1,*v2)), dot_product3(*v1,*v2)); +} + +/// return true if the two points are distant by less than get spherical distance between two vectors +/// \param v1 vector defining the first point +/// \param v2 vector defining the second point +/// \param tan2R tangent squared of the max distance +/// WARNING: using the tangent here is dangerous for R>pi/2. +/// this never happens per se for "regular R" but +/// it may in the vicinity computation as we're using +/// 2R there. +inline bool is_closer(const CSph3vector *v1, const CSph3vector *v2, const double tan2R){ + double dot = dot_product3(*v1,*v2); + return (dot>=0) && (norm2_cross_product3(*v1,*v2)<=tan2R*dot*dot); +} + +/// return true if the two points are distant by less than get spherical distance between to vectors +/// \param v1 vector defining the first point +/// \param v2 vector defining the second point +/// \param tan2R tangent squared of the max distance +/// safer version but computes the norm +inline bool is_closer_safer(const CSph3vector *v1, const CSph3vector *v2, const double cosR){ + return dot_product3(*v1,*v2)>=cosR*sqrt(v1->norm2()*v2->norm2()); + //double dot = dot_product3(*v1,*v2); + //return (dot>=0) && (norm2_cross_product3(*v1,*v2) &_particles, double _radius, double _f, + int _n_pass_max=0, double _Emin=0.0, + Esplit_merge_scale _split_merge_scale=SM_Etilde); + + /** + * compute the jets from a given particle set. + * We are doing multiple passes such pass n_pass looks for jets among + * all particles not put into jets during previous passes. + * By default the number of passes is infinite (0). + * \param _particles list of particles + * \param _radius cone radius + * \param _n_pass_max maximum number of passes (0=full search) + * \param _Emin minimum energy of the protojets + * \param _ordering_scale the ordering scale to decide which stable + * cone is removed + * + * \return the number of jets found. + */ + int compute_jets_progressive_removal(std::vector &_particles, double _radius, + int _n_pass_max=0, double _Emin=0.0, + Esplit_merge_scale _ordering_scale=SM_Etilde); + + /** + * recompute the jets with a different overlap parameter. + * we use the same particles and R as in the preceeding call. + * \param _f shared energy threshold for splitting&merging + * \param _Emin minimum energy of the protojets + * \param _split_merge_scale the scale choice for the split-merge procedure + * split--merge variable + * NOTE: using pt leads to IR unsafety for some events with momentum + * conservation. So we strongly advise not to change the default + * value. + * \return the number of jets found, -1 if recomputation not allowed. + */ + int recompute_jets(double _f, double _Emin = 0.0, + Esplit_merge_scale _split_merge_scale=SM_Etilde); + + /// list of protocones found pass-by-pass + std::vector > protocones_list; + + // random number initialisation + static bool init_done; ///< check random generator initialisation + +#ifdef DEBUG_STABLE_CONES + int nb_hash_cones_total, nb_hash_occupied_total; +#endif + + /** + * A call to this function modifies the stream + * used to print banners (by default cout). + * + * Please note that if you distribute 3rd party code + * that links with SISCone, that 3rd party code must not + * use this call turn off the printing of thw banner + * by default. This requirement reflects the spirit of + * clause 2c of the GNU Public License (v2), under which + * SISCone is distributed. + */ + static void set_banner_stream(std::ostream * ostr) {_banner_ostr = ostr;} + + /** + * returns a pointer to the stream to be used to print banners + * (cout by default) + */ + static std::ostream * banner_stream() {return _banner_ostr;} + + private: + bool rerun_allowed; ///< is recompute_jets allowed ? + static std::ostream * _banner_ostr; ///< stream to use for banners + + /// ensure things are initialised + void _initialise_if_needed(); + +}; + + +// finally, a bunch of functions to access to +// basic information (package name, version) +//--------------------------------------------- + +/** + * return SISCone package name. + * This is nothing but "SISCone", it is a replacement to the + * SISCONE_PACKAGE_NAME string defined in config.h and which is not + * guaranteed to be public. + * \return the SISCone name as a string + */ +std::string siscone_package_name(); + +/** + * return SISCone version number. + * \return a string of the form "X.Y.Z" with possible additional tag + * (alpha, beta, devel) to mention stability status + */ +std::string siscone_version(); + +} +#endif Property changes on: tags/siscone-3.0.5/siscone/spherical/siscone.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/split_merge.cpp =================================================================== --- tags/siscone-3.0.5/siscone/spherical/split_merge.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/split_merge.cpp (revision 426) @@ -0,0 +1,1201 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: split_merge.cpp // +// Description: source file for splitting/merging (contains the CJet class) // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include "split_merge.h" +#include "momentum.h" +#include // for max +#include +#include +#include +#include +#include + +namespace siscone_spherical{ + +using namespace std; + +/******************************************************** + * class CSphjet implementation * + * real Jet information. * + * This class contains information for one single jet. * + * That is, first, its momentum carrying information * + * about its centre and pT, and second, its particle * + * contents * + ********************************************************/ +// default ctor +//-------------- +CSphjet::CSphjet(){ + n = 0; + v = CSphmomentum(); + E_tilde = 0.0; + sm_var2 = 0.0; + pass = CJET_INEXISTENT_PASS; // initialised to a value that should + // notappear in the end (after clustering) +} + +// default dtor +//-------------- +CSphjet::~CSphjet(){ + +} + +// ordering of jets in E (e.g. used in final jets ordering) +//---------------------------------------------------------- +bool jets_E_less(const CSphjet &j1, const CSphjet &j2){ + return j1.v.E > j2.v.E; +} + + +/******************************************************** + * CSphsplit_merge_ptcomparison implementation * + * This deals with the ordering of the jets candidates * + ********************************************************/ + +// odering of two jets +// The variable of the ordering is pt or mt +// depending on 'split_merge_scale' choice +// +// with EPSILON_SPLITMERGE defined, this attempts to identify +// delicate cases where two jets have identical momenta except for +// softish particles -- the difference of pt's may not be correctly +// identified normally and so lead to problems for the fate of the +// softish particle. +// +// NB: there is a potential issue in momentum-conserving events, +// whereby the harder of two jets becomes ill-defined when a soft +// particle is emitted --- this may have a knock-on effect on +// subsequent split-merge steps in cases with sufficiently large R +// (but we don't know what the limit is...) +//------------------------------------------------------------------ +bool CSphsplit_merge_ptcomparison::operator ()(const CSphjet &jet1, const CSphjet &jet2) const{ + double q1, q2; + + // compute the value for comparison for both jets + // This depends on the choice of variable (mt is the default) + q1 = jet1.sm_var2; + q2 = jet2.sm_var2; + + bool res = q1 > q2; + + // if we enable the refined version of the comparison (see defines.h), + // we compute the difference more precisely when the two jets are very + // close in the ordering variable. +#ifdef EPSILON_SPLITMERGE + if ( (fabs(q1-q2) < EPSILON_SPLITMERGE*max(q1,q2)) && + (jet1.v.ref != jet2.v.ref) ) { +#ifdef DEBUG_SPLIT_MERGE + cout << "Using high-precision ordering tests" << endl; +#endif + // get the momentum of the difference + CSphmomentum difference; + double E_tilde_difference; + get_difference(jet1,jet2,&difference,&E_tilde_difference); + + // use the following relation: pt1^2 - pt2^2 = (pt1+pt2)*(pt1-pt2) + double qdiff; + CSphmomentum sum = jet1.v ; + sum += jet2.v; + double E_tilde_sum = jet1.E_tilde + jet2.E_tilde; + + // depending on the choice of ordering variable, set the result + switch (split_merge_scale){ + case SM_Etilde: + qdiff = E_tilde_sum*E_tilde_difference; + break; + case SM_E: + qdiff = sum.E*difference.E; + break; + default: + throw siscone::Csiscone_error("Unsupported split-merge scale choice: " + + SM_scale_name()); + } + res = qdiff > 0; + } +#endif // EPSILON_SPLITMERGE + + return res; +} + + +/// return a name for the sm scale choice +/// NB: used internally and also by fastjet +std::string split_merge_scale_name(Esplit_merge_scale sms) { + switch(sms) { + case SM_E: + return "E (IR unsafe for pairs of identical decayed heavy particles)"; + case SM_Etilde: + return "Etilde (sum of E.[1+sin^2(theta_{i,jet})])"; + default: + return "[SM scale without a name]"; + } +} + + +// get the difference between 2 jets +// - j1 first jet +// - j2 second jet +// - v jet1-jet2 +// - pt_tilde jet1-jet2 pt_tilde +// return true if overlapping, false if disjoint +//----------------------------------------------- +void CSphsplit_merge_ptcomparison::get_difference(const CSphjet &j1, const CSphjet &j2, + CSphmomentum *v, double *E_tilde) const { + int i1,i2; + + // initialise + i1=i2=0; + *v = CSphmomentum(); + *E_tilde = 0.0; + + CSph3vector jet1_axis = j1.v; + //jet1_axis /= j1.v._norm; + jet1_axis /= j1.v.E; + CSph3vector jet2_axis = j2.v; + //jet2_axis /= j2.v._norm; + jet2_axis /= j2.v.E; + + // compute overlap + // at the same time, we store union in indices + // note tat for Etilde, we'll add the direct energy contributino at the end + do{ + if (j1.contents[i1]==j2.contents[i2]) { + const CSphmomentum & p = (*particles)[j1.contents[i1]]; + (*E_tilde) += p.E*((norm2_cross_product3(p,jet1_axis)-norm2_cross_product3(p,jet2_axis))/(*particles_norm2)[j1.contents[i1]]); + i1++; + i2++; + } else if (j1.contents[i1]j2.contents[i2]){ + const CSphmomentum &p = (*particles)[j2.contents[i2]]; + (*v) -= p; + (*E_tilde) -= p.E*norm2_cross_product3(p,jet2_axis)/(*particles_norm2)[j2.contents[i2]]; + i2++; + } else { + throw siscone::Csiscone_error("get_non_overlap reached part it should never have seen..."); + } + } while ((i1E; +} + + +/******************************************************** + * class CSphsplit_merge implementation * + * Class used to split and merge jets. * + ********************************************************/ +// default ctor +//-------------- +CSphsplit_merge::CSphsplit_merge(){ + merge_identical_protocones = false; +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES +#ifdef MERGE_IDENTICAL_PROTOCONES_DEFAULT_TRUE + merge_identical_protocones = true; +#endif +#endif + _user_scale = NULL; + indices = NULL; + + // ensure that ptcomparison points to our set of particles (though params not correct) + ptcomparison.particles = &particles; + ptcomparison.particles_norm2 = &particles_norm2; + candidates.reset(new multiset(ptcomparison)); + + // no hardest cut (col-unsafe) + SM_var2_hardest_cut_off = -numeric_limits::max(); + + // no energy cutoff for the particles to put in p_uncol_hard + stable_cone_soft_E2_cutoff = -1.0; + + // no pt-weighted splitting + use_E_weighted_splitting = false; +} + + +// default dtor +//-------------- +CSphsplit_merge::~CSphsplit_merge(){ + full_clear(); +} + + +// initialisation function +// - _particles list of particles +// - protocones list of protocones (initial jet candidates) +// - R2 cone radius (squared) +// - Emin minimal energy allowed for jets +//------------------------------------------------------------- +int CSphsplit_merge::init(vector & /*_particles*/, vector *protocones, double R2, double Emin){ + // browse protocones + return add_protocones(protocones, R2, Emin); +} + + +// initialisation function for particle list +// - _particles list of particles +//------------------------------------------------------------- +int CSphsplit_merge::init_particles(vector &_particles){ + full_clear(); + + // compute the list of particles + // here, we do not need to throw away particles + // with infinite rapidity (colinear with the beam) + particles = _particles; + n = particles.size(); + + // store the particle norm^2 + particles_norm2.resize(n); + for (int i=0;i(ptcomparison)); + + // start off with huge number + most_ambiguous_split = numeric_limits::max(); + + jets.clear(); +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + if (merge_identical_protocones) + cand_refs.clear(); +#endif + + p_remain.clear(); + + return 0; +} + + +// full clearance +//---------------- +int CSphsplit_merge::full_clear(){ + partial_clear(); + + // clear previously allocated memory + if (indices != NULL){ + delete[] indices; + } + particles.clear(); + + return 0; +} + + +// build the list 'p_uncol_hard' from p_remain by clustering collinear particles +// note that thins in only used for stable-cone detection +// so the parent_index field is unnecessary +//------------------------------------------------------------------------- +int CSphsplit_merge::merge_collinear_and_remove_soft(){ + int i,j; + vector p_sorted; + bool collinear; + double dphi; + + p_uncol_hard.clear(); + + // we first sort the particles according to their theta angle + for (i=0;iM_PI) dphi = twopi-dphi; + if (dphi *protocones, double R2, double Emin){ + int i; + CSphmomentum *c; + CSphmomentum *v; + double tan2R; + CSphjet jet; + + if (protocones->size()==0) + return 1; + + E_min = Emin; + double R = sqrt(R2); + tan2R = tan(R); + tan2R *= tan2R; + +#ifdef DEBUG_SPLIT_MERGE + cout << "particle list: "; + for (int i2=0;i2::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){ + // initialise variables + c = &(*p_it); + + // browse particles to create cone contents + // note that jet is always initialised with default values at this level + jet.v = CSphmomentum(); + jet.contents.clear(); + for (i=0;iparent_index); + jet.v+= *v; + v->index=0; + } + } + jet.n=jet.contents.size(); + + // compute Etilde for that jet. + // we can't do that before as it requires knowledge of the jet axis + // which has just been computed. + compute_Etilde(jet); + + // set the momentum in protocones + // (it was only known through its spatial coordinates up to now) + *c = jet.v; + c->build_thetaphi(); + + // set the jet range + jet.range=CSphtheta_phi_range(c->_theta,c->_phi,R); + +#ifdef DEBUG_SPLIT_MERGE + cout << "adding protojet: "; + + unsigned int phirange=jet.range.phi_range; + for (unsigned int i2=0;i2<32;i2++) fprintf(stdout, "%d", (phirange&(1<> i2 ); + fprintf(stdout, "\t"); + unsigned int thetarange=jet.range.theta_range; + for (unsigned int i2=0;i2<32;i2++) fprintf(stdout, "%d", (thetarange&(1<> i2); + fprintf(stdout, "\t"); + + for (int i2=0;i2 *protocones, double R2, double Emin){ + + int i; + CSphmomentum *c; + CSphmomentum *v; + double R, tan2R; + CSphjet jet, jet_candidate; + bool found_jet = false; + + if (protocones->size()==0) + return 1; + + E_min = Emin; + R = sqrt(R2); + tan2R = tan(R); + tan2R *= tan2R; + + // browse protocones + // for each of them, build the list of particles in them + for (vector::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){ + // initialise variables + c = &(*p_it); + + // browse particles to create cone contents + // note that jet is always initialised with default values at this level + jet_candidate.v = CSphmomentum(); + jet_candidate.contents.clear(); + for (i=0;iparent_index); + jet_candidate.v+= *v; + v->index=0; + } + } + jet_candidate.n=jet_candidate.contents.size(); + + // compute Etilde for that jet. + // we can't do that before as it requires knowledge of the jet axis + // which has just been computed. + compute_Etilde(jet_candidate); + + // set the momentum in protocones + // (it was only known through its spatial coordinates up to now) + *c = jet_candidate.v; + c->build_thetaphi(); + + // set the jet range + jet_candidate.range=CSphtheta_phi_range(c->_theta,c->_phi,R); + + // check that the protojet has large enough pt + if (jet_candidate.v.Eis_larger(jet_candidate, jet) + : ptcomparison(jet_candidate, jet))){ + jet = jet_candidate; + found_jet = true; + } + } + + // make sure at least one of the jets has passed the selection + if (!found_jet) return 1; + + // add the jet to the list of jets + jets.push_back(jet); + jets[jets.size()-1].v.build_thetaphi(); + jets[jets.size()-1].v.build_norm(); + +#ifdef DEBUG_SPLIT_MERGE + cout << "PR-Jet " << jets.size() << " [size " << jet.contents.size() << "]:"; +#endif + + // update the list of what particles are left + int p_remain_index = 0; + int contents_index = 0; + //sort(next_jet.contents.begin(),next_jet.contents.end()); + for (int index=0;indexsize()==0) + return 0; + + if (overlap_tshold>=1.0 || overlap_tshold <= 0) { + ostringstream message; + message << "Illegal value for overlap_tshold, f = " << overlap_tshold; + message << " (legal values are 0size()>0){ + // browse for the first jet + j1 = candidates->begin(); + + // if hardest jet does not pass threshold then nothing else will + // either so one stops the split merge. + //if (j1->sm_var2sm_var2end()){ +#ifdef DEBUG_SPLIT_MERGE + if (j2_relindex==1) show(); + cout << "check overlap between cdt 1 and cdt " << j2_relindex+1 << " with overlap " << endl; +#endif + // check overlapping + if (get_overlap(*j1, *j2, &overlap2)){ + // check if overlapping energy passes threshold + // Note that this depends on the ordering variable +#ifdef DEBUG_SPLIT_MERGE + cout << "overlap between cdt 1 and cdt " << j2_relindex+1 << " with overlap " + << sqrt(overlap2)/j2->v.E << endl<v.E)){ +#ifdef DEBUG_SPLIT_MERGE + cout << " --> split" << endl<begin(); + j2_relindex = 0; + } else { +#ifdef DEBUG_SPLIT_MERGE + cout << " --> merge" << endl<begin(); + j2_relindex = 0; + } + } + // watch out: split/merge might have caused new jets with E < + // Emin to disappear, so the total number of jets may + // have changed by more than expected and j2 might already by + // the end of the candidates list... + j2_relindex++; + if (j2 != candidates->end()) j2++; + } // end of loop on the second jet + + if (j1 != candidates->end()) { + // all "second jet" passed without overlapping + // (otherwise we won't leave the j2 loop) + // => store jet 1 as real jet + jets.push_back(*j1); + jets[jets.size()-1].v.build_thetaphi(); + jets[jets.size()-1].v.build_norm(); + // a bug where the contents has non-zero size has been cropping + // up in many contexts -- so catch it! + assert(j1->contents.size() > 0); + jets[jets.size()-1].pass = particles[j1->contents[0]].index; +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + cand_refs.erase(j1->v.ref); +#endif + candidates->erase(j1); + } + } + } while (candidates->size()>0); + + // sort jets by Energy + sort(jets.begin(), jets.end(), jets_E_less); +#ifdef DEBUG_SPLIT_MERGE + show(); +#endif + + return jets.size(); +} + + + +// save the event on disk +// - flux stream used to save jet contents +//-------------------------------------------- +int CSphsplit_merge::save_contents(FILE *flux){ + jet_iterator it_j; + CSphjet *j1; + int i1, i2; + + fprintf(flux, "# %d jets found\n", (int) jets.size()); + fprintf(flux, "# columns are: px, py, pz, E and number of particles for each jet\n"); + for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ + j1 = &(*it_j); + fprintf(flux, "%e\t%e\t%e\t%e\t%d\n", + j1->v.px, j1->v.py, j1->v.pz, j1->v.E, j1->n); + } + + fprintf(flux, "# jet contents\n"); + fprintf(flux, "# columns are: px, py, pz, E, particle index and jet number\n"); + for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ + j1 = &(*it_j); + for (i2=0;i2n;i2++) + fprintf(flux, "%e\t%e\t%e\t%e\t%d\t%d\n", + particles[j1->contents[i2]].px, particles[j1->contents[i2]].py, + particles[j1->contents[i2]].pz, particles[j1->contents[i2]].E, + j1->contents[i2], i1); + } + + return 0; +} + + +// show current jets/candidate status +//------------------------------------ +int CSphsplit_merge::show(){ + jet_iterator it_j; + cjet_iterator it_c; + CSphjet *j; + const CSphjet *c; + int i1, i2; + + for (it_j = jets.begin(), i1=0 ; it_j != jets.end() ; it_j++, i1++){ + j = &(*it_j); + fprintf(stdout, "jet %2d: %e\t%e\t%e\t%e\t", i1+1, + j->v.px, j->v.py, j->v.pz, j->v.E); + + unsigned int phirange=j->range.phi_range; + for (i2=0;i2<32;i2++) fprintf(stdout, "%d", (phirange&(1<> i2 ); + fprintf(stdout, "\t"); + unsigned int thetarange=j->range.theta_range; + for (i2=0;i2<32;i2++) fprintf(stdout, "%d", (thetarange&(1<> i2); + fprintf(stdout, "\t"); + + for (i2=0;i2n;i2++) + fprintf(stdout, "%d ", j->contents[i2]); + fprintf(stdout, "\n"); + } + + for (it_c = candidates->begin(), i1=0 ; it_c != candidates->end() ; it_c++, i1++){ + c = &(*it_c); + fprintf(stdout, "cdt %2d: %e\t%e\t%e\t%e\t%e\t", i1+1, + c->v.px, c->v.py, c->v.pz, c->v.E, sqrt(c->sm_var2)); + + unsigned int phirange=c->range.phi_range; + for (i2=0;i2<32;i2++) fprintf(stdout, "%d", (phirange&(1<> i2 ); + fprintf(stdout, "\t"); + unsigned int thetarange=c->range.theta_range; + for (i2=0;i2<32;i2++) fprintf(stdout, "%d", (thetarange&(1<> i2); + fprintf(stdout, "\t"); + + for (i2=0;i2n;i2++) + fprintf(stdout, "%d ", c->contents[i2]); + fprintf(stdout, "\n"); + } + + fprintf(stdout, "\n"); + return 0; +} + + +// get the overlap between 2 jets +// - j1 first jet +// - j2 second jet +// - overlap2 returned overlap^2 (determined by the choice of SM variable) +// return true if overlapping, false if disjoint +//--------------------------------------------------------------------- +bool CSphsplit_merge::get_overlap(const CSphjet &j1, const CSphjet &j2, double *overlap2){ + // check if ranges overlap + if (!is_range_overlap(j1.range,j2.range)) + return false; + + int i1,i2; + bool is_overlap; + + // initialise + i1=i2=idx_size=0; + is_overlap = false; + CSphmomentum v; + + // compute overlap + // at the same time, we store union in indices + do{ + if (j1.contents[i1]j2.contents[i2]){ + indices[idx_size] = j2.contents[i2]; + i2++; + } else { // (j1.contents[i1]==j2.contents[i2]) + v += particles[j2.contents[i2]]; + indices[idx_size] = j2.contents[i2]; + i1++; + i2++; + is_overlap = true; + } + idx_size++; + } while ((i1" all over the place + const CSphjet & j1 = * it_j1; + const CSphjet & j2 = * it_j2; + + i1=i2=0; + jet2.v = jet1.v = CSphmomentum(); + + // compute centroids + // When use_E_weighted_splitting is activated, the + // "geometrical" distance is weighted by the inverse + // of the E of the protojet + // This is stored in E{1,2}_weight + E1_weight = (use_E_weighted_splitting) ? 1.0/j1.v.E/j1.v.E : 1.0; + E2_weight = (use_E_weighted_splitting) ? 1.0/j2.v.E/j2.v.E : 1.0; + + // compute jet splitting + do{ + if (j1.contents[i1]_theta,v->_phi); + } else if (j1.contents[i1]>j2.contents[i2]){ + // particle i2 belong only to jet 2 + v = &(particles[j2.contents[i2]]); + jet2.contents.push_back(j2.contents[i2]); + jet2.v += *v; + //jet2.pt_tilde += pt[j2.contents[i2]]; + i2++; + jet2.range.add_particle(v->_theta,v->_phi); + } else { // (j1.contents[i1]==j2.contents[i2]) + // common particle, decide which is the closest centre + v = &(particles[j1.contents[i1]]); + + //TODO: improve this brutal use of atan2 and sqrt !!!! + + //? what when == ? + // When use_E_weighted_splitting is activated, the + // "geometrical" distance is weighted by the inverse + // of the E of the protojet + double d1 = get_distance(&(j1.v), v)*E1_weight; + double d2 = get_distance(&(j2.v), v)*E2_weight; + // do bookkeeping on most ambiguous split + if (fabs(d1-d2) < most_ambiguous_split) + most_ambiguous_split = fabs(d1-d2); + + if (d1_theta,v->_phi); + } else { + // particle i2 belong only to jet 2 + jet2.contents.push_back(j2.contents[i2]); + jet2.v += *v; + //jet2.pt_tilde += pt[j2.contents[i2]]; + jet2.range.add_particle(v->_theta,v->_phi); + } + + i1++; + i2++; + } + } while ((i1_theta,v->_phi); + } + while (i2_theta,v->_phi); + } + + // finalise jets + jet1.n = jet1.contents.size(); + jet2.n = jet2.contents.size(); + + // now the jet axis is known, we can compute Etilde + compute_Etilde(jet1); + compute_Etilde(jet2); + + // remove previous jets +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + cand_refs.erase(j1.v.ref); + cand_refs.erase(j2.v.ref); +#endif + candidates->erase(it_j1); + candidates->erase(it_j2); + + // reinsert new ones + insert(jet1); + insert(jet2); + + return true; +} + +// merge the two given jet. +// during this procedure, the jets j1 & j2 are replaced +// by 1 single jets containing both of them. +// - it_j1 iterator of the first jet in 'candidates' +// - it_j2 iterator of the second jet in 'candidates' +// return true on success, false on error +//////////////////////////////////////////////////////////////// +bool CSphsplit_merge::merge(cjet_iterator &it_j1, cjet_iterator &it_j2){ + CSphjet jet; + int i; + + // build new jet + // note: particles within j1 & j2 have already been stored in indices + for (i=0;irange, it_j2->range); + + // remove old candidates +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + if (merge_identical_protocones){ + cand_refs.erase(it_j1->v.ref); + cand_refs.erase(it_j2->v.ref); + } +#endif + candidates->erase(it_j1); + candidates->erase(it_j2); + + // reinsert new candidate + insert(jet); + + return true; +} + +/** + * Check whether or not a jet has to be inserted in the + * list of protojets. If it has, set its sm_variable and + * insert it to the list of protojets. + */ +bool CSphsplit_merge::insert(CSphjet &jet){ + + // eventually check that no other candidate are present with the + // same cone contents. We recall that this automatic merging of + // identical protocones can lead to infrared-unsafe situations. +#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES + if ((merge_identical_protocones) && (!cand_refs.insert(jet.v.ref).second)) + return false; +#endif + + // check that the protojet has large enough energy + if (jet.v.Einsert(jet); + + return true; +} + +/** + * given a 4-momentum and its associated pT, return the + * variable that has to be used for SM + * \param v 4 momentum of the protojet + * \param pt_tilde pt_tilde of the protojet + */ +double CSphsplit_merge::get_sm_var2(CSphmomentum &v, double &E_tilde){ + switch(ptcomparison.split_merge_scale) { + case SM_E: return v.E*v.E; + case SM_Etilde: return E_tilde*E_tilde; + default: + throw siscone::Csiscone_error("Unsupported split-merge scale choice: " + + ptcomparison.SM_scale_name()); + } + + //return 0.0; +} + + + +/// compute Etilde for a given jet +void CSphsplit_merge::compute_Etilde(CSphjet &jet){ + jet.v.build_norm(); + jet.E_tilde=0.0; + CSph3vector jet_axis = jet.v; + //if (jet.v._norm==0){ + // jet_axis = CSph3vector(0.0,0.0,0.0); + //} else { + jet_axis/=jet.v.E; + //} + //cout << "~~~ Axis: " << jet.v.px << " " << jet.v.py << " " << jet.v.pz << " " << jet.v._norm << endl; + //cout << "~~~ Axis: " << jet_axis.px << " " << jet_axis.py << " " << jet_axis.pz << endl; + for (vector::iterator cont_it=jet.contents.begin(); cont_it!=jet.contents.end(); cont_it++){ + const CSphmomentum &p = particles[*cont_it]; + jet.E_tilde+=p.E*(1.0+norm2_cross_product3(p,jet_axis)/particles_norm2[*cont_it]); + } +} + +} Property changes on: tags/siscone-3.0.5/siscone/spherical/split_merge.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/geom_2d.cpp =================================================================== --- tags/siscone-3.0.5/siscone/spherical/geom_2d.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/geom_2d.cpp (revision 426) @@ -0,0 +1,178 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: geom_2d.cpp // +// Description: source file for two-dimensional geometry tools // +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006-2008 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include "geom_2d.h" +#include + +namespace siscone_spherical{ + +#define PHI_RANGE_MASK 0xFFFFFFFF + +/********************************************************* + * class CSphtheta_phi_range implementation * + * class for holding a covering range in eta-phi * + * * + * This class deals with ranges in the eta-phi plane. It * + * implements methods to test if two ranges overlap and * + * to take the union of two overlapping intervals. * + *********************************************************/ + +using namespace std; + +// static member default init +//---------------------------- +double CSphtheta_phi_range::theta_min = 0.0; +double CSphtheta_phi_range::theta_max = M_PI; + +// default ctor +//-------------- +CSphtheta_phi_range::CSphtheta_phi_range(){ + theta_range = 0; + phi_range = 0; +} + +// ctor with initialisation +// we initialise with a centre (in eta,phi) and a radius +// - c_theta theta coordinate of the centre +// - c_phi phi coordinate of the centre +// - R radius +//------------------------------------------------------- +CSphtheta_phi_range::CSphtheta_phi_range(double c_theta, double c_phi, double R){ + // determination of the eta range + //------------------------------- + double xmin = max(c_theta-R,theta_min+0.00001); + double xmax = min(c_theta+R,theta_max-0.00001); + + unsigned int cell_min = get_theta_cell(xmin); + unsigned int cell_max = get_theta_cell(xmax); + + // warning: if cell_max==2^31, 2*cell_max==0 hence, + // even if the next formula is formally (2*cell_max-cell_min), + // expressing it as (cell_max-cell_min)+cell_max is safe. + theta_range = (cell_max-cell_min)+cell_max; + + // determination of the phi range + // !! taking care of periodicity !! + // !! and the theta dependence !! + //--------------------------------- + double ymin,ymax; + double extra = asin(R/M_PI); + // if the theta range comes too close to the endpoints (theta=0 or + // theta=pi), then keep the full phi range + if (xmin<=theta_min+extra){ + ymin = -M_PI+0.00001; + ymax = M_PI-0.00001; + } else if (xmax>=theta_max-extra){ + ymin = -M_PI+0.00001; + ymax = M_PI-0.00001; + } else { + extra = max(1.0/sin(xmin), 1.0/sin(xmax)); + ymin = (c_phi-R)*extra; + while (ymin<-M_PI) ymin+=twopi; + while (ymin> M_PI) ymin-=twopi; + ymax = (c_phi-R)*extra; + while (ymax<-M_PI) ymax+=twopi; + while (ymax> M_PI) ymax-=twopi; + } + cell_min = get_phi_cell(ymin); + cell_max = get_phi_cell(ymax); + + // Also, if the interval goes through pi, inversion is needed + if (ymax>ymin) + phi_range = (cell_max-cell_min)+cell_max; + else { + phi_range = (cell_min==cell_max) + ? PHI_RANGE_MASK + : ((PHI_RANGE_MASK^(cell_min-cell_max)) + cell_max); + } +} + +// assignment of range +// - r range to assign to current one +//--------------------------------------- +CSphtheta_phi_range& CSphtheta_phi_range::operator = (const CSphtheta_phi_range &r){ + theta_range = r.theta_range; + phi_range = r.phi_range; + + return *this; +} + +// add a particle to the range +// - eta eta coordinate of the particle +// - phi phi coordinate of the particle +// \return 0 on success, 1 on error +//---------------------------------------- +int CSphtheta_phi_range::add_particle(const double theta, const double phi){ + // get the theta cell + unsigned int theta_cell = get_theta_cell(theta); + + // deal with the eta coordinate + theta_range |= theta_cell; + + // deal with the phi coordinate + // + // watch out: if the theta_cell includes theta==0 or theta==pi, + // incude the full phi range + if ((theta_cell == 0x1) || (theta_cell == 0x80000000)) + phi_range = 0xffffffff; + else + phi_range |= get_phi_cell(phi); + + return 0; +} + + +// test overlap +// - r1 first range +// - r2 second range +// return true if overlap, false otherwise. +//------------------------------------------ +bool is_range_overlap(const CSphtheta_phi_range &r1, const CSphtheta_phi_range &r2){ + // check overlap in eta AND phi + return ((r1.theta_range & r2.theta_range) && (r1.phi_range & r2.phi_range)); +} + +// compute union +// Note: we assume that the two intervals overlap +// - r1 first range +// - r2 second range +// \return union of the two ranges +//------------------------------------------ +const CSphtheta_phi_range range_union (const CSphtheta_phi_range &r1, const CSphtheta_phi_range &r2){ + CSphtheta_phi_range tmp; + + // compute union in eta + tmp.theta_range = r1.theta_range | r2.theta_range; + + // compute union in phi + tmp.phi_range = r1.phi_range | r2.phi_range; + + return tmp; +} + +} Property changes on: tags/siscone-3.0.5/siscone/spherical/geom_2d.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Revision \ No newline at end of property Index: tags/siscone-3.0.5/siscone/spherical/README =================================================================== --- tags/siscone-3.0.5/siscone/spherical/README (revision 0) +++ tags/siscone-3.0.5/siscone/spherical/README (revision 426) @@ -0,0 +1 @@ +This directory hosts the sperical-coordinates version of SISCone Index: tags/siscone-3.0.5/siscone/spherical =================================================================== --- tags/siscone-3.0.5/siscone/spherical (revision 425) +++ tags/siscone-3.0.5/siscone/spherical (revision 426) Property changes on: tags/siscone-3.0.5/siscone/spherical ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,7 ## +Makefile.in + +.deps + +Makefile + +.libs Index: tags/siscone-3.0.5/siscone/protocones.cpp =================================================================== --- tags/siscone-3.0.5/siscone/protocones.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/protocones.cpp (revision 426) @@ -0,0 +1,849 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: protocones.cpp // +// Description: source file for stable cones determination (Cstable_cones) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +/******************************************************* + * Introductory note: * + * Since this file has many member functions, we have * + * structured them in categories: * + * INITIALISATION FUNCTIONS * + * - ctor() * + * - ctor(particle_list) * + * - dtor() * + * - init(particle_list) * + * ALGORITHM MAIN ENTRY * + * - get_stable_cone(radius) * + * ALGORITHM MAIN STEPS * + * - init_cone() * + * - test_cone() * + * - update_cone() * + * - proceed_with_stability() * + * ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS * + * - cocircular_pt_less(v1, v2) * + * - prepare_cocircular_list() * + * - test_cone_cocircular() * + * - test_stability(candidate, border_list) * + * - updat_cone_cocircular() * + * RECOMPUTATION OF CONE CONTENTS * + * - compute_cone_contents() * + * - recompute_cone_contents() * + * - recompute_cone_contents_if_needed() * + * VARIOUS TOOLS * + * - circle_intersect() * + * - is_inside() * + * - abs_dangle() * + *******************************************************/ + +#include "protocones.h" +#include "siscone_error.h" +#include "defines.h" +#include +#include +#include "circulator.h" +#include + +namespace siscone{ + +using namespace std; + +/********************************************************************** + * Cstable_cones implementation * + * Computes the list of stable comes from a particle list. * + * This class does the first fundamental task of te cone algorithm: * + * it is used to compute the list of stable cones given a list * + * of particles. * + **********************************************************************/ + +//////////////////////////////////////////////////////// +// INITIALISATION FUNCTIONS // +// - ctor() // +// - ctor(particle_list) // +// - dtor() // +// - init(particle_list) // +//////////////////////////////////////////////////////// + +// default ctor +//-------------- +Cstable_cones::Cstable_cones(){ + nb_tot = 0; + hc = NULL; +} + +// ctor with initialisation +//-------------------------- +Cstable_cones::Cstable_cones(vector &_particle_list) + : Cvicinity(_particle_list){ + + nb_tot = 0; + hc = NULL; +} + +// default dtor +//-------------- +Cstable_cones::~Cstable_cones(){ + if (hc!=NULL) delete hc; +} + +/* + * initialisation + * - _particle_list list of particles + * - _n number of particles + *********************************************************************/ +void Cstable_cones::init(vector &_particle_list){ + // check already allocated mem + if (hc!=NULL){ + delete hc; + } + if (protocones.size()!=0) + protocones.clear(); + + multiple_centre_done.clear(); + + // initialisation + set_particle_list(_particle_list); +} + + +//////////////////////////////////////////////////////// +// ALGORITHM MAIN ENTRY // +// - get_stable_cone(radius) // +//////////////////////////////////////////////////////// + +/* + * compute stable cones. + * This function really does the job i.e. computes + * the list of stable cones (in a seedless way) + * - _radius: radius of the cones + * The number of stable cones found is returned + *********************************************************************/ +int Cstable_cones::get_stable_cones(double _radius){ + int p_idx; + + // check if everything is correctly initialised + if (n_part==0){ + return 0; + } + + R = _radius; + R2 = R*R; + + // allow hash for cones candidates + hc = new hash_cones(n_part, R2); + + // browse all particles + for (p_idx=0;p_idxv; + centre_idx = first_cone; + + // build the initial cone (nodist: avoids calculating distances -- + // just deduces contents by circulating around all in/out operations) + // this function also sets the list of included particles + compute_cone_contents(); + + return 0; +} + + +/* + * test cones. + * We check if the cone(s) built with the present parent and child + * are stable + * return 0 on success 1 on error + *********************************************************************/ +int Cstable_cones::test_cone(){ + Creference weighted_cone_ref; + + // depending on the side we are taking the child particle, + // we test different configuration. + // Each time, two configurations are tested in such a way that + // all 4 possible cases (parent or child in or out the cone) + // are tested when taking the pair of particle parent+child + // and child+parent. + + // here are the tests entering the first series: + // 1. check if the cone is already inserted + // 2. check cone stability for the parent and child particles + + if (centre->side){ + // test when both particles are not in the cone + // or when both are in. + // Note: for the totally exclusive case, test emptyness before + cone_candidate = cone; + if (cone.ref.not_empty()){ + hc->insert(&cone_candidate, parent, child, false, false); + } + + cone_candidate = cone; + cone_candidate+= *parent + *child; + hc->insert(&cone_candidate, parent, child, true, true); + } else { + // test when 1! of the particles is in the cone + cone_candidate = cone + *parent; + hc->insert(&cone_candidate, parent, child, true, false); + + cone_candidate = cone + *child; + hc->insert(&cone_candidate, parent, child, false, true); + } + + nb_tot+=2; + + return 0; +} + + +/* + * update the cone + * go to the next child for that parent and update 'cone' appropriately + * return 0 if update candidate found, 1 otherwise + ***********************************************************************/ +int Cstable_cones::update_cone(){ + // get the next child and centre + centre_idx++; + if (centre_idx==vicinity_size) + centre_idx=0; + if (centre_idx==first_cone) + return 1; + + // update the cone w.r.t. the old child + // only required if the old child is entering inside in which + // case we need to add it. We also know that the child is + // inside iff its side is -. + if (!centre->side){ + // update cone + cone += (*child); + + // update info on particles inside + centre->is_inside->cone = true; + + // update stability check quantities + dpt += fabs(child->px)+fabs(child->py); + } + + // update centre and child to correspond to the new position + centre = vicinity[centre_idx]; + child = centre->v; + + // check cocircularity + // note that if cocirculaity is detected (i.e. if we receive 1 + // in the next test), we need to recall 'update_cone' directly + // since tests and remaining part of te update has been performed + //if (cocircular_check()) + if (cocircular_check()) + return update_cone(); + + + // update the cone w.r.t. the new child + // only required if the new child was already inside in which + // case we need to remove it. We also know that the child is + // inside iff its side is +. + if ((centre->side) && (cone.ref.not_empty())){ + // update cone + cone -= (*child); + + // update info on particles inside + centre->is_inside->cone = false; + + // update stability check quantities + dpt += fabs(child->px)+fabs(child->py); //child->perp2(); + } + + // check that the addition and subtraction of vectors does + // not lead to too much rounding error + // for that, we compute the sum of pt modifications and of |pt| + // since last recomputation and once the ratio overpasses a threshold + // we recompute vicinity. + if ((dpt>PT_TSHOLD*(fabs(cone.px)+fabs(cone.py))) && (cone.ref.not_empty())){ + recompute_cone_contents(); + } + if (cone.ref.is_empty()){ + cone = Cmomentum(); + dpt=0.0; + } + + return 0; +} + + +/* + * compute stability of all enumerated candidates. + * For all candidate cones which are stable w.r.t. their border particles, + * pass the last test: stability with quadtree intersection + ************************************************************************/ +int Cstable_cones::proceed_with_stability(){ + int i; // ,n; + hash_element *elm; + + //n=0; + for (i=0;i<=hc->mask;i++){ + // test ith cell of the hash array + elm = hc->hash_array[i]; + + // browse elements therein + while (elm!=NULL){ + // test stability + if (elm->is_stable){ + // stability is not ensured by all pairs of "edges" already browsed +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + // => testing stability with quadtree intersection + if (quadtree->circle_intersect(elm->eta, elm->phi, R2)==elm->ref){ +#else + // => testing stability with the particle-list intersection + if (circle_intersect(elm->eta, elm->phi)==elm->ref){ +#endif + // add it to the list of protocones + // note that in its present form, we do not allocate the + // 4-vector components of the momentum. There's no need to + // do it here as it will be recomputed in + // Csplit_merge::add_protocones + protocones.push_back(Cmomentum(elm->eta, elm->phi, elm->ref)); + } + } + + // jump to the next one + elm = elm->next; + } + } + + // free hash + // we do that at this level because hash eats rather a lot of memory + // we want to free it before running the split/merge algorithm +#ifdef DEBUG_STABLE_CONES + nb_hash_cones = hc->n_cones; + nb_hash_occupied = hc->n_occupied_cells; +#endif + + delete hc; + hc=NULL; + + return protocones.size(); +} + + +//////////////////////////////////////////////////////// +// ALGORITHM MAIN STEPS FOR COCIRCULAR SITUATIONS // +// - cocircular_pt_less(v1, v2) // +// - prepare_cocircular_list() // +// - test_cone_cocircular() // +// - test_stability(candidate, border_vect) // +// - updat_cone_cocircular() // +//////////////////////////////////////////////////////// + +/// pt-ordering of momenta used for the cocircular case +bool cocircular_pt_less(Cmomentum *v1, Cmomentum *v2){ + return v1->perp2() < v2->perp2(); +} + +/* + * run through the vicinity of the current parent and for each child + * establish which other members are cocircular... Note that the list + * associated with each child contains references to vicinity + * elements: thus two vicinity elements each associated with one given + * particle may appear in a list -- this needs to be watched out for + * later on... + **********************************************************************/ +void Cstable_cones::prepare_cocircular_lists() { + circulator::iterator > here(vicinity.begin(), + vicinity.begin(), + vicinity.end()); + + circulator::iterator > search(here); + + do { + Cvicinity_elm* here_pntr = *here(); + search.set_position(here); + + // search forwards for things that should have "here" included in + // their cocircularity list + while (true) { + ++search; + if ( abs_dphi((*search())->angle, here_pntr->angle) < + here_pntr->cocircular_range + && search() != here()) { + (*search())->cocircular.push_back(here_pntr); + } else { + break; + } + } + + // search backwards + search.set_position(here); + while (true) { + --search; + if ( abs_dphi((*search())->angle, here_pntr->angle) < + here_pntr->cocircular_range + && search() != here()) { + (*search())->cocircular.push_back(here_pntr); + } else { + break; + } + } + + ++here; + } while (here() != vicinity.begin()); + +} + +/* + * Testing cocircular configurations in p^3 time, + * rather than 2^p time; we will test all contiguous subsets of points + * on the border --- note that this is till probably overkill, since + * in principle we only have to test situations where up to a + * half-circle is filled (but going to a full circle is simpler) + ******************************************************************/ +void Cstable_cones::test_cone_cocircular(Cmomentum & borderless_cone, + list & border_list) { + vector border_vect; + + border_vect.reserve(border_list.size()); + for (list::iterator it = border_list.begin(); + it != border_list.end(); it++) { + border_vect.push_back(Cborder_store(*it, centre->eta, centre->phi)); + } + + // get them into order of angle + sort(border_vect.begin(), border_vect.end()); + + // set up some circulators, since these will help us go around the + // circle easily + circulator::iterator > + start(border_vect.begin(), border_vect.begin(),border_vect.end()); + circulator::iterator > mid(start), end(start); + + // test the borderless cone + Cmomentum candidate = borderless_cone; + candidate.build_etaphi(); + if (candidate.ref.not_empty()) + test_stability(candidate, border_vect); + + do { + // reset status wrt inclusion in the cone + mid = start; + do { + mid()->is_in = false; + } while (++mid != start); + + // now run over all inclusion possibilities with this starting point + candidate = borderless_cone; + while (++mid != start) { + // will begin with start+1 and go up to start-1 + mid()->is_in = true; + candidate += *(mid()->mom); + test_stability(candidate, border_vect); + } + + } while (++start != end); + + // mid corresponds to momentum that we need to include to get the + // full cone + mid()->is_in = true; + candidate += *(mid()->mom); + test_stability(candidate, border_vect); +} + + +/** + * carry out the computations needed for the stability check of the + * candidate, using the border_vect to indicate which particles + * should / should not be in the stable cone; if the cone is stable + * insert it into the hash. + **********************************************************************/ +void Cstable_cones::test_stability(Cmomentum & candidate, const vector & border_vect) { + + // this almost certainly has not been done... + candidate.build_etaphi(); + + bool stable = true; + for (unsigned i = 0; i < border_vect.size(); i++) { + if (is_inside(&candidate, border_vect[i].mom) ^ (border_vect[i].is_in)) { + stable = false; + break; // it's unstable so there's no point continuing + } + } + + if (stable) hc->insert(&candidate); +} + +/* + * check if we are in a situation of cocircularity. + * if it is the case, update and test in the corresponding way + * return 'false' if no cocircularity detected, 'true' otherwise + * Note that if cocircularity is detected, we need to + * recall 'update' from 'update' !!! + ***************************************************************/ +bool Cstable_cones::cocircular_check(){ + // check if many configurations have the same centre. + // if this is the case, branch on the algorithm for this + // special case. + // Note that those situation, being considered separately in + // test_cone_multiple, must only be considered here if all + // angles are on the same side (this avoid multiple counting) + + if (centre->cocircular.empty()) return false; + + // first get cone into status required at end... + if ((centre->side) && (cone.ref.not_empty())){ + // update cone + cone -= (*child); + + // update info on particles inside + centre->is_inside->cone = false; + + // update stability check quantities + dpt += fabs(child->px)+fabs(child->py); //child->perp2(); + } + + + // now establish the list of unique children in the list + // first make sure parent and child are in! + + list removed_from_cone; + list put_in_border; + list border_list; + + Cmomentum cone_removal; + Cmomentum border = *parent; + border_list.push_back(parent); + + // make sure child appears in the border region + centre->cocircular.push_back(centre); + + // now establish the full contents of the cone minus the cocircular + // region and of the cocircular region itself + for(list::iterator it = centre->cocircular.begin(); + it != centre->cocircular.end(); it++) { + + if ((*it)->is_inside->cone) { + cone_removal += *((*it)->v); + (*it)->is_inside->cone = false; + removed_from_cone.push_back((*it)->is_inside); + } + + // if a point appears twice (i.e. with + and - sign) in the list of + // points on the border, we take care not to include it twice. + // Note that this situation may appear when a point is at a distance + // close to 2R from the parent + if (!(*it)->is_inside->cocirc) { + border += *((*it)->v); + (*it)->is_inside->cocirc = true; + put_in_border.push_back((*it)->is_inside); + border_list.push_back((*it)->v); + } + } + + + // figure out whether this pairing has been observed before + Cmomentum borderless_cone = cone; + borderless_cone -= cone_removal; + bool consider = true; + for (unsigned int i=0;i(borderless_cone.ref, + border.ref)); + + // first figure out whether our cone momentum is good + double local_dpt = fabs(cone_removal.px) + fabs(cone_removal.py); + double total_dpt = dpt + local_dpt; + + recompute_cone_contents_if_needed(borderless_cone, total_dpt); + if (total_dpt == 0) { + // a recomputation has taken place -- so take advantage of this + // and update the member cone momentum + cone = borderless_cone + cone_removal; + dpt = local_dpt; + } + + test_cone_cocircular(borderless_cone, border_list); + } + + + // relabel things that were in the cone but got removed + for(list::iterator is_in = removed_from_cone.begin(); + is_in != removed_from_cone.end(); is_in++) { + (*is_in)->cone = true; + } + + // relabel things that got put into the border + for(list::iterator is_in = put_in_border.begin(); + is_in != put_in_border.end(); is_in++) { + (*is_in)->cocirc = false; + } + + // we're done with everything -- return true to signal to user that we've + // been through the co-circularity rigmarole + return true; +} + + +//////////////////////////////////////////////////////// +// RECOMPUTATION OF CONE CONTENTS // +// - compute_cone_contents() // +// - recompute_cone_contents() // +// - recompute_cone_contents_if_needed() // +//////////////////////////////////////////////////////// + +/** + * compute the cone contents by going once around the full set of + * circles and tracking the entry/exit status each time + * given parent, child and centre compute the momentum + * of the particle inside the cone + * This sets up the inclusion information, which can then be directly + * used to calculate the cone momentum. + **********************************************************************/ +void Cstable_cones::compute_cone_contents() { + circulator::iterator > + start(vicinity.begin()+first_cone, vicinity.begin(), vicinity.end()); + + circulator::iterator > here(start); + + // note that in the following algorithm, the cone contents never includes + // the child. Indeed, if it has positive sign, then it will be set as + // outside at the last step in the loop. If it has negative sign, then the + // loop will at some point go to the corresponding situation with positive + // sign and set the inclusion status to 0. + + do { + // as we leave this position a particle enters if its side is + // negative (i.e. the centre is the one at -ve angle wrt to the + // parent-child line + if (!(*here())->side) ((*here())->is_inside->cone) = 1; + + // move on to the next position + ++here; + + // as we arrive at this position a particle leaves if its side is positive + if ((*here())->side) ((*here())->is_inside->cone) = 0; + } while (here != start); + + // once we've reached the start the 'is_inside' information should be + // 100% complete, so we can use it to calculate the cone contents + // and then exit + recompute_cone_contents(); + return; + +} + + +/* + * compute the cone momentum from particle list. + * in this version, we use the 'pincluded' information + * from the Cvicinity class + */ +void Cstable_cones::recompute_cone_contents(){ + unsigned int i; + + // set momentum to 0 + cone = Cmomentum(); + + // Important note: we can browse only the particles + // in vicinity since all particles in the cone are + // withing a distance 2R w.r.t. parent hence in vicinity. + // Among those, we only add the particles for which 'is_inside' is true ! + // This methos rather than a direct comparison avoids rounding errors + for (i=0;iside) && (vicinity[i]->is_inside->cone)) + cone += *vicinity[i]->v; + } + + // set check variables back to 0 + dpt = 0.0; +} + + +/* + * if we have gone beyond the acceptable threshold of change, compute + * the cone momentum from particle list. in this version, we use the + * 'pincluded' information from the Cvicinity class, but we don't + * change the member cone, only the locally supplied one + */ +void Cstable_cones::recompute_cone_contents_if_needed(Cmomentum & this_cone, + double & this_dpt){ + + if (this_dpt > PT_TSHOLD*(fabs(this_cone.px)+fabs(this_cone.py))) { + if (cone.ref.is_empty()) { + this_cone = Cmomentum(); + } else { + // set momentum to 0 + this_cone = Cmomentum(); + + // Important note: we can browse only the particles + // in vicinity since all particles in the this_cone are + // withing a distance 2R w.r.t. parent hence in vicinity. + // Among those, we only add the particles for which 'is_inside' is true ! + // This methos rather than a direct comparison avoids rounding errors + for (unsigned int i=0;iside) && (vicinity[i]->is_inside->cone)) + this_cone += *vicinity[i]->v; + } + + } + // set check variables back to 0 + this_dpt = 0.0; + } + +} + + +//////////////////////////////////////////////////////// +// VARIOUS TOOLS // +// - circle_intersect() // +// - is_inside() // +// - abs_dangle() // +//////////////////////////////////////////////////////// + + +/* + * circle intersection. + * computes the intersection with a circle of given centre and radius. + * The output takes the form of a checkxor of the intersection's particles + * - cx circle centre x coordinate + * - cy circle centre y coordinate + * return the checkxor for the intersection + ******************************************************************/ +Creference Cstable_cones::circle_intersect(double cx, double cy){ + Creference intersection; + int i; + double dx, dy; + + for (i=0;iM_PI) + dy -= twopi; + + // really check if the distance is less than VR + if (dx*dx+dy*dyeta - v->eta; + dy = fabs(centre_in->phi - v->phi); + if (dy>M_PI) + dy -= twopi; + + return dx*dx+dy*dyM_PI) + dphi = dphi-twopi; + + return dphi; +} + +} Property changes on: tags/siscone-3.0.5/siscone/protocones.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/vicinity.cpp =================================================================== --- tags/siscone-3.0.5/siscone/vicinity.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/vicinity.cpp (revision 426) @@ -0,0 +1,296 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: vicinity.cpp // +// Description: source file for particle vicinity (Cvicinity class) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include "vicinity.h" +#include +#include +#include + +namespace siscone{ + +using namespace std; + +/************************************************************* + * Cvicinity_elm implementation * + * element in the vicinity of a parent. * + * class used to manage one points in the vicinity * + * of a parent point. * + *************************************************************/ + +// ordering pointers to Cvicinity_elm +//------------------------------------ +bool ve_less(Cvicinity_elm *ve1, Cvicinity_elm *ve2){ + return ve1->angle < ve2->angle; +} + + +/************************************************************* + * Cvicinity implementation * + * list of element in the vicinity of a parent. * + * class used to manage the points which are in the vicinity * + * of a parent point. The construction of the list can be * + * made from a list of points or from a quadtree. * + *************************************************************/ + +// default constructor +//--------------------- +Cvicinity::Cvicinity(){ + n_part = 0; + + ve_list = NULL; +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + quadtree = NULL; +#endif + + parent = NULL; + VR2 = VR = 0.0; + +} + +// constructor with initialisation +//--------------------------------- +Cvicinity::Cvicinity(vector &_particle_list){ + parent = NULL; +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + quadtree = NULL; +#endif + VR2 = VR = 0.0; + + ve_list = NULL; + set_particle_list(_particle_list); +} + +// default destructor +//-------------------- +Cvicinity::~Cvicinity(){ + if (ve_list!=NULL) + delete[] ve_list; + +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + if (quadtree!=NULL) + delete quadtree; +#endif +} + +/* + * set the particle_list + * - particle_list list of particles (type Cmomentum) + * - n number of particles in the list + ************************************************************/ +void Cvicinity::set_particle_list(vector &_particle_list){ + int i,j; +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + double eta_max=0.0; +#endif + + // if the particle list is not empty, destroy it ! + if (ve_list!=NULL){ + delete[] ve_list; + } + vicinity.clear(); +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + if (quadtree!=NULL) + delete quadtree; +#endif + + // allocate memory array for particles + // Note: - we compute max for |eta| + // - we allocate indices to particles + n_part = 0; + plist.clear(); + pincluded.clear(); + for (i=0;i<(int) _particle_list.size();i++){ + // if a particle is colinear with the beam (infinite rapidity) + // we do not take it into account + if (fabs(_particle_list[i].pz)!=_particle_list[i].E){ + plist.push_back(_particle_list[i]); + pincluded.push_back(Cvicinity_inclusion()); // zero inclusion status + + // the parent_index is handled in the split_merge because + // of our multiple-pass procedure. + // Hence, it is not required here any longer. + // plist[n_part].parent_index = i; + plist[n_part].index = n_part; + + // make sure the reference is randomly created + plist[n_part].ref.randomize(); + +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + if (fabs(plist[n_part].eta)>eta_max) eta_max=fabs(plist[n_part].eta); +#endif + + n_part++; + } + } + + // allocate quadtree and vicinity_elm list + // note: we set phi in [-pi:pi] as it is the natural range for atan2! + ve_list = new Cvicinity_elm[2*n_part]; +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + eta_max+=0.1; + quadtree = new Cquadtree(0.0, 0.0, eta_max, M_PI); +#endif + + // append particle to the vicinity_elm list + j = 0; + for (i=0;iadd(&plist[i]); +#endif + ve_list[j].v = ve_list[j+1].v = &plist[i]; + ve_list[j].is_inside = ve_list[j+1].is_inside = &(pincluded[i]); + j+=2; + } + +} + + +/* + * build the vicinity list from a list of points. + * - _parent reference particle + * - _VR vicinity radius + ************************************************************/ +void Cvicinity::build(Cmomentum *_parent, double _VR){ + int i; + + // set parent and radius + parent = _parent; + VR = _VR; + VR2 = VR*VR; + R2 = 0.25*VR2; + R = 0.5*VR; + inv_R_EPS_COCIRC = 1.0 / R / EPSILON_COCIRCULAR; + inv_R_2EPS_COCIRC = 0.5 / R / EPSILON_COCIRCULAR; + + // clear vicinity + vicinity.clear(); + + // init parent variables + pcx = parent->eta; + pcy = parent->phi; + + // really browse the particle list + for (i=0;i0) ? 0.0 : 2.0; + double t=c/s; + return (s>0) ? 1-t/(1+fabs(t)) : 3-t/(1+fabs(t)); +} + + +/* + * append a particle to the 'vicinity' list after + * having computed the angular-ordering quantities + * - v vector to test + **********************************************************/ +void Cvicinity::append_to_vicinity(Cmomentum *v){ + double dx, dy, d2; + + // skip the particle itself) + if (v==parent) + return; + + int i=2*(v->index); + + // compute the distance of the i-th particle with the parent + dx = v->eta - pcx; + dy = v->phi - pcy; + + // pay attention to the periodicity in phi ! + if (dy>M_PI) + dy -= twopi; + else if (dy<-M_PI) + dy += twopi; + + d2 = dx*dx+dy*dy; + + // really check if the distance is less than VR + if (d2eta - ve_list[i+1].eta, + phi_in_range(v->phi-ve_list[i+1].phi)); + + // two sources of error are (GPS CCN29-19) epsilon/(R sin theta) + // and sqrt(2*epsilon/(R (1-cos theta))) and the way things work + // out, it is the _smaller_ of the two that is relevant [NB have + // changed definition of theta here relative to that used in + // CCN29] [NB2: write things so as to avoid zero denominators and + // to minimize the multiplications, divisions and above all sqrts + // -- that means that c & s are defined including a factor of VR2] + c = dot_product(OP,OC); + s = fabs(cross_product(OP,OC)); + double inv_err1 = s * inv_R_EPS_COCIRC; + double inv_err2_sq = (R2-c) * inv_R_2EPS_COCIRC; + ve_list[i].cocircular_range = pow2(inv_err1) > inv_err2_sq ? + 1.0/inv_err1 : + sqrt(1.0/inv_err2_sq); + ve_list[i+1].cocircular_range = ve_list[i].cocircular_range; + } +} + +} Property changes on: tags/siscone-3.0.5/siscone/vicinity.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/reference.cpp =================================================================== --- tags/siscone-3.0.5/siscone/reference.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/reference.cpp (revision 426) @@ -0,0 +1,120 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: reference.cpp // +// Description: source file for checkxor management (Creference class) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include "reference.h" +#include "ranlux.h" +#include + +namespace siscone{ + +/******************************************************* + * Creference implementation * + * references used for checksums. * + * * + * This class implements some reference variable * + * that can be used for checksums. Those checksums * + * are useful to disentengle between contents of two * + * cones without looking into their explicit particle * + * contents. * + *******************************************************/ + +// default constructor +////////////////////// +Creference::Creference(){ + ref[0] = ref[1] = ref[2] = 0; +} + + //static unsigned int reference_bit = 1; + +// create a random reference +//--------------------------- +void Creference::randomize(){ +// ref[0] = reference_bit; +// ref[1] = 0; +// ref[2] = 0; +// reference_bit <<= 1; + + unsigned int r1 = ranlux_get(); + unsigned int r2 = ranlux_get(); + unsigned int r3 = ranlux_get(); + unsigned int r4 = ranlux_get(); + // since ranlux only produces 24 bits, take r4 and add 8 bits + // from it to each of r1,r2, r3 to get 3*32 bits. + ref[0] = r1+((r4 & 0x00ff0000) << 8); + ref[1] = r2+((r4 & 0x0000ff00) << 16); + ref[2] = r3+((r4 & 0x000000ff) << 24); + + if (is_empty()) randomize(); +} + +// test emptyness +//---------------- +bool Creference::is_empty(){ + return (ref[0]==0) && (ref[1]==0) && (ref[2]==0); +} + +// test non-emptyness +//-------------------- +bool Creference::not_empty(){ + return (ref[0]!=0) || (ref[1]!=0) || (ref[2]!=0); +} + +// assignment of reference +//------------------------- +Creference& Creference::operator = (const Creference &r){ + ref[0] = r.ref[0]; + ref[1] = r.ref[1]; + ref[2] = r.ref[2]; + return *this; +} + +// addition of reference +//----------------------- +Creference Creference::operator + (const Creference &r){ + Creference tmp = *this; + return tmp+=r; +} + +// incrementation of reference +//----------------------------- +Creference& Creference::operator += (const Creference &r){ + ref[0] ^= r.ref[0]; + ref[1] ^= r.ref[1]; + ref[2] ^= r.ref[2]; + return *this; +} + +// decrementation of reference +//----------------------------- +Creference& Creference::operator -= (const Creference &r){ + ref[0] ^= r.ref[0]; + ref[1] ^= r.ref[1]; + ref[2] ^= r.ref[2]; + return *this; +} + +} + Property changes on: tags/siscone-3.0.5/siscone/reference.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/protocones.h =================================================================== --- tags/siscone-3.0.5/siscone/protocones.h (revision 0) +++ tags/siscone-3.0.5/siscone/protocones.h (revision 426) @@ -0,0 +1,271 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: protocones.h // +// Description: header file for stable cones determination (Cstable_cones) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __PROTOCONES_H__ +#define __PROTOCONES_H__ + +#include "momentum.h" +#include "vicinity.h" +#include +#include +#include +#include "hash.h" + +#include "defines.h" + +namespace siscone{ + +/** + * \class Cborder_store + * + * class for storing a border momentum (in context of co-circularity + * checks). + + * This class essentially calculates angle of border point w.r.t. + * circle center (eta & phi), and provides a store of information + * about whether we are currently including this point in the + * candidate + */ +class Cborder_store{ +public: + /// default ctor + Cborder_store(Cmomentum * momentum, double centre_eta, double centre_phi) : + mom(momentum), is_in(false) { + angle = atan2(mom->phi - centre_phi, mom->eta - centre_eta); + } + + Cmomentum * mom; ///< particle momentum + double angle; ///< angle w.r.t. circle centre + bool is_in; ///< inclusion status of the particle +}; + + +/// allows easy sorting of Cborder_store objects (which need to be +/// ordered in angle). +inline bool operator<(const Cborder_store & a, const Cborder_store & b) { + return a.angle < b.angle; +} + + +/** + * \class Cstable_cones + * \brief Computes the list of stable comes from a particle list. + * + * This class does the first fundamental task of te cone algorithm: + * it is used to compute the list of stable cones given a list + * of particles. + */ +class Cstable_cones : public Cvicinity{ + public: + /// default ctor + Cstable_cones(); + + /// ctor with initialisation (sse init for details) + Cstable_cones(std::vector &_particle_list); + + /// default dtor + ~Cstable_cones(); + + /** + * initialisation + * \param _particle_list list of particles + */ + void init(std::vector &_particle_list); + + /** + * compute stable cones. + * This function really does the job i.e. computes + * the list of stable cones (in a seedless way) + * \param _radius radius of the cones + * \return The number of stable cones found is returned + */ + int get_stable_cones(double _radius); + + /// list of stable cones + std::vector protocones; + + /// list of candidates + hash_cones *hc; + + /// total number of tested cones + int nb_tot; +#ifdef DEBUG_STABLE_CONES + int nb_hash_cones, nb_hash_occupied; +#endif + + protected: + /// cone radius + double R; + + /// cone radius SQUARED + double R2; + + private: + /// cone with a given particle as parent + /// this reduction to a single vector assumes we trust the checksums + Cmomentum cone; + + /// child particle, taken in the 'vicinity' list + Cmomentum *child; + + /// centre of the tested cone + Cvicinity_elm *centre; + + /// index in the particle list; + unsigned int centre_idx; + + /// first cone used in the vicinity list + unsigned int first_cone; + + /** + * initialise the cone. + * We take the first particle in the angular ordering to compute this one + * \return 0 on success, 1 on error + */ + int init_cone(); + + /** + * test cones. + * We check if the cone(s) build with the present parent and child + * are stable + * \return 0 on success 1 on error + */ + int test_cone(); + + /** + * update the cone + * go to the next child for that parent and update 'cone' appropriately + * \return 0 if update candidate found, 1 otherwise + */ + int update_cone(); + + /* + * run through the vicinity of the current parent and for each child + * indicate which members are cocircular... + */ + void prepare_cocircular_lists(); + + /** + * check if we are in a situation of cocircularity. + * if it is the case, update and test in the corresponding way + * \return 'false' if no cocircularity detected, 'true' otherwise + * Note that if cocircularity is detected, we need to + * recall 'update' from 'update' !!! + */ + bool cocircular_check(); + + /** + * Routine for testing cocircular configurations in p^3 time, + * rather than 2^p time; + */ + void test_cone_cocircular(Cmomentum & borderless_cone, + std::list & border_list); + + /** + * carry out the computations needed for the stability check of the + * candidate, using the border_vect to indicate which particles + * should / should not be in the stable cone; if the cone is stable + * insert it into the hash. + */ + void test_stability(Cmomentum & candidate, + const std::vector & border_vect); + + /** + * compute the cone contents by going once around the full set of + * circles and tracking the entry/exit status each time -- this sets + * up the inclusion information, which can then be directly used to + * calculate the cone momentum. + */ + void compute_cone_contents(); + + /** + * compute the cone momentum from particle list. + * in this version, we use the 'pincluded' information + * from the Cviinity class + */ + void recompute_cone_contents(); + + /* + * if we have gone beyond the acceptable threshold of change, compute + * the cone momentum from particle list. in this version, we use the + * 'pincluded' information from the Cvicinity class, but we don't + * change the member cone, only the locally supplied one + */ + void recompute_cone_contents_if_needed(Cmomentum & this_cone, double & this_dpt); + + /** + * compute stability of all enumerated candidates. + * For all candidate cones which are stable w.r.t. their border particles, + * pass the last test: stability with quadtree intersection + */ + int proceed_with_stability(); + + /* + * circle intersection. + * computes the intersection with a circle of given centre and radius. + * The output takes the form of a checkxor of the intersection's particles + * - cx circle centre x coordinate + * - cy circle centre y coordinate + * return the checkxor for the intersection + ******************************************************************/ + Creference circle_intersect(double cx, double cy); + + /// present candidate cone + Cmomentum cone_candidate; + + /// in case of co-circular points, vector for them + std::vector child_list; + + /// list of cocircular enclusures already studied + /// first element if cone contents, second is cone border + std::vector< std::pair > multiple_centre_done; + + // information for updating cone contents to avoid rounding errors + double dpt; ///< sums of Delta P_t + + /** + * test if a particle is inside a cone of given centre. + * check if the particle of coordinates 'v' is inside the circle of radius R + * centered at 'centre'. + * \param centre centre of the circle + * \param v particle to test + * \return true if inside, false if outside + */ + inline bool is_inside(Cmomentum *centre, Cmomentum *v); +}; + +/* + * compute the absolute value of the difference between 2 angles. + * We take care of the 2pi periodicity + * \param angle1 first angle + * \param angle2 second angle + * \return the absolute value of the difference between the angles + *****************************************************************/ +inline double abs_dangle(double &angle1, double &angle2); + +} +#endif Property changes on: tags/siscone-3.0.5/siscone/protocones.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/momentum.cpp =================================================================== --- tags/siscone-3.0.5/siscone/momentum.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/momentum.cpp (revision 426) @@ -0,0 +1,161 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: momentum.cpp // +// Description: source file for 4-momentum class Cmomentum // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include "momentum.h" +#include +#include + +namespace siscone{ + +/************************************************************************* + * class Cmomentum * + * This class contains the information for particle or group of * + * particles management. * + * It includes all Lorentz properties as well as tools for summing them. * + *************************************************************************/ + +// default ctor +//-------------- +Cmomentum::Cmomentum(){ + eta = 0.0; + phi = 0.0; + px = py = pz = E = 0.0; + ref = Creference(); + index = -1; +} + +// ctor with initialisation +//-------------------------- +Cmomentum::Cmomentum(double _px, double _py, double _pz, double _E){ + px = _px; + py = _py; + pz = _pz; + E = _E; + + // compute eta and phi + build_etaphi(); + ref = Creference(); +} + +// ctor with detailed initialisation +//----------------------------------- +Cmomentum::Cmomentum(double _eta, double _phi, Creference _ref){ + eta = _eta; + phi = _phi; + + ref = _ref; +} + +// default dtor +//-------------- +Cmomentum::~Cmomentum(){ + +} + +// assignment of vectors +//----------------------- +Cmomentum& Cmomentum::operator = (const Cmomentum &v){ + px = v.px; + py = v.py; + pz = v.pz; + E = v.E; + + eta = v.eta; + phi = v.phi; + + ref = v.ref; + return *this; +} + +// addition of vectors +// !!! WARNING !!! no updating of eta and phi !!! +//------------------------------------------------ +const Cmomentum Cmomentum::operator + (const Cmomentum &v){ + Cmomentum tmp = *this; + return tmp+=v; +} + +// incrementation of vectors +// !!! WARNING !!! no updating of eta and phi !!! +//------------------------------------------------ +Cmomentum& Cmomentum::operator += (const Cmomentum &v){ + px+=v.px; + py+=v.py; + pz+=v.pz; + E +=v.E; + + ref+=v.ref; + + return *this; +} + +// incrementation of vectors +// !!! WARNING !!! no updating of eta and phi !!! +//------------------------------------------------ +Cmomentum& Cmomentum::operator -= (const Cmomentum &v){ + px-=v.px; + py-=v.py; + pz-=v.pz; + E -=v.E; + + ref-=v.ref; + return *this; +} + +// build eta-phi from 4-momentum info +// !!! WARNING !!! +// !!! computing eta and phi is time-consuming !!! +// !!! use this whenever you need eta or phi !!! +// !!! automatically called for single-particle !!! +//-------------------------------------------------- +void Cmomentum::build_etaphi(){ + // note: the factor n (ref.nb) cancels in all expressions !! + eta = 0.5*log((E+pz)/(E-pz)); + phi = atan2(py,px); +} + + +// ordering of two vectors +// the default ordering is w.r.t. their references +//------------------------------------------------- +bool operator < (const Cmomentum &v1, const Cmomentum &v2){ + return v1.ref < v2.ref; +} + +// ordering of vectors in eta (e.g. used in collinear tests) +//----------------------------------------------------------- +bool momentum_eta_less(const Cmomentum &v1, const Cmomentum &v2){ + return v1.eta < v2.eta; +} + +// ordering of vectors in pt +//--------------------------- +bool momentum_pt_less(const Cmomentum &v1, const Cmomentum &v2){ + return v1.perp2() < v2.perp2(); +} + +} + Property changes on: tags/siscone-3.0.5/siscone/momentum.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/reference.h =================================================================== --- tags/siscone-3.0.5/siscone/reference.h (revision 0) +++ tags/siscone-3.0.5/siscone/reference.h (revision 426) @@ -0,0 +1,111 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: reference.h // +// Description: header file for checkxor management (Creference class) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __REFERENCE_H__ +#define __REFERENCE_H__ + +namespace siscone{ + +/** + * \class Creference + * \brief references used for checksums. + * + * This class implements some reference variable + * that can be used for checksums. Those checksums + * are useful to disentengle between contents of two + * cones without looking into their explicit particle + * contents. + */ +class Creference{ + public: + /// default constructor + Creference(); + + /// create a random reference + void randomize(); + + /// test emptyness + bool is_empty(); + + /// test non-emptyness + bool not_empty(); + + /// assignment of reference + Creference& operator = (const Creference &r); + + /// addition of reference + Creference operator + (const Creference &r); + + /// incrementation of reference + Creference& operator += (const Creference &r); + + /// decrementation of reference + Creference& operator -= (const Creference &r); + + /// accessing the reference + inline unsigned int operator[] (int i) {return ref[i];} + + unsigned int ref[3]; ///< actual data for the reference +}; + +/// addition of two references +Creference operator + (Creference &r1, Creference &r2); + +/// equality test of two references +bool operator == (const Creference &r1, const Creference &r2); + +/// difference test of two references +bool operator != (const Creference &r1, const Creference &r2); + +/// ordering of two references +bool operator < (const Creference &r1, const Creference &r2); + + +//=============== inline material ================ + +// equality test for two references +//---------------------------------- +inline bool operator == (const Creference &r1, const Creference &r2){ + return (r1.ref[0]==r2.ref[0]) && (r1.ref[1]==r2.ref[1]) && (r1.ref[2]==r2.ref[2]); +} + +// difference test for two references +//---------------------------------- +inline bool operator != (const Creference &r1, const Creference &r2){ + return (r1.ref[0]!=r2.ref[0]) || (r1.ref[1]!=r2.ref[1]) || (r1.ref[2]!=r2.ref[2]); +} + +// difference test for two references +//---------------------------------- +inline bool operator < (const Creference &r1, const Creference &r2){ + return (r1.ref[0] +#include +#include + +namespace siscone{ +using namespace std; + +/*************************************************************** + * Csiscone implementation * + * final class: gather everything to compute the jet contents. * + * * + * This is the class user should use. * + * It computes the jet contents of a list of particles * + * given a cone radius and a threshold for splitting/merging. * + ***************************************************************/ + +// default ctor +//-------------- +Csiscone::Csiscone(){ + rerun_allowed = false; +} + +// default dtor +//-------------- +Csiscone::~Csiscone(){ + rerun_allowed = false; +} + +bool Csiscone::init_done=false; +std::ostream* Csiscone::_banner_ostr = &cout; + +/* + * compute the jets from a given particle set doing multiple passes + * such pass N looks for jets among all particles not put into jets + * during previous passes. + * - _particles list of particles + * - _radius cone radius + * - _f shared energy threshold for splitting&merging + * - _n_pass_max maximum number of runs + * - _ptmin minimum pT of the protojets + * - _split_merge_scale the scale choice for the split-merge procedure + * NOTE: using pt leads to IR unsafety for some events with momentum + * conservation. So we strongly advise not to change the default + * value. + * return the number of jets found. + **********************************************************************/ +int Csiscone::compute_jets(vector &_particles, double _radius, double _f, + int _n_pass_max, double _ptmin, + Esplit_merge_scale _split_merge_scale){ + _initialise_if_needed(); + + // run some general safety tests (NB: f will be checked in split-merge) + if (_radius <= 0.0 || _radius >= 0.5*M_PI) { + ostringstream message; + message << "Illegal value for cone radius, R = " << _radius + << " (legal values are 00) && (_n_pass_max!=0)); + + rerun_allowed = true; + + // split & merge + return perform(_f, _ptmin); +} + + +/* + * compute the jets from a given particle set doing multiple passes + * such pass N looks for jets among all particles not put into jets + * during previous passes. + * - _particles list of particles + * - _radius cone radius + * - _n_pass_max maximum number of runs + * - _ptmin minimum pT of the protojets + * - _ordering_scale the ordering scale to decide which stable + * cone is removed + * return the number of jets found. + **********************************************************************/ +int Csiscone::compute_jets_progressive_removal(vector &_particles, double _radius, + int _n_pass_max, double _ptmin, + Esplit_merge_scale _ordering_scale){ + _initialise_if_needed(); + + // run some general safety tests (NB: f will be checked in split-merge) + if (_radius <= 0.0 || _radius >= 0.5*M_PI) { + ostringstream message; + message << "Illegal value for cone radius, R = " << _radius + << " (legal values are 00) && (_n_pass_max!=0)); + + // split & merge + return jets.size(); +} + + +/* + * recompute the jets with a different overlap parameter. + * we use the same particles and R as in the preceeding call. + * - _f shared energy threshold for splitting&merging + * - _ptmin minimum pT of the protojets + * - _split_merge_scale the scale choice for the split-merge procedure + * NOTE: using pt leads to IR unsafety for some events with momentum + * conservation. So we strongly advise not to change the default + * value. + * return the number of jets found, -1 if recomputation not allowed. + ********************************************************************/ +int Csiscone::recompute_jets(double _f, double _ptmin, + Esplit_merge_scale _split_merge_scale){ + if (!rerun_allowed) + return -1; + + ptcomparison.split_merge_scale = _split_merge_scale; + + // restore particle list + partial_clear(); + init_pleft(); + + // initialise split/merge algorithm + unsigned int i; + for (i=0;iflags()); + + (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl; + (*_banner_ostr) << "# SISCone version " << setw(28) << left << siscone_version() << "o" << endl; + (*_banner_ostr) << "# http://projects.hepforge.org/siscone o" << endl; + (*_banner_ostr) << "# o" << endl; + (*_banner_ostr) << "# This is SISCone: the Seedless Infrared Safe Cone Jet Algorithm o" << endl; + (*_banner_ostr) << "# SISCone was written by Gavin Salam and Gregory Soyez o" << endl; + (*_banner_ostr) << "# It is released under the terms of the GNU General Public License o" << endl; + (*_banner_ostr) << "# o" << endl; + (*_banner_ostr) << "# A description of the algorithm is available in the publication o" << endl; + (*_banner_ostr) << "# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)]. o" << endl; + (*_banner_ostr) << "# Please cite it if you use SISCone. o" << endl; + (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl; + (*_banner_ostr) << endl; + + _banner_ostr->flush(); + _banner_ostr->flags(flags_to_restore); + } +} + +// finally, a bunch of functions to access to +// basic information (package name, version) +//--------------------------------------------- + +/* + * return SISCone package name. + * This is nothing but "SISCone", it is a replacement to the + * SISCONE_PACKAGE_NAME string defined in config.h and which is not + * guaranteed to be public. + * return the SISCone name as a string + */ +string siscone_package_name(){ + return SISCONE_PACKAGE_NAME; +} + +/* + * return SISCone version number. + * return a string of the form "X.Y.Z" with possible additional tag + * (alpha, beta, devel) to mention stability status + */ +string siscone_version(){ + return SISCONE_VERSION; +} + +} Property changes on: tags/siscone-3.0.5/siscone/siscone.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/vicinity.h =================================================================== --- tags/siscone-3.0.5/siscone/vicinity.h (revision 0) +++ tags/siscone-3.0.5/siscone/vicinity.h (revision 426) @@ -0,0 +1,156 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: vicinity.h // +// Description: header file for particle vicinity (Cvicinity class) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __VICINITY_H__ +#define __VICINITY_H__ + +#include +#include +#include "momentum.h" +#include "defines.h" +#include "quadtree.h" + +namespace siscone{ + + + +/** + * \class Cvicinity_inclusion + * \brief a class to keep track of inclusion status in cone and in cocircular region + * while using minimal resources + */ +class Cvicinity_inclusion { +public: + /// default ctor + Cvicinity_inclusion() : cone(false), cocirc(false) {} + + bool cone; ///< flag for particle inclusion in the cone + bool cocirc; ///< flag for particle inclusion in the border +}; + + +/** + * \class Cvicinity_elm + * \brief element in the vicinity of a parent. + * + * class used to manage one points in the vicinity + * of a parent point. + */ +class Cvicinity_elm{ + public: + /// pointer to the second borderline particle + Cmomentum *v; + + /// variable to tell if the particle is inside or outside the cone + Cvicinity_inclusion *is_inside; + + // centre variables + double eta; ///< eta coordinate of the center + double phi; ///< phi coordinate of the center + double angle; ///< angle with parent + bool side; ///< true if angle on the positive side, false otherwise + double cocircular_range; ///< amount by which the angle can be varied while + ///< maintaining this point within co-circularity margin + + /// list of elements co-circular with this one + /// NB: empty list uses less mem than vector + std::list cocircular; +}; + +/// ordering pointers to Cvicinity_elm +bool ve_less(Cvicinity_elm *ve1, Cvicinity_elm *ve2); + + +/** + * \class Cvicinity + * \brief list of element in the vicinity of a parent. + * + * class used to manage the points which are in the vicinity + * of a parent point. + */ +class Cvicinity{ + public: + /// default constructor + Cvicinity(); + + /// constructor with initialisation (see set_particle_list) + Cvicinity(std::vector &_particle_list); + + /// default destructor + ~Cvicinity(); + + /** + * set the particle_list + * \param _particle_list list of particles (type Cmomentum) + */ + void set_particle_list(std::vector &_particle_list); + + /** + * build the vicinity list from the list of points. + * \param _parent reference particle + * \param _VR vicinity radius + */ + void build(Cmomentum *_parent, double _VR); + + // cone kinematical information + Cmomentum *parent; ///< parent vector + double VR; ///< radius of the vicinity + double VR2; ///< squared radius of the vicinity + double R; ///< normal radius + double R2; ///< squared normal radius + double inv_R_EPS_COCIRC; ///< R / EPSILON_COCIRCULAR + double inv_R_2EPS_COCIRC; ///< R / (2*EPSILON_COCIRCULAR) + + // particle list information + int n_part; ///< number of particles + std::vector plist; ///< the list of particles + std::vector pincluded; ///< the inclusion state of particles + Cvicinity_elm *ve_list; ///< list of vicinity elements built from particle list (size=2*n) +#ifdef USE_QUADTREE_FOR_STABILITY_TEST + Cquadtree *quadtree; ///< quadtree used for final stability tests +#endif + + // vicinity information + std::vector vicinity; ///< list of points in parent's vicinity + unsigned int vicinity_size; ///< number of elements in vicinity + + protected: + /** + * append a particle to the 'vicinity' list after + * having tested it and computed the angular-ordering quantities + * \param v vector to test + */ + void append_to_vicinity(Cmomentum *v); + + // internal variables + double pcx; ///< parent centre (eta) + double pcy; ///< parent centre (phi) +}; + +} + +#endif Property changes on: tags/siscone-3.0.5/siscone/vicinity.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/momentum.h =================================================================== --- tags/siscone-3.0.5/siscone/momentum.h (revision 0) +++ tags/siscone-3.0.5/siscone/momentum.h (revision 426) @@ -0,0 +1,157 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: momentum.h // +// Description: header file for 4-momentum class Cmomentum // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __VECTOR_H__ +#define __VECTOR_H__ + +#include +#include +#include "reference.h" +#include "geom_2d.h" +#include "defines.h" + +namespace siscone{ + +/** + * \class Cmomentum + * \brief base class for dynamic coordinates management + * + * This class contains the information for particle or group of + * particles management. + * It includes all Lorentz properties as well as tools for summing them. + * Note: 'sums' over phi angles are indeed averages. This allows to + * deal with periodicity at each step + */ +class Cmomentum{ + public: + /// default ctor + Cmomentum(); + + /// ctor with initialisation + Cmomentum(double _px, double _py, double _pz, double _E); + + /// ctor with detailed initialisation + Cmomentum(double _eta, double _phi, Creference _ref); + + /// default dtor + ~Cmomentum(); + + /// computes pT + inline double perp() const {return sqrt(perp2());} + + /// computes pT^2 + inline double perp2() const {return px*px+py*py;} + + /// computes m + inline double mass() const {return sqrt(mass2());} + + /// computes m^2 + inline double mass2() const {return perpmass2()-perp2();} + + /// transverse mass, mt = sqrt(pt^2+m^2) = sqrt(E^2 - pz^2) + inline double perpmass() const {return sqrt((E-pz)*(E+pz));} + + /// transverse mass squared, mt^2 = pt^2+m^2 = E^2 - pz^2 + inline double perpmass2() const {return (E-pz)*(E+pz);} + + /// computes transverse energy + inline double Et() const {return E/sqrt(1.0+pz*pz/perp2());} + + /// computes transverse energy (squared) + inline double Et2() const {return E*E/(1.0+pz*pz/perp2());} + + /// assignment of vectors + Cmomentum& operator = (const Cmomentum &v); + + /// addition of vectors + /// !!! WARNING !!! no updating of eta and phi !!! + const Cmomentum operator + (const Cmomentum &v); + + /// incrementation of vectors + /// !!! WARNING !!! no updating of eta and phi !!! + Cmomentum& operator += (const Cmomentum &v); + + /// decrementation of vectors + /// !!! WARNING !!! no updating of eta and phi !!! + Cmomentum& operator -= (const Cmomentum &v); + + /// build eta-phi from 4-momentum info + /// !!! WARNING !!! + /// !!! computing eta and phi is time-consuming !!! + /// !!! use this whenever you need eta or phi !!! + /// !!! automatically called for single-particle !!! + void build_etaphi(); + + double px; ///< x-momentum + double py; ///< y-momentum + double pz; ///< z-momentum + double E; ///< energy + + double eta; ///< particle pseudo-rapidity + double phi; ///< particle azimuthal angle + int parent_index; ///< particle number in the parent list + int index; ///< internal particle number + + ////////////////////////////////////////////// + // the following part is used for checksums // + ////////////////////////////////////////////// + Creference ref; ///< reference number for the vector +}; + +/// ordering of two vectors +/// this is by default done w.r.t. their references +bool operator < (const Cmomentum &v1, const Cmomentum &v2); + +/// ordering of vectors in eta (e.g. used in collinear tests) +bool momentum_eta_less(const Cmomentum &v1, const Cmomentum &v2); + +/// ordering of vectors in pt +bool momentum_pt_less(const Cmomentum &v1, const Cmomentum &v2); + + +////////////////////////// +// some handy utilities // +////////////////////////// + +/// get distance between to eta-phi points +/// \param eta eta coordinate of first point +/// \param phi phi coordinate of first point +/// \param v vector defining the second point +inline double get_distance(double eta, double phi, Cmomentum *v){ + double dx, dy; + + dx = eta - v->eta; + dy = fabs(phi - v->phi); + if (dy>M_PI) + dy -= twopi; + + return dx*dx+dy*dy; +} + +} + +#endif Property changes on: tags/siscone-3.0.5/siscone/momentum.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone/area.cpp =================================================================== --- tags/siscone-3.0.5/siscone/area.cpp (revision 0) +++ tags/siscone-3.0.5/siscone/area.cpp (revision 426) @@ -0,0 +1,348 @@ +// -*- C++ -*- +/////////////////////////////////////////////////////////////////////////////// +// File: area.h // +// Description: header file for the computation of jet area // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: 149 $// +// $Date:: 2007-03-15 00:13:58 +0100 (Thu, 15 Mar 2007) $// +/////////////////////////////////////////////////////////////////////////////// + +#include "area.h" +#include "momentum.h" +#include +#include + +namespace siscone{ +using namespace std; + +/******************************************************* + * Cjet_area implementation * + * real Jet information, including its area(s) * + * * + * This class contains information for one single jet. * + * That is, first, its momentum carrying information * + * about its centre and pT, and second, its particle * + * contents (from CJeT). * + * Compared to the Cjet class, it also includes the * + * passive and active areas of the jet computed using * + * the Carea class. * + *******************************************************/ + +// default ctor +//-------------- +Cjet_area::Cjet_area(){ + active_area = passive_area = 0.0; +} + +// jet-initiated ctor +//------------------- +Cjet_area::Cjet_area(Cjet &j){ + v = j.v; + n = j.n; + contents = j.contents; + + pass = j.pass; + + pt_tilde = j.pt_tilde; + sm_var2 = j.sm_var2; + + active_area = passive_area = 0.0; +} + +// default dtor +//-------------- +Cjet_area::~Cjet_area(){ + +} + + +/****************************************************************** + * Csiscone_area implementation * + * class for the computation of jet areas. * + * * + * This is the class user should use whenever you want to compute * + * the jet area (passive and active). * + * It uses the SISCone algorithm to perform the jet analysis. * + ******************************************************************/ + +// default ctor +//------------- +Carea::Carea(){ + grid_size = 60; // 3600 particles added + grid_eta_max = 6.0; // maybe having twice more points in eta than in phi should be nice + grid_shift = 0.5; // 50% "shacking" + + pt_soft = 1e-100; + pt_shift = 0.05; + pt_soft_min = 1e-90; +} + +// default dtor +//------------- +Carea::~Carea(){ + +} + +/* + * compute the jet areas from a given particle set. + * The parameters of this method are the ones which control the jet clustering alghorithm. + * Note that the pt_min is not allowed here soince the jet-area determination involves soft + * particles/jets and thus is used internally. + * - _particles list of particles + * - _radius cone radius + * - _f shared energy threshold for splitting&merging + * - _n_pass_max maximum number of passes (0=full search, the default) + * - _split_merge_scale the scale choice for the split-merge procedure + * NOTE: SM_pt leads to IR unsafety for some events with momentum conservation. + * SM_Et is IR safe but not boost invariant and not implemented(!) + * SM_mt is IR safe for hadronic events, but not for decays of two + * back-to-back particles of identical mass + * SM_pttilde + * is always IR safe, and also boost invariant (default) + * - _hard_only when this is set on, only hard jets are computed + * and not the purely ghosted jets (default: false) + * return the jets together with their areas + * The return value is the number of jets (including pure-ghost ones if they are included) + ********************************************************************************************/ +int Carea::compute_areas(std::vector &_particles, double _radius, double _f, + int _n_pass_max, Esplit_merge_scale _split_merge_scale, + bool _hard_only){ + + vector all_particles; + + // put "hardest cut-off" if needed + // this avoids computation of ghosted jets when not required and + // significantly shortens the SM. + if (_hard_only){ + SM_var2_hardest_cut_off = pt_soft_min*pt_soft_min; + } + + // clear potential previous runs + jet_areas.clear(); + + // put initial set of particles in the list + int n_hard = _particles.size(); + all_particles = _particles; + + // build the set of ghost particles and add them to the particle list + int i,j; + double eta_g,phi_g,pt_g; + + for (i=0;i= n_hard + // and deduce the number of ghosts in the jet, hence the area. + double area_factor = (2.0*grid_eta_max/grid_size)*(twopi/grid_size); + + for (i=0;i<(int) jets.size();i++){ + jet_areas.push_back(jets[i]); + j=0; + while ((j &_particles, double _radius, double _f, + int _n_pass_max, Esplit_merge_scale _split_merge_scale){ + + vector all_particles; + + // in the case of passive area, we do not need + // to put the ghosts in the stable-cone search + // (they do no influence the list of stable cones) + // Here's how it goes... + stable_cone_soft_pt2_cutoff = pt_soft_min*pt_soft_min; + + // clear potential previous runs + jet_areas.clear(); + + // put initial set of particles in the list + int n_hard = _particles.size(); + all_particles = _particles; + + // build the set of ghost particles and add them to the particle list + int i,j; + double eta_g,phi_g,pt_g; + + for (i=0;i= n_hard + // and deduce the number of ghosts in the jet, hence the area. + double area_factor = (2.0*grid_eta_max/grid_size)*(twopi/grid_size); + for (i=0;i<(int) jets.size();i++){ + j=0; + while ((j &_particles, double _radius, double _f, + int _n_pass_max, Esplit_merge_scale _split_merge_scale, + bool _hard_only){ + + vector all_particles; + + // put "hardest cut-off" if needed + // this avoids computation of ghosted jets when not required and + // significantly shortens the SM. + if (_hard_only){ + SM_var2_hardest_cut_off = pt_soft_min*pt_soft_min; + } + + // clear potential previous runs + jet_areas.clear(); + + // put initial set of particles in the list + int n_hard = _particles.size(); + all_particles = _particles; + + // build the set of ghost particles and add them to the particle list + int i,j; + double eta_g,phi_g,pt_g; + + for (i=0;i= n_hard + // and deduce the number of ghosts in the jet, hence the area. + double area_factor = (2.0*grid_eta_max/grid_size)*(twopi/grid_size); + + for (i=0;i<(int) jets.size();i++){ + jet_areas.push_back(jets[i]); + j=0; + while ((j &_particles, double _radius, double _f, + int _n_pass_max=0, double _ptmin=0.0, + Esplit_merge_scale _split_merge_scale=SM_pttilde); + + /** + * compute the jets from a given particle set. + * We are doing multiple passes such pass n_pass looks for jets among + * all particles not put into jets during previous passes. + * By default the number of passes is infinite (0). + * \param _particles list of particles + * \param _radius cone radius + * \param _n_pass_max maximum number of passes (0=full search) + * \param _ptmin minimum pT of the protojets + * \param _ordering_scale the ordering scale to decide which stable + * cone is removed + * + * Note that the Csplit_merge::SM_var2_hardest_cut_off cut is not + * used in the progressive removal variant. + * + * \return the number of jets found. + */ + int compute_jets_progressive_removal(std::vector &_particles, double _radius, + int _n_pass_max=0, double _ptmin=0.0, + Esplit_merge_scale _ordering_scale=SM_pttilde); + + /** + * recompute the jets with a different overlap parameter. + * we use the same particles and R as in the preceeding call. + * \param _f shared energy threshold for splitting&merging + * \param _ptmin minimum pT of the protojets + * \param _split_merge_scale the scale choice for the split-merge procedure + * split--merge variable + * NOTE: using pt leads to IR unsafety for some events with momentum + * conservation. So we strongly advise not to change the default + * value. + * \return the number of jets found, -1 if recomputation not allowed. + */ + int recompute_jets(double _f, double _ptmin = 0.0, + Esplit_merge_scale _split_merge_scale=SM_pttilde); + + /// list of protocones found pass-by-pass (not filled by compute_jets_progressive_removal) + std::vector > protocones_list; + + // random number initialisation + static bool init_done; ///< check random generator initialisation + +#ifdef DEBUG_STABLE_CONES + int nb_hash_cones_total, nb_hash_occupied_total; +#endif + + /** + * A call to this function modifies the stream + * used to print banners (by default cout). + * + * Please note that if you distribute 3rd party code + * that links with SISCone, that 3rd party code must not + * use this call turn off the printing of thw banner + * by default. This requirement reflects the spirit of + * clause 2c of the GNU Public License (v2), under which + * SISCone is distributed. + */ + static void set_banner_stream(std::ostream * ostr) {_banner_ostr = ostr;} + + /** + * returns a pointer to the stream to be used to print banners + * (cout by default) + */ + static std::ostream * banner_stream() {return _banner_ostr;} + + private: + bool rerun_allowed; ///< is recompute_jets allowed ? + static std::ostream * _banner_ostr; ///< stream to use for banners + + /// ensure things are initialised + void _initialise_if_needed(); + +}; + + +// finally, a bunch of functions to access to +// basic information (package name, version) +//--------------------------------------------- + +/** + * return SISCone package name. + * This is nothing but "SISCone", it is a replacement to the + * SISCONE_PACKAGE_NAME string defined in config.h and which is not + * guaranteed to be public. + * \return the SISCone name as a string + */ +std::string siscone_package_name(); + +/** + * return SISCone version number. + * \return a string of the form "X.Y.Z" with possible additional tag + * (alpha, beta, devel) to mention stability status + */ +std::string siscone_version(); + +} +#endif Property changes on: tags/siscone-3.0.5/siscone/siscone.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/siscone =================================================================== --- tags/siscone-3.0.5/siscone (revision 425) +++ tags/siscone-3.0.5/siscone (revision 426) Property changes on: tags/siscone-3.0.5/siscone ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,13 ## +libsiscone.a + +Makefile.in + +.deps + +Makefile + +stamp-h1 + +config.h + +.libs Index: tags/siscone-3.0.5/makefile.static =================================================================== --- tags/siscone-3.0.5/makefile.static (revision 0) +++ tags/siscone-3.0.5/makefile.static (revision 426) @@ -0,0 +1,34 @@ +SUBDIRS = siscone examples +DISTFILES = AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README TODO Doxyfile \ +makefile.static siscone/makefile.static examples/makefile.static \ +configure.ac Makefile.am siscone/Makefile.am examples/Makefile.am \ +config.h.in siscone/*.cpp siscone/*.h \ +examples/events/*.dat examples/mem_check examples/*.h examples/*.cpp +VERSION = `head -1 configure.ac | sed -e"s/AC_INIT(\[SISCone\], \[//;s/\])//"` +TARDIR = siscone-$(VERSION) + +all: config $(SUBDIRS) + +.PHONY: clean $(SUBDIRS) + +clean: $(SUBDIRS) + rm *~ + +depend: $(SUBDIRS) + +config: + @echo "Creating the configuration file" + sed -e "s/#undef PACKAGE_NAME/#define PACKAGE_NAME \"SISCone\"/;s/#undef VERSION/#define VERSION \"$(VERSION)\"/" config.h.in > siscone/config.h + +siscone: + @cd siscone && $(MAKE) -f makefile.static $(MAKECMDGOALS) + +examples: + @cd examples && $(MAKE) -f makefile.static $(MAKECMDGOALS) + +dist: + mkdir $(TARDIR) + cp -R -t $(TARDIR) --parents $(DISTFILES) + tar -czf $(TARDIR)_noautoconf.tar.gz $(TARDIR) +# chmod a-w $(TARDIR).tar.gz + rm -Rf $(TARDIR) Index: tags/siscone-3.0.5/configure.ac =================================================================== --- tags/siscone-3.0.5/configure.ac (revision 0) +++ tags/siscone-3.0.5/configure.ac (revision 426) @@ -0,0 +1,98 @@ +AC_INIT([SISCone], [3.0.5]) +AC_CONFIG_SRCDIR([siscone/siscone.cpp]) +AM_INIT_AUTOMAKE + +dnl (un)comment the following lines if you want to use autoheader +dnl and also (un)comment the call to autoheader in autogen.sh +dnl +dnl Notes: +dnl - the first macro needs to place the files in the correct +dnl dir in order to have the correct -I options for the remote build +dnl - see Makefile.am for distcleaning AX_PREFIX_CONFIG_H leftovers +AC_CONFIG_HEADERS(siscone/config_raw.h:config.h.in) +AX_PREFIX_CONFIG_H(siscone/config.h,SISCONE,siscone/config_raw.h) + +dnl and also uncomment the call to autoheader in autogen.sh + +dnl check autoconf version +AC_PREREQ(2.63) + +dnl check basic types +AC_CHECK_TYPE(int) +AC_CHECK_TYPE(long) + +dnl set default compilation and link flags +dnl those can be changed at configure time so we don't use AM_CXXFLAGS here +test "x${CXXFLAGS+yes}" = xyes || CXXFLAGS="-O3 -Wall -ffast-math" +dnl CXXFLAGS=" -Wall -O3 -ffast-math " + +dnl check useful programs +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +dnl check standard C headers +AC_STDC_HEADERS + +dnl set the default destination directory +AC_PREFIX_DEFAULT(/usr/local) + +dnl if the debug flag is set, build with -g +dnl default is "yes" +AC_ARG_ENABLE(debug, + [ --enable-debug Turn on debug compiler information], + [ENABLE_DEBUG_FLAG="$enableval"], + [ENABLE_DEBUG_FLAG="yes"]) +if [[ "x$ENABLE_DEBUG_FLAG" == "xyes" ]] ; then + CXXFLAGS=${CXXFLAGS}" -g " +fi + +dnl uncomment the next line not to build the shared lib by default +dnl AM_DISABLE_SHARED + +dnl----------------- +dnl check libraries +dnl ---------------- + +dnl math lib +AC_CHECK_LIB(m, cos) +dnl already included into LIBS by the previous check +dnl AM_LDFLAGS=" -lm " + +dnl if the debug flags are on, check if we can also use +dnl some profiling tools +dnl COMMENTED: Pass LDFLAGS to configure instead +dnl if [[ "x$ENABLE_DEBUG_FLAG" == "xyes" ]] ; then +dnl AC_CHECK_LIB(profiler, google_initializer_module_profiler) +dnl AC_CHECK_LIB(pthread, pthread_create) +dnl AC_CHECK_LIB(tcmalloc, malloc) +dnl fi + +dnl enable libtool +AC_PROG_LIBTOOL + +dnl chceck if auto_ptr is deprecated +dnl if yes, see if unique_ptr is supported +AC_MSG_CHECKING([[if $CXX $CXXFLAGS considers atd::auto_ptr as deprecated]]) +AC_LANG_PUSH(C++) +save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS -Werror=deprecated-declarations" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]],[[int *a= new int(1); std::auto_ptr b; b.reset(a);]])], + [ac_compilation_deprecated="no"],[ac_compilation_deprecated="yes"]) +AC_MSG_RESULT([$ac_compilation_deprecated]) +if [[ "$ac_compilation_deprecated" == "yes" ]] ; then + AC_MSG_CHECKING([[if $CXX $CXXFLAGS supports atd::unique_ptr]]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]],[[int *a= new int(1); std::unique_ptr b; b.reset(a);]])], + [ac_supports_unique_ptr="yes"],[as_supports_unique_ptr="no"]) + if [[ "$ac_supports_unique_ptr" == "yes" ]] ; then + AC_DEFINE(USES_UNIQUE_PTR_AS_AUTO_PTR, [], [use unique_ptr instead of auto_ptr]) + fi + AC_MSG_RESULT([$ac_supports_unique_ptr]) + +fi +CXXFLAGS="$save_CXXFLAGS" +AC_LANG_POP(C++) + + +AC_OUTPUT( Makefile siscone/Makefile siscone/spherical/Makefile examples/Makefile examples/events/Makefile ) Index: tags/siscone-3.0.5/.gitignore =================================================================== --- tags/siscone-3.0.5/.gitignore (revision 0) +++ tags/siscone-3.0.5/.gitignore (revision 426) @@ -0,0 +1,16 @@ +/*.tar.gz +/Makefile.in +/config.guess +/config.log +/config.status +/config.sub +/configure +/depcomp +/aclocal.m4 +/Makefile +/autom4te.cache +/install-sh +/libtool +/ltmain.sh +/missing +/compile Index: tags/siscone-3.0.5/TODO =================================================================== --- tags/siscone-3.0.5/TODO (revision 0) +++ tags/siscone-3.0.5/TODO (revision 426) @@ -0,0 +1,2 @@ +//!\file TODO + Index: tags/siscone-3.0.5/doc/latex/.gitignore =================================================================== --- tags/siscone-3.0.5/doc/latex/.gitignore (revision 0) +++ tags/siscone-3.0.5/doc/latex/.gitignore (revision 426) @@ -0,0 +1 @@ +/* Index: tags/siscone-3.0.5/doc/latex =================================================================== --- tags/siscone-3.0.5/doc/latex (revision 425) +++ tags/siscone-3.0.5/doc/latex (revision 426) Property changes on: tags/siscone-3.0.5/doc/latex ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Index: tags/siscone-3.0.5/doc/devel/html/footer.html =================================================================== --- tags/siscone-3.0.5/doc/devel/html/footer.html (revision 0) +++ tags/siscone-3.0.5/doc/devel/html/footer.html (revision 426) @@ -0,0 +1,13 @@ +
+The +SISCone project has been developed by + +Gavin Salam and + +Gregory Soyez
+Documentation generated on $datetime for $projectname by  +Doxygen $doxygenversion +
+
+ + Index: tags/siscone-3.0.5/doc/html/usage.html =================================================================== --- tags/siscone-3.0.5/doc/html/usage.html (revision 0) +++ tags/siscone-3.0.5/doc/html/usage.html (revision 426) @@ -0,0 +1,391 @@ + + + + + +SISCone: Usage + + + + + + + + + +

SISCone Documentation

+

+ +

Version 3.0.5

+

+
+ + + + + +

+home +SISCone is written in C++ and is provided as a library. We describe below 3 ways of using it: +

+

+

+For the e+e- events, we provide an +implementation of SISCone in spherical +coordinates. See here for details on how to use it. +

+
+ + + + +

+home +

Using the sample application

+

+

+For simple applications, SISCone comes with a command-line application + + +
+Usage: ./siscone <args>
+
+Here is an exhaustive list of the arguments:
+Parameters control (with default values):
+  -n <val>, --number=<val>  : set the maximum number of particles allowed (all)
+  -R <val>, --radius=<val>  : set the radius (0.7)
+  -f <val>, --fraction=<val>: set the overlap parameter (0.5)
+  -p <val>, --ptmin=<val>   : set the minimal pT for protojets (0)
+  -e <val>, --event=<val>   : set the event filename (events/single-event.dat)
+  -n <val>, --npass=<val>   : set the number of passes (0 for infinity) (0)
+  -s <val>, --sm=<val>      : set the variable for split-merge (pttilde)
+
+Output flags:
+  --version    : show version information
+  -h, --help   : show this message
+  -v, --verbose: be verbose (on by default)
+  -q, --quiet  : be quiet
+
+
+

+

+The program outputs two files: +

    +
  • particles.dat: the list of particles as a two-column file giving the rapidity y and azimuthal angle φ for each particle
  • +
  • jets.dat: the first line gives the number of jets. Then comes the list of jets within 4 columns giving, for each jet, the (y, φ) coordinates of its centre, its pT and the number of particles it contains. The remaining part of the file lists the jet content. This is again given in 4 columns: the (y, φ) coordinates of the particle, its index in the initial list and the index of the jet to which it belongs.
  • +
+

+

Back to top

+
+ + + + + +

+home +

Using the library

+

+

+SISCone can be more conveniently used directly in C++ program linked against the SISCone library. +There are basically two objects that are important for users: +

+ +

Cmomentum: the 4-momentum class

(see momentum.h for details)
+ +

+This class is used to store the property of one particle. It is defined through the 4-momentum coordinates of the particle e.g., to create a particle of momentum px py pz and energy E
+ + +
+
+  Cmomentum particle=Cmomentum(px, py, pz, E);
+
+
+

+ +

Csiscone: the SISCone jet finder

(see siscone.h for details)
+ +

+The Csiscone class is the main class of interest of the algorithm. It is the one that you want to use to calculate the jets from a given set of particles. The algorithm is called through the following members: + + +
+  int Csiscone::compute_jets(vector<Cmomentum> &particles,
+                             double R, double f, int n_pass_max=0, double ptmin=0.0,
+                             Esplit_merge_scale _split_merge_scale=SM_pttilde);
+  int Csiscone::recompute_jets(double f, double ptmin=0.0,
+                               Esplit_merge_scale _split_merge_scale=SM_pttilde);
+
+

+

+The first of those methods takes the following information as argument: +

    +
  • particles: the list of particles to deal with under the form of a STL vector of particles.
  • +
  • R: the radius of the cone used to scan for stable cones (protocones)
  • +
  • f: the overlap parameter. When splitting and merging protocones, two overlapping cones are split (resp. merged) when their overlapping pT is smaller (resp. larger) than a fraction f of the smallest pT of the parents.
  • +
  • n_pass_max: maximum number of passes. When computing protocones, it happens that some particles do not enter into jet. We can therefore re-run the algorithm with those particles only. This parameter controls the number of such passes. It has been set to 1 by default. If you want to run the algorithm until all particles are associated with a jet or no new stable cone are found, set it to 0.
  • +
  • ptmin: minimal pT for the protojets included in the split-merge process. At each step of the split-merge process, we remove jet candidates which have a pT less than ptmin.
  • +
  • split_merge_scale: variable to use for split-merge (ordering and overlap fraction computation). This can be SM_pttilde, SM_Et, SM_mt or SM_pt, respectively corresponding to a p-scheme pT, the transverse energy ET, the transverse mass mT or the transverse momentum pT. We highly recommand to keep the default value SM_pttilde (see this note for details)
  • +
+The second member (recompute_jets) allows you to rerun the split/merge algorithm with a different overlap parameter. +

+

+Remark: The algorithm has been placed inside the namespace siscone. Hence, you should either add the line using namespace siscone; on top of your applications, or prefix any call to the siscone library by siscone::. +

+ +

Output

+

+The result of calling compute_jets(...) or recompute_jets(...) is stored in the vector + + +
+vector<Cjet> Csiscone::jets;
+
+The elements of that vector contain all necessary information concerning the jets: +

    +
  • Cjet::v: 4-momentum of the jet.
  • +
  • Cjet::n: number of particles in the jet.
  • +
  • Cjet::contents: jet contents. It is stored as a vector<int> listing the indices of the particles contained in the jet.
  • +
  • Cjet::pass : pass at which the jet has been found (0 is the first, -1 means that the particle has not been included in the analysis i.e. it has infinite rapidity).
  • +
+

+ +

an illustrative example

+

+Here follows an example which illustrates the usage of those objects (see also main.cpp in the scones tree) + + +
+
+01 #include <stdio.h>
+02 #include <iostream>
+03 #include "siscone/momentum.h"
+04 #include "siscone/siscone.h"
+05 
+06 #define R     0.7
+07 #define f     0.5
+08 #define f_alt 0.75
+09 
+10 using namespace std;
+11 using namespace siscone;
+12 
+13 int main(int argc, char *argv[]){
+14   vector<Cmomentum> particles;    // list of particles
+15   Csiscone siscone;               // main object for the cone algorithm
+16   int i;                          // loop index
+17   int N;                          // number of particles
+18   double px,py,pz,E;              // particles 4-momentum
+19   char fline[512];                // line to read from a file
+20 
+21   // read particles
+22   FILE *flux;
+23   flux = fopen("events/single-event.dat", "r");
+24   if (flux==NULL){
+25     cerr << "cannot read event" << endl;
+26     return 1;
+27   }
+28 
+29   N=0;
+30   while (fgets(fline, 512, flux)!=NULL){
+31     if (fline[0]!='#'){ // skip lines beginning with '#'
+32       if (sscanf(fline, "%le%le%le%le", &px, &py, &pz, &E)==4){
+33         particles.push_back(Cmomentum(px, py, pz, E));
+34         N++;
+35       } else {
+36         cout << "error in reading event file Giving up." << endl;
+37         fclose(flux);
+38         return 2;
+39       }
+40     }
+41   }
+42   fclose(flux);
+43 
+44   // compute jets
+45   // first compute with multiple passes (default)
+46   i=siscone.compute_jets(particles, R, f);
+47   cout << "  " << i << " jets found in multi-pass run" << endl;
+48 
+49   // then, recompute it with a different f
+50   i=siscone.recompute_jets(f_alt);
+51   cout << "  " << i << " jets found with alterntive f" << endl;
+52 
+53   // compute jets with a single pass
+54   i=siscone.compute_jets(particles, R, f, 1);
+55   cout << "  " << i << " jets found in single-pass run" << endl;
+56 
+57   // show jets
+58   vector<Cjet>::iterator it_j;
+59   int i1;
+60   fprintf(stdout, "#             pT        eta");
+61   fprintf(stdout, "      phi       px         py         pz         E    \n");
+62   for (it_j = siscone.jets.begin(), i1=0 ; 
+63        it_j != siscone.jets.end() ; it_j++, i1++){
+64     fprintf(stdout, "Jet %3d: %10.3f %8.3f %8.3f",
+65             i1, it_j->v.perp(), it_j->v.eta, it_j->v.phi);
+66     fprintf(stdout, " %10.3f %10.3f %10.3f %10.3f\n",
+67             it_j->v.px, it_j->v.py,  it_j->v.pz,  it_j->v.E);
+68   }
+69 
+70   return 0;
+71 }
+
+

+

Back to top

+
+ + + + + +

+home +

Using the FastJet plugin

+

+

+SISCone is available as a plugin of the FastJet project. The plugin is +named SISConePlugin. Note that it requires at least +version 2.1 of FastJet. See +the FastJet website for details. +

+

Back to top

+ + + + + + +
+

+home +

The spherical version of SISCone

+

+

+To allow clustering of e+e events, an +implementation of SISCone in spherical coordinates is available (as of +version 2.0 of SISCone). +

+

+Its usage is very similar to that of the basic implementation of SISCone, +so we just highlight the few differences here: + +

    +
  • The spherical version, uses energy E and normal angles, +rather than the longitudinally boost-invariant pt, +rapidity and azimuth. Specifically: +
      +
    • The distance between a pair of particle is the angle between + the pair particles (equivalently the the distance on the + surface of a unit sphere). Similarily, the cone + radius R is also defined as the cone half-opening + angle.
    • +
    • During the split--merge step, we use the energy of the + particles rather than their transverse momentum. However, as + in the standard situation where ordering the protojets + in pt led to infrared-unsafeties, ordering + the protojets in energy in the spherical case also leads to + infrared unsafeties. To solve that problem, we introduce the + new variable
      + Etilde
      + and use it to order the protojets. Note that to compute the + overlap fraction, we keep using the plain energy (which is + perfectly safe in this case). In practice, when invoking the + clustering, this corresponds to the default choice + of SM_Etilde for the split--merge scale. If one + rather wants to use E despite its infrared-unsafety + problems, one can specify SM_E instead.
    • +
  • +
  • The structure remains the same as for the basic implementation but + the class names have been prefixed by CSph instead of + just C. For example, the list of 4-momenta should be + of the CSphmomentum + type (1), + the clustering is done using CSphsiscone and the jets + are stored in CSphjet objects.
  • +
  • The classes for the spherical implementation are placed under + the siscone_spherical namespace.
  • +
  • The library is called libsiscone_spherical.{a,so} + rather than libsiscone.{a,so}.
  • +
  • The spherical version of SISCone is available as a FastJet plugin + named SISConeSphericalPlugin.
  • +
+ + +(1)The main reason for having +two classes for the 4-momenta is that SISCone is internally optimised +to avoid repeated computation of expensive quantities like the +rapidity. Since the spherical version makes use of the polar angle +θ instead of the rapidity y, having 2 separate classes +allows to optimise both situations. +

+ + + + + +
+

+home +

SISCone with progressive removal

+

+

+Since version 3.0.0, SISCone with progressive removal provides an +alternative to the standard split--merge algorithm used by default with +SISCone. The SISCone-PR algorithm works as follows + +

    +
  1. search for stable cones.
  2. +
  3. declare the hardest stable cone a jet and remove its particles from the list of remaining particles.
  4. +
  5. if there are some remaining particles, go back to 1.
  6. +
+ +In practice, jets are obtained by creating a Csiscone +(or CSphsiscone object) as described above and calling +
+
+ + +
+  int Csisscone::compute_jets_progressive_removal(vector<Cmomentum> &particles,
+                                                  double R, int n_pass_max=0, double ptmin=0.0,
+                                                  Esplit_merge_scale _split_merge_scale=SM_pttilde);
+
+
+ +This results in circular hard jets (analogously to +anti-kt). The complexity of the algorithm is N2 +log(N). + +The scale used to decide which stable cone is the hardest can be +chosen in the same way as the ordering scale for the split--merge +procedure. The default (SM_pttilde for the standard, pp, +version of SISCone; SM_Etilde for the version in spherical +coordinates) is recommended. Alternatively, a user-defined scale +choice can be provided: the user has to derive their favourite scale +choice from Csiscone::Cscale_choice +and then use Csiscone::set_user_scale() +with a pointer to an instance of that class to activate the +user-defined choice. +

+ +

Back to top

+ + + + + +
+Home
+Contacts:  Gregory SoyezGavin Salam + + + Index: tags/siscone-3.0.5/doc/html/algo_main.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/siscone-3.0.5/doc/html/algo_main.png =================================================================== --- tags/siscone-3.0.5/doc/html/algo_main.png (revision 425) +++ tags/siscone-3.0.5/doc/html/algo_main.png (revision 426) Property changes on: tags/siscone-3.0.5/doc/html/algo_main.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/siscone-3.0.5/doc/html/download.html =================================================================== --- tags/siscone-3.0.5/doc/html/download.html (revision 0) +++ tags/siscone-3.0.5/doc/html/download.html (revision 426) @@ -0,0 +1,47 @@ + + + + + +SISCone: Download + + + + + + + +

SISCone Documentation

+

+ +

Version 3.0.5

+

+
+ +

Downloading SISCone

+ +

+You can download here the of SISCone source code. It is developped under the terms of the GNU General Public License (GPL). A version of the license should be included in the code. +

+

+The algorithm used by SISCone has been subject of a publication in +JHEP 05 (2007) 086 +[arXiv:0704.0292 (hep-ph)]. Please refer to that work each time it is appropriate. +

+

+Download SISCone 3.0.5 (latest stable - April 2020 - Release notes) +

+ +

+You can alternatively download SISCone from its SVN repository.
This can be browsed via HTTP access or accessed using the Subversion repository svn+ssh://vcs@phab.hepforge.org/source/sisconesvn. +

+ + + + +
+Home
+Contacts:  Gregory SoyezGavin Salam + + Index: tags/siscone-3.0.5/doc/html/index.html =================================================================== --- tags/siscone-3.0.5/doc/html/index.html (revision 0) +++ tags/siscone-3.0.5/doc/html/index.html (revision 426) @@ -0,0 +1,61 @@ + + + + + +SISCone : Main Page + + + + + + + +

SISCone Documentation

+

+ +

Version 3.0.5

+

+
+ +

+SISCone is a Seedless Infrared Safe Cone jet algorithm. +

+

+It was developped by Gavin Salam and Gregory Soyez. +It is available as a library, as a standalone program +or as a FastJet (>= 2.1) plugin. +

+

+ + + +
News (April 24 2020): We have +released a new version of SISCone (v3.0.5). This minor release fixes a signed/unsigned warning in bitshift operations (thanks to Andrii Verbytskyi).
Relative to the 2.0.X series, SISCone 3.0.X adds the option of running SISCone with progressive removal (instead of the standard split-merge step). This version will be available in FastJet(>=3.3.4). +
+

+

+The algorithm is described in the publication +JHEP 05 (2007) 086 +[arXiv:0704.0292 [hep-ph]]. See +the links below for more detailed information. +

+

+Useful links
+

+ + + +
+Home
+Contacts:  Gregory SoyezGavin Salam + + Index: tags/siscone-3.0.5/doc/html/algo_main.dot =================================================================== --- tags/siscone-3.0.5/doc/html/algo_main.dot (revision 0) +++ tags/siscone-3.0.5/doc/html/algo_main.dot (revision 426) @@ -0,0 +1,29 @@ +digraph algo_main { + nodesep=0.15; + ranksep=0.15; + node [shape=box,style=filled,fillcolor="#CCCCFF",color=blue,fontcolor="#880000"]; + intro [label="Put the set of current particles\nequal to the set of all particles in the event"]; + proto [label="Find all stable cones for the current set of particles"] + add_proto [label="Add each stable cone (defined by the set\nof particles contained in the cone)\nto the list of protojets"]; + remove [label="Remove all particles that are in stable cones\nfrom the list of current particles"]; + end_algo [label="Run the Tevatron Run-II split-merge procedure\non the full list of protojets, with overlap parameter f",height=0.5]; + + node [shape=polygon,sides=4,orientation=45]; + end_loop [label="No new stable cones have been found\nOR one has gone around the loop Npass times"]; + + node [style="invis",fixedsize=true]; + proto_partner [width=0,height=0]; + end_loop_partner [width=0,height=0]; + + { rank="same"; proto; proto_partner; } + { rank="same"; end_loop; end_loop_partner; } + + edge [arrowsize=0.7]; + + intro -> proto -> add_proto -> remove -> end_loop; + end_loop -> end_algo [label=" yes"]; + + end_loop -> end_loop_partner[weight=0,dir=none]; + proto -> proto_partner[weight=0,dir=back]; + end_loop_partner -> proto_partner[label=" no",samehead,sametail,dir=none]; +} Index: tags/siscone-3.0.5/doc/html/home.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/siscone-3.0.5/doc/html/home.png =================================================================== --- tags/siscone-3.0.5/doc/html/home.png (revision 425) +++ tags/siscone-3.0.5/doc/html/home.png (revision 426) Property changes on: tags/siscone-3.0.5/doc/html/home.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/siscone-3.0.5/doc/html/perfs.html =================================================================== --- tags/siscone-3.0.5/doc/html/perfs.html (revision 0) +++ tags/siscone-3.0.5/doc/html/perfs.html (revision 426) @@ -0,0 +1,52 @@ + + + + + +SISCone: Performances + + + + + + + +

SISCone Documentation

+

+ +

Version 3.0.5

+

+
+ +

Execution time

+This figure shows the execution time as a function of the number of particles and compares it with other algorithms. +It has been obtained on a 3.4 GHz Pentium® IV processor. +

+ +

+ +
+ +

Algorithm complexity

+

+SISCone's complexity is dominated by the search for stable cones. If N is the number of particles in the event and n the number of particles in a cone, the complexity goes like +

+

+       N n log(n) +

+

+dominated by the ordering of the O(n) points in the vicinity of each particle. +

+

+Note: for the version of SISCone with progressive-removal, the stable-sone search has to be repeated O(N/n) times, yielding a O(N2log(n)) complexity. +

+ + + + +
+Home
+Contacts:  Gregory SoyezGavin Salam + + Index: tags/siscone-3.0.5/doc/html/etilde.jpg =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/siscone-3.0.5/doc/html/etilde.jpg =================================================================== --- tags/siscone-3.0.5/doc/html/etilde.jpg (revision 425) +++ tags/siscone-3.0.5/doc/html/etilde.jpg (revision 426) Property changes on: tags/siscone-3.0.5/doc/html/etilde.jpg ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/siscone-3.0.5/doc/html/style.css =================================================================== --- tags/siscone-3.0.5/doc/html/style.css (revision 0) +++ tags/siscone-3.0.5/doc/html/style.css (revision 426) @@ -0,0 +1,319 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 100%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 140%; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: Fixed, monospace; + font-size: 95%; +} +PRE.fragment { + border: 0px solid #CCCCCC; + background-color: #CCCCFF; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } +TD.md { background-color: #F4F4FB; font-weight: bold; } +TD.mdPrefix { + background-color: #F4F4FB; + color: #606060; + font-size: 80%; +} +TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } +TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; +# background-image: url("sc.jpg"); + background-color: #FFFFFF; + background-repeat: repeat-y; + background-position: top center; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +TABLE.code { + border: 1px solid #0000FF; + background-color: #CCCCFF; + width: 100% +} +.mdTable { + border: 1px solid #868686; + background-color: #F4F4FB; +} +.mdRow { + padding: 8px 10px; +} +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + Index: tags/siscone-3.0.5/doc/html/algorithm.html =================================================================== --- tags/siscone-3.0.5/doc/html/algorithm.html (revision 0) +++ tags/siscone-3.0.5/doc/html/algorithm.html (revision 426) @@ -0,0 +1,36 @@ + + + + + +SISCone: Algorithm + + + + + + + +

SISCone Documentation

+

+ +

Version 3.0.5

+

+
+ + +

Scheme for the main algorithm

+ +
+

Scheme for stable cone determination

+ + + + + +
+Home
+Contacts:  Gregory SoyezGavin Salam + + Index: tags/siscone-3.0.5/doc/html/sm_issue.html =================================================================== --- tags/siscone-3.0.5/doc/html/sm_issue.html (revision 0) +++ tags/siscone-3.0.5/doc/html/sm_issue.html (revision 426) @@ -0,0 +1,78 @@ + + + + + +SISCone: split-merge issues + + + + + + + +

SISCone Documentation

+

+ +

Version 3.0.5

+

+
+ +

+The split-merge variable issue: +

+ +SISCone is intended to be a cone algorithm that is as close as +possible to the Tevatron run II cone +algorithm, while also being infrared (IR) safe. + +

Though the main IR difficulties are related to the search for +stable cones, and are solved by a seedless procedure, it turns out +that the split-merge phase of the algorithm is also non-trivial. +The Tevatron run II split-merge procedure requires that "protojets" be +considered in a sequence determined by some ordering variable. A +change in the sequence can leads to a change in the final jets. + +When trying to find the best suited variable for the ordering of protojets in +the split--merge process of SISCone, we met a couple of physical issues. +Their history goes as follows: +

    +
  • the Et variable, suggested e.g. in the Tevatron Run II +specification of the midpint algorithm, is not boost invariant.
  • + +
  • the pt variable, used e.g. in practical midpoint +implementations (except for MCFM), suffers from problems with two back-to-back +protojets. Due to momentum conservation, they can have the same pt. +Their ordering is thus random and can be modified by the addition of a soft +particle, leading to an IR unsafety problem.
  • + + +
  • the mt variable does not directly suffer from that +problem: two back-to-back jets only overlap if they cover a region in +the eta-phi plane. In that case, their values of mt will +differ and the ordering is safe. This choice (the default one for +SISCone 1.1.0) suffers unfortunately from one remaining issue: though +mt works for pure QCD, in the case of two back-to-back +narrow-decay-width unstable particles (e.g. a pair of Higgs bosons), both pt +and mt will be the same.
  • + +
  • As of SISCone 1.1.1, we use pttilde: the p-scheme pt +(the sum of the moduli of transverse momenta of all particles in the +protojet ) that interpolates between pt and +mt according to the decay plane of the unstable +massive particle. This will lift the degeneracy between decays of +identical pairs of unstable particles, since the phase space for them +to have identical decay planes vanishes.
  • +
+ + + + +
+Home
+Contacts:  Gregory SoyezGavin Salam + + + Index: tags/siscone-3.0.5/doc/html/home.xpm =================================================================== --- tags/siscone-3.0.5/doc/html/home.xpm (revision 0) +++ tags/siscone-3.0.5/doc/html/home.xpm (revision 426) @@ -0,0 +1,36 @@ +/* XPM */ +static char * home_xpm[] = { +"24 24 9 1", +" c None", +". c #020202", +"+ c #6C7962", +"@ c #7A8A6E", +"# c #FEFEFE", +"$ c #7E8E76", +"% c #82927A", +"& c #C8CEC4", +"* c #E3E7E1", +" ", +" ", +" ", +" ", +" . ... ", +" .#. .&. ", +" .#*%..&. ", +" .##&&$.&. ", +" .##&&&&$&. ", +" .*#&&&&&&@. ", +" .##&&&&&&&&+. ", +" .###&&&&&&&&&+. ", +" ...##&&&&&&&&+... ", +" .##&&&&&&&&+. ", +" .##....&&&&+. ", +" .##.&&.&&&&+. ", +" .##.&&.&&&&+. ", +" .#*.&&.&&&&+. ", +" .&+.++.+++++. ", +" ............. ", +" ", +" ", +" ", +" "}; Index: tags/siscone-3.0.5/doc/html/timings.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/siscone-3.0.5/doc/html/timings.png =================================================================== --- tags/siscone-3.0.5/doc/html/timings.png (revision 425) +++ tags/siscone-3.0.5/doc/html/timings.png (revision 426) Property changes on: tags/siscone-3.0.5/doc/html/timings.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/siscone-3.0.5/doc/html/algo_stable.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: tags/siscone-3.0.5/doc/html/algo_stable.png =================================================================== --- tags/siscone-3.0.5/doc/html/algo_stable.png (revision 425) +++ tags/siscone-3.0.5/doc/html/algo_stable.png (revision 426) Property changes on: tags/siscone-3.0.5/doc/html/algo_stable.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: tags/siscone-3.0.5/doc/html/algo_stable.dot =================================================================== --- tags/siscone-3.0.5/doc/html/algo_stable.dot (revision 0) +++ tags/siscone-3.0.5/doc/html/algo_stable.dot (revision 426) @@ -0,0 +1,119 @@ +digraph algo_stable { + nodesep=0.15; + ranksep=0.15; + + { + nodesep=0.15; + ranksep=0.15; + + node [shape=box,style=filled,fillcolor="#CCCCFF",color=blue,fontcolor="#880000"]; + + init[label="set particle i to be the first particle"]; + + vicinity[label="Find all particles j within distance 2R of i and for each\n\ + j identify the two circles defined by i and j. For each circle,\n\ + compute the angle of its center C relative to i, \n\ + (zeta = atan(d phi_{iC}/d y_{iC}))"]; + + sort[label="Sort the circles into increasing angle zeta"]; + + init_cone[label="For the first circle in this order, calculate the total\n\ + momentum and checkxor for the cones that it defines.\n\ + Consider all 4 permutations of edge points being included\n\ + or excluded. Call these the 'current cones'"]; + + node [shape=polygon,sides=2,orientation=45]; + browse_current[label = "for each of the 4 current cones"]; + node [shape=box,orientation=0,style=filled,fillcolor="#CCCCFF",color=blue,fontcolor="#880000"]; + + test_cone1[label="this cone has not yet been found add\nit to the list of distinct cones"]; + + test_cone2[label="if this cone has not yet been labelled as unstable, establish\n\ + if the in/out status of the edge particles (with respect to the cone\n\ + momentum axis) is the same as when defining the cone; if it is\n\ + not, label the cone as unstable"]; + + node [style="invis",fixedsize=true]; + end_current[width=0,height=0]; + + node [shape=box,style=filled,fillcolor="#CCCCFF",color=blue,fontcolor="#880000",fixedsize=false]; + update_cone[label="Move to the next circle in order. It differs from the previous\n\ + one either by a particle entering the circle, or one leaving the\n\ + circle. Calculate the momentum for the new circle by adding (or\n\ + removing) the momentum of the particle that has entered (left); the\n\ + checkxor can be updated by XORing with the label of that particle."]; + + node [shape=polygon,sides=4,orientation=45]; + until[label="test if all circles are considered"]; + node [shape=box,orientation=0,style=filled,fillcolor="#CCCCFF",color=blue,fontcolor="#880000"]; + + node [shape=polygon,sides=4,orientation=45]; + next_particle[label="move to the next particle: increment i, if possible"]; + node [shape=box,orientation=0,style=filled,fillcolor="#CCCCFF",color=blue,fontcolor="#880000"]; + + node [shape=polygon,sides=2,orientation=45]; + browse_proto[label = "for each of the cones labelled as unstable"]; + node [shape=box,orientation=0,style=filled,fillcolor="#CCCCFF",color=blue,fontcolor="#880000"]; + + node [shape=polygon,sides=4,orientation=45]; + final_check[label="Explicitly check if the cone is stable"]; + node [shape=box,sides=4,orientation=0]; + check_ok[label="add it to the list of stable cones (protojets)"]; + + node [style="invis",fixedsize=true]; + end_proto[width=0,height=0]; + + edge [arrowsize=0.7]; + + init -> vicinity -> sort -> init_cone -> browse_current -> test_cone1 -> test_cone2; + test_cone2 -> end_current[dir=none]; + end_current -> update_cone -> until -> next_particle -> browse_proto -> final_check; + final_check -> check_ok[label="yes"]; + check_ok -> end_proto[dir=none]; + } + // virtual nodes + ///////////////// + { + node [style="invis",fixedsize=true]; + + vicinity_p[width=0,height=0]; + init_cone_p[width=0,height=0]; + browse_current_p[width=0,height=0]; + end_current_p[width=0,height=0]; + until_p[width=0,height=0]; + next_particle_p[width=0,height=0]; + browse_proto_p[width=0,height=0]; + final_p[width=0,height=0]; + end_proto_p[width=0,height=0]; + } + + { rank="same"; vicinity; vicinity_p; } + { rank="same"; init_cone; init_cone_p; } + { rank="same"; browse_current; browse_current_p; } + { rank="same"; end_current; end_current_p; } + { rank="same"; until; until_p; } + { rank="same"; next_particle; next_particle_p; } + { rank="same"; browse_proto; browse_proto_p; } + { rank="same"; final_check; final_p; } + { rank="same"; end_proto; end_proto_p; } + + edge [arrowsize=0.7]; + + end_current->end_current_p[weight=0,dir=none]; + browse_current->browse_current_p[weight=0,dir=back]; + end_current_p->browse_current_p[samehead,sametail,dir=none]; + + until->until_p[weight=0,dir=none]; + init_cone->init_cone_p[weight=0,dir=back]; + until_p->init_cone_p[label=" no",samehead,sametail,dir=none]; + + next_particle->next_particle_p[weight=0,dir=none]; + vicinity->vicinity_p[weight=0,dir=back]; + next_particle_p->vicinity_p[label=" yes",samehead,sametail,dir=none]; + + end_proto->end_proto_p[weight=0,dir=none]; + final_check->final_p[headlabel="no",weight=0]; + browse_proto->browse_proto_p[weight=0,dir=back]; + end_proto_p->final_p[samehead,sametail,dir=none]; + final_p->browse_proto_p[samehead,sametail,dir=none]; +} Index: tags/siscone-3.0.5/doc/html/doxygen.css =================================================================== --- tags/siscone-3.0.5/doc/html/doxygen.css (revision 0) +++ tags/siscone-3.0.5/doc/html/doxygen.css (revision 426) @@ -0,0 +1,310 @@ +BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +BODY,TD { + font-size: 90%; +} +H1 { + text-align: center; + font-size: 160%; +} +H2 { + font-size: 120%; +} +H3 { + font-size: 100%; +} +CAPTION { font-weight: bold } +DIV.qindex { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.nav { + width: 100%; + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + padding: 2px; + line-height: 140%; +} +DIV.navtab { + background-color: #e8eef2; + border: 1px solid #84b0c7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} +TD.navtab { + font-size: 70%; +} +A.qindex { + text-decoration: none; + font-weight: bold; + color: #1A419D; +} +A.qindex:visited { + text-decoration: none; + font-weight: bold; + color: #1A419D +} +A.qindex:hover { + text-decoration: none; + background-color: #ddddff; +} +A.qindexHL { + text-decoration: none; + font-weight: bold; + background-color: #6666cc; + color: #ffffff; + border: 1px double #9295C2; +} +A.qindexHL:hover { + text-decoration: none; + background-color: #6666cc; + color: #ffffff; +} +A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code:link { text-decoration: none; font-weight: normal; color: #0000FF} +A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF} +A.codeRef:link { font-weight: normal; color: #0000FF} +A.codeRef:visited { font-weight: normal; color: #0000FF} +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +.fragment { + font-family: Fixed, monospace; + font-size: 95%; +} +PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } +TD.md { background-color: #F4F4FB; font-weight: bold; } +TD.mdPrefix { + background-color: #F4F4FB; + color: #606060; + font-size: 80%; +} +TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } +TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} +DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } +BODY { + background: white; + color: black; + margin-right: 20px; + margin-left: 20px; +} +TD.indexkey { + background-color: #e8eef2; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TD.indexvalue { + background-color: #e8eef2; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +TR.memlist { + background-color: #f0f0f0; +} +P.formulaDsp { text-align: center; } +IMG.formulaDsp { } +IMG.formulaInl { vertical-align: middle; } +SPAN.keyword { color: #008000 } +SPAN.keywordtype { color: #604020 } +SPAN.keywordflow { color: #e08000 } +SPAN.comment { color: #800000 } +SPAN.preprocessor { color: #806020 } +SPAN.stringliteral { color: #002080 } +SPAN.charliteral { color: #008080 } +.mdTable { + border: 1px solid #868686; + background-color: #F4F4FB; +} +.mdRow { + padding: 8px 10px; +} +.mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.mdescRight { + padding: 0px 8px 4px 8px; + font-size: 80%; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +.memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: none; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-size: 80%; +} +.memTemplParams { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-top-style: solid; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + color: #606060; + background-color: #FAFAFA; + font-size: 80%; +} +.search { color: #003399; + font-weight: bold; +} +FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +TD.tiny { font-size: 75%; +} +a { + color: #1A41A8; +} +a:visited { + color: #2A3798; +} +.dirtab { padding: 4px; + border-collapse: collapse; + border: 1px solid #84b0c7; +} +TH.dirtab { background: #e8eef2; + font-weight: bold; +} +HR { height: 1px; + border: none; + border-top: 1px solid black; +} + Index: tags/siscone-3.0.5/doc/html/.gitignore =================================================================== --- tags/siscone-3.0.5/doc/html/.gitignore (revision 0) +++ tags/siscone-3.0.5/doc/html/.gitignore (revision 426) @@ -0,0 +1 @@ +/* Index: tags/siscone-3.0.5/doc/html =================================================================== --- tags/siscone-3.0.5/doc/html (revision 425) +++ tags/siscone-3.0.5/doc/html (revision 426) Property changes on: tags/siscone-3.0.5/doc/html ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +* Index: tags/siscone-3.0.5/doc/.gitignore =================================================================== --- tags/siscone-3.0.5/doc/.gitignore (revision 0) +++ tags/siscone-3.0.5/doc/.gitignore (revision 426) @@ -0,0 +1 @@ +/devel Index: tags/siscone-3.0.5/doc =================================================================== --- tags/siscone-3.0.5/doc (revision 425) +++ tags/siscone-3.0.5/doc (revision 426) Property changes on: tags/siscone-3.0.5/doc ___________________________________________________________________ Added: svn:ignore ## -0,0 +1 ## +devel Index: tags/siscone-3.0.5/INSTALL =================================================================== --- tags/siscone-3.0.5/INSTALL (revision 0) +++ tags/siscone-3.0.5/INSTALL (revision 426) @@ -0,0 +1,62 @@ +Installation procedure: +======================= + +You have two options to install the SISCone jet finder: +1. use the standard configure/make/make install technique (recommended) +2. use the 'old-fashionned' Makefile + + +1. Installation through configure/make/make install +--------------------------------------------------- + +This is the recommended method for installing the SISCone library, headers +and programs. For a 'standard' installation process, you just need to do +$ ./configure +$ make +$ make install + +In short, 'configure' checks if your system has the required tools to +build SISCone, 'make' actually does the build and 'make install' +installs everything in the correct directories. + +Notes: + +- If you're using an svn version of SISCone, you first need to issue + ./autogen.sh + (to which you can pass configure's options, see below for details) + in order to generate the configure script from svn files. + +- The SISCone library is installed in ${prefix}/lib, the SISCone + development headers in ${prefix}/include/siscone and the useful + programs in ${prefix}/bin. The default prefix is /usr/local but + this can be changed by passing the --prefix= + to the 'configure' script. Note that if you do not have sufficiently + write access you may need to issue 'make install' as root. + Also, if you install SISCone in a non standard location (e.g. + /usr/local/SISCone), do not forget to append ${prefix}/lib to your + LD_LIBARY_PATH. + +- By default, both shared (libsiscone.so) and static (libsiscone.a) + libraries are built and installed. You can disable one of them by + passing --disable-shared or --disable-static to 'configure'. + + +2. Installation using the Makefiles +----------------------------------- + +If you do not feel comfortable with the suggested installation +procedure, it is still possible to install it using the old-fashionned +'make' method. For that, you just need to tell 'make' to use +makefile.static as a main Makefile. This is done typing +$ make -f makefile.static + +This will build the siscone library as src/libsiscone.a and the +various example programs in examples/ : +- 'siscone' an application with options to tune it from the command line + (see main.cpp and options.h/cpp) +- 'sample' another example (used in the html documentation (see doc/html)) +- 'test' a testing program (see src/test.cpp) +- 'times' computes execution times and various statistics for 1 <= N <= 1000 +- mem_check a shell script for checking memory usage as a function of the + number of particles (requires google perftools). +You also have access to the SISCone headers in the src folder. Index: tags/siscone-3.0.5/COPYING =================================================================== --- tags/siscone-3.0.5/COPYING (revision 0) +++ tags/siscone-3.0.5/COPYING (revision 426) @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS Index: tags/siscone-3.0.5/CHECKLIST =================================================================== --- tags/siscone-3.0.5/CHECKLIST (revision 0) +++ tags/siscone-3.0.5/CHECKLIST (revision 426) @@ -0,0 +1,257 @@ +List of tasks to perform to release a new version of SISCone + +====================================================================== +SISCone X.Y.Z release checklist +---------------------------------------------------------------------- +X.Y.Z make a copy of this +X.Y.Z run svn up +X.Y,Z update version number by running ./setversion.sh +X.Y.Z include the release in NEWS +X.Y.Z run doxygen +X.Y.Z update the html doc + . announcement in index.html + . download link (and date+version) in download.html +X.Y.Z mention the release in Changelog by adding + "Release of SISCone X.Y.Z" +X.Y.Z make sure everything is committed +X.Y.Z run 'make distcheck' +X.Y.Z tag the release + svn cp . svn+ssh://vcs@phab.hepforge.org/source/sisconesvn/tags/siscone-X.Y.Z +X.Y.Z copy the tarball to HepForge + scp siscone-X.Y.Z.tar.gz login.hepforge.org:/hepforge/projects/siscone/downloads/ +X.Y.Z update the HepForge pages + . backup 'devel', 'include', *.html in a vX.Y.(Z-1) folder + . check the header and footer in 'include' + . update the announcement in index.html + . update the download info in downloads.html + . copy the Doxygen doc and run ./webadapt.sh + . update release_notes.txt (and point downloads.html to it instead of NEWS) + Note: if some html fixes have been done on hepforge + backport them to the trunk + +X.Y.Z switch version number to X.Y.Z+1-devel +X.Y.Z make sure everything is committed + +====================================================================== +SISCone 3.0.5 release checklist +---------------------------------------------------------------------- +3.0.5 make a copy of this +3.0.5 run svn up +3.0.5 update version number by running ./setversion.sh 3.0.5 +3.0.5 include the release in NEWS +3.0.5 run doxygen +3.0.5 update the html doc + . announcement in index.html + . download link (and date+version) in download.html +3.0.5 mention the release in Changelog by adding + "Release of SISCone X.Y.Z" +3.0.5 make sure everything is committed +X.Y.Z run 'make distcheck' +X.Y.Z tag the release + svn cp . svn+ssh://vcs@phab.hepforge.org/source/sisconesvn/tags/siscone-X.Y.Z +X.Y.Z copy the tarball to HepForge + scp siscone-X.Y.Z.tar.gz login.hepforge.org:/hepforge/projects/siscone/downloads/ +X.Y.Z update the HepForge pages + . backup 'devel', 'include', *.html in a vX.Y.(Z-1) folder + . check the header and footer in 'include' + . update the announcement in index.html + . update the download info in downloads.html + . copy the Doxygen doc and run ./webadapt.sh + . update release_notes.txt (and point downloads.html to it instead of NEWS) + Note: if some html fixes have been done on hepforge + backport them to the trunk + +X.Y.Z switch version number to X.Y.Z+1-devel +X.Y.Z make sure everything is committed + +====================================================================== +SISCone 3.0.4 release checklist +---------------------------------------------------------------------- +3.0.4 make a copy of this +3.0.4 run svn up +3.0.4 update version number by running ./setversion.sh +3.0.4 include the release in NEWS +3.0.4 run doxygen +3.0.4 update the html doc + . announcement in index.html + . download link (and date+version) in download.html +3.0.4 mention the release in Changelog by adding + "Release of SISCone X.Y.Z" +3.0.4 make sure everything is committed +3.0.4 run 'make distcheck' +3.0.4 tag the release + svn cp . svn+ssh://vcs@phab.hepforge.org/source/sisconesvn/tags/siscone-3.0.4 +3.0.4 copy the tarball to HepForge + scp siscone-3.0.4.tar.gz login.hepforge.org:/hepforge/projects/siscone/downloads/ +3.0.4 update the HepForge pages + v backup 'devel', 'include', *.html in a vX.Y.(Z-1) folder + v check the header and footer in 'include' + v update the announcement in index.html + v update the download info in downloads.html + v copy the Doxygen doc and run ./webadapt.sh + v update release_notes.txt (and point downloads.html to it instead of NEWS) + +3.0.4 switch version number to 3.0.5-devel +3.0.5-devel make sure everything is committed + +====================================================================== +SISCone 3.0.3 release checklist +---------------------------------------------------------------------- +3.0.3 make a copy of this +3.0.3 run svn up +3.0.3 update version number by running ./setversion.sh 3.0.3 [new version of the script] +3.0.3 include the release in NEWS +3.0.3 run doxygen +3.0.3 update the html doc + v announcement in index.html + v download link (and date+version) in download.html +3.0.3 mention the release in Changelog by adding + "Release of SISCone X.Y.Z" +3.0.3 make sure everything is committed +3.0.3 run 'make distcheck' +3.0.3 tag the release + svn cp . svn+ssh://login.hepforge.org/hepforge/svn/siscone/tags/siscone-3.0.3 +3.0.3 copy the tarball to HepForge + scp siscone-3.0.3.tar.gz login.hepforge.org:~siscone/downloads/ +3.0.3 update the HepForge pages + v backup 'devel', 'include', *.html in a v3.0.2 folder + v check the header and footer in 'include' + v update the announcement in index.html + v update the download info in downloads.html + v copy the Doxygen doc and run ./webadapt.sh + v update release_notes.txt (and point downloads.html to it instead of NEWS) +3.0.3 switch version number to X.Y.Z+1-devel +3.0.3 make sure everything is committed + +====================================================================== +SISCone 3.0.2 release checklist +---------------------------------------------------------------------- +3.0.2 make a copy of this +3.0.2 run svn up +3.0.2 update version numbber in configure.ac +3.0.2 update version number by running ./setversion.sh +3.0.2 update version number in Doxyfile (should go in the script!) +3.0.2 include the release in NEWS +3.0.2 run doxygen +3.0.2 update the html doc + . version number in each header [should be automated!] + . announcement in index.html + . download link (and date) in download.html +3.0.2 mention the release in Changelog by adding + "Release of SISCone 3.0.2" +3.0.2 make sure everything is committed +3.0.2 run 'make distcheck' +3.0.2 tag the release + svn cp . svn+ssh://login.hepforge.org/hepforge/svn/siscone/tags/siscone-3.0.2 +3.0.2 copy the tarball to HepForge + scp siscone-3.0.2.tar.gz login.hepforge.org:~siscone/downloads/ +3.0.2 update the HepForge pages + v backup 'devel', 'include', *.html in a v3.0.1 folder + v check the header and footer in 'include' + v update the announcement in index.html + v update the download info in downloads.html + v copy the Doxygen doc and run ./webadapt.sh + v update release_notes.txt (and point downloads.html to it instead of NEWS) + Note: some html fixes have been done on hepforge + backport them to the trunk + +3.0.2 switch version number to 3.0.3-devel +3.0.3-devel make sure everything is committed + +====================================================================== +SISCone 3.0.1 release checklist +---------------------------------------------------------------------- +3.0.1 make a copy of this +3.0.1 run svn up +3.0.1 update version numbber in configure.ac +3.0.1 update version number by running ./setversion.sh +3.0.1 update version number in Doxyfile (should go in the script!) +3.0.1 include the release in NEWS +3.0.1 run doxygen +3.0.1 update the html doc + . version number in each header [should be automated!] + . announcement in index.html + . download link (and date) in download.html +3.0.1 mention the release in Changelog by adding + "Release of SISCone X.Y.Z" +3.0.1 make sure everything is committed +3.0.1 run 'make distcheck' +3.0.1 tag the release + svn cp . svn+ssh://login.hepforge.org/hepforge/svn/siscone/tags/siscone-3.0.1 +3.0.1 copy the tarball to HepForge + scp siscone-3.0.1.tar.gz login.hepforge.org:~siscone/downloads/ +3.0.1 update the HepForge pages + . backup 'devel', 'include', *.html in a vX.Y.Z folder + . check the header and footer in 'include' + . update the announcement in index.html + . update the download info in downloads.html + . copy the Doxygen doc and run ./webadapt.sh + . update release_notes.txt (and point downloads.html to it instead of NEWS) + Note: some html fixes have been done on hepforge + backport them to the trunk + +3.0.1 switch version number to X.Y.Z+1-devel +3.0.1 make sure everything is committed + +====================================================================== +SISCone 3.0.0 release checklist +---------------------------------------------------------------------- +3.0.0 make a copy of this +3.0.0 run svn up +3.0.0 update version number by running ./setversion.sh +3.0.0 update version number in Doxyfile (should go in the script!) +3.0.0 include the release in NEWS +3.0.0 run doxygen +3.0.0 update the html doc + . version number in each header [should be automated!] + . announcement in index.html + . download link (and date) in download.html +3.0.0 mention the release in Changelog by adding + "Release of SISCone X.Y.Z" +3.0.0 make sure everything is committed +3.0.0 run 'make distcheck' +3.0.0 tag the release + svn cp . svn+ssh://login.hepforge.org/hepforge/svn/siscone/tags/siscone-X.Y.Z +3.0.0 copy the tarball to HepForge + scp siscone-X.Y.Z.tar.gz login.hepforge.org:~siscone/downloads/ +3.0.0 update the HepForge pages + . backup 'devel', 'include', *.html in a vX.Y.Z folder + . check the header and footer in 'include' + . update the announcement in index.html + . update the download info in downloads.html + . copy the Doxygen doc and run ./webadapt.sh + . update release_notes.txt (and point downloads.html to it instead of NEWS) +3.0.0 switch version number to X.Y.Z+1-devel +3.0.0 make sure everything is committed + +====================================================================== +SISCone 2.0.6 release checklist +---------------------------------------------------------------------- +2.0.6 make a copy of this +2.0.6 run svn up +2.0.6 update version number by running ./setversion.sh +2.0.6 update version number in Doxyfile (should go in the script!) +2.0.6 include the release in NEWS +2.0.6 run doxygen +2.0.6 update the html doc + . version number in each header [should be automated!] + . announcement in index.html + . download link (and date) in download.html +2.0.6 mention the release in Changelog by adding + "Release of SISCone X.Y.Z" +2.0.6 run 'make distcheck' +2.0.6 make sure everything is committed +2.0.6 tag the release + svn cp . svn+ssh://login.hepforge.org/hepforge/svn/siscone/tags/siscone-2.0.6 +2.0.6 copy the tarball to HepForge + scp siscone-X.Y.Z.tar.gz login.hepforge.org:~siscone/downloads/ +2.0.6 update the HepForge pages + . backup 'devel', 'include', *.html in a vX.Y.Z folder + . check the header and footer in 'include' + . update the announcement in index.html + . update the download info in downloads.html + . copy the Doxygen doc and run ./webadapt.sh + . update release_notes.txt +2.0.6 switch version number to X.Y.Z+1-devel +2.0.6 make sure everything is committed + Index: tags/siscone-3.0.5/Makefile.am =================================================================== --- tags/siscone-3.0.5/Makefile.am (revision 0) +++ tags/siscone-3.0.5/Makefile.am (revision 426) @@ -0,0 +1,14 @@ +SUBDIRS = siscone examples +EXTRA_DIST = makefile.static Doxyfile + +# local macros for aclocal +ACLOCAL_AMFLAGS = -I m4 + +# AX_PREFIX_CONFIG_H leaves some files undeleted after a make distclean +# +# we could use DISTCLEAN=... here but this would also overwrite the defaults +# So, instead, we use the (apparently recommended) -local target to extend +# the default behaviour +distclean-local: distclean-ax-prefix-config-h +distclean-ax-prefix-config-h: + rm -f _configs.sed siscone/config.h Index: tags/siscone-3.0.5/setversion.sh =================================================================== --- tags/siscone-3.0.5/setversion.sh (revision 0) +++ tags/siscone-3.0.5/setversion.sh (revision 426) @@ -0,0 +1,45 @@ +#!/bin/bash +# +# Script to update the version number in the locations where it is +# hard-coded. +# +# Usage: +# ./setversion.sh +# The version number will be read from configure.ac + + +if [ $# -ne 1 ] +then + echo "Usage: scripts/set-version.sh version-number" + exit +fi + +version=$1 +echo "------------ Will set SISCone version to $version -----------" + +echo +echo "------------ Setting it in configure.ac ---------------------" +sed -i.bak 's/^\(AC_INIT(\[.*\], \[\).*/\1'$version'])/' configure.ac +diff configure.ac.bak configure.ac + +echo +echo "------------ Setting it in Doxyfile -------------------------" +sed -i.bak 's/^\(PROJECT_NUMBER.*=\).*/\1 '$version'/' Doxyfile +diff Doxyfile.bak Doxyfile + +echo +echo "------------ Setting it in documentation---------------------" +for fn in algorithm.html download.html index.html perfs.html sm_issue.html usage.html; do + sed -i.bak 's/Version .* /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`autoconf' installed to." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +(grep "^AC_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && { + (((libtool --version) < /dev/null > /dev/null 2>&1) || + ((libtool -V) < /dev/null > /dev/null 2>&1)) || + { + echo + echo "**Error**: You must have \`libtool' installed." + echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz" + echo "(or a newer version if it is available)" + DIE=1 + } +} + +grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null && { + grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \ + (gettext --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`gettext' installed." + echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz" + echo "(or a newer version if it is available)" + DIE=1 + } +} + +(automake --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: You must have \`automake' installed." + echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" + echo "(or a newer version if it is available)" + DIE=1 + NO_AUTOMAKE=yes +} + + +# if no automake, don't bother testing for aclocal +test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "**Error**: Missing \`aclocal'. The version of \`automake'" + echo "installed doesn't appear recent enough." + echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" + echo "(or a newer version if it is available)" + DIE=1 +} + +if test "$DIE" -eq 1; then + exit 1 +fi + +if test -z "$*"; then + echo "**Warning**: I am going to run \`configure' with no arguments." + echo "If you wish to pass any to it, please specify them on the" + echo \`$0\'" command line." + echo +fi + +case $CC in +xlc ) + am_opt=--include-deps;; +esac + +for coin in `find $srcdir -name configure.ac -print` +do + dr=`dirname $coin` + if test -f $dr/NO-AUTO-GEN; then + echo skipping $dr -- flagged as no auto-gen + else + echo processing $dr + #macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin` + macrodirs="m4" + ( cd $dr + aclocalinclude="$ACLOCAL_FLAGS -I ." + for k in $macrodirs; do + if test -d $k; then + aclocalinclude="$aclocalinclude -I $k" + ##else + ## echo "**Warning**: No such directory \`$k'. Ignored." + fi + done + if grep "^AM_GNU_GETTEXT" configure.ac >/dev/null; then + if grep "sed.*POTFILES" configure.ac >/dev/null; then + : do nothing -- we still have an old unmodified configure.ac + else + echo "Creating $dr/aclocal.m4 ..." + test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 + echo "Running gettextize... Ignore non-fatal messages." + echo "no" | gettextize --force --copy + echo "Making $dr/aclocal.m4 writable ..." + test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 + fi + fi + if grep "^AM_GNOME_GETTEXT" configure.ac >/dev/null; then + echo "Creating $dr/aclocal.m4 ..." + test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 + echo "Running gettextize... Ignore non-fatal messages." + echo "no" | gettextize --force --copy + echo "Making $dr/aclocal.m4 writable ..." + test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 + fi + if grep "^AC_PROG_LIBTOOL" configure.ac >/dev/null; then + echo "Running libtoolize..." + libtoolize --force --copy + fi + echo "Running aclocal $aclocalinclude ..." + aclocal $aclocalinclude + #if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then + # echo "Running autoheader..." + # autoheader + #fi + echo "Running automake --gnu $am_opt ..." + automake --add-missing --gnu $am_opt + echo "Running autoconf ..." + autoconf + ) + fi +done + +if test x$NOCONFIGURE = x; then + echo Running $srcdir/configure $conf_flags "$@" ... + $srcdir/configure $conf_flags "$@" \ + && echo Now type \`make\' to compile $PKG_NAME +else + echo Skipping configure process. +fi Property changes on: tags/siscone-3.0.5/autogen.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/siscone-3.0.5/NEWS =================================================================== --- tags/siscone-3.0.5/NEWS (revision 0) +++ tags/siscone-3.0.5/NEWS (revision 426) @@ -0,0 +1,217 @@ +This file contains the history of SISCone releases. For each one, +we give a short summary of the important changes from the previous +version. If you want to see a more detailed list of changes, please +read the ChangeLog file. + +SISCone version 3.0.5 (April 24 2020) +===================== + +* Minor release, fixed signed/unsigned warning in bitshift operations + (version to be included in FastJet>=3.3.4) + +SISCone version 3.0.4 (October 1 2018) +===================== + +* Minor release, improved shared library handling by fixing + inter-dependencies. (version to be included in FastJet>=3.3.2) + +SISCone version 3.0.3 (August 3 2016) +===================== + +* Minor release, installing config.h to include flags decided at + configure time. (version to be included in FastJet>=3.2.1) + +SISCone version 3.0.2 (March 16 2016) +===================== + +* Minor release, fixing a bug due to an array being used uninitialised + (no impact on results). Also replaced auto_ptr by unique_ptr when + supported by compiler (version to be included in FastJet>=3.2.0) + +SISCone version 3.0.1 (February 29 2016) +===================== + +* Minor release, fixing a bug due to a rounding issue that occurs the + theta range in (rare) specific configurations where theta=pi in the + split-merge procedure for spherical SISCone + +SISCone version 3.0.0 (September 9 2014) +===================== + +* Added the option of running SISCone with progressive removal, + corresponding to the following algorithm: + + 1. search for stable cones + 2. declare the hardest stable cone a jet and remove its particles + from the list of remaining particles + 3. if there are some remaining particles, go back to 1. + + Use Csiscone::compute_jets_progressive_removal(...) for this version + of SISCone + + The scale used to determine which is the hardest stable cone can be + chosen amongst the same options as the scale used for the + split--merge step [SM_pttilde by default for the pp version of + SISCone, SM_Etilde for the spherical version]. Alternatively, a + user-defined scale choice can be provided using set_user_scale(...). + + Version to be included in FastJet>=3.1.0 + +SISCone version 2.0.6 (April 9 2013) +===================== +* Minor release fixing an issue concerning the installation of + configuration headers and bringing small updates in the autotools + build system (version to be included in FastJet>=3.0.4) + +SISCone version 2.0.5 (January 17 2012) +===================== +* Minor release bringing minor improvements to the build system + (version to be included in FastJet>=3.0.2) + +SISCone version 2.0.4 (November 25 2011) +===================== +* Minor release to remove a few gcc warnings when compiled with + high warning level (-ansi -pedantic -Wextra -Wshadow) + (version to be included in FastJet>=3.0.1) + +SISCone version 2.0.3 (October 5 2011) +===================== +* Minor release to fix a badly documented Etilde variable in the + spherical version of SISCone and to remove a few gcc warnings + (version to be included in FastJet 3.x) + +SISCone version 2.0.2 (May 2011) +===================== +* minor modifications to the build system + (version to be included in FastJet 3.x) + +SISCone version 2.0.1 (May 2009) +===================== +* enabled shared libraries by default + [that was the source of a bug in fastJet] +* replaced _R with _radius to fix build problems on old OSX systems +* fixed some syntax inconsistencies in Makefile.am's + + +SISCone version 2.0.0 (Apr 2009) +===================== +* Added a spherical version of SISCone for use in e+e- collisions + This typically works in the same way as the pp version of SISCone + with the following remarks: + - the classes fot the spherical versions of SISCone are prefixed by + 'CSph' instead of 'C' (e.g. CSphMomentum CSphSISCone) + - the cone radius is defined as its half opening angle (particle + distances are also defined through the angle they define, or, + equivalently, as distances on the surface of a unit sphere) + - For ordering the protojets during the split--merge, we use + E_tilde defined as + / |p_i X p_J|^2 \ + \sum_{i\in J} E_i | 1 + --------------- | + \ |p_i|^2 E_J^2 / + Note that the computation of the overlap uses the "plain" energy + +* Added a flag (Csiscone::use_pt_weighted_splitting) to modify the + split part of the split-merge procedure in such a way that a shared + particle i is assigned the one of the overlapping jets j=1,2 that + has the smaller value of DeltaR_{ij}/p_{tj}. This produces more + circular jets. + +* fixed a bug in the computation of the rapidity range in the + split-merge step + +* the protocones list now contains the full 4-momentum information + (rather than just eta and phi) + +* fixed bugs in example/test.cpp + + +SISCone version 1.3.3 (Aug 2008) +===================== +* added bugfix for g++-4.3 (missing headers for "exit") + + +SISCone version 1.3.2 (Mar 2008) +===================== +* VERSION and PROGRAM (or PACKAGE_NAME) are no longer accessible + directly because of potential conflicts with other packages. + You should use siscone_version() and siscone_package_name() + instead. (Thanks to Rolf Seuster) +* allow the users to set their own default compilation flags. + + +SISCone version 1.3.1 (Mar 2008) +===================== +* fixed some compilation issues under windows + + +SISCone version 1.3.0 (Nov 2007) +===================== + +* The main update in this new release is the switch to + 'autotools'. This means that instead of using the (static) Makefile + build process, you can now use the "standard ./configure; make; make + install" approach. See the INSTALL file for details. + +* added a 'siscone_area' example of how jet areas work within SISCone. + + +SISCone version 1.2.0 (Jun 2007) +===================== + +* 10-15% speed increase by introducing a tiling in the eta-phi plane + allowing for better overlap checking in the split--merge. This can + turn into a bigger effect for area computations. + +* implementing a 'jet area' class to compute active and/or passive + areas. + +* in examples: + - fix bug in the cmdline parsing (there was a segfault with + unrecognised long options), + - add "passes information" to the verbose output of the main siscone + program, + - solve problems with the 'time' example. + + +SISCone version 1.1.1 (Mar 2007) +===================== + +* The major upgrade is the use of pttilde (p-scheme pt) instead + of mt in the split--merge process. Indeed, we have noticed + that mt can lead to IR usafety in the case of two back-to-back + narrow-decay-width unstable particles (e.g. a pair of Higgs bosons). + See http://projects.hepforge.org/siscone/sm_issue.html for details. + + Note that SISCone 1.1.1 allows the user to specify its choice for + the split-merge variable (we highly recommand the default choice) + +* The number of passes is now set to infinity (0) by default + +* Small minor changes in the 'siscone' command-line options + + +SISCone version 1.1.0 (Mar 2007) +===================== + +* dealt with colinearity issues + +* dealt with cocircularity situations (and related rounding errors) + +* use mt instead of pt in the split-merge + pt lead to some IR unsafety for events with momentum conservation + +* move all references to HEPForge + +* Important note: some typos have been fixed. As a consequence, some + end-user members have been affected: + - The contents of the jets is accessed through 'Cjet::contents' + instead of 'Cjet::content' + - The function called to save the jet contents to disk is + 'Csplit_merge::save_contents' instead of 'Csplit_merge::save_content' + Note that 'Csiscone::save_contents' is also valid. + + +SISCone version 1.0.0 (Jan 2007) +===================== + +This is the first stable release of siscone. Index: tags/siscone-3.0.5/examples/mem_check =================================================================== --- tags/siscone-3.0.5/examples/mem_check (revision 0) +++ tags/siscone-3.0.5/examples/mem_check (revision 426) @@ -0,0 +1,48 @@ +#!/bin/bash + +# this assumes that +# - you have pprof, sed, dc and awk +# - you have linked test with google profiler libraries (see src/Makefile) +get_mem_usage_event(){ + echo $i; + HEAPPROFILE=hp ./test $i + heap_file=`ls -1 *.heap | tail -n 1` + pprof --text --alloc_space --files ./test $heap_file | grep "??" > m.dat + mem_used=`awk '{print $4}' m.dat` +} + +save_to_file(){ + echo $i" "$mem_usage" "$mem_usage2 >> mem_usage.dat +} + +#rm mem_usage.dat + +get_mem_usage(){ + mem_usage=0.0 + mem_usage2=0.0 + for (( j=0 ; j<$N_runs ; j++ )); do + get_mem_usage_event + mem_usage=`echo "6 k $mem_usage $mem_used + p" | dc` + mem_usage2=`echo "6 k $mem_usage2 $mem_used $mem_used * + p" | dc` + done + mem_usage=`echo "6 k $mem_usage $N_runs / p" | dc` + mem_usage2=`echo "6 k $mem_usage2 $N_runs / $mem_usage $mem_usage * - p" | dc` + save_to_file +} + +N_runs=1000 +for (( i=10 ; i<100 ; i+=10 )); do + get_mem_usage +done +N_runs=100 +for (( i=100 ; i<1000 ; i+=50 )); do + get_mem_usage +done +N_runs=10 +for (( i=1000 ; i<5001 ; i+=500 )); do + get_mem_usage +done +#N_runs=5 +#for (( i=6000 ; i<6001 ; i+=500 )); do +# get_mem_usage +#done Property changes on: tags/siscone-3.0.5/examples/mem_check ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: tags/siscone-3.0.5/examples/spherical.cpp =================================================================== --- tags/siscone-3.0.5/examples/spherical.cpp (revision 0) +++ tags/siscone-3.0.5/examples/spherical.cpp (revision 426) @@ -0,0 +1,97 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: spherical.cpp // +// Description: example program for the CSphsiscone class (spherical SISCone)// +// This file is part of the SISCone project. // +// WARNING: this is not the main SISCone trunk but // +// an adaptation to spherical coordinates // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: 227 $// +// $Date:: 2008-06-12 20:00:44 -0400 (Thu, 12 Jun 2008) $// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include "siscone/spherical/momentum.h" +#include "siscone/spherical/siscone.h" + +#define R 0.7 +#define f 0.5 +#define f_alt 0.75 + +using namespace std; +using namespace siscone_spherical; + +int main(){ + vector particles; // list of particles + CSphsiscone siscone; // main object for the cone algorithm + int i; // loop index + int N; // number of particles + double px,py,pz,E; // particles 4-momentum + char fline[512]; // line to read from a file + + // read particles + FILE *flux; + flux = fopen("events/single-event.dat", "r"); + if (flux==NULL){ + cerr << "cannot read event" << endl; + return 1; + } + + N=0; + while (fgets(fline, 512, flux)!=NULL){ + if (fline[0]!='#'){ // skip lines beginning with '#' + if (sscanf(fline, "%le%le%le%le", &px, &py, &pz, &E)==4){ + particles.push_back(CSphmomentum(px, py, pz, E)); + N++; + } else { + cout << "error in reading event file Giving up." << endl; + fclose(flux); + return 2; + } + } + } + fclose(flux); + + // compute jets + // first compute with multiple passes (default) + i=siscone.compute_jets(particles, R, f); + cout << " " << i << " jets found in multi-pass run" << endl; + + // then, recompute it with a different f + i=siscone.recompute_jets(f_alt); + cout << " " << i << " jets found with alternative f" << endl; + + // one pass + i=siscone.compute_jets(particles, R, f, 1); + cout << " " << i << " jets found in single-pass run" << endl; + + // show jets + vector::iterator it_j; + int i1; + fprintf(stdout, "# theta phi px py pz E \n"); + for (it_j = siscone.jets.begin(), i1=0 ; + it_j != siscone.jets.end() ; it_j++, i1++){ + fprintf(stdout, "Jet %3d: %8.3f %8.3f %10.3f %10.3f %10.3f %10.3f\n", + i1, it_j->v._theta, it_j->v._phi, it_j->v.px, it_j->v.py, it_j->v.pz, it_j->v.E); + } + + return 0; +} Index: tags/siscone-3.0.5/examples/options.cpp =================================================================== --- tags/siscone-3.0.5/examples/options.cpp (revision 0) +++ tags/siscone-3.0.5/examples/options.cpp (revision 426) @@ -0,0 +1,242 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: options.cpp // +// Description: management of the cmdline options of the main program // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include "options.h" +#include +#include +#include + +using namespace std; +using namespace siscone; + +#define N_DEFAULT -1 +#define R_DEFAULT 0.7 +#define THRESHOLD_DEFAULT 0.5 +#define PTMIN_DEFAULT 0.0 +#define NPASS_DEFAULT 0 +#define DEFAULT_EVENT "events/single-event.dat" +#define SM_DEFAULT SM_pttilde + +/******************************************* + * Coptions implementation * + * options for the 'cone' sample * + *******************************************/ + +// default ctor +//-------------- +Coptions::Coptions(){ + // set default flags values + help_flag=0; + version_flag=0; + verbose_flag=1; + + // set default options values + N_stop = N_DEFAULT; + R = R_DEFAULT; + f = THRESHOLD_DEFAULT; + npass = NPASS_DEFAULT; + ev_name = NULL; + SM_var = SM_DEFAULT; +} + + +// default dtor +//-------------- +Coptions::~Coptions(){ + if (ev_name!=NULL) + delete[] ev_name; +} + + +// parse oprions +// - argc number of arguments from the command line +// - argv arguments from the command line +// return 1 on error, 0 on success +//--------------------------------- +int Coptions::parse_options(int argc, char **argv){ + int opt_param; + int option_index; + bool stop=false; + + // browse the command-line options{ + static struct option siscone_options[]={ + // options that set a flag + {"verbose", no_argument, &verbose_flag, 1}, + {"quiet", no_argument, &verbose_flag, 0}, + {"help", no_argument, &help_flag , 1}, + {"version", no_argument, &version_flag, 1}, + // options setting parameters + {"number", required_argument, NULL, 'N'}, + {"radius", required_argument, NULL, 'R'}, + {"fraction", required_argument, NULL, 'f'}, + {"ptmin", required_argument, NULL, 'p'}, + {"npass", required_argument, NULL, 'n'}, + {"event", required_argument, NULL, 'e'}, + {"sm", required_argument, NULL, 's'}, + {0,0,0,0} + }; + + + do{ + // getopt_long stores the option index here. + option_index=0; + + // retreive options + opt_param = getopt_long(argc, argv, "hvqN:R:f:p:n:e:s:", + siscone_options, &option_index); + + // Detect the end of the options. + if (opt_param == -1) + stop=true; + + // branch according to 'opt_param' + switch (opt_param){ + case 'h': help_flag = 1; break; // help + case 'v': verbose_flag = 1; break; // verbose + case 'q': verbose_flag = 0; break; // quiet + case 'N': // max number of paprticles + sscanf(optarg, "%d", &N_stop); + if (N_stop<=0){ + cout << "Warning: the specified number of particles must be positive. Using default one" << endl; + N_stop = N_DEFAULT; + } + break; + case 'R': + sscanf(optarg, "%lf", &R); + if (R<=0){ + cout << "Warning: the specified cone radius must be positive. Using default one" << endl; + R = R_DEFAULT; + } + break; + case 'f': + sscanf(optarg, "%lf", &f); + if ((f<0) || (f>1)){ + cout << "Warning: the specified split/merge threshold must be in [0,1]. Using default one" << endl; + f = THRESHOLD_DEFAULT; + } + break; + case 'p': + sscanf(optarg, "%lf", &ptmin); + if (ptmin<0){ + cout << "Warning: the specified minimal pT must be non-negative. Using default one" << endl; + ptmin = PTMIN_DEFAULT; + } + break; + case 'n': // max number of paprticles + sscanf(optarg, "%d", &npass); + if (npass<0){ + cout << "Warning: the specified number of passes must be non negative. Using default one" << endl; + npass = NPASS_DEFAULT; + } + break; + case 'e': + if (ev_name==NULL){ + ev_name = new char[strlen(optarg)+1]; + strcpy(ev_name, optarg); + } + break; + case 's': + char tmp[512]; + strcpy(tmp, optarg); + if (strcmp(tmp, "pttilde")==0){ + SM_var = SM_pttilde; + } else if (strcmp(tmp, "mt")==0){ + SM_var = SM_mt; + } else if (strcmp(tmp, "pt")==0){ + SM_var = SM_pt; + } else if (strcmp(tmp, "Et")==0){ + SM_var = SM_Et; + } else { + cout << "Warning: the specified varible for split--merge is not valid (should be pttilde, pt, mt or Et). Using pttilde as the default one." << endl; + SM_var = SM_pttilde; + } + break; + case 0: + case -1: + break; + case '?': + fprintf(stderr, "Giving up.\n"); + return 1; + break; + default: + if (!help_flag){ + fprintf(stderr, "unrecognized option %c. Giving up.\n", opt_param); + return 1; + } + } + } while (!stop); + + if (ev_name==NULL){ + ev_name = new char[strlen(DEFAULT_EVENT)+1]; + strcpy(ev_name, DEFAULT_EVENT); + } + + return 0; +} + + +// print the help message +//------------------------ +int Coptions::print_help(){ + cout << siscone_package_name() << " " << siscone_version() << endl; + cout << "Usage: " << siscone_package_name() << " " << endl; + cout << endl; + cout << "Here is an exhaustive list of the arguments:" << endl; + cout << "Parameters control (with default values):" << endl; + cout << " -n , --number= : set the maximum number of particles allowed (all)" << endl; + cout << " -R , --radius= : set the radius (" << R_DEFAULT << ")" << endl; + cout << " -f , --fraction=: set the overlap parameter (" << THRESHOLD_DEFAULT << ")" << endl; + cout << " -p , --ptmin= : set the minimal pT for protojets (" << PTMIN_DEFAULT << ")" << endl; + cout << " -n , --npass= : set the maximal number of passes (0 for no limit) (" << NPASS_DEFAULT << ")" << endl; + cout << " -e , --event= : set the event filename (" << DEFAULT_EVENT << ")" << endl; + cout << " -s , --sm= : variable for split--merge: pttilde, mt, pt or Et (pttilde)" << endl; + cout << endl; + cout << "Output flags" << endl; + cout << " --version : show version information" << endl; + cout << " -h, --help : show this message" << endl; + cout << " -v, --verbose: be verbose (on by default)" << endl; + cout << " -q, --quiet : be quiet" << endl; + cout << endl; + + return 0; +} + + +// print program version +//----------------------- +int Coptions::print_version(){ + cout << siscone_package_name() << " " << siscone_version() << endl; + cout << "Copyright (C) 2006." << endl; + cout << siscone_package_name() << " comes with NO WARRANTY," << endl; + cout << "to the extent permitted by law." << endl; + cout << "You may redistribute copies of " << siscone_package_name() << endl; + cout << "under the terms of the GNU General Public License." << endl; + cout << "For more information about these matters," << endl; + cout << "see the files named COPYING." << endl; + cout << "Please send bugs or comments to AUTHORS" << endl; + + return 0; +} Property changes on: tags/siscone-3.0.5/examples/options.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/examples/test.cpp =================================================================== --- tags/siscone-3.0.5/examples/test.cpp (revision 0) +++ tags/siscone-3.0.5/examples/test.cpp (revision 426) @@ -0,0 +1,119 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: test.cpp // +// Description: example program that implements tests with random particles // +// and output various informations // +// // +// Note: for a usage example of SISCone, we advise looking at main.cpp // +// or http://projects.hepforge.org/siscone/usage.html // +// // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + +#include "siscone/momentum.h" +#include "siscone/siscone.h" + +#define N_default 500 +#define R 0.7 +#define F 0.75 + +using namespace std; +using namespace siscone; + +int main(int argc, char* argv[]){ + vector particles; + Cmomentum *v; + double phi=0, eta=0, pt=1; + unsigned int N; + + unsigned int i; + FILE *flux; + + if (argc==1){ + //cout << "using default number of particles" << endl; + N = N_default; + } else { + sscanf(argv[1], "%u", &N); + //cout << "using " << N << " particles" << endl; + } + + // Initialise random number generator + timeval timestamp; + gettimeofday(×tamp, NULL); + srand(timestamp.tv_usec); + + // build particle list + cout << "build particle list" << endl; + flux = fopen("particles.dat", "w+"); + for (i=0;ieta, v->phi, v->perp()); + } + } + fclose(flux); + + cout << "bye..." << endl; + + return 0; +} Property changes on: tags/siscone-3.0.5/examples/test.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/examples/options.h =================================================================== --- tags/siscone-3.0.5/examples/options.h (revision 0) +++ tags/siscone-3.0.5/examples/options.h (revision 426) @@ -0,0 +1,74 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: options.h // +// Description: management of the cmdline options of the main program // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef __OPTIONS_H__ +#define __OPTIONS_H__ + +#include "siscone/siscone.h" + +/** + * \class Coptions + + * options for the 'cone' sample + */ +class Coptions{ + public: + /// default ctor + Coptions(); + + /// default dtor + ~Coptions(); + + /// parse oprions + /// \param argc number of arguments from the command line + /// \param argv arguments from the command line + /// \return 1 on error, 0 on success + int parse_options(int argc, char **argv); + + /// print the help message + int print_help(); + + /// print program version + int print_version(); + + // flags + int help_flag; ///< do we need to print the help message + int version_flag; ///< do we need to print the version description + int verbose_flag; ///< do we need to print the help message + + // options + int N_stop; ///< maximum number of particle + double R; ///< cone radius + double f; ///< split/merge threshold + double ptmin; ///< minimal pT for jet candidates + char *ev_name; ///< event to read + int npass; ///< number of passes (0 for \infty) + + /// variable for split-merge + siscone::Esplit_merge_scale SM_var; +}; + +#endif Property changes on: tags/siscone-3.0.5/examples/options.h ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/examples/sample.cpp =================================================================== --- tags/siscone-3.0.5/examples/sample.cpp (revision 0) +++ tags/siscone-3.0.5/examples/sample.cpp (revision 426) @@ -0,0 +1,95 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: sample.cpp // +// Description: example program for the Csiscone class (see documentation) // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include "siscone/momentum.h" +#include "siscone/siscone.h" + +#define R 0.7 +#define f 0.5 +#define f_alt 0.75 + +using namespace std; +using namespace siscone; + +int main(){ + vector particles; // list of particles + Csiscone siscone; // main object for the cone algorithm + int i; // loop index + int N; // number of particles + double px,py,pz,E; // particles 4-momentum + char fline[512]; // line to read from a file + + // read particles + FILE *flux; + flux = fopen("events/single-event.dat", "r"); + if (flux==NULL){ + cerr << "cannot read event" << endl; + return 1; + } + + N=0; + while (fgets(fline, 512, flux)!=NULL){ + if (fline[0]!='#'){ // skip lines beginning with '#' + if (sscanf(fline, "%le%le%le%le", &px, &py, &pz, &E)==4){ + particles.push_back(Cmomentum(px, py, pz, E)); + N++; + } else { + cout << "error in reading event file Giving up." << endl; + fclose(flux); + return 2; + } + } + } + fclose(flux); + + // compute jets + // first compute with multiple passes (default) + i=siscone.compute_jets(particles, R, f); + cout << " " << i << " jets found in multi-pass run" << endl; + + // then, recompute it with a different f + i=siscone.recompute_jets(f_alt); + cout << " " << i << " jets found with alternative f" << endl; + + // one pass + i=siscone.compute_jets(particles, R, f, 1); + cout << " " << i << " jets found in single-pass run" << endl; + + // show jets + vector::iterator it_j; + int i1; + fprintf(stdout, "# pT eta phi px py pz E \n"); + for (it_j = siscone.jets.begin(), i1=0 ; + it_j != siscone.jets.end() ; it_j++, i1++){ + fprintf(stdout, "Jet %3d: %10.3f %8.3f %8.3f %10.3f %10.3f %10.3f %10.3f\n", + i1, it_j->v.perp(), it_j->v.eta, it_j->v.phi, it_j->v.px, it_j->v.py, it_j->v.pz, it_j->v.E); + } + + return 0; +} Property changes on: tags/siscone-3.0.5/examples/sample.cpp ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +Date Rev \ No newline at end of property Index: tags/siscone-3.0.5/examples/times.cpp =================================================================== --- tags/siscone-3.0.5/examples/times.cpp (revision 0) +++ tags/siscone-3.0.5/examples/times.cpp (revision 426) @@ -0,0 +1,124 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: times.cpp // +// Description: example program that computes execution times // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + +#include "siscone/momentum.h" +#include "siscone/siscone.h" + +#define Nruns 32 +#define R 0.7 +#define f 0.5 + +using namespace std; +using namespace siscone; + +timeval time_start, time_end; + +// compute time spent between time_start and time_end +int time_spent(){ + timeval time_diff; + + // compute different with initial time + time_diff.tv_sec = time_end.tv_sec-time_start.tv_sec; + if (time_end.tv_usec > time_start.tv_usec){ + time_diff.tv_usec = time_end.tv_usec-time_start.tv_usec; + } else { + time_diff.tv_sec--; + time_diff.tv_usec = (1000000+time_end.tv_usec)-time_start.tv_usec; + } + + return 1000000*time_diff.tv_sec+time_diff.tv_usec; +} + + + +int main(){ + vector particles; + Csiscone siscone; + double eta,phi; + + // number of events and particles + int i, N; + int n_ev, part_inc; + + // time statistics variables + int time_siscone; + + // save files + FILE *flux; + + // initialise random number generator + cout << "initialise random number generator" << endl; + timeval timestamp; + + gettimeofday(×tamp, NULL); + srand(timestamp.tv_usec); + + flux = fopen("times.dat", "w+"); + + N = 1; + part_inc = 1; + do{ + fprintf(stdout, "\r%5d particles\n", N); + time_siscone=0; + + for (n_ev=0;n_ev} + .x. = {rpn x .ic. @} + .y. = {rpn y .ic. @} + draw symbol 1 at .x. .y. + .ic. += 1 +end while + +# draw jet contents +set symbol size 0.2 +while {rpn .ic. ..num_col_data.. >} + .x. = {rpn x .ic. @} + .y. = {rpn y .ic. @} + .z. = {rpn z .ic. @} + if {rpn .z. 0 ==} + set color red + else if {rpn .z. 1 ==} + set color green + else if {rpn .z. 2 ==} + set color blue + else if {rpn .z. 3 ==} + set color cyan + else if {rpn .z. 4 ==} + set color magenta + else if {rpn .z. 5 ==} + set color yellow + else if {rpn .z. 6 ==} + set color black + else if {rpn .z. 7 ==} + set color orange + else if {rpn .z. 8 ==} + set color brown + else if {rpn .z. 9 ==} + set color LightGray + else if {rpn .z. 10 ==} + set color ForestGreen + else + set color skyblue + end if + .z. = {rpn .z. 11 +} + draw symbol .z. at .x. .y. + .ic. += 1 +end while Index: tags/siscone-3.0.5/examples/main.cpp =================================================================== --- tags/siscone-3.0.5/examples/main.cpp (revision 0) +++ tags/siscone-3.0.5/examples/main.cpp (revision 426) @@ -0,0 +1,117 @@ +/////////////////////////////////////////////////////////////////////////////// +// File: main.cpp // +// Description: main program that runs siscone from the command line // +// This file is part of the SISCone project. // +// For more details, see http://projects.hepforge.org/siscone // +// // +// Copyright (c) 2006 Gavin Salam and Gregory Soyez // +// // +// This program is free software; you can redistribute it and/or modify // +// it under the terms of the GNU General Public License as published by // +// the Free Software Foundation; either version 2 of the License, or // +// (at your option) any later version. // +// // +// This program is distributed in the hope that it will be useful, // +// but WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // +// GNU General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program; if not, write to the Free Software // +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // +// // +// $Revision:: $// +// $Date:: $// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include "siscone/momentum.h" +#include "siscone/siscone.h" +#include "options.h" + +using namespace std; +using namespace siscone; + +int main(int argc, char *argv[]){ + vector particles; + Csiscone siscone; + int i,N; + double px,py,pz,E; + Coptions opts; + char fline[512]; + + if (opts.parse_options(argc, argv)) + exit(1); + + // deal with help message + if (opts.help_flag){ + opts.print_help(); + exit(0); + } + + // deal with version flag + if (opts.version_flag){ + opts.print_version(); + exit(0); + } + + // various files used to read input data and store results + FILE *flux; + FILE *fpart; + + // read particles + if (opts.verbose_flag) cout << "reading particles" << endl; + flux = fopen(opts.ev_name, "r"); + if (flux==NULL){ + cerr << "cannot read event '" << opts.ev_name << "'" << endl; + cerr << "specify the event to read using the -e option" << endl; + return 1; + } + + N=0; + fpart = fopen("particles.dat", "w+"); + while ((opts.N_stop!=0) && (fgets(fline, 512, flux)!=NULL)){ + if (fline[0]!='#'){ // skip lines beginning with '#' + if (sscanf(fline, "%le%le%le%le", &px, &py, &pz, &E)==4){ + particles.push_back(Cmomentum(px, py, pz, E)); + fprintf(fpart, "%e\t%e\n", particles[N].eta, particles[N].phi); + N++; + opts.N_stop--; + } else { + cout << "error in reading event file Giving up." << endl; + fclose(flux); + fclose(fpart); + exit(2); + } + } + } + fclose(flux); + fclose(fpart); + if (opts.verbose_flag) + cout << " working with " << N << " particles" << endl; + + // compute jets + if (opts.verbose_flag) cout << "computing jet contents" << endl; + i=siscone.compute_jets(particles, opts.R, opts.f, opts.npass, opts.ptmin, opts.SM_var); + if (opts.verbose_flag){ + unsigned int pass; + for (pass=0;pass +#include +#include +#include "siscone/momentum.h" +#include "siscone/siscone.h" +#include "siscone/area.h" +#include "options.h" + +using namespace std; +using namespace siscone; + +int main(int argc, char *argv[]){ + vector particles; + Carea siscone_with_area; + int i,N; + double px,py,pz,E; + Coptions opts; + char fline[512]; + + if (opts.parse_options(argc, argv)) + exit(1); + + // deal with help message + if (opts.help_flag){ + opts.print_help(); + exit(0); + } + + // deal with version flag + if (opts.version_flag){ + opts.print_version(); + exit(0); + } + + // various files used to read input data and store results + FILE *flux; + FILE *fpart; + + // read particles + if (opts.verbose_flag) cout << "reading particles" << endl; + flux = fopen(opts.ev_name, "r"); + if (flux==NULL){ + cerr << "cannot read event" << endl; + return 1; + } + + N=0; + fpart = fopen("particles.dat", "w+"); + while ((opts.N_stop!=0) && (fgets(fline, 512, flux)!=NULL)){ + if (fline[0]!='#'){ // skip lines beginning with '#' + if (sscanf(fline, "%le%le%le%le", &px, &py, &pz, &E)==4){ + particles.push_back(Cmomentum(px, py, pz, E)); + fprintf(fpart, "%e\t%e\n", particles[N].eta, particles[N].phi); + N++; + opts.N_stop--; + } else { + cout << "error in reading event file Giving up." << endl; + fclose(flux); + fclose(fpart); + exit(2); + } + } + } + fclose(flux); + fclose(fpart); + if (opts.verbose_flag) + cout << " working with " << N << " particles" << endl; + + // compute jets + if (opts.verbose_flag) cout << "computing jet contents" << endl; + i=siscone_with_area.compute_areas(particles, opts.R, opts.f, opts.npass, opts.SM_var); + if (opts.verbose_flag){ + unsigned int pass; + for (pass=0;pass::iterator ja; + for (ja=siscone_with_area.jet_areas.begin();ja!=siscone_with_area.jet_areas.end();ja++){ + fprintf(flux, "%e\t%e\t%e\t%e\t%e\n", + ja->v.perp(), ja->v.eta, ja->v.phi, + ja->active_area, ja->passive_area); + } + + fclose(flux); + + if (opts.verbose_flag) + cout << "bye..." << endl; + + return 0; +} Index: tags/siscone-3.0.5/examples =================================================================== --- tags/siscone-3.0.5/examples (revision 425) +++ tags/siscone-3.0.5/examples (revision 426) Property changes on: tags/siscone-3.0.5/examples ___________________________________________________________________ Added: svn:ignore ## -0,0 +1,17 ## +*.dat +test +sample +times +siscone + +Makefile.in + +Makefile + +.deps + +siscone_area + +spherical + +.libs Index: tags/siscone-3.0.5/m4/ax_prefix_config_h.m4 =================================================================== --- tags/siscone-3.0.5/m4/ax_prefix_config_h.m4 (revision 0) +++ tags/siscone-3.0.5/m4/ax_prefix_config_h.m4 (revision 426) @@ -0,0 +1,215 @@ +# =========================================================================== +# http://autoconf-archive.cryp.to/ax_prefix_config_h.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])] +# +# DESCRIPTION +# +# This is a new variant from ac_prefix_config_ this one will use a +# lowercase-prefix if the config-define was starting with a +# lowercase-char, e.g. "#define const", "#define restrict", or "#define +# off_t", (and this one can live in another directory, e.g. +# testpkg/config.h therefore I decided to move the output-header to be the +# first arg) +# +# takes the usual config.h generated header file; looks for each of the +# generated "#define SOMEDEF" lines, and prefixes the defined name (ie. +# makes it "#define PREFIX_SOMEDEF". The result is written to the output +# config.header file. The PREFIX is converted to uppercase for the +# conversions. +# +# Defaults: +# +# OUTPUT-HEADER = $PACKAGE-config.h +# PREFIX = $PACKAGE +# ORIG-HEADER, from AM_CONFIG_HEADER(config.h) +# +# Your configure.ac script should contain both macros in this order, and +# unlike the earlier variations of this prefix-macro it is okay to place +# the AX_PREFIX_CONFIG_H call before the AC_OUTPUT invokation. +# +# Example: +# +# AC_INIT(config.h.in) # config.h.in as created by "autoheader" +# AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE +# AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in +# AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it.. +# AC_MEMORY_H # makes "#undef NEED_MEMORY_H" +# AC_C_CONST_H # makes "#undef const" +# AC_OUTPUT(Makefile) # creates the "config.h" now +# # and also mylib/_config.h +# +# if the argument to AX_PREFIX_CONFIG_H would have been omitted then the +# default outputfile would have been called simply "testpkg-config.h", but +# even under the name "mylib/_config.h" it contains prefix-defines like +# +# #ifndef TESTPKG_VERSION +# #define TESTPKG_VERSION "0.1.1" +# #endif +# #ifndef TESTPKG_NEED_MEMORY_H +# #define TESTPKG_NEED_MEMORY_H 1 +# #endif +# #ifndef _testpkg_const +# #define _testpkg_const _const +# #endif +# +# and this "mylib/_config.h" can be installed along with other +# header-files, which is most convenient when creating a shared library +# (that has some headers) where some functionality is dependent on the +# OS-features detected at compile-time. No need to invent some +# "mylib-confdefs.h.in" manually. :-) +# +# Note that some AC_DEFINEs that end up in the config.h file are actually +# self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T +# say that they "will define inline|const|off_t if the system does not do +# it by itself". You might want to clean up about these - consider an +# extra mylib/conf.h that reads something like: +# +# #include +# #ifndef _testpkg_const +# #define _testpkg_const const +# #endif +# +# and then start using _testpkg_const in the header files. That is also a +# good thing to differentiate whether some library-user has starting to +# take up with a different compiler, so perhaps it could read something +# like this: +# +# #ifdef _MSC_VER +# #include +# #else +# #include +# #endif +# #ifndef _testpkg_const +# #define _testpkg_const const +# #endif +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2008 Marten Svantesson +# Copyright (c) 2008 Gerald Point +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl +AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl +AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl +AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl +AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl +AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl +AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl +AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl +AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl +m4_pushdef([_script],[conftest.prefix])dnl +m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl +_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)` +_DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"` +_PKG=`echo ifelse($2, , $PACKAGE, $2)` +_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"` +_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"` +_INP=`echo "ifelse($3,,,$3)" | sed -e 's/ *//'` +if test ".$_INP" = "."; then + for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue + case "$ac_file" in + *.h) _INP=$ac_file ;; + *) + esac + test ".$_INP" != "." && break + done +fi +if test ".$_INP" = "."; then + case "$_OUT" in + */*) _INP=`basename "$_OUT"` + ;; + *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"` + ;; + *) _INP=config.h + ;; + esac +fi +if test -z "$_PKG" ; then + AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H]) +else + if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then + _INP="$srcdir/$_INP" + fi fi + AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines) + if test -f $_INP ; then + echo "s/^@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/" > _script + echo "s/^@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/" >> _script + echo "s/^@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1 \\" >> _script + echo "@%:@def[]ine $_UPP""_\\1 \\2 \\" >> _script + echo "@%:@endif/" >>_script + echo "s/^@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1 \\" >> _script + echo "@%:@define $_LOW""_\\1 \\2 \\" >> _script + echo "@%:@endif/" >> _script + # now executing _script on _DEF input to create _OUT output file + echo "@%:@ifndef $_DEF" >$tmp/pconfig.h + echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h + echo ' ' >>$tmp/pconfig.h + echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h + + sed -f _script $_INP >>$tmp/pconfig.h + echo ' ' >>$tmp/pconfig.h + echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h + echo "@%:@endif" >>$tmp/pconfig.h + if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then + AC_MSG_NOTICE([$_OUT is unchanged]) + else + ac_dir=`AS_DIRNAME(["$_OUT"])` + AS_MKDIR_P(["$ac_dir"]) + rm -f "$_OUT" + mv $tmp/pconfig.h "$_OUT" + fi + cp _script _configs.sed + else + AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT]) + fi + rm -f conftest.* +fi +m4_popdef([_symbol])dnl +m4_popdef([_script])dnl +AS_VAR_POPDEF([_INP])dnl +AS_VAR_POPDEF([_UPP])dnl +AS_VAR_POPDEF([_LOW])dnl +AS_VAR_POPDEF([_PKG])dnl +AS_VAR_POPDEF([_DEF])dnl +AS_VAR_POPDEF([_OUT])dnl +],[PACKAGE="$PACKAGE"])]) + +dnl implementation note: a bug report (31.5.2005) from Marten Svantesson points +dnl out a problem where `echo "\1"` results in a Control-A. The unix standard +dnl http://www.opengroup.org/onlinepubs/000095399/utilities/echo.html +dnl defines all backslash-sequences to be inherently non-portable asking +dnl for replacement mit printf. Some old systems had problems with that +dnl one either. However, the latest libtool (!) release does export an $ECHO +dnl (and $echo) that does the right thing - just one question is left: what +dnl was the first version to have it? Is it greater 2.58 ? Index: tags/siscone-3.0.5/Doxyfile =================================================================== --- tags/siscone-3.0.5/Doxyfile (revision 0) +++ tags/siscone-3.0.5/Doxyfile (revision 426) @@ -0,0 +1,2355 @@ +# Doxyfile 1.8.8 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = SISCone + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = 3.0.5 + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc/devel + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = doc \ + src/old \ + tests \ + timings + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = doc/devel/html/footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra stylesheet files is of importance (e.g. the last +# stylesheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /