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 ConfigurableAnnealing &)
 
 ConfigurableAnnealing (const edm::ParameterSet &)
 
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.

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 }

References beamvalidation::exit(), visualization-live-secondInstance_cfg::m, and theImpl.

Referenced by clone().

◆ ~ConfigurableAnnealing()

ConfigurableAnnealing::~ConfigurableAnnealing ( )
override

Definition at line 36 of file ConfigurableAnnealing.cc.

36 { delete theImpl; }

References theImpl.

◆ ConfigurableAnnealing() [2/2]

ConfigurableAnnealing::ConfigurableAnnealing ( const ConfigurableAnnealing o)

Definition at line 32 of file ConfigurableAnnealing.cc.

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

Member Function Documentation

◆ anneal()

void ConfigurableAnnealing::anneal ( )
overridevirtual

Implements AnnealingSchedule.

Definition at line 40 of file ConfigurableAnnealing.cc.

40 { theImpl->anneal(); }

References AnnealingSchedule::anneal(), and theImpl.

◆ clone()

ConfigurableAnnealing * ConfigurableAnnealing::clone ( void  ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 34 of file ConfigurableAnnealing.cc.

34 { return new ConfigurableAnnealing(*this); }

References ConfigurableAnnealing().

◆ currentTemp()

double ConfigurableAnnealing::currentTemp ( ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 50 of file ConfigurableAnnealing.cc.

50 { return theImpl->currentTemp(); }

References AnnealingSchedule::currentTemp(), and theImpl.

◆ cutoff()

double ConfigurableAnnealing::cutoff ( ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 48 of file ConfigurableAnnealing.cc.

48 { return theImpl->cutoff(); }

References AnnealingSchedule::cutoff(), and theImpl.

◆ debug()

void ConfigurableAnnealing::debug ( ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 38 of file ConfigurableAnnealing.cc.

38 { theImpl->debug(); }

References AnnealingSchedule::debug(), and theImpl.

◆ initialTemp()

double ConfigurableAnnealing::initialTemp ( ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 52 of file ConfigurableAnnealing.cc.

52 { return theImpl->initialTemp(); }

References AnnealingSchedule::initialTemp(), and 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.

54 { return theImpl->isAnnealed(); }

References AnnealingSchedule::isAnnealed(), and 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.

46 { return theImpl->phi(chi2); }

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

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

◆ resetAnnealing()

void ConfigurableAnnealing::resetAnnealing ( )
overridevirtual

Implements AnnealingSchedule.

Definition at line 44 of file ConfigurableAnnealing.cc.

44 { theImpl->resetAnnealing(); }

References AnnealingSchedule::resetAnnealing(), and theImpl.

◆ 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.

42 { return theImpl->weight(chi2); }

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

Member Data Documentation

◆ theImpl

AnnealingSchedule* ConfigurableAnnealing::theImpl
private
AnnealingSchedule::isAnnealed
virtual bool isAnnealed() const =0
AnnealingSchedule::initialTemp
virtual double initialTemp() const =0
DeterministicAnnealing
Definition: DeterministicAnnealing.h:7
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
AnnealingSchedule::phi
virtual double phi(double chi2) const =0
AnnealingSchedule::currentTemp
virtual double currentTemp() const =0
ConfigurableAnnealing::ConfigurableAnnealing
ConfigurableAnnealing(const edm::ParameterSet &)
Definition: ConfigurableAnnealing.cc:9
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
AnnealingSchedule::debug
virtual void debug() const =0
GeometricAnnealing
Definition: GeometricAnnealing.h:7
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
ConfigurableAnnealing::theImpl
AnnealingSchedule * theImpl
Definition: ConfigurableAnnealing.h:31
AnnealingSchedule::weight
virtual double weight(double chi2) const =0
AnnealingSchedule::anneal
virtual void anneal()=0
AnnealingSchedule::cutoff
virtual double cutoff() const =0
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:52
AnnealingSchedule::resetAnnealing
virtual void resetAnnealing()=0