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() :
29 // default constructor
32 //___________________________________________________________________________________
33 AliDielectronBtoJPSItoEle::AliDielectronBtoJPSItoEle(const AliDielectronBtoJPSItoEle& source) :
35 fFCNfunction(source.fFCNfunction),
36 fMCtemplate(source.fMCtemplate),
37 fResType(source.fResType)
43 //_________________________________________________________________________________________________
45 AliDielectronBtoJPSItoEle &AliDielectronBtoJPSItoEle::operator=(const AliDielectronBtoJPSItoEle& source)
48 // assignment operator
50 if(&source == this) return *this;
51 fFCNfunction = source.fFCNfunction;
52 fMCtemplate = source.fMCtemplate;
56 //_________________________________________________________________________________________________
57 AliDielectronBtoJPSItoEle::~AliDielectronBtoJPSItoEle()
65 //_________________________________________________________________________________________________
66 Int_t AliDielectronBtoJPSItoEle::DoMinimization(Int_t step)
69 // performs the minimization
71 Int_t iret=fFCNfunction->DoMinimization(step);
75 //_________________________________________________________________________________________________
76 void AliDielectronBtoJPSItoEle::ReadCandidates(TNtuple* nt, Double_t* &pseudoproper, Double_t* &invmass, Double_t* &pt, Int_t * &typeCand, Int_t& ncand, Double_t massLow, Double_t massUp, Double_t ptLow, Double_t ptUp)
79 // Read N-tuple with X and M values
81 Float_t mJPSI = 0; Float_t x = 0; Float_t type = 0; Float_t transvMom = 0.;
84 TString arrType[] = {"SS","FS","FF"};
85 nt->SetBranchAddress("Mass",&mJPSI);
86 nt->SetBranchAddress("Xdecaytime",&x);
87 nt->SetBranchAddress("Pt",&transvMom);
89 if(!nt->GetListOfBranches()->At(2)) {AliInfo("ERROR: branch with candidate type doesn't exist! \n"); return;}
90 nt->SetBranchAddress("Type",&type);
92 nentries = (Int_t)nt->GetEntries();
93 pseudoproper = new Double_t[nentries];
94 invmass = new Double_t[nentries];
95 pt = new Double_t[nentries];
96 typeCand = new Int_t[nentries];
98 for(Int_t i = 0; i < nentries; i++) {
100 if(!fResType.Contains(arrType[(Int_t)type])) continue;
101 if(massUp > massLow && massLow > 0) { if(mJPSI < massLow || mJPSI >massUp) continue; }
102 if(ptUp > ptLow && ptLow > 0) { if(transvMom < ptLow || transvMom > ptUp) continue; }
103 pseudoproper[ncand]=(Double_t)x;
104 invmass[ncand]=(Double_t)mJPSI;
105 pt[ncand]=(Double_t)transvMom;
106 typeCand[ncand] = (Int_t)type;
111 //_________________________________________________________________________________________________
112 void AliDielectronBtoJPSItoEle::SetCsiMC()
115 // Sets X distribution used as MC template for JPSI from B
117 fFCNfunction->LikelihoodPointer()->SetCsiMC(fMCtemplate);
121 //_________________________________________________________________________________________________
122 void AliDielectronBtoJPSItoEle::SetFitHandler(Double_t* x /*pseudoproper*/, Double_t* m /*inv mass*/, Double_t* pt /*pt*/, Int_t* type /*type*/, Int_t ncand /*candidates*/)
125 // Create the fit handler object to play with different params of the fitting function
128 fFCNfunction = new AliDielectronBtoJPSItoEleCDFfitHandler(x,m,pt,type,ncand);
131 AliInfo("fFCNfunction not istanziated ---> nothing done");