fastjet 2.4.5
GhostedAreaSpec.hh
Go to the documentation of this file.
00001 //STARTHEADER
00002 // $Id: GhostedAreaSpec.hh 1273 2008-08-11 18:22:55Z salam $
00003 //
00004 // Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam
00005 //
00006 //----------------------------------------------------------------------
00007 // This file is part of FastJet.
00008 //
00009 //  FastJet is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU General Public License as published by
00011 //  the Free Software Foundation; either version 2 of the License, or
00012 //  (at your option) any later version.
00013 //
00014 //  The algorithms that underlie FastJet have required considerable
00015 //  development and are described in hep-ph/0512210. If you use
00016 //  FastJet as part of work towards a scientific publication, please
00017 //  include a citation to the FastJet paper.
00018 //
00019 //  FastJet is distributed in the hope that it will be useful,
00020 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 //  GNU General Public License for more details.
00023 //
00024 //  You should have received a copy of the GNU General Public License
00025 //  along with FastJet; if not, write to the Free Software
00026 //  Foundation, Inc.:
00027 //      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //----------------------------------------------------------------------
00029 //ENDHEADER
00030 
00031 
00032 #ifndef __FASTJET_GHOSTEDAREASPEC_HH__
00033 #define __FASTJET_GHOSTEDAREASPEC_HH__
00034 
00035 #include<vector>
00036 #include<string>
00037 #include "fastjet/PseudoJet.hh"
00038 #include "fastjet/internal/BasicRandom.hh"
00039 
00040 // 
00041 #define STATIC_GENERATOR 1
00042 
00043 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
00044 
00046 namespace gas {
00047   const double def_ghost_maxrap  = 6.0;
00048   const int    def_repeat        = 1;
00049   const double def_ghost_area    = 0.01;
00050   const double def_grid_scatter  = 1.0;
00051   const double def_kt_scatter    = 0.1;
00052   const double def_mean_ghost_kt = 1e-100;
00053 }
00054 
00055 //----------------------------------------------------------------------
00058 class GhostedAreaSpec {
00059 public:
00061   GhostedAreaSpec(): _ghost_maxrap (gas::def_ghost_maxrap), 
00062                      _ghost_rap_offset(0.0),
00063                     _repeat       (gas::def_repeat), 
00064                     _ghost_area   (gas::def_ghost_area), 
00065                     _grid_scatter (gas::def_grid_scatter), 
00066                     _kt_scatter   (gas::def_kt_scatter), 
00067                     _mean_ghost_kt(gas::def_mean_ghost_kt),
00068                     _actual_ghost_area(-1.0) {_initialize();};
00069   
00071   explicit GhostedAreaSpec(double ghost_maxrap, 
00072                           int    repeat        = gas::def_repeat,
00073                           double ghost_area    = gas::def_ghost_area,   
00074                           double grid_scatter  = gas::def_grid_scatter, 
00075                           double kt_scatter    = gas::def_kt_scatter,   
00076                           double mean_ghost_kt = gas::def_mean_ghost_kt
00077                           ): 
00078     _ghost_maxrap(ghost_maxrap), 
00079     _ghost_rap_offset(0.0),
00080     _repeat(repeat), 
00081     _ghost_area(ghost_area), 
00082     _grid_scatter(grid_scatter),  
00083     _kt_scatter(kt_scatter), 
00084     _mean_ghost_kt(mean_ghost_kt),
00085     _actual_ghost_area(-1.0) {_initialize();};
00086 
00088   explicit GhostedAreaSpec(double ghost_minrap, 
00089                            double ghost_maxrap, 
00090                            int    repeat        = gas::def_repeat,
00091                            double ghost_area    = gas::def_ghost_area,   
00092                            double grid_scatter  = gas::def_grid_scatter, 
00093                            double kt_scatter    = gas::def_kt_scatter,   
00094                            double mean_ghost_kt = gas::def_mean_ghost_kt
00095                           ): 
00096     _ghost_maxrap    (0.5*(ghost_maxrap - ghost_minrap)), 
00097     _ghost_rap_offset(0.5*(ghost_maxrap + ghost_minrap)),
00098     _repeat(repeat), 
00099     _ghost_area(ghost_area), 
00100     _grid_scatter(grid_scatter),  
00101     _kt_scatter(kt_scatter), 
00102     _mean_ghost_kt(mean_ghost_kt),
00103     _actual_ghost_area(-1.0) {_initialize();};
00104 
00105 
00107   void _initialize();
00108 
00109   // for accessing values set by the user
00110   inline double ghost_etamax() const {return _ghost_maxrap;};
00111   inline double ghost_maxrap() const {return _ghost_maxrap;};
00112   inline double ghost_area   () const {return _ghost_area   ;};
00113   inline double grid_scatter() const {return _grid_scatter;};
00114   inline double kt_scatter  () const {return _kt_scatter  ;};
00115   inline double mean_ghost_kt() const {return _mean_ghost_kt  ;};
00116   inline int    repeat      () const {return _repeat      ;};
00117 
00118   // for accessing values 
00119   inline double actual_ghost_area() const {return _actual_ghost_area;};
00120   inline int    n_ghosts()          const {return _n_ghosts;};
00121 
00122   // when explicitly modifying values, sometimes call the initializer
00123   inline void set_ghost_area   (double val) {_ghost_area    = val; _initialize();};
00124   inline void set_ghost_etamax(double val) {_ghost_maxrap = val; _initialize();};
00125   inline void set_ghost_maxrap(double val) {_ghost_maxrap = val; _initialize();};
00126   inline void set_grid_scatter(double val) {_grid_scatter   = val; };
00127   inline void set_kt_scatter  (double val) {_kt_scatter     = val; };
00128   inline void set_mean_ghost_kt(double val){_mean_ghost_kt  = val; };
00129   inline void set_repeat      (int    val) {_repeat         = val; };
00130 
00133   inline int nphi() const {return _nphi;}
00134   inline int nrap() const {return _nrap;}
00135 
00139   inline void get_random_status(std::vector<int> & __iseed) const {
00140     _random_generator.get_status(__iseed);}
00141 
00147   inline void set_random_status(const std::vector<int> & __iseed) {
00148     _random_generator.set_status(__iseed);}
00149   
00150   inline void checkpoint_random() {get_random_status(_random_checkpoint);}
00151   inline void restore_checkpoint_random() {set_random_status(_random_checkpoint);}
00152 
00154   std::string description() const;
00155 
00157   void add_ghosts(std::vector<PseudoJet> & ) const;
00158 
00161   inline double random_at_own_risk() const {return _our_rand();};
00163   inline BasicRandom<double> & generator_at_own_risk() const {
00164     return _random_generator;}
00165 
00166 private:
00167   
00168   // quantities that determine nature and distribution of ghosts
00169   double _ghost_maxrap;
00170   double _ghost_rap_offset;
00171   int    _repeat      ;
00172   double _ghost_area   ;  
00173   double _grid_scatter;
00174   double _kt_scatter  ;
00175   double _mean_ghost_kt;
00176 
00177   // derived quantities
00178   double _actual_ghost_area, _dphi, _drap;
00179   int    _n_ghosts, _nphi, _nrap;
00180 
00181 
00182   std::vector<int> _random_checkpoint;
00183   static BasicRandom<double> _random_generator;
00184   //mutable BasicRandom<double> _random_generator;
00185 
00186   inline double _our_rand() const {return _random_generator();};
00187   
00188 };
00189 
00191 //class 1GhostPassiveAreaSpec : public GhostedAreaSpec {
00192 //public:
00193 //}
00194 
00195 FASTJET_END_NAMESPACE
00196 
00197 #endif // __FASTJET_GHOSTEDAREASPEC_HH__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines