1 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
4 //-------------------------------------------------------------------------
5 // Class AliDielectronBtoJPSItoEle
6 // Unbinned log-likelihood fit analysis class
9 // Contact: Carmelo.Digiglio@ba.infn.it , giuseppe.bruno@ba.infn.it
10 //-------------------------------------------------------------------------
15 #include "AliDielectronBtoJPSItoEleCDFfitFCN.h"
16 #include "AliDielectronBtoJPSItoEleCDFfitHandler.h"
17 #include "AliDielectronBtoJPSItoEle.h"
20 ClassImp(AliDielectronBtoJPSItoEle)
22 //_______________________________________________________________________________
23 AliDielectronBtoJPSItoEle::AliDielectronBtoJPSItoEle() :
30 // default constructor
33 //___________________________________________________________________________________
34 AliDielectronBtoJPSItoEle::AliDielectronBtoJPSItoEle(const AliDielectronBtoJPSItoEle& source) :
36 fFCNfunction(source.fFCNfunction),
37 fPtBin(source.fPtBin),
38 fMCtemplate(source.fMCtemplate),
39 fResType(source.fResType)
45 //_________________________________________________________________________________________________
47 AliDielectronBtoJPSItoEle &AliDielectronBtoJPSItoEle::operator=(const AliDielectronBtoJPSItoEle& source)
50 // assignment operator
52 if(&source == this) return *this;
53 fFCNfunction = source.fFCNfunction;
54 fPtBin = source.fPtBin;
55 fMCtemplate = source.fMCtemplate;
59 //_________________________________________________________________________________________________
60 AliDielectronBtoJPSItoEle::~AliDielectronBtoJPSItoEle()
68 //_________________________________________________________________________________________________
69 Int_t AliDielectronBtoJPSItoEle::DoMinimization(Int_t step)
72 // performs the minimization
74 Int_t iret=fFCNfunction->DoMinimization(step);
78 //_________________________________________________________________________________________________
79 void AliDielectronBtoJPSItoEle::ReadCandidates(TNtuple* nt, Double_t* &pseudoproper, Double_t* &invmass, Int_t * &typeCand, Int_t& ncand)
82 // Read N-tuple with X and M values
84 Float_t mJPSI = 0; Float_t x = 0; Float_t type = 0;
87 TString arrType[] = {"SS","FS","FF"};
88 nt->SetBranchAddress("Mass",&mJPSI);
89 nt->SetBranchAddress("Xdecaytime",&x);
91 if(!nt->GetListOfBranches()->At(2)) {AliInfo("ERROR: branch with candidate type doesn't exist! \n"); return;}
92 nt->SetBranchAddress("Type",&type);
94 nentries = (Int_t)nt->GetEntries();
95 pseudoproper = new Double_t[nentries];
96 invmass = new Double_t[nentries];
97 typeCand = new Int_t[nentries];
99 for(Int_t i = 0; i < nentries; i++) {
101 if(!fResType.Contains(arrType[(Int_t)type])) continue;
102 pseudoproper[ncand]=(Double_t)x;
103 invmass[ncand]=(Double_t)mJPSI;
104 typeCand[ncand] = (Int_t)type;
109 //_________________________________________________________________________________________________
110 void AliDielectronBtoJPSItoEle::SetCsiMC()
113 // Sets X distribution used as MC template for JPSI from B
115 fFCNfunction->LikelihoodPointer()->SetCsiMC(fMCtemplate);
119 //_________________________________________________________________________________________________
120 void AliDielectronBtoJPSItoEle::SetFitHandler(Double_t* x /*pseudoproper*/, Double_t* m /*inv mass*/, Int_t* type /*type*/, Int_t ncand /*candidates*/)
123 // Create the fit handler object to play with different params of the fitting function
126 fFCNfunction = new AliDielectronBtoJPSItoEleCDFfitHandler(x,m,type,ncand);
129 AliInfo("fFCNfunction not istanziated ---> nothing done");