test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
GeometricAnnealing Class Reference

#include <GeometricAnnealing.h>

Inheritance diagram for GeometricAnnealing:
AnnealingSchedule DefaultMVFAnnealing

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
 
- Public Member Functions inherited from AnnealingSchedule
virtual ~AnnealingSchedule ()
 

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 7 of file GeometricAnnealing.cc.

Referenced by clone().

8  :
10 {}
double cutoff() const
long double T

Member Function Documentation

void GeometricAnnealing::anneal ( )
virtual

Implements AnnealingSchedule.

Definition at line 12 of file GeometricAnnealing.cc.

References theRatio, and theT.

13 {
14  theT=1+(theT-1)*theRatio;
15 }
GeometricAnnealing* GeometricAnnealing::clone ( void  ) const
inlinevirtual

Implements AnnealingSchedule.

Definition at line 45 of file GeometricAnnealing.h.

References GeometricAnnealing().

46  {
47  return new GeometricAnnealing ( * this );
48  };
GeometricAnnealing(const double cutoff=3.0, const double T=256.0, const double annealing_ratio=0.25)
double GeometricAnnealing::currentTemp ( ) const
virtual

Implements AnnealingSchedule.

Definition at line 45 of file GeometricAnnealing.cc.

References theT.

46 {
47  return theT;
48 }
double GeometricAnnealing::cutoff ( ) const
virtual

Implements AnnealingSchedule.

Definition at line 39 of file GeometricAnnealing.cc.

References mathSSE::sqrt(), and theChi2cut.

40 {
41  // std::cout << "[GeometricAnnealing] cutoff called!" << std::endl;
42  return sqrt(theChi2cut);
43 }
T sqrt(T t)
Definition: SSEVec.h:18
void GeometricAnnealing::debug ( ) const
virtual

Implements AnnealingSchedule.

Definition at line 60 of file GeometricAnnealing.cc.

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

61 {
62  std::cout << "[GeometricAnnealing] chi2_cut=" << theChi2cut << ", Tini="
63  << theT0 << ", ratio=" << theRatio << std::endl;
64 }
tuple cout
Definition: gather_cfg.py:145
double GeometricAnnealing::initialTemp ( ) const
virtual

Implements AnnealingSchedule.

Definition at line 50 of file GeometricAnnealing.cc.

References theT0.

51 {
52  return theT0;
53 }
bool GeometricAnnealing::isAnnealed ( ) const
virtual

is it annealed yet?

Implements AnnealingSchedule.

Definition at line 55 of file GeometricAnnealing.cc.

References theT.

56 {
57  return ( theT < 1.02 );
58 }
double GeometricAnnealing::phi ( double  chi2) const
virtual

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

Implements AnnealingSchedule.

Definition at line 34 of file GeometricAnnealing.cc.

References create_public_lumi_plots::exp, and theT.

Referenced by Particle.Particle::__str__(), and weight().

void GeometricAnnealing::resetAnnealing ( )
virtual

Implements AnnealingSchedule.

Definition at line 29 of file GeometricAnnealing.cc.

References theT, and theT0.

30 {
31  theT=theT0;
32 }
double GeometricAnnealing::weight ( double  chi2) const
virtual

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

Implements AnnealingSchedule.

Definition at line 17 of file GeometricAnnealing.cc.

References edm::isNotFinite(), phi(), and theChi2cut.

Referenced by cuy.ValElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), and cuy.graphElement::__init__().

18 {
19  double mphi = phi ( chi2 );
20  long double newtmp = mphi / ( mphi + phi ( theChi2cut ) );
21  if ( edm::isNotFinite(newtmp) )
22  {
23  if ( chi2 < theChi2cut ) newtmp=1.;
24  else newtmp=0.;
25  }
26  return newtmp;
27 }
bool isNotFinite(T x)
Definition: isFinite.h:10
double phi(double chi2) const

Member Data Documentation

double GeometricAnnealing::theChi2cut
private

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().