ROOT logo

/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
*                                                                        *
* Author: The ALICE Off-line Project.                                    *
* Contributors are mentioned in the code where appropriate.              *
*                                                                        *
* Permission to use, copy, modify and distribute this software and its   *
* documentation strictly for non-commercial purposes is hereby granted   *
* without fee, provided that the above copyright notice appears in all   *
* copies and that both the copyright notice and this permission notice   *
* appear in the supporting documentation. The authors make no claims     *
* about the suitability of this software for any purpose. It is          *
* provided "as is" without express or implied warranty.                  *
**************************************************************************/
//
// Class for spectrum correction
// Subtraction of hadronic background, Unfolding of the data and
// Renormalization done here
// The following containers have to be set:
//  - Correction framework container for real data
//  - Correction framework container for MC (Efficiency Map)
//  - Correction framework container for background coming from data
//  - Correction framework container for background coming from MC
//
//  Author: 
//            Raphaelle Bailhache <R.Bailhache@gsi.de>
//            Markus Fasel <M.Fasel@gsi.de>
//

#include <TArrayD.h>
#include <TH1.h>
#include <TList.h>
#include <TObjArray.h>
#include <TROOT.h>
#include <TCanvas.h>
#include <TLegend.h>
#include <TStyle.h>
#include <TMath.h>
#include <TAxis.h>
#include <TGraphErrors.h>
#include <TFile.h>
#include <TPad.h>
#include <TH2D.h>
#include <TF1.h>

#include "AliPID.h"
#include "AliCFContainer.h"
#include "AliCFDataGrid.h"
#include "AliCFEffGrid.h"
#include "AliCFGridSparse.h"
#include "AliCFUnfolding.h"
#include "AliLog.h"

#include "AliHFEspectrum.h"
#include "AliHFEcuts.h"
#include "AliHFEcontainer.h"
#include "AliHFEtools.h"

ClassImp(AliHFEspectrum)

//____________________________________________________________
AliHFEspectrum::AliHFEspectrum(const char *name):
  TNamed(name, ""),
  fCFContainers(new TObjArray(kDataContainerV0+1)),
  fTemporaryObjects(NULL),
  fCorrelation(NULL),
  fBackground(NULL),
  fEfficiencyFunction(NULL),
  fWeightCharm(NULL),
  fInclusiveSpectrum(kTRUE),
  fDumpToFile(kFALSE),
  fEtaSelected(kFALSE),
  fUnSetCorrelatedErrors(kTRUE),
  fSetSmoothing(kFALSE),
  fIPanaHadronBgSubtract(kFALSE),
  fIPanaCharmBgSubtract(kFALSE),
  fIPanaConversionBgSubtract(kFALSE),
  fIPanaNonHFEBgSubtract(kFALSE),
  fIPParameterizedEff(kFALSE),
  fNonHFEsyst(0),
  fBeauty2ndMethod(kFALSE),
  fIPEffCombinedSamples(kTRUE),
  fNbDimensions(1),
  fNMCEvents(0),
  fStepMC(-1),
  fStepTrue(-1),
  fStepData(-1),
  fStepBeforeCutsV0(-1),
  fStepAfterCutsV0(-1),
  fStepGuessedUnfolding(-1),
  fNumberOfIterations(5),
  fNRandomIter(0),
  fChargeChoosen(kAllCharge),
  fNCentralityBinAtTheEnd(0),
  fTestCentralityLow(-1),
  fTestCentralityHigh(-1),
  fFillMoreCorrelationMatrix(kFALSE),
  fHadronEffbyIPcut(NULL),
  fConversionEffbgc(NULL),
  fNonHFEEffbgc(NULL),      
  fBSpectrum2ndMethod(NULL),
  fkBeauty2ndMethodfilename(""),
  fBeamType(0),
  fEtaSyst(kTRUE),
  fDebugLevel(0),
  fWriteToFile(kFALSE),
  fUnfoldBG(kFALSE)
{
  //
  // Default constructor
  //

  for(Int_t k = 0; k < 20; k++){
      fNEvents[k] = 0;
      fNMCbgEvents[k] = 0;
      fLowBoundaryCentralityBinAtTheEnd[k] = 0;
      fHighBoundaryCentralityBinAtTheEnd[k] = 0;
      if(k<kCentrality)
      {
          fEfficiencyTOFPIDD[k] = 0;
          fEfficiencyesdTOFPIDD[k] = 0;
          fEfficiencyIPCharmD[k] = 0;     
          fEfficiencyIPBeautyD[k] = 0;    
          fEfficiencyIPBeautyesdD[k] = 0;
          fEfficiencyIPConversionD[k] = 0;
          fEfficiencyIPNonhfeD[k] = 0;   

	  fConversionEff[k] = 0;
	  fNonHFEEff[k] = 0;
	  fCharmEff[k] = 0;
	  fBeautyEff[k] = 0;
	  fEfficiencyCharmSigD[k] = 0;
          fEfficiencyBeautySigD[k] = 0;
          fEfficiencyBeautySigesdD[k] = 0;
      }
  }
  memset(fEtaRange, 0, sizeof(Double_t) * 2);
  memset(fEtaRangeNorm, 0, sizeof(Double_t) * 2);
  memset(fConvSourceContainer, 0, sizeof(AliCFContainer*) * kElecBgSources * kBgLevels);
  memset(fNonHFESourceContainer, 0, sizeof(AliCFContainer*) * kElecBgSources * kBgLevels);
}

//____________________________________________________________
AliHFEspectrum::~AliHFEspectrum(){
  //
  // Destructor
  //
  if(fCFContainers) delete fCFContainers;
  if(fTemporaryObjects){
    fTemporaryObjects->Clear();
    delete fTemporaryObjects;
  }
}
//____________________________________________________________
Bool_t AliHFEspectrum::Init(const AliHFEcontainer *datahfecontainer, const AliHFEcontainer *mchfecontainer, const AliHFEcontainer *v0hfecontainer, const AliHFEcontainer *bghfecontainer){
  //
  // Init what we need for the correction:
  //
  // Raw spectrum, hadron contamination
  // MC efficiency maps, correlation matrix
  // V0 efficiency if wanted
  //
  // This for a given dimension.
  // If no inclusive spectrum, then take only efficiency map for beauty electron
  // and the appropriate correlation matrix
  //

  
  if(fBeauty2ndMethod) CallInputFileForBeauty2ndMethod();

  Int_t kNdim = 3;
  Int_t kNcentr =1;
  //Int_t ptpr =0;
  if(fBeamType==0) kNdim=3;
  if(fBeamType==1)
  {
      kNdim=4;
      kNcentr=11;
      //ptpr=1;
  }

  Int_t dims[kNdim];
  // Get the requested format
  if(fBeamType==0){
    // pp analysis
    switch(fNbDimensions){
      case 1:   dims[0] = 0;
                break;
      case 2:   for(Int_t i = 0; i < 2; i++) dims[i] = i;
                break;
      case 3:   for(Int_t i = 0; i < 3; i++) dims[i] = i;
                break;
      default:
                AliError("Container with this number of dimensions not foreseen (yet)");
                return kFALSE;
    };
  }

  if(fBeamType==1){
    // PbPb analysis; centrality as first dimension
    Int_t nbDimensions = fNbDimensions;
    fNbDimensions = fNbDimensions + 1;
    switch(nbDimensions){
      case 1: dims[0] = 5;
              dims[1] = 0;
              break;
      case 2: dims[0] = 5;
              for(Int_t i = 0; i < 2; i++) dims[(i+1)] = i;
              break;
      case 3: dims[0] = 5;
              for(Int_t i = 0; i < 3; i++) dims[(i+1)] = i;
              break;
      default:
              AliError("Container with this number of dimensions not foreseen (yet)");
              return kFALSE;
    };
  }

  // Data container: raw spectrum + hadron contamination  
  AliCFContainer *datacontainer = 0x0; 
  if(fInclusiveSpectrum) {
    datacontainer = datahfecontainer->GetCFContainer("recTrackContReco");
  }
  else{

      datacontainer = datahfecontainer->MakeMergedCFContainer("sumreco","sumreco","recTrackContReco:recTrackContDEReco");
  }
  AliCFContainer *contaminationcontainer = datahfecontainer->GetCFContainer("hadronicBackground");
  if((!datacontainer) || (!contaminationcontainer)) return kFALSE;

  AliCFContainer *datacontainerD = GetSlicedContainer(datacontainer, fNbDimensions, dims, -1, fChargeChoosen,fTestCentralityLow,fTestCentralityHigh);
  AliCFContainer *contaminationcontainerD = GetSlicedContainer(contaminationcontainer, fNbDimensions, dims, -1, fChargeChoosen,fTestCentralityLow,fTestCentralityHigh);
  if((!datacontainerD) || (!contaminationcontainerD)) return kFALSE;

  SetContainer(datacontainerD,AliHFEspectrum::kDataContainer);
  SetContainer(contaminationcontainerD,AliHFEspectrum::kBackgroundData);

  // MC container: ESD/MC efficiency maps + MC/MC efficiency maps 
  AliCFContainer *mccontaineresd = 0x0;
  AliCFContainer *mccontaineresdbg = 0x0;
  AliCFContainer *mccontainermc = 0x0;
  AliCFContainer *mccontainermcbg = 0x0;
  AliCFContainer *nonHFEweightedContainer = 0x0;
  AliCFContainer *convweightedContainer = 0x0;
  AliCFContainer *nonHFEtempContainer = 0x0;//temporary container to be sliced for the fnonHFESourceContainers
  AliCFContainer *convtempContainer = 0x0;//temporary container to be sliced for the fConvSourceContainers
   
  if(fInclusiveSpectrum) {
    mccontaineresd = mchfecontainer->MakeMergedCFContainer("sumesd","sumesd","MCTrackCont:recTrackContReco");
    mccontainermc = mchfecontainer->MakeMergedCFContainer("summc","summc","MCTrackCont:recTrackContMC");
  }
  else {
    mccontaineresd = mchfecontainer->MakeMergedCFContainer("sumesd","sumesd","MCTrackCont:recTrackContReco:recTrackContDEReco");
    mccontaineresdbg = bghfecontainer->MakeMergedCFContainer("sumesd","sumesd","MCTrackCont:recTrackContReco:recTrackContDEReco");
    mccontainermc = mchfecontainer->MakeMergedCFContainer("summc","summc","MCTrackCont:recTrackContMC:recTrackContDEMC");
    mccontainermcbg = bghfecontainer->MakeMergedCFContainer("summcbg","summcbg","MCTrackCont:recTrackContMC:recTrackContDEMC");

    if(fNonHFEsyst){   
      const Char_t *sourceName[kElecBgSources]={"Pion","Eta","Omega","Phi","EtaPrime","Rho"};
      const Char_t *levelName[kBgLevels]={"Best","Lower","Upper"};
      for(Int_t iSource = 0; iSource < kElecBgSources; iSource++){
	for(Int_t iLevel = 0; iLevel < kBgLevels; iLevel++){
          nonHFEtempContainer =  bghfecontainer->GetCFContainer(Form("mesonElecs%s%s",sourceName[iSource],levelName[iLevel]));
	  convtempContainer =  bghfecontainer->GetCFContainer(Form("conversionElecs%s%s",sourceName[iSource],levelName[iLevel]));
	  for(Int_t icentr=0;icentr<kNcentr;icentr++)
	  {
	      if(fBeamType==0)
	      {
		  fConvSourceContainer[iSource][iLevel][icentr] = GetSlicedContainer(convtempContainer, fNbDimensions, dims, -1, fChargeChoosen);
		  fNonHFESourceContainer[iSource][iLevel][icentr] = GetSlicedContainer(nonHFEtempContainer, fNbDimensions, dims, -1, fChargeChoosen);
	      }
	      if(fBeamType==1)
	      {
              
		fConvSourceContainer[iSource][iLevel][icentr] = GetSlicedContainer(convtempContainer, fNbDimensions, dims, -1, fChargeChoosen,icentr,icentr);
		fNonHFESourceContainer[iSource][iLevel][icentr] = GetSlicedContainer(nonHFEtempContainer, fNbDimensions, dims, -1, fChargeChoosen,icentr,icentr);
	      }
//	      if((!fConvSourceContainer[iSource][iLevel][icentr])||(!fNonHFESourceContainer[iSource][iLevel])) return kFALSE;
	  }
          if(fBeamType == 1)break;
	}
      }
    }
    // else{      
      nonHFEweightedContainer = bghfecontainer->GetCFContainer("mesonElecs");
      convweightedContainer = bghfecontainer->GetCFContainer("conversionElecs");
      if((!convweightedContainer)||(!nonHFEweightedContainer)) return kFALSE;  
      //}
  }
  if((!mccontaineresd) || (!mccontainermc)) return kFALSE;  
  
  Int_t source = -1;
  if(!fInclusiveSpectrum) source = 1; //beauty
  AliCFContainer *mccontaineresdD = GetSlicedContainer(mccontaineresd, fNbDimensions, dims, source, fChargeChoosen,fTestCentralityLow,fTestCentralityHigh);
  AliCFContainer *mccontainermcD = GetSlicedContainer(mccontainermc, fNbDimensions, dims, source, fChargeChoosen,fTestCentralityLow,fTestCentralityHigh);
  if((!mccontaineresdD) || (!mccontainermcD)) return kFALSE;
  SetContainer(mccontainermcD,AliHFEspectrum::kMCContainerMC);
  SetContainer(mccontaineresdD,AliHFEspectrum::kMCContainerESD);

  // set charm, nonHFE container to estimate BG
  if(!fInclusiveSpectrum){
   source = 0; //charm
   mccontainermcD = GetSlicedContainer(mccontainermcbg, fNbDimensions, dims, source, fChargeChoosen);
   SetContainer(mccontainermcD,AliHFEspectrum::kMCContainerCharmMC);

   //if(!fNonHFEsyst){
     AliCFContainer *nonHFEweightedContainerD = GetSlicedContainer(nonHFEweightedContainer, fNbDimensions, dims, -1, fChargeChoosen);
     SetContainer(nonHFEweightedContainerD,AliHFEspectrum::kMCWeightedContainerNonHFEESD);
     AliCFContainer *convweightedContainerD = GetSlicedContainer(convweightedContainer, fNbDimensions, dims, -1, fChargeChoosen);
     SetContainer(convweightedContainerD,AliHFEspectrum::kMCWeightedContainerConversionESD);
     //}

     SetParameterizedEff(mccontainermc, mccontainermcbg, mccontaineresd, mccontaineresdbg, dims);

  }
  // MC container: correlation matrix
  THnSparseF *mccorrelation = 0x0;
  if(fInclusiveSpectrum) {
    if(fStepMC==(AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kStepHFEcutsTRD + 2)) mccorrelation = mchfecontainer->GetCorrelationMatrix("correlationstepbeforePID");
    else if(fStepMC==(AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kStepHFEcutsTRD + 1)) mccorrelation = mchfecontainer->GetCorrelationMatrix("correlationstepbeforePID");
    else if(fStepMC==(AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kStepHFEcutsTRD)) mccorrelation = mchfecontainer->GetCorrelationMatrix("correlationstepbeforePID");
    else if(fStepMC==(AliHFEcuts::kNcutStepsMCTrack + AliHFEcuts::kStepHFEcutsTRD - 1)) mccorrelation = mchfecontainer->GetCorrelationMatrix("correlationstepbeforePID");
    else mccorrelation = mchfecontainer->GetCorrelationMatrix("correlationstepafterPID");
    
    if(!mccorrelation) mccorrelation = mchfecontainer->GetCorrelationMatrix("correlationstepafterPID");
  }
  else mccorrelation = mchfecontainer->GetCorrelationMatrix("correlationstepafterPID"); // we confirmed that we get same result by using it instead of correlationstepafterDE
  //else mccorrelation = mchfecontainer->GetCorrelationMatrix("correlationstepafterDE");
  if(!mccorrelation) return kFALSE;
  Int_t testCentralityLow = fTestCentralityLow;
  Int_t testCentralityHigh = fTestCentralityHigh;
  if(fFillMoreCorrelationMatrix) {
    testCentralityLow = fTestCentralityLow-1;
    testCentralityHigh = fTestCentralityHigh+1;
  }
  THnSparseF *mccorrelationD = GetSlicedCorrelation(mccorrelation, fNbDimensions, dims,testCentralityLow,testCentralityHigh);
  if(!mccorrelationD) {
    printf("No correlation\n");
    return kFALSE;
  }
  SetCorrelation(mccorrelationD);

  // V0 container Electron, pt eta phi
  if(v0hfecontainer) {
    AliCFContainer *containerV0 = v0hfecontainer->GetCFContainer("taggedTrackContainerReco");
    if(!containerV0) return kFALSE;
    AliCFContainer *containerV0Electron = GetSlicedContainer(containerV0, fNbDimensions, dims, AliPID::kElectron,fChargeChoosen,fTestCentralityLow,fTestCentralityHigh);
    if(!containerV0Electron) return kFALSE;
    SetContainer(containerV0Electron,AliHFEspectrum::kDataContainerV0);
  }
 

  if(fDebugLevel>0){
   
    AliCFDataGrid *contaminationspectrum = (AliCFDataGrid *) ((AliCFDataGrid *)GetSpectrum(contaminationcontainer,1))->Clone();
    contaminationspectrum->SetName("contaminationspectrum");
    TCanvas * ccontaminationspectrum = new TCanvas("contaminationspectrum","contaminationspectrum",1000,700);
    ccontaminationspectrum->Divide(3,1);
    ccontaminationspectrum->cd(1);
    TH2D * contaminationspectrum2dpteta = (TH2D *) contaminationspectrum->Project(1,0);
    TH2D * contaminationspectrum2dptphi = (TH2D *) contaminationspectrum->Project(2,0);
    TH2D * contaminationspectrum2detaphi = (TH2D *) contaminationspectrum->Project(1,2);
    contaminationspectrum2dpteta->SetStats(0);
    contaminationspectrum2dpteta->SetTitle("");
    contaminationspectrum2dpteta->GetXaxis()->SetTitle("#eta");
    contaminationspectrum2dpteta->GetYaxis()->SetTitle("p_{T} [GeV/c]");
    contaminationspectrum2dptphi->SetStats(0);
    contaminationspectrum2dptphi->SetTitle("");
    contaminationspectrum2dptphi->GetXaxis()->SetTitle("#phi [rad]");
    contaminationspectrum2dptphi->GetYaxis()->SetTitle("p_{T} [GeV/c]");
    contaminationspectrum2detaphi->SetStats(0);
    contaminationspectrum2detaphi->SetTitle("");
    contaminationspectrum2detaphi->GetXaxis()->SetTitle("#eta");
    contaminationspectrum2detaphi->GetYaxis()->SetTitle("#phi [rad]");
    contaminationspectrum2dptphi->Draw("colz");
    ccontaminationspectrum->cd(2);
    contaminationspectrum2dpteta->Draw("colz");
    ccontaminationspectrum->cd(3);
    contaminationspectrum2detaphi->Draw("colz");

    TCanvas * ccorrelation = new TCanvas("ccorrelation","ccorrelation",1000,700);
    ccorrelation->cd(1);
    if(mccorrelationD) {
      if(fBeamType==0){
        TH2D * ptcorrelation = (TH2D *) mccorrelationD->Projection(fNbDimensions,0);
        ptcorrelation->Draw("colz");
      }
      if(fBeamType==1){
        TH2D * ptcorrelation = (TH2D *) mccorrelationD->Projection(fNbDimensions+1,1);
        ptcorrelation->Draw("colz");
      }
    }
    if(fWriteToFile){ 
      ccontaminationspectrum->SaveAs("contaminationspectrum.eps");
      ccorrelation->SaveAs("correlationMatrix.eps");
    }
  }

  TFile *file = TFile::Open("tests.root","recreate");
  datacontainerD->Write("data");
  mccontainermcD->Write("mcefficiency");
  mccorrelationD->Write("correlationmatrix");
  file->Close();

  return kTRUE;
}


//____________________________________________________________
void AliHFEspectrum::CallInputFileForBeauty2ndMethod(){
  //
  // get spectrum for beauty 2nd method
  //
  //
    TFile *inputfile2ndmethod=TFile::Open(fkBeauty2ndMethodfilename);
    fBSpectrum2ndMethod = new TH1D(*static_cast<TH1D*>(inputfile2ndmethod->Get("BSpectrum")));
}


//____________________________________________________________
Bool_t AliHFEspectrum::Correct(Bool_t subtractcontamination){
  //
  // Correct the spectrum for efficiency and unfolding
  // with both method and compare
  //
  
  gStyle->SetPalette(1);
  gStyle->SetOptStat(1111);
  gStyle->SetPadBorderMode(0);
  gStyle->SetCanvasColor(10);
  gStyle->SetPadLeftMargin(0.13);
  gStyle->SetPadRightMargin(0.13);

  printf("Steps are: stepdata %d, stepMC %d, steptrue %d, stepV0after %d, stepV0before %d\n",fStepData,fStepMC,fStepTrue,fStepAfterCutsV0,fStepBeforeCutsV0);

  ///////////////////////////
  // Check initialization
  ///////////////////////////

  if((!GetContainer(kDataContainer)) || (!GetContainer(kMCContainerMC)) || (!GetContainer(kMCContainerESD))){
    AliInfo("You have to init before");
    return kFALSE;
  }
  
  if((fStepTrue < 0) && (fStepMC < 0) && (fStepData < 0)) {
    AliInfo("You have to set the steps before: SetMCTruthStep, SetMCEffStep, SetStepToCorrect");
    return kFALSE;
  }
 
  SetNumberOfIteration(10);
  SetStepGuessedUnfolding(AliHFEcuts::kStepRecKineITSTPC + AliHFEcuts::kNcutStepsMCTrack);
    
  AliCFDataGrid *dataGridAfterFirstSteps = 0x0;
  //////////////////////////////////
  // Subtract hadron background
  /////////////////////////////////
  AliCFDataGrid *dataspectrumaftersubstraction = 0x0;
  if(subtractcontamination) {
    dataspectrumaftersubstraction = SubtractBackground(kTRUE);
    dataGridAfterFirstSteps = dataspectrumaftersubstraction;
  }

  printf("cloning spectrum\n");
  AliCFDataGrid *rawsave(NULL);
  if(dataspectrumaftersubstraction){
     rawsave = (AliCFDataGrid *)dataspectrumaftersubstraction->Clone("rawdata");
  } else {
    AliCFContainer *dataContainer = GetContainer(kDataContainer);
    if(!dataContainer){
      AliError("Data Container not available");
    }
    rawsave = new AliCFDataGrid("rawsave", "raw spectrum after subtraction",*dataContainer, fStepData);
  }
  printf("cloned: %p\n", rawsave);

  ////////////////////////////////////////////////
  // Correct for TPC efficiency from V0
  ///////////////////////////////////////////////
  AliCFDataGrid *dataspectrumafterV0efficiencycorrection = 0x0;
  AliCFContainer *dataContainerV0 = GetContainer(kDataContainerV0);
  if(dataContainerV0){printf("Got the V0 container\n");
    dataspectrumafterV0efficiencycorrection = CorrectV0Efficiency(dataspectrumaftersubstraction);
    dataGridAfterFirstSteps = dataspectrumafterV0efficiencycorrection;  
  }

  //////////////////////////////////////////////////////////////////////////////
  // Correct for efficiency parametrized (if TPC efficiency is parametrized)
  /////////////////////////////////////////////////////////////////////////////
  AliCFDataGrid *dataspectrumafterefficiencyparametrizedcorrection = 0x0;
  if(fEfficiencyFunction){
    dataspectrumafterefficiencyparametrizedcorrection = CorrectParametrizedEfficiency(dataGridAfterFirstSteps);
    dataGridAfterFirstSteps = dataspectrumafterefficiencyparametrizedcorrection;  
  }
    
  ///////////////
  // Unfold
  //////////////
  TList *listunfolded = Unfold(dataGridAfterFirstSteps);
  if(!listunfolded){
    printf("Unfolded failed\n");
    return kFALSE;
  }
  THnSparse *correctedspectrum = (THnSparse *) listunfolded->At(0);
  THnSparse *residualspectrum = (THnSparse *) listunfolded->At(1);
  if(!correctedspectrum){
    AliError("No corrected spectrum\n");
    return kFALSE;
  }
  if(!residualspectrum){
    AliError("No residul spectrum\n");
    return kFALSE;
  }   
  
  /////////////////////
  // Simply correct
  ////////////////////
  AliCFDataGrid *alltogetherCorrection = CorrectForEfficiency(dataGridAfterFirstSteps);
  

  //////////
  // Plot
  //////////
  if(fDebugLevel > 0.0) {

    Int_t ptpr = 0;
    if(fBeamType==0) ptpr=0;
    if(fBeamType==1) ptpr=1;
  
    TCanvas * ccorrected = new TCanvas("corrected","corrected",1000,700);
    ccorrected->Divide(2,1);
    ccorrected->cd(1);
    gPad->SetLogy();
    TGraphErrors* correctedspectrumD = Normalize(correctedspectrum);
    correctedspectrumD->SetTitle("");
    correctedspectrumD->GetYaxis()->SetTitleOffset(1.5);
    correctedspectrumD->GetYaxis()->SetRangeUser(0.000000001,1.0);
    correctedspectrumD->SetMarkerStyle(26);
    correctedspectrumD->SetMarkerColor(kBlue);
    correctedspectrumD->SetLineColor(kBlue);
    correctedspectrumD->Draw("AP");
    TGraphErrors* alltogetherspectrumD = Normalize(alltogetherCorrection);
    alltogetherspectrumD->SetTitle("");
    alltogetherspectrumD->GetYaxis()->SetTitleOffset(1.5);
    alltogetherspectrumD->GetYaxis()->SetRangeUser(0.000000001,1.0);
    alltogetherspectrumD->SetMarkerStyle(25);
    alltogetherspectrumD->SetMarkerColor(kBlack);
    alltogetherspectrumD->SetLineColor(kBlack);
    alltogetherspectrumD->Draw("P");
    TLegend *legcorrected = new TLegend(0.4,0.6,0.89,0.89);
    legcorrected->AddEntry(correctedspectrumD,"Corrected","p");
    legcorrected->AddEntry(alltogetherspectrumD,"Alltogether","p");
    legcorrected->Draw("same");
    ccorrected->cd(2);
    TH1D *correctedTH1D = correctedspectrum->Projection(ptpr);
    TH1D *alltogetherTH1D = (TH1D *) alltogetherCorrection->Project(ptpr);
    TH1D* ratiocorrected = (TH1D*)correctedTH1D->Clone();
    ratiocorrected->SetName("ratiocorrected");
    ratiocorrected->SetTitle("");
    ratiocorrected->GetYaxis()->SetTitle("Unfolded/DirectCorrected");
    ratiocorrected->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    ratiocorrected->Divide(correctedTH1D,alltogetherTH1D,1,1);
    ratiocorrected->SetStats(0);
    ratiocorrected->Draw();
    if(fWriteToFile)ccorrected->SaveAs("CorrectedPbPb.eps");

    //TH1D unfoldingspectrac[fNCentralityBinAtTheEnd];
    //TGraphErrors unfoldingspectracn[fNCentralityBinAtTheEnd];
    //TH1D correctedspectrac[fNCentralityBinAtTheEnd];
    //TGraphErrors correctedspectracn[fNCentralityBinAtTheEnd];

    TH1D *unfoldingspectrac = new TH1D[fNCentralityBinAtTheEnd];
    TGraphErrors *unfoldingspectracn = new TGraphErrors[fNCentralityBinAtTheEnd];
    TH1D *correctedspectrac = new TH1D[fNCentralityBinAtTheEnd];
    TGraphErrors *correctedspectracn = new TGraphErrors[fNCentralityBinAtTheEnd];

    if(fBeamType==1) {

      TCanvas * ccorrectedallspectra = new TCanvas("correctedallspectra","correctedallspectra",1000,700);
      ccorrectedallspectra->Divide(2,1);
      TLegend *legtotal = new TLegend(0.4,0.6,0.89,0.89);
      TLegend *legtotalg = new TLegend(0.4,0.6,0.89,0.89);
      
      THnSparseF* sparsesu = (THnSparseF *) correctedspectrum;
      TAxis *cenaxisa = sparsesu->GetAxis(0);
      THnSparseF* sparsed = (THnSparseF *) alltogetherCorrection->GetGrid();
      TAxis *cenaxisb = sparsed->GetAxis(0);
      Int_t nbbin = cenaxisb->GetNbins();
      Int_t stylee[20] = {20,21,22,23,24,25,26,27,28,30,4,5,7,29,29,29,29,29,29,29};
      Int_t colorr[20] = {2,3,4,5,6,7,8,9,46,38,29,30,31,32,33,34,35,37,38,20};
      for(Int_t binc = 0; binc < fNCentralityBinAtTheEnd; binc++){
        TString titlee("corrected_centrality_bin_");
        titlee += "[";
        titlee += fLowBoundaryCentralityBinAtTheEnd[binc];
        titlee += "_";
        titlee += fHighBoundaryCentralityBinAtTheEnd[binc];
        titlee += "[";
        TString titleec("corrected_check_projection_bin_");
        titleec += "[";
        titleec += fLowBoundaryCentralityBinAtTheEnd[binc];
        titleec += "_";
        titleec += fHighBoundaryCentralityBinAtTheEnd[binc];
        titleec += "[";
        TString titleenameunotnormalized("Unfolded_Notnormalized_centrality_bin_");
        titleenameunotnormalized += "[";
        titleenameunotnormalized += fLowBoundaryCentralityBinAtTheEnd[binc];
        titleenameunotnormalized += "_";
        titleenameunotnormalized += fHighBoundaryCentralityBinAtTheEnd[binc];
        titleenameunotnormalized += "[";
        TString titleenameunormalized("Unfolded_normalized_centrality_bin_");
        titleenameunormalized += "[";
        titleenameunormalized += fLowBoundaryCentralityBinAtTheEnd[binc];
        titleenameunormalized += "_";
        titleenameunormalized += fHighBoundaryCentralityBinAtTheEnd[binc];	
        titleenameunormalized += "[";
        TString titleenamednotnormalized("Dirrectcorrected_Notnormalized_centrality_bin_");
        titleenamednotnormalized += "[";
        titleenamednotnormalized += fLowBoundaryCentralityBinAtTheEnd[binc];
        titleenamednotnormalized += "_";
        titleenamednotnormalized += fHighBoundaryCentralityBinAtTheEnd[binc];
        titleenamednotnormalized += "[";
        TString titleenamednormalized("Dirrectedcorrected_normalized_centrality_bin_");
        titleenamednormalized += "[";
        titleenamednormalized += fLowBoundaryCentralityBinAtTheEnd[binc];
        titleenamednormalized += "_";
        titleenamednormalized += fHighBoundaryCentralityBinAtTheEnd[binc];	
        titleenamednormalized += "[";
        Int_t nbEvents = 0;
        for(Int_t k = fLowBoundaryCentralityBinAtTheEnd[binc]; k < fHighBoundaryCentralityBinAtTheEnd[binc]; k++) {
          printf("Number of events %d in the bin %d added!!!\n",fNEvents[k],k);
          nbEvents += fNEvents[k];
        }
        Double_t lowedgega = cenaxisa->GetBinLowEdge(fLowBoundaryCentralityBinAtTheEnd[binc]+1);
        Double_t upedgega = cenaxisa->GetBinUpEdge(fHighBoundaryCentralityBinAtTheEnd[binc]);
        printf("Bin Low edge %f, up edge %f for a\n",lowedgega,upedgega);
        Double_t lowedgegb = cenaxisb->GetBinLowEdge(fLowBoundaryCentralityBinAtTheEnd[binc]+1);
        Double_t upedgegb = cenaxisb->GetBinUpEdge(fHighBoundaryCentralityBinAtTheEnd[binc]);
        printf("Bin Low edge %f, up edge %f for b\n",lowedgegb,upedgegb);
        cenaxisa->SetRange(fLowBoundaryCentralityBinAtTheEnd[binc]+1,fHighBoundaryCentralityBinAtTheEnd[binc]);
        cenaxisb->SetRange(fLowBoundaryCentralityBinAtTheEnd[binc]+1,fHighBoundaryCentralityBinAtTheEnd[binc]);
        TCanvas * ccorrectedcheck = new TCanvas((const char*) titleec,(const char*) titleec,1000,700);
        ccorrectedcheck->cd(1);
        TH1D *aftersuc = (TH1D *) sparsesu->Projection(0);
        TH1D *aftersdc = (TH1D *) sparsed->Projection(0);
        aftersuc->Draw();
        aftersdc->Draw("same");
        TCanvas * ccorrectede = new TCanvas((const char*) titlee,(const char*) titlee,1000,700);
        ccorrectede->Divide(2,1);
        ccorrectede->cd(1);
        gPad->SetLogy();
        TH1D *aftersu = (TH1D *) sparsesu->Projection(1);
        CorrectFromTheWidth(aftersu);
        aftersu->SetName((const char*)titleenameunotnormalized);
        unfoldingspectrac[binc] = *aftersu;
        ccorrectede->cd(1);
        TGraphErrors* aftersun = NormalizeTH1N(aftersu,nbEvents);
        aftersun->SetTitle("");
        aftersun->GetYaxis()->SetTitleOffset(1.5);
        aftersun->GetYaxis()->SetRangeUser(0.000000001,1.0);
        aftersun->SetMarkerStyle(26);
        aftersun->SetMarkerColor(kBlue);
        aftersun->SetLineColor(kBlue);
        aftersun->Draw("AP");
        aftersun->SetName((const char*)titleenameunormalized);
        unfoldingspectracn[binc] = *aftersun;
        ccorrectede->cd(1);
        TH1D *aftersd = (TH1D *) sparsed->Projection(1);
        CorrectFromTheWidth(aftersd);
        aftersd->SetName((const char*)titleenamednotnormalized);
        correctedspectrac[binc] = *aftersd;
        ccorrectede->cd(1);
        TGraphErrors* aftersdn = NormalizeTH1N(aftersd,nbEvents);
        aftersdn->SetTitle("");
        aftersdn->GetYaxis()->SetTitleOffset(1.5);
        aftersdn->GetYaxis()->SetRangeUser(0.000000001,1.0);
        aftersdn->SetMarkerStyle(25);
        aftersdn->SetMarkerColor(kBlack);
        aftersdn->SetLineColor(kBlack);
        aftersdn->Draw("P");
        aftersdn->SetName((const char*)titleenamednormalized);
        correctedspectracn[binc] = *aftersdn;
        TLegend *legcorrectedud = new TLegend(0.4,0.6,0.89,0.89);
        legcorrectedud->AddEntry(aftersun,"Corrected","p");
        legcorrectedud->AddEntry(aftersdn,"Alltogether","p");
        legcorrectedud->Draw("same");
        ccorrectedallspectra->cd(1);
        gPad->SetLogy();
        TH1D *aftersunn = (TH1D *) aftersun->Clone();
        aftersunn->SetMarkerStyle(stylee[binc]);
        aftersunn->SetMarkerColor(colorr[binc]);
        if(binc==0) aftersunn->Draw("AP");
        else aftersunn->Draw("P");
        legtotal->AddEntry(aftersunn,(const char*) titlee,"p");
        ccorrectedallspectra->cd(2);
        gPad->SetLogy();
        TH1D *aftersdnn = (TH1D *) aftersdn->Clone();
        aftersdnn->SetMarkerStyle(stylee[binc]);
        aftersdnn->SetMarkerColor(colorr[binc]);
        if(binc==0) aftersdnn->Draw("AP");
        else aftersdnn->Draw("P");
        legtotalg->AddEntry(aftersdnn,(const char*) titlee,"p");
        ccorrectede->cd(2);
        TH1D* ratiocorrectedbinc = (TH1D*)aftersu->Clone();
        TString titleee("ratiocorrected_bin_");
        titleee += binc;
        ratiocorrectedbinc->SetName((const char*) titleee);
        ratiocorrectedbinc->SetTitle("");
        ratiocorrectedbinc->GetYaxis()->SetTitle("Unfolded/DirectCorrected");
        ratiocorrectedbinc->GetXaxis()->SetTitle("p_{T} [GeV/c]");
        ratiocorrectedbinc->Divide(aftersu,aftersd,1,1);
        ratiocorrectedbinc->SetStats(0);
        ratiocorrectedbinc->Draw();
      }

      ccorrectedallspectra->cd(1);
      legtotal->Draw("same");
      ccorrectedallspectra->cd(2);
      legtotalg->Draw("same");
      
      cenaxisa->SetRange(0,nbbin);
      cenaxisb->SetRange(0,nbbin);
      if(fWriteToFile) ccorrectedallspectra->SaveAs("CorrectedPbPb.eps");
    }

    // Dump to file if needed
    if(fDumpToFile) {
      TFile *out = new TFile("finalSpectrum.root","recreate");
      correctedspectrumD->SetName("UnfoldingCorrectedSpectrum");
      correctedspectrumD->Write();
      alltogetherspectrumD->SetName("AlltogetherSpectrum");
      alltogetherspectrumD->Write();
      ratiocorrected->SetName("RatioUnfoldingAlltogetherSpectrum");
      ratiocorrected->Write();
      correctedspectrum->SetName("UnfoldingCorrectedNotNormalizedSpectrum");
      correctedspectrum->Write();
      alltogetherCorrection->SetName("AlltogetherCorrectedNotNormalizedSpectrum");
      alltogetherCorrection->Write();
      rawsave->Write();
      for(Int_t binc = 0; binc < fNCentralityBinAtTheEnd; binc++){
	      unfoldingspectrac[binc].Write();
	      unfoldingspectracn[binc].Write();
	      correctedspectrac[binc].Write();
	      correctedspectracn[binc].Write();
      }
      out->Close(); delete out;
    }

    if (unfoldingspectrac) delete[] unfoldingspectrac;
    if (unfoldingspectracn)  delete[] unfoldingspectracn;
    if (correctedspectrac) delete[] correctedspectrac;
    if (correctedspectracn) delete[] correctedspectracn;

  }

  return kTRUE;
}

//____________________________________________________________
Bool_t AliHFEspectrum::CorrectBeauty(Bool_t subtractcontamination){
  //
  // Correct the spectrum for efficiency and unfolding for beauty analysis
  // with both method and compare
  //
  
  gStyle->SetPalette(1);
  gStyle->SetOptStat(1111);
  gStyle->SetPadBorderMode(0);
  gStyle->SetCanvasColor(10);
  gStyle->SetPadLeftMargin(0.13);
  gStyle->SetPadRightMargin(0.13);

  ///////////////////////////
  // Check initialization
  ///////////////////////////

  if((!GetContainer(kDataContainer)) || (!GetContainer(kMCContainerMC)) || (!GetContainer(kMCContainerESD))){
    AliInfo("You have to init before");
    return kFALSE;
  }
  
  if((fStepTrue == 0) && (fStepMC == 0) && (fStepData == 0)) {
    AliInfo("You have to set the steps before: SetMCTruthStep, SetMCEffStep, SetStepToCorrect");
    return kFALSE;
  }
 
  SetNumberOfIteration(10);
  SetStepGuessedUnfolding(AliHFEcuts::kStepRecKineITSTPC + AliHFEcuts::kNcutStepsMCTrack);
    
  AliCFDataGrid *dataGridAfterFirstSteps = 0x0;
  //////////////////////////////////
  // Subtract hadron background
  /////////////////////////////////
  AliCFDataGrid *dataspectrumaftersubstraction = 0x0;
  AliCFDataGrid *unnormalizedRawSpectrum = 0x0;
  TGraphErrors *gNormalizedRawSpectrum = 0x0;
  if(subtractcontamination) {
      if(!fBeauty2ndMethod) dataspectrumaftersubstraction = SubtractBackground(kTRUE);
      else dataspectrumaftersubstraction = GetRawBspectra2ndMethod();
      unnormalizedRawSpectrum = (AliCFDataGrid*)dataspectrumaftersubstraction->Clone();
      dataGridAfterFirstSteps = dataspectrumaftersubstraction;
      gNormalizedRawSpectrum = Normalize(unnormalizedRawSpectrum);
  }

  printf("after normalize getting IP \n");

  /////////////////////////////////////////////////////////////////////////////////////////
  // Correct for IP efficiency for beauty electrons after subtracting all the backgrounds
  /////////////////////////////////////////////////////////////////////////////////////////

  AliCFDataGrid *dataspectrumafterefficiencyparametrizedcorrection = 0x0;
  AliCFDataGrid *dataspectrumafterV0efficiencycorrection = 0x0;
  AliCFContainer *dataContainerV0 = GetContainer(kDataContainerV0);

  if(fEfficiencyFunction){
    dataspectrumafterefficiencyparametrizedcorrection = CorrectParametrizedEfficiency(dataGridAfterFirstSteps);
    dataGridAfterFirstSteps = dataspectrumafterefficiencyparametrizedcorrection;
  }
  else if(dataContainerV0){
    dataspectrumafterV0efficiencycorrection = CorrectV0Efficiency(dataspectrumaftersubstraction);
    dataGridAfterFirstSteps = dataspectrumafterV0efficiencycorrection;  
  }  
 


  ///////////////
  // Unfold
  //////////////
  TList *listunfolded = Unfold(dataGridAfterFirstSteps);
  if(!listunfolded){
    printf("Unfolded failed\n");
    return kFALSE;
  }
  THnSparse *correctedspectrum = (THnSparse *) listunfolded->At(0);
  THnSparse *residualspectrum = (THnSparse *) listunfolded->At(1);
  if(!correctedspectrum){
    AliError("No corrected spectrum\n");
    return kFALSE;
  }
  if(!residualspectrum){
    AliError("No residual spectrum\n");
    return kFALSE;
  }   
  
  /////////////////////
  // Simply correct
  ////////////////////

  AliCFDataGrid *alltogetherCorrection = CorrectForEfficiency(dataGridAfterFirstSteps);
  

  //////////
  // Plot
  //////////

  if(fDebugLevel > 0.0) {

    Int_t ptpr = 0;
    if(fBeamType==0) ptpr=0;
    if(fBeamType==1) ptpr=1;
  
    TCanvas * ccorrected = new TCanvas("corrected","corrected",1000,700);
    ccorrected->Divide(2,1);
    ccorrected->cd(1);
    gPad->SetLogy();
    TGraphErrors* correctedspectrumD = Normalize(correctedspectrum);
    correctedspectrumD->SetTitle("");
    correctedspectrumD->GetYaxis()->SetTitleOffset(1.5);
    correctedspectrumD->GetYaxis()->SetRangeUser(0.000000001,1.0);
    correctedspectrumD->SetMarkerStyle(26);
    correctedspectrumD->SetMarkerColor(kBlue);
    correctedspectrumD->SetLineColor(kBlue);
    correctedspectrumD->Draw("AP");
    TGraphErrors* alltogetherspectrumD = Normalize(alltogetherCorrection);
    alltogetherspectrumD->SetTitle("");
    alltogetherspectrumD->GetYaxis()->SetTitleOffset(1.5);
    alltogetherspectrumD->GetYaxis()->SetRangeUser(0.000000001,1.0);
    alltogetherspectrumD->SetMarkerStyle(25);
    alltogetherspectrumD->SetMarkerColor(kBlack);
    alltogetherspectrumD->SetLineColor(kBlack);
    alltogetherspectrumD->Draw("P");
    TLegend *legcorrected = new TLegend(0.4,0.6,0.89,0.89);
    legcorrected->AddEntry(correctedspectrumD,"Corrected","p");
    legcorrected->AddEntry(alltogetherspectrumD,"Alltogether","p");
    legcorrected->Draw("same");
    ccorrected->cd(2);
    TH1D *correctedTH1D = correctedspectrum->Projection(ptpr);
    TH1D *alltogetherTH1D = (TH1D *) alltogetherCorrection->Project(ptpr);
    TH1D* ratiocorrected = (TH1D*)correctedTH1D->Clone();
    ratiocorrected->SetName("ratiocorrected");
    ratiocorrected->SetTitle("");
    ratiocorrected->GetYaxis()->SetTitle("Unfolded/DirectCorrected");
    ratiocorrected->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    ratiocorrected->Divide(correctedTH1D,alltogetherTH1D,1,1);
    ratiocorrected->SetStats(0);
    ratiocorrected->Draw();
    if(fWriteToFile) ccorrected->SaveAs("CorrectedBeauty.eps");

    if(fBeamType == 0){
	if(fNonHFEsyst){
	    CalculateNonHFEsyst(0);
	}
    }

    // Dump to file if needed

    if(fDumpToFile) {
        // to do centrality dependent

      TFile *out;
      out = new TFile("finalSpectrum.root","recreate");
      out->cd();
      //
      correctedspectrumD->SetName("UnfoldingCorrectedSpectrum");
      correctedspectrumD->Write();
      alltogetherspectrumD->SetName("AlltogetherSpectrum");
      alltogetherspectrumD->Write();
      ratiocorrected->SetName("RatioUnfoldingAlltogetherSpectrum");
      ratiocorrected->Write();
      //
      correctedspectrum->SetName("UnfoldingCorrectedNotNormalizedSpectrum");
      correctedspectrum->Write();
      alltogetherCorrection->SetName("AlltogetherCorrectedNotNormalizedSpectrum");
      alltogetherCorrection->Write();
      //
      if(unnormalizedRawSpectrum) {
      unnormalizedRawSpectrum->SetName("beautyAfterIP");
      unnormalizedRawSpectrum->Write();
      }

      if(gNormalizedRawSpectrum){
        gNormalizedRawSpectrum->SetName("normalizedBeautyAfterIP");
        gNormalizedRawSpectrum->Write();
      }

      if(fBeamType==0) {
          Int_t countpp=0;
	  fEfficiencyCharmSigD[countpp]->SetTitle(Form("IPEfficiencyForCharmSigCent%i",countpp));
	  fEfficiencyCharmSigD[countpp]->SetName(Form("IPEfficiencyForCharmSigCent%i",countpp));
	  fEfficiencyCharmSigD[countpp]->Write();
	  fEfficiencyBeautySigD[countpp]->SetTitle(Form("IPEfficiencyForBeautySigCent%i",countpp));
	  fEfficiencyBeautySigD[countpp]->SetName(Form("IPEfficiencyForBeautySigCent%i",countpp));
	  fEfficiencyBeautySigD[countpp]->Write();
	  fCharmEff[countpp]->SetTitle(Form("IPEfficiencyForCharmCent%i",countpp));
	  fCharmEff[countpp]->SetName(Form("IPEfficiencyForCharmCent%i",countpp));
	  fCharmEff[countpp]->Write();
	  fBeautyEff[countpp]->SetTitle(Form("IPEfficiencyForBeautyCent%i",countpp));
	  fBeautyEff[countpp]->SetName(Form("IPEfficiencyForBeautyCent%i",countpp));
	  fBeautyEff[countpp]->Write();
	  fConversionEff[countpp]->SetTitle(Form("IPEfficiencyForConversionCent%i",countpp));
	  fConversionEff[countpp]->SetName(Form("IPEfficiencyForConversionCent%i",countpp));
	  fConversionEff[countpp]->Write();
	  fNonHFEEff[countpp]->SetTitle(Form("IPEfficiencyForNonHFECent%i",countpp));
	  fNonHFEEff[countpp]->SetName(Form("IPEfficiencyForNonHFECent%i",countpp));
	  fNonHFEEff[countpp]->Write();
      }

      if(fBeamType==1) {

	  TGraphErrors* correctedspectrumDc[kCentrality];
          TGraphErrors* alltogetherspectrumDc[kCentrality];
	  for(Int_t i=0;i<kCentrality-2;i++)
	  {
	      correctedspectrum->GetAxis(0)->SetRange(i+1,i+1);
	      correctedspectrumDc[i] = Normalize(correctedspectrum,i);
              if(correctedspectrumDc[i]){
                correctedspectrumDc[i]->SetTitle(Form("UnfoldingCorrectedSpectrum_%i",i));
                correctedspectrumDc[i]->SetName(Form("UnfoldingCorrectedSpectrum_%i",i));
                correctedspectrumDc[i]->Write();
              }
	      alltogetherCorrection->GetAxis(0)->SetRange(i+1,i+1);
	      alltogetherspectrumDc[i] = Normalize(alltogetherCorrection,i);
              if(alltogetherspectrumDc[i]){
                alltogetherspectrumDc[i]->SetTitle(Form("AlltogetherSpectrum_%i",i));
                alltogetherspectrumDc[i]->SetName(Form("AlltogetherSpectrum_%i",i));
                alltogetherspectrumDc[i]->Write();
              }
	    
	      TH1D *centrcrosscheck = correctedspectrum->Projection(0);
	      centrcrosscheck->SetTitle(Form("centrality_%i",i));
	      centrcrosscheck->SetName(Form("centrality_%i",i));
	      centrcrosscheck->Write();

	      TH1D *correctedTH1Dc = correctedspectrum->Projection(ptpr);
	      TH1D *alltogetherTH1Dc = (TH1D *) alltogetherCorrection->Project(ptpr);

	      TH1D *centrcrosscheck2 =  (TH1D *) alltogetherCorrection->Project(0);
	      centrcrosscheck2->SetTitle(Form("centrality2_%i",i));
	      centrcrosscheck2->SetName(Form("centrality2_%i",i));
	      centrcrosscheck2->Write();

	      TH1D* ratiocorrectedc = (TH1D*)correctedTH1D->Clone();
	      ratiocorrectedc->Divide(correctedTH1Dc,alltogetherTH1Dc,1,1);
	      ratiocorrectedc->SetTitle(Form("RatioUnfoldingAlltogetherSpectrum_%i",i));
	      ratiocorrectedc->SetName(Form("RatioUnfoldingAlltogetherSpectrum_%i",i));
              ratiocorrectedc->Write();

              fEfficiencyCharmSigD[i]->SetTitle(Form("IPEfficiencyForCharmSigCent%i",i));
	      fEfficiencyCharmSigD[i]->SetName(Form("IPEfficiencyForCharmSigCent%i",i));
              fEfficiencyCharmSigD[i]->Write();
	      fEfficiencyBeautySigD[i]->SetTitle(Form("IPEfficiencyForBeautySigCent%i",i));
	      fEfficiencyBeautySigD[i]->SetName(Form("IPEfficiencyForBeautySigCent%i",i));
              fEfficiencyBeautySigD[i]->Write();
	      fCharmEff[i]->SetTitle(Form("IPEfficiencyForCharmCent%i",i));
	      fCharmEff[i]->SetName(Form("IPEfficiencyForCharmCent%i",i));
              fCharmEff[i]->Write();
	      fBeautyEff[i]->SetTitle(Form("IPEfficiencyForBeautyCent%i",i));
	      fBeautyEff[i]->SetName(Form("IPEfficiencyForBeautyCent%i",i));
              fBeautyEff[i]->Write();
	      fConversionEff[i]->SetTitle(Form("IPEfficiencyForConversionCent%i",i));
	      fConversionEff[i]->SetName(Form("IPEfficiencyForConversionCent%i",i));
              fConversionEff[i]->Write();
	      fNonHFEEff[i]->SetTitle(Form("IPEfficiencyForNonHFECent%i",i));
	      fNonHFEEff[i]->SetName(Form("IPEfficiencyForNonHFECent%i",i));
              fNonHFEEff[i]->Write();
	  }

      }

      out->Close(); 
      delete out;
    }
  }

  return kTRUE;
}

//____________________________________________________________
AliCFDataGrid* AliHFEspectrum::SubtractBackground(Bool_t setBackground){
  //
  // Apply background subtraction
  //

    Int_t ptpr = 0;
    Int_t nbins=1;
    if(fBeamType==0)
    {
	ptpr=0;
        nbins=1;
    }
    if(fBeamType==1)
    {
	ptpr=1;
	nbins=2;
    }

  // Raw spectrum
  AliCFContainer *dataContainer = GetContainer(kDataContainer);
  if(!dataContainer){
    AliError("Data Container not available");
    return NULL;
  }
  printf("Step data: %d\n",fStepData);
  AliCFDataGrid *spectrumSubtracted = new AliCFDataGrid("spectrumSubtracted", "Data Grid for spectrum after Background subtraction", *dataContainer,fStepData);

  AliCFDataGrid *dataspectrumbeforesubstraction = (AliCFDataGrid *) ((AliCFDataGrid *)GetSpectrum(GetContainer(kDataContainer),fStepData))->Clone();
  dataspectrumbeforesubstraction->SetName("dataspectrumbeforesubstraction"); 
 

  // Background Estimate
  AliCFContainer *backgroundContainer = GetContainer(kBackgroundData);
  if(!backgroundContainer){
    AliError("MC background container not found");
    return NULL;
  }
 
  Int_t stepbackground = 1; // 2 for !fInclusiveSpectrum analysis(old method)
  AliCFDataGrid *backgroundGrid = new AliCFDataGrid("ContaminationGrid","ContaminationGrid",*backgroundContainer,stepbackground);

  if(!fInclusiveSpectrum){
    //Background subtraction for IP analysis

    TH1D *incElecCent[kCentrality-1];
    TH1D *charmCent[kCentrality-1];
    TH1D *convCent[kCentrality-1];
    TH1D *nonHFECent[kCentrality-1]; 
    TH1D *subtractedCent[kCentrality-1];
    TH1D *measuredTH1Draw = (TH1D *) dataspectrumbeforesubstraction->Project(ptpr);
    CorrectFromTheWidth(measuredTH1Draw);
    if(fBeamType==1){
      THnSparseF* sparseIncElec = (THnSparseF *) dataspectrumbeforesubstraction->GetGrid();
      for(Int_t icent =  1; icent < kCentrality-1; icent++){
        sparseIncElec->GetAxis(0)->SetRange(icent,icent);
        incElecCent[icent-1] = (TH1D *) sparseIncElec->Projection(ptpr);
        CorrectFromTheWidth(incElecCent[icent-1]);
      }
    }
    TCanvas *rawspectra = new TCanvas("rawspectra","rawspectra",500,400);
    rawspectra->cd();
    rawspectra->SetLogy();
    gStyle->SetOptStat(0);
    TLegend *lRaw = new TLegend(0.55,0.55,0.85,0.85);
    measuredTH1Draw->SetMarkerStyle(20);
    measuredTH1Draw->Draw();
    measuredTH1Draw->GetXaxis()->SetRangeUser(0.0,7.9);
    lRaw->AddEntry(measuredTH1Draw,"measured raw spectrum");
    TH1D* htemp;
    Int_t* bins=new Int_t[2];
    if(fIPanaHadronBgSubtract){
      // Hadron background
	printf("Hadron background for IP analysis subtracted!\n");
	if(fBeamType==0)
	{

	    htemp  = (TH1D *) fHadronEffbyIPcut->Projection(0);
	    bins[0]=htemp->GetNbinsX();
	}
	if(fBeamType==1)
	{
	    htemp  = (TH1D *) fHadronEffbyIPcut->Projection(0);
	    bins[0]=htemp->GetNbinsX();
	    htemp  = (TH1D *) fHadronEffbyIPcut->Projection(1);
	    bins[1]=htemp->GetNbinsX();
	}
      AliCFDataGrid *hbgContainer = new AliCFDataGrid("hbgContainer","hadron bg after IP cut",nbins,bins);
      hbgContainer->SetGrid(fHadronEffbyIPcut);
      backgroundGrid->Multiply(hbgContainer,1);
      // draw raw hadron bg spectra
      TH1D *hadronbg= (TH1D *) backgroundGrid->Project(ptpr);
      CorrectFromTheWidth(hadronbg);
      hadronbg->SetMarkerColor(7);
      hadronbg->SetMarkerStyle(20);
      rawspectra->cd();
      hadronbg->Draw("samep");
      lRaw->AddEntry(hadronbg,"hadrons");
      // subtract hadron contamination
      spectrumSubtracted->Add(backgroundGrid,-1.0);
    }
    if(fIPanaCharmBgSubtract){
      // Charm background
      printf("Charm background for IP analysis subtracted!\n");
      AliCFDataGrid *charmbgContainer = (AliCFDataGrid *) GetCharmBackground();
      // draw charm bg spectra
      TH1D *charmbg= (TH1D *) charmbgContainer->Project(ptpr);
      CorrectFromTheWidth(charmbg);
      charmbg->SetMarkerColor(3);
      charmbg->SetMarkerStyle(20);
      rawspectra->cd();
      charmbg->Draw("samep");
      lRaw->AddEntry(charmbg,"charm elecs");
      // subtract charm background
      spectrumSubtracted->Add(charmbgContainer,-1.0);
      if(fBeamType==1){
        THnSparseF* sparseCharmElec = (THnSparseF *) charmbgContainer->GetGrid();
        for(Int_t icent =  1; icent < kCentrality-1; icent++){ 
          sparseCharmElec->GetAxis(0)->SetRange(icent,icent);
          charmCent[icent-1] = (TH1D *) sparseCharmElec->Projection(ptpr);
          CorrectFromTheWidth(charmCent[icent-1]);
        }
      }
    }
    if(fIPanaConversionBgSubtract){
      // Conversion background
      AliCFDataGrid *conversionbgContainer = (AliCFDataGrid *) GetConversionBackground(); 
      // draw conversion bg spectra
      TH1D *conversionbg= (TH1D *) conversionbgContainer->Project(ptpr);
      CorrectFromTheWidth(conversionbg);
      conversionbg->SetMarkerColor(4);
      conversionbg->SetMarkerStyle(20);
      rawspectra->cd();
      conversionbg->Draw("samep");
      lRaw->AddEntry(conversionbg,"conversion elecs");
      // subtract conversion background
      spectrumSubtracted->Add(conversionbgContainer,-1.0);
      if(fBeamType==1){
        THnSparseF* sparseconvElec = (THnSparseF *) conversionbgContainer->GetGrid();
        for(Int_t icent =  1; icent < kCentrality-1; icent++){
          sparseconvElec->GetAxis(0)->SetRange(icent,icent);
          convCent[icent-1] = (TH1D *) sparseconvElec->Projection(ptpr);
          CorrectFromTheWidth(convCent[icent-1]);
        }
      }
    }
    if(fIPanaNonHFEBgSubtract){
      // NonHFE background
      AliCFDataGrid *nonHFEbgContainer = (AliCFDataGrid *) GetNonHFEBackground();
      // draw Dalitz/dielectron bg spectra
      TH1D *nonhfebg= (TH1D *) nonHFEbgContainer->Project(ptpr);
      CorrectFromTheWidth(nonhfebg);
      nonhfebg->SetMarkerColor(6);
      nonhfebg->SetMarkerStyle(20);
      rawspectra->cd();
      nonhfebg->Draw("samep");
      lRaw->AddEntry(nonhfebg,"non-HF elecs");
      // subtract Dalitz/dielectron background
      spectrumSubtracted->Add(nonHFEbgContainer,-1.0);
      if(fBeamType==1){
        THnSparseF* sparseNonHFEElec = (THnSparseF *) nonHFEbgContainer->GetGrid();
        for(Int_t icent =  1; icent < kCentrality-1; icent++){
          sparseNonHFEElec->GetAxis(0)->SetRange(icent,icent);
          nonHFECent[icent-1] = (TH1D *) sparseNonHFEElec->Projection(ptpr);
          CorrectFromTheWidth(nonHFECent[icent-1]);
        }
      }
    }

    TH1D *rawbgsubtracted = (TH1D *) spectrumSubtracted->Project(ptpr);
    CorrectFromTheWidth(rawbgsubtracted);
    rawbgsubtracted->SetMarkerStyle(24);
    rawspectra->cd();
    lRaw->AddEntry(rawbgsubtracted,"subtracted raw spectrum");
    rawbgsubtracted->Draw("samep");
    lRaw->Draw("SAME");
    gPad->SetGrid();
    //rawspectra->SaveAs("rawspectra.eps");
    
    if(fBeamType==1){
      THnSparseF* sparseSubtracted = (THnSparseF *) spectrumSubtracted->GetGrid();
      for(Int_t icent =  1; icent < kCentrality-1; icent++){
        sparseSubtracted->GetAxis(0)->SetRange(icent,icent);
        subtractedCent[icent-1] = (TH1D *) sparseSubtracted->Projection(ptpr);
        CorrectFromTheWidth(subtractedCent[icent-1]);
      }
    
      TLegend *lCentRaw = new TLegend(0.55,0.55,0.85,0.85);
      TCanvas *centRaw = new TCanvas("centRaw","centRaw",1000,800);
      centRaw->Divide(3,3);
      for(Int_t icent = 1; icent < kCentrality-1; icent++){
        centRaw->cd(icent);
        gPad->SetLogx();
        gPad->SetLogy();
        incElecCent[icent-1]->GetXaxis()->SetRangeUser(0.4,8.);
        incElecCent[icent-1]->Draw("p");
        incElecCent[icent-1]->SetMarkerColor(1);
        incElecCent[icent-1]->SetMarkerStyle(20);
        charmCent[icent-1]->Draw("samep");
        charmCent[icent-1]->SetMarkerColor(3);
        charmCent[icent-1]->SetMarkerStyle(20);
        convCent[icent-1]->Draw("samep");
        convCent[icent-1]->SetMarkerColor(4);
        convCent[icent-1]->SetMarkerStyle(20);
        nonHFECent[icent-1]->Draw("samep");
        nonHFECent[icent-1]->SetMarkerColor(6);
        nonHFECent[icent-1]->SetMarkerStyle(20);
        subtractedCent[icent-1]->Draw("samep");
        subtractedCent[icent-1]->SetMarkerStyle(24);
        if(icent == 1){
          lCentRaw->AddEntry(incElecCent[0],"inclusive electron spectrum");
          lCentRaw->AddEntry(charmCent[0],"charm elecs");
          lCentRaw->AddEntry(convCent[0],"conversion elecs");
          lCentRaw->AddEntry(nonHFECent[0],"non-HF elecs");
          lCentRaw->AddEntry(subtractedCent[0],"subtracted electron spectrum");
          lCentRaw->Draw("SAME");
        }
      }
    }

    delete[] bins; 

  }
  else{
    // Subtract 
    spectrumSubtracted->Add(backgroundGrid,-1.0);
  }

  if(setBackground){
    if(fBackground) delete fBackground;
    fBackground = backgroundGrid;
  } else delete backgroundGrid;


  if(fDebugLevel > 0) {

    Int_t ptprd;
    if(fBeamType==0) ptprd=0;
    if(fBeamType==1) ptprd=1;
    
    TCanvas * cbackgroundsubtraction = new TCanvas("backgroundsubtraction","backgroundsubtraction",1000,700);
    cbackgroundsubtraction->Divide(3,1);
    cbackgroundsubtraction->cd(1);
    gPad->SetLogy();
    TH1D *measuredTH1Daftersubstraction = (TH1D *) spectrumSubtracted->Project(ptprd);
    TH1D *measuredTH1Dbeforesubstraction = (TH1D *) dataspectrumbeforesubstraction->Project(ptprd);
    CorrectFromTheWidth(measuredTH1Daftersubstraction);
    CorrectFromTheWidth(measuredTH1Dbeforesubstraction);
    measuredTH1Daftersubstraction->SetStats(0);
    measuredTH1Daftersubstraction->SetTitle("");
    measuredTH1Daftersubstraction->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
    measuredTH1Daftersubstraction->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    measuredTH1Daftersubstraction->SetMarkerStyle(25);
    measuredTH1Daftersubstraction->SetMarkerColor(kBlack);
    measuredTH1Daftersubstraction->SetLineColor(kBlack);
    measuredTH1Dbeforesubstraction->SetStats(0);
    measuredTH1Dbeforesubstraction->SetTitle("");
    measuredTH1Dbeforesubstraction->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
    measuredTH1Dbeforesubstraction->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    measuredTH1Dbeforesubstraction->SetMarkerStyle(24);
    measuredTH1Dbeforesubstraction->SetMarkerColor(kBlue);
    measuredTH1Dbeforesubstraction->SetLineColor(kBlue);
    measuredTH1Daftersubstraction->Draw();
    measuredTH1Dbeforesubstraction->Draw("same");
    TLegend *legsubstraction = new TLegend(0.4,0.6,0.89,0.89);
    legsubstraction->AddEntry(measuredTH1Dbeforesubstraction,"With hadron contamination","p");
    legsubstraction->AddEntry(measuredTH1Daftersubstraction,"Without hadron contamination ","p");
    legsubstraction->Draw("same");
    cbackgroundsubtraction->cd(2);
    gPad->SetLogy();
    TH1D* ratiomeasuredcontamination = (TH1D*)measuredTH1Dbeforesubstraction->Clone();
    ratiomeasuredcontamination->SetName("ratiomeasuredcontamination");
    ratiomeasuredcontamination->SetTitle("");
    ratiomeasuredcontamination->GetYaxis()->SetTitle("(with contamination - without contamination) / with contamination");
    ratiomeasuredcontamination->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    ratiomeasuredcontamination->Sumw2();
    ratiomeasuredcontamination->Add(measuredTH1Daftersubstraction,-1.0);
    ratiomeasuredcontamination->Divide(measuredTH1Dbeforesubstraction);
    ratiomeasuredcontamination->SetStats(0);
    ratiomeasuredcontamination->SetMarkerStyle(26);
    ratiomeasuredcontamination->SetMarkerColor(kBlack);
    ratiomeasuredcontamination->SetLineColor(kBlack);
    for(Int_t k=0; k < ratiomeasuredcontamination->GetNbinsX(); k++){
      ratiomeasuredcontamination->SetBinError(k+1,0.0);
    }
    ratiomeasuredcontamination->Draw("P");
    cbackgroundsubtraction->cd(3);
    TH1D *measuredTH1background = (TH1D *) backgroundGrid->Project(ptprd);
    CorrectFromTheWidth(measuredTH1background);
    measuredTH1background->SetStats(0);
    measuredTH1background->SetTitle("");
    measuredTH1background->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
    measuredTH1background->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    measuredTH1background->SetMarkerStyle(26);
    measuredTH1background->SetMarkerColor(kBlack);
    measuredTH1background->SetLineColor(kBlack);
    measuredTH1background->Draw();
    if(fWriteToFile) cbackgroundsubtraction->SaveAs("BackgroundSubtracted.eps");

    if(fBeamType==1) {

      TCanvas * cbackgrounde = new TCanvas("BackgroundSubtraction_allspectra","BackgroundSubtraction_allspectra",1000,700);
      cbackgrounde->Divide(2,1);
      TLegend *legtotal = new TLegend(0.4,0.6,0.89,0.89);
      TLegend *legtotalg = new TLegend(0.4,0.6,0.89,0.89);
     
      THnSparseF* sparsesubtracted = (THnSparseF *) spectrumSubtracted->GetGrid();
      TAxis *cenaxisa = sparsesubtracted->GetAxis(0);
      THnSparseF* sparsebefore = (THnSparseF *) dataspectrumbeforesubstraction->GetGrid();
      TAxis *cenaxisb = sparsebefore->GetAxis(0);
      Int_t nbbin = cenaxisb->GetNbins();
      Int_t stylee[20] = {20,21,22,23,24,25,26,27,28,30,4,5,7,29,29,29,29,29,29,29};
      Int_t colorr[20] = {2,3,4,5,6,7,8,9,46,38,29,30,31,32,33,34,35,37,38,20};
      for(Int_t binc = 0; binc < nbbin; binc++){
        TString titlee("BackgroundSubtraction_centrality_bin_");
        titlee += binc;
        TCanvas * cbackground = new TCanvas((const char*) titlee,(const char*) titlee,1000,700);
        cbackground->Divide(2,1);
        cbackground->cd(1);
        gPad->SetLogy();
        cenaxisa->SetRange(binc+1,binc+1);
        cenaxisb->SetRange(binc+1,binc+1);
        TH1D *aftersubstraction = (TH1D *) sparsesubtracted->Projection(1);
        TH1D *beforesubstraction = (TH1D *) sparsebefore->Projection(1);
        CorrectFromTheWidth(aftersubstraction);
        CorrectFromTheWidth(beforesubstraction);
        aftersubstraction->SetStats(0);
        aftersubstraction->SetTitle((const char*)titlee);
        aftersubstraction->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
        aftersubstraction->GetXaxis()->SetTitle("p_{T} [GeV/c]");
        aftersubstraction->SetMarkerStyle(25);
        aftersubstraction->SetMarkerColor(kBlack);
        aftersubstraction->SetLineColor(kBlack);
        beforesubstraction->SetStats(0);
        beforesubstraction->SetTitle((const char*)titlee);
        beforesubstraction->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
        beforesubstraction->GetXaxis()->SetTitle("p_{T} [GeV/c]");
        beforesubstraction->SetMarkerStyle(24);
        beforesubstraction->SetMarkerColor(kBlue);
        beforesubstraction->SetLineColor(kBlue);
        aftersubstraction->Draw();
        beforesubstraction->Draw("same");
        TLegend *lega = new TLegend(0.4,0.6,0.89,0.89);
        lega->AddEntry(beforesubstraction,"With hadron contamination","p");
        lega->AddEntry(aftersubstraction,"Without hadron contamination ","p");
        lega->Draw("same");
        cbackgrounde->cd(1);
        gPad->SetLogy();
        TH1D *aftersubtractionn = (TH1D *) aftersubstraction->Clone();
        aftersubtractionn->SetMarkerStyle(stylee[binc]);
        aftersubtractionn->SetMarkerColor(colorr[binc]);
        if(binc==0) aftersubtractionn->Draw();
        else aftersubtractionn->Draw("same");
        legtotal->AddEntry(aftersubtractionn,(const char*) titlee,"p");
        cbackgrounde->cd(2);
        gPad->SetLogy();
        TH1D *aftersubtractionng = (TH1D *) aftersubstraction->Clone();
        aftersubtractionng->SetMarkerStyle(stylee[binc]);
        aftersubtractionng->SetMarkerColor(colorr[binc]);
        if(fNEvents[binc] > 0.0) aftersubtractionng->Scale(1/(Double_t)fNEvents[binc]);
        if(binc==0) aftersubtractionng->Draw();
        else aftersubtractionng->Draw("same");
        legtotalg->AddEntry(aftersubtractionng,(const char*) titlee,"p");
        cbackground->cd(2);
        TH1D* ratiocontamination = (TH1D*)beforesubstraction->Clone();
        ratiocontamination->SetName("ratiocontamination");
        ratiocontamination->SetTitle((const char*)titlee);
        ratiocontamination->GetYaxis()->SetTitle("(with contamination - without contamination) / with contamination");
        ratiocontamination->GetXaxis()->SetTitle("p_{T} [GeV/c]");
        ratiocontamination->Add(aftersubstraction,-1.0);
        ratiocontamination->Divide(beforesubstraction);
        Int_t totalbin = ratiocontamination->GetXaxis()->GetNbins();
        for(Int_t nbinpt = 0; nbinpt < totalbin; nbinpt++) {
          ratiocontamination->SetBinError(nbinpt+1,0.0);
        }
        ratiocontamination->SetStats(0);
        ratiocontamination->SetMarkerStyle(26);
        ratiocontamination->SetMarkerColor(kBlack);
        ratiocontamination->SetLineColor(kBlack);
        ratiocontamination->Draw("P");
      }
     
      cbackgrounde->cd(1);
      legtotal->Draw("same");
      cbackgrounde->cd(2);
      legtotalg->Draw("same");

      cenaxisa->SetRange(0,nbbin);
      cenaxisb->SetRange(0,nbbin);
      if(fWriteToFile) cbackgrounde->SaveAs("BackgroundSubtractedPbPb.eps");
    }
  }
  
  return spectrumSubtracted;
}

//____________________________________________________________
AliCFDataGrid* AliHFEspectrum::GetCharmBackground(){
  //
  // calculate charm background
  //
    Int_t ptpr = 0;
    Int_t nDim = 1;
    if(fBeamType==0)
    {
	ptpr=0;
    }
    if(fBeamType==1)
    {
	ptpr=1;
	nDim=2;
    }

  Double_t evtnorm=0;
  if(fNMCbgEvents[0]) evtnorm= double(fNEvents[0])/double(fNMCbgEvents[0]);

  AliCFContainer *mcContainer = GetContainer(kMCContainerCharmMC);
  if(!mcContainer){
    AliError("MC Container not available");
    return NULL;
  }

  if(!fCorrelation){
    AliError("No Correlation map available");
    return NULL;
  }

  AliCFDataGrid *charmBackgroundGrid= 0x0;
  charmBackgroundGrid = new AliCFDataGrid("charmBackgroundGrid","charmBackgroundGrid",*mcContainer, fStepMC-1); // use MC eff. up to right before PID

  TH1D *charmbgaftertofpid = (TH1D *) charmBackgroundGrid->Project(0);
  Int_t* bins=new Int_t[2];
  bins[0]=charmbgaftertofpid->GetNbinsX();

  if(fBeamType==1)
  {
      bins[0]=12;
      charmbgaftertofpid = (TH1D *) charmBackgroundGrid->Project(1);
      bins[1]=charmbgaftertofpid->GetNbinsX();

  }

  AliCFDataGrid *ipWeightedCharmContainer = new AliCFDataGrid("ipWeightedCharmContainer","ipWeightedCharmContainer",nDim,bins);
  ipWeightedCharmContainer->SetGrid(GetPIDxIPEff(0)); // get charm efficiency
  TH1D* parametrizedcharmpidipeff = (TH1D*)ipWeightedCharmContainer->Project(ptpr);

  charmBackgroundGrid->Multiply(ipWeightedCharmContainer,1.);

  Int_t *nBinpp=new Int_t[1];
  Int_t* binspp=new Int_t[1];
  binspp[0]=charmbgaftertofpid->GetNbinsX();  // number of pt bins

  Int_t *nBinPbPb=new Int_t[2];
  Int_t* binsPbPb=new Int_t[2];
  binsPbPb[1]=charmbgaftertofpid->GetNbinsX();  // number of pt bins
  binsPbPb[0]=12;

  Int_t looppt=binspp[0];
  if(fBeamType==1) looppt=binsPbPb[1];

  for(Long_t iBin=1; iBin<= looppt;iBin++){
      if(fBeamType==0)
      {
          nBinpp[0]=iBin;
          charmBackgroundGrid->SetElementError(nBinpp, charmBackgroundGrid->GetElementError(nBinpp)*evtnorm);
          charmBackgroundGrid->SetElement(nBinpp,charmBackgroundGrid->GetElement(nBinpp)*evtnorm);
      }
      if(fBeamType==1)
      {
          // loop over centrality
          for(Long_t iiBin=1; iiBin<= binsPbPb[0];iiBin++){
              nBinPbPb[0]=iiBin;
              nBinPbPb[1]=iBin;
              Double_t evtnormPbPb=0;
              if(fNMCbgEvents[iiBin-1]) evtnormPbPb= double(fNEvents[iiBin-1])/double(fNMCbgEvents[iiBin-1]);
              charmBackgroundGrid->SetElementError(nBinPbPb, charmBackgroundGrid->GetElementError(nBinPbPb)*evtnormPbPb);
              charmBackgroundGrid->SetElement(nBinPbPb,charmBackgroundGrid->GetElement(nBinPbPb)*evtnormPbPb);
          }
      }
  }

  TH1D* charmbgafteripcut = (TH1D*)charmBackgroundGrid->Project(ptpr);

  AliCFDataGrid *weightedCharmContainer = new AliCFDataGrid("weightedCharmContainer","weightedCharmContainer",nDim,bins);
  weightedCharmContainer->SetGrid(GetCharmWeights()); // get charm weighting factors
  TH1D* charmweightingfc = (TH1D*)weightedCharmContainer->Project(ptpr);
  charmBackgroundGrid->Multiply(weightedCharmContainer,1.);
  TH1D* charmbgafterweight = (TH1D*)charmBackgroundGrid->Project(ptpr);

  // Efficiency (set efficiency to 1 for only folding) 
  AliCFEffGrid* efficiencyD = new AliCFEffGrid("efficiency","",*mcContainer);
  efficiencyD->CalculateEfficiency(0,0);

  // Folding
  if(fBeamType==0)nDim = 1;
  if(fBeamType==1)nDim = 2;
  AliCFUnfolding folding("unfolding","",nDim,fCorrelation,efficiencyD->GetGrid(),charmBackgroundGrid->GetGrid(),charmBackgroundGrid->GetGrid());
  folding.SetMaxNumberOfIterations(1);
  folding.Unfold();

  // Results
  THnSparse* result1= folding.GetEstMeasured(); // folded spectra
  THnSparse* result=(THnSparse*)result1->Clone();
  charmBackgroundGrid->SetGrid(result);
  TH1D* charmbgafterfolding = (TH1D*)charmBackgroundGrid->Project(ptpr);

  //Charm background evaluation plots

  TCanvas *cCharmBgEval = new TCanvas("cCharmBgEval","cCharmBgEval",1000,600);
  cCharmBgEval->Divide(3,1);

  cCharmBgEval->cd(1);

  if(fBeamType==0)charmbgaftertofpid->Scale(evtnorm);
  if(fBeamType==1)
  {
      Double_t evtnormPbPb=0;
      for(Int_t kCentr=0;kCentr<bins[0];kCentr++)
      {
	  if(fNMCbgEvents[kCentr]) evtnormPbPb= evtnormPbPb+double(fNEvents[kCentr])/double(fNMCbgEvents[kCentr]);
      }
      charmbgaftertofpid->Scale(evtnormPbPb);
  }

  CorrectFromTheWidth(charmbgaftertofpid);
  charmbgaftertofpid->SetMarkerStyle(25);
  charmbgaftertofpid->Draw("p");
  charmbgaftertofpid->GetYaxis()->SetTitle("yield normalized by # of data events");
  charmbgaftertofpid->GetXaxis()->SetTitle("p_{T} (GeV/c)");
  gPad->SetLogy();

  CorrectFromTheWidth(charmbgafteripcut);
  charmbgafteripcut->SetMarkerStyle(24);
  charmbgafteripcut->Draw("samep");

  CorrectFromTheWidth(charmbgafterweight);
  charmbgafterweight->SetMarkerStyle(24);
  charmbgafterweight->SetMarkerColor(4);
  charmbgafterweight->Draw("samep");

  CorrectFromTheWidth(charmbgafterfolding);
  charmbgafterfolding->SetMarkerStyle(24);
  charmbgafterfolding->SetMarkerColor(2);
  charmbgafterfolding->Draw("samep");

  cCharmBgEval->cd(2);
  parametrizedcharmpidipeff->SetMarkerStyle(24);
  parametrizedcharmpidipeff->Draw("p");
  parametrizedcharmpidipeff->GetXaxis()->SetTitle("p_{T} (GeV/c)");

  cCharmBgEval->cd(3);
  charmweightingfc->SetMarkerStyle(24);
  charmweightingfc->Draw("p");
  charmweightingfc->GetYaxis()->SetTitle("weighting factor for charm electron");
  charmweightingfc->GetXaxis()->SetTitle("p_{T} (GeV/c)");

  cCharmBgEval->cd(1);
  TLegend *legcharmbg = new TLegend(0.3,0.7,0.89,0.89);
  legcharmbg->AddEntry(charmbgaftertofpid,"After TOF PID","p");
  legcharmbg->AddEntry(charmbgafteripcut,"After IP cut","p");
  legcharmbg->AddEntry(charmbgafterweight,"After Weighting","p");
  legcharmbg->AddEntry(charmbgafterfolding,"After Folding","p");
  legcharmbg->Draw("same");

  cCharmBgEval->cd(2);
  TLegend *legcharmbg2 = new TLegend(0.3,0.7,0.89,0.89);
  legcharmbg2->AddEntry(parametrizedcharmpidipeff,"PID + IP cut eff.","p");
  legcharmbg2->Draw("same");

  CorrectStatErr(charmBackgroundGrid);
  if(fWriteToFile) cCharmBgEval->SaveAs("CharmBackground.eps");

  delete[] bins;
  delete[] nBinpp;
  delete[] binspp;
  delete[] nBinPbPb;
  delete[] binsPbPb;

  if(fUnfoldBG) UnfoldBG(charmBackgroundGrid);

  return charmBackgroundGrid;
}

//____________________________________________________________
AliCFDataGrid* AliHFEspectrum::GetConversionBackground(){
  //
  // calculate conversion background
  //
  
  Double_t evtnorm[1] = {0.0};
  if(fNMCbgEvents[0]) evtnorm[0]= double(fNEvents[0])/double(fNMCbgEvents[0]);
  printf("check event!!! %lf \n",evtnorm[0]);
  
  AliCFContainer *backgroundContainer = 0x0;
  
  if(fNonHFEsyst){
    backgroundContainer = (AliCFContainer*)fConvSourceContainer[0][0][0]->Clone();
    for(Int_t iSource = 1; iSource < kElecBgSources; iSource++){
      backgroundContainer->Add(fConvSourceContainer[iSource][0][0]); // make centrality dependent
    }  
  }
  else{    
    // Background Estimate
    backgroundContainer = GetContainer(kMCWeightedContainerConversionESD);    
  } 
  if(!backgroundContainer){
    AliError("MC background container not found");
    return NULL;
  }
  
  Int_t stepbackground = 3;

  AliCFDataGrid *backgroundGrid = new AliCFDataGrid("ConversionBgGrid","ConversionBgGrid",*backgroundContainer,stepbackground);
  Int_t *nBinpp=new Int_t[1];
  Int_t* binspp=new Int_t[1];
  binspp[0]=fConversionEff[0]->GetNbinsX();  // number of pt bins

  Int_t *nBinPbPb=new Int_t[2];
  Int_t* binsPbPb=new Int_t[2];
  binsPbPb[1]=fConversionEff[0]->GetNbinsX();  // number of pt bins
  binsPbPb[0]=12;

  Int_t looppt=binspp[0];
  if(fBeamType==1) looppt=binsPbPb[1];

  for(Long_t iBin=1; iBin<= looppt;iBin++){
      if(fBeamType==0)
      {
	  nBinpp[0]=iBin;
	  backgroundGrid->SetElementError(nBinpp, backgroundGrid->GetElementError(nBinpp)*evtnorm[0]);
	  backgroundGrid->SetElement(nBinpp,backgroundGrid->GetElement(nBinpp)*evtnorm[0]);
      }
      if(fBeamType==1)
      {
          // loop over centrality
	  for(Long_t iiBin=1; iiBin<= binsPbPb[0];iiBin++){
	      nBinPbPb[0]=iiBin;
	      nBinPbPb[1]=iBin;
              Double_t evtnormPbPb=0;
              if(fNMCbgEvents[iiBin-1]) evtnormPbPb= double(fNEvents[iiBin-1])/double(fNMCbgEvents[iiBin-1]);
	      backgroundGrid->SetElementError(nBinPbPb, backgroundGrid->GetElementError(nBinPbPb)*evtnormPbPb);
	      backgroundGrid->SetElement(nBinPbPb,backgroundGrid->GetElement(nBinPbPb)*evtnormPbPb);
	  }
      }
  }
  //end of workaround for statistical errors

  AliCFDataGrid *weightedConversionContainer;
  if(fBeamType==0) weightedConversionContainer = new AliCFDataGrid("weightedConversionContainer","weightedConversionContainer",1,binspp);
  else weightedConversionContainer = new AliCFDataGrid("weightedConversionContainer","weightedConversionContainer",2,binsPbPb);
  weightedConversionContainer->SetGrid(GetPIDxIPEff(2));
  backgroundGrid->Multiply(weightedConversionContainer,1.0);

  delete[] nBinpp;
  delete[] binspp;
  delete[] nBinPbPb;
  delete[] binsPbPb; 

  return backgroundGrid;
}


//____________________________________________________________
AliCFDataGrid* AliHFEspectrum::GetNonHFEBackground(){
  //
  // calculate non-HFE background
  //

  Double_t evtnorm[1] = {0.0};
  if(fNMCbgEvents[0]) evtnorm[0]= double(fNEvents[0])/double(fNMCbgEvents[0]);
  printf("check event!!! %lf \n",evtnorm[0]);
  
  AliCFContainer *backgroundContainer = 0x0;
  if(fNonHFEsyst){
    backgroundContainer = (AliCFContainer*)fNonHFESourceContainer[0][0][0]->Clone();
    for(Int_t iSource = 1; iSource < kElecBgSources; iSource++){
      if(iSource == 1)
        backgroundContainer->Add(fNonHFESourceContainer[iSource][0][0],1.41);//correction for the eta Dalitz decay branching ratio in PYTHIA
      else
        backgroundContainer->Add(fNonHFESourceContainer[iSource][0][0]);
    } 
  }
  else{    
    // Background Estimate 
    backgroundContainer = GetContainer(kMCWeightedContainerNonHFEESD);
  }
  if(!backgroundContainer){
    AliError("MC background container not found");
    return NULL;
  }
  
  
  Int_t stepbackground = 3;

  AliCFDataGrid *backgroundGrid = new AliCFDataGrid("NonHFEBgGrid","NonHFEBgGrid",*backgroundContainer,stepbackground);
  Int_t *nBinpp=new Int_t[1];
  Int_t* binspp=new Int_t[1];
  binspp[0]=fConversionEff[0]->GetNbinsX();  // number of pt bins

  Int_t *nBinPbPb=new Int_t[2];
  Int_t* binsPbPb=new Int_t[2];
  binsPbPb[1]=fConversionEff[0]->GetNbinsX();  // number of pt bins
  binsPbPb[0]=12;

  Int_t looppt=binspp[0];
  if(fBeamType==1) looppt=binsPbPb[1];


  for(Long_t iBin=1; iBin<= looppt;iBin++){
      if(fBeamType==0)
      {
	  nBinpp[0]=iBin;
	  backgroundGrid->SetElementError(nBinpp, backgroundGrid->GetElementError(nBinpp)*evtnorm[0]);
	  backgroundGrid->SetElement(nBinpp,backgroundGrid->GetElement(nBinpp)*evtnorm[0]);
      }
      if(fBeamType==1)
      {
	  for(Long_t iiBin=1; iiBin<=binsPbPb[0];iiBin++){
	      nBinPbPb[0]=iiBin;
	      nBinPbPb[1]=iBin;
	      Double_t evtnormPbPb=0;
              if(fNMCbgEvents[iiBin-1]) evtnormPbPb= double(fNEvents[iiBin-1])/double(fNMCbgEvents[iiBin-1]);
	      backgroundGrid->SetElementError(nBinPbPb, backgroundGrid->GetElementError(nBinPbPb)*evtnormPbPb);
	      backgroundGrid->SetElement(nBinPbPb,backgroundGrid->GetElement(nBinPbPb)*evtnormPbPb);
	  }
      }
  }
  //end of workaround for statistical errors
  AliCFDataGrid *weightedNonHFEContainer;
  if(fBeamType==0) weightedNonHFEContainer = new AliCFDataGrid("weightedNonHFEContainer","weightedNonHFEContainer",1,binspp);
  else weightedNonHFEContainer = new AliCFDataGrid("weightedNonHFEContainer","weightedNonHFEContainer",2,binsPbPb);
  weightedNonHFEContainer->SetGrid(GetPIDxIPEff(3));
  backgroundGrid->Multiply(weightedNonHFEContainer,1.0);

  delete[] nBinpp;
  delete[] binspp;
  delete[] nBinPbPb;
  delete[] binsPbPb; 

  return backgroundGrid;
}

//____________________________________________________________
AliCFDataGrid *AliHFEspectrum::CorrectParametrizedEfficiency(AliCFDataGrid* const bgsubpectrum){
  
  //
  // Apply TPC pid efficiency correction from parametrisation
  //

  // Data in the right format
  AliCFDataGrid *dataGrid = 0x0;  
  if(bgsubpectrum) {
    dataGrid = bgsubpectrum;
  }
  else {
    
    AliCFContainer *dataContainer = GetContainer(kDataContainer);
    if(!dataContainer){
      AliError("Data Container not available");
      return NULL;
    }
    dataGrid = new AliCFDataGrid("dataGrid","dataGrid",*dataContainer, fStepData);
  } 
  AliCFDataGrid *result = (AliCFDataGrid *) dataGrid->Clone();
  result->SetName("ParametrizedEfficiencyBefore");
  THnSparse *h = result->GetGrid();
  Int_t nbdimensions = h->GetNdimensions();
  //printf("CorrectParametrizedEfficiency::We have dimensions %d\n",nbdimensions);
  AliCFContainer *dataContainer = GetContainer(kDataContainer);
  if(!dataContainer){
    AliError("Data Container not available");
    return NULL;
  }
  AliCFContainer *dataContainerbis = (AliCFContainer *) dataContainer->Clone();
  dataContainerbis->Add(dataContainerbis,-1.0);


  Int_t* coord = new Int_t[nbdimensions];
  memset(coord, 0, sizeof(Int_t) * nbdimensions);
  Double_t* points = new Double_t[nbdimensions];

  ULong64_t nEntries = h->GetNbins();
  for (ULong64_t i = 0; i < nEntries; ++i) {
    
    Double_t value = h->GetBinContent(i, coord);
    //Double_t valuecontainer = dataContainerbis->GetBinContent(coord,fStepData);
    //printf("Value %f, and valuecontainer %f\n",value,valuecontainer);
    
    // Get the bin co-ordinates given an coord
    for (Int_t j = 0; j < nbdimensions; ++j)
      points[j] = h->GetAxis(j)->GetBinCenter(coord[j]);

    if (!fEfficiencyFunction->IsInside(points))
         continue;
    TF1::RejectPoint(kFALSE);

    // Evaulate function at points
    Double_t valueEfficiency = fEfficiencyFunction->EvalPar(points, NULL);
    //printf("Value efficiency is %f\n",valueEfficiency);

    if(valueEfficiency > 0.0) {
      h->SetBinContent(coord,value/valueEfficiency);
      dataContainerbis->SetBinContent(coord,fStepData,value/valueEfficiency);
    }
    Double_t error = h->GetBinError(i);
    h->SetBinError(coord,error/valueEfficiency);
    dataContainerbis->SetBinError(coord,fStepData,error/valueEfficiency);

   
  } 

  delete[] coord;
  delete[] points;

  AliCFDataGrid *resultt = new AliCFDataGrid("spectrumEfficiencyParametrized", "Data Grid for spectrum after Efficiency parametrized", *dataContainerbis,fStepData);

  if(fDebugLevel > 0) {

    TCanvas * cEfficiencyParametrized = new TCanvas("EfficiencyParametrized","EfficiencyParametrized",1000,700);
    cEfficiencyParametrized->Divide(2,1);
    cEfficiencyParametrized->cd(1);
    TH1D *afterE = (TH1D *) resultt->Project(0);
    TH1D *beforeE = (TH1D *) dataGrid->Project(0);
    CorrectFromTheWidth(afterE);
    CorrectFromTheWidth(beforeE);
    afterE->SetStats(0);
    afterE->SetTitle("");
    afterE->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
    afterE->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    afterE->SetMarkerStyle(25);
    afterE->SetMarkerColor(kBlack);
    afterE->SetLineColor(kBlack);
    beforeE->SetStats(0);
    beforeE->SetTitle("");
    beforeE->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
    beforeE->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    beforeE->SetMarkerStyle(24);
    beforeE->SetMarkerColor(kBlue);
    beforeE->SetLineColor(kBlue);
    gPad->SetLogy();
    afterE->Draw();
    beforeE->Draw("same");
    TLegend *legefficiencyparametrized = new TLegend(0.4,0.6,0.89,0.89);
    legefficiencyparametrized->AddEntry(beforeE,"Before Efficiency correction","p");
    legefficiencyparametrized->AddEntry(afterE,"After Efficiency correction","p");
    legefficiencyparametrized->Draw("same");
    cEfficiencyParametrized->cd(2);
    fEfficiencyFunction->Draw();
    //cEfficiencyParametrized->cd(3);
    //TH1D *ratioefficiency = (TH1D *) beforeE->Clone();
    //ratioefficiency->Divide(afterE);
    //ratioefficiency->Draw();

    if(fWriteToFile) cEfficiencyParametrized->SaveAs("efficiency.eps");

  }

  return resultt;

}
//____________________________________________________________
AliCFDataGrid *AliHFEspectrum::CorrectV0Efficiency(AliCFDataGrid* const bgsubpectrum){
  
  //
  // Apply TPC pid efficiency correction from V0
  //

  AliCFContainer *v0Container = GetContainer(kDataContainerV0);
  if(!v0Container){
    AliError("V0 Container not available");
    return NULL;
  }

  // Efficiency
  AliCFEffGrid* efficiencyD = new AliCFEffGrid("efficiency","",*v0Container);
  efficiencyD->CalculateEfficiency(fStepAfterCutsV0,fStepBeforeCutsV0);

  // Data in the right format
  AliCFDataGrid *dataGrid = 0x0;  
  if(bgsubpectrum) {
    dataGrid = bgsubpectrum;
  }
  else {
    
    AliCFContainer *dataContainer = GetContainer(kDataContainer);
    if(!dataContainer){
      AliError("Data Container not available");
      return NULL;
    }

    dataGrid = new AliCFDataGrid("dataGrid","dataGrid",*dataContainer, fStepData);
  } 

  // Correct
  AliCFDataGrid *result = (AliCFDataGrid *) dataGrid->Clone();
  result->ApplyEffCorrection(*efficiencyD);

  if(fDebugLevel > 0) {

    Int_t ptpr;
    if(fBeamType==0) ptpr=0;
    if(fBeamType==1) ptpr=1;
    
    TCanvas * cV0Efficiency = new TCanvas("V0Efficiency","V0Efficiency",1000,700);
    cV0Efficiency->Divide(2,1);
    cV0Efficiency->cd(1);
    TH1D *afterE = (TH1D *) result->Project(ptpr);
    TH1D *beforeE = (TH1D *) dataGrid->Project(ptpr);
    afterE->SetStats(0);
    afterE->SetTitle("");
    afterE->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
    afterE->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    afterE->SetMarkerStyle(25);
    afterE->SetMarkerColor(kBlack);
    afterE->SetLineColor(kBlack);
    beforeE->SetStats(0);
    beforeE->SetTitle("");
    beforeE->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
    beforeE->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    beforeE->SetMarkerStyle(24);
    beforeE->SetMarkerColor(kBlue);
    beforeE->SetLineColor(kBlue);
    afterE->Draw();
    beforeE->Draw("same");
    TLegend *legV0efficiency = new TLegend(0.4,0.6,0.89,0.89);
    legV0efficiency->AddEntry(beforeE,"Before Efficiency correction","p");
    legV0efficiency->AddEntry(afterE,"After Efficiency correction","p");
    legV0efficiency->Draw("same");
    cV0Efficiency->cd(2);
    TH1D* efficiencyDproj = (TH1D *) efficiencyD->Project(ptpr);
    efficiencyDproj->SetTitle("");
    efficiencyDproj->SetStats(0);
    efficiencyDproj->SetMarkerStyle(25);
    efficiencyDproj->Draw();

    if(fBeamType==1) {

      TCanvas * cV0Efficiencye = new TCanvas("V0Efficiency_allspectra","V0Efficiency_allspectra",1000,700);
      cV0Efficiencye->Divide(2,1);
      TLegend *legtotal = new TLegend(0.4,0.6,0.89,0.89);
      TLegend *legtotalg = new TLegend(0.4,0.6,0.89,0.89);
     
      THnSparseF* sparseafter = (THnSparseF *) result->GetGrid();
      TAxis *cenaxisa = sparseafter->GetAxis(0);
      THnSparseF* sparsebefore = (THnSparseF *) dataGrid->GetGrid();
      TAxis *cenaxisb = sparsebefore->GetAxis(0);
      THnSparseF* efficiencya = (THnSparseF *) efficiencyD->GetGrid();
      TAxis *cenaxisc = efficiencya->GetAxis(0);
      Int_t nbbin = cenaxisb->GetNbins();
      Int_t stylee[20] = {20,21,22,23,24,25,26,27,28,30,4,5,7,29,29,29,29,29,29,29};
      Int_t colorr[20] = {2,3,4,5,6,7,8,9,46,38,29,30,31,32,33,34,35,37,38,20};
      for(Int_t binc = 0; binc < nbbin; binc++){
        TString titlee("V0Efficiency_centrality_bin_");
        titlee += binc;
        TCanvas * ccV0Efficiency = new TCanvas((const char*) titlee,(const char*) titlee,1000,700);
        ccV0Efficiency->Divide(2,1);
        ccV0Efficiency->cd(1);
        gPad->SetLogy();
        cenaxisa->SetRange(binc+1,binc+1);
        cenaxisb->SetRange(binc+1,binc+1);
        cenaxisc->SetRange(binc+1,binc+1);
        TH1D *aftere = (TH1D *) sparseafter->Projection(1);
        TH1D *beforee = (TH1D *) sparsebefore->Projection(1);
        CorrectFromTheWidth(aftere);
        CorrectFromTheWidth(beforee);
        aftere->SetStats(0);
        aftere->SetTitle((const char*)titlee);
        aftere->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
        aftere->GetXaxis()->SetTitle("p_{T} [GeV/c]");
        aftere->SetMarkerStyle(25);
        aftere->SetMarkerColor(kBlack);
        aftere->SetLineColor(kBlack);
        beforee->SetStats(0);
        beforee->SetTitle((const char*)titlee);
        beforee->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
        beforee->GetXaxis()->SetTitle("p_{T} [GeV/c]");
        beforee->SetMarkerStyle(24);
        beforee->SetMarkerColor(kBlue);
        beforee->SetLineColor(kBlue);
        aftere->Draw();
        beforee->Draw("same");
        TLegend *lega = new TLegend(0.4,0.6,0.89,0.89);
        lega->AddEntry(beforee,"Before correction","p");
        lega->AddEntry(aftere,"After correction","p");
        lega->Draw("same");
        cV0Efficiencye->cd(1);
        gPad->SetLogy();
        TH1D *afteree = (TH1D *) aftere->Clone();
        afteree->SetMarkerStyle(stylee[binc]);
        afteree->SetMarkerColor(colorr[binc]);
        if(binc==0) afteree->Draw();
        else afteree->Draw("same");
        legtotal->AddEntry(afteree,(const char*) titlee,"p");
        cV0Efficiencye->cd(2);
        gPad->SetLogy();
        TH1D *aftereeu = (TH1D *) aftere->Clone();
        aftereeu->SetMarkerStyle(stylee[binc]);
        aftereeu->SetMarkerColor(colorr[binc]);
        if(fNEvents[binc] > 0.0) aftereeu->Scale(1/(Double_t)fNEvents[binc]);
        if(binc==0) aftereeu->Draw();
        else aftereeu->Draw("same");
        legtotalg->AddEntry(aftereeu,(const char*) titlee,"p");
        ccV0Efficiency->cd(2);
        TH1D* efficiencyDDproj = (TH1D *) efficiencya->Projection(1);
        efficiencyDDproj->SetTitle("");
        efficiencyDDproj->SetStats(0);
        efficiencyDDproj->SetMarkerStyle(25);
        efficiencyDDproj->Draw();
      }
     
      cV0Efficiencye->cd(1);
      legtotal->Draw("same");
      cV0Efficiencye->cd(2);
      legtotalg->Draw("same");

      cenaxisa->SetRange(0,nbbin);
      cenaxisb->SetRange(0,nbbin);
      cenaxisc->SetRange(0,nbbin);

      if(fWriteToFile) cV0Efficiencye->SaveAs("V0efficiency.eps");
    }

  }

  
  return result;

}
//____________________________________________________________
TList *AliHFEspectrum::Unfold(AliCFDataGrid* const bgsubpectrum){
  
  //
  // Unfold and eventually correct for efficiency the bgsubspectrum
  //

  AliCFContainer *mcContainer = GetContainer(kMCContainerMC);
  if(!mcContainer){
    AliError("MC Container not available");
    return NULL;
  }

  if(!fCorrelation){
    AliError("No Correlation map available");
    return NULL;
  }

  // Data 
  AliCFDataGrid *dataGrid = 0x0;  
  if(bgsubpectrum) {
    dataGrid = bgsubpectrum;
  }
  else {

    AliCFContainer *dataContainer = GetContainer(kDataContainer);
    if(!dataContainer){
      AliError("Data Container not available");
      return NULL;
    }

    dataGrid = new AliCFDataGrid("dataGrid","dataGrid",*dataContainer, fStepData);
  } 
  
  // Guessed
  AliCFDataGrid* guessedGrid = new AliCFDataGrid("guessed","",*mcContainer, fStepGuessedUnfolding);
  THnSparse* guessedTHnSparse = ((AliCFGridSparse*)guessedGrid->GetData())->GetGrid();

  // Efficiency
  AliCFEffGrid* efficiencyD = new AliCFEffGrid("efficiency","",*mcContainer);
  efficiencyD->CalculateEfficiency(fStepMC,fStepTrue);

  if(!fBeauty2ndMethod)
  {
      // Consider parameterized IP cut efficiency
      if(!fInclusiveSpectrum){
	  Int_t* bins=new Int_t[1];
	  bins[0]=35;

	  AliCFEffGrid *beffContainer = new AliCFEffGrid("beffContainer","beffContainer",1,bins);
	  beffContainer->SetGrid(GetBeautyIPEff(kTRUE));
	  efficiencyD->Multiply(beffContainer,1);
      }
  }
  

  // Unfold 
  
  AliCFUnfolding unfolding("unfolding","",fNbDimensions,fCorrelation,efficiencyD->GetGrid(),dataGrid->GetGrid(),guessedTHnSparse);
  if(fUnSetCorrelatedErrors) unfolding.UnsetCorrelatedErrors();
  unfolding.SetMaxNumberOfIterations(fNumberOfIterations);
  if(fNRandomIter > 0) unfolding.SetNRandomIterations(fNRandomIter);
  if(fSetSmoothing) unfolding.UseSmoothing();
  unfolding.Unfold();

  // Results
  THnSparse* result = unfolding.GetUnfolded();
  THnSparse* residual = unfolding.GetEstMeasured();
  TList *listofresults = new TList;
  listofresults->SetOwner();
  listofresults->AddAt((THnSparse*)result->Clone(),0);
  listofresults->AddAt((THnSparse*)residual->Clone(),1);

  if(fDebugLevel > 0) {

    Int_t ptpr;
    if(fBeamType==0) ptpr=0;
    if(fBeamType==1) ptpr=1;
    
    TCanvas * cresidual = new TCanvas("residual","residual",1000,700);
    cresidual->Divide(2,1);
    cresidual->cd(1);
    gPad->SetLogy();
    TGraphErrors* residualspectrumD = Normalize(residual);
    if(!residualspectrumD) {
      AliError("Number of Events not set for the normalization");
      return NULL;
    }
    residualspectrumD->SetTitle("");
    residualspectrumD->GetYaxis()->SetTitleOffset(1.5);
    residualspectrumD->GetYaxis()->SetRangeUser(0.000000001,1.0);
    residualspectrumD->SetMarkerStyle(26);
    residualspectrumD->SetMarkerColor(kBlue);
    residualspectrumD->SetLineColor(kBlue);
    residualspectrumD->Draw("AP");
    AliCFDataGrid *dataGridBis = (AliCFDataGrid *) (dataGrid->Clone());
    dataGridBis->SetName("dataGridBis"); 
    TGraphErrors* measuredspectrumD = Normalize(dataGridBis);
    measuredspectrumD->SetTitle("");  
    measuredspectrumD->GetYaxis()->SetTitleOffset(1.5);
    measuredspectrumD->GetYaxis()->SetRangeUser(0.000000001,1.0);
    measuredspectrumD->SetMarkerStyle(25);
    measuredspectrumD->SetMarkerColor(kBlack);
    measuredspectrumD->SetLineColor(kBlack);
    measuredspectrumD->Draw("P");
    TLegend *legres = new TLegend(0.4,0.6,0.89,0.89);
    legres->AddEntry(residualspectrumD,"Residual","p");
    legres->AddEntry(measuredspectrumD,"Measured","p");
    legres->Draw("same");
    cresidual->cd(2);
    TH1D *residualTH1D = residual->Projection(ptpr);
    TH1D *measuredTH1D = (TH1D *) dataGridBis->Project(ptpr);
    TH1D* ratioresidual = (TH1D*)residualTH1D->Clone();
    ratioresidual->SetName("ratioresidual");
    ratioresidual->SetTitle("");
    ratioresidual->GetYaxis()->SetTitle("Folded/Measured");
    ratioresidual->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    ratioresidual->Divide(residualTH1D,measuredTH1D,1,1);
    ratioresidual->SetStats(0);
    ratioresidual->Draw();

    if(fWriteToFile) cresidual->SaveAs("Unfolding.eps");
  }

  return listofresults;

}

//____________________________________________________________
AliCFDataGrid *AliHFEspectrum::CorrectForEfficiency(AliCFDataGrid* const bgsubpectrum){
  
  //
  // Apply unfolding and efficiency correction together to bgsubspectrum
  //

  AliCFContainer *mcContainer = GetContainer(kMCContainerESD);
  if(!mcContainer){
    AliError("MC Container not available");
    return NULL;
  }

  // Efficiency
  AliCFEffGrid* efficiencyD = new AliCFEffGrid("efficiency","",*mcContainer);
  efficiencyD->CalculateEfficiency(fStepMC,fStepTrue);


  if(!fBeauty2ndMethod)
  {
      // Consider parameterized IP cut efficiency
      if(!fInclusiveSpectrum){
	  Int_t* bins=new Int_t[1];
	  bins[0]=35;

	  AliCFEffGrid *beffContainer = new AliCFEffGrid("beffContainer","beffContainer",1,bins);
	  beffContainer->SetGrid(GetBeautyIPEff(kFALSE));
	  efficiencyD->Multiply(beffContainer,1);
      }
  }

  // Data in the right format
  AliCFDataGrid *dataGrid = 0x0;  
  if(bgsubpectrum) {
    dataGrid = bgsubpectrum;
  }
  else {
    
    AliCFContainer *dataContainer = GetContainer(kDataContainer);
    if(!dataContainer){
      AliError("Data Container not available");
      return NULL;
    }

    dataGrid = new AliCFDataGrid("dataGrid","dataGrid",*dataContainer, fStepData);
  } 

  // Correct
  AliCFDataGrid *result = (AliCFDataGrid *) dataGrid->Clone();
  result->ApplyEffCorrection(*efficiencyD);

  if(fDebugLevel > 0) {

    Int_t ptpr;
    if(fBeamType==0) ptpr=0;
    if(fBeamType==1) ptpr=1;
    
    printf("Step MC: %d\n",fStepMC);
    printf("Step tracking: %d\n",AliHFEcuts::kStepHFEcutsTRD + AliHFEcuts::kNcutStepsMCTrack);
    printf("Step MC true: %d\n",fStepTrue);
    AliCFEffGrid  *efficiencymcPID = (AliCFEffGrid*)  GetEfficiency(GetContainer(kMCContainerMC),fStepMC,AliHFEcuts::kStepHFEcutsTRD + AliHFEcuts::kNcutStepsMCTrack);
    AliCFEffGrid  *efficiencymctrackinggeo = (AliCFEffGrid*)  GetEfficiency(GetContainer(kMCContainerMC),AliHFEcuts::kStepHFEcutsTRD + AliHFEcuts::kNcutStepsMCTrack,fStepTrue);
    AliCFEffGrid  *efficiencymcall = (AliCFEffGrid*)  GetEfficiency(GetContainer(kMCContainerMC),fStepMC,fStepTrue);
    
    AliCFEffGrid  *efficiencyesdall = (AliCFEffGrid*)  GetEfficiency(GetContainer(kMCContainerESD),fStepMC,fStepTrue);
    
    TCanvas * cefficiency = new TCanvas("efficiency","efficiency",1000,700);
    cefficiency->cd(1);
    TH1D* efficiencymcPIDD = (TH1D *) efficiencymcPID->Project(ptpr);
    efficiencymcPIDD->SetTitle("");
    efficiencymcPIDD->SetStats(0);
    efficiencymcPIDD->SetMarkerStyle(25);
    efficiencymcPIDD->Draw();
    TH1D* efficiencymctrackinggeoD = (TH1D *) efficiencymctrackinggeo->Project(ptpr);
    efficiencymctrackinggeoD->SetTitle("");
    efficiencymctrackinggeoD->SetStats(0);
    efficiencymctrackinggeoD->SetMarkerStyle(26);
    efficiencymctrackinggeoD->Draw("same");
    TH1D* efficiencymcallD = (TH1D *) efficiencymcall->Project(ptpr);
    efficiencymcallD->SetTitle("");
    efficiencymcallD->SetStats(0);
    efficiencymcallD->SetMarkerStyle(27);
    efficiencymcallD->Draw("same");
    TH1D* efficiencyesdallD = (TH1D *) efficiencyesdall->Project(ptpr);
    efficiencyesdallD->SetTitle("");
    efficiencyesdallD->SetStats(0);
    efficiencyesdallD->SetMarkerStyle(24);
    efficiencyesdallD->Draw("same");
    TLegend *legeff = new TLegend(0.4,0.6,0.89,0.89);
    legeff->AddEntry(efficiencymcPIDD,"PID efficiency","p");
    legeff->AddEntry(efficiencymctrackinggeoD,"Tracking geometry efficiency","p");
    legeff->AddEntry(efficiencymcallD,"Overall efficiency","p");
    legeff->AddEntry(efficiencyesdallD,"Overall efficiency ESD","p");
    legeff->Draw("same");

    if(fBeamType==1) {

      THnSparseF* sparseafter = (THnSparseF *) result->GetGrid();
      TAxis *cenaxisa = sparseafter->GetAxis(0);
      THnSparseF* sparsebefore = (THnSparseF *) dataGrid->GetGrid();
      TAxis *cenaxisb = sparsebefore->GetAxis(0);
      THnSparseF* efficiencya = (THnSparseF *) efficiencyD->GetGrid();
      TAxis *cenaxisc = efficiencya->GetAxis(0);
      //Int_t nbbin = cenaxisb->GetNbins();
      //Int_t stylee[20] = {20,21,22,23,24,25,26,27,28,30,4,5,7,29,29,29,29,29,29,29};
      //Int_t colorr[20] = {2,3,4,5,6,7,8,9,46,38,29,30,31,32,33,34,35,37,38,20};
      for(Int_t binc = 0; binc < fNCentralityBinAtTheEnd; binc++){
        TString titlee("Efficiency_centrality_bin_");
        titlee += fLowBoundaryCentralityBinAtTheEnd[binc];
        titlee += "_";
        titlee += fHighBoundaryCentralityBinAtTheEnd[binc];
        TCanvas * cefficiencye = new TCanvas((const char*) titlee,(const char*) titlee,1000,700);
        cefficiencye->Divide(2,1);
        cefficiencye->cd(1);
        gPad->SetLogy();
        cenaxisa->SetRange(fLowBoundaryCentralityBinAtTheEnd[binc]+1,fHighBoundaryCentralityBinAtTheEnd[binc]);
        cenaxisb->SetRange(fLowBoundaryCentralityBinAtTheEnd[binc]+1,fHighBoundaryCentralityBinAtTheEnd[binc]);
        TH1D *afterefficiency = (TH1D *) sparseafter->Projection(ptpr);
        TH1D *beforeefficiency = (TH1D *) sparsebefore->Projection(ptpr);
        CorrectFromTheWidth(afterefficiency);
        CorrectFromTheWidth(beforeefficiency);
        afterefficiency->SetStats(0);
        afterefficiency->SetTitle((const char*)titlee);
        afterefficiency->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
        afterefficiency->GetXaxis()->SetTitle("p_{T} [GeV/c]");
        afterefficiency->SetMarkerStyle(25);
        afterefficiency->SetMarkerColor(kBlack);
        afterefficiency->SetLineColor(kBlack);
        beforeefficiency->SetStats(0);
        beforeefficiency->SetTitle((const char*)titlee);
        beforeefficiency->GetYaxis()->SetTitle("dN/dp_{T} [(GeV/c)^{-1}]");
        beforeefficiency->GetXaxis()->SetTitle("p_{T} [GeV/c]");
        beforeefficiency->SetMarkerStyle(24);
        beforeefficiency->SetMarkerColor(kBlue);
        beforeefficiency->SetLineColor(kBlue);
        afterefficiency->Draw();
        beforeefficiency->Draw("same");
        TLegend *lega = new TLegend(0.4,0.6,0.89,0.89);
        lega->AddEntry(beforeefficiency,"Before efficiency correction","p");
        lega->AddEntry(afterefficiency,"After efficiency correction","p");
        lega->Draw("same");
        cefficiencye->cd(2);
        cenaxisc->SetRange(fLowBoundaryCentralityBinAtTheEnd[binc]+1,fLowBoundaryCentralityBinAtTheEnd[binc]+1);
        TH1D* efficiencyDDproj = (TH1D *) efficiencya->Projection(ptpr);
        efficiencyDDproj->SetTitle("");
        efficiencyDDproj->SetStats(0);
        efficiencyDDproj->SetMarkerStyle(25);
        efficiencyDDproj->SetMarkerColor(2);
        efficiencyDDproj->Draw();
        cenaxisc->SetRange(fHighBoundaryCentralityBinAtTheEnd[binc],fHighBoundaryCentralityBinAtTheEnd[binc]);
        TH1D* efficiencyDDproja = (TH1D *) efficiencya->Projection(ptpr);
        efficiencyDDproja->SetTitle("");
        efficiencyDDproja->SetStats(0);
        efficiencyDDproja->SetMarkerStyle(26);
        efficiencyDDproja->SetMarkerColor(4);
        efficiencyDDproja->Draw("same");
      }
    }

    if(fWriteToFile) cefficiency->SaveAs("efficiencyCorrected.eps");
  }
  
  return result;

}

//__________________________________________________________________________________
TGraphErrors *AliHFEspectrum::Normalize(THnSparse * const spectrum,Int_t i) const {
  //
  // Normalize the spectrum to 1/(2*Pi*p_{T})*dN/dp_{T} (GeV/c)^{-2}
  // Give the final pt spectrum to be compared
  //

  if(fNEvents[i] > 0) {

    Int_t ptpr = 0;
    if(fBeamType==0) ptpr=0;
    if(fBeamType==1) ptpr=1;
    
    TH1D* projection = spectrum->Projection(ptpr);
    CorrectFromTheWidth(projection);
    TGraphErrors *graphError = NormalizeTH1(projection,i);
    return graphError;
  
  }
    
  return 0x0;
  

}
//__________________________________________________________________________________
TGraphErrors *AliHFEspectrum::Normalize(AliCFDataGrid * const spectrum,Int_t i) const {
  //
  // Normalize the spectrum to 1/(2*Pi*p_{T})*dN/dp_{T} (GeV/c)^{-2}
  // Give the final pt spectrum to be compared
  //
  if(fNEvents[i] > 0) {

    Int_t ptpr=0;
    if(fBeamType==0) ptpr=0;
    if(fBeamType==1) ptpr=1;
    
    TH1D* projection = (TH1D *) spectrum->Project(ptpr);
    CorrectFromTheWidth(projection);
    TGraphErrors *graphError = NormalizeTH1(projection,i);

    return graphError;
    
  }

  return 0x0;
  

}
//__________________________________________________________________________________
TGraphErrors *AliHFEspectrum::NormalizeTH1(TH1 *input,Int_t i) const {
  //
  // Normalize the spectrum to 1/(2*Pi*p_{T})*dN/dp_{T} (GeV/c)^{-2}
  // Give the final pt spectrum to be compared
  //
  Double_t chargecoefficient = 0.5;
  if(fChargeChoosen != 0) chargecoefficient = 1.0;

  Double_t etarange = fEtaSelected ? fEtaRangeNorm[1] - fEtaRangeNorm[0] : 1.6;
  printf("Normalizing Eta Range %f\n", etarange);
  if(fNEvents[i] > 0) {

    TGraphErrors *spectrumNormalized = new TGraphErrors(input->GetNbinsX());
    Double_t p = 0, dp = 0; Int_t point = 1;
    Double_t n = 0, dN = 0;
    Double_t nCorr = 0, dNcorr = 0;
    //Double_t errdN = 0, errdp = 0;
    Double_t errdN = 0;
    for(Int_t ibin = input->GetXaxis()->GetFirst(); ibin <= input->GetXaxis()->GetLast(); ibin++){
      point = ibin - input->GetXaxis()->GetFirst();
      p = input->GetXaxis()->GetBinCenter(ibin);
      dp = input->GetXaxis()->GetBinWidth(ibin)/2.;
      n = input->GetBinContent(ibin);
      dN = input->GetBinError(ibin);
      // New point
      nCorr = chargecoefficient * 1./etarange * 1./(Double_t)(fNEvents[i]) * 1./(2. * TMath::Pi() * p) * n;
      errdN = 1./(2. * TMath::Pi() * p);
      //errdp = 1./(2. * TMath::Pi() * p*p) * n;
      //dNcorr = chargecoefficient * 1./etarange * 1./(Double_t)(fNEvents[i]) * TMath::Sqrt(errdN * errdN * dN *dN + errdp *errdp * dp *dp);
      dNcorr = chargecoefficient * 1./etarange * 1./(Double_t)(fNEvents[i]) * TMath::Sqrt(errdN * errdN * dN *dN);
      
      spectrumNormalized->SetPoint(point, p, nCorr);
      spectrumNormalized->SetPointError(point, dp, dNcorr);
    }
    spectrumNormalized->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    spectrumNormalized->GetYaxis()->SetTitle("#frac{1}{2 #pi p_{T}} #frac{dN}{dp_{T}} / [GeV/c]^{-2}");
    spectrumNormalized->SetMarkerStyle(22);
    spectrumNormalized->SetMarkerColor(kBlue);
    spectrumNormalized->SetLineColor(kBlue);

    return spectrumNormalized;
    
  }

  return 0x0;
  

}
//__________________________________________________________________________________
TGraphErrors *AliHFEspectrum::NormalizeTH1N(TH1 *input,Int_t normalization) const {
  //
  // Normalize the spectrum to 1/(2*Pi*p_{T})*dN/dp_{T} (GeV/c)^{-2}
  // Give the final pt spectrum to be compared
  //
  Double_t chargecoefficient = 0.5;
  if(fChargeChoosen != kAllCharge) chargecoefficient = 1.0;

  Double_t etarange = fEtaSelected ? fEtaRangeNorm[1] - fEtaRangeNorm[0] : 1.6;
  printf("Normalizing Eta Range %f\n", etarange);
  if(normalization > 0) {

    TGraphErrors *spectrumNormalized = new TGraphErrors(input->GetNbinsX());
    Double_t p = 0, dp = 0; Int_t point = 1;
    Double_t n = 0, dN = 0;
    Double_t nCorr = 0, dNcorr = 0;
    //Double_t errdN = 0, errdp = 0;
    Double_t errdN = 0;
    for(Int_t ibin = input->GetXaxis()->GetFirst(); ibin <= input->GetXaxis()->GetLast(); ibin++){
      point = ibin - input->GetXaxis()->GetFirst();
      p = input->GetXaxis()->GetBinCenter(ibin);
      //dp = input->GetXaxis()->GetBinWidth(ibin)/2.;
      n = input->GetBinContent(ibin);
      dN = input->GetBinError(ibin);
      // New point
      nCorr = chargecoefficient * 1./etarange * 1./(Double_t)(normalization) * 1./(2. * TMath::Pi() * p) * n;
      errdN = 1./(2. * TMath::Pi() * p);
      //errdp = 1./(2. * TMath::Pi() * p*p) * n;
      //dNcorr = chargecoefficient * 1./etarange * 1./(Double_t)(normalization) * TMath::Sqrt(errdN * errdN * dN *dN + errdp *errdp * dp *dp);
      dNcorr = chargecoefficient * 1./etarange * 1./(Double_t)(normalization) * TMath::Sqrt(errdN * errdN * dN *dN);
      
      spectrumNormalized->SetPoint(point, p, nCorr);
      spectrumNormalized->SetPointError(point, dp, dNcorr);
    }
    spectrumNormalized->GetXaxis()->SetTitle("p_{T} [GeV/c]");
    spectrumNormalized->GetYaxis()->SetTitle("#frac{1}{2 #pi p_{T}} #frac{dN}{dp_{T}} / [GeV/c]^{-2}");
    spectrumNormalized->SetMarkerStyle(22);
    spectrumNormalized->SetMarkerColor(kBlue);
    spectrumNormalized->SetLineColor(kBlue);
    
    return spectrumNormalized;
    
  }

  return 0x0;
  

}
//____________________________________________________________
void AliHFEspectrum::SetContainer(AliCFContainer *cont, AliHFEspectrum::CFContainer_t type){
  //
  // Set the container for a given step to the 
  //
  if(!fCFContainers) fCFContainers = new TObjArray(kDataContainerV0+1);
  fCFContainers->AddAt(cont, type);
}

//____________________________________________________________
AliCFContainer *AliHFEspectrum::GetContainer(AliHFEspectrum::CFContainer_t type){
  //
  // Get Correction Framework Container for given type
  //
  if(!fCFContainers) return NULL;
  return dynamic_cast<AliCFContainer *>(fCFContainers->At(type));
}
//____________________________________________________________
AliCFContainer *AliHFEspectrum::GetSlicedContainer(AliCFContainer *container, Int_t nDim, Int_t *dimensions,Int_t source,Chargetype_t charge, Int_t centralitylow, Int_t centralityhigh) {
  //
  // Slice bin for a given source of electron
  // nDim is the number of dimension the corrections are done
  // dimensions are the definition of the dimensions
  // source is if we want to keep only one MC source (-1 means we don't cut on the MC source)
  // positivenegative if we want to keep positive (1) or negative (0) or both (-1)
  // centrality (-1 means we do not cut on centrality)
  //
  
  Double_t *varMin = new Double_t[container->GetNVar()],
           *varMax = new Double_t[container->GetNVar()];

  Double_t *binLimits;
  for(Int_t ivar = 0; ivar < container->GetNVar(); ivar++){
    
    binLimits = new Double_t[container->GetNBins(ivar)+1];
    container->GetBinLimits(ivar,binLimits);
    varMin[ivar] = binLimits[0];
    varMax[ivar] = binLimits[container->GetNBins(ivar)];
    // source
    if(ivar == 4){
      if((source>= 0) && (source<container->GetNBins(ivar))) {
              varMin[ivar] = container->GetAxis(4,0)->GetBinLowEdge(container->GetAxis(4,0)->FindBin(binLimits[source]));
              varMax[ivar] = container->GetAxis(4,0)->GetBinUpEdge(container->GetAxis(4,0)->FindBin(binLimits[source]));
      }     
    }
    // charge
    if(ivar == 3) {
      if(charge != kAllCharge){
        varMin[ivar] = container->GetAxis(3,0)->GetBinLowEdge(container->GetAxis(3,0)->FindBin(charge));
        varMax[ivar] = container->GetAxis(3,0)->GetBinUpEdge(container->GetAxis(3,0)->FindBin(charge));
      }
    }
    // eta
    if(ivar == 1){
      for(Int_t ic = 1; ic <= container->GetAxis(1,0)->GetLast(); ic++) 
        AliDebug(1, Form("eta bin %d, min %f, max %f\n", ic, container->GetAxis(1,0)->GetBinLowEdge(ic), container->GetAxis(1,0)->GetBinUpEdge(ic))); 
      if(fEtaSelected){
        varMin[ivar] = fEtaRange[0];
        varMax[ivar] = fEtaRange[1];
      }
    }
    if(fEtaSelected){
      fEtaRangeNorm[0] = container->GetAxis(1,0)->GetBinLowEdge(container->GetAxis(1,0)->FindBin(fEtaRange[0]));
      fEtaRangeNorm[1] = container->GetAxis(1,0)->GetBinUpEdge(container->GetAxis(1,0)->FindBin(fEtaRange[1]));
      AliInfo(Form("Normalization done in eta range [%f,%f]\n", fEtaRangeNorm[0], fEtaRangeNorm[0]));
    }
    if(ivar == 5){
	if((centralitylow>= 0) && (centralitylow<container->GetNBins(ivar)) && (centralityhigh>= 0) && (centralityhigh<container->GetNBins(ivar))) {
	    varMin[ivar] = binLimits[centralitylow];
	    varMax[ivar] = binLimits[centralityhigh];

	    TAxis *axistest = container->GetAxis(5,0);
	    printf("GetSlicedContainer: Number of bin in centrality direction %d\n",axistest->GetNbins());
	    printf("Project from %f to %f\n",binLimits[centralitylow],binLimits[centralityhigh]);
	    Double_t lowcentrality = axistest->GetBinLowEdge(axistest->FindBin(binLimits[centralitylow]));
	    Double_t highcentrality = axistest->GetBinUpEdge(axistest->FindBin(binLimits[centralityhigh]));
	    printf("GetSlicedContainer: Low centrality %f and high centrality %f\n",lowcentrality,highcentrality);
	
	}

    }


    delete[] binLimits;
  }
  
  AliCFContainer *k = container->MakeSlice(nDim, dimensions, varMin, varMax);
  AddTemporaryObject(k);
  delete[] varMin; delete[] varMax;

  return k;

}

//_________________________________________________________________________
THnSparseF *AliHFEspectrum::GetSlicedCorrelation(THnSparseF *correlationmatrix, Int_t nDim, Int_t *dimensions, Int_t centralitylow, Int_t centralityhigh) const {
  //
  // Slice correlation
  //

  Int_t ndimensions = correlationmatrix->GetNdimensions();
  //printf("Number of dimension %d correlation map\n",ndimensions);
  if(ndimensions < (2*nDim)) {
    AliError("Problem in the dimensions");
    return NULL;
  }
  
  // Cut in centrality is centrality > -1
  if((centralitylow >=0) && (centralityhigh >=0)) {

    TAxis *axiscentrality0 = correlationmatrix->GetAxis(5);
    TAxis *axiscentrality1 = correlationmatrix->GetAxis(5+((Int_t)(ndimensions/2.)));

    Int_t bins0 = axiscentrality0->GetNbins();
    Int_t bins1 = axiscentrality1->GetNbins();
    
    printf("Number of centrality bins: %d and %d\n",bins0,bins1);
    if(bins0 != bins1) {
      AliError("Problem in the dimensions");
      return NULL;
    }
    
    if((centralitylow>= 0) && (centralitylow<bins0) && (centralityhigh>= 0) && (centralityhigh<bins0)) {
      axiscentrality0->SetRangeUser(centralitylow,centralityhigh);
      axiscentrality1->SetRangeUser(centralitylow,centralityhigh);

      Double_t lowcentrality0 = axiscentrality0->GetBinLowEdge(axiscentrality0->FindBin(centralitylow));
      Double_t highcentrality0 = axiscentrality0->GetBinUpEdge(axiscentrality0->FindBin(centralityhigh));
      Double_t lowcentrality1 = axiscentrality1->GetBinLowEdge(axiscentrality1->FindBin(centralitylow));
      Double_t highcentrality1 = axiscentrality1->GetBinUpEdge(axiscentrality1->FindBin(centralityhigh));
      printf("GetCorrelation0: Low centrality %f and high centrality %f\n",lowcentrality0,highcentrality0);
      printf("GetCorrelation1: Low centrality %f and high centrality %f\n",lowcentrality1,highcentrality1);

      TCanvas * ctestcorrelation = new TCanvas("testcorrelationprojection","testcorrelationprojection",1000,700);
      ctestcorrelation->cd(1);
      TH2D* projection = (TH2D *) correlationmatrix->Projection(5,5+((Int_t)(ndimensions/2.)));
      projection->Draw("colz");

    }
    
  }


  Int_t ndimensionsContainer = (Int_t) ndimensions/2;
  //printf("Number of dimension %d container\n",ndimensionsContainer);

  Int_t *dim = new Int_t[nDim*2];
  for(Int_t iter=0; iter < nDim; iter++){
    dim[iter] = dimensions[iter];
    dim[iter+nDim] = ndimensionsContainer + dimensions[iter];
    //printf("For iter %d: %d and iter+nDim %d: %d\n",iter,dimensions[iter],iter+nDim,ndimensionsContainer + dimensions[iter]);
  }
    
  THnSparseF *k = (THnSparseF *) correlationmatrix->Projection(nDim*2,dim);

  delete[] dim; 
  return k;
  
}
//___________________________________________________________________________
void AliHFEspectrum::CorrectFromTheWidth(TH1D *h1) const {
  //
  // Correct from the width of the bins --> dN/dp_{T} (GeV/c)^{-1}
  //

  TAxis *axis = h1->GetXaxis();
  Int_t nbinX = h1->GetNbinsX();

  for(Int_t i = 1; i <= nbinX; i++) {

    Double_t width = axis->GetBinWidth(i);
    Double_t content = h1->GetBinContent(i);
    Double_t error = h1->GetBinError(i); 
    h1->SetBinContent(i,content/width); 
    h1->SetBinError(i,error/width);
  }

}

//___________________________________________________________________________
void AliHFEspectrum::CorrectStatErr(AliCFDataGrid *backgroundGrid) const { 
  //
  // Correct statistical error
  //

  TH1D *h1 = (TH1D*)backgroundGrid->Project(0);
  Int_t nbinX = h1->GetNbinsX();
  Int_t bins[1];
  for(Long_t i = 1; i <= nbinX; i++) {
    bins[0] = i;
    Float_t content = h1->GetBinContent(i);
    if(content>0){
      Float_t error = TMath::Sqrt(content);
      backgroundGrid->SetElementError(bins, error);
    }
  }
}

//____________________________________________________________
void AliHFEspectrum::AddTemporaryObject(TObject *o){
  // 
  // Emulate garbage collection on class level
  // 
  if(!fTemporaryObjects) {
    fTemporaryObjects= new TList;
    fTemporaryObjects->SetOwner();
  }
  fTemporaryObjects->Add(o);
}

//____________________________________________________________
void AliHFEspectrum::ClearObject(TObject *o){
  //
  // Do a safe deletion
  //
  if(fTemporaryObjects){
    if(fTemporaryObjects->FindObject(o)) fTemporaryObjects->Remove(o);
    delete o;
  } else{
    // just delete
    delete o;
  }
}
//_________________________________________________________________________
TObject* AliHFEspectrum::GetSpectrum(const AliCFContainer * const c, Int_t step) {
  AliCFDataGrid* data = new AliCFDataGrid("data","",*c, step);
  return data;
}
//_________________________________________________________________________
TObject* AliHFEspectrum::GetEfficiency(const AliCFContainer * const c, Int_t step, Int_t step0){
  // 
  // Create efficiency grid and calculate efficiency
  // of step to step0
  //
  TString name("eff");
  name += step;
  name+= step0;
  AliCFEffGrid* eff = new AliCFEffGrid((const char*)name,"",*c);
  eff->CalculateEfficiency(step,step0);
  return eff;
}

//____________________________________________________________________________
THnSparse* AliHFEspectrum::GetCharmWeights(){
  
  //
  // Measured D->e based weighting factors
  //

  const Int_t nDimpp=1;
  Int_t nBinpp[nDimpp] = {35};
  Double_t ptbinning1[36] = {0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, 1.75, 2., 2.25, 2.5, 2.75, 3., 3.5, 4., 4.5, 5., 5.5, 6., 7., 8., 10., 12., 14., 16., 18., 20.};
  const Int_t nDimPbPb=2;
  Int_t nBinPbPb[nDimPbPb] = {11,35};
  Double_t kCentralityRange[12] = {0.,1.,2., 3., 4., 5., 6., 7.,8.,9., 10., 11.};
  Int_t loopcentr=1;
  Int_t looppt=nBinpp[0];
  if(fBeamType==0)
  {
      fWeightCharm = new THnSparseF("weightHisto", "weighting factor; pt[GeV/c]", nDimpp, nBinpp);
      fWeightCharm->SetBinEdges(0, ptbinning1);
  }
  if(fBeamType==1)
  {
      fWeightCharm = new THnSparseF("weightHisto", "weighting factor; centrality bin; pt[GeV/c]", nDimPbPb, nBinPbPb);
      fWeightCharm->SetBinEdges(1, ptbinning1);
      fWeightCharm->SetBinEdges(0, kCentralityRange);
      loopcentr=nBinPbPb[0];
  }

  // Weighting factor for pp
  Double_t weight[35]={0.859260, 0.872552, 0.847475, 0.823631, 0.839386, 0.874024, 0.916755, 0.942801, 0.965856, 0.933905, 0.933414, 0.931936, 0.847826, 0.810902, 0.796608, 0.727002, 0.659227, 0.583610, 0.549956, 0.512633, 0.472254, 0.412364, 0.353191, 0.319145, 0.305412, 0.290334, 0.269863, 0.254646, 0.230245, 0.200859, 0.275953, 0.276271, 0.227332, 0.197004, 0.474385};
  
  // Weighting factor for PbPb (0-20%)
  //Double_t weight[35]={0.641897,  0.640472,  0.615228,  0.650469,  0.737762,  0.847867,  1.009317,  1.158594,  1.307482,  1.476973,  1.551131,  1.677131,  1.785478,  1.888933,  2.017957,  2.074757,  1.926700,  1.869495,  1.546558,  1.222873,  1.160313,  0.903375,  0.799642,  0.706244,  0.705449,  0.599947,  0.719570,  0.499422,  0.703978,  0.477452,  0.325057,  0.093391,  0.096675,  0.000000,  0.000000};

  // Weighting factor for PbPb (40-80%)
  //Double_t weight[35]={0.181953,  0.173248,  0.166799,  0.182558,  0.206581,  0.236955,  0.279390,  0.329129,  0.365260,  0.423059,  0.452057,  0.482726,  0.462627,  0.537770,  0.584663,  0.579452,  0.587194,  0.499498,  0.443299,  0.398596,  0.376695,  0.322331,  0.260890,  0.374834,  0.249114,  0.310330,  0.287326,  0.243174,  0.758945,  0.138867,  0.170576,  0.107797,  0.011390,  0.000000,  0.000000};

  //points
  Double_t pt[1];
  Double_t contents[2];

  for(int icentr=0; icentr<loopcentr; icentr++)
  {
      for(int i=0; i<looppt; i++){
	  pt[0]=(ptbinning1[i]+ptbinning1[i+1])/2.;
	  if(fBeamType==1)
	  {
	      contents[0]=icentr;
	      contents[1]=pt[0];
	  }
	  if(fBeamType==0)
	  {
	      contents[0]=pt[0];
	  }

	  fWeightCharm->Fill(contents,weight[i]);
      }
  }

  Int_t nDimSparse = fWeightCharm->GetNdimensions();
  Int_t* binsvar = new Int_t[nDimSparse]; // number of bins for each variable
  Long_t nBins = 1; // used to calculate the total number of bins in the THnSparse

  for (Int_t iVar=0; iVar<nDimSparse; iVar++) {
      binsvar[iVar] = fWeightCharm->GetAxis(iVar)->GetNbins();
      nBins *= binsvar[iVar];
  }

  Int_t *binfill = new Int_t[nDimSparse]; // bin to fill the THnSparse (holding the bin coordinates)
  // loop that sets 0 error in each bin
  for (Long_t iBin=0; iBin<nBins; iBin++) {
    Long_t bintmp = iBin ;
    for (Int_t iVar=0; iVar<nDimSparse; iVar++) {
      binfill[iVar] = 1 + bintmp % binsvar[iVar] ;
      bintmp /= binsvar[iVar] ;
    }
    fWeightCharm->SetBinError(binfill,0.); // put 0 everywhere
  }

  delete[] binsvar;
  delete[] binfill;

  return fWeightCharm;
}

//____________________________________________________________________________
void AliHFEspectrum::SetParameterizedEff(AliCFContainer *container, AliCFContainer *containermb, AliCFContainer *containeresd, AliCFContainer *containeresdmb, Int_t *dimensions){

   // TOF PID efficiencies
   Int_t ptpr=0;
   if(fBeamType==0) ptpr=0;
   if(fBeamType==1) ptpr=1;

   Int_t loopcentr=1;
   const Int_t nCentralitybinning=11; //number of centrality bins
   if(fBeamType==1)
   {
     loopcentr=nCentralitybinning;
   }

   TF1 *fittofpid = new TF1("fittofpid","[0]*([1]+[2]*log(x)+[3]*log(x)*log(x))*tanh([4]*x-[5])",0.9,8.);
   TF1 *fipfit = new TF1("fipfit","[0]*([1]+[2]*log(x)+[3]*log(x)*log(x))*tanh([4]*x-[5])",0.9,8.);
   TF1 *fipfitnonhfe = new TF1("fipfitnonhfe","[0]*([1]+[2]*log(x)+[3]*log(x)*log(x))*tanh([4]*x-[5])",0.3,10.0);

   TCanvas * cefficiencyParamtof = new TCanvas("efficiencyParamtof","efficiencyParamtof",600,600);
   cefficiencyParamtof->cd();

   AliCFContainer *mccontainermcD = 0x0;
   AliCFContainer *mccontaineresdD = 0x0;
   TH1D* efficiencysigTOFPIDD[nCentralitybinning];
   TH1D* efficiencyTOFPIDD[nCentralitybinning];
   TH1D* efficiencysigesdTOFPIDD[nCentralitybinning];
   TH1D* efficiencyesdTOFPIDD[nCentralitybinning];
   Int_t source = -1; //get parameterized TOF PID efficiencies

   for(int icentr=0; icentr<loopcentr; icentr++) {
      // signal sample
      if(fBeamType==0) mccontainermcD = GetSlicedContainer(container, fNbDimensions, dimensions, source, fChargeChoosen);
      else mccontainermcD = GetSlicedContainer(container, fNbDimensions, dimensions, source, fChargeChoosen,icentr+1);
      AliCFEffGrid* efficiencymcsigParamTOFPID= new AliCFEffGrid("efficiencymcsigParamTOFPID","",*mccontainermcD);
      efficiencymcsigParamTOFPID->CalculateEfficiency(fStepMC,fStepMC-1); // TOF PID efficiencies

      // mb sample for double check
      if(fBeamType==0)  mccontainermcD = GetSlicedContainer(containermb, fNbDimensions, dimensions, source, fChargeChoosen);
      else mccontainermcD = GetSlicedContainer(containermb, fNbDimensions, dimensions, source, fChargeChoosen,icentr+1);
      AliCFEffGrid* efficiencymcParamTOFPID= new AliCFEffGrid("efficiencymcParamTOFPID","",*mccontainermcD);
      efficiencymcParamTOFPID->CalculateEfficiency(fStepMC,fStepMC-1); // TOF PID efficiencies

      // mb sample with reconstructed variables
      if(fBeamType==0)  mccontainermcD = GetSlicedContainer(containeresdmb, fNbDimensions, dimensions, source, fChargeChoosen);
      else mccontainermcD = GetSlicedContainer(containeresdmb, fNbDimensions, dimensions, source, fChargeChoosen,icentr+1);
      AliCFEffGrid* efficiencyesdParamTOFPID= new AliCFEffGrid("efficiencyesdParamTOFPID","",*mccontainermcD);
      efficiencyesdParamTOFPID->CalculateEfficiency(fStepMC,fStepMC-1); // TOF PID efficiencies

      // mb sample with reconstructed variables
      if(fBeamType==0)  mccontainermcD = GetSlicedContainer(containeresd, fNbDimensions, dimensions, source, fChargeChoosen);
      else mccontainermcD = GetSlicedContainer(containeresd, fNbDimensions, dimensions, source, fChargeChoosen,icentr+1);
      AliCFEffGrid* efficiencysigesdParamTOFPID= new AliCFEffGrid("efficiencysigesdParamTOFPID","",*mccontainermcD);
      efficiencysigesdParamTOFPID->CalculateEfficiency(fStepMC,fStepMC-1); // TOF PID efficiencies

      //fill histo
      efficiencysigTOFPIDD[icentr] = (TH1D *) efficiencymcsigParamTOFPID->Project(ptpr);
      efficiencyTOFPIDD[icentr] = (TH1D *) efficiencymcParamTOFPID->Project(ptpr);
      efficiencysigesdTOFPIDD[icentr] = (TH1D *) efficiencysigesdParamTOFPID->Project(ptpr);
      efficiencyesdTOFPIDD[icentr] = (TH1D *) efficiencyesdParamTOFPID->Project(ptpr);
      efficiencysigTOFPIDD[icentr]->SetName(Form("efficiencysigTOFPIDD%d",icentr));
      efficiencyTOFPIDD[icentr]->SetName(Form("efficiencyTOFPIDD%d",icentr));
      efficiencysigesdTOFPIDD[icentr]->SetName(Form("efficiencysigesdTOFPIDD%d",icentr));
      efficiencyesdTOFPIDD[icentr]->SetName(Form("efficiencyesdTOFPIDD%d",icentr));

      //fit (mc enhenced sample)
      fittofpid->SetParameters(0.5,0.319,0.0157,0.00664,6.77,2.08);
      efficiencysigTOFPIDD[icentr]->Fit(fittofpid,"R");
      efficiencysigTOFPIDD[icentr]->GetYaxis()->SetTitle("Efficiency");
      fEfficiencyTOFPIDD[icentr] = efficiencysigTOFPIDD[icentr]->GetFunction("fittofpid");

      //fit (esd enhenced sample)
      efficiencysigesdTOFPIDD[icentr]->Fit(fittofpid,"R");
      efficiencysigesdTOFPIDD[icentr]->GetYaxis()->SetTitle("Efficiency");
      fEfficiencyesdTOFPIDD[icentr] = efficiencysigesdTOFPIDD[icentr]->GetFunction("fittofpid");

   }

   // draw (for PbPb, only 1st bin)
   //sig mc
   efficiencysigTOFPIDD[0]->SetTitle("");
   efficiencysigTOFPIDD[0]->SetStats(0);
   efficiencysigTOFPIDD[0]->SetMarkerStyle(25);
   efficiencysigTOFPIDD[0]->SetMarkerColor(2);
   efficiencysigTOFPIDD[0]->SetLineColor(2);
   efficiencysigTOFPIDD[0]->Draw();

   //mb mc
   efficiencyTOFPIDD[0]->SetTitle("");
   efficiencyTOFPIDD[0]->SetStats(0);
   efficiencyTOFPIDD[0]->SetMarkerStyle(24);
   efficiencyTOFPIDD[0]->SetMarkerColor(4);
   efficiencyTOFPIDD[0]->SetLineColor(4);
   efficiencyTOFPIDD[0]->Draw("same");

   //sig esd
   efficiencysigesdTOFPIDD[0]->SetTitle("");
   efficiencysigesdTOFPIDD[0]->SetStats(0);
   efficiencysigesdTOFPIDD[0]->SetMarkerStyle(25);
   efficiencysigesdTOFPIDD[0]->SetMarkerColor(3);
   efficiencysigesdTOFPIDD[0]->SetLineColor(3);
   efficiencysigesdTOFPIDD[0]->Draw("same");

   //mb esd
   efficiencyesdTOFPIDD[0]->SetTitle("");
   efficiencyesdTOFPIDD[0]->SetStats(0);
   efficiencyesdTOFPIDD[0]->SetMarkerStyle(25);
   efficiencyesdTOFPIDD[0]->SetMarkerColor(1);
   efficiencyesdTOFPIDD[0]->SetLineColor(1);
   efficiencyesdTOFPIDD[0]->Draw("same");

   //signal mc fit
   if(fEfficiencyTOFPIDD[0]){
     fEfficiencyTOFPIDD[0]->SetLineColor(2);
     fEfficiencyTOFPIDD[0]->Draw("same");
   }
   //mb esd fit
   if(fEfficiencyesdTOFPIDD[0]){
       fEfficiencyesdTOFPIDD[0]->SetLineColor(3);
       fEfficiencyesdTOFPIDD[0]->Draw("same");
     }

   TLegend *legtofeff = new TLegend(0.3,0.15,0.79,0.44);
   legtofeff->AddEntry(efficiencysigTOFPIDD[0],"TOF PID Step Efficiency","");
   legtofeff->AddEntry(efficiencysigTOFPIDD[0],"vs MC p_{t} for enhenced samples","p");
   legtofeff->AddEntry(efficiencyTOFPIDD[0],"vs MC p_{t} for mb samples","p");
   legtofeff->AddEntry(efficiencysigesdTOFPIDD[0],"vs esd p_{t} for enhenced samples","p");
   legtofeff->AddEntry(efficiencyesdTOFPIDD[0],"vs esd p_{t} for mb samples","p");
   legtofeff->Draw("same");


   TCanvas * cefficiencyParamIP = new TCanvas("efficiencyParamIP","efficiencyParamIP",500,500);
   cefficiencyParamIP->cd();
   gStyle->SetOptStat(0);

   // IP cut efficiencies
   for(int icentr=0; icentr<loopcentr; icentr++)  {

     AliCFContainer *charmCombined = 0x0; 
     AliCFContainer *beautyCombined = 0x0;
     AliCFContainer *beautyCombinedesd = 0x0;

     printf("centrality printing %i \n",icentr);

     source = 0; //charm enhenced
     if(fBeamType==0) mccontainermcD = GetSlicedContainer(container, fNbDimensions, dimensions, source, fChargeChoosen);
     else mccontainermcD = GetSlicedContainer(container, fNbDimensions, dimensions, source, fChargeChoosen, icentr+1);
     AliCFEffGrid* efficiencyCharmSig = new AliCFEffGrid("efficiencyCharmSig","",*mccontainermcD);
     efficiencyCharmSig->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1); // ip cut efficiency. 

     charmCombined= (AliCFContainer*)mccontainermcD->Clone("charmCombined");  

     source = 1; //beauty enhenced
     if(fBeamType==0) mccontainermcD = GetSlicedContainer(container, fNbDimensions, dimensions, source, fChargeChoosen);
     else mccontainermcD = GetSlicedContainer(container, fNbDimensions, dimensions, source, fChargeChoosen, icentr+1);
     AliCFEffGrid* efficiencyBeautySig = new AliCFEffGrid("efficiencyBeautySig","",*mccontainermcD);
     efficiencyBeautySig->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1); // ip cut efficiency. 

     beautyCombined = (AliCFContainer*)mccontainermcD->Clone("beautyCombined"); 

     if(fBeamType==0) mccontaineresdD = GetSlicedContainer(containeresd, fNbDimensions, dimensions, source, fChargeChoosen);
     else mccontaineresdD = GetSlicedContainer(containeresd, fNbDimensions, dimensions, source, fChargeChoosen, icentr+1);
     AliCFEffGrid* efficiencyBeautySigesd = new AliCFEffGrid("efficiencyBeautySigesd","",*mccontaineresdD);
     efficiencyBeautySigesd->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1); // ip cut efficiency.

     beautyCombinedesd = (AliCFContainer*)mccontaineresdD->Clone("beautyCombinedesd");

     source = 0; //charm mb
     if(fBeamType==0) mccontainermcD = GetSlicedContainer(containermb, fNbDimensions, dimensions, source, fChargeChoosen);
     else mccontainermcD = GetSlicedContainer(containermb, fNbDimensions, dimensions, source, fChargeChoosen, icentr+1);
     AliCFEffGrid* efficiencyCharm = new AliCFEffGrid("efficiencyCharm","",*mccontainermcD);
     efficiencyCharm->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1); // ip cut efficiency. 

     charmCombined->Add(mccontainermcD); 
     AliCFEffGrid* efficiencyCharmCombined = new AliCFEffGrid("efficiencyCharmCombined","",*charmCombined); 
     efficiencyCharmCombined->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1); 

     source = 1; //beauty mb
     if(fBeamType==0) mccontainermcD = GetSlicedContainer(containermb, fNbDimensions, dimensions, source, fChargeChoosen);
     else mccontainermcD = GetSlicedContainer(containermb, fNbDimensions, dimensions, source, fChargeChoosen, icentr+1);
     AliCFEffGrid* efficiencyBeauty = new AliCFEffGrid("efficiencyBeauty","",*mccontainermcD);
     efficiencyBeauty->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1); // ip cut efficiency. 

     beautyCombined->Add(mccontainermcD);
     AliCFEffGrid* efficiencyBeautyCombined = new AliCFEffGrid("efficiencyBeautyCombined","",*beautyCombined); 
     efficiencyBeautyCombined->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1); 

     if(fBeamType==0) mccontaineresdD = GetSlicedContainer(containeresdmb, fNbDimensions, dimensions, source, fChargeChoosen);
     else mccontaineresdD = GetSlicedContainer(containeresdmb, fNbDimensions, dimensions, source, fChargeChoosen, icentr+1);
     AliCFEffGrid* efficiencyBeautyesd = new AliCFEffGrid("efficiencyBeautyesd","",*mccontaineresdD);
     efficiencyBeautyesd->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1); // ip cut efficiency.

     beautyCombinedesd->Add(mccontaineresdD);
     AliCFEffGrid* efficiencyBeautyCombinedesd = new AliCFEffGrid("efficiencyBeautyCombinedesd","",*beautyCombinedesd);
     efficiencyBeautyCombinedesd->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1);

     source = 2; //conversion mb
     if(fBeamType==0) mccontainermcD = GetSlicedContainer(containermb, fNbDimensions, dimensions, source, fChargeChoosen);
     else mccontainermcD = GetSlicedContainer(containermb, fNbDimensions, dimensions, source, fChargeChoosen, icentr+1);
     AliCFEffGrid* efficiencyConv = new AliCFEffGrid("efficiencyConv","",*mccontainermcD);
     efficiencyConv->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1); // ip cut efficiency. 

     source = 3; //non HFE except for the conversion mb
     if(fBeamType==0) mccontainermcD = GetSlicedContainer(containermb, fNbDimensions, dimensions, source, fChargeChoosen);
     else mccontainermcD = GetSlicedContainer(containermb, fNbDimensions, dimensions, source, fChargeChoosen, icentr+1);
     AliCFEffGrid* efficiencyNonhfe= new AliCFEffGrid("efficiencyNonhfe","",*mccontainermcD);
     efficiencyNonhfe->CalculateEfficiency(AliHFEcuts::kNcutStepsMCTrack + fStepData,AliHFEcuts::kNcutStepsMCTrack + fStepData-1); // ip cut efficiency.

     if(fIPEffCombinedSamples){
       fEfficiencyCharmSigD[icentr] = (TH1D*)efficiencyCharmCombined->Project(ptpr); //signal enhenced + mb 
       fEfficiencyBeautySigD[icentr] = (TH1D*)efficiencyBeautyCombined->Project(ptpr); //signal enhenced + mb
       fEfficiencyBeautySigesdD[icentr] = (TH1D*)efficiencyBeautyCombinedesd->Project(ptpr); //signal enhenced + mb
     }
     else{
       fEfficiencyCharmSigD[icentr] = (TH1D*)efficiencyCharmSig->Project(ptpr); //signal enhenced only
       fEfficiencyBeautySigD[icentr] = (TH1D*)efficiencyBeautySig->Project(ptpr); //signal enhenced only
       fEfficiencyBeautySigesdD[icentr] = (TH1D*)efficiencyBeautySigesd->Project(ptpr); //signal enhenced only
     }
     fCharmEff[icentr] = (TH1D*)efficiencyCharm->Project(ptpr); //mb only
     fBeautyEff[icentr] = (TH1D*)efficiencyBeauty->Project(ptpr); //mb only
     fConversionEff[icentr] = (TH1D*)efficiencyConv->Project(ptpr); //mb only
     fNonHFEEff[icentr] = (TH1D*)efficiencyNonhfe->Project(ptpr); //mb only

   }

   if(fBeamType==0){
     AliCFEffGrid  *nonHFEEffGrid = (AliCFEffGrid*)  GetEfficiency(GetContainer(kMCWeightedContainerNonHFEESD),1,0);
     fNonHFEEffbgc = (TH1D *) nonHFEEffGrid->Project(0);

     AliCFEffGrid  *conversionEffGrid = (AliCFEffGrid*)  GetEfficiency(GetContainer(kMCWeightedContainerConversionESD),1,0);
     fConversionEffbgc = (TH1D *) conversionEffGrid->Project(0);
   }

   for(int icentr=0; icentr<loopcentr; icentr++)  {
     fipfit->SetParameters(0.5,0.319,0.0157,0.00664,6.77,2.08);
     fipfit->SetLineColor(2);
     fEfficiencyBeautySigD[icentr]->Fit(fipfit,"R");
     fEfficiencyBeautySigD[icentr]->GetYaxis()->SetTitle("Efficiency");
     if(fBeauty2ndMethod)fEfficiencyIPBeautyD[icentr] = fEfficiencyBeautySigD[0]->GetFunction("fipfit"); //why do we need this line?
     else fEfficiencyIPBeautyD[icentr] = fEfficiencyBeautySigD[icentr]->GetFunction("fipfit");

     fipfit->SetParameters(0.5,0.319,0.0157,0.00664,6.77,2.08);
     fipfit->SetLineColor(6);
     fEfficiencyBeautySigesdD[icentr]->Fit(fipfit,"R");
     fEfficiencyBeautySigesdD[icentr]->GetYaxis()->SetTitle("Efficiency");
     if(fBeauty2ndMethod)fEfficiencyIPBeautyesdD[icentr] = fEfficiencyBeautySigesdD[0]->GetFunction("fipfit"); //why do we need this line?
     else fEfficiencyIPBeautyesdD[icentr] = fEfficiencyBeautySigesdD[icentr]->GetFunction("fipfit");

     fipfit->SetParameters(0.5,0.319,0.0157,0.00664,6.77,2.08);
     fipfit->SetLineColor(1);
     fEfficiencyCharmSigD[icentr]->Fit(fipfit,"R");
     fEfficiencyCharmSigD[icentr]->GetYaxis()->SetTitle("Efficiency");
     fEfficiencyIPCharmD[icentr] = fEfficiencyCharmSigD[icentr]->GetFunction("fipfit");
     
     if(fIPParameterizedEff){
       fipfitnonhfe->SetParameters(0.5,0.319,0.0157,0.00664,6.77,2.08);
       fipfitnonhfe->SetLineColor(3);
       fConversionEff[icentr]->Fit(fipfitnonhfe,"R");
       fConversionEff[icentr]->GetYaxis()->SetTitle("Efficiency");
       fEfficiencyIPConversionD[icentr] = fConversionEff[icentr]->GetFunction("fipfitnonhfe");

       fipfitnonhfe->SetParameters(0.5,0.319,0.0157,0.00664,6.77,2.08);
       fipfitnonhfe->SetLineColor(4);
       fNonHFEEff[icentr]->Fit(fipfitnonhfe,"R");
       fNonHFEEff[icentr]->GetYaxis()->SetTitle("Efficiency");
       fEfficiencyIPNonhfeD[icentr] = fNonHFEEff[icentr]->GetFunction("fipfitnonhfe");
     }
   }

   // draw (for PbPb, only 1st bin)
   fEfficiencyCharmSigD[0]->SetMarkerStyle(21);
   fEfficiencyCharmSigD[0]->SetMarkerColor(1);
   fEfficiencyCharmSigD[0]->SetLineColor(1);
   fEfficiencyBeautySigD[0]->SetMarkerStyle(21);
   fEfficiencyBeautySigD[0]->SetMarkerColor(2);
   fEfficiencyBeautySigD[0]->SetLineColor(2);
   fEfficiencyBeautySigesdD[0]->SetStats(0);
   fEfficiencyBeautySigesdD[0]->SetMarkerStyle(21);
   fEfficiencyBeautySigesdD[0]->SetMarkerColor(6);
   fEfficiencyBeautySigesdD[0]->SetLineColor(6);
   fCharmEff[0]->SetMarkerStyle(24);
   fCharmEff[0]->SetMarkerColor(1);
   fCharmEff[0]->SetLineColor(1);
   fBeautyEff[0]->SetMarkerStyle(24);
   fBeautyEff[0]->SetMarkerColor(2);
   fBeautyEff[0]->SetLineColor(2);
   fConversionEff[0]->SetMarkerStyle(24);
   fConversionEff[0]->SetMarkerColor(3);
   fConversionEff[0]->SetLineColor(3);
   fNonHFEEff[0]->SetMarkerStyle(24);
   fNonHFEEff[0]->SetMarkerColor(4);
   fNonHFEEff[0]->SetLineColor(4);

   fEfficiencyCharmSigD[0]->Draw();
   fEfficiencyCharmSigD[0]->GetXaxis()->SetRangeUser(0.0,7.9);
   fEfficiencyCharmSigD[0]->GetYaxis()->SetRangeUser(0.0,0.5);

   fEfficiencyBeautySigD[0]->Draw("same");
   fEfficiencyBeautySigesdD[0]->Draw("same");
   //fCharmEff[0]->Draw("same");
   //fBeautyEff[0]->Draw("same");

   if(fBeamType==0){
     fConversionEffbgc->SetMarkerStyle(25);
     fConversionEffbgc->SetMarkerColor(3);
     fConversionEffbgc->SetLineColor(3);
     fNonHFEEffbgc->SetMarkerStyle(25);
     fNonHFEEffbgc->SetMarkerColor(4);
     fNonHFEEffbgc->SetLineColor(4);
     fConversionEffbgc->Draw("same");
     fNonHFEEffbgc->Draw("same");
   }
   else{
     fConversionEff[0]->Draw("same");
     fNonHFEEff[0]->Draw("same");
   }
   if(fEfficiencyIPBeautyD[0])
      fEfficiencyIPBeautyD[0]->Draw("same");
   if(fEfficiencyIPBeautyesdD[0])
     fEfficiencyIPBeautyesdD[0]->Draw("same");
   if( fEfficiencyIPCharmD[0])
     fEfficiencyIPCharmD[0]->Draw("same");
   if(fIPParameterizedEff){
     fEfficiencyIPConversionD[0]->Draw("same");
     fEfficiencyIPNonhfeD[0]->Draw("same");
   }
   TLegend *legipeff = new TLegend(0.58,0.2,0.88,0.39);
   legipeff->AddEntry(fEfficiencyBeautySigD[0],"IP Step Efficiency","");
   legipeff->AddEntry(fEfficiencyBeautySigD[0],"beauty e","p");
   legipeff->AddEntry(fEfficiencyBeautySigesdD[0],"beauty e(esd pt)","p");
   legipeff->AddEntry(fEfficiencyCharmSigD[0],"charm e","p");
   legipeff->AddEntry(fConversionEffbgc,"conversion e(esd pt)","p");
   legipeff->AddEntry(fNonHFEEffbgc,"Dalitz e(esd pt)","p");
   //legipeff->AddEntry(fConversionEff[0],"conversion e","p");
   //legipeff->AddEntry(fNonHFEEff[0],"Dalitz e","p");
   legipeff->Draw("same");
   gPad->SetGrid();
   //cefficiencyParamIP->SaveAs("efficiencyParamIP.eps");
}

//____________________________________________________________________________
THnSparse* AliHFEspectrum::GetBeautyIPEff(Bool_t isMCpt){
  //
  // Return beauty electron IP cut efficiency
  //

  const Int_t nPtbinning1 = 35;//number of pt bins, according to new binning
  const Int_t nCentralitybinning=11;//number of centrality bins
  Double_t kPtRange[nPtbinning1+1] = { 0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, 1.75, 2., 2.25, 2.5, 2.75, 3., 3.5, 4., 4.5, 5., 5.5, 6., 7., 8., 10., 12., 14., 16., 18., 20.};//pt bin limits
  Double_t kCentralityRange[nCentralitybinning+1] = {0.,1.,2., 3., 4., 5., 6., 7.,8.,9., 10., 11.};
  //Int_t ptpr = 0;
  Int_t nDim=1;  //dimensions of the efficiency weighting grid
  if(fBeamType==1)
  {
    //ptpr=1;
    nDim=2; //dimensions of the efficiency weighting grid
  }
  Int_t nBin[1] = {nPtbinning1};
  Int_t nBinPbPb[2] = {nCentralitybinning,nPtbinning1};


  THnSparseF *ipcut;
  if(fBeamType==0) ipcut = new THnSparseF("beff", "b IP efficiency; p_{t}(GeV/c)", nDim, nBin);
  else ipcut = new THnSparseF("beff", "b IP efficiency; centrality bin; p_{t}(GeV/c)", nDim, nBinPbPb);
 
  for(Int_t idim = 0; idim < nDim; idim++)
  {
    if(nDim==1) ipcut->SetBinEdges(idim, kPtRange);
    if(nDim==2)
      {
        ipcut->SetBinEdges(0, kCentralityRange);
        ipcut->SetBinEdges(1, kPtRange);
      }
  }
  Double_t pt[1];
  Double_t weight[nCentralitybinning];
  Double_t weightErr[nCentralitybinning];
  Double_t contents[2];

  for(Int_t a=0;a<11;a++)
  {
      weight[a] = 1.0;
      weightErr[a] = 1.0;
  }


  Int_t looppt=nBin[0];
  Int_t loopcentr=1;
  Int_t ibin[2];
  if(fBeamType==1)
  {
      loopcentr=nBinPbPb[0];
  }


  for(int icentr=0; icentr<loopcentr; icentr++)
  {
      for(int i=0; i<looppt; i++)
      {
	  pt[0]=(kPtRange[i]+kPtRange[i+1])/2.;
          if(isMCpt){
            if(fEfficiencyIPBeautyD[icentr]){
              weight[icentr]=fEfficiencyIPBeautyD[icentr]->Eval(pt[0]);
              weightErr[icentr] = 0;
            }
            else{
              printf("Fit failed on beauty IP cut efficiency for centrality %d. Contents in histo used!\n",icentr);
              weight[icentr] = fEfficiencyBeautySigD[icentr]->GetBinContent(i+1); 
              weightErr[icentr] = fEfficiencyBeautySigD[icentr]->GetBinError(i+1);
            }
          }
          else{
            if(fEfficiencyIPBeautyesdD[icentr]){
              weight[icentr]=fEfficiencyIPBeautyesdD[icentr]->Eval(pt[0]);
              weightErr[icentr] = 0;
            }
            else{
              printf("Fit failed on beauty IP cut efficiency for centrality %d. Contents in histo used!\n",icentr);
              weight[icentr] = fEfficiencyBeautySigesdD[icentr]->GetBinContent(i+1);
              weightErr[icentr] = fEfficiencyBeautySigD[icentr]->GetBinError(i+1);
            }
          }

          if(fBeamType==1){
              contents[0]=icentr;
              contents[1]=pt[0];
              ibin[0]=icentr;
              ibin[1]=i+1;
          }
          if(fBeamType==0){
              contents[0]=pt[0];
              ibin[0]=i+1;
          }
          ipcut->Fill(contents,weight[icentr]);
          ipcut->SetBinError(ibin,weightErr[icentr]);
      }
  } 

  Int_t nDimSparse = ipcut->GetNdimensions();
  Int_t* binsvar = new Int_t[nDimSparse]; // number of bins for each variable
  Long_t nBins = 1; // used to calculate the total number of bins in the THnSparse

  for (Int_t iVar=0; iVar<nDimSparse; iVar++) {
      binsvar[iVar] = ipcut->GetAxis(iVar)->GetNbins();
      nBins *= binsvar[iVar];
  }

  Int_t *binfill = new Int_t[nDimSparse]; // bin to fill the THnSparse (holding the bin coordinates)
  // loop that sets 0 error in each bin
  for (Long_t iBin=0; iBin<nBins; iBin++) {
    Long_t bintmp = iBin ;
    for (Int_t iVar=0; iVar<nDimSparse; iVar++) {
      binfill[iVar] = 1 + bintmp % binsvar[iVar] ;
      bintmp /= binsvar[iVar] ;
    }
    //ipcut->SetBinError(binfill,0.); // put 0 everywhere
  }

  delete[] binsvar;
  delete[] binfill;

  return ipcut;
}

//____________________________________________________________________________
THnSparse* AliHFEspectrum::GetPIDxIPEff(Int_t source){
  //
  // Return PID x IP cut efficiency
  //
    const Int_t nPtbinning1 = 35;//number of pt bins, according to new binning
    const Int_t nCentralitybinning=11;//number of centrality bins
    Double_t kPtRange[nPtbinning1+1] = { 0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1., 1.1, 1.2, 1.3, 1.4, 1.5, 1.75, 2., 2.25, 2.5, 2.75, 3., 3.5, 4., 4.5, 5., 5.5, 6., 7., 8., 10., 12., 14., 16., 18., 20.};//pt bin limits
    Double_t kCentralityRange[nCentralitybinning+1] = {0.,1.,2., 3., 4., 5., 6., 7.,8.,9., 10., 11.};
    //Int_t ptpr = 0;
    Int_t nDim=1;  //dimensions of the efficiency weighting grid
    if(fBeamType==1)
    {
      //ptpr=1;
	nDim=2; //dimensions of the efficiency weighting grid
    }
    Int_t nBin[1] = {nPtbinning1};
    Int_t nBinPbPb[2] = {nCentralitybinning,nPtbinning1};

    THnSparseF *pideff;
    if(fBeamType==0) pideff = new THnSparseF("pideff", "PID efficiency; p_{t}(GeV/c)", nDim, nBin);
    else pideff = new THnSparseF("pideff", "PID efficiency; centrality bin; p_{t}(GeV/c)", nDim, nBinPbPb);
    for(Int_t idim = 0; idim < nDim; idim++)
    {

	if(nDim==1) pideff->SetBinEdges(idim, kPtRange);
	if(nDim==2)
	{
	    pideff->SetBinEdges(0, kCentralityRange);
	    pideff->SetBinEdges(1, kPtRange);
	}
    }

  Double_t pt[1];
  Double_t weight[nCentralitybinning];
  Double_t weightErr[nCentralitybinning];
  Double_t contents[2];

  for(Int_t a=0;a<nCentralitybinning;a++)
  {
      weight[a] = 1.0;
      weightErr[a] = 1.0;
  }

  Int_t looppt=nBin[0];
  Int_t loopcentr=1;
  Int_t ibin[2];
  if(fBeamType==1)
  {
      loopcentr=nBinPbPb[0];
  }

  for(int icentr=0; icentr<loopcentr; icentr++)
  {
      Double_t trdtpcPidEfficiency = fEfficiencyFunction->Eval(0); // assume we have constant TRD+TPC PID efficiency
      for(int i=0; i<looppt; i++)
      {
	  pt[0]=(kPtRange[i]+kPtRange[i+1])/2.;

          Double_t tofpideff = 0.;
          Double_t tofpideffesd = 0.;
          if(fEfficiencyTOFPIDD[icentr])
            tofpideff = fEfficiencyTOFPIDD[icentr]->Eval(pt[0]); 
          else{
            printf("TOF PID fit failed on conversion for centrality %d. The result is wrong!\n",icentr);
          }  
          if(fEfficiencyesdTOFPIDD[icentr])
            tofpideffesd = fEfficiencyesdTOFPIDD[icentr]->Eval(pt[0]);
          else{
            printf("TOF PID fit failed on conversion for centrality %d. The result is wrong!\n",icentr);
          }

          //tof pid eff x tpc pid eff x ip cut eff
          if(fIPParameterizedEff){
            if(source==0) {
              if(fEfficiencyIPCharmD[icentr]){
                weight[icentr] = tofpideff*trdtpcPidEfficiency*fEfficiencyIPCharmD[icentr]->Eval(pt[0]);
                weightErr[icentr] = 0; 
              }
              else{
                printf("Fit failed on charm IP cut efficiency for centrality %d\n",icentr);
                weight[icentr] = tofpideff*trdtpcPidEfficiency*fEfficiencyCharmSigD[icentr]->GetBinContent(i+1);
                weightErr[icentr] = tofpideff*trdtpcPidEfficiency*fEfficiencyCharmSigD[icentr]->GetBinError(i+1); 
              }
            } 
	    else if(source==2) {
              if(fEfficiencyIPConversionD[icentr]){
                weight[icentr] = tofpideffesd*trdtpcPidEfficiency*fEfficiencyIPConversionD[icentr]->Eval(pt[0]); 
                weightErr[icentr] = 0; 
              }
              else{
                printf("Fit failed on conversion IP cut efficiency for centrality %d\n",icentr);
                weight[icentr] = tofpideffesd*trdtpcPidEfficiency*fConversionEff[icentr]->GetBinContent(i+1);
                weightErr[icentr] = tofpideffesd*trdtpcPidEfficiency*fConversionEff[icentr]->GetBinError(i+1);
              }
            }
	    else if(source==3) {
              if(fEfficiencyIPNonhfeD[icentr]){
                weight[icentr] = tofpideffesd*trdtpcPidEfficiency*fEfficiencyIPNonhfeD[icentr]->Eval(pt[0]); 
                weightErr[icentr] = 0; 
              }
              else{
                printf("Fit failed on dalitz IP cut efficiency for centrality %d\n",icentr);
                weight[icentr] = tofpideffesd*trdtpcPidEfficiency*fNonHFEEff[icentr]->GetBinContent(i+1);
                weightErr[icentr] = tofpideffesd*trdtpcPidEfficiency*fNonHFEEff[icentr]->GetBinError(i+1);
              }  
            }
          }
          else{
            if(source==0){ 
              if(fEfficiencyIPCharmD[icentr]){
                weight[icentr] = tofpideff*trdtpcPidEfficiency*fEfficiencyIPCharmD[icentr]->Eval(pt[0]);
                weightErr[icentr] = 0;
              }
              else{
                printf("Fit failed on charm IP cut efficiency for centrality %d\n",icentr);
                weight[icentr] = tofpideff*trdtpcPidEfficiency*fEfficiencyCharmSigD[icentr]->GetBinContent(i+1);
                weightErr[icentr] = tofpideff*trdtpcPidEfficiency*fEfficiencyCharmSigD[icentr]->GetBinError(i+1);
              }
            }
	    else if(source==2){
              if(fBeamType==0){
                weight[icentr] = tofpideffesd*trdtpcPidEfficiency*fConversionEffbgc->GetBinContent(i+1); // conversion
                weightErr[icentr] = tofpideffesd*trdtpcPidEfficiency*fConversionEffbgc->GetBinError(i+1);
              }
              else{
                weight[icentr] = tofpideffesd*trdtpcPidEfficiency*fConversionEff[icentr]->GetBinContent(i+1); // conversion
                weightErr[icentr] = tofpideffesd*trdtpcPidEfficiency*fConversionEff[icentr]->GetBinError(i+1);
              }
            }
	    else if(source==3){
              if(fBeamType==0){
                weight[icentr] = tofpideffesd*trdtpcPidEfficiency*fNonHFEEffbgc->GetBinContent(i+1); // conversion
                weightErr[icentr] = tofpideffesd*trdtpcPidEfficiency*fNonHFEEffbgc->GetBinError(i+1);
              }
              else{ 
                weight[icentr] = tofpideffesd*trdtpcPidEfficiency*fNonHFEEff[icentr]->GetBinContent(i+1); // Dalitz
                weightErr[icentr] = tofpideffesd*trdtpcPidEfficiency*fNonHFEEff[icentr]->GetBinError(i+1);
              }
            }
          }

	  if(fBeamType==1){
	      contents[0]=icentr;
	      contents[1]=pt[0];
              ibin[0]=icentr;
              ibin[1]=i+1;
	  }
	  if(fBeamType==0){
	      contents[0]=pt[0];
              ibin[0]=i+1;
	  }

	  pideff->Fill(contents,weight[icentr]);
          pideff->SetBinError(ibin,weightErr[icentr]);
      }
  }

  Int_t nDimSparse = pideff->GetNdimensions();
  Int_t* binsvar = new Int_t[nDimSparse]; // number of bins for each variable
  Long_t nBins = 1; // used to calculate the total number of bins in the THnSparse

  for (Int_t iVar=0; iVar<nDimSparse; iVar++) {
      binsvar[iVar] = pideff->GetAxis(iVar)->GetNbins();
      nBins *= binsvar[iVar];
  }

  Int_t *binfill = new Int_t[nDimSparse]; // bin to fill the THnSparse (holding the bin coordinates)
  // loop that sets 0 error in each bin
  for (Long_t iBin=0; iBin<nBins; iBin++) {
    Long_t bintmp = iBin ;
    for (Int_t iVar=0; iVar<nDimSparse; iVar++) {
      binfill[iVar] = 1 + bintmp % binsvar[iVar] ;
      bintmp /= binsvar[iVar] ;
    }
  }

  delete[] binsvar;
  delete[] binfill;


  return pideff;
}

//__________________________________________________________________________
AliCFDataGrid *AliHFEspectrum::GetRawBspectra2ndMethod(){
 //
 // retrieve AliCFDataGrid for raw beauty spectra obtained from fit method
    //
    Int_t ptpr = 0;
    Int_t nDim = 1;
    if(fBeamType==0)
    {
	ptpr=0;
    }
    if(fBeamType==1)
    {
	ptpr=1;
	nDim=2;
    }

    const Int_t nPtbinning1 = 18;//number of pt bins, according to new binning
    const Int_t nCentralitybinning=11;//number of centrality bins
    Double_t kPtRange[19] = {0, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 12, 16, 20};
   
    Double_t kCentralityRange[nCentralitybinning+1] = {0.,1.,2., 3., 4., 5., 6., 7.,8.,9., 10., 11.};
    Int_t nBin[1] = {nPtbinning1};
    Int_t nBinPbPb[2] = {nCentralitybinning,nPtbinning1};

    AliCFDataGrid *rawBeautyContainer;
    if(fBeamType==0)  rawBeautyContainer = new AliCFDataGrid("rawBeautyContainer","rawBeautyContainer",nDim,nBin);
    else rawBeautyContainer = new AliCFDataGrid("rawBeautyContainer","rawBeautyContainer",nDim,nBinPbPb);
    //  printf("number of bins= %d\n",bins[0]);


    
    
    THnSparseF *brawspectra;
    if(fBeamType==0) brawspectra= new THnSparseF("brawspectra", "beauty yields ; p_{t}(GeV/c)", nDim, nBin);
    else brawspectra= new THnSparseF("brawspectra", "beauty yields ; p_{t}(GeV/c)", nDim, nBinPbPb);
    if(fBeamType==0) brawspectra->SetBinEdges(0, kPtRange);
    if(fBeamType==1)
      {
	//      brawspectra->SetBinEdges(0, centralityBins);
	brawspectra->SetBinEdges(0, kCentralityRange);
	brawspectra->SetBinEdges(1, kPtRange);
      }
    
    Double_t pt[1];
    Double_t yields= 0.;
    Double_t valuesb[2];
    
    //Int_t looppt=nBin[0];
    Int_t loopcentr=1;
    if(fBeamType==1)
      {
	loopcentr=nBinPbPb[0];
      }
    
    for(int icentr=0; icentr<loopcentr; icentr++)
      {
	
	for(int i=0; i<fBSpectrum2ndMethod->GetNbinsX(); i++){
	  pt[0]=(kPtRange[i]+kPtRange[i+1])/2.;
	  
	  yields = fBSpectrum2ndMethod->GetBinContent(i+1);
	  
	  if(fBeamType==1)
	    {
	      valuesb[0]=icentr;
	      valuesb[1]=pt[0];
	    }
	  if(fBeamType==0) valuesb[0]=pt[0];
	  brawspectra->Fill(valuesb,yields);
	}
      }
    
    
    
    Int_t nDimSparse = brawspectra->GetNdimensions();
    Int_t* binsvar = new Int_t[nDimSparse]; // number of bins for each variable
    Long_t nBins = 1; // used to calculate the total number of bins in the THnSparse
    
    for (Int_t iVar=0; iVar<nDimSparse; iVar++) {
      binsvar[iVar] = brawspectra->GetAxis(iVar)->GetNbins();
      nBins *= binsvar[iVar];
    }
    
    Int_t *binfill = new Int_t[nDimSparse]; // bin to fill the THnSparse (holding the bin coordinates)
    // loop that sets 0 error in each bin
    for (Long_t iBin=0; iBin<nBins; iBin++) {
      Long_t bintmp = iBin ;
      for (Int_t iVar=0; iVar<nDimSparse; iVar++) {
	binfill[iVar] = 1 + bintmp % binsvar[iVar] ;
	bintmp /= binsvar[iVar] ;
      }
      brawspectra->SetBinError(binfill,0.); // put 0 everywhere
    }
    
    
    rawBeautyContainer->SetGrid(brawspectra); // get charm efficiency
    TH1D* hRawBeautySpectra = (TH1D*)rawBeautyContainer->Project(ptpr);
    
    new TCanvas;
    fBSpectrum2ndMethod->SetMarkerStyle(24);
    fBSpectrum2ndMethod->Draw("p");
    hRawBeautySpectra->SetMarkerStyle(25);
    hRawBeautySpectra->Draw("samep");

    delete[] binfill;
    delete[] binsvar; 

    return rawBeautyContainer;
}

//__________________________________________________________________________
void AliHFEspectrum::CalculateNonHFEsyst(Int_t centrality){
  //
  // Calculate non HFE sys
  //
  //

  if(!fNonHFEsyst)
    return;

  Double_t evtnorm[1] = {0.0};
  if(fNMCbgEvents[0]>0) evtnorm[0]= double(fNEvents[0])/double(fNMCbgEvents[0]);
  
  AliCFDataGrid *convSourceGrid[kElecBgSources][kBgLevels];
  AliCFDataGrid *nonHFESourceGrid[kElecBgSources][kBgLevels];

  AliCFDataGrid *bgLevelGrid[2][kBgLevels];//for pi0 and eta based errors
  AliCFDataGrid *bgNonHFEGrid[kBgLevels];
  AliCFDataGrid *bgConvGrid[kBgLevels];

  Int_t stepbackground = 3;
  Int_t* bins=new Int_t[1];
  const Char_t *bgBase[2] = {"pi0","eta"};
 
  bins[0]=fConversionEff[centrality]->GetNbinsX();
   
  AliCFDataGrid *weightedConversionContainer = new AliCFDataGrid("weightedConversionContainer","weightedConversionContainer",1,bins);
  AliCFDataGrid *weightedNonHFEContainer = new AliCFDataGrid("weightedNonHFEContainer","weightedNonHFEContainer",1,bins);

  for(Int_t iLevel = 0; iLevel < kBgLevels; iLevel++){   
    for(Int_t iSource = 0; iSource < kElecBgSources; iSource++){
      convSourceGrid[iSource][iLevel] = new AliCFDataGrid(Form("convGrid_%d_%d_%d",iSource,iLevel,centrality),Form("convGrid_%d_%d_%d",iSource,iLevel,centrality),*fConvSourceContainer[iSource][iLevel][centrality],stepbackground);
      weightedConversionContainer->SetGrid(GetPIDxIPEff(2));
      convSourceGrid[iSource][iLevel]->Multiply(weightedConversionContainer,1.0);
      
      nonHFESourceGrid[iSource][iLevel] = new AliCFDataGrid(Form("nonHFEGrid_%d_%d_%d",iSource,iLevel,centrality),Form("nonHFEGrid_%d_%d_%d",iSource,iLevel,centrality),*fNonHFESourceContainer[iSource][iLevel][centrality],stepbackground);
      weightedNonHFEContainer->SetGrid(GetPIDxIPEff(3));
      nonHFESourceGrid[iSource][iLevel]->Multiply(weightedNonHFEContainer,1.0);
    }
    
    bgConvGrid[iLevel] = (AliCFDataGrid*)convSourceGrid[0][iLevel]->Clone();
    for(Int_t iSource = 2; iSource < kElecBgSources; iSource++){
      bgConvGrid[iLevel]->Add(convSourceGrid[iSource][iLevel]);
    }
    if(!fEtaSyst)
      bgConvGrid[iLevel]->Add(convSourceGrid[1][iLevel]);
    
    bgNonHFEGrid[iLevel] = (AliCFDataGrid*)nonHFESourceGrid[0][iLevel]->Clone(); 
    for(Int_t iSource = 2; iSource < kElecBgSources; iSource++){//add other sources to pi0, to get overall background from all meson decays, exception: eta (independent error calculation)
      bgNonHFEGrid[iLevel]->Add(nonHFESourceGrid[iSource][iLevel]);
    }
    if(!fEtaSyst)
      bgNonHFEGrid[iLevel]->Add(nonHFESourceGrid[1][iLevel]);
    
    bgLevelGrid[0][iLevel] = (AliCFDataGrid*)bgConvGrid[iLevel]->Clone();
    bgLevelGrid[0][iLevel]->Add(bgNonHFEGrid[iLevel]);
    if(fEtaSyst){
      bgLevelGrid[1][iLevel] = (AliCFDataGrid*)nonHFESourceGrid[1][iLevel]->Clone();//background for eta source
      bgLevelGrid[1][iLevel]->Add(convSourceGrid[1][iLevel]);
    }
  }
 
  
  //Now subtract the mean from upper, and lower from mean container to get the error based on the pion yield uncertainty (-> this error sums linearly, since its contribution to all meson yields is correlated; exception: eta errors in pp 7 TeV sum with others the gaussian way, as they are independent from pi0) 
  AliCFDataGrid *bgErrorGrid[2][2];//for pions/eta error base, for lower/upper
  TH1D* hBaseErrors[2][2];//pi0/eta and lower/upper
  for(Int_t iErr = 0; iErr < 2; iErr++){//errors for pi0 and eta base
    bgErrorGrid[iErr][0] = (AliCFDataGrid*)bgLevelGrid[iErr][1]->Clone();
    bgErrorGrid[iErr][0]->Add(bgLevelGrid[iErr][0],-1.);
    bgErrorGrid[iErr][1] = (AliCFDataGrid*)bgLevelGrid[iErr][2]->Clone();    
    bgErrorGrid[iErr][1]->Add(bgLevelGrid[iErr][0],-1.);

  //plot absolute differences between limit yields (upper/lower limit, based on pi0 and eta errors) and best estimate
 
    hBaseErrors[iErr][0] = (TH1D*)bgErrorGrid[iErr][0]->Project(0);
    hBaseErrors[iErr][0]->Scale(-1.);
    hBaseErrors[iErr][0]->SetTitle(Form("Absolute %s-based systematic errors from non-HF meson decays and conversions",bgBase[iErr]));
    hBaseErrors[iErr][1] = (TH1D*)bgErrorGrid[iErr][1]->Project(0);
    if(!fEtaSyst)break;
  }
  
 
  //Calculate the scaling errors for electrons from all mesons except for pions (and in pp 7 TeV case eta): square sum of (0.3 * best yield estimate), where 0.3 is the error generally assumed for m_t scaling
  TH1D *hSpeciesErrors[kElecBgSources-1];
  for(Int_t iSource = 1; iSource < kElecBgSources; iSource++){
    if(fEtaSyst && (iSource == 1))continue;
    hSpeciesErrors[iSource-1] = (TH1D*)convSourceGrid[iSource][0]->Project(0);
    TH1D *hNonHFEtemp = (TH1D*)nonHFESourceGrid[iSource][0]->Project(0);
    hSpeciesErrors[iSource-1]->Add(hNonHFEtemp);
    hSpeciesErrors[iSource-1]->Scale(0.3);   
  }
  
  //Int_t firstBgSource = 0;//if eta systematics are not from scaling
  //if(fEtaSyst){firstBgSource = 1;}//source 0 histograms are not filled if eta errors are independently determined!
  TH1D *hOverallSystErrLow = (TH1D*)hSpeciesErrors[1]->Clone();
  TH1D *hOverallSystErrUp = (TH1D*)hSpeciesErrors[1]->Clone();
  TH1D *hScalingErrors = (TH1D*)hSpeciesErrors[1]->Clone();

  TH1D *hOverallBinScaledErrsUp = (TH1D*)hOverallSystErrUp->Clone();
  TH1D *hOverallBinScaledErrsLow = (TH1D*)hOverallSystErrLow->Clone();

  for(Int_t iBin = 1; iBin <= kBgPtBins; iBin++){
    Double_t pi0basedErrLow,pi0basedErrUp,etaErrLow,etaErrUp;    
    pi0basedErrLow = hBaseErrors[0][0]->GetBinContent(iBin); 
    pi0basedErrUp = hBaseErrors[0][1]->GetBinContent(iBin);
    if(fEtaSyst){
      etaErrLow = hBaseErrors[1][0]->GetBinContent(iBin); 
      etaErrUp = hBaseErrors[1][1]->GetBinContent(iBin);
    }
    else{ etaErrLow = etaErrUp = 0.;}

    Double_t sqrsumErrs= 0;
    for(Int_t iSource = 1; iSource < kElecBgSources; iSource++){
      if(fEtaSyst && (iSource == 1))continue;
      Double_t scalingErr=hSpeciesErrors[iSource-1]->GetBinContent(iBin);
      sqrsumErrs+=(scalingErr*scalingErr);
    }
    for(Int_t iErr = 0; iErr < 2; iErr++){
      for(Int_t iLevel = 0; iLevel < 2; iLevel++){
        hBaseErrors[iErr][iLevel]->SetBinContent(iBin,hBaseErrors[iErr][iLevel]->GetBinContent(iBin)/hBaseErrors[iErr][iLevel]->GetBinWidth(iBin));
      }
      if(!fEtaSyst)break;
    }
    hOverallSystErrUp->SetBinContent(iBin, TMath::Sqrt((pi0basedErrUp*pi0basedErrUp)+(etaErrUp*etaErrUp)+sqrsumErrs));
    hOverallSystErrLow->SetBinContent(iBin, TMath::Sqrt((pi0basedErrLow*pi0basedErrLow)+(etaErrLow*etaErrLow)+sqrsumErrs));
    hScalingErrors->SetBinContent(iBin, TMath::Sqrt(sqrsumErrs)/hScalingErrors->GetBinWidth(iBin));

    hOverallBinScaledErrsUp->SetBinContent(iBin,hOverallSystErrUp->GetBinContent(iBin)/hOverallBinScaledErrsUp->GetBinWidth(iBin));
    hOverallBinScaledErrsLow->SetBinContent(iBin,hOverallSystErrLow->GetBinContent(iBin)/hOverallBinScaledErrsLow->GetBinWidth(iBin));		  
  }
   
  
  TCanvas *cPiErrors = new TCanvas("cPiErrors","cPiErrors",1000,600);
  cPiErrors->cd();
  cPiErrors->SetLogx();
  cPiErrors->SetLogy();
  hBaseErrors[0][0]->Draw();
  //hBaseErrors[0][1]->SetMarkerColor(kBlack);
  //hBaseErrors[0][1]->SetLineColor(kBlack);
  //hBaseErrors[0][1]->Draw("SAME");
  if(fEtaSyst){
    hBaseErrors[1][0]->Draw("SAME");
    hBaseErrors[1][0]->SetMarkerColor(kBlack);
    hBaseErrors[1][0]->SetLineColor(kBlack);
  //hBaseErrors[1][1]->SetMarkerColor(13);
  //hBaseErrors[1][1]->SetLineColor(13);
  //hBaseErrors[1][1]->Draw("SAME");
  }
  //hOverallBinScaledErrsUp->SetMarkerColor(kBlue);
  //hOverallBinScaledErrsUp->SetLineColor(kBlue);
  //hOverallBinScaledErrsUp->Draw("SAME");
  hOverallBinScaledErrsLow->SetMarkerColor(kGreen);
  hOverallBinScaledErrsLow->SetLineColor(kGreen);
  hOverallBinScaledErrsLow->Draw("SAME");
  hScalingErrors->SetLineColor(kBlue);
  hScalingErrors->Draw("SAME");

  TLegend *lPiErr = new TLegend(0.6,0.6, 0.95,0.95);
  lPiErr->AddEntry(hBaseErrors[0][0],"Lower error from pion error");
  //lPiErr->AddEntry(hBaseErrors[0][1],"Upper error from pion error");
  if(fEtaSyst){
  lPiErr->AddEntry(hBaseErrors[1][0],"Lower error from eta error");
  //lPiErr->AddEntry(hBaseErrors[1][1],"Upper error from eta error");
  }
  lPiErr->AddEntry(hScalingErrors, "scaling error");
  lPiErr->AddEntry(hOverallBinScaledErrsLow, "overall lower systematics");
  //lPiErr->AddEntry(hOverallBinScaledErrsUp, "overall upper systematics");
  lPiErr->Draw("SAME");

  //Normalize errors
  TH1D *hUpSystScaled = (TH1D*)hOverallSystErrUp->Clone();
  TH1D *hLowSystScaled = (TH1D*)hOverallSystErrLow->Clone();
  hUpSystScaled->Scale(evtnorm[0]);//scale by N(data)/N(MC), to make data sets comparable to saved subtracted spectrum (calculations in separate macro!)
  hLowSystScaled->Scale(evtnorm[0]);
  TH1D *hNormAllSystErrUp = (TH1D*)hUpSystScaled->Clone();
  TH1D *hNormAllSystErrLow = (TH1D*)hLowSystScaled->Clone();
  //histograms to be normalized to TGraphErrors
  CorrectFromTheWidth(hNormAllSystErrUp);
  CorrectFromTheWidth(hNormAllSystErrLow);

  TCanvas *cNormOvErrs = new TCanvas("cNormOvErrs","cNormOvErrs");
  cNormOvErrs->cd();
  cNormOvErrs->SetLogx();
  cNormOvErrs->SetLogy();

  TGraphErrors* gOverallSystErrUp = NormalizeTH1(hNormAllSystErrUp);
  TGraphErrors* gOverallSystErrLow = NormalizeTH1(hNormAllSystErrLow);
  gOverallSystErrUp->SetTitle("Overall Systematic non-HFE Errors");
  gOverallSystErrUp->SetMarkerColor(kBlack);
  gOverallSystErrUp->SetLineColor(kBlack);
  gOverallSystErrLow->SetMarkerColor(kRed);
  gOverallSystErrLow->SetLineColor(kRed);
  gOverallSystErrUp->Draw("AP");
  gOverallSystErrLow->Draw("PSAME");
  TLegend *lAllSys = new TLegend(0.4,0.6,0.89,0.89);
  lAllSys->AddEntry(gOverallSystErrLow,"lower","p");
  lAllSys->AddEntry(gOverallSystErrUp,"upper","p");
  lAllSys->Draw("same");


  AliCFDataGrid *bgYieldGrid;
  if(fEtaSyst){
    bgLevelGrid[0][0]->Add(bgLevelGrid[1][0]);//Addition of the eta background best estimate to the rest. Needed to be separated for error treatment - now overall background necessary! If no separate eta systematics exist, the corresponding grid has already been added before.
  }
  bgYieldGrid = (AliCFDataGrid*)bgLevelGrid[0][0]->Clone();

  TH1D *hBgYield = (TH1D*)bgYieldGrid->Project(0);
  TH1D* hRelErrUp = (TH1D*)hOverallSystErrUp->Clone();
  hRelErrUp->Divide(hBgYield);
  TH1D* hRelErrLow = (TH1D*)hOverallSystErrLow->Clone();
  hRelErrLow->Divide(hBgYield);

  TCanvas *cRelErrs = new TCanvas("cRelErrs","cRelErrs");
  cRelErrs->cd();
  cRelErrs->SetLogx();
  hRelErrUp->SetTitle("Relative error of non-HFE background yield");
  hRelErrUp->Draw();
  hRelErrLow->SetLineColor(kBlack);
  hRelErrLow->Draw("SAME");

  TLegend *lRel = new TLegend(0.6,0.6,0.95,0.95);
  lRel->AddEntry(hRelErrUp, "upper");
  lRel->AddEntry(hRelErrLow, "lower");
  lRel->Draw("SAME");

  //CorrectFromTheWidth(hBgYield);
  //hBgYield->Scale(evtnorm[0]);
 
 
  //write histograms/TGraphs to file
  TFile *output = new TFile("systHists.root","recreate");

  hBgYield->SetName("hBgYield");  
  hBgYield->Write();
  hRelErrUp->SetName("hRelErrUp");
  hRelErrUp->Write();
  hRelErrLow->SetName("hRelErrLow");
  hRelErrLow->Write();
  hUpSystScaled->SetName("hOverallSystErrUp");
  hUpSystScaled->Write();
  hLowSystScaled->SetName("hOverallSystErrLow");
  hLowSystScaled->Write();
  gOverallSystErrUp->SetName("gOverallSystErrUp");
  gOverallSystErrUp->Write();
  gOverallSystErrLow->SetName("gOverallSystErrLow");
  gOverallSystErrLow->Write(); 

  output->Close(); 
  delete output;
  
}

//____________________________________________________________
void AliHFEspectrum::UnfoldBG(AliCFDataGrid* const bgsubpectrum){

  //
  // Unfold backgrounds to check its sanity
  //

  AliCFContainer *mcContainer = GetContainer(kMCContainerCharmMC);
  //AliCFContainer *mcContainer = GetContainer(kMCContainerMC);
  if(!mcContainer){
    AliError("MC Container not available");
    return;
  }

  if(!fCorrelation){
    AliError("No Correlation map available");
    return;
  }

  // Data 
  AliCFDataGrid *dataGrid = 0x0;
  dataGrid = bgsubpectrum;

  // Guessed
  AliCFDataGrid* guessedGrid = new AliCFDataGrid("guessed","",*mcContainer, fStepGuessedUnfolding);
  THnSparse* guessedTHnSparse = ((AliCFGridSparse*)guessedGrid->GetData())->GetGrid();

  // Efficiency
  AliCFEffGrid* efficiencyD = new AliCFEffGrid("efficiency","",*mcContainer);
  efficiencyD->CalculateEfficiency(fStepMC+2,fStepTrue);

  // Unfold background spectra
  Int_t nDim=1;
  if(fBeamType==0)nDim = 1;
  if(fBeamType==1)nDim = 2;
  AliCFUnfolding unfolding("unfolding","",nDim,fCorrelation,efficiencyD->GetGrid(),dataGrid->GetGrid(),guessedTHnSparse);
  if(fUnSetCorrelatedErrors) unfolding.UnsetCorrelatedErrors();
  unfolding.SetMaxNumberOfIterations(fNumberOfIterations);
  if(fSetSmoothing) unfolding.UseSmoothing();
  unfolding.Unfold();

  // Results
  THnSparse* result = unfolding.GetUnfolded();
  TCanvas *ctest = new TCanvas("yvonnetest","yvonnetest",1000,600);
  if(fBeamType==1)
  {
      ctest->Divide(2,2);
      ctest->cd(1);
      result->GetAxis(0)->SetRange(1,1);
      TH1D* htest1=(TH1D*)result->Projection(0);
      htest1->Draw();
      ctest->cd(2);
      result->GetAxis(0)->SetRange(1,1);
      TH1D* htest2=(TH1D*)result->Projection(1);
      htest2->Draw();
      ctest->cd(3);
      result->GetAxis(0)->SetRange(6,6);
      TH1D* htest3=(TH1D*)result->Projection(0);
      htest3->Draw();
      ctest->cd(4);
      result->GetAxis(0)->SetRange(6,6);
      TH1D* htest4=(TH1D*)result->Projection(1);
      htest4->Draw();

  }





  TGraphErrors* unfoldedbgspectrumD = Normalize(result);
  if(!unfoldedbgspectrumD) {
    AliError("Unfolded background spectrum doesn't exist");
  }
  else{
    TFile *file = TFile::Open("unfoldedbgspectrum.root","recreate");
    if(fBeamType==0)unfoldedbgspectrumD->Write("unfoldedbgspectrum");

    if(fBeamType==1)
    {
        Int_t centr=1;
	result->GetAxis(0)->SetRange(centr,centr);
	unfoldedbgspectrumD = Normalize(result,centr-1);
	unfoldedbgspectrumD->Write("unfoldedbgspectrum_centr0_20");
        centr=6;
	result->GetAxis(0)->SetRange(centr,centr);
	unfoldedbgspectrumD = Normalize(result,centr-1);
        unfoldedbgspectrumD->Write("unfoldedbgspectrum_centr40_80");
    }

    file->Close();
  }
}
 AliHFEspectrum.cxx:1
 AliHFEspectrum.cxx:2
 AliHFEspectrum.cxx:3
 AliHFEspectrum.cxx:4
 AliHFEspectrum.cxx:5
 AliHFEspectrum.cxx:6
 AliHFEspectrum.cxx:7
 AliHFEspectrum.cxx:8
 AliHFEspectrum.cxx:9
 AliHFEspectrum.cxx:10
 AliHFEspectrum.cxx:11
 AliHFEspectrum.cxx:12
 AliHFEspectrum.cxx:13
 AliHFEspectrum.cxx:14
 AliHFEspectrum.cxx:15
 AliHFEspectrum.cxx:16
 AliHFEspectrum.cxx:17
 AliHFEspectrum.cxx:18
 AliHFEspectrum.cxx:19
 AliHFEspectrum.cxx:20
 AliHFEspectrum.cxx:21
 AliHFEspectrum.cxx:22
 AliHFEspectrum.cxx:23
 AliHFEspectrum.cxx:24
 AliHFEspectrum.cxx:25
 AliHFEspectrum.cxx:26
 AliHFEspectrum.cxx:27
 AliHFEspectrum.cxx:28
 AliHFEspectrum.cxx:29
 AliHFEspectrum.cxx:30
 AliHFEspectrum.cxx:31
 AliHFEspectrum.cxx:32
 AliHFEspectrum.cxx:33
 AliHFEspectrum.cxx:34
 AliHFEspectrum.cxx:35
 AliHFEspectrum.cxx:36
 AliHFEspectrum.cxx:37
 AliHFEspectrum.cxx:38
 AliHFEspectrum.cxx:39
 AliHFEspectrum.cxx:40
 AliHFEspectrum.cxx:41
 AliHFEspectrum.cxx:42
 AliHFEspectrum.cxx:43
 AliHFEspectrum.cxx:44
 AliHFEspectrum.cxx:45
 AliHFEspectrum.cxx:46
 AliHFEspectrum.cxx:47
 AliHFEspectrum.cxx:48
 AliHFEspectrum.cxx:49
 AliHFEspectrum.cxx:50
 AliHFEspectrum.cxx:51
 AliHFEspectrum.cxx:52
 AliHFEspectrum.cxx:53
 AliHFEspectrum.cxx:54
 AliHFEspectrum.cxx:55
 AliHFEspectrum.cxx:56
 AliHFEspectrum.cxx:57
 AliHFEspectrum.cxx:58
 AliHFEspectrum.cxx:59
 AliHFEspectrum.cxx:60
 AliHFEspectrum.cxx:61
 AliHFEspectrum.cxx:62
 AliHFEspectrum.cxx:63
 AliHFEspectrum.cxx:64
 AliHFEspectrum.cxx:65
 AliHFEspectrum.cxx:66
 AliHFEspectrum.cxx:67
 AliHFEspectrum.cxx:68
 AliHFEspectrum.cxx:69
 AliHFEspectrum.cxx:70
 AliHFEspectrum.cxx:71
 AliHFEspectrum.cxx:72
 AliHFEspectrum.cxx:73
 AliHFEspectrum.cxx:74
 AliHFEspectrum.cxx:75
 AliHFEspectrum.cxx:76
 AliHFEspectrum.cxx:77
 AliHFEspectrum.cxx:78
 AliHFEspectrum.cxx:79
 AliHFEspectrum.cxx:80
 AliHFEspectrum.cxx:81
 AliHFEspectrum.cxx:82
 AliHFEspectrum.cxx:83
 AliHFEspectrum.cxx:84
 AliHFEspectrum.cxx:85
 AliHFEspectrum.cxx:86
 AliHFEspectrum.cxx:87
 AliHFEspectrum.cxx:88
 AliHFEspectrum.cxx:89
 AliHFEspectrum.cxx:90
 AliHFEspectrum.cxx:91
 AliHFEspectrum.cxx:92
 AliHFEspectrum.cxx:93
 AliHFEspectrum.cxx:94
 AliHFEspectrum.cxx:95
 AliHFEspectrum.cxx:96
 AliHFEspectrum.cxx:97
 AliHFEspectrum.cxx:98
 AliHFEspectrum.cxx:99
 AliHFEspectrum.cxx:100
 AliHFEspectrum.cxx:101
 AliHFEspectrum.cxx:102
 AliHFEspectrum.cxx:103
 AliHFEspectrum.cxx:104
 AliHFEspectrum.cxx:105
 AliHFEspectrum.cxx:106
 AliHFEspectrum.cxx:107
 AliHFEspectrum.cxx:108
 AliHFEspectrum.cxx:109
 AliHFEspectrum.cxx:110
 AliHFEspectrum.cxx:111
 AliHFEspectrum.cxx:112
 AliHFEspectrum.cxx:113
 AliHFEspectrum.cxx:114
 AliHFEspectrum.cxx:115
 AliHFEspectrum.cxx:116
 AliHFEspectrum.cxx:117
 AliHFEspectrum.cxx:118
 AliHFEspectrum.cxx:119
 AliHFEspectrum.cxx:120
 AliHFEspectrum.cxx:121
 AliHFEspectrum.cxx:122
 AliHFEspectrum.cxx:123
 AliHFEspectrum.cxx:124
 AliHFEspectrum.cxx:125
 AliHFEspectrum.cxx:126
 AliHFEspectrum.cxx:127
 AliHFEspectrum.cxx:128
 AliHFEspectrum.cxx:129
 AliHFEspectrum.cxx:130
 AliHFEspectrum.cxx:131
 AliHFEspectrum.cxx:132
 AliHFEspectrum.cxx:133
 AliHFEspectrum.cxx:134
 AliHFEspectrum.cxx:135
 AliHFEspectrum.cxx:136
 AliHFEspectrum.cxx:137
 AliHFEspectrum.cxx:138
 AliHFEspectrum.cxx:139
 AliHFEspectrum.cxx:140
 AliHFEspectrum.cxx:141
 AliHFEspectrum.cxx:142
 AliHFEspectrum.cxx:143
 AliHFEspectrum.cxx:144
 AliHFEspectrum.cxx:145
 AliHFEspectrum.cxx:146
 AliHFEspectrum.cxx:147
 AliHFEspectrum.cxx:148
 AliHFEspectrum.cxx:149
 AliHFEspectrum.cxx:150
 AliHFEspectrum.cxx:151
 AliHFEspectrum.cxx:152
 AliHFEspectrum.cxx:153
 AliHFEspectrum.cxx:154
 AliHFEspectrum.cxx:155
 AliHFEspectrum.cxx:156
 AliHFEspectrum.cxx:157
 AliHFEspectrum.cxx:158
 AliHFEspectrum.cxx:159
 AliHFEspectrum.cxx:160
 AliHFEspectrum.cxx:161
 AliHFEspectrum.cxx:162
 AliHFEspectrum.cxx:163
 AliHFEspectrum.cxx:164
 AliHFEspectrum.cxx:165
 AliHFEspectrum.cxx:166
 AliHFEspectrum.cxx:167
 AliHFEspectrum.cxx:168
 AliHFEspectrum.cxx:169
 AliHFEspectrum.cxx:170
 AliHFEspectrum.cxx:171
 AliHFEspectrum.cxx:172
 AliHFEspectrum.cxx:173
 AliHFEspectrum.cxx:174
 AliHFEspectrum.cxx:175
 AliHFEspectrum.cxx:176
 AliHFEspectrum.cxx:177
 AliHFEspectrum.cxx:178
 AliHFEspectrum.cxx:179
 AliHFEspectrum.cxx:180
 AliHFEspectrum.cxx:181
 AliHFEspectrum.cxx:182
 AliHFEspectrum.cxx:183
 AliHFEspectrum.cxx:184
 AliHFEspectrum.cxx:185
 AliHFEspectrum.cxx:186
 AliHFEspectrum.cxx:187
 AliHFEspectrum.cxx:188
 AliHFEspectrum.cxx:189
 AliHFEspectrum.cxx:190
 AliHFEspectrum.cxx:191
 AliHFEspectrum.cxx:192
 AliHFEspectrum.cxx:193
 AliHFEspectrum.cxx:194
 AliHFEspectrum.cxx:195
 AliHFEspectrum.cxx:196
 AliHFEspectrum.cxx:197
 AliHFEspectrum.cxx:198
 AliHFEspectrum.cxx:199
 AliHFEspectrum.cxx:200
 AliHFEspectrum.cxx:201
 AliHFEspectrum.cxx:202
 AliHFEspectrum.cxx:203
 AliHFEspectrum.cxx:204
 AliHFEspectrum.cxx:205
 AliHFEspectrum.cxx:206
 AliHFEspectrum.cxx:207
 AliHFEspectrum.cxx:208
 AliHFEspectrum.cxx:209
 AliHFEspectrum.cxx:210
 AliHFEspectrum.cxx:211
 AliHFEspectrum.cxx:212
 AliHFEspectrum.cxx:213
 AliHFEspectrum.cxx:214
 AliHFEspectrum.cxx:215
 AliHFEspectrum.cxx:216
 AliHFEspectrum.cxx:217
 AliHFEspectrum.cxx:218
 AliHFEspectrum.cxx:219
 AliHFEspectrum.cxx:220
 AliHFEspectrum.cxx:221
 AliHFEspectrum.cxx:222
 AliHFEspectrum.cxx:223
 AliHFEspectrum.cxx:224
 AliHFEspectrum.cxx:225
 AliHFEspectrum.cxx:226
 AliHFEspectrum.cxx:227
 AliHFEspectrum.cxx:228
 AliHFEspectrum.cxx:229
 AliHFEspectrum.cxx:230
 AliHFEspectrum.cxx:231
 AliHFEspectrum.cxx:232
 AliHFEspectrum.cxx:233
 AliHFEspectrum.cxx:234
 AliHFEspectrum.cxx:235
 AliHFEspectrum.cxx:236
 AliHFEspectrum.cxx:237
 AliHFEspectrum.cxx:238
 AliHFEspectrum.cxx:239
 AliHFEspectrum.cxx:240
 AliHFEspectrum.cxx:241
 AliHFEspectrum.cxx:242
 AliHFEspectrum.cxx:243
 AliHFEspectrum.cxx:244
 AliHFEspectrum.cxx:245
 AliHFEspectrum.cxx:246
 AliHFEspectrum.cxx:247
 AliHFEspectrum.cxx:248
 AliHFEspectrum.cxx:249
 AliHFEspectrum.cxx:250
 AliHFEspectrum.cxx:251
 AliHFEspectrum.cxx:252
 AliHFEspectrum.cxx:253
 AliHFEspectrum.cxx:254
 AliHFEspectrum.cxx:255
 AliHFEspectrum.cxx:256
 AliHFEspectrum.cxx:257
 AliHFEspectrum.cxx:258
 AliHFEspectrum.cxx:259
 AliHFEspectrum.cxx:260
 AliHFEspectrum.cxx:261
 AliHFEspectrum.cxx:262
 AliHFEspectrum.cxx:263
 AliHFEspectrum.cxx:264
 AliHFEspectrum.cxx:265
 AliHFEspectrum.cxx:266
 AliHFEspectrum.cxx:267
 AliHFEspectrum.cxx:268
 AliHFEspectrum.cxx:269
 AliHFEspectrum.cxx:270
 AliHFEspectrum.cxx:271
 AliHFEspectrum.cxx:272
 AliHFEspectrum.cxx:273
 AliHFEspectrum.cxx:274
 AliHFEspectrum.cxx:275
 AliHFEspectrum.cxx:276
 AliHFEspectrum.cxx:277
 AliHFEspectrum.cxx:278
 AliHFEspectrum.cxx:279
 AliHFEspectrum.cxx:280
 AliHFEspectrum.cxx:281
 AliHFEspectrum.cxx:282
 AliHFEspectrum.cxx:283
 AliHFEspectrum.cxx:284
 AliHFEspectrum.cxx:285
 AliHFEspectrum.cxx:286
 AliHFEspectrum.cxx:287
 AliHFEspectrum.cxx:288
 AliHFEspectrum.cxx:289
 AliHFEspectrum.cxx:290
 AliHFEspectrum.cxx:291
 AliHFEspectrum.cxx:292
 AliHFEspectrum.cxx:293
 AliHFEspectrum.cxx:294
 AliHFEspectrum.cxx:295
 AliHFEspectrum.cxx:296
 AliHFEspectrum.cxx:297
 AliHFEspectrum.cxx:298
 AliHFEspectrum.cxx:299
 AliHFEspectrum.cxx:300
 AliHFEspectrum.cxx:301
 AliHFEspectrum.cxx:302
 AliHFEspectrum.cxx:303
 AliHFEspectrum.cxx:304
 AliHFEspectrum.cxx:305
 AliHFEspectrum.cxx:306
 AliHFEspectrum.cxx:307
 AliHFEspectrum.cxx:308
 AliHFEspectrum.cxx:309
 AliHFEspectrum.cxx:310
 AliHFEspectrum.cxx:311
 AliHFEspectrum.cxx:312
 AliHFEspectrum.cxx:313
 AliHFEspectrum.cxx:314
 AliHFEspectrum.cxx:315
 AliHFEspectrum.cxx:316
 AliHFEspectrum.cxx:317
 AliHFEspectrum.cxx:318
 AliHFEspectrum.cxx:319
 AliHFEspectrum.cxx:320
 AliHFEspectrum.cxx:321
 AliHFEspectrum.cxx:322
 AliHFEspectrum.cxx:323
 AliHFEspectrum.cxx:324
 AliHFEspectrum.cxx:325
 AliHFEspectrum.cxx:326
 AliHFEspectrum.cxx:327
 AliHFEspectrum.cxx:328
 AliHFEspectrum.cxx:329
 AliHFEspectrum.cxx:330
 AliHFEspectrum.cxx:331
 AliHFEspectrum.cxx:332
 AliHFEspectrum.cxx:333
 AliHFEspectrum.cxx:334
 AliHFEspectrum.cxx:335
 AliHFEspectrum.cxx:336
 AliHFEspectrum.cxx:337
 AliHFEspectrum.cxx:338
 AliHFEspectrum.cxx:339
 AliHFEspectrum.cxx:340
 AliHFEspectrum.cxx:341
 AliHFEspectrum.cxx:342
 AliHFEspectrum.cxx:343
 AliHFEspectrum.cxx:344
 AliHFEspectrum.cxx:345
 AliHFEspectrum.cxx:346
 AliHFEspectrum.cxx:347
 AliHFEspectrum.cxx:348
 AliHFEspectrum.cxx:349
 AliHFEspectrum.cxx:350
 AliHFEspectrum.cxx:351
 AliHFEspectrum.cxx:352
 AliHFEspectrum.cxx:353
 AliHFEspectrum.cxx:354
 AliHFEspectrum.cxx:355
 AliHFEspectrum.cxx:356
 AliHFEspectrum.cxx:357
 AliHFEspectrum.cxx:358
 AliHFEspectrum.cxx:359
 AliHFEspectrum.cxx:360
 AliHFEspectrum.cxx:361
 AliHFEspectrum.cxx:362
 AliHFEspectrum.cxx:363
 AliHFEspectrum.cxx:364
 AliHFEspectrum.cxx:365
 AliHFEspectrum.cxx:366
 AliHFEspectrum.cxx:367
 AliHFEspectrum.cxx:368
 AliHFEspectrum.cxx:369
 AliHFEspectrum.cxx:370
 AliHFEspectrum.cxx:371
 AliHFEspectrum.cxx:372
 AliHFEspectrum.cxx:373
 AliHFEspectrum.cxx:374
 AliHFEspectrum.cxx:375
 AliHFEspectrum.cxx:376
 AliHFEspectrum.cxx:377
 AliHFEspectrum.cxx:378
 AliHFEspectrum.cxx:379
 AliHFEspectrum.cxx:380
 AliHFEspectrum.cxx:381
 AliHFEspectrum.cxx:382
 AliHFEspectrum.cxx:383
 AliHFEspectrum.cxx:384
 AliHFEspectrum.cxx:385
 AliHFEspectrum.cxx:386
 AliHFEspectrum.cxx:387
 AliHFEspectrum.cxx:388
 AliHFEspectrum.cxx:389
 AliHFEspectrum.cxx:390
 AliHFEspectrum.cxx:391
 AliHFEspectrum.cxx:392
 AliHFEspectrum.cxx:393
 AliHFEspectrum.cxx:394
 AliHFEspectrum.cxx:395
 AliHFEspectrum.cxx:396
 AliHFEspectrum.cxx:397
 AliHFEspectrum.cxx:398
 AliHFEspectrum.cxx:399
 AliHFEspectrum.cxx:400
 AliHFEspectrum.cxx:401
 AliHFEspectrum.cxx:402
 AliHFEspectrum.cxx:403
 AliHFEspectrum.cxx:404
 AliHFEspectrum.cxx:405
 AliHFEspectrum.cxx:406
 AliHFEspectrum.cxx:407
 AliHFEspectrum.cxx:408
 AliHFEspectrum.cxx:409
 AliHFEspectrum.cxx:410
 AliHFEspectrum.cxx:411
 AliHFEspectrum.cxx:412
 AliHFEspectrum.cxx:413
 AliHFEspectrum.cxx:414
 AliHFEspectrum.cxx:415
 AliHFEspectrum.cxx:416
 AliHFEspectrum.cxx:417
 AliHFEspectrum.cxx:418
 AliHFEspectrum.cxx:419
 AliHFEspectrum.cxx:420
 AliHFEspectrum.cxx:421
 AliHFEspectrum.cxx:422
 AliHFEspectrum.cxx:423
 AliHFEspectrum.cxx:424
 AliHFEspectrum.cxx:425
 AliHFEspectrum.cxx:426
 AliHFEspectrum.cxx:427
 AliHFEspectrum.cxx:428
 AliHFEspectrum.cxx:429
 AliHFEspectrum.cxx:430
 AliHFEspectrum.cxx:431
 AliHFEspectrum.cxx:432
 AliHFEspectrum.cxx:433
 AliHFEspectrum.cxx:434
 AliHFEspectrum.cxx:435
 AliHFEspectrum.cxx:436
 AliHFEspectrum.cxx:437
 AliHFEspectrum.cxx:438
 AliHFEspectrum.cxx:439
 AliHFEspectrum.cxx:440
 AliHFEspectrum.cxx:441
 AliHFEspectrum.cxx:442
 AliHFEspectrum.cxx:443
 AliHFEspectrum.cxx:444
 AliHFEspectrum.cxx:445
 AliHFEspectrum.cxx:446
 AliHFEspectrum.cxx:447
 AliHFEspectrum.cxx:448
 AliHFEspectrum.cxx:449
 AliHFEspectrum.cxx:450
 AliHFEspectrum.cxx:451
 AliHFEspectrum.cxx:452
 AliHFEspectrum.cxx:453
 AliHFEspectrum.cxx:454
 AliHFEspectrum.cxx:455
 AliHFEspectrum.cxx:456
 AliHFEspectrum.cxx:457
 AliHFEspectrum.cxx:458
 AliHFEspectrum.cxx:459
 AliHFEspectrum.cxx:460
 AliHFEspectrum.cxx:461
 AliHFEspectrum.cxx:462
 AliHFEspectrum.cxx:463
 AliHFEspectrum.cxx:464
 AliHFEspectrum.cxx:465
 AliHFEspectrum.cxx:466
 AliHFEspectrum.cxx:467
 AliHFEspectrum.cxx:468
 AliHFEspectrum.cxx:469
 AliHFEspectrum.cxx:470
 AliHFEspectrum.cxx:471
 AliHFEspectrum.cxx:472
 AliHFEspectrum.cxx:473
 AliHFEspectrum.cxx:474
 AliHFEspectrum.cxx:475
 AliHFEspectrum.cxx:476
 AliHFEspectrum.cxx:477
 AliHFEspectrum.cxx:478
 AliHFEspectrum.cxx:479
 AliHFEspectrum.cxx:480
 AliHFEspectrum.cxx:481
 AliHFEspectrum.cxx:482
 AliHFEspectrum.cxx:483
 AliHFEspectrum.cxx:484
 AliHFEspectrum.cxx:485
 AliHFEspectrum.cxx:486
 AliHFEspectrum.cxx:487
 AliHFEspectrum.cxx:488
 AliHFEspectrum.cxx:489
 AliHFEspectrum.cxx:490
 AliHFEspectrum.cxx:491
 AliHFEspectrum.cxx:492
 AliHFEspectrum.cxx:493
 AliHFEspectrum.cxx:494
 AliHFEspectrum.cxx:495
 AliHFEspectrum.cxx:496
 AliHFEspectrum.cxx:497
 AliHFEspectrum.cxx:498
 AliHFEspectrum.cxx:499
 AliHFEspectrum.cxx:500
 AliHFEspectrum.cxx:501
 AliHFEspectrum.cxx:502
 AliHFEspectrum.cxx:503
 AliHFEspectrum.cxx:504
 AliHFEspectrum.cxx:505
 AliHFEspectrum.cxx:506
 AliHFEspectrum.cxx:507
 AliHFEspectrum.cxx:508
 AliHFEspectrum.cxx:509
 AliHFEspectrum.cxx:510
 AliHFEspectrum.cxx:511
 AliHFEspectrum.cxx:512
 AliHFEspectrum.cxx:513
 AliHFEspectrum.cxx:514
 AliHFEspectrum.cxx:515
 AliHFEspectrum.cxx:516
 AliHFEspectrum.cxx:517
 AliHFEspectrum.cxx:518
 AliHFEspectrum.cxx:519
 AliHFEspectrum.cxx:520
 AliHFEspectrum.cxx:521
 AliHFEspectrum.cxx:522
 AliHFEspectrum.cxx:523
 AliHFEspectrum.cxx:524
 AliHFEspectrum.cxx:525
 AliHFEspectrum.cxx:526
 AliHFEspectrum.cxx:527
 AliHFEspectrum.cxx:528
 AliHFEspectrum.cxx:529
 AliHFEspectrum.cxx:530
 AliHFEspectrum.cxx:531
 AliHFEspectrum.cxx:532
 AliHFEspectrum.cxx:533
 AliHFEspectrum.cxx:534
 AliHFEspectrum.cxx:535
 AliHFEspectrum.cxx:536
 AliHFEspectrum.cxx:537
 AliHFEspectrum.cxx:538
 AliHFEspectrum.cxx:539
 AliHFEspectrum.cxx:540
 AliHFEspectrum.cxx:541
 AliHFEspectrum.cxx:542
 AliHFEspectrum.cxx:543
 AliHFEspectrum.cxx:544
 AliHFEspectrum.cxx:545
 AliHFEspectrum.cxx:546
 AliHFEspectrum.cxx:547
 AliHFEspectrum.cxx:548
 AliHFEspectrum.cxx:549
 AliHFEspectrum.cxx:550
 AliHFEspectrum.cxx:551
 AliHFEspectrum.cxx:552
 AliHFEspectrum.cxx:553
 AliHFEspectrum.cxx:554
 AliHFEspectrum.cxx:555
 AliHFEspectrum.cxx:556
 AliHFEspectrum.cxx:557
 AliHFEspectrum.cxx:558
 AliHFEspectrum.cxx:559
 AliHFEspectrum.cxx:560
 AliHFEspectrum.cxx:561
 AliHFEspectrum.cxx:562
 AliHFEspectrum.cxx:563
 AliHFEspectrum.cxx:564
 AliHFEspectrum.cxx:565
 AliHFEspectrum.cxx:566
 AliHFEspectrum.cxx:567
 AliHFEspectrum.cxx:568
 AliHFEspectrum.cxx:569
 AliHFEspectrum.cxx:570
 AliHFEspectrum.cxx:571
 AliHFEspectrum.cxx:572
 AliHFEspectrum.cxx:573
 AliHFEspectrum.cxx:574
 AliHFEspectrum.cxx:575
 AliHFEspectrum.cxx:576
 AliHFEspectrum.cxx:577
 AliHFEspectrum.cxx:578
 AliHFEspectrum.cxx:579
 AliHFEspectrum.cxx:580
 AliHFEspectrum.cxx:581
 AliHFEspectrum.cxx:582
 AliHFEspectrum.cxx:583
 AliHFEspectrum.cxx:584
 AliHFEspectrum.cxx:585
 AliHFEspectrum.cxx:586
 AliHFEspectrum.cxx:587
 AliHFEspectrum.cxx:588
 AliHFEspectrum.cxx:589
 AliHFEspectrum.cxx:590
 AliHFEspectrum.cxx:591
 AliHFEspectrum.cxx:592
 AliHFEspectrum.cxx:593
 AliHFEspectrum.cxx:594
 AliHFEspectrum.cxx:595
 AliHFEspectrum.cxx:596
 AliHFEspectrum.cxx:597
 AliHFEspectrum.cxx:598
 AliHFEspectrum.cxx:599
 AliHFEspectrum.cxx:600
 AliHFEspectrum.cxx:601
 AliHFEspectrum.cxx:602
 AliHFEspectrum.cxx:603
 AliHFEspectrum.cxx:604
 AliHFEspectrum.cxx:605
 AliHFEspectrum.cxx:606
 AliHFEspectrum.cxx:607
 AliHFEspectrum.cxx:608
 AliHFEspectrum.cxx:609
 AliHFEspectrum.cxx:610
 AliHFEspectrum.cxx:611
 AliHFEspectrum.cxx:612
 AliHFEspectrum.cxx:613
 AliHFEspectrum.cxx:614
 AliHFEspectrum.cxx:615
 AliHFEspectrum.cxx:616
 AliHFEspectrum.cxx:617
 AliHFEspectrum.cxx:618
 AliHFEspectrum.cxx:619
 AliHFEspectrum.cxx:620
 AliHFEspectrum.cxx:621
 AliHFEspectrum.cxx:622
 AliHFEspectrum.cxx:623
 AliHFEspectrum.cxx:624
 AliHFEspectrum.cxx:625
 AliHFEspectrum.cxx:626
 AliHFEspectrum.cxx:627
 AliHFEspectrum.cxx:628
 AliHFEspectrum.cxx:629
 AliHFEspectrum.cxx:630
 AliHFEspectrum.cxx:631
 AliHFEspectrum.cxx:632
 AliHFEspectrum.cxx:633
 AliHFEspectrum.cxx:634
 AliHFEspectrum.cxx:635
 AliHFEspectrum.cxx:636
 AliHFEspectrum.cxx:637
 AliHFEspectrum.cxx:638
 AliHFEspectrum.cxx:639
 AliHFEspectrum.cxx:640
 AliHFEspectrum.cxx:641
 AliHFEspectrum.cxx:642
 AliHFEspectrum.cxx:643
 AliHFEspectrum.cxx:644
 AliHFEspectrum.cxx:645
 AliHFEspectrum.cxx:646
 AliHFEspectrum.cxx:647
 AliHFEspectrum.cxx:648
 AliHFEspectrum.cxx:649
 AliHFEspectrum.cxx:650
 AliHFEspectrum.cxx:651
 AliHFEspectrum.cxx:652
 AliHFEspectrum.cxx:653
 AliHFEspectrum.cxx:654
 AliHFEspectrum.cxx:655
 AliHFEspectrum.cxx:656
 AliHFEspectrum.cxx:657
 AliHFEspectrum.cxx:658
 AliHFEspectrum.cxx:659
 AliHFEspectrum.cxx:660
 AliHFEspectrum.cxx:661
 AliHFEspectrum.cxx:662
 AliHFEspectrum.cxx:663
 AliHFEspectrum.cxx:664
 AliHFEspectrum.cxx:665
 AliHFEspectrum.cxx:666
 AliHFEspectrum.cxx:667
 AliHFEspectrum.cxx:668
 AliHFEspectrum.cxx:669
 AliHFEspectrum.cxx:670
 AliHFEspectrum.cxx:671
 AliHFEspectrum.cxx:672
 AliHFEspectrum.cxx:673
 AliHFEspectrum.cxx:674
 AliHFEspectrum.cxx:675
 AliHFEspectrum.cxx:676
 AliHFEspectrum.cxx:677
 AliHFEspectrum.cxx:678
 AliHFEspectrum.cxx:679
 AliHFEspectrum.cxx:680
 AliHFEspectrum.cxx:681
 AliHFEspectrum.cxx:682
 AliHFEspectrum.cxx:683
 AliHFEspectrum.cxx:684
 AliHFEspectrum.cxx:685
 AliHFEspectrum.cxx:686
 AliHFEspectrum.cxx:687
 AliHFEspectrum.cxx:688
 AliHFEspectrum.cxx:689
 AliHFEspectrum.cxx:690
 AliHFEspectrum.cxx:691
 AliHFEspectrum.cxx:692
 AliHFEspectrum.cxx:693
 AliHFEspectrum.cxx:694
 AliHFEspectrum.cxx:695
 AliHFEspectrum.cxx:696
 AliHFEspectrum.cxx:697
 AliHFEspectrum.cxx:698
 AliHFEspectrum.cxx:699
 AliHFEspectrum.cxx:700
 AliHFEspectrum.cxx:701
 AliHFEspectrum.cxx:702
 AliHFEspectrum.cxx:703
 AliHFEspectrum.cxx:704
 AliHFEspectrum.cxx:705
 AliHFEspectrum.cxx:706
 AliHFEspectrum.cxx:707
 AliHFEspectrum.cxx:708
 AliHFEspectrum.cxx:709
 AliHFEspectrum.cxx:710
 AliHFEspectrum.cxx:711
 AliHFEspectrum.cxx:712
 AliHFEspectrum.cxx:713
 AliHFEspectrum.cxx:714
 AliHFEspectrum.cxx:715
 AliHFEspectrum.cxx:716
 AliHFEspectrum.cxx:717
 AliHFEspectrum.cxx:718
 AliHFEspectrum.cxx:719
 AliHFEspectrum.cxx:720
 AliHFEspectrum.cxx:721
 AliHFEspectrum.cxx:722
 AliHFEspectrum.cxx:723
 AliHFEspectrum.cxx:724
 AliHFEspectrum.cxx:725
 AliHFEspectrum.cxx:726
 AliHFEspectrum.cxx:727
 AliHFEspectrum.cxx:728
 AliHFEspectrum.cxx:729
 AliHFEspectrum.cxx:730
 AliHFEspectrum.cxx:731
 AliHFEspectrum.cxx:732
 AliHFEspectrum.cxx:733
 AliHFEspectrum.cxx:734
 AliHFEspectrum.cxx:735
 AliHFEspectrum.cxx:736
 AliHFEspectrum.cxx:737
 AliHFEspectrum.cxx:738
 AliHFEspectrum.cxx:739
 AliHFEspectrum.cxx:740
 AliHFEspectrum.cxx:741
 AliHFEspectrum.cxx:742
 AliHFEspectrum.cxx:743
 AliHFEspectrum.cxx:744
 AliHFEspectrum.cxx:745
 AliHFEspectrum.cxx:746
 AliHFEspectrum.cxx:747
 AliHFEspectrum.cxx:748
 AliHFEspectrum.cxx:749
 AliHFEspectrum.cxx:750
 AliHFEspectrum.cxx:751
 AliHFEspectrum.cxx:752
 AliHFEspectrum.cxx:753
 AliHFEspectrum.cxx:754
 AliHFEspectrum.cxx:755
 AliHFEspectrum.cxx:756
 AliHFEspectrum.cxx:757
 AliHFEspectrum.cxx:758
 AliHFEspectrum.cxx:759
 AliHFEspectrum.cxx:760
 AliHFEspectrum.cxx:761
 AliHFEspectrum.cxx:762
 AliHFEspectrum.cxx:763
 AliHFEspectrum.cxx:764
 AliHFEspectrum.cxx:765
 AliHFEspectrum.cxx:766
 AliHFEspectrum.cxx:767
 AliHFEspectrum.cxx:768
 AliHFEspectrum.cxx:769
 AliHFEspectrum.cxx:770
 AliHFEspectrum.cxx:771
 AliHFEspectrum.cxx:772
 AliHFEspectrum.cxx:773
 AliHFEspectrum.cxx:774
 AliHFEspectrum.cxx:775
 AliHFEspectrum.cxx:776
 AliHFEspectrum.cxx:777
 AliHFEspectrum.cxx:778
 AliHFEspectrum.cxx:779
 AliHFEspectrum.cxx:780
 AliHFEspectrum.cxx:781
 AliHFEspectrum.cxx:782
 AliHFEspectrum.cxx:783
 AliHFEspectrum.cxx:784
 AliHFEspectrum.cxx:785
 AliHFEspectrum.cxx:786
 AliHFEspectrum.cxx:787
 AliHFEspectrum.cxx:788
 AliHFEspectrum.cxx:789
 AliHFEspectrum.cxx:790
 AliHFEspectrum.cxx:791
 AliHFEspectrum.cxx:792
 AliHFEspectrum.cxx:793
 AliHFEspectrum.cxx:794
 AliHFEspectrum.cxx:795
 AliHFEspectrum.cxx:796
 AliHFEspectrum.cxx:797
 AliHFEspectrum.cxx:798
 AliHFEspectrum.cxx:799
 AliHFEspectrum.cxx:800
 AliHFEspectrum.cxx:801
 AliHFEspectrum.cxx:802
 AliHFEspectrum.cxx:803
 AliHFEspectrum.cxx:804
 AliHFEspectrum.cxx:805
 AliHFEspectrum.cxx:806
 AliHFEspectrum.cxx:807
 AliHFEspectrum.cxx:808
 AliHFEspectrum.cxx:809
 AliHFEspectrum.cxx:810
 AliHFEspectrum.cxx:811
 AliHFEspectrum.cxx:812
 AliHFEspectrum.cxx:813
 AliHFEspectrum.cxx:814
 AliHFEspectrum.cxx:815
 AliHFEspectrum.cxx:816
 AliHFEspectrum.cxx:817
 AliHFEspectrum.cxx:818
 AliHFEspectrum.cxx:819
 AliHFEspectrum.cxx:820
 AliHFEspectrum.cxx:821
 AliHFEspectrum.cxx:822
 AliHFEspectrum.cxx:823
 AliHFEspectrum.cxx:824
 AliHFEspectrum.cxx:825
 AliHFEspectrum.cxx:826
 AliHFEspectrum.cxx:827
 AliHFEspectrum.cxx:828
 AliHFEspectrum.cxx:829
 AliHFEspectrum.cxx:830
 AliHFEspectrum.cxx:831
 AliHFEspectrum.cxx:832
 AliHFEspectrum.cxx:833
 AliHFEspectrum.cxx:834
 AliHFEspectrum.cxx:835
 AliHFEspectrum.cxx:836
 AliHFEspectrum.cxx:837
 AliHFEspectrum.cxx:838
 AliHFEspectrum.cxx:839
 AliHFEspectrum.cxx:840
 AliHFEspectrum.cxx:841
 AliHFEspectrum.cxx:842
 AliHFEspectrum.cxx:843
 AliHFEspectrum.cxx:844
 AliHFEspectrum.cxx:845
 AliHFEspectrum.cxx:846
 AliHFEspectrum.cxx:847
 AliHFEspectrum.cxx:848
 AliHFEspectrum.cxx:849
 AliHFEspectrum.cxx:850
 AliHFEspectrum.cxx:851
 AliHFEspectrum.cxx:852
 AliHFEspectrum.cxx:853
 AliHFEspectrum.cxx:854
 AliHFEspectrum.cxx:855
 AliHFEspectrum.cxx:856
 AliHFEspectrum.cxx:857
 AliHFEspectrum.cxx:858
 AliHFEspectrum.cxx:859
 AliHFEspectrum.cxx:860
 AliHFEspectrum.cxx:861
 AliHFEspectrum.cxx:862
 AliHFEspectrum.cxx:863
 AliHFEspectrum.cxx:864
 AliHFEspectrum.cxx:865
 AliHFEspectrum.cxx:866
 AliHFEspectrum.cxx:867
 AliHFEspectrum.cxx:868
 AliHFEspectrum.cxx:869
 AliHFEspectrum.cxx:870
 AliHFEspectrum.cxx:871
 AliHFEspectrum.cxx:872
 AliHFEspectrum.cxx:873
 AliHFEspectrum.cxx:874
 AliHFEspectrum.cxx:875
 AliHFEspectrum.cxx:876
 AliHFEspectrum.cxx:877
 AliHFEspectrum.cxx:878
 AliHFEspectrum.cxx:879
 AliHFEspectrum.cxx:880
 AliHFEspectrum.cxx:881
 AliHFEspectrum.cxx:882
 AliHFEspectrum.cxx:883
 AliHFEspectrum.cxx:884
 AliHFEspectrum.cxx:885
 AliHFEspectrum.cxx:886
 AliHFEspectrum.cxx:887
 AliHFEspectrum.cxx:888
 AliHFEspectrum.cxx:889
 AliHFEspectrum.cxx:890
 AliHFEspectrum.cxx:891
 AliHFEspectrum.cxx:892
 AliHFEspectrum.cxx:893
 AliHFEspectrum.cxx:894
 AliHFEspectrum.cxx:895
 AliHFEspectrum.cxx:896
 AliHFEspectrum.cxx:897
 AliHFEspectrum.cxx:898
 AliHFEspectrum.cxx:899
 AliHFEspectrum.cxx:900
 AliHFEspectrum.cxx:901
 AliHFEspectrum.cxx:902
 AliHFEspectrum.cxx:903
 AliHFEspectrum.cxx:904
 AliHFEspectrum.cxx:905
 AliHFEspectrum.cxx:906
 AliHFEspectrum.cxx:907
 AliHFEspectrum.cxx:908
 AliHFEspectrum.cxx:909
 AliHFEspectrum.cxx:910
 AliHFEspectrum.cxx:911
 AliHFEspectrum.cxx:912
 AliHFEspectrum.cxx:913
 AliHFEspectrum.cxx:914
 AliHFEspectrum.cxx:915
 AliHFEspectrum.cxx:916
 AliHFEspectrum.cxx:917
 AliHFEspectrum.cxx:918
 AliHFEspectrum.cxx:919
 AliHFEspectrum.cxx:920
 AliHFEspectrum.cxx:921
 AliHFEspectrum.cxx:922
 AliHFEspectrum.cxx:923
 AliHFEspectrum.cxx:924
 AliHFEspectrum.cxx:925
 AliHFEspectrum.cxx:926
 AliHFEspectrum.cxx:927
 AliHFEspectrum.cxx:928
 AliHFEspectrum.cxx:929
 AliHFEspectrum.cxx:930
 AliHFEspectrum.cxx:931
 AliHFEspectrum.cxx:932
 AliHFEspectrum.cxx:933
 AliHFEspectrum.cxx:934
 AliHFEspectrum.cxx:935
 AliHFEspectrum.cxx:936
 AliHFEspectrum.cxx:937
 AliHFEspectrum.cxx:938
 AliHFEspectrum.cxx:939
 AliHFEspectrum.cxx:940
 AliHFEspectrum.cxx:941
 AliHFEspectrum.cxx:942
 AliHFEspectrum.cxx:943
 AliHFEspectrum.cxx:944
 AliHFEspectrum.cxx:945
 AliHFEspectrum.cxx:946
 AliHFEspectrum.cxx:947
 AliHFEspectrum.cxx:948
 AliHFEspectrum.cxx:949
 AliHFEspectrum.cxx:950
 AliHFEspectrum.cxx:951
 AliHFEspectrum.cxx:952
 AliHFEspectrum.cxx:953
 AliHFEspectrum.cxx:954
 AliHFEspectrum.cxx:955
 AliHFEspectrum.cxx:956
 AliHFEspectrum.cxx:957
 AliHFEspectrum.cxx:958
 AliHFEspectrum.cxx:959
 AliHFEspectrum.cxx:960
 AliHFEspectrum.cxx:961
 AliHFEspectrum.cxx:962
 AliHFEspectrum.cxx:963
 AliHFEspectrum.cxx:964
 AliHFEspectrum.cxx:965
 AliHFEspectrum.cxx:966
 AliHFEspectrum.cxx:967
 AliHFEspectrum.cxx:968
 AliHFEspectrum.cxx:969
 AliHFEspectrum.cxx:970
 AliHFEspectrum.cxx:971
 AliHFEspectrum.cxx:972
 AliHFEspectrum.cxx:973
 AliHFEspectrum.cxx:974
 AliHFEspectrum.cxx:975
 AliHFEspectrum.cxx:976
 AliHFEspectrum.cxx:977
 AliHFEspectrum.cxx:978
 AliHFEspectrum.cxx:979
 AliHFEspectrum.cxx:980
 AliHFEspectrum.cxx:981
 AliHFEspectrum.cxx:982
 AliHFEspectrum.cxx:983
 AliHFEspectrum.cxx:984
 AliHFEspectrum.cxx:985
 AliHFEspectrum.cxx:986
 AliHFEspectrum.cxx:987
 AliHFEspectrum.cxx:988
 AliHFEspectrum.cxx:989
 AliHFEspectrum.cxx:990
 AliHFEspectrum.cxx:991
 AliHFEspectrum.cxx:992
 AliHFEspectrum.cxx:993
 AliHFEspectrum.cxx:994
 AliHFEspectrum.cxx:995
 AliHFEspectrum.cxx:996
 AliHFEspectrum.cxx:997
 AliHFEspectrum.cxx:998
 AliHFEspectrum.cxx:999
 AliHFEspectrum.cxx:1000
 AliHFEspectrum.cxx:1001
 AliHFEspectrum.cxx:1002
 AliHFEspectrum.cxx:1003
 AliHFEspectrum.cxx:1004
 AliHFEspectrum.cxx:1005
 AliHFEspectrum.cxx:1006
 AliHFEspectrum.cxx:1007
 AliHFEspectrum.cxx:1008
 AliHFEspectrum.cxx:1009
 AliHFEspectrum.cxx:1010
 AliHFEspectrum.cxx:1011
 AliHFEspectrum.cxx:1012
 AliHFEspectrum.cxx:1013
 AliHFEspectrum.cxx:1014
 AliHFEspectrum.cxx:1015
 AliHFEspectrum.cxx:1016
 AliHFEspectrum.cxx:1017
 AliHFEspectrum.cxx:1018
 AliHFEspectrum.cxx:1019
 AliHFEspectrum.cxx:1020
 AliHFEspectrum.cxx:1021
 AliHFEspectrum.cxx:1022
 AliHFEspectrum.cxx:1023
 AliHFEspectrum.cxx:1024
 AliHFEspectrum.cxx:1025
 AliHFEspectrum.cxx:1026
 AliHFEspectrum.cxx:1027
 AliHFEspectrum.cxx:1028
 AliHFEspectrum.cxx:1029
 AliHFEspectrum.cxx:1030
 AliHFEspectrum.cxx:1031
 AliHFEspectrum.cxx:1032
 AliHFEspectrum.cxx:1033
 AliHFEspectrum.cxx:1034
 AliHFEspectrum.cxx:1035
 AliHFEspectrum.cxx:1036
 AliHFEspectrum.cxx:1037
 AliHFEspectrum.cxx:1038
 AliHFEspectrum.cxx:1039
 AliHFEspectrum.cxx:1040
 AliHFEspectrum.cxx:1041
 AliHFEspectrum.cxx:1042
 AliHFEspectrum.cxx:1043
 AliHFEspectrum.cxx:1044
 AliHFEspectrum.cxx:1045
 AliHFEspectrum.cxx:1046
 AliHFEspectrum.cxx:1047
 AliHFEspectrum.cxx:1048
 AliHFEspectrum.cxx:1049
 AliHFEspectrum.cxx:1050
 AliHFEspectrum.cxx:1051
 AliHFEspectrum.cxx:1052
 AliHFEspectrum.cxx:1053
 AliHFEspectrum.cxx:1054
 AliHFEspectrum.cxx:1055
 AliHFEspectrum.cxx:1056
 AliHFEspectrum.cxx:1057
 AliHFEspectrum.cxx:1058
 AliHFEspectrum.cxx:1059
 AliHFEspectrum.cxx:1060
 AliHFEspectrum.cxx:1061
 AliHFEspectrum.cxx:1062
 AliHFEspectrum.cxx:1063
 AliHFEspectrum.cxx:1064
 AliHFEspectrum.cxx:1065
 AliHFEspectrum.cxx:1066
 AliHFEspectrum.cxx:1067
 AliHFEspectrum.cxx:1068
 AliHFEspectrum.cxx:1069
 AliHFEspectrum.cxx:1070
 AliHFEspectrum.cxx:1071
 AliHFEspectrum.cxx:1072
 AliHFEspectrum.cxx:1073
 AliHFEspectrum.cxx:1074
 AliHFEspectrum.cxx:1075
 AliHFEspectrum.cxx:1076
 AliHFEspectrum.cxx:1077
 AliHFEspectrum.cxx:1078
 AliHFEspectrum.cxx:1079
 AliHFEspectrum.cxx:1080
 AliHFEspectrum.cxx:1081
 AliHFEspectrum.cxx:1082
 AliHFEspectrum.cxx:1083
 AliHFEspectrum.cxx:1084
 AliHFEspectrum.cxx:1085
 AliHFEspectrum.cxx:1086
 AliHFEspectrum.cxx:1087
 AliHFEspectrum.cxx:1088
 AliHFEspectrum.cxx:1089
 AliHFEspectrum.cxx:1090
 AliHFEspectrum.cxx:1091
 AliHFEspectrum.cxx:1092
 AliHFEspectrum.cxx:1093
 AliHFEspectrum.cxx:1094
 AliHFEspectrum.cxx:1095
 AliHFEspectrum.cxx:1096
 AliHFEspectrum.cxx:1097
 AliHFEspectrum.cxx:1098
 AliHFEspectrum.cxx:1099
 AliHFEspectrum.cxx:1100
 AliHFEspectrum.cxx:1101
 AliHFEspectrum.cxx:1102
 AliHFEspectrum.cxx:1103
 AliHFEspectrum.cxx:1104
 AliHFEspectrum.cxx:1105
 AliHFEspectrum.cxx:1106
 AliHFEspectrum.cxx:1107
 AliHFEspectrum.cxx:1108
 AliHFEspectrum.cxx:1109
 AliHFEspectrum.cxx:1110
 AliHFEspectrum.cxx:1111
 AliHFEspectrum.cxx:1112
 AliHFEspectrum.cxx:1113
 AliHFEspectrum.cxx:1114
 AliHFEspectrum.cxx:1115
 AliHFEspectrum.cxx:1116
 AliHFEspectrum.cxx:1117
 AliHFEspectrum.cxx:1118
 AliHFEspectrum.cxx:1119
 AliHFEspectrum.cxx:1120
 AliHFEspectrum.cxx:1121
 AliHFEspectrum.cxx:1122
 AliHFEspectrum.cxx:1123
 AliHFEspectrum.cxx:1124
 AliHFEspectrum.cxx:1125
 AliHFEspectrum.cxx:1126
 AliHFEspectrum.cxx:1127
 AliHFEspectrum.cxx:1128
 AliHFEspectrum.cxx:1129
 AliHFEspectrum.cxx:1130
 AliHFEspectrum.cxx:1131
 AliHFEspectrum.cxx:1132
 AliHFEspectrum.cxx:1133
 AliHFEspectrum.cxx:1134
 AliHFEspectrum.cxx:1135
 AliHFEspectrum.cxx:1136
 AliHFEspectrum.cxx:1137
 AliHFEspectrum.cxx:1138
 AliHFEspectrum.cxx:1139
 AliHFEspectrum.cxx:1140
 AliHFEspectrum.cxx:1141
 AliHFEspectrum.cxx:1142
 AliHFEspectrum.cxx:1143
 AliHFEspectrum.cxx:1144
 AliHFEspectrum.cxx:1145
 AliHFEspectrum.cxx:1146
 AliHFEspectrum.cxx:1147
 AliHFEspectrum.cxx:1148
 AliHFEspectrum.cxx:1149
 AliHFEspectrum.cxx:1150
 AliHFEspectrum.cxx:1151
 AliHFEspectrum.cxx:1152
 AliHFEspectrum.cxx:1153
 AliHFEspectrum.cxx:1154
 AliHFEspectrum.cxx:1155
 AliHFEspectrum.cxx:1156
 AliHFEspectrum.cxx:1157
 AliHFEspectrum.cxx:1158
 AliHFEspectrum.cxx:1159
 AliHFEspectrum.cxx:1160
 AliHFEspectrum.cxx:1161
 AliHFEspectrum.cxx:1162
 AliHFEspectrum.cxx:1163
 AliHFEspectrum.cxx:1164
 AliHFEspectrum.cxx:1165
 AliHFEspectrum.cxx:1166
 AliHFEspectrum.cxx:1167
 AliHFEspectrum.cxx:1168
 AliHFEspectrum.cxx:1169
 AliHFEspectrum.cxx:1170
 AliHFEspectrum.cxx:1171
 AliHFEspectrum.cxx:1172
 AliHFEspectrum.cxx:1173
 AliHFEspectrum.cxx:1174
 AliHFEspectrum.cxx:1175
 AliHFEspectrum.cxx:1176
 AliHFEspectrum.cxx:1177
 AliHFEspectrum.cxx:1178
 AliHFEspectrum.cxx:1179
 AliHFEspectrum.cxx:1180
 AliHFEspectrum.cxx:1181
 AliHFEspectrum.cxx:1182
 AliHFEspectrum.cxx:1183
 AliHFEspectrum.cxx:1184
 AliHFEspectrum.cxx:1185
 AliHFEspectrum.cxx:1186
 AliHFEspectrum.cxx:1187
 AliHFEspectrum.cxx:1188
 AliHFEspectrum.cxx:1189
 AliHFEspectrum.cxx:1190
 AliHFEspectrum.cxx:1191
 AliHFEspectrum.cxx:1192
 AliHFEspectrum.cxx:1193
 AliHFEspectrum.cxx:1194
 AliHFEspectrum.cxx:1195
 AliHFEspectrum.cxx:1196
 AliHFEspectrum.cxx:1197
 AliHFEspectrum.cxx:1198
 AliHFEspectrum.cxx:1199
 AliHFEspectrum.cxx:1200
 AliHFEspectrum.cxx:1201
 AliHFEspectrum.cxx:1202
 AliHFEspectrum.cxx:1203
 AliHFEspectrum.cxx:1204
 AliHFEspectrum.cxx:1205
 AliHFEspectrum.cxx:1206
 AliHFEspectrum.cxx:1207
 AliHFEspectrum.cxx:1208
 AliHFEspectrum.cxx:1209
 AliHFEspectrum.cxx:1210
 AliHFEspectrum.cxx:1211
 AliHFEspectrum.cxx:1212
 AliHFEspectrum.cxx:1213
 AliHFEspectrum.cxx:1214
 AliHFEspectrum.cxx:1215
 AliHFEspectrum.cxx:1216
 AliHFEspectrum.cxx:1217
 AliHFEspectrum.cxx:1218
 AliHFEspectrum.cxx:1219
 AliHFEspectrum.cxx:1220
 AliHFEspectrum.cxx:1221
 AliHFEspectrum.cxx:1222
 AliHFEspectrum.cxx:1223
 AliHFEspectrum.cxx:1224
 AliHFEspectrum.cxx:1225
 AliHFEspectrum.cxx:1226
 AliHFEspectrum.cxx:1227
 AliHFEspectrum.cxx:1228
 AliHFEspectrum.cxx:1229
 AliHFEspectrum.cxx:1230
 AliHFEspectrum.cxx:1231
 AliHFEspectrum.cxx:1232
 AliHFEspectrum.cxx:1233
 AliHFEspectrum.cxx:1234
 AliHFEspectrum.cxx:1235
 AliHFEspectrum.cxx:1236
 AliHFEspectrum.cxx:1237
 AliHFEspectrum.cxx:1238
 AliHFEspectrum.cxx:1239
 AliHFEspectrum.cxx:1240
 AliHFEspectrum.cxx:1241
 AliHFEspectrum.cxx:1242
 AliHFEspectrum.cxx:1243
 AliHFEspectrum.cxx:1244
 AliHFEspectrum.cxx:1245
 AliHFEspectrum.cxx:1246
 AliHFEspectrum.cxx:1247
 AliHFEspectrum.cxx:1248
 AliHFEspectrum.cxx:1249
 AliHFEspectrum.cxx:1250
 AliHFEspectrum.cxx:1251
 AliHFEspectrum.cxx:1252
 AliHFEspectrum.cxx:1253
 AliHFEspectrum.cxx:1254
 AliHFEspectrum.cxx:1255
 AliHFEspectrum.cxx:1256
 AliHFEspectrum.cxx:1257
 AliHFEspectrum.cxx:1258
 AliHFEspectrum.cxx:1259
 AliHFEspectrum.cxx:1260
 AliHFEspectrum.cxx:1261
 AliHFEspectrum.cxx:1262
 AliHFEspectrum.cxx:1263
 AliHFEspectrum.cxx:1264
 AliHFEspectrum.cxx:1265
 AliHFEspectrum.cxx:1266
 AliHFEspectrum.cxx:1267
 AliHFEspectrum.cxx:1268
 AliHFEspectrum.cxx:1269
 AliHFEspectrum.cxx:1270
 AliHFEspectrum.cxx:1271
 AliHFEspectrum.cxx:1272
 AliHFEspectrum.cxx:1273
 AliHFEspectrum.cxx:1274
 AliHFEspectrum.cxx:1275
 AliHFEspectrum.cxx:1276
 AliHFEspectrum.cxx:1277
 AliHFEspectrum.cxx:1278
 AliHFEspectrum.cxx:1279
 AliHFEspectrum.cxx:1280
 AliHFEspectrum.cxx:1281
 AliHFEspectrum.cxx:1282
 AliHFEspectrum.cxx:1283
 AliHFEspectrum.cxx:1284
 AliHFEspectrum.cxx:1285
 AliHFEspectrum.cxx:1286
 AliHFEspectrum.cxx:1287
 AliHFEspectrum.cxx:1288
 AliHFEspectrum.cxx:1289
 AliHFEspectrum.cxx:1290
 AliHFEspectrum.cxx:1291
 AliHFEspectrum.cxx:1292
 AliHFEspectrum.cxx:1293
 AliHFEspectrum.cxx:1294
 AliHFEspectrum.cxx:1295
 AliHFEspectrum.cxx:1296
 AliHFEspectrum.cxx:1297
 AliHFEspectrum.cxx:1298
 AliHFEspectrum.cxx:1299
 AliHFEspectrum.cxx:1300
 AliHFEspectrum.cxx:1301
 AliHFEspectrum.cxx:1302
 AliHFEspectrum.cxx:1303
 AliHFEspectrum.cxx:1304
 AliHFEspectrum.cxx:1305
 AliHFEspectrum.cxx:1306
 AliHFEspectrum.cxx:1307
 AliHFEspectrum.cxx:1308
 AliHFEspectrum.cxx:1309
 AliHFEspectrum.cxx:1310
 AliHFEspectrum.cxx:1311
 AliHFEspectrum.cxx:1312
 AliHFEspectrum.cxx:1313
 AliHFEspectrum.cxx:1314
 AliHFEspectrum.cxx:1315
 AliHFEspectrum.cxx:1316
 AliHFEspectrum.cxx:1317
 AliHFEspectrum.cxx:1318
 AliHFEspectrum.cxx:1319
 AliHFEspectrum.cxx:1320
 AliHFEspectrum.cxx:1321
 AliHFEspectrum.cxx:1322
 AliHFEspectrum.cxx:1323
 AliHFEspectrum.cxx:1324
 AliHFEspectrum.cxx:1325
 AliHFEspectrum.cxx:1326
 AliHFEspectrum.cxx:1327
 AliHFEspectrum.cxx:1328
 AliHFEspectrum.cxx:1329
 AliHFEspectrum.cxx:1330
 AliHFEspectrum.cxx:1331
 AliHFEspectrum.cxx:1332
 AliHFEspectrum.cxx:1333
 AliHFEspectrum.cxx:1334
 AliHFEspectrum.cxx:1335
 AliHFEspectrum.cxx:1336
 AliHFEspectrum.cxx:1337
 AliHFEspectrum.cxx:1338
 AliHFEspectrum.cxx:1339
 AliHFEspectrum.cxx:1340
 AliHFEspectrum.cxx:1341
 AliHFEspectrum.cxx:1342
 AliHFEspectrum.cxx:1343
 AliHFEspectrum.cxx:1344
 AliHFEspectrum.cxx:1345
 AliHFEspectrum.cxx:1346
 AliHFEspectrum.cxx:1347
 AliHFEspectrum.cxx:1348
 AliHFEspectrum.cxx:1349
 AliHFEspectrum.cxx:1350
 AliHFEspectrum.cxx:1351
 AliHFEspectrum.cxx:1352
 AliHFEspectrum.cxx:1353
 AliHFEspectrum.cxx:1354
 AliHFEspectrum.cxx:1355
 AliHFEspectrum.cxx:1356
 AliHFEspectrum.cxx:1357
 AliHFEspectrum.cxx:1358
 AliHFEspectrum.cxx:1359
 AliHFEspectrum.cxx:1360
 AliHFEspectrum.cxx:1361
 AliHFEspectrum.cxx:1362
 AliHFEspectrum.cxx:1363
 AliHFEspectrum.cxx:1364
 AliHFEspectrum.cxx:1365
 AliHFEspectrum.cxx:1366
 AliHFEspectrum.cxx:1367
 AliHFEspectrum.cxx:1368
 AliHFEspectrum.cxx:1369
 AliHFEspectrum.cxx:1370
 AliHFEspectrum.cxx:1371
 AliHFEspectrum.cxx:1372
 AliHFEspectrum.cxx:1373
 AliHFEspectrum.cxx:1374
 AliHFEspectrum.cxx:1375
 AliHFEspectrum.cxx:1376
 AliHFEspectrum.cxx:1377
 AliHFEspectrum.cxx:1378
 AliHFEspectrum.cxx:1379
 AliHFEspectrum.cxx:1380
 AliHFEspectrum.cxx:1381
 AliHFEspectrum.cxx:1382
 AliHFEspectrum.cxx:1383
 AliHFEspectrum.cxx:1384
 AliHFEspectrum.cxx:1385
 AliHFEspectrum.cxx:1386
 AliHFEspectrum.cxx:1387
 AliHFEspectrum.cxx:1388
 AliHFEspectrum.cxx:1389
 AliHFEspectrum.cxx:1390
 AliHFEspectrum.cxx:1391
 AliHFEspectrum.cxx:1392
 AliHFEspectrum.cxx:1393
 AliHFEspectrum.cxx:1394
 AliHFEspectrum.cxx:1395
 AliHFEspectrum.cxx:1396
 AliHFEspectrum.cxx:1397
 AliHFEspectrum.cxx:1398
 AliHFEspectrum.cxx:1399
 AliHFEspectrum.cxx:1400
 AliHFEspectrum.cxx:1401
 AliHFEspectrum.cxx:1402
 AliHFEspectrum.cxx:1403
 AliHFEspectrum.cxx:1404
 AliHFEspectrum.cxx:1405
 AliHFEspectrum.cxx:1406
 AliHFEspectrum.cxx:1407
 AliHFEspectrum.cxx:1408
 AliHFEspectrum.cxx:1409
 AliHFEspectrum.cxx:1410
 AliHFEspectrum.cxx:1411
 AliHFEspectrum.cxx:1412
 AliHFEspectrum.cxx:1413
 AliHFEspectrum.cxx:1414
 AliHFEspectrum.cxx:1415
 AliHFEspectrum.cxx:1416
 AliHFEspectrum.cxx:1417
 AliHFEspectrum.cxx:1418
 AliHFEspectrum.cxx:1419
 AliHFEspectrum.cxx:1420
 AliHFEspectrum.cxx:1421
 AliHFEspectrum.cxx:1422
 AliHFEspectrum.cxx:1423
 AliHFEspectrum.cxx:1424
 AliHFEspectrum.cxx:1425
 AliHFEspectrum.cxx:1426
 AliHFEspectrum.cxx:1427
 AliHFEspectrum.cxx:1428
 AliHFEspectrum.cxx:1429
 AliHFEspectrum.cxx:1430
 AliHFEspectrum.cxx:1431
 AliHFEspectrum.cxx:1432
 AliHFEspectrum.cxx:1433
 AliHFEspectrum.cxx:1434
 AliHFEspectrum.cxx:1435
 AliHFEspectrum.cxx:1436
 AliHFEspectrum.cxx:1437
 AliHFEspectrum.cxx:1438
 AliHFEspectrum.cxx:1439
 AliHFEspectrum.cxx:1440
 AliHFEspectrum.cxx:1441
 AliHFEspectrum.cxx:1442
 AliHFEspectrum.cxx:1443
 AliHFEspectrum.cxx:1444
 AliHFEspectrum.cxx:1445
 AliHFEspectrum.cxx:1446
 AliHFEspectrum.cxx:1447
 AliHFEspectrum.cxx:1448
 AliHFEspectrum.cxx:1449
 AliHFEspectrum.cxx:1450
 AliHFEspectrum.cxx:1451
 AliHFEspectrum.cxx:1452
 AliHFEspectrum.cxx:1453
 AliHFEspectrum.cxx:1454
 AliHFEspectrum.cxx:1455
 AliHFEspectrum.cxx:1456
 AliHFEspectrum.cxx:1457
 AliHFEspectrum.cxx:1458
 AliHFEspectrum.cxx:1459
 AliHFEspectrum.cxx:1460
 AliHFEspectrum.cxx:1461
 AliHFEspectrum.cxx:1462
 AliHFEspectrum.cxx:1463
 AliHFEspectrum.cxx:1464
 AliHFEspectrum.cxx:1465
 AliHFEspectrum.cxx:1466
 AliHFEspectrum.cxx:1467
 AliHFEspectrum.cxx:1468
 AliHFEspectrum.cxx:1469
 AliHFEspectrum.cxx:1470
 AliHFEspectrum.cxx:1471
 AliHFEspectrum.cxx:1472
 AliHFEspectrum.cxx:1473
 AliHFEspectrum.cxx:1474
 AliHFEspectrum.cxx:1475
 AliHFEspectrum.cxx:1476
 AliHFEspectrum.cxx:1477
 AliHFEspectrum.cxx:1478
 AliHFEspectrum.cxx:1479
 AliHFEspectrum.cxx:1480
 AliHFEspectrum.cxx:1481
 AliHFEspectrum.cxx:1482
 AliHFEspectrum.cxx:1483
 AliHFEspectrum.cxx:1484
 AliHFEspectrum.cxx:1485
 AliHFEspectrum.cxx:1486
 AliHFEspectrum.cxx:1487
 AliHFEspectrum.cxx:1488
 AliHFEspectrum.cxx:1489
 AliHFEspectrum.cxx:1490
 AliHFEspectrum.cxx:1491
 AliHFEspectrum.cxx:1492
 AliHFEspectrum.cxx:1493
 AliHFEspectrum.cxx:1494
 AliHFEspectrum.cxx:1495
 AliHFEspectrum.cxx:1496
 AliHFEspectrum.cxx:1497
 AliHFEspectrum.cxx:1498
 AliHFEspectrum.cxx:1499
 AliHFEspectrum.cxx:1500
 AliHFEspectrum.cxx:1501
 AliHFEspectrum.cxx:1502
 AliHFEspectrum.cxx:1503
 AliHFEspectrum.cxx:1504
 AliHFEspectrum.cxx:1505
 AliHFEspectrum.cxx:1506
 AliHFEspectrum.cxx:1507
 AliHFEspectrum.cxx:1508
 AliHFEspectrum.cxx:1509
 AliHFEspectrum.cxx:1510
 AliHFEspectrum.cxx:1511
 AliHFEspectrum.cxx:1512
 AliHFEspectrum.cxx:1513
 AliHFEspectrum.cxx:1514
 AliHFEspectrum.cxx:1515
 AliHFEspectrum.cxx:1516
 AliHFEspectrum.cxx:1517
 AliHFEspectrum.cxx:1518
 AliHFEspectrum.cxx:1519
 AliHFEspectrum.cxx:1520
 AliHFEspectrum.cxx:1521
 AliHFEspectrum.cxx:1522
 AliHFEspectrum.cxx:1523
 AliHFEspectrum.cxx:1524
 AliHFEspectrum.cxx:1525
 AliHFEspectrum.cxx:1526
 AliHFEspectrum.cxx:1527
 AliHFEspectrum.cxx:1528
 AliHFEspectrum.cxx:1529
 AliHFEspectrum.cxx:1530
 AliHFEspectrum.cxx:1531
 AliHFEspectrum.cxx:1532
 AliHFEspectrum.cxx:1533
 AliHFEspectrum.cxx:1534
 AliHFEspectrum.cxx:1535
 AliHFEspectrum.cxx:1536
 AliHFEspectrum.cxx:1537
 AliHFEspectrum.cxx:1538
 AliHFEspectrum.cxx:1539
 AliHFEspectrum.cxx:1540
 AliHFEspectrum.cxx:1541
 AliHFEspectrum.cxx:1542
 AliHFEspectrum.cxx:1543
 AliHFEspectrum.cxx:1544
 AliHFEspectrum.cxx:1545
 AliHFEspectrum.cxx:1546
 AliHFEspectrum.cxx:1547
 AliHFEspectrum.cxx:1548
 AliHFEspectrum.cxx:1549
 AliHFEspectrum.cxx:1550
 AliHFEspectrum.cxx:1551
 AliHFEspectrum.cxx:1552
 AliHFEspectrum.cxx:1553
 AliHFEspectrum.cxx:1554
 AliHFEspectrum.cxx:1555
 AliHFEspectrum.cxx:1556
 AliHFEspectrum.cxx:1557
 AliHFEspectrum.cxx:1558
 AliHFEspectrum.cxx:1559
 AliHFEspectrum.cxx:1560
 AliHFEspectrum.cxx:1561
 AliHFEspectrum.cxx:1562
 AliHFEspectrum.cxx:1563
 AliHFEspectrum.cxx:1564
 AliHFEspectrum.cxx:1565
 AliHFEspectrum.cxx:1566
 AliHFEspectrum.cxx:1567
 AliHFEspectrum.cxx:1568
 AliHFEspectrum.cxx:1569
 AliHFEspectrum.cxx:1570
 AliHFEspectrum.cxx:1571
 AliHFEspectrum.cxx:1572
 AliHFEspectrum.cxx:1573
 AliHFEspectrum.cxx:1574
 AliHFEspectrum.cxx:1575
 AliHFEspectrum.cxx:1576
 AliHFEspectrum.cxx:1577
 AliHFEspectrum.cxx:1578
 AliHFEspectrum.cxx:1579
 AliHFEspectrum.cxx:1580
 AliHFEspectrum.cxx:1581
 AliHFEspectrum.cxx:1582
 AliHFEspectrum.cxx:1583
 AliHFEspectrum.cxx:1584
 AliHFEspectrum.cxx:1585
 AliHFEspectrum.cxx:1586
 AliHFEspectrum.cxx:1587
 AliHFEspectrum.cxx:1588
 AliHFEspectrum.cxx:1589
 AliHFEspectrum.cxx:1590
 AliHFEspectrum.cxx:1591
 AliHFEspectrum.cxx:1592
 AliHFEspectrum.cxx:1593
 AliHFEspectrum.cxx:1594
 AliHFEspectrum.cxx:1595
 AliHFEspectrum.cxx:1596
 AliHFEspectrum.cxx:1597
 AliHFEspectrum.cxx:1598
 AliHFEspectrum.cxx:1599
 AliHFEspectrum.cxx:1600
 AliHFEspectrum.cxx:1601
 AliHFEspectrum.cxx:1602
 AliHFEspectrum.cxx:1603
 AliHFEspectrum.cxx:1604
 AliHFEspectrum.cxx:1605
 AliHFEspectrum.cxx:1606
 AliHFEspectrum.cxx:1607
 AliHFEspectrum.cxx:1608
 AliHFEspectrum.cxx:1609
 AliHFEspectrum.cxx:1610
 AliHFEspectrum.cxx:1611
 AliHFEspectrum.cxx:1612
 AliHFEspectrum.cxx:1613
 AliHFEspectrum.cxx:1614
 AliHFEspectrum.cxx:1615
 AliHFEspectrum.cxx:1616
 AliHFEspectrum.cxx:1617
 AliHFEspectrum.cxx:1618
 AliHFEspectrum.cxx:1619
 AliHFEspectrum.cxx:1620
 AliHFEspectrum.cxx:1621
 AliHFEspectrum.cxx:1622
 AliHFEspectrum.cxx:1623
 AliHFEspectrum.cxx:1624
 AliHFEspectrum.cxx:1625
 AliHFEspectrum.cxx:1626
 AliHFEspectrum.cxx:1627
 AliHFEspectrum.cxx:1628
 AliHFEspectrum.cxx:1629
 AliHFEspectrum.cxx:1630
 AliHFEspectrum.cxx:1631
 AliHFEspectrum.cxx:1632
 AliHFEspectrum.cxx:1633
 AliHFEspectrum.cxx:1634
 AliHFEspectrum.cxx:1635
 AliHFEspectrum.cxx:1636
 AliHFEspectrum.cxx:1637
 AliHFEspectrum.cxx:1638
 AliHFEspectrum.cxx:1639
 AliHFEspectrum.cxx:1640
 AliHFEspectrum.cxx:1641
 AliHFEspectrum.cxx:1642
 AliHFEspectrum.cxx:1643
 AliHFEspectrum.cxx:1644
 AliHFEspectrum.cxx:1645
 AliHFEspectrum.cxx:1646
 AliHFEspectrum.cxx:1647
 AliHFEspectrum.cxx:1648
 AliHFEspectrum.cxx:1649
 AliHFEspectrum.cxx:1650
 AliHFEspectrum.cxx:1651
 AliHFEspectrum.cxx:1652
 AliHFEspectrum.cxx:1653
 AliHFEspectrum.cxx:1654
 AliHFEspectrum.cxx:1655
 AliHFEspectrum.cxx:1656
 AliHFEspectrum.cxx:1657
 AliHFEspectrum.cxx:1658
 AliHFEspectrum.cxx:1659
 AliHFEspectrum.cxx:1660
 AliHFEspectrum.cxx:1661
 AliHFEspectrum.cxx:1662
 AliHFEspectrum.cxx:1663
 AliHFEspectrum.cxx:1664
 AliHFEspectrum.cxx:1665
 AliHFEspectrum.cxx:1666
 AliHFEspectrum.cxx:1667
 AliHFEspectrum.cxx:1668
 AliHFEspectrum.cxx:1669
 AliHFEspectrum.cxx:1670
 AliHFEspectrum.cxx:1671
 AliHFEspectrum.cxx:1672
 AliHFEspectrum.cxx:1673
 AliHFEspectrum.cxx:1674
 AliHFEspectrum.cxx:1675
 AliHFEspectrum.cxx:1676
 AliHFEspectrum.cxx:1677
 AliHFEspectrum.cxx:1678
 AliHFEspectrum.cxx:1679
 AliHFEspectrum.cxx:1680
 AliHFEspectrum.cxx:1681
 AliHFEspectrum.cxx:1682
 AliHFEspectrum.cxx:1683
 AliHFEspectrum.cxx:1684
 AliHFEspectrum.cxx:1685
 AliHFEspectrum.cxx:1686
 AliHFEspectrum.cxx:1687
 AliHFEspectrum.cxx:1688
 AliHFEspectrum.cxx:1689
 AliHFEspectrum.cxx:1690
 AliHFEspectrum.cxx:1691
 AliHFEspectrum.cxx:1692
 AliHFEspectrum.cxx:1693
 AliHFEspectrum.cxx:1694
 AliHFEspectrum.cxx:1695
 AliHFEspectrum.cxx:1696
 AliHFEspectrum.cxx:1697
 AliHFEspectrum.cxx:1698
 AliHFEspectrum.cxx:1699
 AliHFEspectrum.cxx:1700
 AliHFEspectrum.cxx:1701
 AliHFEspectrum.cxx:1702
 AliHFEspectrum.cxx:1703
 AliHFEspectrum.cxx:1704
 AliHFEspectrum.cxx:1705
 AliHFEspectrum.cxx:1706
 AliHFEspectrum.cxx:1707
 AliHFEspectrum.cxx:1708
 AliHFEspectrum.cxx:1709
 AliHFEspectrum.cxx:1710
 AliHFEspectrum.cxx:1711
 AliHFEspectrum.cxx:1712
 AliHFEspectrum.cxx:1713
 AliHFEspectrum.cxx:1714
 AliHFEspectrum.cxx:1715
 AliHFEspectrum.cxx:1716
 AliHFEspectrum.cxx:1717
 AliHFEspectrum.cxx:1718
 AliHFEspectrum.cxx:1719
 AliHFEspectrum.cxx:1720
 AliHFEspectrum.cxx:1721
 AliHFEspectrum.cxx:1722
 AliHFEspectrum.cxx:1723
 AliHFEspectrum.cxx:1724
 AliHFEspectrum.cxx:1725
 AliHFEspectrum.cxx:1726
 AliHFEspectrum.cxx:1727
 AliHFEspectrum.cxx:1728
 AliHFEspectrum.cxx:1729
 AliHFEspectrum.cxx:1730
 AliHFEspectrum.cxx:1731
 AliHFEspectrum.cxx:1732
 AliHFEspectrum.cxx:1733
 AliHFEspectrum.cxx:1734
 AliHFEspectrum.cxx:1735
 AliHFEspectrum.cxx:1736
 AliHFEspectrum.cxx:1737
 AliHFEspectrum.cxx:1738
 AliHFEspectrum.cxx:1739
 AliHFEspectrum.cxx:1740
 AliHFEspectrum.cxx:1741
 AliHFEspectrum.cxx:1742
 AliHFEspectrum.cxx:1743
 AliHFEspectrum.cxx:1744
 AliHFEspectrum.cxx:1745
 AliHFEspectrum.cxx:1746
 AliHFEspectrum.cxx:1747
 AliHFEspectrum.cxx:1748
 AliHFEspectrum.cxx:1749
 AliHFEspectrum.cxx:1750
 AliHFEspectrum.cxx:1751
 AliHFEspectrum.cxx:1752
 AliHFEspectrum.cxx:1753
 AliHFEspectrum.cxx:1754
 AliHFEspectrum.cxx:1755
 AliHFEspectrum.cxx:1756
 AliHFEspectrum.cxx:1757
 AliHFEspectrum.cxx:1758
 AliHFEspectrum.cxx:1759
 AliHFEspectrum.cxx:1760
 AliHFEspectrum.cxx:1761
 AliHFEspectrum.cxx:1762
 AliHFEspectrum.cxx:1763
 AliHFEspectrum.cxx:1764
 AliHFEspectrum.cxx:1765
 AliHFEspectrum.cxx:1766
 AliHFEspectrum.cxx:1767
 AliHFEspectrum.cxx:1768
 AliHFEspectrum.cxx:1769
 AliHFEspectrum.cxx:1770
 AliHFEspectrum.cxx:1771
 AliHFEspectrum.cxx:1772
 AliHFEspectrum.cxx:1773
 AliHFEspectrum.cxx:1774
 AliHFEspectrum.cxx:1775
 AliHFEspectrum.cxx:1776
 AliHFEspectrum.cxx:1777
 AliHFEspectrum.cxx:1778
 AliHFEspectrum.cxx:1779
 AliHFEspectrum.cxx:1780
 AliHFEspectrum.cxx:1781
 AliHFEspectrum.cxx:1782
 AliHFEspectrum.cxx:1783
 AliHFEspectrum.cxx:1784
 AliHFEspectrum.cxx:1785
 AliHFEspectrum.cxx:1786
 AliHFEspectrum.cxx:1787
 AliHFEspectrum.cxx:1788
 AliHFEspectrum.cxx:1789
 AliHFEspectrum.cxx:1790
 AliHFEspectrum.cxx:1791
 AliHFEspectrum.cxx:1792
 AliHFEspectrum.cxx:1793
 AliHFEspectrum.cxx:1794
 AliHFEspectrum.cxx:1795
 AliHFEspectrum.cxx:1796
 AliHFEspectrum.cxx:1797
 AliHFEspectrum.cxx:1798
 AliHFEspectrum.cxx:1799
 AliHFEspectrum.cxx:1800
 AliHFEspectrum.cxx:1801
 AliHFEspectrum.cxx:1802
 AliHFEspectrum.cxx:1803
 AliHFEspectrum.cxx:1804
 AliHFEspectrum.cxx:1805
 AliHFEspectrum.cxx:1806
 AliHFEspectrum.cxx:1807
 AliHFEspectrum.cxx:1808
 AliHFEspectrum.cxx:1809
 AliHFEspectrum.cxx:1810
 AliHFEspectrum.cxx:1811
 AliHFEspectrum.cxx:1812
 AliHFEspectrum.cxx:1813
 AliHFEspectrum.cxx:1814
 AliHFEspectrum.cxx:1815
 AliHFEspectrum.cxx:1816
 AliHFEspectrum.cxx:1817
 AliHFEspectrum.cxx:1818
 AliHFEspectrum.cxx:1819
 AliHFEspectrum.cxx:1820
 AliHFEspectrum.cxx:1821
 AliHFEspectrum.cxx:1822
 AliHFEspectrum.cxx:1823
 AliHFEspectrum.cxx:1824
 AliHFEspectrum.cxx:1825
 AliHFEspectrum.cxx:1826
 AliHFEspectrum.cxx:1827
 AliHFEspectrum.cxx:1828
 AliHFEspectrum.cxx:1829
 AliHFEspectrum.cxx:1830
 AliHFEspectrum.cxx:1831
 AliHFEspectrum.cxx:1832
 AliHFEspectrum.cxx:1833
 AliHFEspectrum.cxx:1834
 AliHFEspectrum.cxx:1835
 AliHFEspectrum.cxx:1836
 AliHFEspectrum.cxx:1837
 AliHFEspectrum.cxx:1838
 AliHFEspectrum.cxx:1839
 AliHFEspectrum.cxx:1840
 AliHFEspectrum.cxx:1841
 AliHFEspectrum.cxx:1842
 AliHFEspectrum.cxx:1843
 AliHFEspectrum.cxx:1844
 AliHFEspectrum.cxx:1845
 AliHFEspectrum.cxx:1846
 AliHFEspectrum.cxx:1847
 AliHFEspectrum.cxx:1848
 AliHFEspectrum.cxx:1849
 AliHFEspectrum.cxx:1850
 AliHFEspectrum.cxx:1851
 AliHFEspectrum.cxx:1852
 AliHFEspectrum.cxx:1853
 AliHFEspectrum.cxx:1854
 AliHFEspectrum.cxx:1855
 AliHFEspectrum.cxx:1856
 AliHFEspectrum.cxx:1857
 AliHFEspectrum.cxx:1858
 AliHFEspectrum.cxx:1859
 AliHFEspectrum.cxx:1860
 AliHFEspectrum.cxx:1861
 AliHFEspectrum.cxx:1862
 AliHFEspectrum.cxx:1863
 AliHFEspectrum.cxx:1864
 AliHFEspectrum.cxx:1865
 AliHFEspectrum.cxx:1866
 AliHFEspectrum.cxx:1867
 AliHFEspectrum.cxx:1868
 AliHFEspectrum.cxx:1869
 AliHFEspectrum.cxx:1870
 AliHFEspectrum.cxx:1871
 AliHFEspectrum.cxx:1872
 AliHFEspectrum.cxx:1873
 AliHFEspectrum.cxx:1874
 AliHFEspectrum.cxx:1875
 AliHFEspectrum.cxx:1876
 AliHFEspectrum.cxx:1877
 AliHFEspectrum.cxx:1878
 AliHFEspectrum.cxx:1879
 AliHFEspectrum.cxx:1880
 AliHFEspectrum.cxx:1881
 AliHFEspectrum.cxx:1882
 AliHFEspectrum.cxx:1883
 AliHFEspectrum.cxx:1884
 AliHFEspectrum.cxx:1885
 AliHFEspectrum.cxx:1886
 AliHFEspectrum.cxx:1887
 AliHFEspectrum.cxx:1888
 AliHFEspectrum.cxx:1889
 AliHFEspectrum.cxx:1890
 AliHFEspectrum.cxx:1891
 AliHFEspectrum.cxx:1892
 AliHFEspectrum.cxx:1893
 AliHFEspectrum.cxx:1894
 AliHFEspectrum.cxx:1895
 AliHFEspectrum.cxx:1896
 AliHFEspectrum.cxx:1897
 AliHFEspectrum.cxx:1898
 AliHFEspectrum.cxx:1899
 AliHFEspectrum.cxx:1900
 AliHFEspectrum.cxx:1901
 AliHFEspectrum.cxx:1902
 AliHFEspectrum.cxx:1903
 AliHFEspectrum.cxx:1904
 AliHFEspectrum.cxx:1905
 AliHFEspectrum.cxx:1906
 AliHFEspectrum.cxx:1907
 AliHFEspectrum.cxx:1908
 AliHFEspectrum.cxx:1909
 AliHFEspectrum.cxx:1910
 AliHFEspectrum.cxx:1911
 AliHFEspectrum.cxx:1912
 AliHFEspectrum.cxx:1913
 AliHFEspectrum.cxx:1914
 AliHFEspectrum.cxx:1915
 AliHFEspectrum.cxx:1916
 AliHFEspectrum.cxx:1917
 AliHFEspectrum.cxx:1918
 AliHFEspectrum.cxx:1919
 AliHFEspectrum.cxx:1920
 AliHFEspectrum.cxx:1921
 AliHFEspectrum.cxx:1922
 AliHFEspectrum.cxx:1923
 AliHFEspectrum.cxx:1924
 AliHFEspectrum.cxx:1925
 AliHFEspectrum.cxx:1926
 AliHFEspectrum.cxx:1927
 AliHFEspectrum.cxx:1928
 AliHFEspectrum.cxx:1929
 AliHFEspectrum.cxx:1930
 AliHFEspectrum.cxx:1931
 AliHFEspectrum.cxx:1932
 AliHFEspectrum.cxx:1933
 AliHFEspectrum.cxx:1934
 AliHFEspectrum.cxx:1935
 AliHFEspectrum.cxx:1936
 AliHFEspectrum.cxx:1937
 AliHFEspectrum.cxx:1938
 AliHFEspectrum.cxx:1939
 AliHFEspectrum.cxx:1940
 AliHFEspectrum.cxx:1941
 AliHFEspectrum.cxx:1942
 AliHFEspectrum.cxx:1943
 AliHFEspectrum.cxx:1944
 AliHFEspectrum.cxx:1945
 AliHFEspectrum.cxx:1946
 AliHFEspectrum.cxx:1947
 AliHFEspectrum.cxx:1948
 AliHFEspectrum.cxx:1949
 AliHFEspectrum.cxx:1950
 AliHFEspectrum.cxx:1951
 AliHFEspectrum.cxx:1952
 AliHFEspectrum.cxx:1953
 AliHFEspectrum.cxx:1954
 AliHFEspectrum.cxx:1955
 AliHFEspectrum.cxx:1956
 AliHFEspectrum.cxx:1957
 AliHFEspectrum.cxx:1958
 AliHFEspectrum.cxx:1959
 AliHFEspectrum.cxx:1960
 AliHFEspectrum.cxx:1961
 AliHFEspectrum.cxx:1962
 AliHFEspectrum.cxx:1963
 AliHFEspectrum.cxx:1964
 AliHFEspectrum.cxx:1965
 AliHFEspectrum.cxx:1966
 AliHFEspectrum.cxx:1967
 AliHFEspectrum.cxx:1968
 AliHFEspectrum.cxx:1969
 AliHFEspectrum.cxx:1970
 AliHFEspectrum.cxx:1971
 AliHFEspectrum.cxx:1972
 AliHFEspectrum.cxx:1973
 AliHFEspectrum.cxx:1974
 AliHFEspectrum.cxx:1975
 AliHFEspectrum.cxx:1976
 AliHFEspectrum.cxx:1977
 AliHFEspectrum.cxx:1978
 AliHFEspectrum.cxx:1979
 AliHFEspectrum.cxx:1980
 AliHFEspectrum.cxx:1981
 AliHFEspectrum.cxx:1982
 AliHFEspectrum.cxx:1983
 AliHFEspectrum.cxx:1984
 AliHFEspectrum.cxx:1985
 AliHFEspectrum.cxx:1986
 AliHFEspectrum.cxx:1987
 AliHFEspectrum.cxx:1988
 AliHFEspectrum.cxx:1989
 AliHFEspectrum.cxx:1990
 AliHFEspectrum.cxx:1991
 AliHFEspectrum.cxx:1992
 AliHFEspectrum.cxx:1993
 AliHFEspectrum.cxx:1994
 AliHFEspectrum.cxx:1995
 AliHFEspectrum.cxx:1996
 AliHFEspectrum.cxx:1997
 AliHFEspectrum.cxx:1998
 AliHFEspectrum.cxx:1999
 AliHFEspectrum.cxx:2000
 AliHFEspectrum.cxx:2001
 AliHFEspectrum.cxx:2002
 AliHFEspectrum.cxx:2003
 AliHFEspectrum.cxx:2004
 AliHFEspectrum.cxx:2005
 AliHFEspectrum.cxx:2006
 AliHFEspectrum.cxx:2007
 AliHFEspectrum.cxx:2008
 AliHFEspectrum.cxx:2009
 AliHFEspectrum.cxx:2010
 AliHFEspectrum.cxx:2011
 AliHFEspectrum.cxx:2012
 AliHFEspectrum.cxx:2013
 AliHFEspectrum.cxx:2014
 AliHFEspectrum.cxx:2015
 AliHFEspectrum.cxx:2016
 AliHFEspectrum.cxx:2017
 AliHFEspectrum.cxx:2018
 AliHFEspectrum.cxx:2019
 AliHFEspectrum.cxx:2020
 AliHFEspectrum.cxx:2021
 AliHFEspectrum.cxx:2022
 AliHFEspectrum.cxx:2023
 AliHFEspectrum.cxx:2024
 AliHFEspectrum.cxx:2025
 AliHFEspectrum.cxx:2026
 AliHFEspectrum.cxx:2027
 AliHFEspectrum.cxx:2028
 AliHFEspectrum.cxx:2029
 AliHFEspectrum.cxx:2030
 AliHFEspectrum.cxx:2031
 AliHFEspectrum.cxx:2032
 AliHFEspectrum.cxx:2033
 AliHFEspectrum.cxx:2034
 AliHFEspectrum.cxx:2035
 AliHFEspectrum.cxx:2036
 AliHFEspectrum.cxx:2037
 AliHFEspectrum.cxx:2038
 AliHFEspectrum.cxx:2039
 AliHFEspectrum.cxx:2040
 AliHFEspectrum.cxx:2041
 AliHFEspectrum.cxx:2042
 AliHFEspectrum.cxx:2043
 AliHFEspectrum.cxx:2044
 AliHFEspectrum.cxx:2045
 AliHFEspectrum.cxx:2046
 AliHFEspectrum.cxx:2047
 AliHFEspectrum.cxx:2048
 AliHFEspectrum.cxx:2049
 AliHFEspectrum.cxx:2050
 AliHFEspectrum.cxx:2051
 AliHFEspectrum.cxx:2052
 AliHFEspectrum.cxx:2053
 AliHFEspectrum.cxx:2054
 AliHFEspectrum.cxx:2055
 AliHFEspectrum.cxx:2056
 AliHFEspectrum.cxx:2057
 AliHFEspectrum.cxx:2058
 AliHFEspectrum.cxx:2059
 AliHFEspectrum.cxx:2060
 AliHFEspectrum.cxx:2061
 AliHFEspectrum.cxx:2062
 AliHFEspectrum.cxx:2063
 AliHFEspectrum.cxx:2064
 AliHFEspectrum.cxx:2065
 AliHFEspectrum.cxx:2066
 AliHFEspectrum.cxx:2067
 AliHFEspectrum.cxx:2068
 AliHFEspectrum.cxx:2069
 AliHFEspectrum.cxx:2070
 AliHFEspectrum.cxx:2071
 AliHFEspectrum.cxx:2072
 AliHFEspectrum.cxx:2073
 AliHFEspectrum.cxx:2074
 AliHFEspectrum.cxx:2075
 AliHFEspectrum.cxx:2076
 AliHFEspectrum.cxx:2077
 AliHFEspectrum.cxx:2078
 AliHFEspectrum.cxx:2079
 AliHFEspectrum.cxx:2080
 AliHFEspectrum.cxx:2081
 AliHFEspectrum.cxx:2082
 AliHFEspectrum.cxx:2083
 AliHFEspectrum.cxx:2084
 AliHFEspectrum.cxx:2085
 AliHFEspectrum.cxx:2086
 AliHFEspectrum.cxx:2087
 AliHFEspectrum.cxx:2088
 AliHFEspectrum.cxx:2089
 AliHFEspectrum.cxx:2090
 AliHFEspectrum.cxx:2091
 AliHFEspectrum.cxx:2092
 AliHFEspectrum.cxx:2093
 AliHFEspectrum.cxx:2094
 AliHFEspectrum.cxx:2095
 AliHFEspectrum.cxx:2096
 AliHFEspectrum.cxx:2097
 AliHFEspectrum.cxx:2098
 AliHFEspectrum.cxx:2099
 AliHFEspectrum.cxx:2100
 AliHFEspectrum.cxx:2101
 AliHFEspectrum.cxx:2102
 AliHFEspectrum.cxx:2103
 AliHFEspectrum.cxx:2104
 AliHFEspectrum.cxx:2105
 AliHFEspectrum.cxx:2106
 AliHFEspectrum.cxx:2107
 AliHFEspectrum.cxx:2108
 AliHFEspectrum.cxx:2109
 AliHFEspectrum.cxx:2110
 AliHFEspectrum.cxx:2111
 AliHFEspectrum.cxx:2112
 AliHFEspectrum.cxx:2113
 AliHFEspectrum.cxx:2114
 AliHFEspectrum.cxx:2115
 AliHFEspectrum.cxx:2116
 AliHFEspectrum.cxx:2117
 AliHFEspectrum.cxx:2118
 AliHFEspectrum.cxx:2119
 AliHFEspectrum.cxx:2120
 AliHFEspectrum.cxx:2121
 AliHFEspectrum.cxx:2122
 AliHFEspectrum.cxx:2123
 AliHFEspectrum.cxx:2124
 AliHFEspectrum.cxx:2125
 AliHFEspectrum.cxx:2126
 AliHFEspectrum.cxx:2127
 AliHFEspectrum.cxx:2128
 AliHFEspectrum.cxx:2129
 AliHFEspectrum.cxx:2130
 AliHFEspectrum.cxx:2131
 AliHFEspectrum.cxx:2132
 AliHFEspectrum.cxx:2133
 AliHFEspectrum.cxx:2134
 AliHFEspectrum.cxx:2135
 AliHFEspectrum.cxx:2136
 AliHFEspectrum.cxx:2137
 AliHFEspectrum.cxx:2138
 AliHFEspectrum.cxx:2139
 AliHFEspectrum.cxx:2140
 AliHFEspectrum.cxx:2141
 AliHFEspectrum.cxx:2142
 AliHFEspectrum.cxx:2143
 AliHFEspectrum.cxx:2144
 AliHFEspectrum.cxx:2145
 AliHFEspectrum.cxx:2146
 AliHFEspectrum.cxx:2147
 AliHFEspectrum.cxx:2148
 AliHFEspectrum.cxx:2149
 AliHFEspectrum.cxx:2150
 AliHFEspectrum.cxx:2151
 AliHFEspectrum.cxx:2152
 AliHFEspectrum.cxx:2153
 AliHFEspectrum.cxx:2154
 AliHFEspectrum.cxx:2155
 AliHFEspectrum.cxx:2156
 AliHFEspectrum.cxx:2157
 AliHFEspectrum.cxx:2158
 AliHFEspectrum.cxx:2159
 AliHFEspectrum.cxx:2160
 AliHFEspectrum.cxx:2161
 AliHFEspectrum.cxx:2162
 AliHFEspectrum.cxx:2163
 AliHFEspectrum.cxx:2164
 AliHFEspectrum.cxx:2165
 AliHFEspectrum.cxx:2166
 AliHFEspectrum.cxx:2167
 AliHFEspectrum.cxx:2168
 AliHFEspectrum.cxx:2169
 AliHFEspectrum.cxx:2170
 AliHFEspectrum.cxx:2171
 AliHFEspectrum.cxx:2172
 AliHFEspectrum.cxx:2173
 AliHFEspectrum.cxx:2174
 AliHFEspectrum.cxx:2175
 AliHFEspectrum.cxx:2176
 AliHFEspectrum.cxx:2177
 AliHFEspectrum.cxx:2178
 AliHFEspectrum.cxx:2179
 AliHFEspectrum.cxx:2180
 AliHFEspectrum.cxx:2181
 AliHFEspectrum.cxx:2182
 AliHFEspectrum.cxx:2183
 AliHFEspectrum.cxx:2184
 AliHFEspectrum.cxx:2185
 AliHFEspectrum.cxx:2186
 AliHFEspectrum.cxx:2187
 AliHFEspectrum.cxx:2188
 AliHFEspectrum.cxx:2189
 AliHFEspectrum.cxx:2190
 AliHFEspectrum.cxx:2191
 AliHFEspectrum.cxx:2192
 AliHFEspectrum.cxx:2193
 AliHFEspectrum.cxx:2194
 AliHFEspectrum.cxx:2195
 AliHFEspectrum.cxx:2196
 AliHFEspectrum.cxx:2197
 AliHFEspectrum.cxx:2198
 AliHFEspectrum.cxx:2199
 AliHFEspectrum.cxx:2200
 AliHFEspectrum.cxx:2201
 AliHFEspectrum.cxx:2202
 AliHFEspectrum.cxx:2203
 AliHFEspectrum.cxx:2204
 AliHFEspectrum.cxx:2205
 AliHFEspectrum.cxx:2206
 AliHFEspectrum.cxx:2207
 AliHFEspectrum.cxx:2208
 AliHFEspectrum.cxx:2209
 AliHFEspectrum.cxx:2210
 AliHFEspectrum.cxx:2211
 AliHFEspectrum.cxx:2212
 AliHFEspectrum.cxx:2213
 AliHFEspectrum.cxx:2214
 AliHFEspectrum.cxx:2215
 AliHFEspectrum.cxx:2216
 AliHFEspectrum.cxx:2217
 AliHFEspectrum.cxx:2218
 AliHFEspectrum.cxx:2219
 AliHFEspectrum.cxx:2220
 AliHFEspectrum.cxx:2221
 AliHFEspectrum.cxx:2222
 AliHFEspectrum.cxx:2223
 AliHFEspectrum.cxx:2224
 AliHFEspectrum.cxx:2225
 AliHFEspectrum.cxx:2226
 AliHFEspectrum.cxx:2227
 AliHFEspectrum.cxx:2228
 AliHFEspectrum.cxx:2229
 AliHFEspectrum.cxx:2230
 AliHFEspectrum.cxx:2231
 AliHFEspectrum.cxx:2232
 AliHFEspectrum.cxx:2233
 AliHFEspectrum.cxx:2234
 AliHFEspectrum.cxx:2235
 AliHFEspectrum.cxx:2236
 AliHFEspectrum.cxx:2237
 AliHFEspectrum.cxx:2238
 AliHFEspectrum.cxx:2239
 AliHFEspectrum.cxx:2240
 AliHFEspectrum.cxx:2241
 AliHFEspectrum.cxx:2242
 AliHFEspectrum.cxx:2243
 AliHFEspectrum.cxx:2244
 AliHFEspectrum.cxx:2245
 AliHFEspectrum.cxx:2246
 AliHFEspectrum.cxx:2247
 AliHFEspectrum.cxx:2248
 AliHFEspectrum.cxx:2249
 AliHFEspectrum.cxx:2250
 AliHFEspectrum.cxx:2251
 AliHFEspectrum.cxx:2252
 AliHFEspectrum.cxx:2253
 AliHFEspectrum.cxx:2254
 AliHFEspectrum.cxx:2255
 AliHFEspectrum.cxx:2256
 AliHFEspectrum.cxx:2257
 AliHFEspectrum.cxx:2258
 AliHFEspectrum.cxx:2259
 AliHFEspectrum.cxx:2260
 AliHFEspectrum.cxx:2261
 AliHFEspectrum.cxx:2262
 AliHFEspectrum.cxx:2263
 AliHFEspectrum.cxx:2264
 AliHFEspectrum.cxx:2265
 AliHFEspectrum.cxx:2266
 AliHFEspectrum.cxx:2267
 AliHFEspectrum.cxx:2268
 AliHFEspectrum.cxx:2269
 AliHFEspectrum.cxx:2270
 AliHFEspectrum.cxx:2271
 AliHFEspectrum.cxx:2272
 AliHFEspectrum.cxx:2273
 AliHFEspectrum.cxx:2274
 AliHFEspectrum.cxx:2275
 AliHFEspectrum.cxx:2276
 AliHFEspectrum.cxx:2277
 AliHFEspectrum.cxx:2278
 AliHFEspectrum.cxx:2279
 AliHFEspectrum.cxx:2280
 AliHFEspectrum.cxx:2281
 AliHFEspectrum.cxx:2282
 AliHFEspectrum.cxx:2283
 AliHFEspectrum.cxx:2284
 AliHFEspectrum.cxx:2285
 AliHFEspectrum.cxx:2286
 AliHFEspectrum.cxx:2287
 AliHFEspectrum.cxx:2288
 AliHFEspectrum.cxx:2289
 AliHFEspectrum.cxx:2290
 AliHFEspectrum.cxx:2291
 AliHFEspectrum.cxx:2292
 AliHFEspectrum.cxx:2293
 AliHFEspectrum.cxx:2294
 AliHFEspectrum.cxx:2295
 AliHFEspectrum.cxx:2296
 AliHFEspectrum.cxx:2297
 AliHFEspectrum.cxx:2298
 AliHFEspectrum.cxx:2299
 AliHFEspectrum.cxx:2300
 AliHFEspectrum.cxx:2301
 AliHFEspectrum.cxx:2302
 AliHFEspectrum.cxx:2303
 AliHFEspectrum.cxx:2304
 AliHFEspectrum.cxx:2305
 AliHFEspectrum.cxx:2306
 AliHFEspectrum.cxx:2307
 AliHFEspectrum.cxx:2308
 AliHFEspectrum.cxx:2309
 AliHFEspectrum.cxx:2310
 AliHFEspectrum.cxx:2311
 AliHFEspectrum.cxx:2312
 AliHFEspectrum.cxx:2313
 AliHFEspectrum.cxx:2314
 AliHFEspectrum.cxx:2315
 AliHFEspectrum.cxx:2316
 AliHFEspectrum.cxx:2317
 AliHFEspectrum.cxx:2318
 AliHFEspectrum.cxx:2319
 AliHFEspectrum.cxx:2320
 AliHFEspectrum.cxx:2321
 AliHFEspectrum.cxx:2322
 AliHFEspectrum.cxx:2323
 AliHFEspectrum.cxx:2324
 AliHFEspectrum.cxx:2325
 AliHFEspectrum.cxx:2326
 AliHFEspectrum.cxx:2327
 AliHFEspectrum.cxx:2328
 AliHFEspectrum.cxx:2329
 AliHFEspectrum.cxx:2330
 AliHFEspectrum.cxx:2331
 AliHFEspectrum.cxx:2332
 AliHFEspectrum.cxx:2333
 AliHFEspectrum.cxx:2334
 AliHFEspectrum.cxx:2335
 AliHFEspectrum.cxx:2336
 AliHFEspectrum.cxx:2337
 AliHFEspectrum.cxx:2338
 AliHFEspectrum.cxx:2339
 AliHFEspectrum.cxx:2340
 AliHFEspectrum.cxx:2341
 AliHFEspectrum.cxx:2342
 AliHFEspectrum.cxx:2343
 AliHFEspectrum.cxx:2344
 AliHFEspectrum.cxx:2345
 AliHFEspectrum.cxx:2346
 AliHFEspectrum.cxx:2347
 AliHFEspectrum.cxx:2348
 AliHFEspectrum.cxx:2349
 AliHFEspectrum.cxx:2350
 AliHFEspectrum.cxx:2351
 AliHFEspectrum.cxx:2352
 AliHFEspectrum.cxx:2353
 AliHFEspectrum.cxx:2354
 AliHFEspectrum.cxx:2355
 AliHFEspectrum.cxx:2356
 AliHFEspectrum.cxx:2357
 AliHFEspectrum.cxx:2358
 AliHFEspectrum.cxx:2359
 AliHFEspectrum.cxx:2360
 AliHFEspectrum.cxx:2361
 AliHFEspectrum.cxx:2362
 AliHFEspectrum.cxx:2363
 AliHFEspectrum.cxx:2364
 AliHFEspectrum.cxx:2365
 AliHFEspectrum.cxx:2366
 AliHFEspectrum.cxx:2367
 AliHFEspectrum.cxx:2368
 AliHFEspectrum.cxx:2369
 AliHFEspectrum.cxx:2370
 AliHFEspectrum.cxx:2371
 AliHFEspectrum.cxx:2372
 AliHFEspectrum.cxx:2373
 AliHFEspectrum.cxx:2374
 AliHFEspectrum.cxx:2375
 AliHFEspectrum.cxx:2376
 AliHFEspectrum.cxx:2377
 AliHFEspectrum.cxx:2378
 AliHFEspectrum.cxx:2379
 AliHFEspectrum.cxx:2380
 AliHFEspectrum.cxx:2381
 AliHFEspectrum.cxx:2382
 AliHFEspectrum.cxx:2383
 AliHFEspectrum.cxx:2384
 AliHFEspectrum.cxx:2385
 AliHFEspectrum.cxx:2386
 AliHFEspectrum.cxx:2387
 AliHFEspectrum.cxx:2388
 AliHFEspectrum.cxx:2389
 AliHFEspectrum.cxx:2390
 AliHFEspectrum.cxx:2391
 AliHFEspectrum.cxx:2392
 AliHFEspectrum.cxx:2393
 AliHFEspectrum.cxx:2394
 AliHFEspectrum.cxx:2395
 AliHFEspectrum.cxx:2396
 AliHFEspectrum.cxx:2397
 AliHFEspectrum.cxx:2398
 AliHFEspectrum.cxx:2399
 AliHFEspectrum.cxx:2400
 AliHFEspectrum.cxx:2401
 AliHFEspectrum.cxx:2402
 AliHFEspectrum.cxx:2403
 AliHFEspectrum.cxx:2404
 AliHFEspectrum.cxx:2405
 AliHFEspectrum.cxx:2406
 AliHFEspectrum.cxx:2407
 AliHFEspectrum.cxx:2408
 AliHFEspectrum.cxx:2409
 AliHFEspectrum.cxx:2410
 AliHFEspectrum.cxx:2411
 AliHFEspectrum.cxx:2412
 AliHFEspectrum.cxx:2413
 AliHFEspectrum.cxx:2414
 AliHFEspectrum.cxx:2415
 AliHFEspectrum.cxx:2416
 AliHFEspectrum.cxx:2417
 AliHFEspectrum.cxx:2418
 AliHFEspectrum.cxx:2419
 AliHFEspectrum.cxx:2420
 AliHFEspectrum.cxx:2421
 AliHFEspectrum.cxx:2422
 AliHFEspectrum.cxx:2423
 AliHFEspectrum.cxx:2424
 AliHFEspectrum.cxx:2425
 AliHFEspectrum.cxx:2426
 AliHFEspectrum.cxx:2427
 AliHFEspectrum.cxx:2428
 AliHFEspectrum.cxx:2429
 AliHFEspectrum.cxx:2430
 AliHFEspectrum.cxx:2431
 AliHFEspectrum.cxx:2432
 AliHFEspectrum.cxx:2433
 AliHFEspectrum.cxx:2434
 AliHFEspectrum.cxx:2435
 AliHFEspectrum.cxx:2436
 AliHFEspectrum.cxx:2437
 AliHFEspectrum.cxx:2438
 AliHFEspectrum.cxx:2439
 AliHFEspectrum.cxx:2440
 AliHFEspectrum.cxx:2441
 AliHFEspectrum.cxx:2442
 AliHFEspectrum.cxx:2443
 AliHFEspectrum.cxx:2444
 AliHFEspectrum.cxx:2445
 AliHFEspectrum.cxx:2446
 AliHFEspectrum.cxx:2447
 AliHFEspectrum.cxx:2448
 AliHFEspectrum.cxx:2449
 AliHFEspectrum.cxx:2450
 AliHFEspectrum.cxx:2451
 AliHFEspectrum.cxx:2452
 AliHFEspectrum.cxx:2453
 AliHFEspectrum.cxx:2454
 AliHFEspectrum.cxx:2455
 AliHFEspectrum.cxx:2456
 AliHFEspectrum.cxx:2457
 AliHFEspectrum.cxx:2458
 AliHFEspectrum.cxx:2459
 AliHFEspectrum.cxx:2460
 AliHFEspectrum.cxx:2461
 AliHFEspectrum.cxx:2462
 AliHFEspectrum.cxx:2463
 AliHFEspectrum.cxx:2464
 AliHFEspectrum.cxx:2465
 AliHFEspectrum.cxx:2466
 AliHFEspectrum.cxx:2467
 AliHFEspectrum.cxx:2468
 AliHFEspectrum.cxx:2469
 AliHFEspectrum.cxx:2470
 AliHFEspectrum.cxx:2471
 AliHFEspectrum.cxx:2472
 AliHFEspectrum.cxx:2473
 AliHFEspectrum.cxx:2474
 AliHFEspectrum.cxx:2475
 AliHFEspectrum.cxx:2476
 AliHFEspectrum.cxx:2477
 AliHFEspectrum.cxx:2478
 AliHFEspectrum.cxx:2479
 AliHFEspectrum.cxx:2480
 AliHFEspectrum.cxx:2481
 AliHFEspectrum.cxx:2482
 AliHFEspectrum.cxx:2483
 AliHFEspectrum.cxx:2484
 AliHFEspectrum.cxx:2485
 AliHFEspectrum.cxx:2486
 AliHFEspectrum.cxx:2487
 AliHFEspectrum.cxx:2488
 AliHFEspectrum.cxx:2489
 AliHFEspectrum.cxx:2490
 AliHFEspectrum.cxx:2491
 AliHFEspectrum.cxx:2492
 AliHFEspectrum.cxx:2493
 AliHFEspectrum.cxx:2494
 AliHFEspectrum.cxx:2495
 AliHFEspectrum.cxx:2496
 AliHFEspectrum.cxx:2497
 AliHFEspectrum.cxx:2498
 AliHFEspectrum.cxx:2499
 AliHFEspectrum.cxx:2500
 AliHFEspectrum.cxx:2501
 AliHFEspectrum.cxx:2502
 AliHFEspectrum.cxx:2503
 AliHFEspectrum.cxx:2504
 AliHFEspectrum.cxx:2505
 AliHFEspectrum.cxx:2506
 AliHFEspectrum.cxx:2507
 AliHFEspectrum.cxx:2508
 AliHFEspectrum.cxx:2509
 AliHFEspectrum.cxx:2510
 AliHFEspectrum.cxx:2511
 AliHFEspectrum.cxx:2512
 AliHFEspectrum.cxx:2513
 AliHFEspectrum.cxx:2514
 AliHFEspectrum.cxx:2515
 AliHFEspectrum.cxx:2516
 AliHFEspectrum.cxx:2517
 AliHFEspectrum.cxx:2518
 AliHFEspectrum.cxx:2519
 AliHFEspectrum.cxx:2520
 AliHFEspectrum.cxx:2521
 AliHFEspectrum.cxx:2522
 AliHFEspectrum.cxx:2523
 AliHFEspectrum.cxx:2524
 AliHFEspectrum.cxx:2525
 AliHFEspectrum.cxx:2526
 AliHFEspectrum.cxx:2527
 AliHFEspectrum.cxx:2528
 AliHFEspectrum.cxx:2529
 AliHFEspectrum.cxx:2530
 AliHFEspectrum.cxx:2531
 AliHFEspectrum.cxx:2532
 AliHFEspectrum.cxx:2533
 AliHFEspectrum.cxx:2534
 AliHFEspectrum.cxx:2535
 AliHFEspectrum.cxx:2536
 AliHFEspectrum.cxx:2537
 AliHFEspectrum.cxx:2538
 AliHFEspectrum.cxx:2539
 AliHFEspectrum.cxx:2540
 AliHFEspectrum.cxx:2541
 AliHFEspectrum.cxx:2542
 AliHFEspectrum.cxx:2543
 AliHFEspectrum.cxx:2544
 AliHFEspectrum.cxx:2545
 AliHFEspectrum.cxx:2546
 AliHFEspectrum.cxx:2547
 AliHFEspectrum.cxx:2548
 AliHFEspectrum.cxx:2549
 AliHFEspectrum.cxx:2550
 AliHFEspectrum.cxx:2551
 AliHFEspectrum.cxx:2552
 AliHFEspectrum.cxx:2553
 AliHFEspectrum.cxx:2554
 AliHFEspectrum.cxx:2555
 AliHFEspectrum.cxx:2556
 AliHFEspectrum.cxx:2557
 AliHFEspectrum.cxx:2558
 AliHFEspectrum.cxx:2559
 AliHFEspectrum.cxx:2560
 AliHFEspectrum.cxx:2561
 AliHFEspectrum.cxx:2562
 AliHFEspectrum.cxx:2563
 AliHFEspectrum.cxx:2564
 AliHFEspectrum.cxx:2565
 AliHFEspectrum.cxx:2566
 AliHFEspectrum.cxx:2567
 AliHFEspectrum.cxx:2568
 AliHFEspectrum.cxx:2569
 AliHFEspectrum.cxx:2570
 AliHFEspectrum.cxx:2571
 AliHFEspectrum.cxx:2572
 AliHFEspectrum.cxx:2573
 AliHFEspectrum.cxx:2574
 AliHFEspectrum.cxx:2575
 AliHFEspectrum.cxx:2576
 AliHFEspectrum.cxx:2577
 AliHFEspectrum.cxx:2578
 AliHFEspectrum.cxx:2579
 AliHFEspectrum.cxx:2580
 AliHFEspectrum.cxx:2581
 AliHFEspectrum.cxx:2582
 AliHFEspectrum.cxx:2583
 AliHFEspectrum.cxx:2584
 AliHFEspectrum.cxx:2585
 AliHFEspectrum.cxx:2586
 AliHFEspectrum.cxx:2587
 AliHFEspectrum.cxx:2588
 AliHFEspectrum.cxx:2589
 AliHFEspectrum.cxx:2590
 AliHFEspectrum.cxx:2591
 AliHFEspectrum.cxx:2592
 AliHFEspectrum.cxx:2593
 AliHFEspectrum.cxx:2594
 AliHFEspectrum.cxx:2595
 AliHFEspectrum.cxx:2596
 AliHFEspectrum.cxx:2597
 AliHFEspectrum.cxx:2598
 AliHFEspectrum.cxx:2599
 AliHFEspectrum.cxx:2600
 AliHFEspectrum.cxx:2601
 AliHFEspectrum.cxx:2602
 AliHFEspectrum.cxx:2603
 AliHFEspectrum.cxx:2604
 AliHFEspectrum.cxx:2605
 AliHFEspectrum.cxx:2606
 AliHFEspectrum.cxx:2607
 AliHFEspectrum.cxx:2608
 AliHFEspectrum.cxx:2609
 AliHFEspectrum.cxx:2610
 AliHFEspectrum.cxx:2611
 AliHFEspectrum.cxx:2612
 AliHFEspectrum.cxx:2613
 AliHFEspectrum.cxx:2614
 AliHFEspectrum.cxx:2615
 AliHFEspectrum.cxx:2616
 AliHFEspectrum.cxx:2617
 AliHFEspectrum.cxx:2618
 AliHFEspectrum.cxx:2619
 AliHFEspectrum.cxx:2620
 AliHFEspectrum.cxx:2621
 AliHFEspectrum.cxx:2622
 AliHFEspectrum.cxx:2623
 AliHFEspectrum.cxx:2624
 AliHFEspectrum.cxx:2625
 AliHFEspectrum.cxx:2626
 AliHFEspectrum.cxx:2627
 AliHFEspectrum.cxx:2628
 AliHFEspectrum.cxx:2629
 AliHFEspectrum.cxx:2630
 AliHFEspectrum.cxx:2631
 AliHFEspectrum.cxx:2632
 AliHFEspectrum.cxx:2633
 AliHFEspectrum.cxx:2634
 AliHFEspectrum.cxx:2635
 AliHFEspectrum.cxx:2636
 AliHFEspectrum.cxx:2637
 AliHFEspectrum.cxx:2638
 AliHFEspectrum.cxx:2639
 AliHFEspectrum.cxx:2640
 AliHFEspectrum.cxx:2641
 AliHFEspectrum.cxx:2642
 AliHFEspectrum.cxx:2643
 AliHFEspectrum.cxx:2644
 AliHFEspectrum.cxx:2645
 AliHFEspectrum.cxx:2646
 AliHFEspectrum.cxx:2647
 AliHFEspectrum.cxx:2648
 AliHFEspectrum.cxx:2649
 AliHFEspectrum.cxx:2650
 AliHFEspectrum.cxx:2651
 AliHFEspectrum.cxx:2652
 AliHFEspectrum.cxx:2653
 AliHFEspectrum.cxx:2654
 AliHFEspectrum.cxx:2655
 AliHFEspectrum.cxx:2656
 AliHFEspectrum.cxx:2657
 AliHFEspectrum.cxx:2658
 AliHFEspectrum.cxx:2659
 AliHFEspectrum.cxx:2660
 AliHFEspectrum.cxx:2661
 AliHFEspectrum.cxx:2662
 AliHFEspectrum.cxx:2663
 AliHFEspectrum.cxx:2664
 AliHFEspectrum.cxx:2665
 AliHFEspectrum.cxx:2666
 AliHFEspectrum.cxx:2667
 AliHFEspectrum.cxx:2668
 AliHFEspectrum.cxx:2669
 AliHFEspectrum.cxx:2670
 AliHFEspectrum.cxx:2671
 AliHFEspectrum.cxx:2672
 AliHFEspectrum.cxx:2673
 AliHFEspectrum.cxx:2674
 AliHFEspectrum.cxx:2675
 AliHFEspectrum.cxx:2676
 AliHFEspectrum.cxx:2677
 AliHFEspectrum.cxx:2678
 AliHFEspectrum.cxx:2679
 AliHFEspectrum.cxx:2680
 AliHFEspectrum.cxx:2681
 AliHFEspectrum.cxx:2682
 AliHFEspectrum.cxx:2683
 AliHFEspectrum.cxx:2684
 AliHFEspectrum.cxx:2685
 AliHFEspectrum.cxx:2686
 AliHFEspectrum.cxx:2687
 AliHFEspectrum.cxx:2688
 AliHFEspectrum.cxx:2689
 AliHFEspectrum.cxx:2690
 AliHFEspectrum.cxx:2691
 AliHFEspectrum.cxx:2692
 AliHFEspectrum.cxx:2693
 AliHFEspectrum.cxx:2694
 AliHFEspectrum.cxx:2695
 AliHFEspectrum.cxx:2696
 AliHFEspectrum.cxx:2697
 AliHFEspectrum.cxx:2698
 AliHFEspectrum.cxx:2699
 AliHFEspectrum.cxx:2700
 AliHFEspectrum.cxx:2701
 AliHFEspectrum.cxx:2702
 AliHFEspectrum.cxx:2703
 AliHFEspectrum.cxx:2704
 AliHFEspectrum.cxx:2705
 AliHFEspectrum.cxx:2706
 AliHFEspectrum.cxx:2707
 AliHFEspectrum.cxx:2708
 AliHFEspectrum.cxx:2709
 AliHFEspectrum.cxx:2710
 AliHFEspectrum.cxx:2711
 AliHFEspectrum.cxx:2712
 AliHFEspectrum.cxx:2713
 AliHFEspectrum.cxx:2714
 AliHFEspectrum.cxx:2715
 AliHFEspectrum.cxx:2716
 AliHFEspectrum.cxx:2717
 AliHFEspectrum.cxx:2718
 AliHFEspectrum.cxx:2719
 AliHFEspectrum.cxx:2720
 AliHFEspectrum.cxx:2721
 AliHFEspectrum.cxx:2722
 AliHFEspectrum.cxx:2723
 AliHFEspectrum.cxx:2724
 AliHFEspectrum.cxx:2725
 AliHFEspectrum.cxx:2726
 AliHFEspectrum.cxx:2727
 AliHFEspectrum.cxx:2728
 AliHFEspectrum.cxx:2729
 AliHFEspectrum.cxx:2730
 AliHFEspectrum.cxx:2731
 AliHFEspectrum.cxx:2732
 AliHFEspectrum.cxx:2733
 AliHFEspectrum.cxx:2734
 AliHFEspectrum.cxx:2735
 AliHFEspectrum.cxx:2736
 AliHFEspectrum.cxx:2737
 AliHFEspectrum.cxx:2738
 AliHFEspectrum.cxx:2739
 AliHFEspectrum.cxx:2740
 AliHFEspectrum.cxx:2741
 AliHFEspectrum.cxx:2742
 AliHFEspectrum.cxx:2743
 AliHFEspectrum.cxx:2744
 AliHFEspectrum.cxx:2745
 AliHFEspectrum.cxx:2746
 AliHFEspectrum.cxx:2747
 AliHFEspectrum.cxx:2748
 AliHFEspectrum.cxx:2749
 AliHFEspectrum.cxx:2750
 AliHFEspectrum.cxx:2751
 AliHFEspectrum.cxx:2752
 AliHFEspectrum.cxx:2753
 AliHFEspectrum.cxx:2754
 AliHFEspectrum.cxx:2755
 AliHFEspectrum.cxx:2756
 AliHFEspectrum.cxx:2757
 AliHFEspectrum.cxx:2758
 AliHFEspectrum.cxx:2759
 AliHFEspectrum.cxx:2760
 AliHFEspectrum.cxx:2761
 AliHFEspectrum.cxx:2762
 AliHFEspectrum.cxx:2763
 AliHFEspectrum.cxx:2764
 AliHFEspectrum.cxx:2765
 AliHFEspectrum.cxx:2766
 AliHFEspectrum.cxx:2767
 AliHFEspectrum.cxx:2768
 AliHFEspectrum.cxx:2769
 AliHFEspectrum.cxx:2770
 AliHFEspectrum.cxx:2771
 AliHFEspectrum.cxx:2772
 AliHFEspectrum.cxx:2773
 AliHFEspectrum.cxx:2774
 AliHFEspectrum.cxx:2775
 AliHFEspectrum.cxx:2776
 AliHFEspectrum.cxx:2777
 AliHFEspectrum.cxx:2778
 AliHFEspectrum.cxx:2779
 AliHFEspectrum.cxx:2780
 AliHFEspectrum.cxx:2781
 AliHFEspectrum.cxx:2782
 AliHFEspectrum.cxx:2783
 AliHFEspectrum.cxx:2784
 AliHFEspectrum.cxx:2785
 AliHFEspectrum.cxx:2786
 AliHFEspectrum.cxx:2787
 AliHFEspectrum.cxx:2788
 AliHFEspectrum.cxx:2789
 AliHFEspectrum.cxx:2790
 AliHFEspectrum.cxx:2791
 AliHFEspectrum.cxx:2792
 AliHFEspectrum.cxx:2793
 AliHFEspectrum.cxx:2794
 AliHFEspectrum.cxx:2795
 AliHFEspectrum.cxx:2796
 AliHFEspectrum.cxx:2797
 AliHFEspectrum.cxx:2798
 AliHFEspectrum.cxx:2799
 AliHFEspectrum.cxx:2800
 AliHFEspectrum.cxx:2801
 AliHFEspectrum.cxx:2802
 AliHFEspectrum.cxx:2803
 AliHFEspectrum.cxx:2804
 AliHFEspectrum.cxx:2805
 AliHFEspectrum.cxx:2806
 AliHFEspectrum.cxx:2807
 AliHFEspectrum.cxx:2808
 AliHFEspectrum.cxx:2809
 AliHFEspectrum.cxx:2810
 AliHFEspectrum.cxx:2811
 AliHFEspectrum.cxx:2812
 AliHFEspectrum.cxx:2813
 AliHFEspectrum.cxx:2814
 AliHFEspectrum.cxx:2815
 AliHFEspectrum.cxx:2816
 AliHFEspectrum.cxx:2817
 AliHFEspectrum.cxx:2818
 AliHFEspectrum.cxx:2819
 AliHFEspectrum.cxx:2820
 AliHFEspectrum.cxx:2821
 AliHFEspectrum.cxx:2822
 AliHFEspectrum.cxx:2823
 AliHFEspectrum.cxx:2824
 AliHFEspectrum.cxx:2825
 AliHFEspectrum.cxx:2826
 AliHFEspectrum.cxx:2827
 AliHFEspectrum.cxx:2828
 AliHFEspectrum.cxx:2829
 AliHFEspectrum.cxx:2830
 AliHFEspectrum.cxx:2831
 AliHFEspectrum.cxx:2832
 AliHFEspectrum.cxx:2833
 AliHFEspectrum.cxx:2834
 AliHFEspectrum.cxx:2835
 AliHFEspectrum.cxx:2836
 AliHFEspectrum.cxx:2837
 AliHFEspectrum.cxx:2838
 AliHFEspectrum.cxx:2839
 AliHFEspectrum.cxx:2840
 AliHFEspectrum.cxx:2841
 AliHFEspectrum.cxx:2842
 AliHFEspectrum.cxx:2843
 AliHFEspectrum.cxx:2844
 AliHFEspectrum.cxx:2845
 AliHFEspectrum.cxx:2846
 AliHFEspectrum.cxx:2847
 AliHFEspectrum.cxx:2848
 AliHFEspectrum.cxx:2849
 AliHFEspectrum.cxx:2850
 AliHFEspectrum.cxx:2851
 AliHFEspectrum.cxx:2852
 AliHFEspectrum.cxx:2853
 AliHFEspectrum.cxx:2854
 AliHFEspectrum.cxx:2855
 AliHFEspectrum.cxx:2856
 AliHFEspectrum.cxx:2857
 AliHFEspectrum.cxx:2858
 AliHFEspectrum.cxx:2859
 AliHFEspectrum.cxx:2860
 AliHFEspectrum.cxx:2861
 AliHFEspectrum.cxx:2862
 AliHFEspectrum.cxx:2863
 AliHFEspectrum.cxx:2864
 AliHFEspectrum.cxx:2865
 AliHFEspectrum.cxx:2866
 AliHFEspectrum.cxx:2867
 AliHFEspectrum.cxx:2868
 AliHFEspectrum.cxx:2869
 AliHFEspectrum.cxx:2870
 AliHFEspectrum.cxx:2871
 AliHFEspectrum.cxx:2872
 AliHFEspectrum.cxx:2873
 AliHFEspectrum.cxx:2874
 AliHFEspectrum.cxx:2875
 AliHFEspectrum.cxx:2876
 AliHFEspectrum.cxx:2877
 AliHFEspectrum.cxx:2878
 AliHFEspectrum.cxx:2879
 AliHFEspectrum.cxx:2880
 AliHFEspectrum.cxx:2881
 AliHFEspectrum.cxx:2882
 AliHFEspectrum.cxx:2883
 AliHFEspectrum.cxx:2884
 AliHFEspectrum.cxx:2885
 AliHFEspectrum.cxx:2886
 AliHFEspectrum.cxx:2887
 AliHFEspectrum.cxx:2888
 AliHFEspectrum.cxx:2889
 AliHFEspectrum.cxx:2890
 AliHFEspectrum.cxx:2891
 AliHFEspectrum.cxx:2892
 AliHFEspectrum.cxx:2893
 AliHFEspectrum.cxx:2894
 AliHFEspectrum.cxx:2895
 AliHFEspectrum.cxx:2896
 AliHFEspectrum.cxx:2897
 AliHFEspectrum.cxx:2898
 AliHFEspectrum.cxx:2899
 AliHFEspectrum.cxx:2900
 AliHFEspectrum.cxx:2901
 AliHFEspectrum.cxx:2902
 AliHFEspectrum.cxx:2903
 AliHFEspectrum.cxx:2904
 AliHFEspectrum.cxx:2905
 AliHFEspectrum.cxx:2906
 AliHFEspectrum.cxx:2907
 AliHFEspectrum.cxx:2908
 AliHFEspectrum.cxx:2909
 AliHFEspectrum.cxx:2910
 AliHFEspectrum.cxx:2911
 AliHFEspectrum.cxx:2912
 AliHFEspectrum.cxx:2913
 AliHFEspectrum.cxx:2914
 AliHFEspectrum.cxx:2915
 AliHFEspectrum.cxx:2916
 AliHFEspectrum.cxx:2917
 AliHFEspectrum.cxx:2918
 AliHFEspectrum.cxx:2919
 AliHFEspectrum.cxx:2920
 AliHFEspectrum.cxx:2921
 AliHFEspectrum.cxx:2922
 AliHFEspectrum.cxx:2923
 AliHFEspectrum.cxx:2924
 AliHFEspectrum.cxx:2925
 AliHFEspectrum.cxx:2926
 AliHFEspectrum.cxx:2927
 AliHFEspectrum.cxx:2928
 AliHFEspectrum.cxx:2929
 AliHFEspectrum.cxx:2930
 AliHFEspectrum.cxx:2931
 AliHFEspectrum.cxx:2932
 AliHFEspectrum.cxx:2933
 AliHFEspectrum.cxx:2934
 AliHFEspectrum.cxx:2935
 AliHFEspectrum.cxx:2936
 AliHFEspectrum.cxx:2937
 AliHFEspectrum.cxx:2938
 AliHFEspectrum.cxx:2939
 AliHFEspectrum.cxx:2940
 AliHFEspectrum.cxx:2941
 AliHFEspectrum.cxx:2942
 AliHFEspectrum.cxx:2943
 AliHFEspectrum.cxx:2944
 AliHFEspectrum.cxx:2945
 AliHFEspectrum.cxx:2946
 AliHFEspectrum.cxx:2947
 AliHFEspectrum.cxx:2948
 AliHFEspectrum.cxx:2949
 AliHFEspectrum.cxx:2950
 AliHFEspectrum.cxx:2951
 AliHFEspectrum.cxx:2952
 AliHFEspectrum.cxx:2953
 AliHFEspectrum.cxx:2954
 AliHFEspectrum.cxx:2955
 AliHFEspectrum.cxx:2956
 AliHFEspectrum.cxx:2957
 AliHFEspectrum.cxx:2958
 AliHFEspectrum.cxx:2959
 AliHFEspectrum.cxx:2960
 AliHFEspectrum.cxx:2961
 AliHFEspectrum.cxx:2962
 AliHFEspectrum.cxx:2963
 AliHFEspectrum.cxx:2964
 AliHFEspectrum.cxx:2965
 AliHFEspectrum.cxx:2966
 AliHFEspectrum.cxx:2967
 AliHFEspectrum.cxx:2968
 AliHFEspectrum.cxx:2969
 AliHFEspectrum.cxx:2970
 AliHFEspectrum.cxx:2971
 AliHFEspectrum.cxx:2972
 AliHFEspectrum.cxx:2973
 AliHFEspectrum.cxx:2974
 AliHFEspectrum.cxx:2975
 AliHFEspectrum.cxx:2976
 AliHFEspectrum.cxx:2977
 AliHFEspectrum.cxx:2978
 AliHFEspectrum.cxx:2979
 AliHFEspectrum.cxx:2980
 AliHFEspectrum.cxx:2981
 AliHFEspectrum.cxx:2982
 AliHFEspectrum.cxx:2983
 AliHFEspectrum.cxx:2984
 AliHFEspectrum.cxx:2985
 AliHFEspectrum.cxx:2986
 AliHFEspectrum.cxx:2987
 AliHFEspectrum.cxx:2988
 AliHFEspectrum.cxx:2989
 AliHFEspectrum.cxx:2990
 AliHFEspectrum.cxx:2991
 AliHFEspectrum.cxx:2992
 AliHFEspectrum.cxx:2993
 AliHFEspectrum.cxx:2994
 AliHFEspectrum.cxx:2995
 AliHFEspectrum.cxx:2996
 AliHFEspectrum.cxx:2997
 AliHFEspectrum.cxx:2998
 AliHFEspectrum.cxx:2999
 AliHFEspectrum.cxx:3000
 AliHFEspectrum.cxx:3001
 AliHFEspectrum.cxx:3002
 AliHFEspectrum.cxx:3003
 AliHFEspectrum.cxx:3004
 AliHFEspectrum.cxx:3005
 AliHFEspectrum.cxx:3006
 AliHFEspectrum.cxx:3007
 AliHFEspectrum.cxx:3008
 AliHFEspectrum.cxx:3009
 AliHFEspectrum.cxx:3010
 AliHFEspectrum.cxx:3011
 AliHFEspectrum.cxx:3012
 AliHFEspectrum.cxx:3013
 AliHFEspectrum.cxx:3014
 AliHFEspectrum.cxx:3015
 AliHFEspectrum.cxx:3016
 AliHFEspectrum.cxx:3017
 AliHFEspectrum.cxx:3018
 AliHFEspectrum.cxx:3019
 AliHFEspectrum.cxx:3020
 AliHFEspectrum.cxx:3021
 AliHFEspectrum.cxx:3022
 AliHFEspectrum.cxx:3023
 AliHFEspectrum.cxx:3024
 AliHFEspectrum.cxx:3025
 AliHFEspectrum.cxx:3026
 AliHFEspectrum.cxx:3027
 AliHFEspectrum.cxx:3028
 AliHFEspectrum.cxx:3029
 AliHFEspectrum.cxx:3030
 AliHFEspectrum.cxx:3031
 AliHFEspectrum.cxx:3032
 AliHFEspectrum.cxx:3033
 AliHFEspectrum.cxx:3034
 AliHFEspectrum.cxx:3035
 AliHFEspectrum.cxx:3036
 AliHFEspectrum.cxx:3037
 AliHFEspectrum.cxx:3038
 AliHFEspectrum.cxx:3039
 AliHFEspectrum.cxx:3040
 AliHFEspectrum.cxx:3041
 AliHFEspectrum.cxx:3042
 AliHFEspectrum.cxx:3043
 AliHFEspectrum.cxx:3044
 AliHFEspectrum.cxx:3045
 AliHFEspectrum.cxx:3046
 AliHFEspectrum.cxx:3047
 AliHFEspectrum.cxx:3048
 AliHFEspectrum.cxx:3049
 AliHFEspectrum.cxx:3050
 AliHFEspectrum.cxx:3051
 AliHFEspectrum.cxx:3052
 AliHFEspectrum.cxx:3053
 AliHFEspectrum.cxx:3054
 AliHFEspectrum.cxx:3055
 AliHFEspectrum.cxx:3056
 AliHFEspectrum.cxx:3057
 AliHFEspectrum.cxx:3058
 AliHFEspectrum.cxx:3059
 AliHFEspectrum.cxx:3060
 AliHFEspectrum.cxx:3061
 AliHFEspectrum.cxx:3062
 AliHFEspectrum.cxx:3063
 AliHFEspectrum.cxx:3064
 AliHFEspectrum.cxx:3065
 AliHFEspectrum.cxx:3066
 AliHFEspectrum.cxx:3067
 AliHFEspectrum.cxx:3068
 AliHFEspectrum.cxx:3069
 AliHFEspectrum.cxx:3070
 AliHFEspectrum.cxx:3071
 AliHFEspectrum.cxx:3072
 AliHFEspectrum.cxx:3073
 AliHFEspectrum.cxx:3074
 AliHFEspectrum.cxx:3075
 AliHFEspectrum.cxx:3076
 AliHFEspectrum.cxx:3077
 AliHFEspectrum.cxx:3078
 AliHFEspectrum.cxx:3079
 AliHFEspectrum.cxx:3080
 AliHFEspectrum.cxx:3081
 AliHFEspectrum.cxx:3082
 AliHFEspectrum.cxx:3083
 AliHFEspectrum.cxx:3084
 AliHFEspectrum.cxx:3085
 AliHFEspectrum.cxx:3086
 AliHFEspectrum.cxx:3087
 AliHFEspectrum.cxx:3088
 AliHFEspectrum.cxx:3089
 AliHFEspectrum.cxx:3090
 AliHFEspectrum.cxx:3091
 AliHFEspectrum.cxx:3092
 AliHFEspectrum.cxx:3093
 AliHFEspectrum.cxx:3094
 AliHFEspectrum.cxx:3095
 AliHFEspectrum.cxx:3096
 AliHFEspectrum.cxx:3097
 AliHFEspectrum.cxx:3098
 AliHFEspectrum.cxx:3099
 AliHFEspectrum.cxx:3100
 AliHFEspectrum.cxx:3101
 AliHFEspectrum.cxx:3102
 AliHFEspectrum.cxx:3103
 AliHFEspectrum.cxx:3104
 AliHFEspectrum.cxx:3105
 AliHFEspectrum.cxx:3106
 AliHFEspectrum.cxx:3107
 AliHFEspectrum.cxx:3108
 AliHFEspectrum.cxx:3109
 AliHFEspectrum.cxx:3110
 AliHFEspectrum.cxx:3111
 AliHFEspectrum.cxx:3112
 AliHFEspectrum.cxx:3113
 AliHFEspectrum.cxx:3114
 AliHFEspectrum.cxx:3115
 AliHFEspectrum.cxx:3116
 AliHFEspectrum.cxx:3117
 AliHFEspectrum.cxx:3118
 AliHFEspectrum.cxx:3119
 AliHFEspectrum.cxx:3120
 AliHFEspectrum.cxx:3121
 AliHFEspectrum.cxx:3122
 AliHFEspectrum.cxx:3123
 AliHFEspectrum.cxx:3124
 AliHFEspectrum.cxx:3125
 AliHFEspectrum.cxx:3126
 AliHFEspectrum.cxx:3127
 AliHFEspectrum.cxx:3128
 AliHFEspectrum.cxx:3129
 AliHFEspectrum.cxx:3130
 AliHFEspectrum.cxx:3131
 AliHFEspectrum.cxx:3132
 AliHFEspectrum.cxx:3133
 AliHFEspectrum.cxx:3134
 AliHFEspectrum.cxx:3135
 AliHFEspectrum.cxx:3136
 AliHFEspectrum.cxx:3137
 AliHFEspectrum.cxx:3138
 AliHFEspectrum.cxx:3139
 AliHFEspectrum.cxx:3140
 AliHFEspectrum.cxx:3141
 AliHFEspectrum.cxx:3142
 AliHFEspectrum.cxx:3143
 AliHFEspectrum.cxx:3144
 AliHFEspectrum.cxx:3145
 AliHFEspectrum.cxx:3146
 AliHFEspectrum.cxx:3147
 AliHFEspectrum.cxx:3148
 AliHFEspectrum.cxx:3149
 AliHFEspectrum.cxx:3150
 AliHFEspectrum.cxx:3151
 AliHFEspectrum.cxx:3152
 AliHFEspectrum.cxx:3153
 AliHFEspectrum.cxx:3154
 AliHFEspectrum.cxx:3155
 AliHFEspectrum.cxx:3156
 AliHFEspectrum.cxx:3157
 AliHFEspectrum.cxx:3158
 AliHFEspectrum.cxx:3159
 AliHFEspectrum.cxx:3160
 AliHFEspectrum.cxx:3161
 AliHFEspectrum.cxx:3162
 AliHFEspectrum.cxx:3163
 AliHFEspectrum.cxx:3164
 AliHFEspectrum.cxx:3165
 AliHFEspectrum.cxx:3166
 AliHFEspectrum.cxx:3167
 AliHFEspectrum.cxx:3168
 AliHFEspectrum.cxx:3169
 AliHFEspectrum.cxx:3170
 AliHFEspectrum.cxx:3171
 AliHFEspectrum.cxx:3172
 AliHFEspectrum.cxx:3173
 AliHFEspectrum.cxx:3174
 AliHFEspectrum.cxx:3175
 AliHFEspectrum.cxx:3176
 AliHFEspectrum.cxx:3177
 AliHFEspectrum.cxx:3178
 AliHFEspectrum.cxx:3179
 AliHFEspectrum.cxx:3180
 AliHFEspectrum.cxx:3181
 AliHFEspectrum.cxx:3182
 AliHFEspectrum.cxx:3183
 AliHFEspectrum.cxx:3184
 AliHFEspectrum.cxx:3185
 AliHFEspectrum.cxx:3186
 AliHFEspectrum.cxx:3187
 AliHFEspectrum.cxx:3188
 AliHFEspectrum.cxx:3189
 AliHFEspectrum.cxx:3190
 AliHFEspectrum.cxx:3191
 AliHFEspectrum.cxx:3192
 AliHFEspectrum.cxx:3193
 AliHFEspectrum.cxx:3194
 AliHFEspectrum.cxx:3195
 AliHFEspectrum.cxx:3196
 AliHFEspectrum.cxx:3197
 AliHFEspectrum.cxx:3198
 AliHFEspectrum.cxx:3199
 AliHFEspectrum.cxx:3200
 AliHFEspectrum.cxx:3201
 AliHFEspectrum.cxx:3202
 AliHFEspectrum.cxx:3203
 AliHFEspectrum.cxx:3204
 AliHFEspectrum.cxx:3205
 AliHFEspectrum.cxx:3206
 AliHFEspectrum.cxx:3207
 AliHFEspectrum.cxx:3208
 AliHFEspectrum.cxx:3209
 AliHFEspectrum.cxx:3210
 AliHFEspectrum.cxx:3211
 AliHFEspectrum.cxx:3212
 AliHFEspectrum.cxx:3213
 AliHFEspectrum.cxx:3214
 AliHFEspectrum.cxx:3215
 AliHFEspectrum.cxx:3216
 AliHFEspectrum.cxx:3217
 AliHFEspectrum.cxx:3218
 AliHFEspectrum.cxx:3219
 AliHFEspectrum.cxx:3220
 AliHFEspectrum.cxx:3221
 AliHFEspectrum.cxx:3222
 AliHFEspectrum.cxx:3223
 AliHFEspectrum.cxx:3224
 AliHFEspectrum.cxx:3225
 AliHFEspectrum.cxx:3226
 AliHFEspectrum.cxx:3227
 AliHFEspectrum.cxx:3228
 AliHFEspectrum.cxx:3229
 AliHFEspectrum.cxx:3230
 AliHFEspectrum.cxx:3231
 AliHFEspectrum.cxx:3232
 AliHFEspectrum.cxx:3233
 AliHFEspectrum.cxx:3234
 AliHFEspectrum.cxx:3235
 AliHFEspectrum.cxx:3236
 AliHFEspectrum.cxx:3237
 AliHFEspectrum.cxx:3238
 AliHFEspectrum.cxx:3239
 AliHFEspectrum.cxx:3240
 AliHFEspectrum.cxx:3241
 AliHFEspectrum.cxx:3242
 AliHFEspectrum.cxx:3243
 AliHFEspectrum.cxx:3244
 AliHFEspectrum.cxx:3245
 AliHFEspectrum.cxx:3246
 AliHFEspectrum.cxx:3247
 AliHFEspectrum.cxx:3248
 AliHFEspectrum.cxx:3249
 AliHFEspectrum.cxx:3250
 AliHFEspectrum.cxx:3251
 AliHFEspectrum.cxx:3252
 AliHFEspectrum.cxx:3253
 AliHFEspectrum.cxx:3254
 AliHFEspectrum.cxx:3255
 AliHFEspectrum.cxx:3256
 AliHFEspectrum.cxx:3257
 AliHFEspectrum.cxx:3258
 AliHFEspectrum.cxx:3259
 AliHFEspectrum.cxx:3260
 AliHFEspectrum.cxx:3261
 AliHFEspectrum.cxx:3262
 AliHFEspectrum.cxx:3263
 AliHFEspectrum.cxx:3264
 AliHFEspectrum.cxx:3265
 AliHFEspectrum.cxx:3266
 AliHFEspectrum.cxx:3267
 AliHFEspectrum.cxx:3268
 AliHFEspectrum.cxx:3269
 AliHFEspectrum.cxx:3270
 AliHFEspectrum.cxx:3271
 AliHFEspectrum.cxx:3272
 AliHFEspectrum.cxx:3273
 AliHFEspectrum.cxx:3274
 AliHFEspectrum.cxx:3275
 AliHFEspectrum.cxx:3276
 AliHFEspectrum.cxx:3277
 AliHFEspectrum.cxx:3278
 AliHFEspectrum.cxx:3279
 AliHFEspectrum.cxx:3280
 AliHFEspectrum.cxx:3281
 AliHFEspectrum.cxx:3282
 AliHFEspectrum.cxx:3283
 AliHFEspectrum.cxx:3284
 AliHFEspectrum.cxx:3285
 AliHFEspectrum.cxx:3286
 AliHFEspectrum.cxx:3287
 AliHFEspectrum.cxx:3288
 AliHFEspectrum.cxx:3289
 AliHFEspectrum.cxx:3290
 AliHFEspectrum.cxx:3291
 AliHFEspectrum.cxx:3292
 AliHFEspectrum.cxx:3293
 AliHFEspectrum.cxx:3294
 AliHFEspectrum.cxx:3295
 AliHFEspectrum.cxx:3296
 AliHFEspectrum.cxx:3297
 AliHFEspectrum.cxx:3298
 AliHFEspectrum.cxx:3299
 AliHFEspectrum.cxx:3300
 AliHFEspectrum.cxx:3301
 AliHFEspectrum.cxx:3302
 AliHFEspectrum.cxx:3303
 AliHFEspectrum.cxx:3304
 AliHFEspectrum.cxx:3305
 AliHFEspectrum.cxx:3306
 AliHFEspectrum.cxx:3307
 AliHFEspectrum.cxx:3308
 AliHFEspectrum.cxx:3309
 AliHFEspectrum.cxx:3310
 AliHFEspectrum.cxx:3311
 AliHFEspectrum.cxx:3312
 AliHFEspectrum.cxx:3313
 AliHFEspectrum.cxx:3314
 AliHFEspectrum.cxx:3315
 AliHFEspectrum.cxx:3316
 AliHFEspectrum.cxx:3317
 AliHFEspectrum.cxx:3318
 AliHFEspectrum.cxx:3319
 AliHFEspectrum.cxx:3320
 AliHFEspectrum.cxx:3321
 AliHFEspectrum.cxx:3322
 AliHFEspectrum.cxx:3323
 AliHFEspectrum.cxx:3324
 AliHFEspectrum.cxx:3325
 AliHFEspectrum.cxx:3326
 AliHFEspectrum.cxx:3327
 AliHFEspectrum.cxx:3328
 AliHFEspectrum.cxx:3329
 AliHFEspectrum.cxx:3330
 AliHFEspectrum.cxx:3331
 AliHFEspectrum.cxx:3332
 AliHFEspectrum.cxx:3333
 AliHFEspectrum.cxx:3334
 AliHFEspectrum.cxx:3335
 AliHFEspectrum.cxx:3336
 AliHFEspectrum.cxx:3337
 AliHFEspectrum.cxx:3338
 AliHFEspectrum.cxx:3339
 AliHFEspectrum.cxx:3340
 AliHFEspectrum.cxx:3341
 AliHFEspectrum.cxx:3342
 AliHFEspectrum.cxx:3343
 AliHFEspectrum.cxx:3344
 AliHFEspectrum.cxx:3345
 AliHFEspectrum.cxx:3346
 AliHFEspectrum.cxx:3347
 AliHFEspectrum.cxx:3348
 AliHFEspectrum.cxx:3349
 AliHFEspectrum.cxx:3350
 AliHFEspectrum.cxx:3351
 AliHFEspectrum.cxx:3352
 AliHFEspectrum.cxx:3353
 AliHFEspectrum.cxx:3354
 AliHFEspectrum.cxx:3355
 AliHFEspectrum.cxx:3356
 AliHFEspectrum.cxx:3357
 AliHFEspectrum.cxx:3358
 AliHFEspectrum.cxx:3359
 AliHFEspectrum.cxx:3360
 AliHFEspectrum.cxx:3361
 AliHFEspectrum.cxx:3362
 AliHFEspectrum.cxx:3363
 AliHFEspectrum.cxx:3364
 AliHFEspectrum.cxx:3365
 AliHFEspectrum.cxx:3366
 AliHFEspectrum.cxx:3367
 AliHFEspectrum.cxx:3368
 AliHFEspectrum.cxx:3369
 AliHFEspectrum.cxx:3370
 AliHFEspectrum.cxx:3371
 AliHFEspectrum.cxx:3372
 AliHFEspectrum.cxx:3373
 AliHFEspectrum.cxx:3374
 AliHFEspectrum.cxx:3375
 AliHFEspectrum.cxx:3376
 AliHFEspectrum.cxx:3377
 AliHFEspectrum.cxx:3378
 AliHFEspectrum.cxx:3379
 AliHFEspectrum.cxx:3380
 AliHFEspectrum.cxx:3381
 AliHFEspectrum.cxx:3382
 AliHFEspectrum.cxx:3383
 AliHFEspectrum.cxx:3384
 AliHFEspectrum.cxx:3385
 AliHFEspectrum.cxx:3386
 AliHFEspectrum.cxx:3387
 AliHFEspectrum.cxx:3388
 AliHFEspectrum.cxx:3389
 AliHFEspectrum.cxx:3390
 AliHFEspectrum.cxx:3391
 AliHFEspectrum.cxx:3392
 AliHFEspectrum.cxx:3393
 AliHFEspectrum.cxx:3394
 AliHFEspectrum.cxx:3395
 AliHFEspectrum.cxx:3396
 AliHFEspectrum.cxx:3397
 AliHFEspectrum.cxx:3398
 AliHFEspectrum.cxx:3399
 AliHFEspectrum.cxx:3400
 AliHFEspectrum.cxx:3401
 AliHFEspectrum.cxx:3402
 AliHFEspectrum.cxx:3403
 AliHFEspectrum.cxx:3404
 AliHFEspectrum.cxx:3405
 AliHFEspectrum.cxx:3406
 AliHFEspectrum.cxx:3407
 AliHFEspectrum.cxx:3408
 AliHFEspectrum.cxx:3409
 AliHFEspectrum.cxx:3410
 AliHFEspectrum.cxx:3411
 AliHFEspectrum.cxx:3412
 AliHFEspectrum.cxx:3413
 AliHFEspectrum.cxx:3414
 AliHFEspectrum.cxx:3415
 AliHFEspectrum.cxx:3416
 AliHFEspectrum.cxx:3417
 AliHFEspectrum.cxx:3418
 AliHFEspectrum.cxx:3419
 AliHFEspectrum.cxx:3420
 AliHFEspectrum.cxx:3421
 AliHFEspectrum.cxx:3422
 AliHFEspectrum.cxx:3423
 AliHFEspectrum.cxx:3424
 AliHFEspectrum.cxx:3425
 AliHFEspectrum.cxx:3426
 AliHFEspectrum.cxx:3427
 AliHFEspectrum.cxx:3428
 AliHFEspectrum.cxx:3429
 AliHFEspectrum.cxx:3430
 AliHFEspectrum.cxx:3431
 AliHFEspectrum.cxx:3432
 AliHFEspectrum.cxx:3433
 AliHFEspectrum.cxx:3434
 AliHFEspectrum.cxx:3435
 AliHFEspectrum.cxx:3436
 AliHFEspectrum.cxx:3437
 AliHFEspectrum.cxx:3438
 AliHFEspectrum.cxx:3439
 AliHFEspectrum.cxx:3440
 AliHFEspectrum.cxx:3441
 AliHFEspectrum.cxx:3442
 AliHFEspectrum.cxx:3443
 AliHFEspectrum.cxx:3444
 AliHFEspectrum.cxx:3445
 AliHFEspectrum.cxx:3446
 AliHFEspectrum.cxx:3447
 AliHFEspectrum.cxx:3448
 AliHFEspectrum.cxx:3449
 AliHFEspectrum.cxx:3450
 AliHFEspectrum.cxx:3451
 AliHFEspectrum.cxx:3452
 AliHFEspectrum.cxx:3453
 AliHFEspectrum.cxx:3454
 AliHFEspectrum.cxx:3455
 AliHFEspectrum.cxx:3456
 AliHFEspectrum.cxx:3457
 AliHFEspectrum.cxx:3458
 AliHFEspectrum.cxx:3459
 AliHFEspectrum.cxx:3460
 AliHFEspectrum.cxx:3461
 AliHFEspectrum.cxx:3462
 AliHFEspectrum.cxx:3463
 AliHFEspectrum.cxx:3464
 AliHFEspectrum.cxx:3465
 AliHFEspectrum.cxx:3466
 AliHFEspectrum.cxx:3467
 AliHFEspectrum.cxx:3468
 AliHFEspectrum.cxx:3469
 AliHFEspectrum.cxx:3470
 AliHFEspectrum.cxx:3471
 AliHFEspectrum.cxx:3472
 AliHFEspectrum.cxx:3473
 AliHFEspectrum.cxx:3474
 AliHFEspectrum.cxx:3475
 AliHFEspectrum.cxx:3476
 AliHFEspectrum.cxx:3477
 AliHFEspectrum.cxx:3478
 AliHFEspectrum.cxx:3479
 AliHFEspectrum.cxx:3480
 AliHFEspectrum.cxx:3481
 AliHFEspectrum.cxx:3482
 AliHFEspectrum.cxx:3483
 AliHFEspectrum.cxx:3484
 AliHFEspectrum.cxx:3485
 AliHFEspectrum.cxx:3486
 AliHFEspectrum.cxx:3487
 AliHFEspectrum.cxx:3488
 AliHFEspectrum.cxx:3489
 AliHFEspectrum.cxx:3490
 AliHFEspectrum.cxx:3491
 AliHFEspectrum.cxx:3492
 AliHFEspectrum.cxx:3493
 AliHFEspectrum.cxx:3494
 AliHFEspectrum.cxx:3495
 AliHFEspectrum.cxx:3496
 AliHFEspectrum.cxx:3497
 AliHFEspectrum.cxx:3498
 AliHFEspectrum.cxx:3499
 AliHFEspectrum.cxx:3500
 AliHFEspectrum.cxx:3501
 AliHFEspectrum.cxx:3502
 AliHFEspectrum.cxx:3503
 AliHFEspectrum.cxx:3504
 AliHFEspectrum.cxx:3505
 AliHFEspectrum.cxx:3506
 AliHFEspectrum.cxx:3507
 AliHFEspectrum.cxx:3508
 AliHFEspectrum.cxx:3509
 AliHFEspectrum.cxx:3510
 AliHFEspectrum.cxx:3511
 AliHFEspectrum.cxx:3512
 AliHFEspectrum.cxx:3513
 AliHFEspectrum.cxx:3514
 AliHFEspectrum.cxx:3515
 AliHFEspectrum.cxx:3516
 AliHFEspectrum.cxx:3517
 AliHFEspectrum.cxx:3518
 AliHFEspectrum.cxx:3519
 AliHFEspectrum.cxx:3520
 AliHFEspectrum.cxx:3521
 AliHFEspectrum.cxx:3522
 AliHFEspectrum.cxx:3523
 AliHFEspectrum.cxx:3524
 AliHFEspectrum.cxx:3525
 AliHFEspectrum.cxx:3526
 AliHFEspectrum.cxx:3527
 AliHFEspectrum.cxx:3528
 AliHFEspectrum.cxx:3529
 AliHFEspectrum.cxx:3530
 AliHFEspectrum.cxx:3531
 AliHFEspectrum.cxx:3532
 AliHFEspectrum.cxx:3533
 AliHFEspectrum.cxx:3534
 AliHFEspectrum.cxx:3535
 AliHFEspectrum.cxx:3536
 AliHFEspectrum.cxx:3537
 AliHFEspectrum.cxx:3538
 AliHFEspectrum.cxx:3539
 AliHFEspectrum.cxx:3540
 AliHFEspectrum.cxx:3541
 AliHFEspectrum.cxx:3542
 AliHFEspectrum.cxx:3543
 AliHFEspectrum.cxx:3544
 AliHFEspectrum.cxx:3545
 AliHFEspectrum.cxx:3546
 AliHFEspectrum.cxx:3547
 AliHFEspectrum.cxx:3548
 AliHFEspectrum.cxx:3549
 AliHFEspectrum.cxx:3550
 AliHFEspectrum.cxx:3551
 AliHFEspectrum.cxx:3552
 AliHFEspectrum.cxx:3553
 AliHFEspectrum.cxx:3554
 AliHFEspectrum.cxx:3555
 AliHFEspectrum.cxx:3556
 AliHFEspectrum.cxx:3557
 AliHFEspectrum.cxx:3558
 AliHFEspectrum.cxx:3559
 AliHFEspectrum.cxx:3560
 AliHFEspectrum.cxx:3561
 AliHFEspectrum.cxx:3562
 AliHFEspectrum.cxx:3563
 AliHFEspectrum.cxx:3564
 AliHFEspectrum.cxx:3565
 AliHFEspectrum.cxx:3566
 AliHFEspectrum.cxx:3567
 AliHFEspectrum.cxx:3568
 AliHFEspectrum.cxx:3569
 AliHFEspectrum.cxx:3570
 AliHFEspectrum.cxx:3571
 AliHFEspectrum.cxx:3572
 AliHFEspectrum.cxx:3573
 AliHFEspectrum.cxx:3574
 AliHFEspectrum.cxx:3575
 AliHFEspectrum.cxx:3576
 AliHFEspectrum.cxx:3577
 AliHFEspectrum.cxx:3578
 AliHFEspectrum.cxx:3579
 AliHFEspectrum.cxx:3580
 AliHFEspectrum.cxx:3581
 AliHFEspectrum.cxx:3582
 AliHFEspectrum.cxx:3583
 AliHFEspectrum.cxx:3584
 AliHFEspectrum.cxx:3585
 AliHFEspectrum.cxx:3586
 AliHFEspectrum.cxx:3587
 AliHFEspectrum.cxx:3588
 AliHFEspectrum.cxx:3589
 AliHFEspectrum.cxx:3590
 AliHFEspectrum.cxx:3591
 AliHFEspectrum.cxx:3592
 AliHFEspectrum.cxx:3593
 AliHFEspectrum.cxx:3594
 AliHFEspectrum.cxx:3595
 AliHFEspectrum.cxx:3596
 AliHFEspectrum.cxx:3597
 AliHFEspectrum.cxx:3598
 AliHFEspectrum.cxx:3599
 AliHFEspectrum.cxx:3600
 AliHFEspectrum.cxx:3601
 AliHFEspectrum.cxx:3602
 AliHFEspectrum.cxx:3603
 AliHFEspectrum.cxx:3604
 AliHFEspectrum.cxx:3605
 AliHFEspectrum.cxx:3606
 AliHFEspectrum.cxx:3607
 AliHFEspectrum.cxx:3608
 AliHFEspectrum.cxx:3609
 AliHFEspectrum.cxx:3610
 AliHFEspectrum.cxx:3611
 AliHFEspectrum.cxx:3612
 AliHFEspectrum.cxx:3613
 AliHFEspectrum.cxx:3614
 AliHFEspectrum.cxx:3615
 AliHFEspectrum.cxx:3616
 AliHFEspectrum.cxx:3617
 AliHFEspectrum.cxx:3618
 AliHFEspectrum.cxx:3619
 AliHFEspectrum.cxx:3620
 AliHFEspectrum.cxx:3621
 AliHFEspectrum.cxx:3622
 AliHFEspectrum.cxx:3623
 AliHFEspectrum.cxx:3624
 AliHFEspectrum.cxx:3625
 AliHFEspectrum.cxx:3626
 AliHFEspectrum.cxx:3627
 AliHFEspectrum.cxx:3628
 AliHFEspectrum.cxx:3629
 AliHFEspectrum.cxx:3630
 AliHFEspectrum.cxx:3631
 AliHFEspectrum.cxx:3632
 AliHFEspectrum.cxx:3633
 AliHFEspectrum.cxx:3634
 AliHFEspectrum.cxx:3635
 AliHFEspectrum.cxx:3636
 AliHFEspectrum.cxx:3637
 AliHFEspectrum.cxx:3638
 AliHFEspectrum.cxx:3639
 AliHFEspectrum.cxx:3640
 AliHFEspectrum.cxx:3641
 AliHFEspectrum.cxx:3642
 AliHFEspectrum.cxx:3643
 AliHFEspectrum.cxx:3644
 AliHFEspectrum.cxx:3645
 AliHFEspectrum.cxx:3646
 AliHFEspectrum.cxx:3647
 AliHFEspectrum.cxx:3648
 AliHFEspectrum.cxx:3649
 AliHFEspectrum.cxx:3650
 AliHFEspectrum.cxx:3651
 AliHFEspectrum.cxx:3652
 AliHFEspectrum.cxx:3653
 AliHFEspectrum.cxx:3654
 AliHFEspectrum.cxx:3655
 AliHFEspectrum.cxx:3656
 AliHFEspectrum.cxx:3657
 AliHFEspectrum.cxx:3658
 AliHFEspectrum.cxx:3659
 AliHFEspectrum.cxx:3660
 AliHFEspectrum.cxx:3661
 AliHFEspectrum.cxx:3662
 AliHFEspectrum.cxx:3663
 AliHFEspectrum.cxx:3664
 AliHFEspectrum.cxx:3665
 AliHFEspectrum.cxx:3666
 AliHFEspectrum.cxx:3667
 AliHFEspectrum.cxx:3668
 AliHFEspectrum.cxx:3669
 AliHFEspectrum.cxx:3670
 AliHFEspectrum.cxx:3671
 AliHFEspectrum.cxx:3672
 AliHFEspectrum.cxx:3673
 AliHFEspectrum.cxx:3674
 AliHFEspectrum.cxx:3675
 AliHFEspectrum.cxx:3676
 AliHFEspectrum.cxx:3677
 AliHFEspectrum.cxx:3678
 AliHFEspectrum.cxx:3679
 AliHFEspectrum.cxx:3680
 AliHFEspectrum.cxx:3681
 AliHFEspectrum.cxx:3682
 AliHFEspectrum.cxx:3683
 AliHFEspectrum.cxx:3684
 AliHFEspectrum.cxx:3685
 AliHFEspectrum.cxx:3686
 AliHFEspectrum.cxx:3687
 AliHFEspectrum.cxx:3688
 AliHFEspectrum.cxx:3689
 AliHFEspectrum.cxx:3690
 AliHFEspectrum.cxx:3691
 AliHFEspectrum.cxx:3692
 AliHFEspectrum.cxx:3693
 AliHFEspectrum.cxx:3694
 AliHFEspectrum.cxx:3695
 AliHFEspectrum.cxx:3696
 AliHFEspectrum.cxx:3697
 AliHFEspectrum.cxx:3698
 AliHFEspectrum.cxx:3699
 AliHFEspectrum.cxx:3700
 AliHFEspectrum.cxx:3701
 AliHFEspectrum.cxx:3702
 AliHFEspectrum.cxx:3703
 AliHFEspectrum.cxx:3704
 AliHFEspectrum.cxx:3705
 AliHFEspectrum.cxx:3706
 AliHFEspectrum.cxx:3707
 AliHFEspectrum.cxx:3708
 AliHFEspectrum.cxx:3709
 AliHFEspectrum.cxx:3710
 AliHFEspectrum.cxx:3711
 AliHFEspectrum.cxx:3712
 AliHFEspectrum.cxx:3713
 AliHFEspectrum.cxx:3714
 AliHFEspectrum.cxx:3715
 AliHFEspectrum.cxx:3716
 AliHFEspectrum.cxx:3717
 AliHFEspectrum.cxx:3718
 AliHFEspectrum.cxx:3719
 AliHFEspectrum.cxx:3720
 AliHFEspectrum.cxx:3721
 AliHFEspectrum.cxx:3722
 AliHFEspectrum.cxx:3723
 AliHFEspectrum.cxx:3724
 AliHFEspectrum.cxx:3725
 AliHFEspectrum.cxx:3726
 AliHFEspectrum.cxx:3727
 AliHFEspectrum.cxx:3728
 AliHFEspectrum.cxx:3729
 AliHFEspectrum.cxx:3730
 AliHFEspectrum.cxx:3731
 AliHFEspectrum.cxx:3732
 AliHFEspectrum.cxx:3733
 AliHFEspectrum.cxx:3734
 AliHFEspectrum.cxx:3735
 AliHFEspectrum.cxx:3736
 AliHFEspectrum.cxx:3737
 AliHFEspectrum.cxx:3738
 AliHFEspectrum.cxx:3739
 AliHFEspectrum.cxx:3740
 AliHFEspectrum.cxx:3741
 AliHFEspectrum.cxx:3742
 AliHFEspectrum.cxx:3743
 AliHFEspectrum.cxx:3744
 AliHFEspectrum.cxx:3745
 AliHFEspectrum.cxx:3746
 AliHFEspectrum.cxx:3747
 AliHFEspectrum.cxx:3748
 AliHFEspectrum.cxx:3749
 AliHFEspectrum.cxx:3750
 AliHFEspectrum.cxx:3751
 AliHFEspectrum.cxx:3752
 AliHFEspectrum.cxx:3753
 AliHFEspectrum.cxx:3754
 AliHFEspectrum.cxx:3755
 AliHFEspectrum.cxx:3756
 AliHFEspectrum.cxx:3757
 AliHFEspectrum.cxx:3758
 AliHFEspectrum.cxx:3759
 AliHFEspectrum.cxx:3760
 AliHFEspectrum.cxx:3761
 AliHFEspectrum.cxx:3762
 AliHFEspectrum.cxx:3763
 AliHFEspectrum.cxx:3764
 AliHFEspectrum.cxx:3765
 AliHFEspectrum.cxx:3766
 AliHFEspectrum.cxx:3767
 AliHFEspectrum.cxx:3768
 AliHFEspectrum.cxx:3769
 AliHFEspectrum.cxx:3770
 AliHFEspectrum.cxx:3771
 AliHFEspectrum.cxx:3772
 AliHFEspectrum.cxx:3773
 AliHFEspectrum.cxx:3774
 AliHFEspectrum.cxx:3775
 AliHFEspectrum.cxx:3776
 AliHFEspectrum.cxx:3777
 AliHFEspectrum.cxx:3778
 AliHFEspectrum.cxx:3779
 AliHFEspectrum.cxx:3780
 AliHFEspectrum.cxx:3781
 AliHFEspectrum.cxx:3782
 AliHFEspectrum.cxx:3783
 AliHFEspectrum.cxx:3784
 AliHFEspectrum.cxx:3785
 AliHFEspectrum.cxx:3786
 AliHFEspectrum.cxx:3787
 AliHFEspectrum.cxx:3788
 AliHFEspectrum.cxx:3789
 AliHFEspectrum.cxx:3790
 AliHFEspectrum.cxx:3791
 AliHFEspectrum.cxx:3792
 AliHFEspectrum.cxx:3793
 AliHFEspectrum.cxx:3794
 AliHFEspectrum.cxx:3795
 AliHFEspectrum.cxx:3796
 AliHFEspectrum.cxx:3797
 AliHFEspectrum.cxx:3798
 AliHFEspectrum.cxx:3799
 AliHFEspectrum.cxx:3800
 AliHFEspectrum.cxx:3801
 AliHFEspectrum.cxx:3802
 AliHFEspectrum.cxx:3803
 AliHFEspectrum.cxx:3804
 AliHFEspectrum.cxx:3805
 AliHFEspectrum.cxx:3806
 AliHFEspectrum.cxx:3807
 AliHFEspectrum.cxx:3808
 AliHFEspectrum.cxx:3809
 AliHFEspectrum.cxx:3810
 AliHFEspectrum.cxx:3811
 AliHFEspectrum.cxx:3812
 AliHFEspectrum.cxx:3813
 AliHFEspectrum.cxx:3814
 AliHFEspectrum.cxx:3815
 AliHFEspectrum.cxx:3816
 AliHFEspectrum.cxx:3817
 AliHFEspectrum.cxx:3818
 AliHFEspectrum.cxx:3819
 AliHFEspectrum.cxx:3820
 AliHFEspectrum.cxx:3821
 AliHFEspectrum.cxx:3822
 AliHFEspectrum.cxx:3823
 AliHFEspectrum.cxx:3824
 AliHFEspectrum.cxx:3825
 AliHFEspectrum.cxx:3826
 AliHFEspectrum.cxx:3827
 AliHFEspectrum.cxx:3828
 AliHFEspectrum.cxx:3829
 AliHFEspectrum.cxx:3830
 AliHFEspectrum.cxx:3831
 AliHFEspectrum.cxx:3832
 AliHFEspectrum.cxx:3833
 AliHFEspectrum.cxx:3834
 AliHFEspectrum.cxx:3835
 AliHFEspectrum.cxx:3836
 AliHFEspectrum.cxx:3837
 AliHFEspectrum.cxx:3838
 AliHFEspectrum.cxx:3839
 AliHFEspectrum.cxx:3840
 AliHFEspectrum.cxx:3841
 AliHFEspectrum.cxx:3842
 AliHFEspectrum.cxx:3843
 AliHFEspectrum.cxx:3844
 AliHFEspectrum.cxx:3845
 AliHFEspectrum.cxx:3846
 AliHFEspectrum.cxx:3847
 AliHFEspectrum.cxx:3848
 AliHFEspectrum.cxx:3849
 AliHFEspectrum.cxx:3850
 AliHFEspectrum.cxx:3851
 AliHFEspectrum.cxx:3852
 AliHFEspectrum.cxx:3853
 AliHFEspectrum.cxx:3854
 AliHFEspectrum.cxx:3855
 AliHFEspectrum.cxx:3856
 AliHFEspectrum.cxx:3857
 AliHFEspectrum.cxx:3858
 AliHFEspectrum.cxx:3859
 AliHFEspectrum.cxx:3860
 AliHFEspectrum.cxx:3861
 AliHFEspectrum.cxx:3862
 AliHFEspectrum.cxx:3863
 AliHFEspectrum.cxx:3864
 AliHFEspectrum.cxx:3865
 AliHFEspectrum.cxx:3866
 AliHFEspectrum.cxx:3867
 AliHFEspectrum.cxx:3868
 AliHFEspectrum.cxx:3869
 AliHFEspectrum.cxx:3870
 AliHFEspectrum.cxx:3871
 AliHFEspectrum.cxx:3872
 AliHFEspectrum.cxx:3873
 AliHFEspectrum.cxx:3874
 AliHFEspectrum.cxx:3875
 AliHFEspectrum.cxx:3876
 AliHFEspectrum.cxx:3877
 AliHFEspectrum.cxx:3878
 AliHFEspectrum.cxx:3879
 AliHFEspectrum.cxx:3880
 AliHFEspectrum.cxx:3881
 AliHFEspectrum.cxx:3882
 AliHFEspectrum.cxx:3883
 AliHFEspectrum.cxx:3884
 AliHFEspectrum.cxx:3885
 AliHFEspectrum.cxx:3886
 AliHFEspectrum.cxx:3887
 AliHFEspectrum.cxx:3888
 AliHFEspectrum.cxx:3889
 AliHFEspectrum.cxx:3890
 AliHFEspectrum.cxx:3891
 AliHFEspectrum.cxx:3892
 AliHFEspectrum.cxx:3893
 AliHFEspectrum.cxx:3894
 AliHFEspectrum.cxx:3895
 AliHFEspectrum.cxx:3896
 AliHFEspectrum.cxx:3897
 AliHFEspectrum.cxx:3898
 AliHFEspectrum.cxx:3899
 AliHFEspectrum.cxx:3900
 AliHFEspectrum.cxx:3901
 AliHFEspectrum.cxx:3902
 AliHFEspectrum.cxx:3903
 AliHFEspectrum.cxx:3904
 AliHFEspectrum.cxx:3905
 AliHFEspectrum.cxx:3906
 AliHFEspectrum.cxx:3907
 AliHFEspectrum.cxx:3908
 AliHFEspectrum.cxx:3909
 AliHFEspectrum.cxx:3910
 AliHFEspectrum.cxx:3911
 AliHFEspectrum.cxx:3912
 AliHFEspectrum.cxx:3913
 AliHFEspectrum.cxx:3914
 AliHFEspectrum.cxx:3915
 AliHFEspectrum.cxx:3916
 AliHFEspectrum.cxx:3917
 AliHFEspectrum.cxx:3918
 AliHFEspectrum.cxx:3919
 AliHFEspectrum.cxx:3920
 AliHFEspectrum.cxx:3921
 AliHFEspectrum.cxx:3922
 AliHFEspectrum.cxx:3923
 AliHFEspectrum.cxx:3924
 AliHFEspectrum.cxx:3925