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 #include "fastjet/GhostedAreaSpec.hh"
00032 #include<iostream>
00033 #include<sstream>
00034
00035 using namespace std;
00036
00037 FASTJET_BEGIN_NAMESPACE
00038
00039 BasicRandom<double> GhostedAreaSpec::_random_generator;
00040
00041
00042
00043
00044
00045 void GhostedAreaSpec::_initialize() {
00046
00047 _drap = sqrt(_ghost_area);
00048 _dphi = _drap;
00049 _nphi = int(ceil(twopi/_dphi)); _dphi = twopi/_nphi;
00050 _nrap = int(ceil(_ghost_maxrap/_drap)); _drap = _ghost_maxrap / _nrap;
00051 _actual_ghost_area = _dphi * _drap;
00052 _n_ghosts = (2*_nrap+1)*_nphi;
00053
00054
00055 checkpoint_random();
00056
00057 }
00058
00059
00060
00061 void GhostedAreaSpec::add_ghosts(vector<PseudoJet> & event) const {
00062
00063 for (int irap = -_nrap; irap <= _nrap; irap++) {
00064 for (int iphi = 0; iphi < _nphi; iphi++) {
00065
00066
00067 double phi = (iphi+0.5) * _dphi + _dphi*(_our_rand()-0.5)*_grid_scatter;
00068 double rap = irap * _drap + _drap*(_our_rand()-0.5)*_grid_scatter
00069 + _ghost_rap_offset ;
00070 double kt = _mean_ghost_kt*(1+(_our_rand()-0.5)*_kt_scatter);
00071
00072 double pminus = kt*exp(-rap);
00073 double pplus = kt*exp(+rap);
00074 double px = kt*sin(phi);
00075 double py = kt*cos(phi);
00076
00077
00078 PseudoJet mom(px,py,0.5*(pplus-pminus),0.5*(pplus+pminus));
00079 event.push_back(mom);
00080 }
00081 }
00082 }
00083
00084 string GhostedAreaSpec::description() const {
00085
00086 ostringstream ostr;
00087 ostr << "ghosts of area " << actual_ghost_area()
00088 << " (had requested " << ghost_area() << ")"
00089 << ", placed up to y = " << ghost_maxrap()
00090 << ", scattered wrt to perfect grid by (rel) " << grid_scatter()
00091 << ", mean_ghost_kt = " << mean_ghost_kt()
00092 << ", rel kt_scatter = " << kt_scatter()
00093 << ", n repetitions of ghost distributions = " << repeat();
00094 return ostr.str();
00095 }
00096
00097 FASTJET_END_NAMESPACE
00098