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