Fork me on GitHub

Ignore:
Timestamp:
Sep 3, 2014, 3:18:54 PM (10 years ago)
Author:
Pavel Demin <demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
be2222c
Parents:
5b5a56b
Message:

upgrade FastJet to version 3.1.0-beta.1, upgrade Nsubjettiness to version 2.1.0, add SoftKiller version 1.0.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.cc

    r5b5a56b r35cdc46  
    55//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
    66//
     7//  $Id: NjettinessPlugin.cc 663 2014-06-03 21:26:41Z jthaler $
    78//----------------------------------------------------------------------
    89// This file is part of FastJet contrib.
     
    2930
    3031
    31 // Constructor with same arguments as Nsubjettiness.
    32 NjettinessPlugin::NjettinessPlugin(int N, Njettiness::AxesMode axes_mode, Njettiness::MeasureMode measure_mode, double para1, double para2, double para3, double para4)
    33   : _N(N), _njettinessFinder(axes_mode, measure_mode, para1, para2, para3, para4) {}
    34 
    35 // Old constructor for compatibility
    36 NjettinessPlugin::NjettinessPlugin(int N, Njettiness::AxesMode mode, double beta, double R0, double Rcutoff)
    37    : _N(N), _njettinessFinder(mode, Njettiness::normalized_cutoff_measure, beta, R0, Rcutoff) {}
    3832
    3933std::string NjettinessPlugin::description() const {return "N-jettiness jet finder";}
    4034
     35
    4136// Clusters the particles according to the Njettiness jet algorithm
    42 // TODO: this code should be revisited to see if if can be made more clear.
     37// Apologies for the complication with this code, but we need to make
     38// a fake jet clustering tree.  The partitioning is done by getPartitionList
    4339void NjettinessPlugin::run_clustering(ClusterSequence& cs) const
    4440{
    4541   std::vector<fastjet::PseudoJet> particles = cs.jets();
     42
     43   // HACK: remove area information from particles (in case this is called by
     44   // a ClusterSequenceArea.  Will be fixed in a future FastJet release)
     45   for (unsigned i = 0; i < particles.size(); i++) {
     46      particles[i].set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>());
     47   }
     48   
     49   
    4650   _njettinessFinder.getTau(_N, particles);
    47    std::vector<std::list<int> > partition = _njettinessFinder.getPartition(particles);
     51
     52   std::vector<std::list<int> > partition = _njettinessFinder.getPartitionList(particles);
    4853
    4954   std::vector<fastjet::PseudoJet> jet_indices_for_extras;
    5055
    5156   // output clusterings for each jet
    52    for (size_t i = 0; i < partition.size(); ++i) {
     57   for (size_t i0 = 0; i0 < partition.size(); ++i0) {
     58      size_t i = partition.size() - 1 - i0; // reversed order of reading to match axes order
    5359      std::list<int>& indices = partition[i];
    5460      if (indices.size() == 0) continue;
     
    7076   }
    7177
     78   //HACK:  Re-reverse order of reading to match CS order
     79   reverse(jet_indices_for_extras.begin(),jet_indices_for_extras.end());
     80
    7281   NjettinessExtras * extras = new NjettinessExtras(_njettinessFinder.currentTauComponents(),jet_indices_for_extras,_njettinessFinder.currentAxes());
    7382   cs.plugin_associate_extras(std::auto_ptr<ClusterSequence::Extras>(extras));
Note: See TracChangeset for help on using the changeset viewer.