ROOT logo
//------------------------------------------------------------------------------
// Implementation of AliPerformanceDCA class. It keeps information from 
// comparison of reconstructed and MC particle tracks. In addtion, 
// it keeps selection cuts used during comparison. The comparison 
// information is stored in the ROOT histograms. Analysis of these 
// histograms can be done by using Analyse() class function. The result of 
// the analysis (histograms/graphs) are stored in the folder
// which is a data member of AliPerformanceDCA.
//  
// Author: J.Otwinowski 04/02/2008 
//------------------------------------------------------------------------------

/*
 
  // after running comparison task, read the file, and get component
  gROOT->LoadMacro("$ALICE_ROOT/PWGPP/Macros/LoadMyLibs.C");
  LoadMyLibs();
  TFile f("Output.root");
  AliPerformanceDCA * compObj = (AliPerformanceDCA*)coutput->FindObject("AliPerformanceDCA");

  // Analyse comparison data
  compObj->Analyse();

  // the output histograms/graphs will be stored in the folder "folderDCA" 
  compObj->GetAnalysisFolder()->ls("*");
 
  // user can save whole comparison object (or only folder with anlysed histograms) 
  // in the seperate output file (e.g.)
  TFile fout("Analysed_DCA.root","recreate");
  compObj->Write(); // compObj->GetAnalysisFolder()->Write();
  fout.Close();

*/

#include <TAxis.h>
#include <TCanvas.h>
#include <TGraph.h>
#include <TGraph2D.h>
#include <TH1.h>
#include <TH2.h>
#include <TH3.h>
#include <TF1.h>

#include "AliPerformanceDCA.h" 
#include "AliESDEvent.h"   
#include "AliESDVertex.h" 
#include "AliLog.h" 
#include "AliMathBase.h"
#include "AliRecInfoCuts.h" 
#include "AliMCInfoCuts.h" 
#include "AliStack.h" 
#include "AliMCEvent.h" 
#include "AliTracker.h"   
#include "AliHeader.h"   
#include "AliGenEventHeader.h"   

using namespace std;

ClassImp(AliPerformanceDCA)

//_____________________________________________________________________________
AliPerformanceDCA::AliPerformanceDCA(const Char_t* name, const Char_t* title,Int_t analysisMode, Bool_t hptGenerator):
  AliPerformanceObject(name,title),

  // DCA histograms
  fDCAHisto(0),

  // Cuts 
  fCutsRC(0), 
  fCutsMC(0),  

  // histogram folder 
  fAnalysisFolder(0)
{
  // named constructor	 

  SetAnalysisMode(analysisMode);
  SetHptGenerator(hptGenerator);
  Init();
}

//_____________________________________________________________________________
AliPerformanceDCA::~AliPerformanceDCA()
{
  // destructor
  if(fDCAHisto)  delete fDCAHisto; fDCAHisto=0; 
  if(fAnalysisFolder) delete fAnalysisFolder; fAnalysisFolder=0;
}

//_____________________________________________________________________________
void AliPerformanceDCA::Init()
{
  // DCA histograms

  // set pt bins
  Int_t nPtBins = 50;
  Double_t ptMin = 1.e-2, ptMax = 20.;

  Double_t *binsPt = 0;

  if (IsHptGenerator())  { 
        ptMax = 100.;
  } 
   binsPt = CreateLogAxis(nPtBins,ptMin,ptMax);

  /*
  Int_t nPtBins = 31;
   Double_t binsPt[32] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.7,0.8,0.9,1.0,1.2,1.4,1.6,1.8,2.0,2.25,2.5,2.75,3.,3.5,4.,5.,6.,8.,10.};
   Double_t ptMin = 0., ptMax = 10.;

   if(IsHptGenerator() == kTRUE) {
     nPtBins = 100;
     ptMin = 0.; ptMax = 100.;
   }
   */

   //dca_r, dca_z, eta, pt
   Int_t binsQA[5]    = {100,100,30,nPtBins,144};
   Double_t xminQA[5] = {-10.,-10.,-1.5,ptMin,0.};
   Double_t xmaxQA[5] = {10.,10.,1.5,ptMax,2*TMath::Pi()};

   fDCAHisto = new THnSparseF("fDCAHisto","dca_r:dca_z:eta:pt:phi",5,binsQA,xminQA,xmaxQA);
   fDCAHisto->SetBinEdges(3,binsPt);

   fDCAHisto->GetAxis(0)->SetTitle("dca_r (cm)");
   fDCAHisto->GetAxis(1)->SetTitle("dca_z (cm)");
   fDCAHisto->GetAxis(2)->SetTitle("#eta");
   fDCAHisto->GetAxis(3)->SetTitle("p_{T} (GeV/c)");
   fDCAHisto->GetAxis(4)->SetTitle("phi (rad)");
   fDCAHisto->Sumw2();

  // init cuts
  if(!fCutsMC) 
    AliDebug(AliLog::kError, "ERROR: Cannot find AliMCInfoCuts object");
  if(!fCutsRC) 
    AliDebug(AliLog::kError, "ERROR: Cannot find AliRecInfoCuts object");
 
  // init folder
  fAnalysisFolder = CreateFolder("folderDCA","Analysis DCA Folder");
}

//_____________________________________________________________________________
void AliPerformanceDCA::ProcessTPC(AliStack* const stack, AliESDtrack *const esdTrack, AliESDEvent* const esdEvent)
{
  // Fill DCA comparison information
  if(!esdEvent) return;
  if(!esdTrack) return;

  if( IsUseTrackVertex() ) 
  { 
    // Relate TPC inner params to prim. vertex
    const AliESDVertex *vtxESD = esdEvent->GetPrimaryVertexTracks();
    Double_t x[3]; esdTrack->GetXYZ(x);
    Double_t b[3]; AliTracker::GetBxByBz(x,b);
    Bool_t isOK = esdTrack->RelateToVertexTPCBxByBz(vtxESD, b, kVeryBig);
    if(!isOK) return;

    /*
      // JMT -- recaluclate DCA for HLT if not present
      if ( dca[0] == 0. && dca[1] == 0. ) {
        track->GetDZ( vtxESD->GetX(), vtxESD->GetY(), vtxESD->GetZ(), esdEvent->GetMagneticField(), dca );
      }
    */
  }

  // get TPC inner params at DCA to prim. vertex 
  const AliExternalTrackParam *track = esdTrack->GetTPCInnerParam();
  if(!track) return;

  // read from ESD track
  Float_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
  esdTrack->GetImpactParametersTPC(dca,cov);

  if (esdTrack->GetTPCNcls()<fCutsRC->GetMinNClustersTPC()) return; // min. nb. TPC clusters  
 
  Double_t vDCAHisto[5]={dca[0],dca[1],track->Eta(),track->Pt(),track->Phi()};
  fDCAHisto->Fill(vDCAHisto);

  //
  // Fill rec vs MC information
  //
  if(!stack) return;

}

//_____________________________________________________________________________
void AliPerformanceDCA::ProcessTPCITS(AliStack* const stack, AliESDtrack *const esdTrack, AliESDEvent* const esdEvent)
{
  // Fill DCA comparison information
  if(!esdTrack) return;
  if(!esdEvent) return;

  if( IsUseTrackVertex() ) 
  { 
    // Relate TPC inner params to prim. vertex
    const AliESDVertex *vtxESD = esdEvent->GetPrimaryVertexTracks();
    Double_t x[3]; esdTrack->GetXYZ(x);
    Double_t b[3]; AliTracker::GetBxByBz(x,b);
    Bool_t isOK = esdTrack->RelateToVertexBxByBz(vtxESD, b, kVeryBig);
    if(!isOK) return;

    /*
      // JMT -- recaluclate DCA for HLT if not present
      if ( dca[0] == 0. && dca[1] == 0. ) {
        track->GetDZ( vtxESD->GetX(), vtxESD->GetY(), vtxESD->GetZ(), esdEvent->GetMagneticField(), dca );
      }
    */
  }

  Float_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z
  esdTrack->GetImpactParameters(dca,cov);

  if ((esdTrack->GetStatus()&AliESDtrack::kTPCrefit)==0) return; // TPC refit
  if (esdTrack->GetTPCNcls()<fCutsRC->GetMinNClustersTPC()) return; // min. nb. TPC clusters  
  if(esdTrack->GetITSclusters(0)<fCutsRC->GetMinNClustersITS()) return;  // min. nb. ITS clusters

  Double_t vDCAHisto[5]={dca[0],dca[1],esdTrack->Eta(),esdTrack->Pt(), esdTrack->Phi()};
  fDCAHisto->Fill(vDCAHisto);

  //
  // Fill rec vs MC information
  //
  if(!stack) return;

}

void AliPerformanceDCA::ProcessConstrained(AliStack* const /*stack*/, AliESDtrack *const /*esdTrack*/)
{
  // Fill DCA comparison information
  
  AliDebug(AliLog::kWarning, "Warning: Not implemented");
}

//_____________________________________________________________________________
Long64_t AliPerformanceDCA::Merge(TCollection* const list) 
{
  // Merge list of objects (needed by PROOF)

  if (!list)
  return 0;

  if (list->IsEmpty())
  return 1;

  TIterator* iter = list->MakeIterator();
  TObject* obj = 0;

  // collection of generated histograms
  Int_t count=0;
  while((obj = iter->Next()) != 0) 
  {
    AliPerformanceDCA* entry = dynamic_cast<AliPerformanceDCA*>(obj);
    if (entry == 0) continue; 

    fDCAHisto->Add(entry->fDCAHisto);
    count++;
  }

return count;
}

//_____________________________________________________________________________
void AliPerformanceDCA::Exec(AliMCEvent* const mcEvent, AliESDEvent *const esdEvent, AliESDfriend *const esdFriend, const Bool_t bUseMC, const Bool_t bUseESDfriend)
{
  // Process comparison information 
  //
  if(!esdEvent) 
  {
    Error("Exec","esdEvent not available");
    return;
  }
  AliHeader* header = 0;
  AliGenEventHeader* genHeader = 0;
  AliStack* stack = 0;
  TArrayF vtxMC(3);
  
  if(bUseMC)
  {
    if(!mcEvent) {
      Error("Exec","mcEvent not available");
      return;
    }
    // get MC event header
    header = mcEvent->Header();
    if (!header) {
      Error("Exec","Header not available");
      return;
    }
    // MC particle stack
    stack = mcEvent->Stack();
    if (!stack) {
      Error("Exec","Stack not available");
      return;
    }
    // get MC vertex
    genHeader = header->GenEventHeader();
    if (!genHeader) {
      Error("Exec","Could not retrieve genHeader from Header");
      return;
    }
    genHeader->PrimaryVertex(vtxMC);
  } 
  
  // use ESD friends
  if(bUseESDfriend) {
    if(!esdFriend) {
      Error("Exec","esdFriend not available");
      return;
    }
  }

  // trigger
  if(!bUseMC &&GetTriggerClass()) {
    Bool_t isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());
    if(!isEventTriggered) return; 
  }

  // get event vertex
  const AliESDVertex *vtxESD = NULL;
  if( IsUseTrackVertex() ) 
  { 
    // track vertex
    vtxESD = esdEvent->GetPrimaryVertexTracks();
  }
  else {
    // TPC track vertex
    vtxESD = esdEvent->GetPrimaryVertexTPC();
  }
  if(vtxESD && (vtxESD->GetStatus()<=0)) return;

  //  Process events
  for (Int_t iTrack = 0; iTrack < esdEvent->GetNumberOfTracks(); iTrack++) 
  { 
    AliESDtrack *track = esdEvent->GetTrack(iTrack);
    if(!track) continue;

    if(GetAnalysisMode() == 0) ProcessTPC(stack,track,esdEvent);
    else if(GetAnalysisMode() == 1) ProcessTPCITS(stack,track,esdEvent);
    else if(GetAnalysisMode() == 2) ProcessConstrained(stack,track);
    else {
      printf("ERROR: AnalysisMode %d \n",fAnalysisMode);
      return;
    }
  }
}

//_____________________________________________________________________________
void AliPerformanceDCA::Analyse()
{
  //
  // Analyse comparison information and store output histograms
  // in the analysis folder "folderDCA" 
  //
  
  TH1::AddDirectory(kFALSE);
  TH1F *h1D=0;
  TH2F *h2D=0;
  TObjArray *aFolderObj = new TObjArray;
  if(!aFolderObj) return;
  char title[256];
  TObjArray *arr[6] = {0};
  TF1 *f1[6] = {0};



  // set pt measurable range 
  //fDCAHisto->GetAxis(3)->SetRangeUser(0.10,10.);

  //
  h2D = (TH2F*)fDCAHisto->Projection(0,1); // inverse projection convention
  h2D->SetName("dca_r_vs_dca_z");
  h2D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(1)->GetTitle());
  h2D->GetYaxis()->SetTitle(fDCAHisto->GetAxis(0)->GetTitle());
  snprintf(title,256,"%s vs %s",fDCAHisto->GetAxis(0)->GetTitle(),fDCAHisto->GetAxis(1)->GetTitle());
  h2D->SetTitle(title);
  aFolderObj->Add(h2D);

  //
  h2D = (TH2F*)fDCAHisto->Projection(0,2);
  h2D->SetName("dca_r_vs_eta");
  h2D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(2)->GetTitle());
  h2D->GetYaxis()->SetTitle(fDCAHisto->GetAxis(0)->GetTitle());
  snprintf(title,256,"%s vs %s",fDCAHisto->GetAxis(2)->GetTitle(),fDCAHisto->GetAxis(0)->GetTitle());
  h2D->SetTitle(title);
  aFolderObj->Add(h2D);

  //
  // mean and rms
  //
  h1D = MakeStat1D(h2D,0,0);
  h1D->SetName("mean_dca_r_vs_eta");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(2)->GetTitle());
  h1D->GetYaxis()->SetTitle("mean_dca_r (cm)");
  snprintf(title,256," mean_dca_r (cm) vs %s",fDCAHisto->GetAxis(2)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  h1D = MakeStat1D(h2D,0,1);
  h1D->SetName("rms_dca_r_vs_eta");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(2)->GetTitle());
  h1D->GetYaxis()->SetTitle("rms_dca_r (cm)");
  snprintf(title,256," rms_dca_r (cm) vs %s",fDCAHisto->GetAxis(2)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  //
  // fit mean and sigma
  //

  arr[0] = new TObjArray();
  f1[0] = new TF1("gaus","gaus");
  h2D->FitSlicesY(f1[0],0,-1,0,"QNR",arr[0]);

  h1D = (TH1F*)arr[0]->At(1);
  h1D->SetName("fit_mean_dca_r_vs_eta");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(2)->GetTitle());
  h1D->GetYaxis()->SetTitle("fit_mean_dca_r (cm)");
  snprintf(title,256," fit_mean_dca_r (cm) vs %s",fDCAHisto->GetAxis(2)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  h1D = (TH1F*)arr[0]->At(2);
  h1D->SetName("res_dca_r_vs_eta");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(2)->GetTitle());
  h1D->GetYaxis()->SetTitle("res_dca_r (cm)");
  snprintf(title,256," res_dca_r (cm) vs %s",fDCAHisto->GetAxis(2)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  //
  // 
  //
  h2D = (TH2F*)fDCAHisto->Projection(0,3);
  h2D->SetName("dca_r_vs_pt");
  h2D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(3)->GetTitle());
  h2D->GetYaxis()->SetTitle(fDCAHisto->GetAxis(0)->GetTitle());
  snprintf(title,256,"%s vs %s",fDCAHisto->GetAxis(0)->GetTitle(),fDCAHisto->GetAxis(3)->GetTitle());
  h2D->SetTitle(title);
  h2D->SetBit(TH1::kLogX);
  aFolderObj->Add(h2D);

  h1D = MakeStat1D(h2D,0,0);
  h1D->SetName("mean_dca_r_vs_pt");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(3)->GetTitle());
  h1D->GetYaxis()->SetTitle("mean_dca_r (cm)");
  snprintf(title,256,"mean_dca_r (cm) vs %s",fDCAHisto->GetAxis(3)->GetTitle());
  h1D->SetTitle(title);
  h1D->SetBit(TH1::kLogX);
  aFolderObj->Add(h1D);

  h1D = MakeStat1D(h2D,0,1);
  h1D->SetName("rms_dca_r_vs_pt");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(3)->GetTitle());
  h1D->GetYaxis()->SetTitle("rms_dca_r (cm)");
  snprintf(title,256,"rms_dca_r (cm) vs %s",fDCAHisto->GetAxis(3)->GetTitle());
  h1D->SetTitle(title);
  h1D->SetBit(TH1::kLogX);
  aFolderObj->Add(h1D);
   
  //
  // fit mean and sigma
  //

  arr[1] = new TObjArray();
  f1[1] = new TF1("gaus","gaus");
  h2D->FitSlicesY(f1[1],0,-1,0,"QNR",arr[1]);

  h1D = (TH1F*)arr[1]->At(1);
  h1D->SetName("fit_mean_dca_r_vs_pt");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(3)->GetTitle());
  h1D->GetYaxis()->SetTitle("fit_mean_dca_r (cm)");
  snprintf(title,256,"fit_mean_dca_r (cm) vs %s",fDCAHisto->GetAxis(3)->GetTitle());
  h1D->SetTitle(title);
  h1D->SetBit(TH1::kLogX);
  aFolderObj->Add(h1D);

  h1D = (TH1F*)arr[1]->At(2);
  h1D->SetName("res_dca_r_vs_pt");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(3)->GetTitle());
  h1D->GetYaxis()->SetTitle("res_dca_r (cm)");
  snprintf(title,256,"res_dca_r (cm) vs %s",fDCAHisto->GetAxis(3)->GetTitle());
  h1D->SetTitle(title);
  h1D->SetBit(TH1::kLogX);
  aFolderObj->Add(h1D);

  // 
  h2D = (TH2F*)fDCAHisto->Projection(1,2);
  h2D->SetName("dca_z_vs_eta");
  h2D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(2)->GetTitle());
  h2D->GetYaxis()->SetTitle(fDCAHisto->GetAxis(1)->GetTitle());
  snprintf(title,256,"%s vs %s",fDCAHisto->GetAxis(1)->GetTitle(),fDCAHisto->GetAxis(2)->GetTitle());
  h2D->SetTitle(title);
  aFolderObj->Add(h2D);

  h1D = MakeStat1D(h2D,0,0);
  h1D->SetName("mean_dca_z_vs_eta");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(2)->GetTitle());
  h1D->GetYaxis()->SetTitle("mean_dca_z (cm)");
  snprintf(title,256,"mean_dca_z (cm) vs %s",fDCAHisto->GetAxis(2)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  h1D = MakeStat1D(h2D,0,1);
  h1D->SetName("rms_dca_z_vs_eta");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(2)->GetTitle());
  h1D->GetYaxis()->SetTitle("rms_dca_z (cm)");
  snprintf(title,256,"rms_dca_z (cm) vs %s",fDCAHisto->GetAxis(2)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  //
  // fit mean and sigma
  //
  arr[2] = new TObjArray();
  f1[2] = new TF1("gaus","gaus");
  h2D->FitSlicesY(f1[2],0,-1,0,"QNR",arr[2]);

  h1D = (TH1F*)arr[2]->At(1);
  h1D->SetName("fit_mean_dca_z_vs_eta");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(2)->GetTitle());
  h1D->GetYaxis()->SetTitle("fit_mean_dca_z (cm)");
  snprintf(title,256,"fit_mean_dca_z (cm) vs %s",fDCAHisto->GetAxis(2)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  h1D = (TH1F*)arr[2]->At(2);
  h1D->SetName("res_dca_z_vs_eta");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(2)->GetTitle());
  h1D->GetYaxis()->SetTitle("res_dca_z (cm)");
  snprintf(title,256,"res_dca_z (cm) vs %s",fDCAHisto->GetAxis(2)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  //
  h2D = (TH2F*)fDCAHisto->Projection(1,3);
  h2D->SetName("dca_z_vs_pt");
  h2D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(3)->GetTitle());
  h2D->GetYaxis()->SetTitle(fDCAHisto->GetAxis(1)->GetTitle());
  snprintf(title,256,"%s vs %s",fDCAHisto->GetAxis(1)->GetTitle(),fDCAHisto->GetAxis(3)->GetTitle());
  h2D->SetTitle(title);
  h2D->SetBit(TH1::kLogX);
  aFolderObj->Add(h2D);

  h1D = MakeStat1D(h2D,0,0);
  h1D->SetName("mean_dca_z_vs_pt");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(3)->GetTitle());
  h1D->GetYaxis()->SetTitle("mean_dca_z (cm)");
  snprintf(title,256,"mean_dca_z (cm) vs %s",fDCAHisto->GetAxis(3)->GetTitle());
  h1D->SetTitle(title);
  h1D->SetBit(TH1::kLogX);
  aFolderObj->Add(h1D);

  h1D = MakeStat1D(h2D,0,1);
  h1D->SetName("rms_dca_z_vs_pt");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(3)->GetTitle());
  h1D->GetYaxis()->SetTitle("rms_dca_z (cm)");
  snprintf(title,256,"rms_dca_z (cm) vs %s",fDCAHisto->GetAxis(3)->GetTitle());
  h1D->SetTitle(title);
  h1D->SetBit(TH1::kLogX);
  aFolderObj->Add(h1D);
   
  //
  // fit mean and sigma
  //

  arr[3] = new TObjArray();
  f1[3] = new TF1("gaus","gaus");
  h2D->FitSlicesY(f1[3],0,-1,0,"QNR",arr[3]);

  h1D = (TH1F*)arr[3]->At(1);
  h1D->SetName("fit_mean_dca_z_vs_pt");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(3)->GetTitle());
  h1D->GetYaxis()->SetTitle("fit_mean_dca_z (cm)");
  snprintf(title,256,"fit_mean_dca_z (cm) vs %s",fDCAHisto->GetAxis(3)->GetTitle());
  h1D->SetTitle(title);
  h1D->SetBit(TH1::kLogX);
  aFolderObj->Add(h1D);

  h1D = (TH1F*)arr[3]->At(2);
  h1D->SetName("res_dca_z_vs_pt");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(3)->GetTitle());
  h1D->GetYaxis()->SetTitle("res_dca_z (cm)");
  snprintf(title,256,"res_dca_z (cm) vs %s",fDCAHisto->GetAxis(3)->GetTitle());
  h1D->SetTitle(title);
  h1D->SetBit(TH1::kLogX);
  aFolderObj->Add(h1D);

  // A - side
  fDCAHisto->GetAxis(2)->SetRangeUser(-1.5,0.0);

  h2D = (TH2F*)fDCAHisto->Projection(1,4);
  h2D->SetName("dca_z_vs_phi_Aside");
  h2D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(4)->GetTitle());
  h2D->GetYaxis()->SetTitle(fDCAHisto->GetAxis(1)->GetTitle());
  snprintf(title,256,"%s vs %s (A-side)",fDCAHisto->GetAxis(1)->GetTitle(),fDCAHisto->GetAxis(4)->GetTitle());
  h2D->SetTitle(title);
  aFolderObj->Add(h2D);

  h1D = MakeStat1D(h2D,0,0);
  h1D->SetName("mean_dca_z_vs_phi_Aside");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(4)->GetTitle());
  h1D->GetYaxis()->SetTitle("mean_dca_z (cm)");
  snprintf(title,256,"mean_dca_z (cm) vs %s (A-side)",fDCAHisto->GetAxis(4)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  h1D = MakeStat1D(h2D,0,1);
  h1D->SetName("rms_dca_z_vs_phi_Aside");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(4)->GetTitle());
  h1D->GetYaxis()->SetTitle("rms_dca_z (cm)");
  snprintf(title,256,"rms_dca_z (cm) vs %s (A-side)",fDCAHisto->GetAxis(4)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);
 
  //
  // fit mean and sigma
  //
  arr[4] = new TObjArray();
  f1[4] = new TF1("gaus","gaus");
  h2D->FitSlicesY(f1[4],0,-1,0,"QNR",arr[4]);

  h1D = (TH1F*)arr[4]->At(1);
  h1D->SetName("fit_mean_dca_z_vs_phi_Aside");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(4)->GetTitle());
  h1D->GetYaxis()->SetTitle("fit_mean_dca_z (cm)");
  snprintf(title,256,"fit_mean_dca_z (cm) vs %s (A-side)",fDCAHisto->GetAxis(4)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  h1D = (TH1F*)arr[4]->At(2);
  h1D->SetName("res_dca_z_vs_phi_Aside");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(4)->GetTitle());
  h1D->GetYaxis()->SetTitle("res_dca_z (cm)");
  snprintf(title,256,"res_dca_z (cm) vs %s (A-side)",fDCAHisto->GetAxis(4)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);
 

  // C - side
  fDCAHisto->GetAxis(2)->SetRangeUser(0.0,1.5);

  h2D = (TH2F*)fDCAHisto->Projection(1,4);
  h2D->SetName("dca_z_vs_phi_Cside");
  h2D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(4)->GetTitle());
  h2D->GetYaxis()->SetTitle(fDCAHisto->GetAxis(1)->GetTitle());
  snprintf(title,256,"%s vs %s (C-side)",fDCAHisto->GetAxis(1)->GetTitle(),fDCAHisto->GetAxis(4)->GetTitle());
  h2D->SetTitle(title);
  aFolderObj->Add(h2D);

  h1D = MakeStat1D(h2D,0,0);
  h1D->SetName("mean_dca_z_vs_phi_Cside");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(4)->GetTitle());
  h1D->GetYaxis()->SetTitle("mean_dca_z (cm)");
  snprintf(title,256,"mean_dca_z (cm) vs %s (C-side)",fDCAHisto->GetAxis(4)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  h1D = MakeStat1D(h2D,0,1);
  h1D->SetName("rms_dca_z_vs_phi_Cside");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(4)->GetTitle());
  h1D->GetYaxis()->SetTitle("rms_dca_z (cm)");
  snprintf(title,256,"rms_dca_z (cm) vs %s (C-side)",fDCAHisto->GetAxis(4)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  //
  // fit mean and sigma
  //
  arr[5] = new TObjArray();
  f1[5] = new TF1("gaus","gaus");
  h2D->FitSlicesY(f1[5],0,-1,0,"QNR",arr[5]);

  h1D = (TH1F*)arr[5]->At(1);
  h1D->SetName("fit_mean_dca_z_vs_phi_Cside");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(4)->GetTitle());
  h1D->GetYaxis()->SetTitle("fit_mean_dca_z (cm)");
  snprintf(title,256,"fit_mean_dca_z (cm) vs %s (C-side)",fDCAHisto->GetAxis(4)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);

  h1D = (TH1F*)arr[5]->At(2);
  h1D->SetName("res_dca_z_vs_phi_Cside");
  h1D->GetXaxis()->SetTitle(fDCAHisto->GetAxis(4)->GetTitle());
  h1D->GetYaxis()->SetTitle("res_dca_z (cm)");
  snprintf(title,256,"res_dca_z (cm) vs %s (C-side)",fDCAHisto->GetAxis(4)->GetTitle());
  h1D->SetTitle(title);
  aFolderObj->Add(h1D);
 
  // export objects to analysis folder
  fAnalysisFolder = ExportToFolder(aFolderObj);

  // delete only TObjArray
  if(aFolderObj) delete aFolderObj;
}

//_____________________________________________________________________________
TH1F* AliPerformanceDCA::MakeStat1D(TH2 *hist, Int_t delta0, Int_t type) 
{
  // Return TH1F histogram 
  // delta - number of bins to integrate
  // with mean (type == 0) or RMS (type==1) 

  char hname[256];
  const char* suffix = "_stat1d";
  snprintf(hname,256,"%s%s",hist->GetName(),suffix);
  TAxis* xaxis = hist->GetXaxis();
  Int_t  nbinx = xaxis->GetNbins();

  TH1F *hnew = (TH1F*)hist->ProjectionX()->Clone();
  hnew->SetName(hname);

  char name[256];
  for (Int_t ix=0; ix<=nbinx;ix++) {
    snprintf(name,256,"%s_%d",hist->GetName(),ix);
    TH1 *projection = hist->ProjectionY(name,ix-delta0,ix+delta0);

    Float_t stat= 0., stat_err =0.;
    if (type==0) { stat = projection->GetMean(); stat_err = projection->GetMeanError(); } 
    if (type==1) { stat = projection->GetRMS(); stat_err = projection->GetRMSError(); }
 
    hnew->SetBinContent(ix, stat);
    hnew->SetBinError(ix, stat_err);
  }
  
return hnew;
}

//_____________________________________________________________________________
TH2F* AliPerformanceDCA::MakeStat2D(TH3 *hist, Int_t delta0, Int_t delta1, Int_t type) 
{
  // Return TH1F histogram 
  // delta0 - number of bins to integrate in x
  // delta1 - number of bins to integrate in y
  // with mean (type==0) or RMS (type==1) 

  char hname[256];
  const char* suffix = "_stat2d";
  snprintf(hname,256,"%s%s",hist->GetName(),suffix);

  TAxis* xaxis = hist->GetXaxis();
  Int_t  nbinx = xaxis->GetNbins(); 

  TH2F *hnew = (TH2F*)hist->Project3D("yx")->Clone();
  hnew->SetName(hname);

  TAxis* yaxis = hist->GetYaxis();
  Int_t  nbiny = yaxis->GetNbins(); 

  char name[256];
  for (Int_t ix=0; ix<=nbinx;ix++) {
    for (Int_t iy=0; iy<=nbiny;iy++) {
      snprintf(name,256,"%s_%d_%d",hist->GetName(),ix,iy);
      TH1 *projection = hist->ProjectionZ(name,ix-delta0,ix+delta0,iy-delta1,iy+delta1);

      Float_t stat= 0., stat_err =0.;
      if (type==0) { stat = projection->GetMean(); stat_err = projection->GetMeanError(); } 
      if (type==1) { stat = projection->GetRMS(); stat_err = projection->GetRMSError(); }
     
      hnew->SetBinContent(ix,iy,stat);
      hnew->SetBinError(ix,iy,stat_err);
    }
  }
  
return hnew;
}

//_____________________________________________________________________________
TFolder* AliPerformanceDCA::ExportToFolder(TObjArray * array) 
{
  // recreate folder avery time and export objects to new one
  //
  AliPerformanceDCA * comp=this;
  TFolder *folder = comp->GetAnalysisFolder();

  TString name, title;
  TFolder *newFolder = 0;
  Int_t i = 0;
  Int_t size = array->GetSize();

  if(folder) { 
     // get name and title from old folder
     name = folder->GetName();  
     title = folder->GetTitle();  

	 // delete old one
     delete folder;

	 // create new one
     newFolder = CreateFolder(name.Data(),title.Data());
     newFolder->SetOwner();

	 // add objects to folder
     while(i < size) {
	   newFolder->Add(array->At(i));
	   i++;
	 }
  }

return newFolder;
}

//_____________________________________________________________________________
TFolder* AliPerformanceDCA::CreateFolder(TString name,TString title) { 
// create folder for analysed histograms
TFolder *folder = 0;
  folder = new TFolder(name.Data(),title.Data());

  return folder;
}
 AliPerformanceDCA.cxx:1
 AliPerformanceDCA.cxx:2
 AliPerformanceDCA.cxx:3
 AliPerformanceDCA.cxx:4
 AliPerformanceDCA.cxx:5
 AliPerformanceDCA.cxx:6
 AliPerformanceDCA.cxx:7
 AliPerformanceDCA.cxx:8
 AliPerformanceDCA.cxx:9
 AliPerformanceDCA.cxx:10
 AliPerformanceDCA.cxx:11
 AliPerformanceDCA.cxx:12
 AliPerformanceDCA.cxx:13
 AliPerformanceDCA.cxx:14
 AliPerformanceDCA.cxx:15
 AliPerformanceDCA.cxx:16
 AliPerformanceDCA.cxx:17
 AliPerformanceDCA.cxx:18
 AliPerformanceDCA.cxx:19
 AliPerformanceDCA.cxx:20
 AliPerformanceDCA.cxx:21
 AliPerformanceDCA.cxx:22
 AliPerformanceDCA.cxx:23
 AliPerformanceDCA.cxx:24
 AliPerformanceDCA.cxx:25
 AliPerformanceDCA.cxx:26
 AliPerformanceDCA.cxx:27
 AliPerformanceDCA.cxx:28
 AliPerformanceDCA.cxx:29
 AliPerformanceDCA.cxx:30
 AliPerformanceDCA.cxx:31
 AliPerformanceDCA.cxx:32
 AliPerformanceDCA.cxx:33
 AliPerformanceDCA.cxx:34
 AliPerformanceDCA.cxx:35
 AliPerformanceDCA.cxx:36
 AliPerformanceDCA.cxx:37
 AliPerformanceDCA.cxx:38
 AliPerformanceDCA.cxx:39
 AliPerformanceDCA.cxx:40
 AliPerformanceDCA.cxx:41
 AliPerformanceDCA.cxx:42
 AliPerformanceDCA.cxx:43
 AliPerformanceDCA.cxx:44
 AliPerformanceDCA.cxx:45
 AliPerformanceDCA.cxx:46
 AliPerformanceDCA.cxx:47
 AliPerformanceDCA.cxx:48
 AliPerformanceDCA.cxx:49
 AliPerformanceDCA.cxx:50
 AliPerformanceDCA.cxx:51
 AliPerformanceDCA.cxx:52
 AliPerformanceDCA.cxx:53
 AliPerformanceDCA.cxx:54
 AliPerformanceDCA.cxx:55
 AliPerformanceDCA.cxx:56
 AliPerformanceDCA.cxx:57
 AliPerformanceDCA.cxx:58
 AliPerformanceDCA.cxx:59
 AliPerformanceDCA.cxx:60
 AliPerformanceDCA.cxx:61
 AliPerformanceDCA.cxx:62
 AliPerformanceDCA.cxx:63
 AliPerformanceDCA.cxx:64
 AliPerformanceDCA.cxx:65
 AliPerformanceDCA.cxx:66
 AliPerformanceDCA.cxx:67
 AliPerformanceDCA.cxx:68
 AliPerformanceDCA.cxx:69
 AliPerformanceDCA.cxx:70
 AliPerformanceDCA.cxx:71
 AliPerformanceDCA.cxx:72
 AliPerformanceDCA.cxx:73
 AliPerformanceDCA.cxx:74
 AliPerformanceDCA.cxx:75
 AliPerformanceDCA.cxx:76
 AliPerformanceDCA.cxx:77
 AliPerformanceDCA.cxx:78
 AliPerformanceDCA.cxx:79
 AliPerformanceDCA.cxx:80
 AliPerformanceDCA.cxx:81
 AliPerformanceDCA.cxx:82
 AliPerformanceDCA.cxx:83
 AliPerformanceDCA.cxx:84
 AliPerformanceDCA.cxx:85
 AliPerformanceDCA.cxx:86
 AliPerformanceDCA.cxx:87
 AliPerformanceDCA.cxx:88
 AliPerformanceDCA.cxx:89
 AliPerformanceDCA.cxx:90
 AliPerformanceDCA.cxx:91
 AliPerformanceDCA.cxx:92
 AliPerformanceDCA.cxx:93
 AliPerformanceDCA.cxx:94
 AliPerformanceDCA.cxx:95
 AliPerformanceDCA.cxx:96
 AliPerformanceDCA.cxx:97
 AliPerformanceDCA.cxx:98
 AliPerformanceDCA.cxx:99
 AliPerformanceDCA.cxx:100
 AliPerformanceDCA.cxx:101
 AliPerformanceDCA.cxx:102
 AliPerformanceDCA.cxx:103
 AliPerformanceDCA.cxx:104
 AliPerformanceDCA.cxx:105
 AliPerformanceDCA.cxx:106
 AliPerformanceDCA.cxx:107
 AliPerformanceDCA.cxx:108
 AliPerformanceDCA.cxx:109
 AliPerformanceDCA.cxx:110
 AliPerformanceDCA.cxx:111
 AliPerformanceDCA.cxx:112
 AliPerformanceDCA.cxx:113
 AliPerformanceDCA.cxx:114
 AliPerformanceDCA.cxx:115
 AliPerformanceDCA.cxx:116
 AliPerformanceDCA.cxx:117
 AliPerformanceDCA.cxx:118
 AliPerformanceDCA.cxx:119
 AliPerformanceDCA.cxx:120
 AliPerformanceDCA.cxx:121
 AliPerformanceDCA.cxx:122
 AliPerformanceDCA.cxx:123
 AliPerformanceDCA.cxx:124
 AliPerformanceDCA.cxx:125
 AliPerformanceDCA.cxx:126
 AliPerformanceDCA.cxx:127
 AliPerformanceDCA.cxx:128
 AliPerformanceDCA.cxx:129
 AliPerformanceDCA.cxx:130
 AliPerformanceDCA.cxx:131
 AliPerformanceDCA.cxx:132
 AliPerformanceDCA.cxx:133
 AliPerformanceDCA.cxx:134
 AliPerformanceDCA.cxx:135
 AliPerformanceDCA.cxx:136
 AliPerformanceDCA.cxx:137
 AliPerformanceDCA.cxx:138
 AliPerformanceDCA.cxx:139
 AliPerformanceDCA.cxx:140
 AliPerformanceDCA.cxx:141
 AliPerformanceDCA.cxx:142
 AliPerformanceDCA.cxx:143
 AliPerformanceDCA.cxx:144
 AliPerformanceDCA.cxx:145
 AliPerformanceDCA.cxx:146
 AliPerformanceDCA.cxx:147
 AliPerformanceDCA.cxx:148
 AliPerformanceDCA.cxx:149
 AliPerformanceDCA.cxx:150
 AliPerformanceDCA.cxx:151
 AliPerformanceDCA.cxx:152
 AliPerformanceDCA.cxx:153
 AliPerformanceDCA.cxx:154
 AliPerformanceDCA.cxx:155
 AliPerformanceDCA.cxx:156
 AliPerformanceDCA.cxx:157
 AliPerformanceDCA.cxx:158
 AliPerformanceDCA.cxx:159
 AliPerformanceDCA.cxx:160
 AliPerformanceDCA.cxx:161
 AliPerformanceDCA.cxx:162
 AliPerformanceDCA.cxx:163
 AliPerformanceDCA.cxx:164
 AliPerformanceDCA.cxx:165
 AliPerformanceDCA.cxx:166
 AliPerformanceDCA.cxx:167
 AliPerformanceDCA.cxx:168
 AliPerformanceDCA.cxx:169
 AliPerformanceDCA.cxx:170
 AliPerformanceDCA.cxx:171
 AliPerformanceDCA.cxx:172
 AliPerformanceDCA.cxx:173
 AliPerformanceDCA.cxx:174
 AliPerformanceDCA.cxx:175
 AliPerformanceDCA.cxx:176
 AliPerformanceDCA.cxx:177
 AliPerformanceDCA.cxx:178
 AliPerformanceDCA.cxx:179
 AliPerformanceDCA.cxx:180
 AliPerformanceDCA.cxx:181
 AliPerformanceDCA.cxx:182
 AliPerformanceDCA.cxx:183
 AliPerformanceDCA.cxx:184
 AliPerformanceDCA.cxx:185
 AliPerformanceDCA.cxx:186
 AliPerformanceDCA.cxx:187
 AliPerformanceDCA.cxx:188
 AliPerformanceDCA.cxx:189
 AliPerformanceDCA.cxx:190
 AliPerformanceDCA.cxx:191
 AliPerformanceDCA.cxx:192
 AliPerformanceDCA.cxx:193
 AliPerformanceDCA.cxx:194
 AliPerformanceDCA.cxx:195
 AliPerformanceDCA.cxx:196
 AliPerformanceDCA.cxx:197
 AliPerformanceDCA.cxx:198
 AliPerformanceDCA.cxx:199
 AliPerformanceDCA.cxx:200
 AliPerformanceDCA.cxx:201
 AliPerformanceDCA.cxx:202
 AliPerformanceDCA.cxx:203
 AliPerformanceDCA.cxx:204
 AliPerformanceDCA.cxx:205
 AliPerformanceDCA.cxx:206
 AliPerformanceDCA.cxx:207
 AliPerformanceDCA.cxx:208
 AliPerformanceDCA.cxx:209
 AliPerformanceDCA.cxx:210
 AliPerformanceDCA.cxx:211
 AliPerformanceDCA.cxx:212
 AliPerformanceDCA.cxx:213
 AliPerformanceDCA.cxx:214
 AliPerformanceDCA.cxx:215
 AliPerformanceDCA.cxx:216
 AliPerformanceDCA.cxx:217
 AliPerformanceDCA.cxx:218
 AliPerformanceDCA.cxx:219
 AliPerformanceDCA.cxx:220
 AliPerformanceDCA.cxx:221
 AliPerformanceDCA.cxx:222
 AliPerformanceDCA.cxx:223
 AliPerformanceDCA.cxx:224
 AliPerformanceDCA.cxx:225
 AliPerformanceDCA.cxx:226
 AliPerformanceDCA.cxx:227
 AliPerformanceDCA.cxx:228
 AliPerformanceDCA.cxx:229
 AliPerformanceDCA.cxx:230
 AliPerformanceDCA.cxx:231
 AliPerformanceDCA.cxx:232
 AliPerformanceDCA.cxx:233
 AliPerformanceDCA.cxx:234
 AliPerformanceDCA.cxx:235
 AliPerformanceDCA.cxx:236
 AliPerformanceDCA.cxx:237
 AliPerformanceDCA.cxx:238
 AliPerformanceDCA.cxx:239
 AliPerformanceDCA.cxx:240
 AliPerformanceDCA.cxx:241
 AliPerformanceDCA.cxx:242
 AliPerformanceDCA.cxx:243
 AliPerformanceDCA.cxx:244
 AliPerformanceDCA.cxx:245
 AliPerformanceDCA.cxx:246
 AliPerformanceDCA.cxx:247
 AliPerformanceDCA.cxx:248
 AliPerformanceDCA.cxx:249
 AliPerformanceDCA.cxx:250
 AliPerformanceDCA.cxx:251
 AliPerformanceDCA.cxx:252
 AliPerformanceDCA.cxx:253
 AliPerformanceDCA.cxx:254
 AliPerformanceDCA.cxx:255
 AliPerformanceDCA.cxx:256
 AliPerformanceDCA.cxx:257
 AliPerformanceDCA.cxx:258
 AliPerformanceDCA.cxx:259
 AliPerformanceDCA.cxx:260
 AliPerformanceDCA.cxx:261
 AliPerformanceDCA.cxx:262
 AliPerformanceDCA.cxx:263
 AliPerformanceDCA.cxx:264
 AliPerformanceDCA.cxx:265
 AliPerformanceDCA.cxx:266
 AliPerformanceDCA.cxx:267
 AliPerformanceDCA.cxx:268
 AliPerformanceDCA.cxx:269
 AliPerformanceDCA.cxx:270
 AliPerformanceDCA.cxx:271
 AliPerformanceDCA.cxx:272
 AliPerformanceDCA.cxx:273
 AliPerformanceDCA.cxx:274
 AliPerformanceDCA.cxx:275
 AliPerformanceDCA.cxx:276
 AliPerformanceDCA.cxx:277
 AliPerformanceDCA.cxx:278
 AliPerformanceDCA.cxx:279
 AliPerformanceDCA.cxx:280
 AliPerformanceDCA.cxx:281
 AliPerformanceDCA.cxx:282
 AliPerformanceDCA.cxx:283
 AliPerformanceDCA.cxx:284
 AliPerformanceDCA.cxx:285
 AliPerformanceDCA.cxx:286
 AliPerformanceDCA.cxx:287
 AliPerformanceDCA.cxx:288
 AliPerformanceDCA.cxx:289
 AliPerformanceDCA.cxx:290
 AliPerformanceDCA.cxx:291
 AliPerformanceDCA.cxx:292
 AliPerformanceDCA.cxx:293
 AliPerformanceDCA.cxx:294
 AliPerformanceDCA.cxx:295
 AliPerformanceDCA.cxx:296
 AliPerformanceDCA.cxx:297
 AliPerformanceDCA.cxx:298
 AliPerformanceDCA.cxx:299
 AliPerformanceDCA.cxx:300
 AliPerformanceDCA.cxx:301
 AliPerformanceDCA.cxx:302
 AliPerformanceDCA.cxx:303
 AliPerformanceDCA.cxx:304
 AliPerformanceDCA.cxx:305
 AliPerformanceDCA.cxx:306
 AliPerformanceDCA.cxx:307
 AliPerformanceDCA.cxx:308
 AliPerformanceDCA.cxx:309
 AliPerformanceDCA.cxx:310
 AliPerformanceDCA.cxx:311
 AliPerformanceDCA.cxx:312
 AliPerformanceDCA.cxx:313
 AliPerformanceDCA.cxx:314
 AliPerformanceDCA.cxx:315
 AliPerformanceDCA.cxx:316
 AliPerformanceDCA.cxx:317
 AliPerformanceDCA.cxx:318
 AliPerformanceDCA.cxx:319
 AliPerformanceDCA.cxx:320
 AliPerformanceDCA.cxx:321
 AliPerformanceDCA.cxx:322
 AliPerformanceDCA.cxx:323
 AliPerformanceDCA.cxx:324
 AliPerformanceDCA.cxx:325
 AliPerformanceDCA.cxx:326
 AliPerformanceDCA.cxx:327
 AliPerformanceDCA.cxx:328
 AliPerformanceDCA.cxx:329
 AliPerformanceDCA.cxx:330
 AliPerformanceDCA.cxx:331
 AliPerformanceDCA.cxx:332
 AliPerformanceDCA.cxx:333
 AliPerformanceDCA.cxx:334
 AliPerformanceDCA.cxx:335
 AliPerformanceDCA.cxx:336
 AliPerformanceDCA.cxx:337
 AliPerformanceDCA.cxx:338
 AliPerformanceDCA.cxx:339
 AliPerformanceDCA.cxx:340
 AliPerformanceDCA.cxx:341
 AliPerformanceDCA.cxx:342
 AliPerformanceDCA.cxx:343
 AliPerformanceDCA.cxx:344
 AliPerformanceDCA.cxx:345
 AliPerformanceDCA.cxx:346
 AliPerformanceDCA.cxx:347
 AliPerformanceDCA.cxx:348
 AliPerformanceDCA.cxx:349
 AliPerformanceDCA.cxx:350
 AliPerformanceDCA.cxx:351
 AliPerformanceDCA.cxx:352
 AliPerformanceDCA.cxx:353
 AliPerformanceDCA.cxx:354
 AliPerformanceDCA.cxx:355
 AliPerformanceDCA.cxx:356
 AliPerformanceDCA.cxx:357
 AliPerformanceDCA.cxx:358
 AliPerformanceDCA.cxx:359
 AliPerformanceDCA.cxx:360
 AliPerformanceDCA.cxx:361
 AliPerformanceDCA.cxx:362
 AliPerformanceDCA.cxx:363
 AliPerformanceDCA.cxx:364
 AliPerformanceDCA.cxx:365
 AliPerformanceDCA.cxx:366
 AliPerformanceDCA.cxx:367
 AliPerformanceDCA.cxx:368
 AliPerformanceDCA.cxx:369
 AliPerformanceDCA.cxx:370
 AliPerformanceDCA.cxx:371
 AliPerformanceDCA.cxx:372
 AliPerformanceDCA.cxx:373
 AliPerformanceDCA.cxx:374
 AliPerformanceDCA.cxx:375
 AliPerformanceDCA.cxx:376
 AliPerformanceDCA.cxx:377
 AliPerformanceDCA.cxx:378
 AliPerformanceDCA.cxx:379
 AliPerformanceDCA.cxx:380
 AliPerformanceDCA.cxx:381
 AliPerformanceDCA.cxx:382
 AliPerformanceDCA.cxx:383
 AliPerformanceDCA.cxx:384
 AliPerformanceDCA.cxx:385
 AliPerformanceDCA.cxx:386
 AliPerformanceDCA.cxx:387
 AliPerformanceDCA.cxx:388
 AliPerformanceDCA.cxx:389
 AliPerformanceDCA.cxx:390
 AliPerformanceDCA.cxx:391
 AliPerformanceDCA.cxx:392
 AliPerformanceDCA.cxx:393
 AliPerformanceDCA.cxx:394
 AliPerformanceDCA.cxx:395
 AliPerformanceDCA.cxx:396
 AliPerformanceDCA.cxx:397
 AliPerformanceDCA.cxx:398
 AliPerformanceDCA.cxx:399
 AliPerformanceDCA.cxx:400
 AliPerformanceDCA.cxx:401
 AliPerformanceDCA.cxx:402
 AliPerformanceDCA.cxx:403
 AliPerformanceDCA.cxx:404
 AliPerformanceDCA.cxx:405
 AliPerformanceDCA.cxx:406
 AliPerformanceDCA.cxx:407
 AliPerformanceDCA.cxx:408
 AliPerformanceDCA.cxx:409
 AliPerformanceDCA.cxx:410
 AliPerformanceDCA.cxx:411
 AliPerformanceDCA.cxx:412
 AliPerformanceDCA.cxx:413
 AliPerformanceDCA.cxx:414
 AliPerformanceDCA.cxx:415
 AliPerformanceDCA.cxx:416
 AliPerformanceDCA.cxx:417
 AliPerformanceDCA.cxx:418
 AliPerformanceDCA.cxx:419
 AliPerformanceDCA.cxx:420
 AliPerformanceDCA.cxx:421
 AliPerformanceDCA.cxx:422
 AliPerformanceDCA.cxx:423
 AliPerformanceDCA.cxx:424
 AliPerformanceDCA.cxx:425
 AliPerformanceDCA.cxx:426
 AliPerformanceDCA.cxx:427
 AliPerformanceDCA.cxx:428
 AliPerformanceDCA.cxx:429
 AliPerformanceDCA.cxx:430
 AliPerformanceDCA.cxx:431
 AliPerformanceDCA.cxx:432
 AliPerformanceDCA.cxx:433
 AliPerformanceDCA.cxx:434
 AliPerformanceDCA.cxx:435
 AliPerformanceDCA.cxx:436
 AliPerformanceDCA.cxx:437
 AliPerformanceDCA.cxx:438
 AliPerformanceDCA.cxx:439
 AliPerformanceDCA.cxx:440
 AliPerformanceDCA.cxx:441
 AliPerformanceDCA.cxx:442
 AliPerformanceDCA.cxx:443
 AliPerformanceDCA.cxx:444
 AliPerformanceDCA.cxx:445
 AliPerformanceDCA.cxx:446
 AliPerformanceDCA.cxx:447
 AliPerformanceDCA.cxx:448
 AliPerformanceDCA.cxx:449
 AliPerformanceDCA.cxx:450
 AliPerformanceDCA.cxx:451
 AliPerformanceDCA.cxx:452
 AliPerformanceDCA.cxx:453
 AliPerformanceDCA.cxx:454
 AliPerformanceDCA.cxx:455
 AliPerformanceDCA.cxx:456
 AliPerformanceDCA.cxx:457
 AliPerformanceDCA.cxx:458
 AliPerformanceDCA.cxx:459
 AliPerformanceDCA.cxx:460
 AliPerformanceDCA.cxx:461
 AliPerformanceDCA.cxx:462
 AliPerformanceDCA.cxx:463
 AliPerformanceDCA.cxx:464
 AliPerformanceDCA.cxx:465
 AliPerformanceDCA.cxx:466
 AliPerformanceDCA.cxx:467
 AliPerformanceDCA.cxx:468
 AliPerformanceDCA.cxx:469
 AliPerformanceDCA.cxx:470
 AliPerformanceDCA.cxx:471
 AliPerformanceDCA.cxx:472
 AliPerformanceDCA.cxx:473
 AliPerformanceDCA.cxx:474
 AliPerformanceDCA.cxx:475
 AliPerformanceDCA.cxx:476
 AliPerformanceDCA.cxx:477
 AliPerformanceDCA.cxx:478
 AliPerformanceDCA.cxx:479
 AliPerformanceDCA.cxx:480
 AliPerformanceDCA.cxx:481
 AliPerformanceDCA.cxx:482
 AliPerformanceDCA.cxx:483
 AliPerformanceDCA.cxx:484
 AliPerformanceDCA.cxx:485
 AliPerformanceDCA.cxx:486
 AliPerformanceDCA.cxx:487
 AliPerformanceDCA.cxx:488
 AliPerformanceDCA.cxx:489
 AliPerformanceDCA.cxx:490
 AliPerformanceDCA.cxx:491
 AliPerformanceDCA.cxx:492
 AliPerformanceDCA.cxx:493
 AliPerformanceDCA.cxx:494
 AliPerformanceDCA.cxx:495
 AliPerformanceDCA.cxx:496
 AliPerformanceDCA.cxx:497
 AliPerformanceDCA.cxx:498
 AliPerformanceDCA.cxx:499
 AliPerformanceDCA.cxx:500
 AliPerformanceDCA.cxx:501
 AliPerformanceDCA.cxx:502
 AliPerformanceDCA.cxx:503
 AliPerformanceDCA.cxx:504
 AliPerformanceDCA.cxx:505
 AliPerformanceDCA.cxx:506
 AliPerformanceDCA.cxx:507
 AliPerformanceDCA.cxx:508
 AliPerformanceDCA.cxx:509
 AliPerformanceDCA.cxx:510
 AliPerformanceDCA.cxx:511
 AliPerformanceDCA.cxx:512
 AliPerformanceDCA.cxx:513
 AliPerformanceDCA.cxx:514
 AliPerformanceDCA.cxx:515
 AliPerformanceDCA.cxx:516
 AliPerformanceDCA.cxx:517
 AliPerformanceDCA.cxx:518
 AliPerformanceDCA.cxx:519
 AliPerformanceDCA.cxx:520
 AliPerformanceDCA.cxx:521
 AliPerformanceDCA.cxx:522
 AliPerformanceDCA.cxx:523
 AliPerformanceDCA.cxx:524
 AliPerformanceDCA.cxx:525
 AliPerformanceDCA.cxx:526
 AliPerformanceDCA.cxx:527
 AliPerformanceDCA.cxx:528
 AliPerformanceDCA.cxx:529
 AliPerformanceDCA.cxx:530
 AliPerformanceDCA.cxx:531
 AliPerformanceDCA.cxx:532
 AliPerformanceDCA.cxx:533
 AliPerformanceDCA.cxx:534
 AliPerformanceDCA.cxx:535
 AliPerformanceDCA.cxx:536
 AliPerformanceDCA.cxx:537
 AliPerformanceDCA.cxx:538
 AliPerformanceDCA.cxx:539
 AliPerformanceDCA.cxx:540
 AliPerformanceDCA.cxx:541
 AliPerformanceDCA.cxx:542
 AliPerformanceDCA.cxx:543
 AliPerformanceDCA.cxx:544
 AliPerformanceDCA.cxx:545
 AliPerformanceDCA.cxx:546
 AliPerformanceDCA.cxx:547
 AliPerformanceDCA.cxx:548
 AliPerformanceDCA.cxx:549
 AliPerformanceDCA.cxx:550
 AliPerformanceDCA.cxx:551
 AliPerformanceDCA.cxx:552
 AliPerformanceDCA.cxx:553
 AliPerformanceDCA.cxx:554
 AliPerformanceDCA.cxx:555
 AliPerformanceDCA.cxx:556
 AliPerformanceDCA.cxx:557
 AliPerformanceDCA.cxx:558
 AliPerformanceDCA.cxx:559
 AliPerformanceDCA.cxx:560
 AliPerformanceDCA.cxx:561
 AliPerformanceDCA.cxx:562
 AliPerformanceDCA.cxx:563
 AliPerformanceDCA.cxx:564
 AliPerformanceDCA.cxx:565
 AliPerformanceDCA.cxx:566
 AliPerformanceDCA.cxx:567
 AliPerformanceDCA.cxx:568
 AliPerformanceDCA.cxx:569
 AliPerformanceDCA.cxx:570
 AliPerformanceDCA.cxx:571
 AliPerformanceDCA.cxx:572
 AliPerformanceDCA.cxx:573
 AliPerformanceDCA.cxx:574
 AliPerformanceDCA.cxx:575
 AliPerformanceDCA.cxx:576
 AliPerformanceDCA.cxx:577
 AliPerformanceDCA.cxx:578
 AliPerformanceDCA.cxx:579
 AliPerformanceDCA.cxx:580
 AliPerformanceDCA.cxx:581
 AliPerformanceDCA.cxx:582
 AliPerformanceDCA.cxx:583
 AliPerformanceDCA.cxx:584
 AliPerformanceDCA.cxx:585
 AliPerformanceDCA.cxx:586
 AliPerformanceDCA.cxx:587
 AliPerformanceDCA.cxx:588
 AliPerformanceDCA.cxx:589
 AliPerformanceDCA.cxx:590
 AliPerformanceDCA.cxx:591
 AliPerformanceDCA.cxx:592
 AliPerformanceDCA.cxx:593
 AliPerformanceDCA.cxx:594
 AliPerformanceDCA.cxx:595
 AliPerformanceDCA.cxx:596
 AliPerformanceDCA.cxx:597
 AliPerformanceDCA.cxx:598
 AliPerformanceDCA.cxx:599
 AliPerformanceDCA.cxx:600
 AliPerformanceDCA.cxx:601
 AliPerformanceDCA.cxx:602
 AliPerformanceDCA.cxx:603
 AliPerformanceDCA.cxx:604
 AliPerformanceDCA.cxx:605
 AliPerformanceDCA.cxx:606
 AliPerformanceDCA.cxx:607
 AliPerformanceDCA.cxx:608
 AliPerformanceDCA.cxx:609
 AliPerformanceDCA.cxx:610
 AliPerformanceDCA.cxx:611
 AliPerformanceDCA.cxx:612
 AliPerformanceDCA.cxx:613
 AliPerformanceDCA.cxx:614
 AliPerformanceDCA.cxx:615
 AliPerformanceDCA.cxx:616
 AliPerformanceDCA.cxx:617
 AliPerformanceDCA.cxx:618
 AliPerformanceDCA.cxx:619
 AliPerformanceDCA.cxx:620
 AliPerformanceDCA.cxx:621
 AliPerformanceDCA.cxx:622
 AliPerformanceDCA.cxx:623
 AliPerformanceDCA.cxx:624
 AliPerformanceDCA.cxx:625
 AliPerformanceDCA.cxx:626
 AliPerformanceDCA.cxx:627
 AliPerformanceDCA.cxx:628
 AliPerformanceDCA.cxx:629
 AliPerformanceDCA.cxx:630
 AliPerformanceDCA.cxx:631
 AliPerformanceDCA.cxx:632
 AliPerformanceDCA.cxx:633
 AliPerformanceDCA.cxx:634
 AliPerformanceDCA.cxx:635
 AliPerformanceDCA.cxx:636
 AliPerformanceDCA.cxx:637
 AliPerformanceDCA.cxx:638
 AliPerformanceDCA.cxx:639
 AliPerformanceDCA.cxx:640
 AliPerformanceDCA.cxx:641
 AliPerformanceDCA.cxx:642
 AliPerformanceDCA.cxx:643
 AliPerformanceDCA.cxx:644
 AliPerformanceDCA.cxx:645
 AliPerformanceDCA.cxx:646
 AliPerformanceDCA.cxx:647
 AliPerformanceDCA.cxx:648
 AliPerformanceDCA.cxx:649
 AliPerformanceDCA.cxx:650
 AliPerformanceDCA.cxx:651
 AliPerformanceDCA.cxx:652
 AliPerformanceDCA.cxx:653
 AliPerformanceDCA.cxx:654
 AliPerformanceDCA.cxx:655
 AliPerformanceDCA.cxx:656
 AliPerformanceDCA.cxx:657
 AliPerformanceDCA.cxx:658
 AliPerformanceDCA.cxx:659
 AliPerformanceDCA.cxx:660
 AliPerformanceDCA.cxx:661
 AliPerformanceDCA.cxx:662
 AliPerformanceDCA.cxx:663
 AliPerformanceDCA.cxx:664
 AliPerformanceDCA.cxx:665
 AliPerformanceDCA.cxx:666
 AliPerformanceDCA.cxx:667
 AliPerformanceDCA.cxx:668
 AliPerformanceDCA.cxx:669
 AliPerformanceDCA.cxx:670
 AliPerformanceDCA.cxx:671
 AliPerformanceDCA.cxx:672
 AliPerformanceDCA.cxx:673
 AliPerformanceDCA.cxx:674
 AliPerformanceDCA.cxx:675
 AliPerformanceDCA.cxx:676
 AliPerformanceDCA.cxx:677
 AliPerformanceDCA.cxx:678
 AliPerformanceDCA.cxx:679
 AliPerformanceDCA.cxx:680
 AliPerformanceDCA.cxx:681
 AliPerformanceDCA.cxx:682
 AliPerformanceDCA.cxx:683
 AliPerformanceDCA.cxx:684
 AliPerformanceDCA.cxx:685
 AliPerformanceDCA.cxx:686
 AliPerformanceDCA.cxx:687
 AliPerformanceDCA.cxx:688
 AliPerformanceDCA.cxx:689
 AliPerformanceDCA.cxx:690
 AliPerformanceDCA.cxx:691
 AliPerformanceDCA.cxx:692
 AliPerformanceDCA.cxx:693
 AliPerformanceDCA.cxx:694
 AliPerformanceDCA.cxx:695
 AliPerformanceDCA.cxx:696
 AliPerformanceDCA.cxx:697
 AliPerformanceDCA.cxx:698
 AliPerformanceDCA.cxx:699
 AliPerformanceDCA.cxx:700
 AliPerformanceDCA.cxx:701
 AliPerformanceDCA.cxx:702
 AliPerformanceDCA.cxx:703
 AliPerformanceDCA.cxx:704
 AliPerformanceDCA.cxx:705
 AliPerformanceDCA.cxx:706
 AliPerformanceDCA.cxx:707
 AliPerformanceDCA.cxx:708
 AliPerformanceDCA.cxx:709
 AliPerformanceDCA.cxx:710
 AliPerformanceDCA.cxx:711
 AliPerformanceDCA.cxx:712
 AliPerformanceDCA.cxx:713
 AliPerformanceDCA.cxx:714
 AliPerformanceDCA.cxx:715
 AliPerformanceDCA.cxx:716
 AliPerformanceDCA.cxx:717
 AliPerformanceDCA.cxx:718
 AliPerformanceDCA.cxx:719
 AliPerformanceDCA.cxx:720
 AliPerformanceDCA.cxx:721
 AliPerformanceDCA.cxx:722
 AliPerformanceDCA.cxx:723
 AliPerformanceDCA.cxx:724
 AliPerformanceDCA.cxx:725
 AliPerformanceDCA.cxx:726
 AliPerformanceDCA.cxx:727
 AliPerformanceDCA.cxx:728
 AliPerformanceDCA.cxx:729
 AliPerformanceDCA.cxx:730
 AliPerformanceDCA.cxx:731
 AliPerformanceDCA.cxx:732
 AliPerformanceDCA.cxx:733
 AliPerformanceDCA.cxx:734
 AliPerformanceDCA.cxx:735
 AliPerformanceDCA.cxx:736
 AliPerformanceDCA.cxx:737
 AliPerformanceDCA.cxx:738
 AliPerformanceDCA.cxx:739
 AliPerformanceDCA.cxx:740
 AliPerformanceDCA.cxx:741
 AliPerformanceDCA.cxx:742
 AliPerformanceDCA.cxx:743
 AliPerformanceDCA.cxx:744
 AliPerformanceDCA.cxx:745
 AliPerformanceDCA.cxx:746
 AliPerformanceDCA.cxx:747
 AliPerformanceDCA.cxx:748
 AliPerformanceDCA.cxx:749
 AliPerformanceDCA.cxx:750
 AliPerformanceDCA.cxx:751
 AliPerformanceDCA.cxx:752
 AliPerformanceDCA.cxx:753
 AliPerformanceDCA.cxx:754
 AliPerformanceDCA.cxx:755
 AliPerformanceDCA.cxx:756
 AliPerformanceDCA.cxx:757
 AliPerformanceDCA.cxx:758
 AliPerformanceDCA.cxx:759
 AliPerformanceDCA.cxx:760
 AliPerformanceDCA.cxx:761
 AliPerformanceDCA.cxx:762
 AliPerformanceDCA.cxx:763
 AliPerformanceDCA.cxx:764
 AliPerformanceDCA.cxx:765
 AliPerformanceDCA.cxx:766
 AliPerformanceDCA.cxx:767
 AliPerformanceDCA.cxx:768
 AliPerformanceDCA.cxx:769
 AliPerformanceDCA.cxx:770
 AliPerformanceDCA.cxx:771
 AliPerformanceDCA.cxx:772
 AliPerformanceDCA.cxx:773
 AliPerformanceDCA.cxx:774
 AliPerformanceDCA.cxx:775
 AliPerformanceDCA.cxx:776
 AliPerformanceDCA.cxx:777
 AliPerformanceDCA.cxx:778
 AliPerformanceDCA.cxx:779
 AliPerformanceDCA.cxx:780
 AliPerformanceDCA.cxx:781
 AliPerformanceDCA.cxx:782
 AliPerformanceDCA.cxx:783
 AliPerformanceDCA.cxx:784
 AliPerformanceDCA.cxx:785
 AliPerformanceDCA.cxx:786
 AliPerformanceDCA.cxx:787
 AliPerformanceDCA.cxx:788
 AliPerformanceDCA.cxx:789
 AliPerformanceDCA.cxx:790
 AliPerformanceDCA.cxx:791
 AliPerformanceDCA.cxx:792
 AliPerformanceDCA.cxx:793
 AliPerformanceDCA.cxx:794
 AliPerformanceDCA.cxx:795
 AliPerformanceDCA.cxx:796
 AliPerformanceDCA.cxx:797
 AliPerformanceDCA.cxx:798
 AliPerformanceDCA.cxx:799
 AliPerformanceDCA.cxx:800
 AliPerformanceDCA.cxx:801
 AliPerformanceDCA.cxx:802
 AliPerformanceDCA.cxx:803
 AliPerformanceDCA.cxx:804
 AliPerformanceDCA.cxx:805
 AliPerformanceDCA.cxx:806
 AliPerformanceDCA.cxx:807
 AliPerformanceDCA.cxx:808
 AliPerformanceDCA.cxx:809