<commit_before>/**************************************************************************
 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
#include <TVirtualFitter.h>
#include <TFitter.h>
#include <TMinuit.h>
#include <TStopwatch.h>
#include <TCanvas.h>
#include "AliLog.h"
#include "AliDielectronBtoJPSItoEleCDFfitHandler.h"
#include "AliDielectronBtoJPSItoEleCDFfitFCN.h"

//-------------------------------------------------------------------------
//                      Class AliDielectronBtoJPSItoEleCDFfitHandler
//            Class to perform unbinned log-likelihood fit
//      
//                        Origin: <NAME>
//     Contact: <EMAIL> , <EMAIL>
//-------------------------------------------------------------------------

void CDFFunction(Int_t &npar, Double_t *gin, Double_t &f, Double_t *x, Int_t iflag);

ClassImp(AliDielectronBtoJPSItoEleCDFfitHandler)

	//______________________________________________________________________________
void CDFFunction(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
{
	// This function is called by minuit
	// The corresponding member method is called
	// using SetObjectFit/GetObjectFit methods of TMinuit
	AliDielectronBtoJPSItoEleCDFfitHandler* dummy = (AliDielectronBtoJPSItoEleCDFfitHandler *)TVirtualFitter::GetFitter()->GetObjectFit();
	dummy->CdfFCN(npar, gin, f, par, iflag);
}


//_________________________________________________________________________________________________
AliDielectronBtoJPSItoEleCDFfitHandler::AliDielectronBtoJPSItoEleCDFfitHandler():
	fIsParamFixed(49),
	fPrintStatus(kFALSE),
	fUp(0),
	fX(0x0),
	fM(0x0),
	fPt(0x0),
	fType(0x0),
        fLikely(0x0),
	fNcand(0),
	fContPlot1(0x0),
	fContPlot2(0x0),
	fContPlot3(0x0),
	fitter(0)
{
	//
	// default constructor
	//
}
//_________________________________________________________________________________________________
AliDielectronBtoJPSItoEleCDFfitHandler::AliDielectronBtoJPSItoEleCDFfitHandler(Double_t* decaytime, 
		Double_t* invariantmass, Double_t *pt,Int_t *type, Int_t ncand) :
	fIsParamFixed(49),
	fPrintStatus(kFALSE),
	fUp(0),
	fX(decaytime),
	fM(invariantmass),
	fPt(pt),
        fType(type),
	fLikely(0x0),
	fNcand(ncand),
	fContPlot1(0x0),
	fContPlot2(0x0),
	fContPlot3(0x0),
	fitter(0)
{
	//
	// constructor
	//
	AliInfo("\n+++\n+++ Minimization object AliDielectronBtoJPSItoEleCDFfitHandler created\n+++\n");
	fLikely = new AliDielectronBtoJPSItoEleCDFfitFCN();
	AliInfo("\n+++\n+++ CDF fit function object AliDielectronBtoJPSItoEleCDFfitFCN created\n+++\n");
	AliInfo("Parameter 0  ----> fWeightRes");
	AliInfo("Parameter 1  ----> fPos");
	AliInfo("Parameter 2  ----> fNeg");
	AliInfo("Parameter 3  ----> fSym");
	AliInfo("Parameter 4  ----> fOneOvLamPlus");
	AliInfo("Parameter 5  ----> fOneOvLamMinus");
	AliInfo("Parameter 6  ----> fOneOvLamSym");
	AliInfo("Parameter 7  ----> fB");
	AliInfo("Parameter 8  ----> fFsig");
	AliInfo("Parameter 9  ----> fMmean");
	AliInfo("Parameter 10 ----> fNexp");
	AliInfo("Parameter 11 ----> fSigma");
	AliInfo("Parameter 12 ----> fAlpha");
	AliInfo("Parameter 13 ----> fNorm");
	AliInfo("Parameter 14 ----> fBkgNorm");
	AliInfo("Parameter 15 ----> fBkgMean");
	AliInfo("Parameter 16 ----> fBkgSlope");
	AliInfo("Parameter 17 ----> fBkgConst");
	AliInfo("Parameter 18 ----> fNormGaus1 (FF)");
	AliInfo("Parameter 19 ----> fNormGaus2 (FF)");
        AliInfo("Parameter 20 ----> fMean1Res (FF)");
        AliInfo("Parameter 21 ----> fsigma1Res (FF)"); 
        AliInfo("Parameter 22 ----> fMean2Res (FF)");
        AliInfo("Parameter 23 ----> fsigma2Res (FF)");
        AliInfo("Parameter 24 ----> fAlfaRes (FF)");
        AliInfo("Parameter 25 ----> fLambdaRes (FF)");
        AliInfo("Parameter 26 ----> fNormResExp (FF)");
        AliInfo("Parameter 27 ----> fNormGaus1 (FS)");
        AliInfo("Parameter 28 ----> fNormGaus2 (FS)");
        AliInfo("Parameter 29 ----> fMean1Res (FS)");
        AliInfo("Parameter 30 ----> fsigma1Res (FS)");
        AliInfo("Parameter 31 ----> fMean2Res (FS)");
        AliInfo("Parameter 32 ----> fsigma2Res (FS)");
        AliInfo("Parameter 33 ----> fAlfaRes (FS)");
        AliInfo("Parameter 34 ----> fLambdaRes (FS)");
        AliInfo("Parameter 35 ----> fNormResExp (FS)");
        AliInfo("Parameter 36 ----> fNormGaus1 (SS)");
        AliInfo("Parameter 37 ----> fNormGaus2 (SS)");
        AliInfo("Parameter 38 ----> fMean1Res (SS)");
        AliInfo("Parameter 39 ----> fsigma1Res (SS)");
        AliInfo("Parameter 40 ----> fMean2Res (SS)");
        AliInfo("Parameter 41 ----> fsigma2Res (SS)");
        AliInfo("Parameter 42 ----> fAlfaRes (SS)");
        AliInfo("Parameter 43 ----> fLambdaRes (SS)");
        AliInfo("Parameter 44 ----> fNormResExp (SS)");
        AliInfo("Parameter 45 ----> fOneOvLamSym1 (additional parameter)");
        AliInfo("Parameter 46 ----> fSym1 (additional parameter)");
        AliInfo("Parameter 47 ----> fPolyn4 (additional parameter)");
        AliInfo("Parameter 48 ----> fPolyn5 (additional parameter)");

	AliInfo(Form("\n+++\n+++ Number of candidates ---> %d\n+++\n ", ncand));
}
//___________________________________________________________________________
AliDielectronBtoJPSItoEleCDFfitHandler& AliDielectronBtoJPSItoEleCDFfitHandler::operator=(const AliDielectronBtoJPSItoEleCDFfitHandler& c)
{
	//
	// Assignment operator
	//
	if (this!=&c) {
		fIsParamFixed = c.fIsParamFixed;
		fPrintStatus  = c.fPrintStatus;
		fUp           = c.fUp;
		fX            = c.fX;
		fM            = c.fM;
		fPt           = c.fPt;
		fType         = c.fType;
                fLikely       = c.fLikely;
		fNcand        = c.fNcand;
		fContPlot1    = c.fContPlot1;
		fContPlot2    = c.fContPlot2;
		fContPlot3    = c.fContPlot3;
	}
	return *this;
}

//_______________________________________________________________________________________
AliDielectronBtoJPSItoEleCDFfitHandler::AliDielectronBtoJPSItoEleCDFfitHandler(const AliDielectronBtoJPSItoEleCDFfitHandler& c) :
	TNamed(c),
	fIsParamFixed(c.fIsParamFixed),
	fPrintStatus(c.fPrintStatus),
	fUp(c.fUp),
	fX(c.fX),
	fM(c.fM),
	fPt(c.fPt),
	fType(c.fType),
        fLikely(c.fLikely),
	fNcand(c.fNcand),
	fContPlot1(c.fContPlot1),
	fContPlot2(c.fContPlot2),
	fContPlot3(c.fContPlot3),
	fitter(c.fitter)
{
	//
	// Copy Constructor
	//
}
//_______________________________________________________________________________________
AliDielectronBtoJPSItoEleCDFfitHandler::~AliDielectronBtoJPSItoEleCDFfitHandler()
{
	//
	//destructor
	//
	delete fLikely;
}
//_______________________________________________________________________________________
Int_t AliDielectronBtoJPSItoEleCDFfitHandler::DoMinimization(Int_t step)
{
	//
	// performs the minimization<commit_msg>Coverity fixes 16727, 19855<commit_after>/**************************************************************************
 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/
#include <TVirtualFitter.h>
#include <TFitter.h>
#include <TMinuit.h>
#include <TStopwatch.h>
#include <TCanvas.h>
#include "AliLog.h"
#include "AliDielectronBtoJPSItoEleCDFfitHandler.h"
#include "AliDielectronBtoJPSItoEleCDFfitFCN.h"

//-------------------------------------------------------------------------
//                      Class AliDielectronBtoJPSItoEleCDFfitHandler
//            Class to perform unbinned log-likelihood fit
//      
//                        Origin: <NAME>
//     Contact: <EMAIL> , <EMAIL>
//-------------------------------------------------------------------------

void CDFFunction(Int_t &npar, Double_t *gin, Double_t &f, Double_t *x, Int_t iflag);

ClassImp(AliDielectronBtoJPSItoEleCDFfitHandler)

	//______________________________________________________________________________
void CDFFunction(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
{
	// This function is called by minuit
	// The corresponding member method is called
	// using SetObjectFit/GetObjectFit methods of TMinuit
	AliDielectronBtoJPSItoEleCDFfitHandler* dummy = (AliDielectronBtoJPSItoEleCDFfitHandler *)TVirtualFitter::GetFitter()->GetObjectFit();
	dummy->CdfFCN(npar, gin, f, par, iflag);
}


//_________________________________________________________________________________________________
AliDielectronBtoJPSItoEleCDFfitHandler::AliDielectronBtoJPSItoEleCDFfitHandler():
	fIsParamFixed(49),
	fPrintStatus(kFALSE),
        fParamStartValues(),
	fUp(0),
	fX(0x0),
	fM(0x0),
	fPt(0x0),
	fType(0x0),
        fLikely(0x0),
	fNcand(0),
	fContPlot1(0x0),
	fContPlot2(0x0),
	fContPlot3(0x0),
	fitter(0)
{
	//
	// default constructor
	//
}
//_________________________________________________________________________________________________
AliDielectronBtoJPSItoEleCDFfitHandler::AliDielectronBtoJPSItoEleCDFfitHandler(Double_t* decaytime, 
		Double_t* invariantmass, Double_t *pt,Int_t *type, Int_t ncand) :
	fIsParamFixed(49),
	fPrintStatus(kFALSE),
        fParamStartValues(),
	fUp(0),
	fX(decaytime),
	fM(invariantmass),
	fPt(pt),
        fType(type),
	fLikely(0x0),
	fNcand(ncand),
	fContPlot1(0x0),
	fContPlot2(0x0),
	fContPlot3(0x0),
	fitter(0)
{
	//
	// constructor
	//
	AliInfo("\n+++\n+++ Minimization object AliDielectronBtoJPSItoEleCDFfitHandler created\n+++\n");
	fLikely = new AliDielectronBtoJPSItoEleCDFfitFCN();
	AliInfo("\n+++\n+++ CDF fit function object AliDielectronBtoJPSItoEleCDFfitFCN created\n+++\n");
	AliInfo("Parameter 0  ----> fWeightRes");
	AliInfo("Parameter 1  ----> fPos");
	AliInfo("Parameter 2  ----> fNeg");
	AliInfo("Parameter 3  ----> fSym");
	AliInfo("Parameter 4  ----> fOneOvLamPlus");
	AliInfo("Parameter 5  ----> fOneOvLamMinus");
	AliInfo("Parameter 6  ----> fOneOvLamSym");
	AliInfo("Parameter 7  ----> fB");
	AliInfo("Parameter 8  ----> fFsig");
	AliInfo("Parameter 9  ----> fMmean");
	AliInfo("Parameter 10 ----> fNexp");
	AliInfo("Parameter 11 ----> fSigma");
	AliInfo("Parameter 12 ----> fAlpha");
	AliInfo("Parameter 13 ----> fNorm");
	AliInfo("Parameter 14 ----> fBkgNorm");
	AliInfo("Parameter 15 ----> fBkgMean");
	AliInfo("Parameter 16 ----> fBkgSlope");
	AliInfo("Parameter 17 ----> fBkgConst");
	AliInfo("Parameter 18 ----> fNormGaus1 (FF)");
	AliInfo("Parameter 19 ----> fNormGaus2 (FF)");
        AliInfo("Parameter 20 ----> fMean1Res (FF)");
        AliInfo("Parameter 21 ----> fsigma1Res (FF)"); 
        AliInfo("Parameter 22 ----> fMean2Res (FF)");
        AliInfo("Parameter 23 ----> fsigma2Res (FF)");
        AliInfo("Parameter 24 ----> fAlfaRes (FF)");
        AliInfo("Parameter 25 ----> fLambdaRes (FF)");
        AliInfo("Parameter 26 ----> fNormResExp (FF)");
        AliInfo("Parameter 27 ----> fNormGaus1 (FS)");
        AliInfo("Parameter 28 ----> fNormGaus2 (FS)");
        AliInfo("Parameter 29 ----> fMean1Res (FS)");
        AliInfo("Parameter 30 ----> fsigma1Res (FS)");
        AliInfo("Parameter 31 ----> fMean2Res (FS)");
        AliInfo("Parameter 32 ----> fsigma2Res (FS)");
        AliInfo("Parameter 33 ----> fAlfaRes (FS)");
        AliInfo("Parameter 34 ----> fLambdaRes (FS)");
        AliInfo("Parameter 35 ----> fNormResExp (FS)");
        AliInfo("Parameter 36 ----> fNormGaus1 (SS)");
        AliInfo("Parameter 37 ----> fNormGaus2 (SS)");
        AliInfo("Parameter 38 ----> fMean1Res (SS)");
        AliInfo("Parameter 39 ----> fsigma1Res (SS)");
        AliInfo("Parameter 40 ----> fMean2Res (SS)");
        AliInfo("Parameter 41 ----> fsigma2Res (SS)");
        AliInfo("Parameter 42 ----> fAlfaRes (SS)");
        AliInfo("Parameter 43 ----> fLambdaRes (SS)");
        AliInfo("Parameter 44 ----> fNormResExp (SS)");
        AliInfo("Parameter 45 ----> fOneOvLamSym1 (additional parameter)");
        AliInfo("Parameter 46 ----> fSym1 (additional parameter)");
        AliInfo("Parameter 47 ----> fPolyn4 (additional parameter)");
        AliInfo("Parameter 48 ----> fPolyn5 (additional parameter)");

	AliInfo(Form("\n+++\n+++ Number of candidates ---> %d\n+++\n ", ncand));
}
//___________________________________________________________________________
AliDielectronBtoJPSItoEleCDFfitHandler& AliDielectronBtoJPSItoEleCDFfitHandler::operator=(const AliDielectronBtoJPSItoEleCDFfitHandler& c)
{
	//
	// Assignment operator
	//
	if (this!=&c) {
		fIsParamFixed = c.fIsParamFixed;
		fPrintStatus  = c.fPrintStatus;
                for (Int_t i=0; i<49; ++i) fParamStartValues[i]=c.fParamStartValues[i];
		fUp           = c.fUp;
		fX            = c.fX;
		fM            = c.fM;
		fPt           = c.fPt;
		fType         = c.fType;
                fLikely       = c.fLikely;
		fNcand        = c.fNcand;
		fContPlot1    = c.fContPlot1;
		fContPlot2    = c.fContPlot2;
		fContPlot3    = c.fContPlot3;
	}
	return *this;
}

//_______________________________________________________________________________________
AliDielectronBtoJPSItoEleCDFfitHandler::AliDielectronBtoJPSItoEleCDFfitHandler(const AliDielectronBtoJPSItoEleCDFfitHandler& c) :
	TNamed(c),
	fIsParamFixed(c.fIsParamFixed),
	fPrintStatus(c.fPrintStatus),
        fParamStartValues(),
	fUp(c.fUp),
	fX(c.fX),
	fM(c.fM),
	fPt(c.fPt),
	fType(c.fType),
        fLikely(c.fLikely),
	fNcand(c.fNcand),
	fContPlot1(c.fContPlot1),
	fContPlot2(c.fContPlot2),
	fContPlot3(c.fContPlot3),
	fitter(c.fitter)
{
	//
	// Copy Constructor
	//
        for (Int_t i=0; i<49; ++i) fParamStartValues[i]=c.fParamStartValues[i];
}
//_______________________________________________________________________________________
AliDielectronBtoJPSItoEleCDFfitHandler::~AliDielectronBtoJPSItoEleCDFfitHandler()
{
	//
	//destructor
	//
	delete fLikely;
}
//_______________________________________________________________________________________
Int_t AliDielectronBtoJPSItoEleCDFfitHandler::DoMinimization(Int_t step)
{
	//
	// performs the minimization
{'fraction_non_alphanumeric': 0.17563484410157507, 'fraction_numerical': 0.022757955641272903, 'mean_word_length': 3.079727248885392, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5323158', 'n_tokens_mistral': 5394, 'n_tokens_neox': 4974, 'n_words': 969}