CMS 3D CMS Logo

Classes | Public Member Functions | Private Attributes

GeometricAnnealing Class Reference

#include <GeometricAnnealing.h>

Inheritance diagram for GeometricAnnealing:
AnnealingSchedule DefaultMVFAnnealing

List of all members.

Classes

class  A

Public Member Functions

void anneal ()
GeometricAnnealingclone () const
double currentTemp () const
double cutoff () const
void debug () const
 GeometricAnnealing (const double cutoff=3.0, const double T=256.0, const double annealing_ratio=0.25)
double initialTemp () const
bool isAnnealed () const
double phi (double chi2) const
void resetAnnealing ()
double weight (double chi2) const

Private Attributes

double theChi2cut
double theRatio
double theT
double theT0

Detailed Description

Definition at line 7 of file GeometricAnnealing.h.


Constructor & Destructor Documentation

GeometricAnnealing::GeometricAnnealing ( const double  cutoff = 3.0,
const double  T = 256.0,
const double  annealing_ratio = 0.25 
)

Definition at line 6 of file GeometricAnnealing.cc.

Referenced by clone().

                                                               :
  theT0(T), theT(T), theChi2cut(cutoff*cutoff), theRatio( ratio )
{}

Member Function Documentation

void GeometricAnnealing::anneal ( ) [virtual]

Implements AnnealingSchedule.

Definition at line 11 of file GeometricAnnealing.cc.

References theRatio, and theT.

{
  theT=1+(theT-1)*theRatio;
}
GeometricAnnealing* GeometricAnnealing::clone ( void  ) const [inline, virtual]

Implements AnnealingSchedule.

Definition at line 45 of file GeometricAnnealing.h.

References GeometricAnnealing().

  {
    return new GeometricAnnealing ( * this );
  };
double GeometricAnnealing::currentTemp ( ) const [virtual]

Implements AnnealingSchedule.

Definition at line 44 of file GeometricAnnealing.cc.

References theT.

{
  return theT;
}
double GeometricAnnealing::cutoff ( ) const [virtual]

Implements AnnealingSchedule.

Definition at line 38 of file GeometricAnnealing.cc.

References mathSSE::sqrt(), and theChi2cut.

{
  // std::cout << "[GeometricAnnealing] cutoff called!" << std::endl;
  return sqrt(theChi2cut);
}
void GeometricAnnealing::debug ( ) const [virtual]

Implements AnnealingSchedule.

Definition at line 59 of file GeometricAnnealing.cc.

References gather_cfg::cout, theChi2cut, theRatio, and theT0.

{
  std::cout << "[GeometricAnnealing] chi2_cut=" << theChi2cut << ", Tini="
       << theT0 << ", ratio=" << theRatio << std::endl;
}
double GeometricAnnealing::initialTemp ( ) const [virtual]

Implements AnnealingSchedule.

Definition at line 49 of file GeometricAnnealing.cc.

References theT0.

{
  return theT0;
}
bool GeometricAnnealing::isAnnealed ( ) const [virtual]

is it annealed yet?

Implements AnnealingSchedule.

Definition at line 54 of file GeometricAnnealing.cc.

References theT.

{
  return ( theT < 1.02 );
}
double GeometricAnnealing::phi ( double  chi2) const [virtual]

phi ( chi2 ) = e^( -.5 * chi2 / T )

Implements AnnealingSchedule.

Definition at line 33 of file GeometricAnnealing.cc.

References funct::exp(), and theT.

Referenced by weight().

{
  return exp ( -.5 * chi2 / theT );
}
void GeometricAnnealing::resetAnnealing ( ) [virtual]

Implements AnnealingSchedule.

Definition at line 28 of file GeometricAnnealing.cc.

References theT, and theT0.

{
  theT=theT0;
}
double GeometricAnnealing::weight ( double  chi2) const [virtual]

Returns phi(chi2) / ( phi(cutoff^2) + phi(chi2) ),

Implements AnnealingSchedule.

Definition at line 16 of file GeometricAnnealing.cc.

References phi(), and theChi2cut.

{
  double mphi = phi ( chi2 );
  long double newtmp = mphi / ( mphi + phi ( theChi2cut ) );
  if ( std::isinf(newtmp) )
  {
    if ( chi2 < theChi2cut ) newtmp=1.;
    else newtmp=0.;
  }
  return newtmp;
}

Member Data Documentation

Definition at line 53 of file GeometricAnnealing.h.

Referenced by cutoff(), debug(), and weight().

double GeometricAnnealing::theRatio [private]

Definition at line 54 of file GeometricAnnealing.h.

Referenced by anneal(), and debug().

double GeometricAnnealing::theT [private]

Definition at line 52 of file GeometricAnnealing.h.

Referenced by anneal(), currentTemp(), isAnnealed(), phi(), and resetAnnealing().

double GeometricAnnealing::theT0 [private]

Definition at line 48 of file GeometricAnnealing.h.

Referenced by debug(), initialTemp(), and resetAnnealing().