Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
RecoVertex
VertexTools
src
GeometricAnnealing.cc
Go to the documentation of this file.
1
#include "
RecoVertex/VertexTools/interface/GeometricAnnealing.h
"
2
#include <cmath>
3
#include <iostream>
4
#include <limits>
5
6
GeometricAnnealing::GeometricAnnealing
(
7
const
double
cutoff
,
const
double
T
,
const
double
ratio ) :
8
theT0(T), theT(T), theChi2cut(cutoff*cutoff), theRatio( ratio )
9
{}
10
11
void
GeometricAnnealing::anneal
()
12
{
13
theT
=1+(
theT
-1)*
theRatio
;
14
}
15
16
double
GeometricAnnealing::weight
(
double
chi2 )
const
17
{
18
double
mphi =
phi
( chi2 );
19
long
double
newtmp = mphi / ( mphi +
phi
(
theChi2cut
) );
20
if
( std::isinf(newtmp) )
21
{
22
if
( chi2 <
theChi2cut
) newtmp=1.;
23
else
newtmp=0.;
24
}
25
return
newtmp;
26
}
27
28
void
GeometricAnnealing::resetAnnealing
()
29
{
30
theT
=
theT0
;
31
}
32
33
double
GeometricAnnealing::phi
(
double
chi2 )
const
34
{
35
return
exp
( -.5 * chi2 /
theT
);
36
}
37
38
double
GeometricAnnealing::cutoff
()
const
39
{
40
// std::cout << "[GeometricAnnealing] cutoff called!" << std::endl;
41
return
sqrt
(
theChi2cut
);
42
}
43
44
double
GeometricAnnealing::currentTemp
()
const
45
{
46
return
theT
;
47
}
48
49
double
GeometricAnnealing::initialTemp
()
const
50
{
51
return
theT0
;
52
}
53
54
bool
GeometricAnnealing::isAnnealed
()
const
55
{
56
return
(
theT
< 1.02 );
57
}
58
59
void
GeometricAnnealing::debug
()
const
60
{
61
std::cout
<<
"[GeometricAnnealing] chi2_cut="
<<
theChi2cut
<<
", Tini="
62
<<
theT0
<<
", ratio="
<<
theRatio
<< std::endl;
63
}
GeometricAnnealing::anneal
void anneal()
Definition:
GeometricAnnealing.cc:11
GeometricAnnealing::theT
double theT
Definition:
GeometricAnnealing.h:52
create_public_lumi_plots.exp
tuple exp
Definition:
create_public_lumi_plots.py:1104
GeometricAnnealing::debug
void debug() const
Definition:
GeometricAnnealing.cc:59
GeometricAnnealing::cutoff
double cutoff() const
Definition:
GeometricAnnealing.cc:38
GeometricAnnealing::resetAnnealing
void resetAnnealing()
Definition:
GeometricAnnealing.cc:28
GeometricAnnealing::theRatio
double theRatio
Definition:
GeometricAnnealing.h:54
GeometricAnnealing.h
GeometricAnnealing::weight
double weight(double chi2) const
Definition:
GeometricAnnealing.cc:16
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:48
GeometricAnnealing::GeometricAnnealing
GeometricAnnealing(const double cutoff=3.0, const double T=256.0, const double annealing_ratio=0.25)
Definition:
GeometricAnnealing.cc:6
GeometricAnnealing::phi
double phi(double chi2) const
Definition:
GeometricAnnealing.cc:33
prof2calltree.cutoff
tuple cutoff
Definition:
prof2calltree.py:22
GeometricAnnealing::theT0
double theT0
Definition:
GeometricAnnealing.h:48
GeometricAnnealing::isAnnealed
bool isAnnealed() const
Definition:
GeometricAnnealing.cc:54
GeometricAnnealing::initialTemp
double initialTemp() const
Definition:
GeometricAnnealing.cc:49
GeometricAnnealing::currentTemp
double currentTemp() const
Definition:
GeometricAnnealing.cc:44
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:121
T
long double T
Definition:
Basic3DVectorLD.h:59
GeometricAnnealing::theChi2cut
double theChi2cut
Definition:
GeometricAnnealing.h:53
Generated for CMSSW Reference Manual by
1.8.5