Fork me on GitHub

source: svn/trunk/Utilities/Fastjet/include/fastjet/ClusterSequenceVoronoiArea.hh@ 106

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

Fastjet added; CDFCones directory has been changed

File size: 4.3 KB
Line 
1//STARTHEADER
2// $Id: ClusterSequenceVoronoiArea.hh,v 1.1 2008-11-06 14:32:08 ovyn Exp $
3//
4// Copyright (c) 2005-2007, Matteo Cacciari, Gavin Salam and Gregory Soyez
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#ifndef __FASTJET_CLUSTERSEQUENCEVORONOIAREA_HH__
32#define __FASTJET_CLUSTERSEQUENCEVORONOIAREA_HH__
33
34#include "Utilities/Fastjet/include/fastjet/PseudoJet.hh"
35#include "Utilities/Fastjet/include/fastjet/AreaDefinition.hh"
36#include "Utilities/Fastjet/include/fastjet/ClusterSequenceAreaBase.hh"
37#include <memory>
38#include <vector>
39
40FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
41
42/**
43 * \class ClusterSequenceVoronoiArea
44 * Handle the computation of Voronoi jet area.
45 */
46class ClusterSequenceVoronoiArea : public ClusterSequenceAreaBase {
47public:
48 /// template ctor
49 /// \param pseudojet list of jets (template type)
50 /// \param jet_def jet definition
51 /// \param effective_Rfact effective radius
52 /// \param writeout_combinations ??????
53 template<class L> ClusterSequenceVoronoiArea
54 (const std::vector<L> & pseudojets,
55 const JetDefinition & jet_def,
56 const VoronoiAreaSpec & spec = VoronoiAreaSpec(),
57 const bool & writeout_combinations = false);
58
59 /// default dtor
60 ~ClusterSequenceVoronoiArea();
61
62 /// return the area associated with the given jet
63 virtual inline double area(const PseudoJet & jet) const {
64 return _voronoi_area[jet.cluster_hist_index()];};
65
66 /// return a 4-vector area associated with the given jet -- stricly
67 /// this is not the exact 4-vector area, but rather an approximation
68 /// made of sums of centres of all Voronoi cells in jet, each
69 /// contributing with a normalisation equal to the area of the cell
70 virtual inline PseudoJet area_4vector(const PseudoJet & jet) const {
71 return _voronoi_area_4vector[jet.cluster_hist_index()];};
72
73 /// return the error of the area associated with the given jet
74 /// (0 by definition for a voronoi area)
75 virtual inline double area_error(const PseudoJet & jet) const {
76 return 0.0;};
77
78 /// passive area calculator -- to be defined in the .cc file (it will do
79 /// the true hard work)
80 class VoronoiAreaCalc;
81
82
83private:
84 /// initialisation of the Voronoi Area
85 void _initializeVA();
86
87 std::vector<double> _voronoi_area; ///< vector containing the result
88 std::vector<PseudoJet> _voronoi_area_4vector; ///< vector containing approx 4-vect areas
89 VoronoiAreaCalc *_pa_calc; ///< area calculator
90 double _effective_Rfact; ///< effective radius
91};
92
93
94
95
96/// template constructor need to be specified in the header!
97//----------------------------------------------------------------------
98template<class L> ClusterSequenceVoronoiArea::ClusterSequenceVoronoiArea
99(const std::vector<L> &pseudojets,
100 const JetDefinition &jet_def,
101 const VoronoiAreaSpec & spec,
102 const bool & writeout_combinations) :
103 _effective_Rfact(spec.effective_Rfact()) {
104
105 // transfer the initial jets (type L) into our own array
106 _transfer_input_jets(pseudojets);
107
108 // run the clustering
109 _initialise_and_run(jet_def,writeout_combinations);
110
111 // the jet clustering's already been done, now worry about areas...
112 _initializeVA();
113}
114
115FASTJET_END_NAMESPACE
116
117#endif // __FASTJET_CLUSTERSEQUENCEVORONOIAREA_HH__
Note: See TracBrowser for help on using the repository browser.