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