// -*- 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:: 859 $// // $Date:: 2012-11-28 02:49:23 +0100 (Wed, 28 Nov 2012) $// /////////////////////////////////////////////////////////////////////////////// #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