Fork me on GitHub

source: svn/trunk/Utilities/Fastjet/src/GhostedAreaSpec.cc@ 746

Last change on this file since 746 was 11, checked in by severine ovyn, 16 years ago

Fastjet added; CDFCones directory has been changed

File size: 3.6 KB
Line 
1//STARTHEADER
2// $Id: GhostedAreaSpec.cc,v 1.1 2008-11-06 14:32:15 ovyn Exp $
3//
4// Copyright (c) 2005-2006, Matteo Cacciari and Gavin Salam
5//
6//----------------------------------------------------------------------
7// This file is part of FastJet.
8//
9// FastJet is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; either version 2 of the License, or
12// (at your option) any later version.
13//
14// The algorithms that underlie FastJet have required considerable
15// development and are described in hep-ph/0512210. If you use
16// FastJet as part of work towards a scientific publication, please
17// include a citation to the FastJet paper.
18//
19// FastJet is distributed in the hope that it will be useful,
20// but WITHOUT ANY WARRANTY; without even the implied warranty of
21// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22// GNU General Public License for more details.
23//
24// You should have received a copy of the GNU General Public License
25// along with FastJet; if not, write to the Free Software
26// Foundation, Inc.:
27// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28//----------------------------------------------------------------------
29//ENDHEADER
30
31#include "../include/fastjet/GhostedAreaSpec.hh"
32#include<iostream>
33#include<sstream>
34
35using namespace std;
36
37FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
38
39BasicRandom<double> GhostedAreaSpec::_random_generator;
40
41//======================================================================
42/// sets the detailed parameters for the ghosts (which may not be quite
43/// the same as those requested -- this is in order for things to fit
44/// in nicely into 2pi etc...
45void GhostedAreaSpec::_initialize() {
46 // add on area-measuring dummy particles
47 _drap = sqrt(_ghost_area);
48 _dphi = _drap;
49 _nphi = int(ceil(twopi/_dphi)); _dphi = twopi/_nphi;
50 _nrap = int(ceil(_ghost_maxrap/_drap)); _drap = _ghost_maxrap / _nrap;
51 _actual_ghost_area = _dphi * _drap;
52 _n_ghosts = (2*_nrap+1)*_nphi;
53
54 // checkpoint the status of the random number generator.
55 checkpoint_random();
56 //_random_generator.info(cerr);
57}
58
59//----------------------------------------------------------------------
60/// adds the ghost 4-momenta to the vector of PseudoJet's
61void GhostedAreaSpec::add_ghosts(vector<PseudoJet> & event) const {
62 // add momenta for ghosts
63 for (int irap = -_nrap; irap <= _nrap; irap++) {
64 for (int iphi = 0; iphi < _nphi; iphi++) {
65
66 // include random offsets for all quantities
67 double phi = (iphi+0.5) * _dphi + _dphi*(_our_rand()-0.5)*_grid_scatter;
68 double rap = irap * _drap + _drap*(_our_rand()-0.5)*_grid_scatter;
69 double kt = _mean_ghost_kt*(1+(_our_rand()-0.5)*_kt_scatter);
70
71 double pminus = kt*exp(-rap);
72 double pplus = kt*exp(+rap);
73 double px = kt*sin(phi);
74 double py = kt*cos(phi);
75 //cout << kt<<" "<<rap<<" "<<phi<<"\n";
76 //if (phi>=twopi || phi < 0.0) cout << "Hey: "<< phi-twopi<<"\n";
77 PseudoJet mom(px,py,0.5*(pplus-pminus),0.5*(pplus+pminus));
78 event.push_back(mom);
79 }
80 }
81}
82
83string GhostedAreaSpec::description() const {
84
85 ostringstream ostr;
86 ostr << "ghosts of area " << actual_ghost_area()
87 << " (had requested " << ghost_area() << ")"
88 << ", placed up to y = " << ghost_maxrap()
89 << ", scattered wrt to perfect grid by (rel) " << grid_scatter()
90 << ", mean_ghost_kt = " << mean_ghost_kt()
91 << ", rel kt_scatter = " << kt_scatter()
92 << ", n repetitions of ghost distributions = " << repeat();
93 return ostr.str();
94}
95
96FASTJET_END_NAMESPACE
97
Note: See TracBrowser for help on using the repository browser.