Fork me on GitHub

source: svn/trunk/Utilities/Fastjet/src/ClusterSequencePassiveArea.cc@ 432

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

Fastjet added; CDFCones directory has been changed

File size: 4.4 KB
Line 
1//STARTHEADER
2// $Id: ClusterSequencePassiveArea.cc,v 1.1 2008-11-06 14:32:14 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/ClusterSequencePassiveArea.hh"
32#include "../include/fastjet/ClusterSequenceVoronoiArea.hh"
33
34FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
35
36
37using namespace std;
38
39//----------------------------------------------------------------------
40/// global routine for initialising and running a passive area that is
41/// correct in general, but that chooses an optimal approach for
42/// various special cases.
43void ClusterSequencePassiveArea::_initialise_and_run_PA (
44 const JetDefinition & jet_def,
45 const GhostedAreaSpec & area_spec,
46 const bool & writeout_combinations) {
47
48 if (jet_def.jet_algorithm() == kt_algorithm) {
49 // first run the passive area
50 ClusterSequenceVoronoiArea csva(_jets,jet_def,VoronoiAreaSpec(1.0));
51 // now set up and transfer relevant information
52 // first the clustering sequence
53 transfer_from_sequence(csva);
54 // then the areas
55 _resize_and_zero_AA();
56 for (unsigned i = 0; i < _history.size(); i++) {
57 int ijetp = _history[i].jetp_index;
58 if (ijetp != Invalid) {
59 _average_area[i] = csva.area(_jets[ijetp]);
60 _average_area_4vector[i] = csva.area_4vector(_jets[ijetp]);
61 }
62 }
63
64 } else if (jet_def.jet_algorithm() == cambridge_algorithm) {
65 // run a variant of the cambridge algorithm that has been hacked
66 // to deal with passive areas
67 JetDefinition tmp_jet_def = jet_def;
68 tmp_jet_def.set_jet_finder(cambridge_for_passive_algorithm);
69 tmp_jet_def.set_extra_param(sqrt(area_spec.mean_ghost_kt()));
70 _initialise_and_run_AA(tmp_jet_def, area_spec, writeout_combinations);
71 _jet_def = jet_def;
72
73 } else if (jet_def.jet_algorithm() == antikt_algorithm) {
74 // for the antikt algorithm, passive and active are identical
75 _initialise_and_run_AA(jet_def, area_spec, writeout_combinations);
76
77 } else if (jet_def.jet_algorithm() == plugin_algorithm &&
78 jet_def.plugin()->supports_ghosted_passive_areas()) {
79 // for some plugin algorithms, one can "prime" the algorithm with information
80 // about the ghost scale, and then an "AA" run will actually give a passive
81 // area
82 double ghost_sep_scale_store = jet_def.plugin()->ghost_separation_scale();
83 jet_def.plugin()->set_ghost_separation_scale(sqrt(area_spec.mean_ghost_kt()));
84 _initialise_and_run_AA(jet_def, area_spec, writeout_combinations);
85
86 // restore the original ghost_sep_scale
87 jet_def.plugin()->set_ghost_separation_scale(ghost_sep_scale_store);
88
89 } else {
90 // for a generic algorithm, just run the 1GhostPassiveArea
91 _initialise_and_run_1GPA(jet_def, area_spec, writeout_combinations);
92 }
93}
94
95//----------------------------------------------------------------------
96// dispatch to most relevant empty area calculation...
97double ClusterSequencePassiveArea::empty_area (const RangeDefinition & range) const {
98 if (jet_def().jet_algorithm() == kt_algorithm) {
99 // run the naive algorithm
100 return ClusterSequenceAreaBase::empty_area(range);
101 } else {
102 return ClusterSequence1GhostPassiveArea::empty_area(range);
103 }
104}
105
106
107FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
108
Note: See TracBrowser for help on using the repository browser.