Changeset 35cdc46 in git for external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.cc
- Timestamp:
- Sep 3, 2014, 3:18:54 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- be2222c
- Parents:
- 5b5a56b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.cc
r5b5a56b r35cdc46 5 5 // Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason 6 6 // 7 // $Id: NjettinessPlugin.cc 663 2014-06-03 21:26:41Z jthaler $ 7 8 //---------------------------------------------------------------------- 8 9 // This file is part of FastJet contrib. … … 29 30 30 31 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 compatibility36 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) {}38 32 39 33 std::string NjettinessPlugin::description() const {return "N-jettiness jet finder";} 40 34 35 41 36 // 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 43 39 void NjettinessPlugin::run_clustering(ClusterSequence& cs) const 44 40 { 45 41 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 46 50 _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); 48 53 49 54 std::vector<fastjet::PseudoJet> jet_indices_for_extras; 50 55 51 56 // 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 53 59 std::list<int>& indices = partition[i]; 54 60 if (indices.size() == 0) continue; … … 70 76 } 71 77 78 //HACK: Re-reverse order of reading to match CS order 79 reverse(jet_indices_for_extras.begin(),jet_indices_for_extras.end()); 80 72 81 NjettinessExtras * extras = new NjettinessExtras(_njettinessFinder.currentTauComponents(),jet_indices_for_extras,_njettinessFinder.currentAxes()); 73 82 cs.plugin_associate_extras(std::auto_ptr<ClusterSequence::Extras>(extras));
Note:
See TracChangeset
for help on using the changeset viewer.