#include <DipzLikelihoodCmp.h>
Definition at line 40 of file DipzLikelihoodCmp.h.
◆ DipzLikelihood()
| DipzLikelihood::DipzLikelihood |
( |
const std::string & | decName_z, |
|
|
const std::string & | decName_negLogSigma2 ) |
Definition at line 11 of file DipzLikelihoodCmp.cxx.
12 :
15}
const std::string m_decName_z
const std::string m_decName_negLogSigma2
◆ ~DipzLikelihood()
| DipzLikelihood::~DipzLikelihood |
( |
| ) |
|
|
default |
◆ calcDenom()
| double DipzLikelihood::calcDenom |
( |
double | acmlt, |
|
|
const pHypoJet & | ip ) const |
|
private |
Definition at line 54 of file DipzLikelihoodCmp.cxx.
54 {
55 double sigma_squared =
57
59
60 return acml + oneoversigmasq;
61}
double checkedRatio(double num, double den) const
double getDipzMLPLDecValue(const pHypoJet &ip, const std::string &decName) const
◆ calcLogTerm()
| double DipzLikelihood::calcLogTerm |
( |
double | acmlt, |
|
|
const pHypoJet & | ip, |
|
|
double | zhat ) const |
|
private |
Definition at line 63 of file DipzLikelihoodCmp.cxx.
65 {
66
68
69 double dipz_negLogSigmaSq =
71
72 double sigma_squared = std::exp(-1 * dipz_negLogSigmaSq);
73
74 double logterm =
75 -0.5 * std::log(2.0 *
M_PI)
76 + 0.5 * dipz_negLogSigmaSq
77 -
checkedRatio(std::pow(zhat - dipz_mu, 2), (2.0 * sigma_squared) );
78
79 return acml + logterm;
80
81}
◆ calcNum()
| double DipzLikelihood::calcNum |
( |
double | acmlt, |
|
|
const pHypoJet & | ip ) const |
|
private |
Definition at line 42 of file DipzLikelihoodCmp.cxx.
42 {
43
44 double sigma_squared =
46
47 double muoversigmasq =
49
50 return acml + muoversigmasq;
51}
◆ checkedRatio()
| double DipzLikelihood::checkedRatio |
( |
double | num, |
|
|
double | den ) const |
|
private |
Definition at line 17 of file DipzLikelihoodCmp.cxx.
17 {
18 if (den == 0.) {
19
20
21 throw std::runtime_error("DipzLikelihood::checkedRatio dividing by 0");
22 }
23
25}
◆ getDipzMLPLDecValue()
| double DipzLikelihood::getDipzMLPLDecValue |
( |
const pHypoJet & | ip, |
|
|
const std::string & | decName ) const |
|
private |
Definition at line 27 of file DipzLikelihoodCmp.cxx.
29{
30
31 float momentValue;
32 if (!(
ip->getAttribute(decName, momentValue))) {
33 throw std::runtime_error("Impossible to retrieve decorator \'" +
34 decName + "\' for jet hypo");
35 }
36
37
38
39 return momentValue;
40}
◆ operator()()
| double DipzLikelihood::operator() |
( |
const HypoJetVector & | ips | ) |
const |
Definition at line 84 of file DipzLikelihoodCmp.cxx.
84 {
85
86 auto zhat_num = std::accumulate(ips.begin(),
87 ips.end(),
88 0.0,
89 [
this](
double sum,
const pHypoJet& jp) {
90 return this->calcNum(sum, jp);});
91
92 auto zhat_den = std::accumulate(ips.begin(),
93 ips.end(),
94 0.0,
95 [
this](
double sum,
const pHypoJet& jp) {
96 return this->calcDenom(sum, jp);});
97
99
100 auto logproduct =
101 std::accumulate(ips.begin(),
102 ips.end(),
103 0.0,
104 [&zhat,
this](
double sum,
const pHypoJet& jp) {
105 return this->calcLogTerm(sum, jp, zhat);});
106
107 return logproduct;
108}
std::shared_ptr< const HypoJet::IJet > pHypoJet
◆ m_decName_negLogSigma2
| const std::string DipzLikelihood::m_decName_negLogSigma2 |
|
private |
◆ m_decName_z
| const std::string DipzLikelihood::m_decName_z |
|
private |
The documentation for this class was generated from the following files: