MINT2
Mint
Neg2LLConstraint.h
Go to the documentation of this file.
1
#ifndef NEG_TWO_LL_Constraint_HH
2
#define NEG_TWO_LL_Constraint_HH
3
// author: Philippe d'Argent (p.dargent@cern.ch)
4
5
#include "TMath.h"
6
#include "
Mint/Minimisable.h
"
7
#include "
Mint/Neg2LLConstraint.h
"
8
9
#include <vector>
10
11
namespace
MINT
{
12
13
class
Neg2LLConstraint
:
public
Minimisable
{
14
protected
:
15
IMinuitParameter
*
_mp
;
16
double
_mean
;
17
double
_sigma
;
18
19
public
:
20
Neg2LLConstraint
(
IMinuitParameter
* mp,
double
mean,
double
sigma,
MinuitParameterSet
* mps=0)
21
:
Minimisable
(mps),
_mp
(mp),
_mean
(mean),
_sigma
(sigma) {};
22
23
virtual
void
beginFit
(){};
24
virtual
void
parametersChanged
(){};
25
virtual
void
endFit
(){};
26
27
virtual
double
getVal
(){
28
if
(0 ==
_sigma
)
return
0;
29
double
d=((double) *(
_mp
) -
_mean
)/
_sigma
;
30
return
d*d;
31
//return -2.* log(gauss((double) *(_mp)) );
32
}
33
34
virtual
double
getNewVal
(){
35
parametersChanged
();
36
return
getVal
();
37
}
38
39
inline
double
gauss
(
double
x){
40
if
(0 ==
_sigma
)
return
0;
41
double
d=(x-
_mean
)/
_sigma
;
42
double
n=1./(sqrt(2.0*TMath::Pi())*
_sigma
);
43
return
n * exp(-0.5*d*d);
44
}
45
46
virtual
~Neg2LLConstraint
(){}
47
48
};
49
50
}
// namespace MINT
51
#endif
52
//
MINT::Neg2LLConstraint::~Neg2LLConstraint
virtual ~Neg2LLConstraint()
Definition:
Neg2LLConstraint.h:46
MINT::Neg2LLConstraint::_mp
IMinuitParameter * _mp
Definition:
Neg2LLConstraint.h:15
MINT::Neg2LLConstraint::beginFit
virtual void beginFit()
Definition:
Neg2LLConstraint.h:23
MINT::Neg2LLConstraint
Definition:
Neg2LLConstraint.h:13
MINT::MinuitParameterSet
Definition:
MinuitParameterSet.h:20
Neg2LLConstraint.h
MINT::Neg2LLConstraint::_sigma
double _sigma
Definition:
Neg2LLConstraint.h:17
MINT::Neg2LLConstraint::Neg2LLConstraint
Neg2LLConstraint(IMinuitParameter *mp, double mean, double sigma, MinuitParameterSet *mps=0)
Definition:
Neg2LLConstraint.h:20
MINT::IMinuitParameter
Definition:
IMinuitParameter.h:14
MINT::Minimisable
Definition:
Minimisable.h:10
MINT::Neg2LLConstraint::getNewVal
virtual double getNewVal()
Definition:
Neg2LLConstraint.h:34
MINT::Neg2LLConstraint::endFit
virtual void endFit()
Definition:
Neg2LLConstraint.h:25
MINT::Neg2LLConstraint::getVal
virtual double getVal()
Definition:
Neg2LLConstraint.h:27
MINT::Neg2LLConstraint::parametersChanged
virtual void parametersChanged()
Definition:
Neg2LLConstraint.h:24
MINT
Definition:
BasicComplex.h:7
MINT::Neg2LLConstraint::gauss
double gauss(double x)
Definition:
Neg2LLConstraint.h:39
Minimisable.h
MINT::Neg2LLConstraint::_mean
double _mean
Definition:
Neg2LLConstraint.h:16
Generated by
1.8.15