CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 () override
 
ConfigurableAnnealingclone () const override
 
 ConfigurableAnnealing (const edm::ParameterSet &)
 
 ConfigurableAnnealing (const ConfigurableAnnealing &)
 
double currentTemp () const override
 
double cutoff () const override
 
void debug () const override
 
double initialTemp () const override
 
bool isAnnealed () const override
 
double phi (double chi2) const override
 
void resetAnnealing () override
 
double weight (double chi2) const override
 
 ~ConfigurableAnnealing () override
 
- 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 beamvalidation::exit(), edm::ParameterSet::getParameter(), and theImpl.

Referenced by clone().

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

Definition at line 36 of file ConfigurableAnnealing.cc.

References theImpl.

36 { delete theImpl; }
AnnealingSchedule * theImpl
ConfigurableAnnealing::ConfigurableAnnealing ( const ConfigurableAnnealing o)

Definition at line 32 of file ConfigurableAnnealing.cc.

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

Member Function Documentation

void ConfigurableAnnealing::anneal ( )
overridevirtual

Implements AnnealingSchedule.

Definition at line 40 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::anneal(), and theImpl.

40 { theImpl->anneal(); }
AnnealingSchedule * theImpl
virtual void anneal()=0
ConfigurableAnnealing * ConfigurableAnnealing::clone ( void  ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 34 of file ConfigurableAnnealing.cc.

References ConfigurableAnnealing().

34 { return new ConfigurableAnnealing(*this); }
ConfigurableAnnealing(const edm::ParameterSet &)
double ConfigurableAnnealing::currentTemp ( ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 50 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::currentTemp(), and theImpl.

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

Implements AnnealingSchedule.

Definition at line 48 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::cutoff(), and theImpl.

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

Implements AnnealingSchedule.

Definition at line 38 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::debug(), and theImpl.

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

Implements AnnealingSchedule.

Definition at line 52 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::initialTemp(), and theImpl.

52 { return theImpl->initialTemp(); }
virtual double initialTemp() const =0
AnnealingSchedule * theImpl
bool ConfigurableAnnealing::isAnnealed ( ) const
overridevirtual

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

Implements AnnealingSchedule.

Definition at line 54 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::isAnnealed(), and theImpl.

54 { return theImpl->isAnnealed(); }
virtual bool isAnnealed() const =0
AnnealingSchedule * theImpl
double ConfigurableAnnealing::phi ( double  chi2) const
inlineoverridevirtual

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

Implements AnnealingSchedule.

Definition at line 46 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::phi(), and theImpl.

Referenced by Particle.Particle::__str__(), and ntupleDataFormat.Track::phiPull().

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

Implements AnnealingSchedule.

Definition at line 44 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::resetAnnealing(), and theImpl.

44 { theImpl->resetAnnealing(); }
AnnealingSchedule * theImpl
virtual void resetAnnealing()=0
double ConfigurableAnnealing::weight ( double  chi2) const
overridevirtual

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

Implements AnnealingSchedule.

Definition at line 42 of file ConfigurableAnnealing.cc.

References theImpl, and AnnealingSchedule::weight().

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

Member Data Documentation

AnnealingSchedule* ConfigurableAnnealing::theImpl
private