CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ConfigurableAnnealing.cc
Go to the documentation of this file.
5 #include <string>
6 
7 using namespace std;
8 
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 }
36 
38  theImpl ( o.theImpl->clone() )
39 {}
40 
42 {
43  return new ConfigurableAnnealing ( *this );
44 }
45 
47 {
48  delete theImpl;
49 }
50 
52 {
53  theImpl->debug();
54 }
55 
57 {
58  theImpl->anneal();
59 }
60 
61 double ConfigurableAnnealing::weight ( double chi2 ) const
62 {
63  return theImpl->weight ( chi2 );
64 }
65 
67 {
69 }
70 
71 inline double ConfigurableAnnealing::phi( double chi2 ) const
72 {
73  return theImpl->phi ( chi2 );
74 }
75 
77 {
78  return theImpl->cutoff();
79 }
80 
82 {
83  return theImpl->currentTemp();
84 }
85 
87 {
88  return theImpl->initialTemp();
89 }
90 
92 {
93  return theImpl->isAnnealed();
94 }
virtual bool isAnnealed() const =0
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
double weight(double chi2) const
virtual double initialTemp() const =0
virtual double phi(double chi2) const =0
virtual void debug() const =0
virtual double currentTemp() const =0
double phi(double chi2) const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
ConfigurableAnnealing(const edm::ParameterSet &)
AnnealingSchedule * theImpl
ConfigurableAnnealing * clone() const
virtual void anneal()=0
virtual void resetAnnealing()=0
virtual double cutoff() const =0
virtual double weight(double chi2) const =0