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() [1/2]

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(), visualization-live-secondInstance_cfg::m, 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
AnnealingSchedule * theImpl
def exit(msg="")

◆ ~ConfigurableAnnealing()

ConfigurableAnnealing::~ConfigurableAnnealing ( )
override

Definition at line 36 of file ConfigurableAnnealing.cc.

References theImpl.

36 { delete theImpl; }
AnnealingSchedule * theImpl

◆ ConfigurableAnnealing() [2/2]

ConfigurableAnnealing::ConfigurableAnnealing ( const ConfigurableAnnealing o)

Definition at line 32 of file ConfigurableAnnealing.cc.

32 : theImpl(o.theImpl->clone()) {}
AnnealingSchedule * theImpl

Member Function Documentation

◆ anneal()

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

◆ clone()

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 &)

◆ currentTemp()

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

◆ cutoff()

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

◆ debug()

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

◆ initialTemp()

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

◆ isAnnealed()

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

◆ phi()

double ConfigurableAnnealing::phi ( double  chi2) const
inlineoverridevirtual

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

Implements AnnealingSchedule.

Definition at line 46 of file ConfigurableAnnealing.cc.

References hltPixelTracks_cff::chi2, AnnealingSchedule::phi(), and theImpl.

Referenced by Particle.Particle::__str__(), datamodel.Object::DeltaR(), datamodel.Object::p4(), and ntupleDataFormat.Track::phiPull().

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

◆ resetAnnealing()

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

◆ weight()

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 hltPixelTracks_cff::chi2, theImpl, and AnnealingSchedule::weight().

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

Member Data Documentation

◆ theImpl

AnnealingSchedule* ConfigurableAnnealing::theImpl
private