2 // $Id: ClusterSequenceVoronoiArea.hh 621 2007-05-09 10:34:30Z salam $
4 // Copyright (c) 2005-2007, Matteo Cacciari, Gavin Salam and Gregory Soyez
6 //----------------------------------------------------------------------
7 // This file is part of FastJet.
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.
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.
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.
24 // You should have received a copy of the GNU General Public License
25 // along with FastJet; if not, write to the Free Software
27 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 //----------------------------------------------------------------------
31 #ifndef __FASTJET_CLUSTERSEQUENCEVORONOIAREA_HH__
32 #define __FASTJET_CLUSTERSEQUENCEVORONOIAREA_HH__
34 #include "fastjet/PseudoJet.hh"
35 #include "fastjet/AreaDefinition.hh"
36 #include "fastjet/ClusterSequenceAreaBase.hh"
40 namespace fastjet { // defined in fastjet/internal/base.hh
43 * \class ClusterSequenceVoronoiArea
44 * Handle the computation of Voronoi jet area.
46 class ClusterSequenceVoronoiArea : public ClusterSequenceAreaBase {
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);
60 ~ClusterSequenceVoronoiArea();
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()];};
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()];};
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 {
78 /// passive area calculator -- to be defined in the .cc file (it will do
79 /// the true hard work)
80 class VoronoiAreaCalc;
84 /// initialisation of the Voronoi Area
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
96 /// template constructor need to be specified in the header!
97 //----------------------------------------------------------------------
98 template<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()) {
105 // transfer the initial jets (type L) into our own array
106 _transfer_input_jets(pseudojets);
108 // run the clustering
109 _initialise_and_run(jet_def,writeout_combinations);
111 // the jet clustering's already been done, now worry about areas...
115 } // fastjet namespace
117 #endif // __FASTJET_CLUSTERSEQUENCEVORONOIAREA_HH__