CMS 3D CMS Logo

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 cmsRelvalreport::exit, edm::ParameterSet::getParameter(), and theImpl.

Referenced by clone().

9  :
10  theImpl( nullptr )
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 ( )
override

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

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
overridevirtual

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
overridevirtual

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
overridevirtual

Implements AnnealingSchedule.

Definition at line 76 of file ConfigurableAnnealing.cc.

References AnnealingSchedule::cutoff(), and theImpl.

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

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
overridevirtual

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
overridevirtual

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
inlineoverridevirtual

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__(), and ntupleDataFormat.Track::phiPull().

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

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
overridevirtual

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

Implements AnnealingSchedule.

Definition at line 61 of file ConfigurableAnnealing.cc.

References theImpl, and AnnealingSchedule::weight().

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

Member Data Documentation

AnnealingSchedule* ConfigurableAnnealing::theImpl
private