CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GeometricAnnealing Class Reference

#include <GeometricAnnealing.h>

Inheritance diagram for GeometricAnnealing:
AnnealingSchedule DefaultMVFAnnealing

Public Member Functions

void anneal () override
 
GeometricAnnealingclone () const override
 
double currentTemp () const override
 
double cutoff () const override
 
void debug () const override
 
 GeometricAnnealing (const double cutoff=3.0, const double T=256.0, const double annealing_ratio=0.25)
 
double initialTemp () const override
 
bool isAnnealed () const override
 
double phi (double chi2) const override
 
void resetAnnealing () override
 
double weight (double chi2) const override
 
- Public Member Functions inherited from AnnealingSchedule
virtual ~AnnealingSchedule ()
 

Private Attributes

double theChi2cut
 
double theRatio
 
double theT
 
double theT0
 

Detailed Description

Definition at line 7 of file GeometricAnnealing.h.

Constructor & Destructor Documentation

◆ GeometricAnnealing()

GeometricAnnealing::GeometricAnnealing ( const double  cutoff = 3.0,
const double  T = 256.0,
const double  annealing_ratio = 0.25 
)

Definition at line 7 of file GeometricAnnealing.cc.

Member Function Documentation

◆ anneal()

void GeometricAnnealing::anneal ( )
overridevirtual

Implements AnnealingSchedule.

Definition at line 10 of file GeometricAnnealing.cc.

10 { theT = 1 + (theT - 1) * theRatio; }

References theRatio, and theT.

◆ clone()

GeometricAnnealing* GeometricAnnealing::clone ( void  ) const
inlineoverridevirtual

Implements AnnealingSchedule.

Definition at line 42 of file GeometricAnnealing.h.

42 { return new GeometricAnnealing(*this); };

◆ currentTemp()

double GeometricAnnealing::currentTemp ( ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 33 of file GeometricAnnealing.cc.

33 { return theT; }

References theT.

◆ cutoff()

double GeometricAnnealing::cutoff ( ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 28 of file GeometricAnnealing.cc.

28  {
29  // std::cout << "[GeometricAnnealing] cutoff called!" << std::endl;
30  return sqrt(theChi2cut);
31 }

References mathSSE::sqrt(), and theChi2cut.

◆ debug()

void GeometricAnnealing::debug ( ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 39 of file GeometricAnnealing.cc.

39  {
40  std::cout << "[GeometricAnnealing] chi2_cut=" << theChi2cut << ", Tini=" << theT0 << ", ratio=" << theRatio
41  << std::endl;
42 }

References gather_cfg::cout, theChi2cut, theRatio, and theT0.

◆ initialTemp()

double GeometricAnnealing::initialTemp ( ) const
overridevirtual

Implements AnnealingSchedule.

Definition at line 35 of file GeometricAnnealing.cc.

35 { return theT0; }

References theT0.

◆ isAnnealed()

bool GeometricAnnealing::isAnnealed ( ) const
overridevirtual

is it annealed yet?

Implements AnnealingSchedule.

Definition at line 37 of file GeometricAnnealing.cc.

37 { return (theT < 1.02); }

References theT.

◆ phi()

double GeometricAnnealing::phi ( double  chi2) const
overridevirtual

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

Implements AnnealingSchedule.

Definition at line 26 of file GeometricAnnealing.cc.

26 { return exp(-.5 * chi2 / theT); }

References hltPixelTracks_cff::chi2, JetChargeProducer_cfi::exp, and theT.

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

◆ resetAnnealing()

void GeometricAnnealing::resetAnnealing ( )
overridevirtual

Implements AnnealingSchedule.

Definition at line 24 of file GeometricAnnealing.cc.

24 { theT = theT0; }

References theT, and theT0.

◆ weight()

double GeometricAnnealing::weight ( double  chi2) const
overridevirtual

Returns phi(chi2) / ( phi(cutoff^2) + phi(chi2) ),

Implements AnnealingSchedule.

Definition at line 12 of file GeometricAnnealing.cc.

12  {
13  double mphi = phi(chi2);
14  long double newtmp = mphi / (mphi + phi(theChi2cut));
15  if (edm::isNotFinite(newtmp)) {
16  if (chi2 < theChi2cut)
17  newtmp = 1.;
18  else
19  newtmp = 0.;
20  }
21  return newtmp;
22 }

References hltPixelTracks_cff::chi2, edm::isNotFinite(), phi(), and theChi2cut.

Member Data Documentation

◆ theChi2cut

double GeometricAnnealing::theChi2cut
private

Definition at line 47 of file GeometricAnnealing.h.

Referenced by cutoff(), debug(), and weight().

◆ theRatio

double GeometricAnnealing::theRatio
private

Definition at line 48 of file GeometricAnnealing.h.

Referenced by anneal(), and debug().

◆ theT

double GeometricAnnealing::theT
private

Definition at line 46 of file GeometricAnnealing.h.

Referenced by anneal(), currentTemp(), isAnnealed(), phi(), and resetAnnealing().

◆ theT0

double GeometricAnnealing::theT0
private

Definition at line 42 of file GeometricAnnealing.h.

Referenced by debug(), initialTemp(), and resetAnnealing().

edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
gather_cfg.cout
cout
Definition: gather_cfg.py:144
GeometricAnnealing::theT0
double theT0
Definition: GeometricAnnealing.h:42
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
GeometricAnnealing::GeometricAnnealing
GeometricAnnealing(const double cutoff=3.0, const double T=256.0, const double annealing_ratio=0.25)
Definition: GeometricAnnealing.cc:7
GeometricAnnealing::phi
double phi(double chi2) const override
Definition: GeometricAnnealing.cc:26
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
GeometricAnnealing::theChi2cut
double theChi2cut
Definition: GeometricAnnealing.h:47
particleFlowDisplacedVertex_cfi.ratio
ratio
Definition: particleFlowDisplacedVertex_cfi.py:93
GeometricAnnealing::cutoff
double cutoff() const override
Definition: GeometricAnnealing.cc:28
T
long double T
Definition: Basic3DVectorLD.h:48
GeometricAnnealing::theRatio
double theRatio
Definition: GeometricAnnealing.h:48
GeometricAnnealing::theT
double theT
Definition: GeometricAnnealing.h:46
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6