Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:09:43

0001 // -*- C++ -*-
0002 ///////////////////////////////////////////////////////////////////////////////
0003 // File: siscone.h                                                           //
0004 // Description: header file for the main SISCone class                       //
0005 // This file is part of the SISCone project.                                 //
0006 // For more details, see http://projects.hepforge.org/siscone                //
0007 //                                                                           //
0008 // Copyright (c) 2006 Gavin Salam and Gregory Soyez                          //
0009 //                                                                           //
0010 // This program is free software; you can redistribute it and/or modify      //
0011 // it under the terms of the GNU General Public License as published by      //
0012 // the Free Software Foundation; either version 2 of the License, or         //
0013 // (at your option) any later version.                                       //
0014 //                                                                           //
0015 // This program is distributed in the hope that it will be useful,           //
0016 // but WITHOUT ANY WARRANTY; without even the implied warranty of            //
0017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             //
0018 // GNU General Public License for more details.                              //
0019 //                                                                           //
0020 // You should have received a copy of the GNU General Public License         //
0021 // along with this program; if not, write to the Free Software               //
0022 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
0023 //                                                                           //
0024 // $Revision::                                                              $//
0025 // $Date::                                                                  $//
0026 ///////////////////////////////////////////////////////////////////////////////
0027 
0028 #ifndef __SISCONE_H__
0029 #define __SISCONE_H__
0030 
0031 #include "protocones.h"
0032 #include "split_merge.h"
0033 
0034 namespace siscone{
0035 
0036 /**
0037  * \class Csiscone
0038  * final class: gather everything to compute the jet contents.
0039  * 
0040  * This is the class user should use.
0041  * It computes the jet contents of a list of particles
0042  * given a cone radius and a threshold for splitting/merging.
0043  *
0044  * After the call to 'perform', the vector jets is filled with
0045  * the jets found. the 'contents' field of each jets contains
0046  * the indices of the particles included in that jet. 
0047  */
0048 class Csiscone : public Cstable_cones, public Csplit_merge{
0049  public:
0050   /// default ctor
0051   Csiscone();
0052 
0053   /// default dtor
0054   ~Csiscone();
0055 
0056   /**
0057    * compute the jets from a given particle set.
0058    * We are doing multiple passes such pass n_pass looks for jets among 
0059    * all particles not put into jets during previous passes.
0060    * By default the number of passes is infinite (0). 
0061    * \param _particles   list of particles
0062    * \param _radius      cone radius
0063    * \param _f           shared energy threshold for splitting&merging
0064    * \param _n_pass_max  maximum number of passes (0=full search)
0065    * \param _ptmin       minimum pT of the protojets
0066    * \param _split_merge_scale    the scale choice for the split-merge procedure
0067    *        NOTE: SM_pt leads to IR unsafety for some events with momentum conservation. 
0068    *              SM_Et is IR safe but not boost invariant and not implemented(!)
0069    *              SM_mt is IR safe for hadronic events, but not for decays of two 
0070    *                    back-to-back particles of identical mass
0071    *              SM_pttilde  
0072    *                    is always IR safe, and also boost invariant (default)
0073    *
0074    * \return the number of jets found.
0075    */
0076   int compute_jets(std::vector<Cmomentum> &_particles, double _radius, double _f, 
0077            int _n_pass_max=0, double _ptmin=0.0,
0078            Esplit_merge_scale _split_merge_scale=SM_pttilde);
0079 
0080   /**
0081    * compute the jets from a given particle set.
0082    * We are doing multiple passes such pass n_pass looks for jets among 
0083    * all particles not put into jets during previous passes.
0084    * By default the number of passes is infinite (0). 
0085    * \param _particles   list of particles
0086    * \param _radius      cone radius
0087    * \param _n_pass_max  maximum number of passes (0=full search)
0088    * \param _ptmin       minimum pT of the protojets
0089    * \param _ordering_scale    the ordering scale to decide which stable
0090    *                           cone is removed
0091    *
0092    * Note that the Csplit_merge::SM_var2_hardest_cut_off cut is not
0093    * used in the progressive removal variant.
0094    * 
0095    * \return the number of jets found.
0096    */
0097   int compute_jets_progressive_removal(std::vector<Cmomentum> &_particles, double _radius, 
0098                        int _n_pass_max=0, double _ptmin=0.0,
0099                        Esplit_merge_scale _ordering_scale=SM_pttilde);
0100 
0101   /**
0102    * recompute the jets with a different overlap parameter.
0103    * we use the same particles and R as in the preceeding call.
0104    * \param _f           shared energy threshold for splitting&merging
0105    * \param _ptmin       minimum pT of the protojets
0106    * \param _split_merge_scale    the scale choice for the split-merge procedure
0107    *                                           split--merge variable
0108    *        NOTE: using pt leads to IR unsafety for some events with momentum
0109    *              conservation. So we strongly advise not to change the default
0110    *              value.
0111    * \return the number of jets found, -1 if recomputation not allowed.
0112    */
0113   int recompute_jets(double _f, double _ptmin = 0.0,
0114              Esplit_merge_scale _split_merge_scale=SM_pttilde);
0115 
0116   /// list of protocones found pass-by-pass (not filled by compute_jets_progressive_removal)
0117   std::vector<std::vector<Cmomentum> > protocones_list;
0118 
0119   // random number initialisation
0120   static bool init_done;      ///< check random generator initialisation
0121 
0122 #ifdef DEBUG_STABLE_CONES
0123   int nb_hash_cones_total, nb_hash_occupied_total;
0124 #endif
0125 
0126   /**
0127    * A call to this function modifies the stream
0128    * used to print banners (by default cout).
0129    *
0130    * Please note that if you distribute 3rd party code
0131    * that links with SISCone, that 3rd party code must not
0132    * use this call turn off the printing of thw banner
0133    * by default. This requirement reflects the spirit of
0134    * clause 2c of the GNU Public License (v2), under which
0135    * SISCone is distributed.
0136    */
0137   static void set_banner_stream(std::ostream * ostr) {_banner_ostr = ostr;}
0138 
0139   /**
0140    * returns a pointer to the stream to be used to print banners
0141    * (cout by default)
0142    */
0143   static std::ostream * banner_stream() {return _banner_ostr;}
0144 
0145  private:
0146   bool rerun_allowed;         ///< is recompute_jets allowed ?
0147   static std::ostream * _banner_ostr; ///< stream to use for banners
0148 
0149   /// ensure things are initialised
0150   void _initialise_if_needed();
0151 
0152 };
0153 
0154   
0155 // finally, a bunch of functions to access to 
0156 // basic information (package name, version)
0157 //---------------------------------------------
0158 
0159 /** 
0160  * return SISCone package name.
0161  * This is nothing but "SISCone", it is a replacement to the
0162  * SISCONE_PACKAGE_NAME string defined in config.h and which is not
0163  * guaranteed to be public.
0164  * \return the SISCone name as a string
0165  */
0166 std::string siscone_package_name();
0167 
0168 /** 
0169  * return SISCone version number.
0170  * \return a string of the form "X.Y.Z" with possible additional tag
0171  *         (alpha, beta, devel) to mention stability status
0172  */
0173 std::string siscone_version();
0174 
0175 }
0176 #endif