Fork me on GitHub

source: svn/trunk/Utilities/Fastjet/src/RangeDefinition.cc@ 11

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

Fastjet added; CDFCones directory has been changed

File size: 2.1 KB
Line 
1//STARTHEADER
2// $Id: RangeDefinition.cc,v 1.1 2008-11-06 14:32:15 ovyn Exp $
3//
4// Copyright (c) 2005-2007, 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/RangeDefinition.hh"
32
33FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
34
35using namespace std;
36
37/// calculate, and set in _total_area, the area with a numerical test
38/// takes a reasonable time with rapmax = 10, npoints = 100
39void RangeDefinition::_numerical_total_area(double rapmax, int npoints) {
40
41 int count = 0;
42 double deltaphi = twopi/double(npoints);
43 double deltarap = 2.0*rapmax/double(npoints);
44 double phi = 0.0;
45 for(int i = 0; i < npoints; i++) {
46 double rap = -rapmax;
47 for (int j = 0; j < npoints; j++) {
48 if ( is_in_range(rap,phi) ) { count++; }
49 rap += deltarap;
50 }
51 phi += deltaphi;
52 }
53
54 _total_area = double(count)/double(npoints*npoints)*2.0*twopi*rapmax;
55}
56
57FASTJET_END_NAMESPACE
Note: See TracBrowser for help on using the repository browser.