move storage in the Efficiency task to THnSparse
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Apr 2012 10:22:33 +0000 (10:22 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Apr 2012 10:22:33 +0000 (10:22 +0000)
restructured THnSparse projections (move to AliTRDrecoTask)
add optionally Track points to the list of data to be collected by
infoGen

14 files changed:
PWGPP/PWGPPLinkDef.h
PWGPP/TRD/AliTRDcheckTRK.cxx
PWGPP/TRD/AliTRDefficiency.cxx
PWGPP/TRD/AliTRDefficiency.h
PWGPP/TRD/AliTRDinfoGen.cxx
PWGPP/TRD/AliTRDinfoGen.h
PWGPP/TRD/AliTRDrecoTask.cxx
PWGPP/TRD/AliTRDrecoTask.h
PWGPP/TRD/AliTRDresolution.cxx
PWGPP/TRD/AliTRDresolution.h
PWGPP/TRD/info/AliTRDtrackInfo.cxx
PWGPP/TRD/info/AliTRDtrackInfo.h
PWGPP/TRD/macros/AddTRDinfoGen.C
PWGPP/TRD/macros/AddTRDresolution.C

index 8d91d18..4eec38f 100644 (file)
 #pragma link C++ class  AliTRDpidInfo::AliTRDpidData+;
 #pragma link C++ class  AliTRDinfoGen+;
 #pragma link C++ class  AliTRDrecoTask+;
+#pragma link C++ class  AliTRDrecoTask::AliTRDrecoProjection+;
 #pragma link C++ class  AliTRDcheckESD+;
 #pragma link C++ class  AliTRDcheckDET+;
 #pragma link C++ class  AliTRDcheckPID+;
 #pragma link C++ class  AliTRDcheckTRK+;
 #pragma link C++ class  AliTRDresolution+;
-#pragma link C++ class  AliTRDresolution::AliTRDresolutionProjection+;
 #pragma link C++ class  AliTRDefficiency+;
 #pragma link C++ class  AliTRDefficiencyMC+;
 #pragma link C++ class  AliTRDv0Monitor+;
index bfae135..587db1e 100644 (file)
@@ -45,7 +45,7 @@
 
 ClassImp(AliTRDcheckTRK)
 
-UChar_t  AliTRDcheckTRK::fgSteer= 0;
+UChar_t AliTRDcheckTRK::fgSteer= 0;
 Float_t AliTRDcheckTRK::fgKalmanStep = 2.;
 //__________________________________________________________________________
 AliTRDcheckTRK::AliTRDcheckTRK()
index 6ade10f..cd7cb8d 100644 (file)
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
+#include <TROOT.h>
+#include <TStyle.h>
 #include <TClonesArray.h>
 #include <TObjArray.h>
 #include <TProfile.h>
 #include <TPad.h>
+#include <TCanvas.h>
 #include <TLegend.h>
+#include <THnSparse.h>
+#include <TH2.h>
+#include <TH3.h>
+#include <THStack.h>
 #include "TTreeStream.h"
 
 #include "AliPID.h"
@@ -38,6 +45,8 @@
 #include "AliTracker.h"
 #include "AliAnalysisManager.h"
 
+#include "AliTRDgeometry.h"
+#include "AliTRDtrackV1.h"
 #include "Cal/AliTRDCalPID.h"
 #include "AliTRDefficiency.h"
 #include "info/AliTRDtrackInfo.h"
@@ -48,6 +57,7 @@ ClassImp(AliTRDefficiency)
 AliTRDefficiency::AliTRDefficiency()
   :AliTRDrecoTask()
   ,fMissed(NULL)
+  ,fProj(NULL)
 {
   //
   // Default constructor
@@ -59,6 +69,7 @@ AliTRDefficiency::AliTRDefficiency()
 AliTRDefficiency::AliTRDefficiency(char* name)
   :AliTRDrecoTask(name, "TRD barrel tracking efficiency checker")
   ,fMissed(NULL)
+  ,fProj(NULL)
 {
   //
   // Default constructor
@@ -75,37 +86,113 @@ AliTRDefficiency::~AliTRDefficiency()
   }
 }
 
+// //____________________________________________________________________
+// void  AliTRDefficiency::UserCreateOutputObjects()
+// {
+//   //
+//   // Create output objects
+//   //
+// 
+//   const Int_t nbins = AliTRDCalPID::kNMom;
+//   Float_t xbins[nbins+1] = {.5, .7, .9, 1.3, 1.7, 2.4, 3.5, 4.5, 5.5, 7., 9., 11.};
+// 
+//   TH1 *h = NULL;
+//   fContainer = new TObjArray(); fContainer->SetOwner();
+//   for(Int_t is=0; is<AliPID::kSPECIES; is++){
+//     fContainer->Add(h = new TProfile(Form("h%s", AliTRDCalPID::GetPartSymb(is)), AliPID::ParticleShortName(is), nbins, xbins));
+//     h->SetLineColor(AliTRDCalPID::GetPartColor(is));
+//     h->SetMarkerColor(AliTRDCalPID::GetPartColor(is));
+//     h->SetMarkerStyle(24);
+//   }
+//   fContainer->Add(h = new TProfile("h", "", nbins, xbins));
+//   h->SetMarkerStyle(7);
+//   PostData(1, fContainer);
+// }
+
 //____________________________________________________________________
-void  AliTRDefficiency::UserCreateOutputObjects()
+TH1* AliTRDefficiency::PlotBasicEff(const AliTRDtrackV1 *track)
 {
-  //
-  // Create output objects
-  //
+// plot TRD efficiency based on ESD info
 
-  const Int_t nbins = AliTRDCalPID::kNMom;
-  Float_t xbins[nbins+1] = {.5, .7, .9, 1.3, 1.7, 2.4, 3.5, 4.5, 5.5, 7., 9., 11.};
+  if(!fkESD){
+    AliDebug(4, "No ESD info.");
+    return NULL;
+  }
 
-  TH1 *h = NULL;
-  fContainer = new TObjArray(); fContainer->SetOwner();
-  for(Int_t is=0; is<AliPID::kSPECIES; is++){
-    fContainer->Add(h = new TProfile(Form("h%s", AliTRDCalPID::GetPartSymb(is)), AliPID::ParticleShortName(is), nbins, xbins));
-    h->SetLineColor(AliTRDCalPID::GetPartColor(is));
-    h->SetMarkerColor(AliTRDCalPID::GetPartColor(is));
-    h->SetMarkerStyle(24);
+  THnSparse *H(NULL);
+  if(!fContainer || !(H = ((THnSparse*)fContainer->FindObject("hEFF")))){
+    AliWarning("No output container defined.");
+    return NULL;
   }
-  fContainer->Add(h = new TProfile("h", "", nbins, xbins));
-  h->SetMarkerStyle(7);
-  PostData(1, fContainer);
-} 
+  if(track) fkTrack = track;
+
+  Double_t val[11]; memset(val, 0, 11*sizeof(Double_t));
+  ULong_t status(fkESD->GetStatus());
+  val[0] =((status&AliESDtrack::kTRDin)?1:0) +
+          ((status&AliESDtrack::kTRDStop)?1:0) +
+          ((status&AliESDtrack::kTRDout)?2:0);
+  val[1] = fkESD->Phi();
+  val[2] = fkESD->Eta();
+  val[3] = DebugLevel()>=1?GetPtBin(fkESD->Pt()):GetPtBinSignificant(fkESD->Pt());
+  val[4] = 0.;
+  if(fkMC){
+    if(fkMC->GetLabel() == fkMC->GetTRDlabel()) val[4] = 0.;
+    else if(fkMC->GetLabel() == -fkMC->GetTRDlabel()) val[4] = 1.;
+    else val[4] = -1.;
+  }
+  if(fkTrack){ // read track status in debug mode with friends
+    //val[4] = fkTrack->GetStatusTRD(-1);
+    for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++) val[5+ily]=fkTrack->GetStatusTRD(ily);
+  }
+  H->Fill(val);
+  return NULL;
+}
+
+// //____________________________________________________________________
+// TH1* AliTRDefficiency::PlotMC(const AliTRDtrackV1 *track)
+// {
+// // plot TRD efficiency based on MC info
+// 
+//   if(!HasMC()) return NULL;
+//   if(!fkESD){
+//     AliDebug(4, "No ESD info.");
+//     return NULL;
+//   }
+//   if(!fkMC){
+//     AliDebug(4, "No MC info.");
+//     return NULL;
+//   }
+// 
+//   THnSparse *H(NULL);
+//   if(!fContainer || !(H = ((THnSparse*)fContainer->FindObject("hMC")))){
+//     AliWarning("No output container defined.");
+//     return NULL;
+//   }
+//   if(track) fkTrack = track;
+//   Double_t val[11]; memset(val, 0, 11*sizeof(Double_t));
+//   ULong_t status(fkESD->GetStatus());
+//   val[0] =((status&AliESDtrack::kTRDin)?1:0) +
+//           ((status&AliESDtrack::kTRDStop)?1:0) +
+//           ((status&AliESDtrack::kTRDout)?2:0);
+//   val[1] = fkESD->Phi();
+//   val[2] = fkESD->Eta();
+//   val[3] = DebugLevel()>=1?GetPtBin(fkESD->Pt()):GetPtBinSignificant(fkESD->Pt());
+//   if(fkTrack){ // read track status in debug mode with friends
+//     val[4] = fkTrack->GetStatusTRD(-1);
+//     for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++) val[5+ily]=fkTrack->GetStatusTRD(ily);
+//   }
+//   H->Fill(val);
+// 
+// }
 
 //____________________________________________________________________
-void AliTRDefficiency::UserExec(Option_t *)
+void AliTRDefficiency::LocalUserExec(Option_t *)
 {
   //
-  // Do it
+  // Do it obsolete
   //
 
-  Int_t labelsacc[10000]; 
+  Int_t labelsacc[10000];
   memset(labelsacc, 0, sizeof(Int_t) * 10000);
        
   fTracks = dynamic_cast<TObjArray *>(GetInputData(1));
@@ -269,6 +356,33 @@ void AliTRDefficiency::UserExec(Option_t *)
        }
 }
 
+//____________________________________________________________________
+Int_t AliTRDefficiency::GetPtBin(Float_t pt)
+{
+// Get logaritmic pt bin
+
+  Float_t pt0(0.5), dpt(0.002);
+  Int_t ipt(0);
+  while(ipt<30){
+    if(pt<pt0) break;
+    ipt++; pt0+=(TMath::Exp(ipt*ipt*dpt)-1.);
+  }
+  return ipt-1;
+}
+
+//____________________________________________________________________
+Int_t AliTRDefficiency::GetPtBinSignificant(Float_t pt)
+{
+// Get significant (very low, low, medium, high, very high) pt bin
+
+  Float_t pt0[] = {0.5, 0.8, 1.5, 5};
+  Int_t ipt(0);
+  while(ipt<4){
+    if(pt<pt0[ipt]) break;
+    ipt++;
+  }
+  return ipt-1;
+}
 
 //____________________________________________________________________
 Bool_t AliTRDefficiency::GetRefFigure(Int_t ifig)
@@ -329,10 +443,327 @@ Bool_t AliTRDefficiency::GetRefFigure(Int_t ifig)
   return kTRUE;
 }
 
+//________________________________________________________
+TObjArray* AliTRDefficiency::Histos()
+{
+  //
+  // Define histograms
+  //
+
+  if(fContainer) return fContainer;
+
+  fContainer  = new TObjArray(1); fContainer->SetOwner(kTRUE);
+  THnSparse *H(NULL);
+  TString st;
+
+  //++++++++++++++++++++++
+  // cluster to detector
+  if(!(H = (THnSparseI*)gROOT->FindObject("hEFF"))){
+    const Int_t mdim(11);
+    Int_t npt=DebugLevel()>=1?20:3;
+    Int_t nlabel(1);
+    const Char_t *eTitle[mdim] = {"label", "#phi [rad]", "eta", "p_{t} [bin]", "label", "status[0]", "status[1]", "status[2]", "status[3]", "status[4]", "status[5]"};
+    const Int_t eNbins[mdim]   = {5, 180, 50, npt, nlabel, 5, 5, 5, 5, 5, 5};
+    const Double_t eMin[mdim]  = {-0.5, -TMath::Pi(), -1., -0.5, -0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5},
+                   eMax[mdim]  = {4.5, TMath::Pi(), 1., npt-.5, nlabel-0.5, 5.5, 5.5, 5.5, 5.5, 5.5, 5.5};
+    st = "basic efficiency;";
+    // define minimum info to be saved in non debug mode
+    Int_t ndim=DebugLevel()>=1?mdim:(HasMCdata()?5:4);
+    for(Int_t idim(0); idim<ndim; idim++){ st += eTitle[idim]; st+=";";}
+    H = new THnSparseI("hEFF", st.Data(), ndim, eNbins, eMin, eMax);
+/*    TAxis *ax(H->GetAxis(0)); const Char_t *lTRDflag[] = {"!TRDin", "TRDin", "TRDin&TRDStop", "TRDin&TRDout", "TRDin&TRDout&TRDStop"};
+    for(Int_t ibin(1); ibin<=ax->GetNbins(); ibin++) ax->SetBinLabel(ibin, lTRDflag[ibin-1]);*/
+  } else H->Reset();
+  fContainer->AddAt(H, 0);
+
+  return fContainer;
+}
 
 //____________________________________________________________________
 Bool_t AliTRDefficiency::PostProcess()
 {
-  fNRefFigures = HasMCdata() ? 2 : 1; 
+// Fit, Project, Combine, Extract values from the containers filled during execution
+
+  if (!fContainer) {
+    AliError("ERROR: list not available");
+    return kFALSE;
+  }
+  if(!fProj){
+    AliInfo("Building array of projections ...");
+    fProj = new TObjArray(50); fProj->SetOwner(kTRUE);
+  }
+  if(!MakeProjectionBasicEff()) return kFALSE;
+  return kTRUE;
+}
+
+//____________________________________________________________________
+Bool_t AliTRDefficiency::MakeProjectionBasicEff()
+{
+// Make basic efficiency plots
+
+  if(!fContainer || !fProj){
+    AliError("Missing data container.");
+    return kFALSE;
+  }
+  THnSparse *H(NULL);
+  if(!(H = (THnSparse*)fContainer->FindObject("hEFF"))){
+    AliError("Missing/Wrong data @ hEFF.");
+    return kFALSE;
+  }
+  Int_t ndim(H->GetNdimensions()); //Bool_t debug(ndim>Int_t(kNdimCl));
+  TAxis *aa[11], *al(NULL); memset(aa, 0, sizeof(TAxis*) * 11);
+  for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id);
+  if(H->GetNdimensions() > 4) al = H->GetAxis(4);
+  Int_t nlab=al?3:1;
+
+  // define rebinning strategy
+  //const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
+  AliTRDrecoProjection hp[15];  TObjArray php(15);
+  const Char_t *stat[] = {"!TRDin", "TRDin", "TRDin&TRDStop", "TRDin&TRDout", "TRDin&TRDout&TRDStop"};
+  const Char_t *lab[] = {"Bad", "Good", "Accept"};
+  Int_t ih(0);
+  for(Int_t ilab(0); ilab<nlab; ilab++){
+    for(Int_t istat(0); istat<5; istat++){
+//      isel++; // new selection
+      hp[ih].Build(Form("HEff%d%d", ilab, istat),
+                  Form("Efficiency ::  Lab[%s] Stat[#bf{%s}]", lab[ilab], stat[istat]),
+                  2, 1, 3, aa);
+      //hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
+      php.AddLast(&hp[ih++]); //np[isel]++;
+    }
+  }
+  AliInfo(Form("Build %3d 3D projections.", ih));
+
+  Int_t istatus, ilab(0), coord[11]; memset(coord, 0, sizeof(Int_t) * 11); Double_t v = 0.;
+  for (Long64_t ib(0); ib < H->GetNbins(); ib++) {
+    v = H->GetBinContent(ib, coord); if(v<1.) continue;
+    istatus = coord[0]-1;
+    if(al) ilab = coord[4];
+    Int_t isel = ilab*5+istatus;
+    for(Int_t jh(0); jh<1/*np[isel]*/; jh++) ((AliTRDrecoProjection*)php.At(isel+jh))->Increment(coord, v);
+  }
+  TH2 *h2(NULL);  Int_t jh(0);
+  for(; ih--; ){
+    if(!hp[ih].H()) continue;
+    hp[ih].Projection2D(1, 10, -1, kFALSE);
+    if((h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].H()->GetName())))) fProj->AddAt(h2, jh++);
+  }
+
+  AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
+  AliTRDrecoProjection prLab;  TH2 *hLab[3] = {0}; TH1 *hpLab[3] = {0};
+  for(ilab=0; ilab<nlab; ilab++){
+    if(!(pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HEff%d%d", ilab, 3)))) continue;
+    prLab=(*pr0);
+    prLab.SetNameTitle(Form("HEffLb%d", ilab), "Sum over status");
+    prLab.H()->SetNameTitle(Form("HEffLb%d", ilab), Form("Efficiency :: #bf{%s} Propagated Tracks", lab[ilab]));
+    if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HEff%d%d", ilab, 4)))) continue;
+    prLab+=(*pr1);
+    h2 = prLab.Projection2D(1, 10, -1, kFALSE);
+    if((hLab[ilab] = (TH2*)gDirectory->Get(Form("%sEn", prLab.H()->GetName())))) fProj->AddAt(hLab[ilab], jh++);
+    if((hpLab[ilab] = prLab.H()->Project3D("z"))) fProj->AddAt(hpLab[ilab], jh++);
+  }
+
+  for(Int_t istat(0); istat<5; istat++) {
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HEff%d%d", 0, istat)))) {
+      for(ilab=1; ilab<nlab; ilab++){
+        if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HEff%d%d", ilab, istat)))) continue;
+        (*pr0)+=(*pr1);
+      }
+      pr0->H()->SetNameTitle(Form("HEff%d", istat), Form("Efficiency :: Stat[#bf{%s}]", stat[istat]));
+      h2 = pr0->Projection2D(1, 10, -1, kFALSE);
+      if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) fProj->AddAt(h2, jh++);
+
+      if(istat>1 && (pr1 = (AliTRDrecoProjection*)php.FindObject("HEff01"))) (*pr1)+=(*pr0);
+      if(istat>2 && (pr1 = (AliTRDrecoProjection*)php.FindObject("HEff02"))) (*pr1)+=(*pr0);
+      if(istat>3 && (pr1 = (AliTRDrecoProjection*)php.FindObject("HEff03"))) (*pr1)+=(*pr0);
+    }
+  }
+  // All tracks
+  TH2 *hEff[3] = {0};TH1 *hpEff[3] = {0};
+  if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HEff%d%d", 0, 1)))) {
+    pr0->H()->SetNameTitle("HEff", "Efficiency :: All Tracks");
+    h2 = pr0->Projection2D(1, 10, -1, kFALSE);
+    hEff[0] = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName()));
+    hpEff[0]= pr0->H()->Project3D("z");
+  }
+  // Tracked tracks
+  if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HEff%d%d", 0, 2)))) {
+    pr0->H()->SetNameTitle("H2EffT", "Efficiency :: Tracked Tracks");
+    h2 = pr0->Projection2D(1, 10, -1, kFALSE);
+    hEff[1] = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName()));
+    hpEff[1]= pr0->H()->Project3D("z");
+  }
+  // Propagated tracks
+  if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HEff%d%d", 0, 3)))) {
+    pr0->H()->SetNameTitle("HEffPrp", "Efficiency :: Propagated Tracks");
+    h2 = pr0->Projection2D(1, 10, -1, kFALSE);
+    hEff[2] = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName()));
+    hpEff[2]= pr0->H()->Project3D("z");
+  }
+  if(hEff[0]){
+    if(hEff[1]){
+      hEff[1]->Divide(hEff[0]);
+      fProj->AddAt(hEff[1], jh++);
+    }
+    if(hEff[2]){
+      TH2 *hEff1 = (TH2*)hEff[2]->Clone("H2EffPEn");
+      hEff1->Divide(hEff[0]);
+      fProj->AddAt(hEff1, jh++);
+    }
+  }
+  if(hpEff[0]){
+    if(hpEff[1]){
+      hpEff[1]->Divide(hpEff[0]);
+      fProj->AddAt(hpEff[1], jh++);
+    }
+    if(hEff[2]){
+      TH1 *hpEff1 = (TH1*)hpEff[2]->Clone("H2EffP_z");
+      hpEff1->Divide(hpEff[0]);
+      fProj->AddAt(hpEff1, jh++);
+    }
+  }
+  // process MC label
+  if(hEff[2]){
+    for(ilab=0; ilab<nlab; ilab++){
+      if(!hLab[ilab]) continue;
+      hLab[ilab]->Divide(hEff[2]);
+      fProj->AddAt(hLab[ilab], jh++);
+    }
+  }
+  if(hpEff[2]){
+    for(ilab=0; ilab<nlab; ilab++){
+      if(!hpLab[ilab]) continue;
+      hpLab[ilab]->Divide(hpEff[2]);
+      fProj->AddAt(hpLab[ilab], jh++);
+    }
+  }
+  AliInfo(Form("Done %3d 2D projections.", jh));
   return kTRUE;
 }
+
+//____________________________________________________________________
+void AliTRDefficiency::MakeSummary()
+{
+//  Build summary plots
+  if(!fProj){
+    AliError("Missing results");
+    return;
+  }
+  TVirtualPad *p(NULL); TCanvas *cOut(NULL);
+  TH2 *h2(NULL);
+  gStyle->SetPalette(1);
+
+  const Char_t cid[]={'T','P'};
+  const Char_t *labEff[] = {"Propagated", "Stopped", "Missed"};
+  const Char_t *labMC[] = {"TRD == ESD [good]", "TRD == -ESD [accept]", "TRD != ESD [bad]"};
+  Int_t nbins(20);
+  //calculate true pt bin
+  Float_t ptBins[23]; ptBins[0] = 0.;
+  if(nbins==3){ // significant bins
+    ptBins[1] = 0.5;
+    ptBins[2] = 0.8;
+    ptBins[3] = 1.5;
+    ptBins[4] = 5.;
+    ptBins[5] = 10.;
+  } else if(nbins==20){ // logarithmic bins
+    ptBins[1] = 0.5;
+    Float_t dpt(0.002);
+    for(Int_t ipt(1); ipt<21; ipt++) ptBins[ipt+1] = ptBins[ipt]+(TMath::Exp(ipt*ipt*dpt)-1.);
+    ptBins[22] = 10.;
+  } else {
+    AliError(Form("Unknown no.[%d] of bins in the p_t spectrum", nbins));
+    return;// kFALSE;
+  }
+
+  cOut = new TCanvas(Form("%s_Eff", GetName()), "TRD Efficiency", 1536, 1536); cOut->Divide(2,2,1.e-5,1.e-5);
+  // tracking eff :: eta-phi dependence
+  for(Int_t it(0); it<2; it++){
+    if(!(h2 = (TH2*)fProj->FindObject(Form("H2Eff%cEn", cid[it])))) {
+      AliError(Form("Missing \"H2Eff%c\".", cid[it]));
+      continue;
+    }
+    h2->SetContour(10); h2->Scale(1.e2); SetRangeZ(h2, 80, 100, 30);
+    h2->GetZaxis()->SetTitle("Efficiency [%]"); h2->GetZaxis()->CenterTitle();
+    p=cOut->cd(it+1);p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712);
+    h2->Draw("colz");
+    //MakeDetectorPlot();
+  }
+  if(!(h2 = (TH2*)fProj->FindObject("HEff0En"))) {
+    AliError("Missing \"HEff0En\".");
+    return;
+  }
+  p=cOut->cd(3);p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712);
+  h2->Draw("colz");
+  // tracking eff :: pt dependence
+  TH1 *h[2] = {0};
+  if(!(h[0] = (TH1*)fProj->FindObject("H2EffP_z"))){
+    AliError("Missing \"H2EffP_z\".");
+    return;
+  }
+  if(!(h[1] = (TH1*)fProj->FindObject("H2EffT_z"))){
+    AliError("Missing \"H2EffT_z\".");
+    return;
+  }
+  TH1 *h1[3] = {0};
+  Color_t color[] = {kGreen, kBlue, kRed};
+  for(Int_t il=0;il<3;il++){
+    h1[il]=new TH1F(Form("h1Eff%d", il), "", nbins+2, ptBins);
+    h1[il]->SetFillColor(color[il]);
+    h1[il]->SetFillStyle(il==2?3002:1001);
+    h1[il]->SetLineColor(color[il]);
+    h1[il]->SetLineWidth(1);
+  }
+  for(Int_t ip(0);ip<=(nbins+1);ip++){
+    h1[0]->SetBinContent(ip+1, 1.e2*h[0]->GetBinContent(ip)); // propagated
+    h1[1]->SetBinContent(ip+1, 1.e2*(h[1]->GetBinContent(ip) - h[0]->GetBinContent(ip))); // stopped
+    h1[2]->SetBinContent(ip+1, 1.e2*(1 - h[1]->GetBinContent(ip))); // missed
+  }
+  THStack *hs = new THStack("hEff","Tracking Efficiency;p_{t} [GeV/c];Efficiency [%]");
+  TLegend *leg = new TLegend(0.671371,0.1313559,0.9576613,0.2923729,NULL,"brNDC");
+  leg->SetBorderSize(0); leg->SetFillColor(kWhite); leg->SetFillStyle(1001);
+  for(Int_t ic(0); ic<3;ic++){ hs->Add(h1[ic]);leg->AddEntry(h1[ic], labEff[ic], "f");}
+  p=cOut->cd(4); p->SetLeftMargin(0.08266129); p->SetRightMargin(0.0141129);p->SetTopMargin(0.006355932);p->SetLogx();
+  hs->Draw(); leg->Draw();
+  hs->GetXaxis()->SetRangeUser(0.6,10.);
+  hs->GetXaxis()->SetMoreLogLabels();
+  hs->GetXaxis()->SetTitleOffset(1.2);
+  hs->GetYaxis()->SetNdivisions(513);
+  hs->SetMinimum(80.);
+  hs->GetYaxis()->CenterTitle();
+  cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+
+  cOut = new TCanvas(Form("%s_MC", GetName()), "TRD Label", 1536, 1536); cOut->Divide(2,2,1.e-5,1.e-5);
+  for(Int_t ipad(0); ipad<3; ipad++){
+    p=cOut->cd(ipad+1);p->SetRightMargin(0.1572581);p->SetTopMargin(0.08262712);
+    if(!(h2 = (TH2*)fProj->FindObject(Form("HEffLb%dEn", ipad)))) continue;
+    h2->SetContour(10);
+    h2->Scale(1.e2); SetRangeZ(h2, ipad==1?80:0., ipad==1?100.:10, ipad==1?30:0.01);
+    h2->GetZaxis()->SetTitle("Efficiency [%]"); h2->GetZaxis()->CenterTitle();
+    h2->Draw("colz");
+  }
+  for(Int_t il=0;il<3;il++){
+    if(!(h[il] = (TH1D*)fProj->FindObject(Form("HEffLb%d_z", il)))) continue;
+    h1[il]=new TH1F(Form("h1Lab%d", il), "", nbins+2, ptBins);
+    for(Int_t ip(0);ip<=(nbins+1);ip++) h1[il]->SetBinContent(ip+1, 1.e2*h[il]->GetBinContent(ip));
+    h1[il]->SetFillColor(il+2);
+    h1[il]->SetFillStyle(il==2?3002:1001);
+    h1[il]->SetLineColor(il+2);
+    h1[il]->SetLineWidth(1);
+  }
+  leg = new TLegend(0.671371,0.1313559,0.9576613,0.2923729,NULL,"brNDC");
+  leg->SetBorderSize(0); leg->SetFillColor(kWhite); leg->SetFillStyle(1001);
+  hs = new THStack("hLab","TRD Label;p_{t} [GeV/c];Efficiency [%]");
+  hs->Add(h1[1]);leg->AddEntry(h1[1], labMC[1], "f"); // good
+  hs->Add(h1[2]);leg->AddEntry(h1[2], labMC[2], "f"); // accept
+  hs->Add(h1[0]);leg->AddEntry(h1[0], labMC[0], "f"); // bad
+  p=cOut->cd(4); p->SetLeftMargin(0.08266129); p->SetRightMargin(0.0141129);p->SetTopMargin(0.006355932); p->SetLogx();
+  hs->Draw(); leg->Draw();
+  cOut->Modified();cOut->Update();
+  hs->GetXaxis()->SetRangeUser(0.6,10.);
+  hs->GetXaxis()->SetMoreLogLabels();
+  hs->GetXaxis()->SetTitleOffset(1.2);
+  hs->GetYaxis()->SetNdivisions(513);
+  hs->SetMinimum(80.);
+  hs->GetYaxis()->CenterTitle();
+  cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+}
index 87479d4..b10f434 100644 (file)
@@ -15,6 +15,7 @@
 #include "AliTRDrecoTask.h"
 #endif
 
+class AliTRDtrackV1;
 class TObjArray;
 class TList;
 class TClonesArray;
@@ -24,20 +25,29 @@ class AliTRDefficiency : public AliTRDrecoTask
 public:
   AliTRDefficiency();
   AliTRDefficiency(char* name);
-  virtual ~AliTRDefficiency();
-  void    UserCreateOutputObjects();
-  void    UserExec(Option_t *);
-  Bool_t  GetRefFigure(Int_t ifig);
-  Bool_t  PostProcess();
+  virtual       ~AliTRDefficiency();
+//  void        UserCreateOutputObjects();
+  void          LocalUserExec(Option_t *);
+  Bool_t        GetRefFigure(Int_t ifig);
+  static Int_t  GetPtBin(Float_t pt);
+  static Int_t  GetPtBinSignificant(Float_t pt);
+  TObjArray*    Histos();
+  TH1*          PlotBasicEff(const AliTRDtrackV1 *t=NULL);
+//  TH1*          PlotMC(const AliTRDtrackV1 *t=NULL);
+  void          MakeSummary();
+  Bool_t        PostProcess();
+  TObjArray*    Results() const {return fProj;}
+protected:
+  Bool_t        MakeProjectionBasicEff();
 
 private:
   AliTRDefficiency(const AliTRDefficiency&);
   AliTRDefficiency& operator=(const AliTRDefficiency&);
 
-private:
-  TClonesArray     *fMissed;            // Missed ?
+  TClonesArray     *fMissed;          // Missed ?
+  TObjArray        *fProj;            //! result holder - sigma values
 
-  ClassDef(AliTRDefficiency, 1) // TRD tracking efficiency
+  ClassDef(AliTRDefficiency, 2) // TRD tracking efficiency
 };
 
 #endif
index 748e9ad..3279655 100644 (file)
@@ -505,6 +505,11 @@ void AliTRDinfoGen::UserExec(Option_t *){
     if(esdTrack->GetStatus()&AliESDtrack::kTPCout) nTPC++;\r
     if(esdTrack->GetStatus()&AliESDtrack::kTRDout) nTRDout++;\r
     if(esdTrack->GetStatus()&AliESDtrack::kTRDin) nTRDin++;\r
+/*    printf("TRD[%c %c %c] N[%3d] label[%3d %3d]\n",\r
+      (esdTrack->GetStatus()&AliESDtrack::kTRDin)?'y':'n',\r
+      (esdTrack->GetStatus()&AliESDtrack::kTRDStop)?'y':'n',\r
+      (esdTrack->GetStatus()&AliESDtrack::kTRDout)?'y':'n',\r
+      esdTrack->GetTRDncls(), esdTrack->GetLabel(), esdTrack->GetTRDLabel());*/\r
     // look at external track param\r
     const AliExternalTrackParam *op = esdTrack->GetOuterParam();\r
     Double_t xyz[3];\r
@@ -545,6 +550,7 @@ void AliTRDinfoGen::UserExec(Option_t *){
       fTrackInfo->SetPDG(fPdg);\r
       fTrackInfo->SetPrimary(mcParticle->Particle()->IsPrimary());\r
       fTrackInfo->SetLabel(label);\r
+      fTrackInfo->SetTRDlabel(esdTrack->GetTRDLabel());\r
       Int_t jref = iref;//, kref = 0;\r
       while(jref<nRefs){\r
         ref = mcParticle->GetTrackReference(jref);\r
@@ -562,6 +568,10 @@ void AliTRDinfoGen::UserExec(Option_t *){
     Double_t p[AliPID::kSPECIES]; esdTrack->GetTRDpid(p);\r
     fTrackInfo->SetESDpid(p);\r
     fTrackInfo->SetESDpidQuality(esdTrack->GetTRDntrackletsPID());\r
+    fTrackInfo->SetESDeta(esdTrack->Eta());\r
+    Double_t loc[3];\r
+    if(esdTrack->GetXYZAt(298., fESDev->GetMagneticField(), loc)) fTrackInfo->SetESDphi(TMath::ATan2(loc[1], loc[0]));\r
+    fTrackInfo->SetESDpt(esdTrack->Pt());\r
     if(!nSlices) nSlices = esdTrack->GetNumberOfTRDslices();\r
     memset(dedx, 0, 100*sizeof(Double32_t));\r
     Int_t in(0);\r
@@ -596,6 +606,8 @@ void AliTRDinfoGen::UserExec(Option_t *){
     if(esdFriendTrack){\r
       fTrackInfo->SetTPCoutParam(esdFriendTrack->GetTPCOut());\r
       fTrackInfo->SetITSoutParam(esdFriendTrack->GetITSOut());\r
+      const AliTrackPointArray *tps(NULL);\r
+      if((tps=esdFriendTrack->GetTrackPointArray()) && HasTrackPoints()) fTrackInfo->SetTrackPointArray(tps);\r
       Int_t icalib = 0;\r
       while((calObject = esdFriendTrack->GetCalibObject(icalib++))){\r
         if(strcmp(calObject->IsA()->GetName(),"AliTRDtrackV1") != 0) continue; // Look for the TRDtrack\r
index dad0be3..3ba5a54 100644 (file)
@@ -36,6 +36,7 @@ public:
    ,kUseLocalTrkSelection = BIT(19)\r
    ,kCollision            = BIT(20)\r
    ,kOCDB                 = BIT(21)\r
+   ,kTrkPoints            = BIT(22)\r
   };\r
   enum AliTRDinfoGenObjects{\r
      kTracksESD =  0\r
@@ -79,6 +80,7 @@ public:
   // temporary until check with AliAnalysisTaskSE collision selection mechanism\r
   Bool_t  IsInitOCDB() const {return TestBit(kOCDB);}\r
   Bool_t  IsCollision() const {return TestBit(kCollision);}\r
+  Bool_t  HasTrackPoints() const {return TestBit(kTrkPoints);}\r
   void    MakeSummary();\r
   static const AliTRDReconstructor* Reconstructor() {return fgReconstructor;}\r
   static AliTRDgeometry*      Geometry() {return fgGeo;}\r
@@ -94,6 +96,7 @@ public:
 \r
   Bool_t  UseLocalEvSelection() const {return Bool_t(fEventCut);}\r
   Bool_t  UseLocalTrkSelection() const {return TestBit(kUseLocalTrkSelection);}\r
+  void    UseTrackPoints(Bool_t use=kTRUE) {SetBit(kTrkPoints, use);}\r
   void    UserCreateOutputObjects();\r
   void    UserExec(Option_t *);\r
   void    Terminate(Option_t* option = "");\r
index 8ee5aef..f87e10a 100644 (file)
@@ -22,6 +22,8 @@
 #include "TList.h"\r
 #include "TMap.h"\r
 #include "TH1.h"\r
+#include "TH2.h"\r
+#include "TH3.h"\r
 #include "TF1.h"\r
 #include "TObjArray.h"\r
 #include "TDirectory.h"\r
@@ -357,7 +359,7 @@ void AliTRDrecoTask::MakeDetectorPlot(Int_t ly, const Option_t *opt)
   }\r
   Float_t xmin(0.), xmax(0.);\r
   TBox *gdet = new TBox();\r
-  gdet->SetLineWidth(kBlack);gdet->SetFillColor(kBlack);\r
+  gdet->SetLineColor(kBlack);gdet->SetFillColor(kBlack);\r
   Int_t style[] = {0, 3003};\r
   for(Int_t idet(0); idet<540; idet++){\r
     if(idet%6 != ly) continue;\r
@@ -462,3 +464,244 @@ void AliTRDrecoTask::Adjust(TF1 *f, TH1 * const h)
   f->SetParLimits(5, 0., 1.e2);\r
   f->SetParameter(5, 2.e-1);\r
 }\r
+\r
+\r
+//________________________________________________________\r
+void AliTRDrecoTask::SetNormZ(TH2 *h2, Int_t bxmin, Int_t bxmax, Int_t bymin, Int_t bymax, Float_t thr)\r
+{\r
+// Normalize histo content to the mean value in the range specified by bin ranges\r
+// [bxmin, bxmax] on the x axis and [bymin, bymax] on the y axis.\r
+// Optionally a threshold "thr" can be specified to disregard entries with no meaning\r
+\r
+  Float_t s = 0., c=0.; Int_t is(0);\r
+  for(Int_t ix(bxmin); ix<=(bxmax>0?bxmax:(h2->GetXaxis()->GetNbins())); ix++){\r
+    for(Int_t iy(bymin); iy<=(bymax>0?bymax:(h2->GetYaxis()->GetNbins())); iy++){\r
+      if((c = h2->GetBinContent(ix, iy))<thr) continue;\r
+      s += c; is++;\r
+    }\r
+  }\r
+  s/= is?is:1;\r
+  for(Int_t ix(1); ix<=h2->GetXaxis()->GetNbins(); ix++){\r
+    for(Int_t iy(1); iy<=h2->GetYaxis()->GetNbins(); iy++){\r
+      if((c = h2->GetBinContent(ix, iy))<thr) h2->SetBinContent(ix, iy, thr-100);\r
+      else h2->SetBinContent(ix, iy, 100.*(c/s-1.));\r
+    }\r
+  }\r
+}\r
+\r
+//________________________________________________________\r
+void AliTRDrecoTask::SetRangeZ(TH2 *h2, Float_t min, Float_t max, Float_t thr)\r
+{\r
+// Set range on Z axis such to avoid outliers\r
+\r
+  Float_t c(0.), dz(1.e-3*(max-min));\r
+  for(Int_t ix(1); ix<=h2->GetXaxis()->GetNbins(); ix++){\r
+    for(Int_t iy(1); iy<=h2->GetYaxis()->GetNbins(); iy++){\r
+      if((c = h2->GetBinContent(ix, iy))<thr) continue;\r
+      if(c<=min) h2->SetBinContent(ix, iy, min+dz);\r
+    }\r
+  }\r
+  h2->GetZaxis()->SetRangeUser(min, max);\r
+}\r
+\r
+//________________________________________________________\r
+Float_t AliTRDrecoTask::GetMeanStat(TH1 *h, Float_t cut, Option_t *opt)\r
+{\r
+// return mean number of entries/bin of histogram "h"\r
+// if option "opt" is given the following values are accepted:\r
+//   "<" : consider only entries less than "cut"\r
+//   ">" : consider only entries greater than "cut"\r
+\r
+  //Int_t dim(h->GetDimension());\r
+  Int_t nbx(h->GetNbinsX()), nby(h->GetNbinsY()), nbz(h->GetNbinsZ());\r
+  Double_t sum(0.); Int_t n(0);\r
+  for(Int_t ix(1); ix<=nbx; ix++)\r
+    for(Int_t iy(1); iy<=nby; iy++)\r
+      for(Int_t iz(1); iz<=nbz; iz++){\r
+        if(strcmp(opt, "")==0){sum += h->GetBinContent(ix, iy, iz); n++;}\r
+        else{\r
+          if(strcmp(opt, "<")==0) {\r
+            if(h->GetBinContent(ix, iy, iz)<cut) {sum += h->GetBinContent(ix, iy, iz); n++;}\r
+          } else if(strcmp(opt, ">")==0){\r
+            if(h->GetBinContent(ix, iy, iz)>cut) {sum += h->GetBinContent(ix, iy, iz); n++;}\r
+          } else {sum += h->GetBinContent(ix, iy, iz); n++;}\r
+        }\r
+      }\r
+  return n>0?sum/n:0.;\r
+}\r
+\r
+//________________________________________________________\r
+AliTRDrecoTask::AliTRDrecoProjection::AliTRDrecoProjection()\r
+  :TNamed()\r
+  ,fH(NULL)\r
+  ,fNrebin(0)\r
+  ,fRebinX(NULL)\r
+  ,fRebinY(NULL)\r
+{\r
+  // constructor\r
+  memset(fAx, 0, 3*sizeof(Int_t));\r
+  memset(fRange, 0, 4*sizeof(Float_t));\r
+}\r
+\r
+//________________________________________________________\r
+AliTRDrecoTask::AliTRDrecoProjection::~AliTRDrecoProjection()\r
+{\r
+  // destructor\r
+  if(fH) delete fH;\r
+}\r
+\r
+//________________________________________________________\r
+void AliTRDrecoTask::AliTRDrecoProjection::Build(const Char_t *n, const Char_t *t, Int_t ix, Int_t iy, Int_t iz, TAxis *aa[])\r
+{\r
+// check and build (if neccessary) projection determined by axis "ix", "iy" and "iz"\r
+  if(!aa[ix] || !aa[iy] || !aa[iz]) return;\r
+  TAxis *ax(aa[ix]), *ay(aa[iy]), *az(aa[iz]);\r
+  // check ax definiton to protect against older versions of the data\r
+  if(ax->GetNbins()<=0 || (ax->GetXmax()-ax->GetXmin())<=0.){\r
+    AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, ax->GetTitle(), ax->GetNbins(), ax->GetXmin(), ax->GetXmax()));\r
+    return;\r
+  }\r
+  if(ay->GetNbins()<=0 || (ay->GetXmax()-ay->GetXmin())<=0.){\r
+    AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, ay->GetTitle(), ay->GetNbins(), ay->GetXmin(), ay->GetXmax()));\r
+    return;\r
+  }\r
+  if(az->GetNbins()<=0 || (az->GetXmax()-az->GetXmin())<=0.){\r
+    AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, az->GetTitle(), az->GetNbins(), az->GetXmin(), az->GetXmax()));\r
+    return;\r
+  }\r
+  SetNameTitle(n,t);\r
+  fH = new TH3I(n, Form("%s;%s;%s;%s", t, ax->GetTitle(), ay->GetTitle(), az->GetTitle()),\r
+    ax->GetNbins(), ax->GetXmin(), ax->GetXmax(),\r
+    ay->GetNbins(), ay->GetXmin(), ay->GetXmax(),\r
+    az->GetNbins(), az->GetXmin(), az->GetXmax());\r
+  fAx[0] = ix; fAx[1] = iy; fAx[2] = iz;\r
+  fRange[0] = az->GetXmin()/3.; fRange[1] = az->GetXmax()/3.;\r
+  AliDebug(2, Form("H3(%s, %s) :: %s[%3d %4.2f %4.2f]%s[%3d %4.2f %4.2f]%s[%3d %4.2f %4.2f]", n, t,\r
+    ax->GetTitle(), ax->GetNbins(), ax->GetXmin(), ax->GetXmax(),\r
+    ay->GetTitle(), ay->GetNbins(), ay->GetXmin(), ay->GetXmax(),\r
+    az->GetTitle(), az->GetNbins(), az->GetXmin(), az->GetXmax()));\r
+}\r
+\r
+//________________________________________________________\r
+AliTRDrecoTask::AliTRDrecoProjection& AliTRDrecoTask::AliTRDrecoProjection::operator=(const AliTRDrecoProjection& rhs)\r
+{\r
+// copy projections\r
+  if(this == &rhs) return *this;\r
+\r
+  TNamed::operator=(rhs);\r
+  if(fNrebin){fNrebin=0; delete [] fRebinX; delete [] fRebinY;}\r
+  if(rhs.fNrebin) SetRebinStrategy(rhs.fNrebin, rhs.fRebinX, rhs.fRebinY);\r
+  memcpy(fAx, rhs.fAx, 3*sizeof(Int_t));\r
+  memcpy(fRange, rhs.fRange, 4*sizeof(Float_t));\r
+  if(fH) delete fH;\r
+  if(rhs.fH) fH=(TH3I*)rhs.fH->Clone(Form("%s_CLONE", rhs.fH->GetName()));\r
+  return *this;\r
+}\r
+\r
+//________________________________________________________\r
+AliTRDrecoTask::AliTRDrecoProjection& AliTRDrecoTask::AliTRDrecoProjection::operator+=(const AliTRDrecoProjection& other)\r
+{\r
+// increment projections\r
+  if(!fH || !other.fH) return *this;\r
+  AliDebug(2, Form("%s+=%s [%s+=%s]", GetName(), other.GetName(), fH->GetName(), (other.fH)->GetName()));\r
+  fH->Add(other.fH);\r
+  return *this;\r
+}\r
+\r
+//________________________________________________________\r
+void AliTRDrecoTask::AliTRDrecoProjection::Increment(Int_t bin[], Double_t v)\r
+{\r
+// increment bin with value "v" pointed by general coord in "bin"\r
+  if(!fH) return;\r
+  AliDebug(4, Form("  %s[%2d]", fH->GetName(), Int_t(v)));\r
+  fH->AddBinContent(fH->GetBin(bin[fAx[0]],bin[fAx[1]],bin[fAx[2]]), Int_t(v));\r
+}\r
+\r
+//________________________________________________________\r
+TH2* AliTRDrecoTask::AliTRDrecoProjection::Projection2D(const Int_t nstat, const Int_t ncol, const Int_t mid, Bool_t del)\r
+{\r
+// build the 2D projection and adjust binning\r
+\r
+  const Char_t *title[] = {"Mean", "#mu", "MPV"};\r
+  if(!fH) return NULL;\r
+  TAxis *ax(fH->GetXaxis()), *ay(fH->GetYaxis()), *az(fH->GetZaxis());\r
+  TH2D *h2s(NULL), *hyx(NULL);\r
+  if(!(h2s = (TH2D*)fH->Project3D("yx"))) return NULL;\r
+  // save a copy of the original distribution\r
+  if(!del){\r
+    hyx = (TH2D*)h2s->Clone();\r
+    hyx->SetName(Form("%sEn", fH->GetName()));\r
+  }\r
+  Int_t irebin(0), dxBin(1), dyBin(1);\r
+  while(irebin<fNrebin && (AliTRDrecoTask::GetMeanStat(h2s, .5, ">")<nstat)){\r
+    h2s->Rebin2D(fRebinX[irebin], fRebinY[irebin]);\r
+    dxBin*=fRebinX[irebin];dyBin*=fRebinY[irebin];\r
+    irebin++;\r
+  }\r
+  Int_t nx(h2s->GetNbinsX()), ny(h2s->GetNbinsY());\r
+  delete h2s;\r
+  if(mid<0) return NULL;\r
+\r
+  // start projection\r
+  TH1 *h(NULL); Int_t n(0);\r
+  Float_t dz=(fRange[1]-fRange[1])/ncol;\r
+  TString titlez(az->GetTitle()); TObjArray *tokenTitle(titlez.Tokenize(" "));\r
+  Int_t nt(tokenTitle->GetEntriesFast());\r
+  TH2 *h2 = new TH2F(Form("%s_2D", fH->GetName()),\r
+            Form("%s;%s;%s;%s(%s) %s", fH->GetTitle(), ax->GetTitle(), ay->GetTitle(), title[mid], nt>0?(*tokenTitle)[0]->GetName():"", nt>1?(*tokenTitle)[1]->GetName():""),\r
+            nx, ax->GetXmin(), ax->GetXmax(), ny, ay->GetXmin(), ay->GetXmax());\r
+  h2->SetContour(ncol);\r
+  h2->GetZaxis()->CenterTitle();\r
+  h2->GetZaxis()->SetTitleOffset(1.4);\r
+  h2->GetZaxis()->SetRangeUser(fRange[0], fRange[1]);\r
+  AliDebug(2, Form("%s[%s] nx[%d] ny[%d]", h2->GetName(), h2->GetTitle(), nx, ny));\r
+  for(Int_t iy(0); iy<ny; iy++){\r
+    for(Int_t ix(0); ix<nx; ix++){\r
+      h = fH->ProjectionZ(Form("%s_z", h2->GetName()), ix*dxBin+1, (ix+1)*dxBin+1, iy*dyBin+1, (iy+1)*dyBin+1);\r
+      Int_t ne((Int_t)h->Integral());\r
+      if(ne<nstat/2){\r
+        h2->SetBinContent(ix+1, iy+1, -999);\r
+        h2->SetBinError(ix+1, iy+1, 1.);\r
+        n++;\r
+      }else{\r
+        Float_t v(h->GetMean()), ve(h->GetRMS());\r
+        if(mid==1){\r
+          TF1 fg("fg", "gaus", az->GetXmin(), az->GetXmax());\r
+          fg.SetParameter(0, Float_t(ne)); fg.SetParameter(1, v); fg.SetParameter(2, ve);\r
+          h->Fit(&fg, "WQ");\r
+          v = fg.GetParameter(1); ve = fg.GetParameter(2);\r
+        } else if (mid==2) {\r
+          TF1 fl("fl", "landau", az->GetXmin(), az->GetXmax());\r
+          fl.SetParameter(0, Float_t(ne)); fl.SetParameter(1, v); fl.SetParameter(2, ve);\r
+          h->Fit(&fl, "WQ");\r
+          v = fl.GetMaximumX(); ve = fl.GetParameter(2);\r
+/*          TF1 fgle("gle", "[0]*TMath::Landau(x, [1], [2], 1)*TMath::Exp(-[3]*x/[1])", az->GetXmin(), az->GetXmax());\r
+          fgle.SetParameter(0, fl.GetParameter(0));\r
+          fgle.SetParameter(1, fl.GetParameter(1));\r
+          fgle.SetParameter(2, fl.GetParameter(2));\r
+          fgle.SetParameter(3, 1.);fgle.SetParLimits(3, 0., 5.);\r
+          h->Fit(&fgle, "WQ");\r
+          v = fgle.GetMaximumX(); ve = fgle.GetParameter(2);*/\r
+        }\r
+        if(v<fRange[0]) h2->SetBinContent(ix+1, iy+1, fRange[0]+0.1*dz);\r
+        else h2->SetBinContent(ix+1, iy+1, v);\r
+        h2->SetBinError(ix+1, iy+1, ve);\r
+      }\r
+    }\r
+  }\r
+  if(h) delete h;\r
+  if(n==nx*ny){delete h2; h2=NULL;} // clean empty projections\r
+  return h2;\r
+}\r
+\r
+//________________________________________________________\r
+void AliTRDrecoTask::AliTRDrecoProjection::SetRebinStrategy(Int_t n, Int_t rebx[], Int_t reby[])\r
+{\r
+// define rebinning strategy for this projection\r
+  fNrebin = n;\r
+  fRebinX = new Int_t[n]; memcpy(fRebinX, rebx, n*sizeof(Int_t));\r
+  fRebinY = new Int_t[n]; memcpy(fRebinY, reby, n*sizeof(Int_t));\r
+}\r
+\r
+\r
+\r
index 47ab6aa..67819a1 100644 (file)
 #include "info/AliTRDeventInfo.h"\r
 #endif\r
 \r
+class TAxis;\r
 class TH1;\r
+class TH2;\r
+class TH3;\r
 class TF1;\r
 class TList;\r
 class TObjArray;\r
@@ -32,12 +35,38 @@ class AliTRDrecoTask : public AliAnalysisTaskSE
 friend class AliEveTRDTrackList;\r
 public:\r
   enum AliTRDrecoSteeringBits{\r
-    kMCdata       = BIT(18)\r
+     kMCdata      = BIT(18)\r
     ,kFriends     = BIT(19)\r
     ,kPostProcess = BIT(20)\r
-    ,kHeavyIon     = BIT(21)\r
+    ,kHeavyIon    = BIT(21)\r
   };\r
   \r
+  class AliTRDrecoProjection : public TNamed\r
+  {\r
+  public:\r
+    AliTRDrecoProjection();\r
+    virtual ~AliTRDrecoProjection();\r
+    AliTRDrecoProjection& operator+=(const AliTRDrecoProjection& other);\r
+    AliTRDrecoProjection& operator=(const AliTRDrecoProjection& other);\r
+    void  Build(const Char_t *n, const Char_t *t, Int_t ix, Int_t iy, Int_t iz, TAxis *aa[]);\r
+    void  Increment(Int_t bin[], Double_t v);\r
+    TH3*  H() const { return fH;}\r
+    TH2*  Projection2D(const Int_t nstat, const Int_t ncol, const Int_t mid=0, Bool_t del=kTRUE);\r
+    void  SetRebinStrategy(Int_t n, Int_t rebx[], Int_t reby[]);\r
+    void  SetShowRange(Float_t zm, Float_t zM, Float_t em=0., Float_t eM=0.) {fRange[0] = zm; fRange[1] = zM; fRange[2] = em; fRange[3] = eM;}\r
+  private:\r
+    AliTRDrecoProjection(const AliTRDrecoProjection&);\r
+  protected:\r
+    TH3  *fH;          // data container\r
+    Int_t fAx[3];      // projection axes\r
+    Int_t fNrebin;     // no. of rebinning steps\r
+    Int_t *fRebinX;    //[fNrebin] rebinning of the X axis\r
+    Int_t *fRebinY;    //[fNrebin] rebinning of the Y axis\r
+    Float_t fRange[4]; //show range of the z processed\r
+\r
+    ClassDef(AliTRDrecoProjection, 2)  // wrapper for a projection container THnSparse -> TH3\r
+  };\r
+\r
   AliTRDrecoTask();\r
   AliTRDrecoTask(const char *name, const char *title);\r
   virtual ~AliTRDrecoTask();\r
@@ -48,6 +77,7 @@ public:
   virtual void   SetDebugLevel(Int_t level);\r
   \r
     \r
+  static Float_t GetMeanStat(TH1 *h, Float_t cut=0., Option_t *opt="");\r
   Int_t          GetNRefFigures() const; \r
   const Char_t*  GetNameId() const       { return fNameId;}\r
   TList*         GetPlotFunctors() const { return fPlotFuncList;}\r
@@ -71,6 +101,8 @@ public:
   virtual void   SetMCdata(Bool_t mc = kTRUE) {SetBit(kMCdata, mc);}\r
   virtual void   SetNameId(const Char_t *nid) {snprintf(fNameId, 10, "%s", nid);}\r
   virtual void   SetPostProcess(Bool_t pp = kTRUE) {SetBit(kPostProcess, pp);}\r
+  static void    SetNormZ(TH2 *h2, Int_t bxmin=1, Int_t bxmax=-1, Int_t bymin=1, Int_t bymax=-1, Float_t thr=0.);\r
+  static void    SetRangeZ(TH2 *h2, Float_t m, Float_t M, Float_t thr=0.);\r
   void SetRunTerminate(Bool_t runTerminate = kTRUE) { fRunTerminate = runTerminate; }\r
   virtual void   Terminate(Option_t *);\r
 \r
@@ -79,6 +111,7 @@ protected:
   virtual void   InitFunctorList();\r
   void           Adjust(TF1 *f, TH1 * const h);\r
   Bool_t         HasFunctorList() const { return fPlotFuncList != NULL; }\r
+\r
   Char_t                fNameId[10];       // unique identifier of task particularity\r
   UChar_t               fNRefFigures;      // no of reference figures reported by task\r
   TObjArray             *fDets;            //! container to store detector position and status\r
index c83e39d..d476032 100644 (file)
@@ -93,7 +93,7 @@
 #include "info/AliTRDeventInfo.h"
 
 ClassImp(AliTRDresolution)
-ClassImp(AliTRDresolution::AliTRDresolutionProjection)
+ClassImp(AliTRDresolution::AliTRDrecoProjection)
 
 Int_t const   AliTRDresolution::fgkNbins[kNdim] = {
   Int_t(kNbunchCross)/*bc*/,
@@ -960,31 +960,6 @@ Int_t AliTRDresolution::GetPtBin(Float_t pt)
   return ipt;
 }
 
-//________________________________________________________
-Float_t AliTRDresolution::GetMeanStat(TH1 *h, Float_t cut, Option_t *opt)
-{
-// return mean number of entries/bin of histogram "h"
-// if option "opt" is given the following values are accepted:
-//   "<" : consider only entries less than "cut"
-//   ">" : consider only entries greater than "cut"
-
-  //Int_t dim(h->GetDimension());
-  Int_t nbx(h->GetNbinsX()), nby(h->GetNbinsY()), nbz(h->GetNbinsZ());
-  Double_t sum(0.); Int_t n(0);
-  for(Int_t ix(1); ix<=nbx; ix++)
-    for(Int_t iy(1); iy<=nby; iy++)
-      for(Int_t iz(1); iz<=nbz; iz++){
-        if(strcmp(opt, "")==0){sum += h->GetBinContent(ix, iy, iz); n++;}
-        else{
-          if(strcmp(opt, "<")==0) {
-            if(h->GetBinContent(ix, iy, iz)<cut) {sum += h->GetBinContent(ix, iy, iz); n++;}
-          } else if(strcmp(opt, ">")==0){
-            if(h->GetBinContent(ix, iy, iz)>cut) {sum += h->GetBinContent(ix, iy, iz); n++;}
-          } else {sum += h->GetBinContent(ix, iy, iz); n++;}
-        }
-      }
-  return n>0?sum/n:0.;
-}
 
 //________________________________________________________
 void AliTRDresolution::GetRangeZ(TH2 *h2, Float_t &min, Float_t &max)
@@ -1368,7 +1343,7 @@ Bool_t AliTRDresolution::MakeProjectionDetector()
   const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 2, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
   //const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"0-10%", "10-20%", "20-50%", "50-80%", "80-100%"};
   const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"};
-  AliTRDresolutionProjection hp[kDetNproj];  TObjArray php(kDetNproj);
+  AliTRDrecoProjection hp[kDetNproj];  TObjArray php(kDetNproj);
   Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
   for(Int_t ipad(0); ipad<nPad; ipad++){
     for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){
@@ -1393,37 +1368,37 @@ Bool_t AliTRDresolution::MakeProjectionDetector()
     npad = 0;             // no. of pads selection
     if(an) npad = TMath::Min(coord[5]-1, Int_t(kNpads));
     isel = npad*AliTRDeventInfo::kCentralityClasses*AliTRDgeometry::kNlayer+cen*AliTRDgeometry::kNlayer+ly;
-    ((AliTRDresolutionProjection*)php.At(isel))->Increment(coord, v);
-    //Int_t ioff=isel;for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
+    ((AliTRDrecoProjection*)php.At(isel))->Increment(coord, v);
+    //Int_t ioff=isel;for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v);
   }
   TObjArray *arr(NULL);
   fProj->AddAt(arr = new TObjArray(kDetNproj), kDetector);
 
   TH2 *h2(NULL);  Int_t jh(0);
   for(; ih--; ){
-    if(!hp[ih].fH) continue;
+    if(!hp[ih].H()) continue;
     if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours, 0, kFALSE))) continue;
     arr->AddAt(h2, jh++);
-    if(!(h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].fH->GetName())))) continue;
+    if(!(h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].H()->GetName())))) continue;
     arr->AddAt(h2, jh++);
   }
-  AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
+  AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
   for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
     for(Int_t icen(0); icen<AliTRDeventInfo::kCentralityClasses; icen++){
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, 0)))){
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, 0)))){
         for(Int_t ipad(1); ipad<nPad; ipad++){
-          if((pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, ipad)))){
+          if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, icen, ipad)))){
             (*pr0)+=(*pr1);
           }
         }
-        pr0->fH->SetNameTitle(Form("HDet%d%d", ily, icen), Form("Detectors :: Ly[%d] Cen[%s]", ily, cenName[icen]));
+        pr0->H()->SetNameTitle(Form("HDet%d%d", ily, icen), Form("Detectors :: Ly[%d] Cen[%s]", ily, cenName[icen]));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 0, kFALSE))) arr->AddAt(h2, jh++);
-        if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->fH->GetName())))) arr->AddAt(h2, jh++);
-        if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))) (*pr1)+=(*pr0);
+        if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++);
+        if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))) (*pr1)+=(*pr0);
       }
     }
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))){
-      pr0->fH->SetNameTitle(Form("HDet%d", ily), Form("Detectors :: Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HDet%d%d%d", ily, 0, 0)))){
+      pr0->H()->SetNameTitle(Form("HDet%d", ily), Form("Detectors :: Ly[%d]", ily));
       if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
     }
   }
@@ -1466,7 +1441,7 @@ Bool_t AliTRDresolution::MakeProjectionCluster(Bool_t mc)
   const Int_t nsel(AliTRDgeometry::kNlayer*kNcharge*(kNpads+1)*AliTRDeventInfo::kCentralityClasses);
   // define rebinning strategy
   const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
-  AliTRDresolutionProjection hp[kClNproj];  TObjArray php(kClNproj);
+  AliTRDrecoProjection hp[kClNproj];  TObjArray php(kClNproj);
   const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'};
   const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"2800-inf", "2100-2799", "1400-2099", "700-1399", "0-699"};
   Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
@@ -1501,7 +1476,7 @@ Bool_t AliTRDresolution::MakeProjectionCluster(Bool_t mc)
   }
   AliInfo(Form("Build %3d 3D projections.", ih));
 
-  AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
+  AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
   Int_t ly(0), ch(0), rcBin(as?as->FindBin(0.):-1), chBin(apt?apt->FindBin(0.):-1), ioff(0), cen(0), npad(0);
   for (Long64_t ib(0); ib < H->GetNbins(); ib++) {
     v = H->GetBinContent(ib, coord); if(v<1.) continue;
@@ -1530,26 +1505,26 @@ Bool_t AliTRDresolution::MakeProjectionCluster(Bool_t mc)
       AliError(Form("Wrong selection %d [%3d]", ioff, ih));
       return kFALSE;
     }
-    if(!(pr0=(AliTRDresolutionProjection*)php.At(ioff))) {
+    if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) {
       AliError(Form("Missing projection %d", ioff));
       return kFALSE;
     }
-    if(strcmp(pr0->fH->GetName(), Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ch], ly, cen, npad))!=0){
-      AliError(Form("Projection mismatch :: request[H%sClY%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ly, cen, npad, pr0->fH->GetName()));
+    if(strcmp(pr0->H()->GetName(), Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ch], ly, cen, npad))!=0){
+      AliError(Form("Projection mismatch :: request[H%sClY%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ly, cen, npad, pr0->H()->GetName()));
       return kFALSE;
     }
-    for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
+    for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v);
   }
   TObjArray *arr(NULL);
   fProj->AddAt(arr = new TObjArray(kClNproj), cidx);
 
   TH2 *h2(NULL);  Int_t jh(0);
   for(; ih--; ){
-    if(!hp[ih].fH) continue;
-    if(strchr(hp[ih].fH->GetName(), 'Q')){
+    if(!hp[ih].H()) continue;
+    if(strchr(hp[ih].H()->GetName(), 'Q')){
       if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours, 0, kFALSE))) continue;
       arr->AddAt(h2, jh++);
-      if(!(h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].fH->GetName())))) continue;
+      if(!(h2 = (TH2*)gDirectory->Get(Form("%sEn", hp[ih].H()->GetName())))) continue;
       arr->AddAt(h2, jh++);
     } else {
       if((h2 = hp[ih].Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
@@ -1559,88 +1534,88 @@ Bool_t AliTRDresolution::MakeProjectionCluster(Bool_t mc)
     for(Int_t ich(0); ich<nCh; ich++){
       for(Int_t icen(0); icen<nCen; icen++){
         /*!dy*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
           for(Int_t ipad(1); ipad<nNpad; ipad++){
-            if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
+            if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
             (*pr0)+=(*pr1);
           }
-          pr0->fH->SetNameTitle(Form("H%sClY%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+          pr0->H()->SetNameTitle(Form("H%sClY%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-          if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
+          if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
         }
         /*!Q*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
           for(Int_t ipad(1); ipad<nNpad; ipad++){
-            if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
+            if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
             (*pr0)+=(*pr1);
           }
-          pr0->fH->SetNameTitle(Form("H%sClQ%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: Q Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+          pr0->H()->SetNameTitle(Form("H%sClQ%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: Q Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 2, kFALSE))) arr->AddAt(h2, jh++);
-          if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->fH->GetName())))) arr->AddAt(h2, jh++);
-          pr0->fH->SetName(Form("H%sClQS%c%d%d", mc?"MC":"", chName[ich], ily, icen));
+          if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++);
+          pr0->H()->SetName(Form("H%sClQS%c%d%d", mc?"MC":"", chName[ich], ily, icen));
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
-          if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
+          if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
         }
         /*!YXTC*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
           for(Int_t ipad(1); ipad<nNpad; ipad++){
-            if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
+            if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
             (*pr0)+=(*pr1);
           }
-          pr0->fH->SetNameTitle(Form("H%sClYXTC%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay(x,TC) Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+          pr0->H()->SetNameTitle(Form("H%sClYXTC%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay(x,TC) Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-          if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
+          if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
         }
         /*!YXPh*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, icen, 0)))){
           for(Int_t ipad(1); ipad<nNpad; ipad++){
-            if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
+            if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[1], ily, icen, ipad)))) continue;
             (*pr0)+=(*pr1);
           }
-          pr0->fH->SetNameTitle(Form("H%sClYXPh%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay(x,#Phi) Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
+          pr0->H()->SetNameTitle(Form("H%sClYXPh%c%d%d", mc?"MC":"", chName[ich], ily, icen), Form("Clusters[%c] :: #Deltay(x,#Phi) Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-          if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
+          if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))) (*pr1)+=(*pr0);
         }
       } // end centrality integration
       /*!dy*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
-        pr0->fH->SetNameTitle(Form("H%sClY%c%d", mc?"MC":"", chName[ich], ily),
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
+        pr0->H()->SetNameTitle(Form("H%sClY%c%d", mc?"MC":"", chName[ich], ily),
                               Form("Clusters[%c]:: #Deltay Ly[%d]", chSgn[ich], ily));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
       }
       /*!Q*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
-        pr0->fH->SetNameTitle(Form("H%sClQ%c%d", mc?"MC":"", chName[ich], ily),
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
+        pr0->H()->SetNameTitle(Form("H%sClQ%c%d", mc?"MC":"", chName[ich], ily),
                               Form("Clusters[%c]:: Q Ly[%d]", chSgn[ich], ily));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++);
-        pr0->fH->SetName(Form("H%sClQS%c%d", mc?"MC":"", chName[ich], ily));
+        pr0->H()->SetName(Form("H%sClQS%c%d", mc?"MC":"", chName[ich], ily));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClQ%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
       }
       /*!YXTC*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
-        pr0->fH->SetNameTitle(Form("H%sClYXTC%c%d", mc?"MC":"", chName[ich], ily),
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
+        pr0->H()->SetNameTitle(Form("H%sClYXTC%c%d", mc?"MC":"", chName[ich], ily),
                               Form("Clusters[%c]:: #Deltay(x,TC) Ly[%d]", chSgn[ich], ily));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXTC%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
       }
       /*!YXPh*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
-        pr0->fH->SetNameTitle(Form("H%sClYXPh%c%d", mc?"MC":"", chName[ich], ily),
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[ich], ily, 0, 0)))){
+        pr0->H()->SetNameTitle(Form("H%sClYXPh%c%d", mc?"MC":"", chName[ich], ily),
                               Form("Clusters[%c]:: #Deltay(x,#Phi) Ly[%d]", chSgn[ich], ily));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))) (*pr1)+=(*pr0);
       }
     } // end charge integration
     /*!dy*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){
-      pr0->fH->SetNameTitle(Form("H%sClY%d", mc?"MC":"", ily), Form("Clusters :: #Deltay Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClY%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){
+      pr0->H()->SetNameTitle(Form("H%sClY%d", mc?"MC":"", ily), Form("Clusters :: #Deltay Ly[%d]", ily));
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
     }
     /*!YXPh*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){
-      pr0->fH->SetNameTitle(Form("H%sClYXPh%d", mc?"MC":"", ily), Form("Clusters :: #Deltay Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sClYXPh%c%d%d%d", mc?"MC":"", chName[0], ily, 0, 0)))){
+      pr0->H()->SetNameTitle(Form("H%sClYXPh%d", mc?"MC":"", ily), Form("Clusters :: #Deltay Ly[%d]", ily));
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
     }
 
@@ -1686,7 +1661,7 @@ Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc)
   const Int_t nsel(AliTRDeventInfo::kCentralityClasses*AliTRDgeometry::kNlayer*kNpt*(AliPID::kSPECIES*kNcharge + 1));
   // define rebinning strategy
   const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
-  AliTRDresolutionProjection hp[kTrkltNproj]; TObjArray php(kTrkltNproj);
+  AliTRDrecoProjection hp[kTrkltNproj]; TObjArray php(kTrkltNproj);
   Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
   const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'};
   const Char_t ptName[kNpt] = {'l', 'i', 'h'};
@@ -1757,7 +1732,7 @@ Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc)
   }
   AliInfo(Form("Build %3d 3D projections.", ih));
 
-  AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
+  AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
   Int_t ly(0), ch(0), sp(2), rcBin(as?as->FindBin(0.):-1), pt(0), cen(0), ioff(0), jspc(nSpc*nCh+1), kspc(nSpc*nCh*4+1);
   for (Long64_t ib(0); ib < H->GetNbins(); ib++) {
     v = H->GetBinContent(ib, coord);
@@ -1788,31 +1763,31 @@ Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc)
       AliError(Form("Wrong selection %d [%3d]", ioff, ih));
       return kFALSE;
     }
-    if(!(pr0=(AliTRDresolutionProjection*)php.At(ioff))) {
+    if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) {
       AliError(Form("Missing projection %d", ioff));
       return kFALSE;
     }
     if(sp>=0){
-      if(strcmp(pr0->fH->GetName(), Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ch], ptName[pt], sp, ly, cen))!=0){
-        AliError(Form("Projection mismatch :: request[H%sTrkltY%c%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ptName[pt], sp, ly, cen, pr0->fH->GetName()));
+      if(strcmp(pr0->H()->GetName(), Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ch], ptName[pt], sp, ly, cen))!=0){
+        AliError(Form("Projection mismatch :: request[H%sTrkltY%c%c%d%d%d] found[%s]", mc?"MC":"", chName[ch], ptName[pt], sp, ly, cen, pr0->H()->GetName()));
         return kFALSE;
       }
     } else {
-      if(strcmp(pr0->fH->GetName(), Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[pt], ly, cen))!=0){
-        AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c%d%d] found[%s]", mc?"MC":"", ptName[pt], ly, cen, pr0->fH->GetName()));
+      if(strcmp(pr0->H()->GetName(), Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[pt], ly, cen))!=0){
+        AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c%d%d] found[%s]", mc?"MC":"", ptName[pt], ly, cen, pr0->H()->GetName()));
         return kFALSE;
       }
     }
-    for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
+    for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v);
   }
   TObjArray *arr(NULL);
   fProj->AddAt(arr = new TObjArray(kTrkltNproj), cidx);
 
   TH2 *h2(NULL); Int_t jh(0);
   for(; ih--; ){
-    if(!hp[ih].fH) continue;
+    if(!hp[ih].H()) continue;
     Int_t mid(0), nstat(kNstat);
-    if(strchr(hp[ih].fH->GetName(), 'Q')){ mid=2; nstat=kNstatQ;}
+    if(strchr(hp[ih].H()->GetName(), 'Q')){ mid=2; nstat=kNstatQ;}
     if(!(h2 = hp[ih].Projection2D(nstat, kNcontours, mid))) continue;
     arr->AddAt(h2, jh++);
   }
@@ -1822,160 +1797,160 @@ Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc)
       for(Int_t icen(0); icen<nCen; icen++){
         for(Int_t ipt(0); ipt<nPt; ipt++){
           /*!dy*/
-          if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
+          if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
             for(Int_t isp(1); isp<nSpc; isp++){
-              if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
+              if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
               (*pr0)+=(*pr1);
             }
-            pr0->fH->SetNameTitle(Form("H%sTrkltY%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
+            pr0->H()->SetNameTitle(Form("H%sTrkltY%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
                                       Form("Tracklets[%c]:: #Deltay{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
             if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-            if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
+            if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
           }
           /*!dphi*/
-          if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
+          if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
             for(Int_t isp(1); isp<nSpc; isp++){
-              if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
+              if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
               (*pr0)+=(*pr1);
             }
-            pr0->fH->SetNameTitle(Form("H%sTrkltPh%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
+            pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
                                       Form("Tracklets[%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
             if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-            if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
+            if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
           }
           /*!dQ/dl*/
-          if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
+          if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
             for(Int_t isp(1); isp<nSpc; isp++){
-              if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
+              if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
               (*pr0)+=(*pr1);
             }
-            pr0->fH->SetNameTitle(Form("H%sTrkltQ%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
+            pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
                                       Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
             if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++);
-            pr0->fH->SetNameTitle(Form("H%sTrkltQS%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
+            pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
                                       Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
             pr0->SetShowRange(2.4, 5.1);
             if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
-            if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
+            if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
           }
           /*!TB occupancy*/
-          if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
+          if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], 0, ily, icen)))){
             for(Int_t isp(1); isp<nSpc; isp++){
-              if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
+              if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen)))) continue;
               (*pr0)+=(*pr1);
             }
-            pr0->fH->SetNameTitle(Form("H%sTrkltTB%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
+            pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%c%d%d", mc?"MC":"", chName[ich], ptName[ipt], ily, icen),
                                       Form("Tracklets[%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
             if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
-            if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
+            if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))) (*pr1)+=(*pr0);
           }
         } // end pt integration
         /*!dy*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
-          pr0->fH->SetNameTitle(Form("H%sTrkltY%c%d%d", mc?"MC":"", chName[ich], ily, icen),
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
+          pr0->H()->SetNameTitle(Form("H%sTrkltY%c%d%d", mc?"MC":"", chName[ich], ily, icen),
                                 Form("Tracklets[%c]:: #Deltay Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-          if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+          if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
         }
         /*!dphi*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
-          pr0->fH->SetNameTitle(Form("H%sTrkltPh%c%d%d", mc?"MC":"", chName[ich], ily, icen),
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
+          pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%d%d", mc?"MC":"", chName[ich], ily, icen),
                                 Form("Tracklets[%c]:: #Delta#phi Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-          if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+          if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
         }
         /*!dQ/dl*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
-          pr0->fH->SetNameTitle(Form("H%sTrkltQ%c%d%d", mc?"MC":"", chName[ich], ily, icen),
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
+          pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%d%d", mc?"MC":"", chName[ich], ily, icen),
                                 Form("Tracklets[%c]:: dQdl Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
           pr0->SetShowRange(1.,2.3);
           if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++);
-          pr0->fH->SetNameTitle(Form("H%sTrkltQS%c%d%d", mc?"MC":"", chName[ich], ily, icen),
+          pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%d%d", mc?"MC":"", chName[ich], ily, icen),
                                 Form("Tracklets[%c]:: dQdl Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
           pr0->SetShowRange(2.4,5.1);
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
-          if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+          if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
         }
         /*!TB occupancy*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
-          pr0->fH->SetNameTitle(Form("H%sTrkltTB%c%d%d", mc?"MC":"", chName[ich], ily, icen),
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, icen)))){
+          pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%d%d", mc?"MC":"", chName[ich], ily, icen),
                                 Form("Tracklets[%c]:: OccupancyTB Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
           if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
-          if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+          if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
         }
       } // end centrality integration
       /*!dy*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
-        pr0->fH->SetNameTitle(Form("H%sTrkltY%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: #Deltay Ly[%d]", chSgn[ich], ily));
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
+        pr0->H()->SetNameTitle(Form("H%sTrkltY%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: #Deltay Ly[%d]", chSgn[ich], ily));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
       }
       /*!dphi*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
-        pr0->fH->SetNameTitle(Form("H%sTrkltPh%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: #Delta#phi Ly[%d]", chSgn[ich], ily));
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
+        pr0->H()->SetNameTitle(Form("H%sTrkltPh%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: #Delta#phi Ly[%d]", chSgn[ich], ily));
         pr0->SetShowRange(-.9,.9);
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
       }
       /*!dQ/dl*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
-        pr0->fH->SetNameTitle(Form("H%sTrkltQ%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], ily));
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
+        pr0->H()->SetNameTitle(Form("H%sTrkltQ%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], ily));
         pr0->SetShowRange(1.,2.3);
         if((h2 = pr0->Projection2D(kNstatQ, kNcontours, 2))) arr->AddAt(h2, jh++);
-        pr0->fH->SetNameTitle(Form("H%sTrkltQS%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], ily));
+        pr0->H()->SetNameTitle(Form("H%sTrkltQS%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: dQdl Ly[%d]", chSgn[ich], ily));
         pr0->SetShowRange(2.4,5.1);
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
       }
       /*!TB occupancy*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
-        pr0->fH->SetNameTitle(Form("H%sTrkltTB%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: OccupancyTB Ly[%d]", chSgn[ich], ily));
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[0], 0, ily, 0)))){
+        pr0->H()->SetNameTitle(Form("H%sTrkltTB%c%d", mc?"MC":"", chName[ich], ily), Form("Tracklets[%c] :: OccupancyTB Ly[%d]", chSgn[ich], ily));
         if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))) (*pr1)+=(*pr0);
       }
     } // end charge integration
     /*!dy*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkltY%d", mc?"MC":"", ily), Form("Tracklets :: #Deltay Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkltY%d", mc?"MC":"", ily), Form("Tracklets :: #Deltay Ly[%d]", ily));
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
     }
     /*!dphi*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkltPh%d", mc?"MC":"", ily), Form("Tracklets :: #Delta#phi Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkltPh%d", mc?"MC":"", ily), Form("Tracklets :: #Delta#phi Ly[%d]", ily));
       pr0->SetShowRange(-.45,.45);
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
     }
     /*!dQdl*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkltQ%d", mc?"MC":"", ily), Form("Tracklets :: dQdl Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkltQ%d", mc?"MC":"", ily), Form("Tracklets :: dQdl Ly[%d]", ily));
       pr0->SetShowRange(1.,2.3);
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++);
-      pr0->fH->SetName(Form("H%sTrkltQS%d", mc?"MC":"", ily));
+      pr0->H()->SetName(Form("H%sTrkltQS%d", mc?"MC":"", ily));
       pr0->SetShowRange(2.4,5.1);
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
     }
     /*!TB occupancy*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkltTB%d", mc?"MC":"", ily), Form("Tracklets :: OccupancyTB Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[0], ptName[0], 0, ily, 0)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkltTB%d", mc?"MC":"", ily), Form("Tracklets :: OccupancyTB Ly[%d]", ily));
       if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
     }
 
     /*! Row Cross processing*/
     for(Int_t icen(0); icen<nCen; icen++){
       /*!RC dz*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, icen)))){
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, icen)))){
         for(Int_t ipt(0); ipt<kNpt; ipt++){
-          if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[ipt], ily, icen)))) continue;
+          if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[ipt], ily, icen)))) continue;
           (*pr0)+=(*pr1);
         }
-        pr0->fH->SetNameTitle(Form("H%sTrkltRCZ%d%d", mc?"MC":"", ily, icen), Form("Tracklets[RC]:: #Deltaz Ly[%d] Cen[%s]", ily, cenName[icen]));
+        pr0->H()->SetNameTitle(Form("H%sTrkltRCZ%d%d", mc?"MC":"", ily, icen), Form("Tracklets[RC]:: #Deltaz Ly[%d] Cen[%s]", ily, cenName[icen]));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(icen && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, 0)))) (*pr1)+=(*pr0);
+        if(icen && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, 0)))) (*pr1)+=(*pr0);
       }
     } // end centrality integration for row cross
     /*!RC dz*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, 0)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkltRCZ%d", mc?"MC":"", ily), Form("Tracklets[RC] :: #Deltaz Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkltRCZ%c%d%d", mc?"MC":"", ptName[0], ily, 0)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkltRCZ%d", mc?"MC":"", ily), Form("Tracklets[RC] :: #Deltaz Ly[%d]", ily));
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
     }
   } // end layer loop
@@ -2021,7 +1996,7 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
   const Char_t *ptCut[kNpt] = {"p_{t}[GeV/c]<0.8", "0.8<=p_{t}[GeV/c]<1.5", "p_{t}[GeV/c]>=1.5"};
   // define rebinning strategy
   const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
-  AliTRDresolutionProjection hp[kMCTrkInNproj]; TObjArray php(kMCTrkInNproj+2);
+  AliTRDrecoProjection hp[kMCTrkInNproj]; TObjArray php(kMCTrkInNproj+2);
   Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
   // define list of projections
   for(Int_t ipt(0); ipt<nPt; ipt++){
@@ -2078,7 +2053,7 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
 
   // fill projections
   Int_t ch(0), pt(0), sp(1), rcBin(as?as->FindBin(0.):-1), ioff(0);
-  AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
+  AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
   for (Long64_t ib(0); ib < H->GetNbins(); ib++) {
     v = H->GetBinContent(ib, coord);
     if(v<1.) continue;
@@ -2105,122 +2080,122 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
       AliError(Form("Wrong selection %d [%3d]", ioff, ih));
       return kFALSE;
     }
-    if(!(pr0=(AliTRDresolutionProjection*)php.At(ioff))) {
+    if(!(pr0=(AliTRDrecoProjection*)php.At(ioff))) {
       AliError(Form("Missing projection %d", ioff));
       return kFALSE;
     }
     if(sp>=0 && ch<2){
-      if(strcmp(pr0->fH->GetName(), Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ch], ptName[pt], sp))!=0){
-        AliError(Form("Projection mismatch :: request[H%sTrkInY%c%c%d] found[%s]", mc?"MC":"", chName[ch], ptName[pt], sp, pr0->fH->GetName()));
+      if(strcmp(pr0->H()->GetName(), Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ch], ptName[pt], sp))!=0){
+        AliError(Form("Projection mismatch :: request[H%sTrkInY%c%c%d] found[%s]", mc?"MC":"", chName[ch], ptName[pt], sp, pr0->H()->GetName()));
         return kFALSE;
       }
     } else {
-      if(strcmp(pr0->fH->GetName(), Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[pt]))!=0){
-        AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c] found[%s]", mc?"MC":"", ptName[pt], pr0->fH->GetName()));
+      if(strcmp(pr0->H()->GetName(), Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[pt]))!=0){
+        AliError(Form("Projection mismatch :: request[H%sTrkltRCZ%c] found[%s]", mc?"MC":"", ptName[pt], pr0->H()->GetName()));
         return kFALSE;
       }
     }
-    for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
+    for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v);
   }
   TObjArray *arr(NULL);
   fProj->AddAt(arr = new TObjArray(mc?kMCTrkInNproj:kTrkInNproj), cidx);
 
   TH2 *h2(NULL); Int_t jh(0);
   for(; ih--; ){
-    if(!hp[ih].fH) continue;
+    if(!hp[ih].H()) continue;
     if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours))) continue;
     arr->AddAt(h2, jh++);
   }
   // build combined performance plots
   // combine up the tree of projections
-  AliTRDresolutionProjection xlow[2], specY[kNcharge*AliPID::kSPECIES], specPh[kNcharge*AliPID::kSPECIES], specQ[kNcharge*AliPID::kSPECIES];
+  AliTRDrecoProjection xlow[2], specY[kNcharge*AliPID::kSPECIES], specPh[kNcharge*AliPID::kSPECIES], specQ[kNcharge*AliPID::kSPECIES];
   for(Int_t ich(0); ich<kNcharge; ich++){
     // PID dependency - summation over pt
     for(Int_t isp(0); isp<AliPID::kSPECIES; isp++){
       /*!dy*/
       Int_t idx(ich*AliPID::kSPECIES+isp);
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){
         specY[idx] = (*pr0);
         specY[idx].SetNameTitle(Form("H%sTrkInY%c%d", mc?"MC":"", chName[ich], isp), "Sum over pt");
-        specY[idx].fH->SetNameTitle(Form("H%sTrkInY%c%d", mc?"MC":"", chName[ich], isp),
+        specY[idx].H()->SetNameTitle(Form("H%sTrkInY%c%d", mc?"MC":"", chName[ich], isp),
                               Form("TrackIn[%s%c]:: #Deltay", AliPID::ParticleLatexName(isp), chSgn[ich]));
         for(Int_t ipt(1); ipt<nPt; ipt++){
-          if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+          if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
           specY[idx]+=(*pr1);
         }
         php.AddLast(&specY[idx]);
         if((h2 = specY[idx].Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++);
-        if((h2 = (TH2*)gDirectory->Get(Form("%sEn", specY[idx].fH->GetName())))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specY[idx];
+        if((h2 = (TH2*)gDirectory->Get(Form("%sEn", specY[idx].H()->GetName())))) arr->AddAt(h2, jh++);
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specY[idx];
       }
       /*!dphi*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){
         specPh[idx] = (*pr0);
         specPh[idx].SetNameTitle(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[ich], isp), "Sum over pt");
-        specPh[idx].fH->SetNameTitle(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[ich], isp),
+        specPh[idx].H()->SetNameTitle(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[ich], isp),
                               Form("TrackIn[%s%c]:: #Delta#phi", AliPID::ParticleLatexName(isp), chSgn[ich]));
         specPh[idx].SetShowRange(-1.5, 1.5);
         for(Int_t ipt(1); ipt<nPt; ipt++){
-          if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+          if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
           specPh[idx]+=(*pr1);
         }
         php.AddLast(&specPh[idx]);
         if((h2 = specPh[idx].Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specPh[idx];
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specPh[idx];
       }
       /*!dQdl*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", mc?"MC":"", chName[ich], ptName[0], isp)))){
         specQ[idx] = (*pr0);
         specQ[idx].SetNameTitle(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[ich], isp), "Sum over pt");
-        specQ[idx].fH->SetNameTitle(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[ich], isp),
+        specQ[idx].H()->SetNameTitle(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[ich], isp),
                               Form("TrackIn[%s%c]:: dQdl", AliPID::ParticleLatexName(isp), chSgn[ich]));
         specQ[idx].SetShowRange(-2.2, -1.75);
-        specQ[idx].fH->GetZaxis()->SetTitle("dQdl [a.u.]");
+        specQ[idx].H()->GetZaxis()->SetTitle("dQdl [a.u.]");
         for(Int_t ipt(1); ipt<nPt; ipt++){
-          if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+          if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
           specQ[idx]+=(*pr1);
         }
         php.AddLast(&specQ[idx]);
         if((h2 = specQ[idx].Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++);
-        specQ[idx].fH->SetName(Form("H%sTrkInQS%c%d", mc?"MC":"", chName[ich], isp));
+        specQ[idx].H()->SetName(Form("H%sTrkInQS%c%d", mc?"MC":"", chName[ich], isp));
         specQ[idx].SetShowRange(-1.75, -1.25);
         if((h2 = specQ[idx].Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
-        if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specQ[idx];
+        if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[0], isp)))) (*pr1)+=specQ[idx];
       }
     } // end PID loop for pt integration
 
     // pt dependency - summation over PID
     for(Int_t ipt(0); ipt<nPt; ipt++){
       /*!dy*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){
         for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
-          if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+          if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
           (*pr0)+=(*pr1);
         }
-        pr0->fH->SetNameTitle(Form("H%sTrkInY%c%c", mc?"MC":"", chName[ich], ptName[ipt]),
+        pr0->H()->SetNameTitle(Form("H%sTrkInY%c%c", mc?"MC":"", chName[ich], ptName[ipt]),
                                   Form("TrackIn[%c]:: #Deltay{%s}", chSgn[ich], ptCut[ipt]));
         pr0->SetShowRange(-0.3, 0.3);
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
+        if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
       }
       /*!dphi*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){
         for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
-          if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+          if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
           (*pr0)+=(*pr1);
         }
-        pr0->fH->SetNameTitle(Form("H%sTrkInPh%c%c", mc?"MC":"", chName[ich], ptName[ipt]),
+        pr0->H()->SetNameTitle(Form("H%sTrkInPh%c%c", mc?"MC":"", chName[ich], ptName[ipt]),
                                   Form("TrackIn[%c]:: #Delta#phi{%s}", chSgn[ich], ptCut[ipt]));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
+        if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
       }
       /*!dx*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], 0)))){
         for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
-          if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
+          if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp)))) continue;
           (*pr0)+=(*pr1);
         }
-        pr0->fH->SetNameTitle(Form("H%sTrkInX%c%c", mc?"MC":"", chName[ich], ptName[ipt]),
+        pr0->H()->SetNameTitle(Form("H%sTrkInX%c%c", mc?"MC":"", chName[ich], ptName[ipt]),
                                   Form("TrackIn[%c]:: #Deltax{%s}", chSgn[ich], ptCut[ipt]));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
         if(!ipt){
@@ -2229,48 +2204,48 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
                                  Form("TrackIn[%c]:: #Deltax{%s}", chSgn[ich], ptCut[0]));
           php.AddLast(&xlow[ich]);
         }
-        if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
+        if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))) (*pr1)+=(*pr0);
       }
     } // end pt loop for PID integration
 
     /*!dy*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkInY%c", mc?"MC":"", chName[ich]),
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkInY%c", mc?"MC":"", chName[ich]),
                             Form("TrackIn[%c]:: #Deltay", chSgn[ich]));
       pr0->SetShowRange(-0.3, 0.3);
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++);
-      if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->fH->GetName())))) arr->AddAt(h2, jh++);
-      if(ich && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
+      if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++);
+      if(ich && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
     }
     /*!dy high pt*/
-    if(ich && (pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[2], 0)))){
-      if((pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[2], 0)))){
+    if(ich && (pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[2], 0)))){
+      if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[2], 0)))){
         (*pr0)+=(*pr1);
-        pr0->fH->SetNameTitle(Form("H%sTrkInY%c", mc?"MC":"", ptName[2]), Form("TrackIn :: #Deltay{%s}", ptCut[2]));
+        pr0->H()->SetNameTitle(Form("H%sTrkInY%c", mc?"MC":"", ptName[2]), Form("TrackIn :: #Deltay{%s}", ptCut[2]));
         pr0->SetShowRange(-0.3, 0.3);
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
       }
     }
     /*!dphi*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkInPh%c", mc?"MC":"", chName[ich]),
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkInPh%c", mc?"MC":"", chName[ich]),
                             Form("TrackIn[%c]:: #Delta#phi", chSgn[ich]));
       pr0->SetShowRange(-1., 1.);
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-      if(ich==1 && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
+      if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
     }
     /*!dx*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkInX%c", mc?"MC":"", chName[ich]),
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 0)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkInX%c", mc?"MC":"", chName[ich]),
                             Form("TrackIn[%c]:: #Deltax", chSgn[ich]));
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-      if(ich==1 && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
+      if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))) (*pr1)+=(*pr0);
     }
     /*!dx low pt*/
-    if(ich && (pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 5)))){
-      if((pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 5)))){
+    if(ich && (pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 5)))){
+      if((pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[0], 5)))){
         (*pr0)+=(*pr1);
-        pr0->fH->SetNameTitle(Form("H%sTrkInX%c", mc?"MC":"", ptName[0]), Form("TrackIn :: #Deltax{%s}", ptCut[0]));
+        pr0->H()->SetNameTitle(Form("H%sTrkInX%c", mc?"MC":"", ptName[0]), Form("TrackIn :: #Deltax{%s}", ptCut[0]));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
       }
     }
@@ -2278,82 +2253,82 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
 
   for(Int_t isp(0); isp<AliPID::kSPECIES; isp++){
     /*!dy*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%d", mc?"MC":"", chName[0], isp)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkInY%d", mc?"MC":"", isp), Form("TrackIn[%s] :: #Deltay", AliPID::ParticleLatexName(isp)));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%d", mc?"MC":"", chName[0], isp)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkInY%d", mc?"MC":"", isp), Form("TrackIn[%s] :: #Deltay", AliPID::ParticleLatexName(isp)));
       pr0->SetShowRange(-0.3, 0.3);
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++);
-      if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->fH->GetName())))) arr->AddAt(h2, jh++);
+      if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++);
     }
     /*!dphi*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[0], isp)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkInPh%d", mc?"MC":"", isp), Form("TrackIn[%s] :: #Delta#phi", AliPID::ParticleLatexName(isp)));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%d", mc?"MC":"", chName[0], isp)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkInPh%d", mc?"MC":"", isp), Form("TrackIn[%s] :: #Delta#phi", AliPID::ParticleLatexName(isp)));
       pr0->SetShowRange(-1., 1.);
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
     }
     /*!dQdl*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[0], isp)))){
-      pr0->fH->SetNameTitle(Form("H%sTrkInQ%d", mc?"MC":"", isp), Form("TrackIn[%s] :: dQdl", AliPID::ParticleLatexName(isp)));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInQ%c%d", mc?"MC":"", chName[0], isp)))){
+      pr0->H()->SetNameTitle(Form("H%sTrkInQ%d", mc?"MC":"", isp), Form("TrackIn[%s] :: dQdl", AliPID::ParticleLatexName(isp)));
       pr0->SetShowRange(-2.2, -1.75);
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 2))) arr->AddAt(h2, jh++);
-      pr0->fH->SetName(Form("H%sTrkInQS%d", mc?"MC":"", isp));
+      pr0->H()->SetName(Form("H%sTrkInQS%d", mc?"MC":"", isp));
       pr0->SetShowRange(-1.7, -1.25);
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 0))) arr->AddAt(h2, jh++);
     }
   } // end PID processing
 
   /*!dy*/
-  if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){
-    pr0->fH->SetNameTitle(Form("H%sTrkInY", mc?"MC":""), "TrackIn :: #Deltay");
+  if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){
+    pr0->H()->SetNameTitle(Form("H%sTrkInY", mc?"MC":""), "TrackIn :: #Deltay");
     pr0->SetShowRange(-0.3, 0.3);
     if((h2 = pr0->Projection2D(kNstat, kNcontours, 1, kFALSE))) arr->AddAt(h2, jh++);
-    if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->fH->GetName())))) arr->AddAt(h2, jh++);
+    if((h2 = (TH2*)gDirectory->Get(Form("%sEn", pr0->H()->GetName())))) arr->AddAt(h2, jh++);
   }
   /*!dphi*/
-  if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){
-    pr0->fH->SetNameTitle(Form("H%sTrkInPh", mc?"MC":""), "TrackIn :: #Delta#phi");
+  if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){
+    pr0->H()->SetNameTitle(Form("H%sTrkInPh", mc?"MC":""), "TrackIn :: #Delta#phi");
     if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
   }
   /*!dx*/
-  if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){
-    pr0->fH->SetNameTitle(Form("H%sTrkInX", mc?"MC":""), "TrackIn :: #Deltax");
+  if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[0], ptName[0], 0)))){
+    pr0->H()->SetNameTitle(Form("H%sTrkInX", mc?"MC":""), "TrackIn :: #Deltax");
     if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
   }
 
   // Row Cross processing
   /*!RC dz*/
-  if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[0])))){
+  if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[0])))){
     for(Int_t ipt(0); ipt<kNpt; ipt++){
-      if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[ipt])))) continue;
+      if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCZ%c", mc?"MC":"", ptName[ipt])))) continue;
       (*pr0)+=(*pr1);
     }
-    pr0->fH->SetNameTitle(Form("H%sTrkInRCZ", mc?"MC":""), "TrackIn[RC]:: #Deltaz");
+    pr0->H()->SetNameTitle(Form("H%sTrkInRCZ", mc?"MC":""), "TrackIn[RC]:: #Deltaz");
     if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
   }
   /*!RC dy*/
-  if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCY%c", mc?"MC":"", ptName[0])))){
+  if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCY%c", mc?"MC":"", ptName[0])))){
     for(Int_t ipt(0); ipt<kNpt; ipt++){
-      if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCY%c", mc?"MC":"", ptName[ipt])))) continue;
+      if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCY%c", mc?"MC":"", ptName[ipt])))) continue;
       (*pr0)+=(*pr1);
     }
-    pr0->fH->SetNameTitle(Form("H%sTrkInRCY", mc?"MC":""), "TrackIn[RC]:: #Deltay");
+    pr0->H()->SetNameTitle(Form("H%sTrkInRCY", mc?"MC":""), "TrackIn[RC]:: #Deltay");
     if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
   }
   /*!RC dphi*/
-  if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCPh%c", mc?"MC":"", ptName[0])))){
+  if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCPh%c", mc?"MC":"", ptName[0])))){
     for(Int_t ipt(0); ipt<kNpt; ipt++){
-      if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCPh%c", mc?"MC":"", ptName[ipt])))) continue;
+      if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCPh%c", mc?"MC":"", ptName[ipt])))) continue;
       (*pr0)+=(*pr1);
     }
-    pr0->fH->SetNameTitle(Form("H%sTrkInRCPh", mc?"MC":""), "TrackIn[RC]:: #Delta#phi");
+    pr0->H()->SetNameTitle(Form("H%sTrkInRCPh", mc?"MC":""), "TrackIn[RC]:: #Delta#phi");
     if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
   }
   /*!RC dx*/
-  if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCX%c", mc?"MC":"", ptName[0])))){
+  if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCX%c", mc?"MC":"", ptName[0])))){
     for(Int_t ipt(0); ipt<kNpt; ipt++){
-      if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("H%sTrkInRCX%c", mc?"MC":"", ptName[ipt])))) continue;
+      if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("H%sTrkInRCX%c", mc?"MC":"", ptName[ipt])))) continue;
       (*pr0)+=(*pr1);
     }
-    pr0->fH->SetNameTitle(Form("H%sTrkInRCX", mc?"MC":""), "TrackIn[RC]:: #Deltax");
+    pr0->H()->SetNameTitle(Form("H%sTrkInRCX", mc?"MC":""), "TrackIn[RC]:: #Deltax");
     if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
   }
   AliInfo(Form("Done %3d 2D projections.", jh));
@@ -2392,7 +2367,7 @@ Bool_t AliTRDresolution::MakeProjectionTrack()
   const Char_t *ptCut[kNpt] = {"p_{t}[GeV/c]<0.8", "0.8<=p_{t}[GeV/c]<1.5", "p_{t}[GeV/c]>=1.5"};
   // define rebinning strategy
   const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
-  AliTRDresolutionProjection hp[kTrkNproj]; TObjArray php(kTrkNproj);
+  AliTRDrecoProjection hp[kTrkNproj]; TObjArray php(kTrkNproj);
   Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
   for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
     for(Int_t ipt(0); ipt<kNpt; ipt++){
@@ -2445,97 +2420,97 @@ Bool_t AliTRDresolution::MakeProjectionTrack()
     Int_t ioff = ly*kNpt*31+pt*31; ioff+=3*(sp<0?10:(sp*kNcharge+ch));
     isel = ly*kNpt*11+pt*11; isel+=sp<0?10:(sp*kNcharge+ch);
     AliDebug(4, Form("SELECTION[%d] :: ch[%c] pt[%c] sp[%d] ly[%d]\n", np[isel], ch==2?'Z':chName[ch], ptName[pt], sp, ly));
-    for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
+    for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDrecoProjection*)php.At(ioff+jh))->Increment(coord, v);
   }
   TObjArray *arr(NULL);
   fProj->AddAt(arr = new TObjArray(kTrkNproj), cidx);
 
   TH2 *h2(NULL); Int_t jh(0);
   for(; ih--; ){
-    if(!hp[ih].fH) continue;
+    if(!hp[ih].H()) continue;
     if(!(h2 = hp[ih].Projection2D(kNstat, kNcontours))) continue;
     arr->AddAt(h2, jh++);
   }
 
   // combine up the tree of projections
-  AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
+  AliTRDrecoProjection *pr0(NULL), *pr1(NULL);
   //Int_t iproj(0), jproj(0);
   for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
     for(Int_t ich(0); ich<kNcharge; ich++){
       for(Int_t ipt(0); ipt<kNpt; ipt++){
         /*!dy*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){
           for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
-            if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue;
+            if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue;
             (*pr0)+=(*pr1);
           }
-          AliDebug(2, Form("Rename %s to HMCTrkY%c%c%d", pr0->fH->GetName(), chName[ich], ptName[ipt], ily));
-          pr0->fH->SetNameTitle(Form("HMCTrkY%c%c%d", chName[ich], ptName[ipt], ily),
+          AliDebug(2, Form("Rename %s to HMCTrkY%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], ily));
+          pr0->H()->SetNameTitle(Form("HMCTrkY%c%c%d", chName[ich], ptName[ipt], ily),
                                     Form("Tracks[%c]:: #Deltay{%s} Ly[%d]", chSgn[ich], ptCut[ipt], ily));
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-          if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+          if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
         }
         /*!dphi*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){
           for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
-            if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue;
+            if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue;
             (*pr0)+=(*pr1);
           }
-          AliDebug(2, Form("Rename %s to HMCTrkPh%c%c%d", pr0->fH->GetName(), chName[ich], ptName[ipt], ily));
-          pr0->fH->SetNameTitle(Form("HMCTrkPh%c%c%d", chName[ich], ptName[ipt], ily),
+          AliDebug(2, Form("Rename %s to HMCTrkPh%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], ily));
+          pr0->H()->SetNameTitle(Form("HMCTrkPh%c%c%d", chName[ich], ptName[ipt], ily),
                                     Form("Tracks[%c]:: #Delta#phi{%s} Ly[%d]", chSgn[ich], ptCut[ipt], ily));
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-          if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+          if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
         }
 
         /*!dpt/pt*/
-        if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){
+        if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], 0, ily)))){
           for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
-            if(!(pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue;
+            if(!(pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, ily)))) continue;
             (*pr0)+=(*pr1);
           }
-          AliDebug(2, Form("Rename %s to HMCTrkDPt%c%c%d", pr0->fH->GetName(), chName[ich], ptName[ipt], ily));
-          pr0->fH->SetNameTitle(Form("HMCTrkDPt%c%c%d", chName[ich], ptName[ipt], ily),
+          AliDebug(2, Form("Rename %s to HMCTrkDPt%c%c%d", pr0->H()->GetName(), chName[ich], ptName[ipt], ily));
+          pr0->H()->SetNameTitle(Form("HMCTrkDPt%c%c%d", chName[ich], ptName[ipt], ily),
                                     Form("Tracks[%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", chSgn[ich], ptCut[ipt], ily));
           if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-          if(ipt && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+          if(ipt && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
         }
       }
       /*!dy*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, ily)))){
-        pr0->fH->SetNameTitle(Form("HMCTrkY%c%d", chName[ich], ily),
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[0], 0, ily)))){
+        pr0->H()->SetNameTitle(Form("HMCTrkY%c%d", chName[ich], ily),
                               Form("Tracks[%c]:: #Deltay Ly[%d]", chSgn[ich], ily));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ich==1 && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+        if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
       }
       /*!dphi*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, ily)))){
-        pr0->fH->SetNameTitle(Form("HMCTrkPh%c%d", chName[ich], ily),
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[0], 0, ily)))){
+        pr0->H()->SetNameTitle(Form("HMCTrkPh%c%d", chName[ich], ily),
                               Form("Tracks[%c]:: #Delta#phi Ly[%d]", chSgn[ich], ily));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ich==1 && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+        if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
       }
       /*!dpt/pt*/
-      if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, ily)))){
-        pr0->fH->SetNameTitle(Form("HMCTrkDPt%c%d", chName[ich], ily),
+      if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[0], 0, ily)))){
+        pr0->H()->SetNameTitle(Form("HMCTrkDPt%c%d", chName[ich], ily),
                               Form("Tracks[%c]:: #Deltap_{t}/p_{t} Ly[%d]", chSgn[ich], ily));
         if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
-        if(ich==1 && (pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
+        if(ich==1 && (pr1 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, ily)))) (*pr1)+=(*pr0);
       }
     }
     /*!dy*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, ily)))){
-      pr0->fH->SetNameTitle(Form("HMCTrkY%d", ily), Form("Tracks :: #Deltay Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkY%c%c%d%d", chName[0], ptName[0], 0, ily)))){
+      pr0->H()->SetNameTitle(Form("HMCTrkY%d", ily), Form("Tracks :: #Deltay Ly[%d]", ily));
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
     }
     /*!dphi*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, ily)))){
-      pr0->fH->SetNameTitle(Form("HMCTrkPh%d", ily), Form("Tracks :: #Delta#phi Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkPh%c%c%d%d", chName[0], ptName[0], 0, ily)))){
+      pr0->H()->SetNameTitle(Form("HMCTrkPh%d", ily), Form("Tracks :: #Delta#phi Ly[%d]", ily));
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
     }
     /*!dpt/pt*/
-    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, ily)))){
-      pr0->fH->SetNameTitle(Form("HMCTrkDPt%d", ily), Form("Tracks :: #Deltap_{t}/p_{t} Ly[%d]", ily));
+    if((pr0 = (AliTRDrecoProjection*)php.FindObject(Form("HMCTrkDPt%c%c%d%d", chName[0], ptName[0], 0, ily)))){
+      pr0->H()->SetNameTitle(Form("HMCTrkDPt%d", ily), Form("Tracks :: #Deltap_{t}/p_{t} Ly[%d]", ily));
       if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
     }
   }
@@ -3198,192 +3173,6 @@ void AliTRDresolution::GetLandauMpvFwhm(TF1 * const f, Float_t &mpv, Float_t &xm
 // }
 
 //________________________________________________________
-AliTRDresolution::AliTRDresolutionProjection::AliTRDresolutionProjection()
-  :TNamed()
-  ,fH(NULL)
-  ,fNrebin(0)
-  ,fRebinX(NULL)
-  ,fRebinY(NULL)
-{
-  // constructor
-  memset(fAx, 0, 3*sizeof(Int_t));
-  memset(fRange, 0, 4*sizeof(Float_t));
-}
-
-//________________________________________________________
-AliTRDresolution::AliTRDresolutionProjection::~AliTRDresolutionProjection()
-{
-  // destructor
-  if(fH) delete fH;
-}
-
-//________________________________________________________
-void AliTRDresolution::AliTRDresolutionProjection::Build(const Char_t *n, const Char_t *t, Int_t ix, Int_t iy, Int_t iz, TAxis *aa[])
-{
-// check and build (if neccessary) projection determined by axis "ix", "iy" and "iz"
-  if(!aa[ix] || !aa[iy] || !aa[iz]) return;
-  TAxis *ax(aa[ix]), *ay(aa[iy]), *az(aa[iz]);
-  // check ax definiton to protect against older versions of the data
-  if(ax->GetNbins()<=0 || (ax->GetXmax()-ax->GetXmin())<=0.){
-    AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, ax->GetTitle(), ax->GetNbins(), ax->GetXmin(), ax->GetXmax()));
-    return;
-  }
-  if(ay->GetNbins()<=0 || (ay->GetXmax()-ay->GetXmin())<=0.){
-    AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, ay->GetTitle(), ay->GetNbins(), ay->GetXmin(), ay->GetXmax()));
-    return;
-  }
-  if(az->GetNbins()<=0 || (az->GetXmax()-az->GetXmin())<=0.){
-    AliWarning(Form("Wrong definition of axis[%d] \"%s\"[%d](%f %f).", ix, az->GetTitle(), az->GetNbins(), az->GetXmin(), az->GetXmax()));
-    return;
-  }
-  SetNameTitle(n,t);
-  fH = new TH3I(n, Form("%s;%s;%s;%s", t, ax->GetTitle(), ay->GetTitle(), az->GetTitle()),
-    ax->GetNbins(), ax->GetXmin(), ax->GetXmax(),
-    ay->GetNbins(), ay->GetXmin(), ay->GetXmax(),
-    az->GetNbins(), az->GetXmin(), az->GetXmax());
-  fAx[0] = ix; fAx[1] = iy; fAx[2] = iz;
-  fRange[0] = az->GetXmin()/3.; fRange[1] = az->GetXmax()/3.;
-  AliDebug(2, Form("H3(%s, %s) :: %s[%3d %4.2f %4.2f]%s[%3d %4.2f %4.2f]%s[%3d %4.2f %4.2f]", n, t,
-    ax->GetTitle(), ax->GetNbins(), ax->GetXmin(), ax->GetXmax(),
-    ay->GetTitle(), ay->GetNbins(), ay->GetXmin(), ay->GetXmax(),
-    az->GetTitle(), az->GetNbins(), az->GetXmin(), az->GetXmax()));
-}
-
-//________________________________________________________
-AliTRDresolution::AliTRDresolutionProjection& AliTRDresolution::AliTRDresolutionProjection::operator=(const AliTRDresolutionProjection& rhs)
-{
-// copy projections
-  if(this == &rhs) return *this;
-
-  TNamed::operator=(rhs);
-  if(fNrebin){fNrebin=0; delete [] fRebinX; delete [] fRebinY;}
-  if(rhs.fNrebin) SetRebinStrategy(rhs.fNrebin, rhs.fRebinX, rhs.fRebinY);
-  memcpy(fAx, rhs.fAx, 3*sizeof(Int_t));
-  memcpy(fRange, rhs.fRange, 4*sizeof(Float_t));
-  if(fH) delete fH;
-  if(rhs.fH) fH=(TH3I*)rhs.fH->Clone(Form("%s_CLONE", rhs.fH->GetName()));
-  return *this;
-}
-
-//________________________________________________________
-AliTRDresolution::AliTRDresolutionProjection& AliTRDresolution::AliTRDresolutionProjection::operator+=(const AliTRDresolutionProjection& other)
-{
-// increment projections
-  if(!fH || !other.fH) return *this;
-  AliDebug(2, Form("%s+=%s [%s+=%s]", GetName(), other.GetName(), fH->GetName(), (other.fH)->GetName()));
-  fH->Add(other.fH);
-  return *this;
-}
-
-//________________________________________________________
-void AliTRDresolution::AliTRDresolutionProjection::Increment(Int_t bin[], Double_t v)
-{
-// increment bin with value "v" pointed by general coord in "bin"
-  if(!fH) return;
-  AliDebug(4, Form("  %s[%2d]", fH->GetName(), Int_t(v)));
-  fH->AddBinContent(fH->GetBin(bin[fAx[0]],bin[fAx[1]],bin[fAx[2]]), Int_t(v));
-}
-
-//________________________________________________________
-TH2* AliTRDresolution::AliTRDresolutionProjection::Projection2D(const Int_t nstat, const Int_t ncol, const Int_t mid, Bool_t del)
-{
-// build the 2D projection and adjust binning
-
-  const Char_t *title[] = {"Mean", "#mu", "MPV"};
-  if(!fH) return NULL;
-  TAxis *ax(fH->GetXaxis()), *ay(fH->GetYaxis()), *az(fH->GetZaxis());
-  TH2D *h2s(NULL), *hyx(NULL);
-  if(!(h2s = (TH2D*)fH->Project3D("yx"))) return NULL;
-  // save a copy of the original distribution
-  if(!del){
-    hyx = (TH2D*)h2s->Clone();
-    hyx->SetName(Form("%sEn", fH->GetName()));
-  }
-  Int_t irebin(0), dxBin(1), dyBin(1);
-  while(irebin<fNrebin && (AliTRDresolution::GetMeanStat(h2s, .5, ">")<nstat)){
-    h2s->Rebin2D(fRebinX[irebin], fRebinY[irebin]);
-    dxBin*=fRebinX[irebin];dyBin*=fRebinY[irebin];
-    irebin++;
-  }
-  Int_t nx(h2s->GetNbinsX()), ny(h2s->GetNbinsY());
-  delete h2s;
-
-  // start projection
-  TH1 *h(NULL); Int_t n(0);
-  Float_t dz=(fRange[1]-fRange[1])/ncol;
-  TString titlez(az->GetTitle()); TObjArray *tokenTitle(titlez.Tokenize(" "));
-  Int_t nt(tokenTitle->GetEntriesFast());
-  TH2 *h2 = new TH2F(Form("%s_2D", fH->GetName()),
-            Form("%s;%s;%s;%s(%s) %s", fH->GetTitle(), ax->GetTitle(), ay->GetTitle(), title[mid], nt>0?(*tokenTitle)[0]->GetName():"", nt>1?(*tokenTitle)[1]->GetName():""),
-            nx, ax->GetXmin(), ax->GetXmax(), ny, ay->GetXmin(), ay->GetXmax());
-  h2->SetContour(ncol);
-  h2->GetZaxis()->CenterTitle();
-  h2->GetZaxis()->SetTitleOffset(1.4);
-  h2->GetZaxis()->SetRangeUser(fRange[0], fRange[1]);
-  AliDebug(2, Form("%s[%s] nx[%d] ny[%d]", h2->GetName(), h2->GetTitle(), nx, ny));
-  for(Int_t iy(0); iy<ny; iy++){
-    for(Int_t ix(0); ix<nx; ix++){
-      h = fH->ProjectionZ(Form("%s_z", h2->GetName()), ix*dxBin+1, (ix+1)*dxBin+1, iy*dyBin+1, (iy+1)*dyBin+1);
-      Int_t ne((Int_t)h->Integral());
-      if(ne<nstat/2){
-        h2->SetBinContent(ix+1, iy+1, -999);
-        h2->SetBinError(ix+1, iy+1, 1.);
-        n++;
-      }else{
-        Float_t v(h->GetMean()), ve(h->GetRMS());
-        if(mid==1){
-          TF1 fg("fg", "gaus", az->GetXmin(), az->GetXmax());
-          fg.SetParameter(0, Float_t(ne)); fg.SetParameter(1, v); fg.SetParameter(2, ve);
-          h->Fit(&fg, "WQ");
-          v = fg.GetParameter(1); ve = fg.GetParameter(2);
-        } else if (mid==2) {
-          TF1 fl("fl", "landau", az->GetXmin(), az->GetXmax());
-          fl.SetParameter(0, Float_t(ne)); fl.SetParameter(1, v); fl.SetParameter(2, ve);
-          h->Fit(&fl, "WQ");
-          v = fl.GetMaximumX(); ve = fl.GetParameter(2);
-/*          TF1 fgle("gle", "[0]*TMath::Landau(x, [1], [2], 1)*TMath::Exp(-[3]*x/[1])", az->GetXmin(), az->GetXmax());
-          fgle.SetParameter(0, fl.GetParameter(0));
-          fgle.SetParameter(1, fl.GetParameter(1));
-          fgle.SetParameter(2, fl.GetParameter(2));
-          fgle.SetParameter(3, 1.);fgle.SetParLimits(3, 0., 5.);
-          h->Fit(&fgle, "WQ");
-          v = fgle.GetMaximumX(); ve = fgle.GetParameter(2);*/
-        }
-        if(v<fRange[0]) h2->SetBinContent(ix+1, iy+1, fRange[0]+0.1*dz);
-        else h2->SetBinContent(ix+1, iy+1, v);
-        h2->SetBinError(ix+1, iy+1, ve);
-      }
-    }
-  }
-  if(h) delete h;
-  if(n==nx*ny){delete h2; h2=NULL;} // clean empty projections
-  return h2;
-}
-
-//________________________________________________________
-void AliTRDresolution::SetNormZ(TH2 *h2, Int_t bxmin, Int_t bxmax, Int_t bymin, Int_t bymax, Float_t thr)
-{
-// Normalize histo content to the mean value in the range specified by bin ranges
-// [bxmin, bxmax] on the x axis and [bymin, bymax] on the y axis.
-// Optionally a threshold "thr" can be specified to disregard entries with no meaning 
-
-  Float_t s = 0., c=0.; Int_t is(0);
-  for(Int_t ix(bxmin); ix<=(bxmax>0?bxmax:(h2->GetXaxis()->GetNbins())); ix++){
-    for(Int_t iy(bymin); iy<=(bymax>0?bymax:(h2->GetYaxis()->GetNbins())); iy++){
-      if((c = h2->GetBinContent(ix, iy))<thr) continue;
-      s += c; is++;
-    }
-  }
-  s/= is?is:1;
-  for(Int_t ix(1); ix<=h2->GetXaxis()->GetNbins(); ix++){
-    for(Int_t iy(1); iy<=h2->GetYaxis()->GetNbins(); iy++){
-      if((c = h2->GetBinContent(ix, iy))<thr) h2->SetBinContent(ix, iy, thr-100);
-      else h2->SetBinContent(ix, iy, 100.*(c/s-1.));
-    }
-  }
-}
-
-//________________________________________________________
 void AliTRDresolution::SetProcesses(Bool_t det, Bool_t cl, Bool_t trklt, Bool_t trkin)
 {
 // steer processes
@@ -3393,28 +3182,3 @@ void AliTRDresolution::SetProcesses(Bool_t det, Bool_t cl, Bool_t trklt, Bool_t
   if(trkin) SETBIT(fSteer, kTrackIn); else CLRBIT(fSteer, kTrackIn);
 }
 
-//________________________________________________________
-void AliTRDresolution::SetRangeZ(TH2 *h2, Float_t min, Float_t max, Float_t thr)
-{
-// Set range on Z axis such to avoid outliers
-
-  Float_t c(0.), dz(1.e-3*(max-min));
-  for(Int_t ix(1); ix<=h2->GetXaxis()->GetNbins(); ix++){
-    for(Int_t iy(1); iy<=h2->GetYaxis()->GetNbins(); iy++){
-      if((c = h2->GetBinContent(ix, iy))<thr) continue;
-      if(c<=min) h2->SetBinContent(ix, iy, min+dz);
-    }
-  }
-  h2->GetZaxis()->SetRangeUser(min, max);
-}
-
-//________________________________________________________
-void AliTRDresolution::AliTRDresolutionProjection::SetRebinStrategy(Int_t n, Int_t rebx[], Int_t reby[])
-{
-// define rebinning strategy for this projection
-  fNrebin = n;
-  fRebinX = new Int_t[n]; memcpy(fRebinX, rebx, n*sizeof(Int_t));
-  fRebinY = new Int_t[n]; memcpy(fRebinY, reby, n*sizeof(Int_t));
-}
-
-
index 01bf5ac..6b43232 100644 (file)
 #include "TNamed.h"
 #endif
 
-class TAxis;
 class TH1;
 class TH2;
-class TH3;
 class TF1;
 class TGraphErrors;
 class TObjArray;
@@ -95,6 +93,8 @@ public:
 
   AliTRDresolution();
   AliTRDresolution(char* name, Bool_t xchange=kTRUE);
+  AliTRDresolution(const AliTRDresolution&);
+  AliTRDresolution& operator=(const AliTRDresolution&);
   virtual ~AliTRDresolution();
   
   static Bool_t   FitTrack(const Int_t np, AliTrackPoint *points, Float_t params[10]);
@@ -103,7 +103,6 @@ public:
 //  Float_t GetCorrectionX(Int_t det, Int_t tb) const {return fXcorr[det][tb];}
   static void     GetRangeZ(TH2 *h2, Float_t &m, Float_t &M);
   Float_t         GetDyRange() const {return fDyRange;}
-  static Float_t  GetMeanStat(TH1 *h, Float_t cut=0., Option_t *opt="");
   Float_t         GetPtThreshold() const {return fPtThreshold;}
   static Int_t    GetPtBin(Float_t pt);
   Bool_t          GetRefFigure(Int_t ifig);
@@ -143,9 +142,7 @@ public:
   void            SetBCselectTOF(Int_t b=0)             { fBCbinTOF = b==0?2:(b<0?1:3);}
   void            SetBCselectFill(Int_t b=0)            { fBCbinFill = b<0||b>3499?1:b+1;}
   void            SetBsign(Int_t b=0)                   { fBsign = Bool_t(b);}
-  static void     SetNormZ(TH2 *h2, Int_t bxmin=1, Int_t bxmax=-1, Int_t bymin=1, Int_t bymax=-1, Float_t thr=0.);
   void            SetProcesses(Bool_t det, Bool_t cl, Bool_t trklt, Bool_t trkin);
-  static void     SetRangeZ(TH2 *h2, Float_t m, Float_t M, Float_t thr=0.);
   void            SetVerbose(Bool_t v = kTRUE)          { SetBit(kVerbose, v);}
   void            SetVisual(Bool_t v = kTRUE)           { SetBit(kVisual, v);}
   void            SetTrackRefit(Bool_t v = kTRUE)       { SetBit(kTrackRefit, v);}
@@ -155,35 +152,6 @@ public:
   void            Terminate(Option_t * opt);
   static Bool_t   UseTrack(const Int_t np, const AliTrackPoint *points, Float_t params[10]);
 
-  class AliTRDresolutionProjection : public TNamed
-  {
-    friend class AliTRDresolution;  // Friend class
-  public:
-    AliTRDresolutionProjection();
-    virtual ~AliTRDresolutionProjection();
-    AliTRDresolutionProjection& operator+=(const AliTRDresolutionProjection& other);
-    AliTRDresolutionProjection& operator=(const AliTRDresolutionProjection& other);
-    void  Build(const Char_t *n, const Char_t *t, Int_t ix, Int_t iy, Int_t iz, TAxis *aa[]);
-    void  Increment(Int_t bin[], Double_t v);
-    TH2*  Projection2D(const Int_t nstat, const Int_t ncol, const Int_t mid=0, Bool_t del=kTRUE);
-    void  SetRebinStrategy(Int_t n, Int_t rebx[], Int_t reby[]);
-    void  SetShowRange(Float_t zm, Float_t zM, Float_t em=0., Float_t eM=0.) {fRange[0] = zm; fRange[1] = zM; fRange[2] = em; fRange[3] = eM;}
-  private:
-    AliTRDresolutionProjection(const AliTRDresolutionProjection&);
-  protected:
-    TH3  *fH;          // data container
-    Int_t fAx[3];      // projection axes
-    Int_t fNrebin;     // no. of rebinning steps
-    Int_t *fRebinX;    //[fNrebin] rebinning of the X axis
-    Int_t *fRebinY;    //[fNrebin] rebinning of the Y axis
-    Float_t fRange[4]; //show range of the z processed
-
-    ClassDef(AliTRDresolutionProjection, 2)  // wrapper for a projection container THnSparse -> TH3
-  };
-
-  AliTRDresolution(const AliTRDresolution&);
-  AliTRDresolution& operator=(const AliTRDresolution&);
-
   void        AdjustF1(TH1 *h, TF1 *f);
   TObjArray*  BuildMonitorContainerCluster(const char* name, Bool_t expand=kFALSE, Float_t range=-1.);
   TObjArray*  BuildMonitorContainerTracklet(const char* name, Bool_t expand=kFALSE);
@@ -212,7 +180,7 @@ protected:
   static Int_t const    fgkNbins[kNdim];  //! no of bins/projection
   static Double_t const fgkMin[kNdim];    //! low limits for projections
   static Double_t const fgkMax[kNdim];    //! high limits for projections
-  static Char_t const  *fgkTitle[kNdim];  //! title of projection 
+  static Char_t const  *fgkTitle[kNdim];  //! title of projection
   static Float_t        fgPtBin[25];      //! pt segmentation
   TObjArray            *fProj;            //! result holder - sigma values
   TDatabasePDG         *fDBPDG;           //! PDG database
index 0172f40..e0d0b9c 100644 (file)
@@ -30,6 +30,7 @@
 #include "TVectorT.h"
 
 #include "AliTrackReference.h"
+#include "AliTrackPointArray.h"
 #include "AliExternalTrackParam.h"
 
 #include "AliTRDseedV1.h"
@@ -72,16 +73,13 @@ AliTRDtrackInfo::AliTRDtrackInfo(const AliTRDtrackInfo &trdInfo):
   //
 
   if(trdInfo.fMC) fMC = new AliMCinfo(*trdInfo.fMC);
-
-  if(trdInfo.fTRDtrack){ 
-    fTRDtrack = new AliTRDtrackV1(*trdInfo.fTRDtrack);
-    if(trdInfo.fTRDtrack->IsOwner()) fTRDtrack->SetOwner();
-  }
+  SetTrack(trdInfo.fTRDtrack);
 }
 
 //___________________________________________________
 AliTRDtrackInfo::AliMCinfo::AliMCinfo()
   :fLabel(0)
+  ,fTRDlabel(0)
   ,fPDG(0)
   ,fNTrackRefs(0)
 {
@@ -92,6 +90,7 @@ AliTRDtrackInfo::AliMCinfo::AliMCinfo()
 //___________________________________________________
 AliTRDtrackInfo::AliMCinfo::AliMCinfo(const AliMCinfo &mc)
   :fLabel(mc.fLabel)
+  ,fTRDlabel(mc.fTRDlabel)
   ,fPDG(mc.fPDG)
   ,fNTrackRefs(mc.fNTrackRefs)
 {
@@ -136,10 +135,14 @@ AliTRDtrackInfo::AliESDinfo::AliESDinfo()
   ,fTOFbc(0)
   ,fTRDpidQuality(0)
   ,fTRDnSlices(0)
+  ,fPt(0.)
+  ,fPhi(-999.)
+  ,fEta(-999.)
   ,fTRDslices(NULL)
   ,fOP(NULL)
   ,fTPCout(NULL)
   ,fITSout(NULL)
+  ,fTPArray(NULL)
 {
   //
   // Constructor
@@ -159,10 +162,14 @@ AliTRDtrackInfo::AliESDinfo::AliESDinfo(const AliESDinfo &esd)
   ,fTOFbc(esd.fTOFbc)
   ,fTRDpidQuality(esd.fTRDpidQuality)
   ,fTRDnSlices(esd.fTRDnSlices)
+  ,fPt(esd.fPt)
+  ,fPhi(esd.fPhi)
+  ,fEta(esd.fEta)
   ,fTRDslices(NULL)
   ,fOP(NULL)
   ,fTPCout(NULL)
   ,fITSout(NULL)
+  ,fTPArray(NULL)
 {
   //
   // Constructor
@@ -175,9 +182,10 @@ AliTRDtrackInfo::AliESDinfo::AliESDinfo(const AliESDinfo &esd)
     fTRDslices = new Double32_t[fTRDnSlices];
     memcpy(fTRDslices, esd.fTRDslices, fTRDnSlices*sizeof(Double32_t));
   }
-  if(esd.fOP) fOP = new AliExternalTrackParam(*esd.fOP);
-  if(esd.fTPCout) fTPCout = new AliExternalTrackParam(*esd.fTPCout);
-  if(esd.fITSout) fITSout = new AliExternalTrackParam(*esd.fITSout);
+  SetOuterParam(esd.fOP);
+  SetTPCoutParam(esd.fTPCout);
+  SetITSoutParam(esd.fITSout);
+  SetTrackPointArray(esd.fTPArray);
 }
 
 
@@ -221,6 +229,7 @@ AliTRDtrackInfo::AliESDinfo::~AliESDinfo()
   if(fOP) delete fOP; fOP = NULL;
   if(fTPCout) delete fTPCout; fTPCout = NULL;
   if(fITSout) delete fITSout; fITSout = NULL;
+  if(fTPArray) delete fTPArray;
 }
 
 //___________________________________________________
@@ -236,6 +245,7 @@ void AliTRDtrackInfo::AliESDinfo::Delete(const Option_t *){
   if(fOP) delete fOP; fOP = NULL;
   if(fTPCout) delete fTPCout; fTPCout = NULL;
   if(fITSout) delete fITSout; fITSout = NULL;
+  if(fTPArray) delete fTPArray; fTPArray = NULL;
 }
 
 
@@ -258,14 +268,7 @@ AliTRDtrackInfo& AliTRDtrackInfo::operator=(const AliTRDtrackInfo &trdInfo)
     }
   } else {if(fMC) delete fMC; fMC = NULL;}
 
-  if(trdInfo.fTRDtrack){
-    if(!fTRDtrack) fTRDtrack = new AliTRDtrackV1(*trdInfo.fTRDtrack);
-    else{
-      fTRDtrack->~AliTRDtrackV1();
-      new(fTRDtrack) AliTRDtrackV1(*trdInfo.fTRDtrack);
-    }
-    if(trdInfo.fTRDtrack->IsOwner()) fTRDtrack->SetOwner();
-  } else {if(fTRDtrack) delete fTRDtrack; fTRDtrack = NULL;}
+  SetTrack(trdInfo.fTRDtrack);
 
   return *this;
 }
@@ -279,12 +282,13 @@ AliTRDtrackInfo::AliMCinfo& AliTRDtrackInfo::AliMCinfo::operator=(const AliMCinf
 
   if(this == &mc) return *this;
   fLabel      = mc.fLabel;
+  fTRDlabel   = mc.fTRDlabel;
   fPDG        = mc.fPDG;
   fNTrackRefs = mc.fNTrackRefs;
 
   AliTrackReference **itr = &fTrackRefs[0];
   AliTrackReference* const *jtr = &mc.fTrackRefs[0];
-  for(Int_t ien = 0; ien < 12; ien++, itr++, jtr++){
+  for(Int_t ien = 0; ien < 2*AliTRDgeometry::kNlayer; ien++, itr++, jtr++){
     if((*jtr)){
       if(!(*itr)) (*itr) = new AliTrackReference(*(*jtr));
       else{
@@ -312,6 +316,9 @@ AliTRDtrackInfo::AliESDinfo& AliTRDtrackInfo::AliESDinfo::operator=(const AliESD
   fTOFbc       = esd.fTOFbc;
   fTRDpidQuality= esd.fTRDpidQuality;
   fTRDnSlices  = esd.fTRDnSlices;
+  fPt          = esd.fPt;
+  fPhi         = esd.fPhi;
+  fEta         = esd.fEta;
   
   memcpy(fTRDr, esd.fTRDr, AliPID::kSPECIES*sizeof(Double32_t));
   memcpy(fTRDv0pid, esd.fTRDv0pid, AliPID::kSPECIES*sizeof(Int_t));
@@ -320,27 +327,10 @@ AliTRDtrackInfo::AliESDinfo& AliTRDtrackInfo::AliESDinfo::operator=(const AliESD
     if(!fTRDslices) fTRDslices = new Double32_t[fTRDnSlices];
     memcpy(fTRDslices, esd.fTRDslices, fTRDnSlices*sizeof(Double32_t));
   }
-  if(esd.fOP){
-    if(fOP){
-      fOP->~AliExternalTrackParam();
-      // RS: Constructor from VTrack was used instead of Constructor from AliExternalTrackParam
-      new(fOP) AliExternalTrackParam(*esd.fOP);
-    } else fOP = new AliExternalTrackParam(*esd.fOP);
-  } else {if(fOP) delete fOP; fOP = NULL;}
-  if(esd.fTPCout){
-    if(fTPCout){
-      fTPCout->~AliExternalTrackParam();
-      // RS: Constructor from VTrack was used instead of Constructor from AliExternalTrackParam
-      new(fTPCout) AliExternalTrackParam(*esd.fTPCout);
-    } else fTPCout = new AliExternalTrackParam(*esd.fTPCout);
-  } else { if(fTPCout) delete fTPCout; fTPCout = NULL;}
-  if(esd.fITSout){
-    if(fITSout){
-      fITSout->~AliExternalTrackParam();
-      // RS: Constructor from VTrack was used instead of Constructor from AliExternalTrackParam
-      new(fITSout) AliExternalTrackParam(*esd.fITSout);
-    } else fITSout = new AliExternalTrackParam(*esd.fITSout);
-  } else { if(fITSout) delete fITSout; fITSout = NULL;}
+  SetOuterParam(esd.fOP);
+  SetTPCoutParam(esd.fTPCout);
+  SetITSoutParam(esd.fITSout);
+  SetTrackPointArray(esd.fTPArray);
 
   return *this;
 }
@@ -366,13 +356,35 @@ void AliTRDtrackInfo::SetTrack(const AliTRDtrackV1 *track)
   // Set the TRD track
   //
 
-  if(!fTRDtrack) fTRDtrack = new AliTRDtrackV1(*track);
-  else{
-    fTRDtrack->~AliTRDtrackV1();
-    new(fTRDtrack) AliTRDtrackV1(*track);
+  if(track){
+    if(!fTRDtrack) fTRDtrack = new AliTRDtrackV1(*track);
+    else{
+      fTRDtrack->~AliTRDtrackV1();
+      new(fTRDtrack) AliTRDtrackV1(*track);
+    }
+    if(track->IsOwner()) fTRDtrack->SetOwner();
+  } else {
+    if(fTRDtrack) delete fTRDtrack; fTRDtrack = NULL;
+  }
+}
+
+//___________________________________________________
+void AliTRDtrackInfo::AliESDinfo::SetTrackPointArray(const AliTrackPointArray *tps)
+{
+  //
+  // Set the track point array for alignment task
+  //
+
+
+  if(tps){
+    if(!fTPArray) fTPArray = new AliTrackPointArray(*tps);
+    else{
+      fTPArray->~AliTrackPointArray();
+      new(fTPArray) AliTrackPointArray(*tps);
+    }
+  } else {
+    if(fTPArray) delete fTPArray; fTPArray = NULL;
   }
-  fTRDtrack->SetOwner();
-  // Make a copy for the object in order to avoid ownership problems
 }
 
 //___________________________________________________
@@ -382,7 +394,7 @@ void AliTRDtrackInfo::AddTrackRef(const AliTrackReference *tref)
   // Add track reference
   //
 
-  if(fMC->fNTrackRefs >= 12){ 
+  if(fMC->fNTrackRefs >= 2*AliTRDgeometry::kNlayer){ 
     SetCurved();
     return;
   }
@@ -427,7 +439,7 @@ Int_t AliTRDtrackInfo::GetNumberOfClusters() const
   if(!fTRDtrack) return 0;
   if(fTRDtrack->GetNumberOfTracklets() == 0) return n;
   AliTRDseedV1 *tracklet = NULL;
-  for(Int_t ip=0; ip<6; ip++){
+  for(Int_t ip=0; ip<AliTRDgeometry::kNlayer; ip++){
     if(!(tracklet = const_cast<AliTRDseedV1 *>(fTRDtrack->GetTracklet(ip)))) continue;
     n+=tracklet->GetN();
   }
@@ -436,45 +448,57 @@ Int_t AliTRDtrackInfo::GetNumberOfClusters() const
 
 
 //___________________________________________________
-void  AliTRDtrackInfo::SetOuterParam(const AliExternalTrackParam *op)
+void  AliTRDtrackInfo::AliESDinfo::SetOuterParam(const AliExternalTrackParam *op)
 {
   //
   // Set outer track parameters
   //
 
-  if(!op) return;
-  if(fESD.fOP){
-    fESD.fOP->~AliExternalTrackParam();
-    new(fESD.fOP) AliExternalTrackParam(*op);
-  } else fESD.fOP = new AliExternalTrackParam(*op);
+  if(op){
+    if(fOP){
+      fOP->~AliExternalTrackParam();
+      // RS: Constructor from VTrack was used instead of Constructor from AliExternalTrackParam
+      new(fOP) AliExternalTrackParam(*op);
+    } else fOP = new AliExternalTrackParam(*op);
+  } else {
+    if(fOP) delete fOP; fOP = NULL;
+  }
 }
 
 //___________________________________________________
-void  AliTRDtrackInfo::SetITSoutParam(const AliExternalTrackParam *op)
+void  AliTRDtrackInfo::AliESDinfo::SetITSoutParam(const AliExternalTrackParam *op)
 {
   //
   // Set TPCout track parameters
   //
 
-  if(!op) return;
-  if(fESD.fITSout){
-    fESD.fITSout->~AliExternalTrackParam();
-    new(fESD.fITSout) AliExternalTrackParam(*op);
-  } else fESD.fITSout = new AliExternalTrackParam(*op);
+  if(op){
+    if(fITSout){
+      fITSout->~AliExternalTrackParam();
+      // RS: Constructor from VTrack was used instead of Constructor from AliExternalTrackParam
+      new(fITSout) AliExternalTrackParam(*op);
+    } else fITSout = new AliExternalTrackParam(*op);
+  } else {
+    if(fITSout) delete fITSout; fITSout = NULL;
+  }
 }
 
 //___________________________________________________
-void  AliTRDtrackInfo::SetTPCoutParam(const AliExternalTrackParam *op)
+void  AliTRDtrackInfo::AliESDinfo::SetTPCoutParam(const AliExternalTrackParam *op)
 {
   //
   // Set TPCout track parameters
   //
 
-  if(!op) return;
-  if(fESD.fTPCout){
-    fESD.fTPCout->~AliExternalTrackParam();
-    new(fESD.fTPCout) AliExternalTrackParam(*op);
-  } else fESD.fTPCout = new AliExternalTrackParam(*op);
+  if(op){
+    if(fTPCout){
+      fTPCout->~AliExternalTrackParam();
+      // RS: Constructor from VTrack was used instead of Constructor from AliExternalTrackParam
+      new(fTPCout) AliExternalTrackParam(*op);
+    } else fTPCout = new AliExternalTrackParam(*op);
+  } else {
+    if(fTPCout) delete fTPCout; fTPCout = NULL;
+  }
 }
 
 //___________________________________________________
index b1b3e41..788a38d 100644 (file)
@@ -21,6 +21,7 @@ typedef class TVectorT<Double_t> TVectorD;
 class AliTRDseedV1;
 class AliTRDtrackV1;
 class AliTrackReference;
+class AliTrackPointArray;
 class AliExternalTrackParam;
 class AliTRDtrackInfo : public TObject{
 public:
@@ -35,13 +36,16 @@ public:
     virtual ~AliESDinfo();
     AliESDinfo& operator=(const AliESDinfo &esd);
     void Delete(const Option_t *);
+    Float_t     Eta() const                      { return fEta;}
     Bool_t      HasV0() const                    { return fHasV0;}
     Int_t       GetId() const                    { return fId;}
     ULong_t     GetStatus() const                { return fStatus;}
     Int_t       GetKinkIndex() const             { return fKinkIndex;}
     Short_t     GetTOFbc() const                 { return fTOFbc;}
     UShort_t    GetTPCncls() const               { return fTPCncls;}
+    AliTrackPointArray* GetTrackPointArray() const      { return fTPArray; }
     UChar_t     GetPidQuality() const            { return fTRDpidQuality;}
+
     Int_t       GetNSlices() const               { return fTRDnSlices;}
     Double32_t* GetSliceIter() const             { return fTRDslices;}
     const Double32_t* GetResponseIter() const    { return &fTRDr[0];}
@@ -50,24 +54,34 @@ public:
     AliExternalTrackParam* GetTPCoutParam() const { return fTPCout;}
     const Int_t* GetV0pid() const                { return &fTRDv0pid[0];}
     Int_t       GetV0pid(Int_t i) const          { return fTRDv0pid[i];}
+    Float_t     Phi() const                      { return fPhi;}
+    Float_t     Pt() const                       { return fPt;}
+    void        SetOuterParam(const AliExternalTrackParam *op);
+    void        SetITSoutParam(const AliExternalTrackParam *op);
+    void        SetTPCoutParam(const AliExternalTrackParam *op);
+    void        SetTrackPointArray(const AliTrackPointArray *tps);
 
   protected:
-    UChar_t     fHasV0;         // v0 bit
-    Int_t       fId;            // ESD track id
-    ULong_t     fStatus;        // ESD track status
-    Int_t       fKinkIndex;     // ESD kink index
-    UShort_t    fTPCncls;       // Number of Clusters inside TPC
-    Short_t     fTOFbc;         // TOF bunch crossing index
+    UChar_t     fHasV0;                   // v0 bit
+    Int_t       fId;                      // ESD track id
+    ULong_t     fStatus;                  // ESD track status
+    Int_t       fKinkIndex;               // ESD kink index
+    UShort_t    fTPCncls;                 // Number of Clusters inside TPC
+    Short_t     fTOFbc;                   // TOF bunch crossing index
     Double32_t  fTRDr[AliPID::kSPECIES];  // TRD radial position
-    UChar_t     fTRDpidQuality; // TRD PID quality
-    Int_t       fTRDnSlices;    // number of slices used for PID
-    Double32_t *fTRDslices;     //[fTRDnSlices] 
-    AliExternalTrackParam *fOP; // outer track param
-    AliExternalTrackParam *fTPCout; // outer TPC param
-    AliExternalTrackParam *fITSout; // outer ITS param
-    Int_t  fTRDv0pid[AliPID::kSPECIES]; // PID from v0s
-
-    ClassDef(AliESDinfo, 6)     // ESD info related to TRD
+    UChar_t     fTRDpidQuality;           // TRD PID quality
+    Int_t       fTRDnSlices;              // number of slices used for PID
+    Float_t     fPt;                      // p_t at TRD entrance
+    Float_t     fPhi;                     // phi at TRD entrance
+    Float_t     fEta;                     // eta at TRD entrance
+    Double32_t *fTRDslices;               //[fTRDnSlices]
+    AliExternalTrackParam *fOP;           // outer track param
+    AliExternalTrackParam *fTPCout;       // outer TPC param
+    AliExternalTrackParam *fITSout;       // outer ITS param
+    AliTrackPointArray *fTPArray;         // track point array to be used for alignment
+    Int_t  fTRDv0pid[AliPID::kSPECIES];   // PID from v0s
+
+    ClassDef(AliESDinfo, 8)     // ESD info related to TRD
   };
 
   class AliMCinfo{
@@ -79,6 +93,7 @@ public:
     virtual ~AliMCinfo();
     AliMCinfo& operator=(const AliMCinfo &mc);
     Int_t   GetLabel() const {return fLabel;}
+    Int_t   GetTRDlabel() const {return fTRDlabel;}
     Int_t   GetNTrackRefs() const {return fNTrackRefs;}
     Int_t   GetPDG() const {return fPDG;}
     Int_t   GetPID() const ;
@@ -93,14 +108,15 @@ public:
     static void SetKalmanStep(Double_t s) {fgKalmanStep = s;}
     static void SetKalmanUpdate(Bool_t s=kTRUE) {fgKalmanUpdate = s;}
   protected:
-    Int_t   fLabel;               // MC label  
+    Int_t   fLabel;               // ESD label
+    Int_t   fTRDlabel;            // TRD label
     Int_t   fPDG;                 // particle code
     Int_t   fNTrackRefs;           // number of track refs
     static Double_t fgKalmanStep; // Kalman step propagation
     static Bool_t fgKalmanUpdate; // Kalman update with TRD tracklets
     AliTrackReference  *fTrackRefs[kNTrackRefs];       // track refs array
 
-    ClassDef(AliMCinfo, 2)      // MC info related to TRD
+    ClassDef(AliMCinfo, 3)      // MC info related to TRD
   };
 
   AliTRDtrackInfo();
@@ -136,22 +152,27 @@ public:
 
   void               SetCurved(Bool_t curv = kTRUE)   { SetBit(kCurv, curv);}
   void               SetLabel(Int_t lab)              { if(fMC) fMC->fLabel = lab; }
+  void               SetTRDlabel(Int_t lab)           { if(fMC) fMC->fTRDlabel = lab; }
   void               SetNumberOfClustersRefit(Int_t n){fNClusters = n;}
   inline void        SetMC();
   void               SetPDG(Int_t pdg)                { if(fMC) fMC->fPDG = pdg; }
   void               SetPrimary(Bool_t prim = kTRUE)  {SetBit(kPrim, prim);}
-  void               SetOuterParam(const AliExternalTrackParam *op);
-  void               SetITSoutParam(const AliExternalTrackParam *op);
-  void               SetTPCoutParam(const AliExternalTrackParam *op);
+  void               SetOuterParam(const AliExternalTrackParam *op)  {fESD.SetOuterParam(op);}
+  void               SetITSoutParam(const AliExternalTrackParam *op) {fESD.SetITSoutParam(op);}
+  void               SetTPCoutParam(const AliExternalTrackParam *op) {fESD.SetTPCoutParam(op);}
   void               SetStatus(ULong_t stat)          { fESD.fStatus = stat;}
   void               SetKinkIndex(Int_t kinkIndex)    { fESD.fKinkIndex = kinkIndex;}
   void               SetTOFbc(Int_t bc)               { fESD.fTOFbc = bc;}
   void               SetTPCncls(UShort_t TPCncls)     { fESD.fTPCncls = TPCncls;}
   void               SetTrackId(Int_t id)             { fESD.fId = id;}
   void               SetTrack(const AliTRDtrackV1 *track);
+  void               SetTrackPointArray(const AliTrackPointArray *tps) {fESD.SetTrackPointArray(tps);}
   void               SetESDpidQuality(UChar_t q)      { fESD.fTRDpidQuality = q;}
   void               SetSlices(Int_t n, Double32_t *s);
   inline void        SetESDpid(Double_t *);
+  void               SetESDeta(Float_t eta)           { fESD.fEta = eta;}
+  void               SetESDphi(Float_t phi)           { fESD.fPhi = phi;}
+  void               SetESDpt(Float_t pt)             { fESD.fPt = pt;}
   inline void        SetV0pid(Int_t *);
   void               SetV0(Bool_t v0=kTRUE)           { fESD.fHasV0 = v0;}
   
index 2ea14f4..9861edb 100644 (file)
@@ -17,6 +17,7 @@ void AddTRDinfoGen(AliAnalysisManager *mgr, Int_t /*map*/, AliAnalysisDataContai
   info->SetDebugLevel(0);
   info->SetMCdata(mc);
   info->SetLocalTrkSelection();
+  info->UseTrackPoints(kFALSE); // set it to true if track points for alignment are to be saved in trackInfo object
   info->SetOCDB("alien://folder=/alice/data/2010/OCDB");
   // settings for collisions
   info->SetCollision(/*kFALSE*/);
index a8055b8..5bc9875 100644 (file)
@@ -75,6 +75,7 @@ void AddTRDresolution(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContain
     mgr->ConnectInput(taskAlign,  0, mgr->GetCommonInputContainer());  
     mgr->ConnectInput(taskAlign,  1, ci[0]);
     mgr->ConnectInput(taskAlign,  2, evInfoContainer);
+    mgr->ConnectInput(taskAlign,  3, ci[4]);                          // conect clusters container
     mgr->ConnectOutput(taskAlign, 1, mgr->CreateContainer(Form("h%s", taskAlign->GetName()), TObjArray::Class(), AliAnalysisManager::kExchangeContainer));
     mgr->ConnectOutput(taskAlign, 2, mgr->CreateContainer(taskAlign->GetName(), TTree::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Alignment",mgr->GetCommonFileName())));
   }