Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:23:17

0001 #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableAnnealing.h"
0002 #include "RecoVertex/VertexTools/interface/GeometricAnnealing.h"
0003 #include "RecoVertex/VertexTools/interface/DeterministicAnnealing.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 #include <string>
0006 
0007 using namespace std;
0008 
0009 ConfigurableAnnealing::ConfigurableAnnealing(const edm::ParameterSet& m) : theImpl(nullptr) {
0010   string type = m.getParameter<string>("annealing");
0011   // edm::LogWarning("ConfigurableAnnealing") << "below one code ist still here.";
0012   if (type == "below") {
0013     edm::LogError("ConfigurableAnnealing") << "below one annealing employed!";
0014     vector<float> sched;
0015     double final = m.getParameter<double>("Tfinal");
0016     sched.push_back(256.);
0017     sched.push_back(64.);
0018     sched.push_back(16.);
0019     sched.push_back(4.);
0020     sched.push_back(1.);
0021     sched.push_back(final);
0022     theImpl = new DeterministicAnnealing(sched, m.getParameter<double>("sigmacut"));
0023   } else if (type == "geom") {
0024     theImpl = new GeometricAnnealing(
0025         m.getParameter<double>("sigmacut"), m.getParameter<double>("Tini"), m.getParameter<double>("ratio"));
0026   } else {
0027     edm::LogError("ConfigurableAnnealing") << "annealing type " << type << " is not known.";
0028     exit(-1);
0029   }
0030 }
0031 
0032 ConfigurableAnnealing::ConfigurableAnnealing(const ConfigurableAnnealing& o) : theImpl(o.theImpl->clone()) {}
0033 
0034 ConfigurableAnnealing* ConfigurableAnnealing::clone() const { return new ConfigurableAnnealing(*this); }
0035 
0036 ConfigurableAnnealing::~ConfigurableAnnealing() { delete theImpl; }
0037 
0038 void ConfigurableAnnealing::debug() const { theImpl->debug(); }
0039 
0040 void ConfigurableAnnealing::anneal() { theImpl->anneal(); }
0041 
0042 double ConfigurableAnnealing::weight(double chi2) const { return theImpl->weight(chi2); }
0043 
0044 void ConfigurableAnnealing::resetAnnealing() { theImpl->resetAnnealing(); }
0045 
0046 inline double ConfigurableAnnealing::phi(double chi2) const { return theImpl->phi(chi2); }
0047 
0048 double ConfigurableAnnealing::cutoff() const { return theImpl->cutoff(); }
0049 
0050 double ConfigurableAnnealing::currentTemp() const { return theImpl->currentTemp(); }
0051 
0052 double ConfigurableAnnealing::initialTemp() const { return theImpl->initialTemp(); }
0053 
0054 bool ConfigurableAnnealing::isAnnealed() const { return theImpl->isAnnealed(); }