- }
- delete [] index;
- delete [] indexMin;
- delete [] indexMax;
- if(valden>0)val=valnum/valden;
- AliInfo(Form(" the Average Efficiency = %f ",val));
- return val;
-}
-//____________________________________________________________________
-void AliCFEffGrid::Copy(TObject& eff) const
-{
- //
- // copy function
- //
- Copy(eff);
- AliCFEffGrid& target = (AliCFEffGrid &) eff;
-
- target.fSelNum=fSelNum;
- target.fSelDen=fSelDen;
- if(fContainer)
- target.fContainer=fContainer;
-}
-//___________________________________________________________________
-TH1D *AliCFEffGrid::Project(Int_t ivar) const
-{
- //
- // Make a 1D projection along variable ivar
- //
-
- TH1D *proj1D=0;
- Int_t nbins =fNVarBins[ivar];
- Double_t *bins = new Double_t[nbins+1];
- for(Int_t ibin =0;ibin<nbins+1;ibin++){
- bins[ibin] = fVarBinLimits[ibin+fOffset[ivar]];
- }
-
- char pname[30];
- sprintf(pname,"%s%s%i%i%s%i",GetName(),"_SelStep",fSelNum,fSelDen,"_proj1D_var", ivar);
- char htitle[30];
- sprintf(htitle,"%s%s%i%i%s%i",GetName(),"_SelStep",fSelNum,fSelDen,"_proj1D_var", ivar);
-
- if(!proj1D){
- proj1D =new TH1D(pname,htitle, nbins, bins);
- }
-
- //unset the use of axis range to be able to divide the histos
- fContainer->GetGrid(fSelNum)->UseAxisRange(kFALSE);
- fContainer->GetGrid(fSelDen)->UseAxisRange(kFALSE);
-
- proj1D->Sumw2();
- proj1D->Divide(fContainer->GetGrid(fSelNum)->Project(ivar),fContainer->GetGrid(fSelDen)->Project(ivar),1.,1.,"B");
-
- fContainer->GetGrid(fSelNum)->UseAxisRange(kTRUE);
- fContainer->GetGrid(fSelDen)->UseAxisRange(kTRUE);
- proj1D->GetXaxis()->SetRange(
- ((AliCFGridSparse*)GetNum())->GetGrid()->GetAxis(ivar)->GetFirst(),
- ((AliCFGridSparse*)GetNum())->GetGrid()->GetAxis(ivar)->GetLast()
- );
-
- delete [] bins;
- return proj1D;
-}
-//___________________________________________________________________
-TH2D *AliCFEffGrid::Project(Int_t ivar1,Int_t ivar2) const
-{
- //
- // Make a 2D projection along variable ivar1,ivar2
- //
-
- TH2D *proj2D=0;
-
- Int_t nbins1 =fNVarBins[ivar1];
- Double_t *bins1 = new Double_t[nbins1+1];
- Int_t nbins2 =fNVarBins[ivar2];
- Double_t *bins2 = new Double_t[nbins2+1];
- for(Int_t ibin1 =0;ibin1<nbins1+1;ibin1++){
- bins1[ibin1] = fVarBinLimits[ibin1+fOffset[ivar1]];