CMS 3D CMS Logo

Public Member Functions | Private Attributes

ConfigurableAnnealing Class Reference

#include <ConfigurableAnnealing.h>

Inheritance diagram for ConfigurableAnnealing:
AnnealingSchedule

List of all members.

Public Member Functions

void anneal ()
ConfigurableAnnealingclone () const
 ConfigurableAnnealing (const edm::ParameterSet &)
 ConfigurableAnnealing (const ConfigurableAnnealing &)
double currentTemp () const
double cutoff () const
void debug () const
double initialTemp () const
bool isAnnealed () const
double phi (double chi2) const
void resetAnnealing ()
double weight (double chi2) const
 ~ConfigurableAnnealing ()

Private Attributes

AnnealingScheduletheImpl

Detailed Description

Definition at line 8 of file ConfigurableAnnealing.h.


Constructor & Destructor Documentation

ConfigurableAnnealing::ConfigurableAnnealing ( const edm::ParameterSet m)

An annealing schedule that is completely configurable via edm::ParameterSet

Definition at line 9 of file ConfigurableAnnealing.cc.

References cmsRelvalreport::exit, edm::ParameterSet::getParameter(), and theImpl.

Referenced by clone().

                                                                         :
  theImpl( 0 )
{
  string type = m.getParameter<string>("annealing");
  // edm::LogWarning("ConfigurableAnnealing") << "below one code ist still here.";
  if ( type == "below" )
  {
    edm::LogError("ConfigurableAnnealing") << "below one annealing employed!";
    vector < float > sched;
    double final = m.getParameter<double>("Tfinal");
    sched.push_back ( 256. );
    sched.push_back ( 64. );
    sched.push_back ( 16. );
    sched.push_back ( 4. );
    sched.push_back ( 1. );
    sched.push_back ( final );
    theImpl = new DeterministicAnnealing( sched, m.getParameter<double>("sigmacut"));
  } else if ( type =="geom" ) {
    theImpl = new GeometricAnnealing(
                    m.getParameter<double>("sigmacut"),
                    m.getParameter<double>("Tini"),
                    m.getParameter<double>("ratio") );
  } else {
    edm::LogError("ConfigurableAnnealing") << "annealing type " << type << " is not known.";
    exit(-1);
  }
}
ConfigurableAnnealing::~ConfigurableAnnealing ( )

Definition at line 46 of file ConfigurableAnnealing.cc.

References theImpl.

{
  delete theImpl;
}
ConfigurableAnnealing::ConfigurableAnnealing ( const ConfigurableAnnealing o)

Definition at line 37 of file ConfigurableAnnealing.cc.

                                                                               :
  theImpl ( o.theImpl->clone() )
{}

Member Function Documentation

void ConfigurableAnnealing::anneal ( ) [virtual]

Implements AnnealingSchedule.

Definition at line 56 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::anneal(), and theImpl.

{
  theImpl->anneal();
}
ConfigurableAnnealing * ConfigurableAnnealing::clone ( void  ) const [virtual]

Implements AnnealingSchedule.

Definition at line 41 of file ConfigurableAnnealing.cc.

References ConfigurableAnnealing().

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

Implements AnnealingSchedule.

Definition at line 81 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::currentTemp(), and theImpl.

{
  return theImpl->currentTemp();
}
double ConfigurableAnnealing::cutoff ( ) const [virtual]

Implements AnnealingSchedule.

Definition at line 76 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::cutoff(), and theImpl.

{
  return theImpl->cutoff();
}
void ConfigurableAnnealing::debug ( ) const [virtual]

Implements AnnealingSchedule.

Definition at line 51 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::debug(), and theImpl.

{
  theImpl->debug();
}
double ConfigurableAnnealing::initialTemp ( ) const [virtual]

Implements AnnealingSchedule.

Definition at line 86 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::initialTemp(), and theImpl.

{
  return theImpl->initialTemp();
}
bool ConfigurableAnnealing::isAnnealed ( ) const [virtual]

Returns phi(chi2) / ( phi(cutoff^2) + sum_i { phi(chi2s[i]) } ) is it annealed yet?

Implements AnnealingSchedule.

Definition at line 91 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::isAnnealed(), and theImpl.

{
  return theImpl->isAnnealed();
}
double ConfigurableAnnealing::phi ( double  chi2) const [inline, virtual]

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

Implements AnnealingSchedule.

Definition at line 71 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::phi(), and theImpl.

{
  return theImpl->phi ( chi2 );
}
void ConfigurableAnnealing::resetAnnealing ( ) [virtual]

Implements AnnealingSchedule.

Definition at line 66 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::resetAnnealing(), and theImpl.

double ConfigurableAnnealing::weight ( double  chi2) const [virtual]

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

Implements AnnealingSchedule.

Definition at line 61 of file ConfigurableAnnealing.cc.

References theImpl, and AnnealingSchedule::weight().

{
  return theImpl->weight ( chi2 );
}

Member Data Documentation