MINT2
LASSO.cpp
Go to the documentation of this file.
1 // author: Philippe d'Argent (p.dargent@cern.ch)
2 #include "Mint/Neg2LLSum.h"
3 #include "Mint/IMinimisable.h"
4 #include "Mint/LASSO.h"
5 #include "Mint/NamedParameter.h"
6 
7 
8 using namespace std;
9 using namespace MINT;
10 
11 
12 double LASSO::getVal(){
13  if(_lassoMod) return _lambda * (_pdf->sumOfSqrtFitFractions() + _pdf->absSumOfSqrtInterferenceFractions());
14  else return _lambda * _pdf->sumOfSqrtFitFractions();
15 }
16 
17 int LASSO::numberOfFitFractionsLargerThanThreshold(double threshold){
18  return _pdf->numberOfFitFractionsLargerThanThreshold(threshold);
19 }
20 
21 //void LASSO::Gradient(Double_t* grad){
22 void LASSO::Gradient(vector<double>& grad){
23  std::vector<double> grad_pdf(this->getParSet()->size());
24 
25 
26  /*
27  for(unsigned int j=0; j < this->getParSet()->size(); j++){
28  grad_pdf.at(j) = 0.;
29 
30  _pdf->GradientForLasso(&grad_pdf[0]);
31  }
32  */
33 
34  for(unsigned int j=0; j < grad.size(); j++) grad[j]=0;
35  _pdf->GradientForLasso(grad);
36 
37  /*
38  for(unsigned int j=0; j < this->getParSet()->size(); j++){
39  grad.at(j)= _lambda * grad_pdf.at(;
40  }
41  */
42 
43 }
44 
45 
46 //