[11] | 1 | //STARTHEADER
|
---|
| 2 | // $Id: ClusterSequence1GhostPassiveArea.cc,v 1.1 2008-11-06 14:32:13 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/ClusterSequence1GhostPassiveArea.hh"
|
---|
| 32 |
|
---|
| 33 | FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | using namespace std;
|
---|
| 37 |
|
---|
| 38 | //----------------------------------------------------------------------
|
---|
| 39 | /// global routine for initialising and running a general passive area
|
---|
| 40 | void ClusterSequence1GhostPassiveArea::_initialise_and_run_1GPA (
|
---|
| 41 | const JetDefinition & jet_def,
|
---|
| 42 | const GhostedAreaSpec & area_spec,
|
---|
| 43 | const bool & writeout_combinations) {
|
---|
| 44 |
|
---|
| 45 | bool continue_running;
|
---|
| 46 | _initialise_AA(jet_def, area_spec, writeout_combinations, continue_running);
|
---|
| 47 | if (continue_running) {
|
---|
| 48 | _run_1GPA(area_spec);
|
---|
| 49 | _postprocess_AA(area_spec);
|
---|
| 50 | }
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | //----------------------------------------------------------------------
|
---|
| 55 | /// routine for running a passive area one ghost at a time.
|
---|
| 56 | void ClusterSequence1GhostPassiveArea::_run_1GPA (const GhostedAreaSpec & area_spec) {
|
---|
| 57 | // record the input jets as they are currently
|
---|
| 58 | vector<PseudoJet> input_jets(_jets);
|
---|
| 59 |
|
---|
| 60 | // code for testing the unique tree
|
---|
| 61 | vector<int> unique_tree;
|
---|
| 62 |
|
---|
| 63 | // initialise our temporary average area^2
|
---|
| 64 | valarray<double> lcl_average_area2(0.0, _average_area.size());
|
---|
| 65 | valarray<double> last_average_area(0.0, _average_area.size());
|
---|
| 66 |
|
---|
| 67 | // run the clustering multiple times so as to get areas of all the jets
|
---|
| 68 | for (int irepeat = 0; irepeat < area_spec.repeat(); irepeat++) {
|
---|
| 69 |
|
---|
| 70 | // first establish list of all ghosts
|
---|
| 71 | vector<PseudoJet> all_ghosts;
|
---|
| 72 | area_spec.add_ghosts(all_ghosts);
|
---|
| 73 |
|
---|
| 74 | // then run many subsets of ghosts (actually each subset contains just one ghost)
|
---|
| 75 | for (unsigned ig = 0; ig < all_ghosts.size(); ig++) {
|
---|
| 76 | vector<PseudoJet> some_ghosts;
|
---|
| 77 | some_ghosts.push_back(all_ghosts[ig]);
|
---|
| 78 | ClusterSequenceActiveAreaExplicitGhosts clust_seq(input_jets, jet_def(),
|
---|
| 79 | some_ghosts, area_spec.actual_ghost_area());
|
---|
| 80 |
|
---|
| 81 | if (irepeat == 0 && ig == 0) {
|
---|
| 82 | // take the non-ghost part of the history and put into our own
|
---|
| 83 | // history.
|
---|
| 84 | _transfer_ghost_free_history(clust_seq);
|
---|
| 85 | // get the "unique" order that will be used for transferring all areas.
|
---|
| 86 | unique_tree = unique_history_order();
|
---|
| 87 | }
|
---|
| 88 |
|
---|
| 89 | // transfer areas from clust_seq into our object
|
---|
| 90 | _transfer_areas(unique_tree, clust_seq);
|
---|
| 91 | }
|
---|
| 92 | // keep track of fluctuations in area
|
---|
| 93 | lcl_average_area2 += (_average_area - last_average_area)*
|
---|
| 94 | (_average_area - last_average_area);
|
---|
| 95 | last_average_area = _average_area;
|
---|
| 96 | }
|
---|
| 97 | _average_area2 = lcl_average_area2;
|
---|
| 98 | }
|
---|
| 99 |
|
---|
| 100 |
|
---|
| 101 | FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
|
---|
| 102 |
|
---|