Fork me on GitHub

Ignore:
Timestamp:
Dec 9, 2014, 1:27:13 PM (10 years ago)
Author:
Michele <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
37deb3b, 9e991f8
Parents:
f6b6ee7 (diff), e7e90df (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'TestFastJet310b1'

File:
1 edited

Legend:

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

    rf6b6ee7 r49234af  
    55//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
    66//
     7//  $Id: AxesFinder.cc 670 2014-06-06 01:24:42Z jthaler $
    78//----------------------------------------------------------------------
    89// This file is part of FastJet contrib.
     
    3738template <int N>
    3839std::vector<LightLikeAxis> AxesFinderFromOnePassMinimization::UpdateAxesFast(const std::vector <LightLikeAxis> & old_axes,
    39                                   const std::vector <fastjet::PseudoJet> & inputJets) {
     40                                  const std::vector <fastjet::PseudoJet> & inputJets) const {
    4041   assert(old_axes.size() == N);
    4142   
     
    4546   for (int n = 0; n < N; ++n) {
    4647      new_axes[n].reset(0.0,0.0,0.0,0.0);
    47 #ifdef FASTJET2
    48       new_jets[n].reset(0.0,0.0,0.0,0.0);
    49 #else
    50       // use cheaper reset if available
    5148      new_jets[n].reset_momentum(0.0,0.0,0.0,0.0);
    52 #endif
    5349   }
    5450
     
    135131// (This is just a wrapper for the templated version above.)
    136132std::vector<LightLikeAxis> AxesFinderFromOnePassMinimization::UpdateAxes(const std::vector <LightLikeAxis> & old_axes,
    137                                       const std::vector <fastjet::PseudoJet> & inputJets) {
     133                                      const std::vector <fastjet::PseudoJet> & inputJets) const {
    138134   int N = old_axes.size();
    139135   switch (N) {
     
    166162// uses minimization of N-jettiness to continually update axes until convergence.
    167163// The function returns the axes found at the (local) minimum
    168 std::vector<fastjet::PseudoJet> AxesFinderFromOnePassMinimization::getBetterAxes(int n_jets, const std::vector <fastjet::PseudoJet> & inputJets, const std::vector<fastjet::PseudoJet>& seedAxes) {
     164std::vector<fastjet::PseudoJet> AxesFinderFromOnePassMinimization::getAxes(int n_jets, const std::vector <fastjet::PseudoJet> & inputJets, const std::vector<fastjet::PseudoJet>& seedAxes) const {
    169165         
    170166   // convert from PseudoJets to LightLikeAxes
     
    211207}
    212208
    213 PseudoJet AxesFinderFromKmeansMinimization::jiggle(const PseudoJet& axis) {
     209PseudoJet AxesFinderFromKmeansMinimization::jiggle(const PseudoJet& axis) const {
    214210   double phi_noise = ((double)rand()/(double)RAND_MAX) * _noise_range * 2.0 - _noise_range;
    215211   double rap_noise = ((double)rand()/(double)RAND_MAX) * _noise_range * 2.0 - _noise_range;
     
    226222   
    227223// Repeatedly calls the one pass finder to try to find global minimum
    228 std::vector<fastjet::PseudoJet> AxesFinderFromKmeansMinimization::getBetterAxes(int n_jets, const std::vector <fastjet::PseudoJet> & inputJets, const std::vector<fastjet::PseudoJet>& seedAxes) {
     224std::vector<fastjet::PseudoJet> AxesFinderFromKmeansMinimization::getAxes(int n_jets, const std::vector <fastjet::PseudoJet> & inputJets, const std::vector<fastjet::PseudoJet>& seedAxes) const {
    229225   
    230226   // first iteration
     
    256252// It continually updates until it reaches convergence or it reaches the maximum number of attempts.
    257253// This is essentially the same as a stable cone finder.
    258 std::vector<fastjet::PseudoJet> AxesFinderFromGeometricMinimization::getBetterAxes(int n_jets, const std::vector <fastjet::PseudoJet> & particles, const std::vector<fastjet::PseudoJet>& currentAxes) {
     254std::vector<fastjet::PseudoJet> AxesFinderFromGeometricMinimization::getAxes(int /*n_jets*/, const std::vector <fastjet::PseudoJet> & particles, const std::vector<fastjet::PseudoJet>& currentAxes) const {
    259255
    260256   std::vector<fastjet::PseudoJet> seedAxes = currentAxes;
    261    double seedTau = _function->tau(particles, seedAxes);
     257   double seedTau = _function.tau(particles, seedAxes);
    262258   
    263259   for (int i = 0; i < _nAttempts; i++) {
     
    270266         // start from unclustered beam measure
    271267         int minJ = -1;
    272          double minDist = _function->beam_distance_squared(particles[i]);
     268         double minDist = _function.beam_distance_squared(particles[i]);
    273269         
    274270         // which axis am I closest to?
    275271         for (unsigned int j = 0; j < seedAxes.size(); j++) {
    276             double tempDist = _function->jet_distance_squared(particles[i],seedAxes[j]);
     272            double tempDist = _function.jet_distance_squared(particles[i],seedAxes[j]);
    277273            if (tempDist < minDist) {
    278274               minDist = tempDist;
     
    287283      // calculate tau on new axes
    288284      seedAxes = newAxes;
    289       double tempTau = _function->tau(particles, newAxes);
     285      double tempTau = _function.tau(particles, newAxes);
    290286     
    291287      // close enough to stop?
Note: See TracChangeset for help on using the changeset viewer.