00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
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
00044
00045
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
00056
00057
00058
00059
00060
00061
00062 class GhostedAreaSpec {
00063 public:
00064
00065 GhostedAreaSpec(): _ghost_maxrap (gas::def_ghost_maxrap),
00066 _ghost_rap_offset(0.0),
00067 _repeat (gas::def_repeat),
00068 _ghost_area (gas::def_ghost_area),
00069 _grid_scatter (gas::def_grid_scatter),
00070 _kt_scatter (gas::def_kt_scatter),
00071 _mean_ghost_kt(gas::def_mean_ghost_kt),
00072 _actual_ghost_area(-1.0) {_initialize();};
00073
00074
00075 explicit GhostedAreaSpec(double ghost_maxrap,
00076 int repeat = gas::def_repeat,
00077 double ghost_area = gas::def_ghost_area,
00078 double grid_scatter = gas::def_grid_scatter,
00079 double kt_scatter = gas::def_kt_scatter,
00080 double mean_ghost_kt = gas::def_mean_ghost_kt
00081 ):
00082 _ghost_maxrap(ghost_maxrap),
00083 _ghost_rap_offset(0.0),
00084 _repeat(repeat),
00085 _ghost_area(ghost_area),
00086 _grid_scatter(grid_scatter),
00087 _kt_scatter(kt_scatter),
00088 _mean_ghost_kt(mean_ghost_kt),
00089 _actual_ghost_area(-1.0) {_initialize();};
00090
00091
00092 explicit GhostedAreaSpec(double ghost_minrap,
00093 double ghost_maxrap,
00094 int repeat = gas::def_repeat,
00095 double ghost_area = gas::def_ghost_area,
00096 double grid_scatter = gas::def_grid_scatter,
00097 double kt_scatter = gas::def_kt_scatter,
00098 double mean_ghost_kt = gas::def_mean_ghost_kt
00099 ):
00100 _ghost_maxrap (0.5*(ghost_maxrap - ghost_minrap)),
00101 _ghost_rap_offset(0.5*(ghost_maxrap + ghost_minrap)),
00102 _repeat(repeat),
00103 _ghost_area(ghost_area),
00104 _grid_scatter(grid_scatter),
00105 _kt_scatter(kt_scatter),
00106 _mean_ghost_kt(mean_ghost_kt),
00107 _actual_ghost_area(-1.0) {_initialize();};
00108
00109
00110
00111 void _initialize();
00112
00113
00114 inline double ghost_etamax() const {return _ghost_maxrap;};
00115 inline double ghost_maxrap() const {return _ghost_maxrap;};
00116 inline double ghost_area () const {return _ghost_area ;};
00117 inline double grid_scatter() const {return _grid_scatter;};
00118 inline double kt_scatter () const {return _kt_scatter ;};
00119 inline double mean_ghost_kt() const {return _mean_ghost_kt ;};
00120 inline int repeat () const {return _repeat ;};
00121
00122
00123 inline double actual_ghost_area() const {return _actual_ghost_area;};
00124 inline int n_ghosts() const {return _n_ghosts;};
00125
00126
00127 inline void set_ghost_area (double val) {_ghost_area = val; _initialize();};
00128 inline void set_ghost_etamax(double val) {_ghost_maxrap = val; _initialize();};
00129 inline void set_ghost_maxrap(double val) {_ghost_maxrap = val; _initialize();};
00130 inline void set_grid_scatter(double val) {_grid_scatter = val; };
00131 inline void set_kt_scatter (double val) {_kt_scatter = val; };
00132 inline void set_mean_ghost_kt(double val){_mean_ghost_kt = val; };
00133 inline void set_repeat (int val) {_repeat = val; };
00134
00135
00136
00137 inline int nphi() const {return _nphi;}
00138 inline int nrap() const {return _nrap;}
00139
00140
00141
00142
00143 inline void get_random_status(std::vector<int> & __iseed) const {
00144 _random_generator.get_status(__iseed);}
00145
00146
00147
00148
00149
00150
00151 inline void set_random_status(const std::vector<int> & __iseed) {
00152 _random_generator.set_status(__iseed);}
00153
00154 inline void checkpoint_random() {get_random_status(_random_checkpoint);}
00155 inline void restore_checkpoint_random() {set_random_status(_random_checkpoint);}
00156
00157
00158 std::string description() const;
00159
00160
00161
00162 void add_ghosts(std::vector<PseudoJet> & ) const;
00163
00164
00165
00166 inline double random_at_own_risk() const {return _our_rand();};
00167
00168 inline BasicRandom<double> & generator_at_own_risk() const {
00169 return _random_generator;}
00170
00171 private:
00172
00173
00174 double _ghost_maxrap;
00175 double _ghost_rap_offset;
00176 int _repeat ;
00177 double _ghost_area ;
00178 double _grid_scatter;
00179 double _kt_scatter ;
00180 double _mean_ghost_kt;
00181
00182
00183 double _actual_ghost_area, _dphi, _drap;
00184 int _n_ghosts, _nphi, _nrap;
00185
00186
00187 std::vector<int> _random_checkpoint;
00188 static BasicRandom<double> _random_generator;
00189
00190
00191 inline double _our_rand() const {return _random_generator();};
00192
00193 };
00194
00195
00196
00197
00198
00199
00200 FASTJET_END_NAMESPACE
00201
00202 #endif // __FASTJET_GHOSTEDAREASPEC_HH__