test
CMS 3D CMS Logo

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

#include <ConfigurableAnnealing.h>

Inheritance diagram for ConfigurableAnnealing:
AnnealingSchedule

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

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

9  :
10  theImpl( 0 )
11 {
12  string type = m.getParameter<string>("annealing");
13  // edm::LogWarning("ConfigurableAnnealing") << "below one code ist still here.";
14  if ( type == "below" )
15  {
16  edm::LogError("ConfigurableAnnealing") << "below one annealing employed!";
17  vector < float > sched;
18  double final = m.getParameter<double>("Tfinal");
19  sched.push_back ( 256. );
20  sched.push_back ( 64. );
21  sched.push_back ( 16. );
22  sched.push_back ( 4. );
23  sched.push_back ( 1. );
24  sched.push_back ( final );
25  theImpl = new DeterministicAnnealing( sched, m.getParameter<double>("sigmacut"));
26  } else if ( type =="geom" ) {
28  m.getParameter<double>("sigmacut"),
29  m.getParameter<double>("Tini"),
30  m.getParameter<double>("ratio") );
31  } else {
32  edm::LogError("ConfigurableAnnealing") << "annealing type " << type << " is not known.";
33  exit(-1);
34  }
35 }
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
AnnealingSchedule * theImpl
ConfigurableAnnealing::~ConfigurableAnnealing ( )

Definition at line 46 of file ConfigurableAnnealing.cc.

References theImpl.

47 {
48  delete theImpl;
49 }
AnnealingSchedule * theImpl
ConfigurableAnnealing::ConfigurableAnnealing ( const ConfigurableAnnealing o)

Definition at line 37 of file ConfigurableAnnealing.cc.

37  :
38  theImpl ( o.theImpl->clone() )
39 {}
virtual AnnealingSchedule * clone() const =0
AnnealingSchedule * theImpl

Member Function Documentation

void ConfigurableAnnealing::anneal ( )
virtual

Implements AnnealingSchedule.

Definition at line 56 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::anneal(), and theImpl.

57 {
58  theImpl->anneal();
59 }
AnnealingSchedule * theImpl
virtual void anneal()=0
ConfigurableAnnealing * ConfigurableAnnealing::clone ( void  ) const
virtual

Implements AnnealingSchedule.

Definition at line 41 of file ConfigurableAnnealing.cc.

References ConfigurableAnnealing().

42 {
43  return new ConfigurableAnnealing ( *this );
44 }
ConfigurableAnnealing(const edm::ParameterSet &)
double ConfigurableAnnealing::currentTemp ( ) const
virtual

Implements AnnealingSchedule.

Definition at line 81 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::currentTemp(), and theImpl.

82 {
83  return theImpl->currentTemp();
84 }
virtual double currentTemp() const =0
AnnealingSchedule * theImpl
double ConfigurableAnnealing::cutoff ( ) const
virtual

Implements AnnealingSchedule.

Definition at line 76 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::cutoff(), and theImpl.

77 {
78  return theImpl->cutoff();
79 }
AnnealingSchedule * theImpl
virtual double cutoff() const =0
void ConfigurableAnnealing::debug ( ) const
virtual

Implements AnnealingSchedule.

Definition at line 51 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::debug(), and theImpl.

52 {
53  theImpl->debug();
54 }
virtual void debug() const =0
AnnealingSchedule * theImpl
double ConfigurableAnnealing::initialTemp ( ) const
virtual

Implements AnnealingSchedule.

Definition at line 86 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::initialTemp(), and theImpl.

87 {
88  return theImpl->initialTemp();
89 }
virtual double initialTemp() const =0
AnnealingSchedule * theImpl
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.

92 {
93  return theImpl->isAnnealed();
94 }
virtual bool isAnnealed() const =0
AnnealingSchedule * theImpl
double ConfigurableAnnealing::phi ( double  chi2) const
inlinevirtual

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

Implements AnnealingSchedule.

Definition at line 71 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::phi(), and theImpl.

Referenced by Particle.Particle::__str__().

72 {
73  return theImpl->phi ( chi2 );
74 }
virtual double phi(double chi2) const =0
AnnealingSchedule * theImpl
void ConfigurableAnnealing::resetAnnealing ( )
virtual

Implements AnnealingSchedule.

Definition at line 66 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::resetAnnealing(), and theImpl.

67 {
69 }
AnnealingSchedule * theImpl
virtual void resetAnnealing()=0
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().

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

62 {
63  return theImpl->weight ( chi2 );
64 }
AnnealingSchedule * theImpl
virtual double weight(double chi2) const =0

Member Data Documentation

AnnealingSchedule* ConfigurableAnnealing::theImpl
private