00001 //STARTHEADER 00002 // $Id: ActiveAreaSpec.cc 295 2006-08-19 10:15:37Z 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 #include "fastjet/ActiveAreaSpec.hh" 00032 #include<iostream> 00033 00034 using namespace std; 00035 00036 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh 00037 00038 BasicRandom<double> ActiveAreaSpec::_random_generator; 00039 00040 //====================================================================== 00044 void ActiveAreaSpec::_initialize() { 00045 // add on area-measuring dummy particles 00046 _deta = sqrt(_ghost_area); 00047 _dphi = _deta; 00048 _nphi = int(ceil(twopi/_dphi)); _dphi = twopi/_nphi; 00049 _neta = int(ceil(_ghost_etamax/_deta)); _deta = _ghost_etamax / _neta; 00050 _actual_ghost_area = _dphi * _deta; 00051 _n_ghosts = (2*_neta+1)*_nphi; 00052 00053 //_random_generator.info(cerr); 00054 } 00055 00056 //---------------------------------------------------------------------- 00058 void ActiveAreaSpec::add_ghosts(vector<PseudoJet> & event) const { 00059 // add momenta for ghosts 00060 for (int ieta = -_neta; ieta <= _neta; ieta++) { 00061 for (int iphi = 0; iphi < _nphi; iphi++) { 00062 // // include random offsets for all quantities 00063 // double phi = (iphi+0.5) * _dphi + _dphi*rand()*_grid_scatter/RAND_MAX; 00064 // double eta = ieta * _deta + _deta*rand()*_grid_scatter/RAND_MAX; 00065 // //double phi = (iphi+0.5) * _dphi* + rand()*_grid_scatter/RAND_MAX; 00066 // //double eta = ieta * _deta + rand()*_grid_scatter/RAND_MAX; 00067 // double kt = _mean_ghost_kt*(1+rand()*_kt_scatter/RAND_MAX); 00068 00069 // include random offsets for all quantities 00070 double phi = (iphi+0.5) * _dphi + _dphi*_our_rand()*_grid_scatter; 00071 double eta = ieta * _deta + _deta*_our_rand()*_grid_scatter; 00072 //double phi = (iphi+0.5) * _dphi* + _our_rand()*_grid_scatter; 00073 //double eta = ieta * _deta + _our_rand()*_grid_scatter; 00074 double kt = _mean_ghost_kt*(1+_our_rand()*_kt_scatter); 00075 00076 00077 00078 double pminus = kt*exp(-eta); 00079 double pplus = kt*exp(+eta); 00080 double px = kt*sin(phi); 00081 double py = kt*cos(phi); 00082 //cout << kt<<" "<<eta<<" "<<phi<<"\n"; 00083 //if (phi>=twopi || phi < 0.0) cout << "Hey: "<< phi-twopi<<"\n"; 00084 PseudoJet mom(px,py,0.5*(pplus-pminus),0.5*(pplus+pminus)); 00085 //mom.set_user_index(1); // for ghost particles (user index now lost...) 00086 event.push_back(mom); 00087 //_is_pure_ghost.push_back(true); 00088 } 00089 } 00090 } 00091 00092 FASTJET_END_NAMESPACE 00093
1.4.2