AliDielectronBtoJPSItoEle::AliDielectronBtoJPSItoEle() :
fFCNfunction(0),
fPtBin(0),
-fMCtemplate(0)
+fMCtemplate(0),
+fResType("FF")
{
//
// default constructor
TNamed(source),
fFCNfunction(source.fFCNfunction),
fPtBin(source.fPtBin),
-fMCtemplate(source.fMCtemplate)
+fMCtemplate(source.fMCtemplate),
+fResType(source.fResType)
{
//
// copy constructor
delete fMCtemplate;
}
//_________________________________________________________________________________________________
-Int_t AliDielectronBtoJPSItoEle::DoMinimization()
+Int_t AliDielectronBtoJPSItoEle::DoMinimization(Int_t step)
{
//
// performs the minimization
//
- Int_t iret=fFCNfunction->DoMinimization();
+ Int_t iret=fFCNfunction->DoMinimization(step);
return iret;
}
//_________________________________________________________________________________________________
-void AliDielectronBtoJPSItoEle::ReadCandidates(TNtuple* nt, Double_t* &pseudoproper,Double_t* &invmass, Int_t& ncand)
+void AliDielectronBtoJPSItoEle::ReadCandidates(TNtuple* nt, Double_t* &pseudoproper, Double_t* &invmass, Int_t * &typeCand, Int_t& ncand)
{
//
// Read N-tuple with X and M values
//
- Float_t mJPSI = 0; Float_t x = 0;
+ Float_t mJPSI = 0; Float_t x = 0; Float_t type = 0;
Int_t nentries = 0;
ncand=0;
+ TString arrType[] = {"SS","FS","FF"};
nt->SetBranchAddress("Mass",&mJPSI);
nt->SetBranchAddress("Xdecaytime",&x);
+ //
+ if(!nt->GetListOfBranches()->At(2)) {AliInfo("ERROR: branch with candidate type doesn't exist! \n"); return;}
+ nt->SetBranchAddress("Type",&type);
+ //
nentries = (Int_t)nt->GetEntries();
pseudoproper = new Double_t[nentries];
invmass = new Double_t[nentries];
+ typeCand = new Int_t[nentries];
+
for(Int_t i = 0; i < nentries; i++) {
nt->GetEntry(i);
+ if(!fResType.Contains(arrType[(Int_t)type])) continue;
+ pseudoproper[ncand]=(Double_t)x;
+ invmass[ncand]=(Double_t)mJPSI;
+ typeCand[ncand] = (Int_t)type;
ncand++;
- pseudoproper[i]=(Double_t)(10000*x);
- invmass[i]=(Double_t)mJPSI;
- }
-
+ }
return;
}
//_________________________________________________________________________________________________
return;
}
//_________________________________________________________________________________________________
-void AliDielectronBtoJPSItoEle::SetFitHandler(Double_t* x /*pseudoproper*/, Double_t* m /*inv mass*/, Int_t ncand /*candidates*/)
+void AliDielectronBtoJPSItoEle::SetFitHandler(Double_t* x /*pseudoproper*/, Double_t* m /*inv mass*/, Int_t* type /*type*/, Int_t ncand /*candidates*/)
{
//
// Create the fit handler object to play with different params of the fitting function
//
- fFCNfunction = new AliDielectronBtoJPSItoEleCDFfitHandler(x,m,ncand);
+ fFCNfunction = new AliDielectronBtoJPSItoEleCDFfitHandler(x,m,type,ncand);
if(!fFCNfunction) {
AliInfo("fFCNfunction not istanziated ---> nothing done");