1 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
4 //-------------------------------------------------------------------------
5 // Class AliAnalysisBtoJPSItoEle
6 // Unbinned log-likelihood fit analysis class
9 // Contact: Carmelo.Digiglio@ba.infn.it , giuseppe.bruno@ba.infn.it
10 //-------------------------------------------------------------------------
15 #include "AliBtoJPSItoEleCDFfitFCN.h"
16 #include "AliBtoJPSItoEleCDFfitHandler.h"
17 #include "AliAnalysisBtoJPSItoEle.h"
20 ClassImp(AliAnalysisBtoJPSItoEle)
22 //_______________________________________________________________________________
23 AliAnalysisBtoJPSItoEle::AliAnalysisBtoJPSItoEle() :
29 // default constructor
32 //___________________________________________________________________________________
33 AliAnalysisBtoJPSItoEle::AliAnalysisBtoJPSItoEle(const AliAnalysisBtoJPSItoEle& source) :
35 fFCNfunction(source.fFCNfunction),
36 fPtBin(source.fPtBin),
37 fMCtemplate(source.fMCtemplate)
43 //_________________________________________________________________________________________________
45 AliAnalysisBtoJPSItoEle &AliAnalysisBtoJPSItoEle::operator=(const AliAnalysisBtoJPSItoEle& source)
48 // assignment operator
50 if(&source == this) return *this;
51 fFCNfunction = source.fFCNfunction;
52 fPtBin = source.fPtBin;
53 fMCtemplate = source.fMCtemplate;
57 //_________________________________________________________________________________________________
58 AliAnalysisBtoJPSItoEle::~AliAnalysisBtoJPSItoEle()
66 //_________________________________________________________________________________________________
67 Int_t AliAnalysisBtoJPSItoEle::DoMinimization(Double_t* x,
68 Double_t* m, Int_t ncand)
71 // performs the minimization
73 AliInfo(Form("Number of candidates used for the minimisation is %d",ncand));
74 fFCNfunction = new AliBtoJPSItoEleCDFfitHandler(x,m,ncand);
75 SetResolutionConstants(fPtBin);
76 SetCsiMC(fMCtemplate);
77 fFCNfunction->SetErrorDef(0.5); // tells Minuit that the error interval is the one in which
78 // the function differs from the minimum for less than setted value
79 Int_t iret=fFCNfunction->DoMinimization();
83 //_________________________________________________________________________________________________
84 void AliAnalysisBtoJPSItoEle::SetResolutionConstants(Int_t BinNum)
87 // sets constants for parametrized resolution function
90 AliInfo("fFCNfunction not istanziated ---> nothing done");
93 AliInfo("Call likelihood SetResolutionConstants method ---> OK");
94 AliBtoJPSItoEleCDFfitFCN* loglikePnt = fFCNfunction->LikelihoodPointer();
96 AliWarning("Pointer to AliBtoJPSItoEleCDFfitFCN class not found!");
99 loglikePnt->SetResolutionConstants(BinNum);
101 //_________________________________________________________________________________________________
102 void AliAnalysisBtoJPSItoEle::ReadCandidates(TNtuple* nt, Double_t* &pseudoproper,Double_t* &invmass, Int_t& ncand)
105 // Read N-tuple with X and M values
107 Float_t mJPSI = 0; Float_t x = 0;
110 nt->SetBranchAddress("Mass",&mJPSI);
111 nt->SetBranchAddress("Xdecaytime",&x);
112 nentries = (Int_t)nt->GetEntries();
113 pseudoproper = new Double_t[nentries];
114 invmass = new Double_t[nentries];
115 for(Int_t i = 0; i < nentries; i++) {
118 pseudoproper[i]=(Double_t)(10000*x);
119 invmass[i]=(Double_t)mJPSI;
124 //_________________________________________________________________________________________________
125 void AliAnalysisBtoJPSItoEle::SetCsiMC(TH1F* MCtemplates)
128 // Sets X distribution used as MC template for JPSI from B
130 fFCNfunction->LikelihoodPointer()->SetCsiMC(MCtemplates);
134 //_________________________________________________________________________________________________