Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:24

0001 #ifndef GeometricAnnealing_H
0002 #define GeometricAnnealing_H
0003 
0004 #include "RecoVertex/VertexTools/interface/AnnealingSchedule.h"
0005 #include <vector>
0006 
0007 class GeometricAnnealing : public AnnealingSchedule {
0008 public:
0009   /**
0010    *  \class GeometricAnnealing.
0011    *  A very simple class that returns the association probabilty of a (any)
0012    *  chi2 value, given a cutoff (as a "sigma"), a temperature, and (optionally used) an
0013    *  annealing ratio ( geometric annealing ).
0014    */
0015 
0016   GeometricAnnealing(const double cutoff = 3.0, const double T = 256.0, const double annealing_ratio = 0.25);
0017 
0018   void anneal() override;          //< One annealing step. theT *= theRatio.
0019   void resetAnnealing() override;  //< theT = theT0.
0020 
0021   /**
0022    *  phi ( chi2 ) = e^( -.5 * chi2 / T )
0023    */
0024   double phi(double chi2) const override;
0025 
0026   /**
0027    *  Returns phi(chi2) / ( phi(cutoff^2) + phi(chi2) ),
0028    */
0029   double weight(double chi2) const override;
0030 
0031   double cutoff() const override;
0032   double currentTemp() const override;
0033   double initialTemp() const override;
0034 
0035   /**
0036    * is it annealed yet?
0037    */
0038   bool isAnnealed() const override;
0039 
0040   void debug() const override;
0041 
0042   GeometricAnnealing* clone() const override { return new GeometricAnnealing(*this); };
0043 
0044 private:
0045   double theT0;
0046   double theT;
0047   double theChi2cut;
0048   double theRatio;
0049 };
0050 
0051 #endif