[35cdc46] | 1 | //FJSTARTHEADER
|
---|
| 2 | // $Id: ClusterSequencePassiveArea.cc 3433 2014-07-23 08:17:03Z salam $
|
---|
[d7d2da3] | 3 | //
|
---|
[35cdc46] | 4 | // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
|
---|
[d7d2da3] | 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
|
---|
[35cdc46] | 15 | // development. They are described in the original FastJet paper,
|
---|
| 16 | // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
|
---|
[d7d2da3] | 17 | // FastJet as part of work towards a scientific publication, please
|
---|
[35cdc46] | 18 | // quote the version you use and include a citation to the manual and
|
---|
| 19 | // optionally also to hep-ph/0512210.
|
---|
[d7d2da3] | 20 | //
|
---|
| 21 | // FastJet is distributed in the hope that it will be useful,
|
---|
| 22 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 23 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 24 | // GNU General Public License for more details.
|
---|
| 25 | //
|
---|
| 26 | // You should have received a copy of the GNU General Public License
|
---|
| 27 | // along with FastJet. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 28 | //----------------------------------------------------------------------
|
---|
[35cdc46] | 29 | //FJENDHEADER
|
---|
[d7d2da3] | 30 |
|
---|
| 31 | #include "fastjet/ClusterSequencePassiveArea.hh"
|
---|
| 32 | #include "fastjet/ClusterSequenceVoronoiArea.hh"
|
---|
| 33 |
|
---|
| 34 | FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | using 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.
|
---|
| 43 | void ClusterSequencePassiveArea::_initialise_and_run_PA (
|
---|
| 44 | const JetDefinition & jet_def_in,
|
---|
| 45 | const GhostedAreaSpec & area_spec,
|
---|
| 46 | const bool & writeout_combinations) {
|
---|
| 47 |
|
---|
| 48 | if (jet_def_in.jet_algorithm() == kt_algorithm) {
|
---|
| 49 | // first run the passive area
|
---|
| 50 | ClusterSequenceVoronoiArea csva(_jets,jet_def_in,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_in.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_in;
|
---|
| 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_in;
|
---|
| 72 |
|
---|
| 73 | } else if (jet_def_in.jet_algorithm() == antikt_algorithm) {
|
---|
| 74 | // for the antikt algorithm, passive and active are identical
|
---|
| 75 | _initialise_and_run_AA(jet_def_in, area_spec, writeout_combinations);
|
---|
| 76 |
|
---|
| 77 | } else if (jet_def_in.jet_algorithm() == plugin_algorithm &&
|
---|
| 78 | jet_def_in.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_in.plugin()->ghost_separation_scale();
|
---|
| 83 | jet_def_in.plugin()->set_ghost_separation_scale(sqrt(area_spec.mean_ghost_kt()));
|
---|
| 84 | _initialise_and_run_AA(jet_def_in, area_spec, writeout_combinations);
|
---|
| 85 |
|
---|
| 86 | // restore the original ghost_sep_scale
|
---|
| 87 | jet_def_in.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_in, area_spec, writeout_combinations);
|
---|
| 92 | }
|
---|
| 93 | }
|
---|
| 94 |
|
---|
| 95 | //----------------------------------------------------------------------
|
---|
| 96 | // dispatch to most relevant empty area calculation...
|
---|
| 97 | double ClusterSequencePassiveArea::empty_area (const Selector & selector) const {
|
---|
| 98 | if (jet_def().jet_algorithm() == kt_algorithm) {
|
---|
| 99 | // run the naive algorithm
|
---|
| 100 | return ClusterSequenceAreaBase::empty_area(selector);
|
---|
| 101 | } else {
|
---|
| 102 | return ClusterSequence1GhostPassiveArea::empty_area(selector);
|
---|
| 103 | }
|
---|
| 104 | }
|
---|
| 105 |
|
---|
| 106 |
|
---|
| 107 | FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
|
---|
| 108 |
|
---|