add cluster monitoring from RecPoints
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Dec 2011 11:24:23 +0000 (11:24 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Dec 2011 11:24:23 +0000 (11:24 +0000)
13 files changed:
PWG1/TRD/AliTRDinfoGen.cxx
PWG1/TRD/AliTRDinfoGen.h
PWG1/TRD/AliTRDpwg1Helper.h
PWG1/TRD/AliTRDrecoTask.cxx
PWG1/TRD/AliTRDrecoTask.h
PWG1/TRD/AliTRDresolution.cxx
PWG1/TRD/AliTRDresolution.h
PWG1/TRD/macros/AddTRDcheckDET.C
PWG1/TRD/macros/AddTRDcheckTRK.C
PWG1/TRD/macros/AddTRDefficiency.C
PWG1/TRD/macros/AddTRDinfoGen.C
PWG1/TRD/macros/AddTRDresolution.C
PWG1/macros/AddTrainPerformanceTRD.C

index 309c848..2dca0a9 100644 (file)
@@ -56,6 +56,7 @@
 #include "AliESDEvent.h"\r
 #include "AliMCEvent.h"\r
 #include "AliESDInputHandler.h"\r
+#include "AliESDInputHandlerRP.h"\r
 #include "AliMCEventHandler.h"\r
 \r
 #include "AliESDfriend.h"\r
@@ -124,6 +125,7 @@ AliTRDinfoGen::AliTRDinfoGen()
   ,fTracksSA(NULL)\r
   ,fTracksKink(NULL)\r
   ,fV0List(NULL)\r
+  ,fClusters(NULL)\r
   ,fContainer(NULL)\r
   ,fRecos(NULL)\r
   ,fDebugStream(NULL)\r
@@ -150,6 +152,7 @@ AliTRDinfoGen::AliTRDinfoGen(char* name)
   ,fTracksSA(NULL)\r
   ,fTracksKink(NULL)\r
   ,fV0List(NULL)\r
+  ,fClusters(NULL)\r
   ,fContainer(NULL)\r
   ,fRecos(NULL)\r
   ,fDebugStream(NULL)\r
@@ -159,11 +162,12 @@ AliTRDinfoGen::AliTRDinfoGen(char* name)
   //\r
   SetTitle("MC-REC TRD-track list generator");\r
   DefineOutput(AliTRDpwg1Helper::kTracksBarrel, TObjArray::Class());\r
-  DefineOutput(AliTRDpwg1Helper::kTracksSA, TObjArray::Class());\r
-  DefineOutput(AliTRDpwg1Helper::kTracksKink, TObjArray::Class());\r
-  DefineOutput(AliTRDpwg1Helper::kEventInfo, AliTRDeventInfo::Class());\r
-  DefineOutput(AliTRDpwg1Helper::kV0List, TObjArray::Class());\r
-  DefineOutput(AliTRDpwg1Helper::kMonitor, TObjArray::Class()); // histogram list\r
+  DefineOutput(AliTRDpwg1Helper::kTracksSA,     TObjArray::Class());\r
+  DefineOutput(AliTRDpwg1Helper::kTracksKink,   TObjArray::Class());\r
+  DefineOutput(AliTRDpwg1Helper::kEventInfo,    AliTRDeventInfo::Class());\r
+  DefineOutput(AliTRDpwg1Helper::kV0List,       TObjArray::Class());\r
+  DefineOutput(AliTRDpwg1Helper::kClusters,     TObjArray::Class());\r
+  DefineOutput(AliTRDpwg1Helper::kMonitor,      TObjArray::Class()); // histogram list\r
 }\r
 \r
 //____________________________________________________________________\r
@@ -179,11 +183,11 @@ AliTRDinfoGen::~AliTRDinfoGen()
   if(fTrackInfo) delete fTrackInfo; fTrackInfo = NULL;\r
   if(fEventInfo) delete fEventInfo; fEventInfo = NULL;\r
   if(fV0Info) delete fV0Info; fV0Info = NULL;\r
-  if(fTracksBarrel){ \r
+  if(fTracksBarrel){\r
     fTracksBarrel->Delete(); delete fTracksBarrel;\r
     fTracksBarrel = NULL;\r
   }\r
-  if(fTracksSA){ \r
+  if(fTracksSA){\r
     fTracksSA->Delete(); delete fTracksSA;\r
     fTracksSA = NULL;\r
   }\r
@@ -196,6 +200,10 @@ AliTRDinfoGen::~AliTRDinfoGen()
     delete fV0List;\r
     fV0List = NULL;\r
   }\r
+  if(fClusters){\r
+    fClusters->Delete(); delete fClusters;\r
+    fClusters = NULL;\r
+  }\r
   if(fContainer && !(AliAnalysisManager::GetAnalysisManager() && AliAnalysisManager::GetAnalysisManager()->IsProofMode())){\r
     fContainer->Delete(); \r
     delete fContainer;\r
@@ -229,6 +237,7 @@ void AliTRDinfoGen::UserCreateOutputObjects()
   fTracksSA = new TObjArray(20); fTracksSA->SetOwner(kTRUE);\r
   fTracksKink = new TObjArray(20); fTracksKink->SetOwner(kTRUE);\r
   fV0List = new TObjArray(10); fV0List->SetOwner(kTRUE);\r
+  fClusters = new TObjArray(AliTRDgeometry::kNdet); fClusters->SetOwner(kTRUE);\r
 \r
   // define general monitor\r
   fContainer = new TObjArray(kNclasses); fContainer->SetOwner(kTRUE);\r
@@ -263,7 +272,14 @@ void AliTRDinfoGen::UserCreateOutputObjects()
   TObjArray *chmb = new TObjArray(AliTRDgeometry::kNdet);\r
   chmb->SetName("Chambers"); chmb->SetOwner();\r
   fContainer->AddAt(chmb, kChmb);\r
-  PostData(AliTRDpwg1Helper::kMonitor, fContainer);\r
+\r
+  PostData(AliTRDpwg1Helper::kTracksBarrel, fTracksBarrel);\r
+  PostData(AliTRDpwg1Helper::kTracksSA,     fTracksSA);\r
+  PostData(AliTRDpwg1Helper::kTracksKink,   fTracksKink);\r
+  PostData(AliTRDpwg1Helper::kEventInfo,    fEventInfo);\r
+  PostData(AliTRDpwg1Helper::kV0List,       fV0List);\r
+  PostData(AliTRDpwg1Helper::kClusters,     fClusters);\r
+  PostData(AliTRDpwg1Helper::kMonitor,      fContainer);\r
 }\r
 \r
 //____________________________________________________________________\r
@@ -302,6 +318,7 @@ void AliTRDinfoGen::UserExec(Option_t *){
   fTracksSA->Delete();\r
   fTracksKink->Delete();\r
   fV0List->Delete();\r
+  fClusters->Delete();\r
   fEventInfo->Delete("");\r
 \r
   fESDev = dynamic_cast<AliESDEvent*>(InputEvent());\r
@@ -567,9 +584,8 @@ void AliTRDinfoGen::UserExec(Option_t *){
       break;\r
     }\r
 \r
-    // read REC info\r
+    // read track REC info\r
     esdFriendTrack = (fESDfriend->GetNumberOfTracks() > itrk) ? fESDfriend->GetTrack(itrk): NULL;\r
-\r
     if(esdFriendTrack){\r
       fTrackInfo->SetTPCoutParam(esdFriendTrack->GetTPCOut());\r
       Int_t icalib = 0;\r
@@ -651,6 +667,29 @@ void AliTRDinfoGen::UserExec(Option_t *){
     }\r
     fTrackInfo->Delete("");\r
   }\r
+  // read clusters REC info\r
+  TTree * treeR = (dynamic_cast<AliESDInputHandlerRP*>(fInputHandler))->GetTreeR("TRD");\r
+  if(treeR) {\r
+    TObjArray *recPoints(NULL);\r
+    if((treeR->GetBranch("TRDcluster"))){\r
+      treeR->SetBranchAddress("TRDcluster", &recPoints);\r
+      for(Int_t idet(0); idet<treeR->GetEntries(); idet++){\r
+        treeR->GetEntry(idet);\r
+        if(!recPoints->GetEntries()){\r
+          AliDebug(1, Form("Missing entry %d from TreeR", idet));\r
+          continue;\r
+        }\r
+        AliTRDcluster *c = (AliTRDcluster*)(*recPoints)[0];\r
+        if(!c){\r
+          AliDebug(1, Form("Missing first cluster in entry %d from TreeR", idet));\r
+          continue;\r
+        }\r
+        fClusters->AddAt(recPoints->Clone(Form("%03d", c->GetDetector())), c->GetDetector());\r
+      }\r
+    } else AliDebug(3, "No TRDcluster branch");\r
+  } else AliDebug(3, "No RecPoints");\r
+\r
+\r
 \r
   // LOOP 2 - over MC tracks which are passing TRD where the track is not reconstructed\r
   if(HasMCdata()){\r
@@ -735,12 +774,6 @@ void AliTRDinfoGen::UserExec(Option_t *){
   h->Fill(Float_t(kKinkMC), nKinkMC);\r
   h->Fill(Float_t(kBarrelFriend), nBarrelFriend);\r
   h->Fill(Float_t(kSAFriend), nSAFriend);\r
-\r
-  PostData(AliTRDpwg1Helper::kTracksBarrel, fTracksBarrel);\r
-  PostData(AliTRDpwg1Helper::kTracksSA, fTracksSA);\r
-  PostData(AliTRDpwg1Helper::kTracksKink, fTracksKink);\r
-  PostData(AliTRDpwg1Helper::kEventInfo, fEventInfo);\r
-  PostData(AliTRDpwg1Helper::kV0List, fV0List);\r
 }\r
 \r
 \r
index d4d33d5..dad0be3 100644 (file)
@@ -57,6 +57,7 @@ public:
   enum AliTRDinfoGenClasses{\r
      kStatTrk = 0\r
     ,kEvType\r
+//    ,kBCtrack\r
     ,kBC\r
     ,kTrigger\r
     ,kChmb\r
@@ -116,6 +117,7 @@ private:
   TTreeSRedirector* DebugStream();\r
   void              MakeChambers();\r
 \r
+//  UShort_t          fBF;             //! Bunch Fill of previous event\r
   AliESDEvent      *fESDev;          //! ESD event\r
   AliMCEvent       *fMCev;           //! MC event\r
   // event/track cuts OO - to be used\r
@@ -130,6 +132,7 @@ private:
   TObjArray        *fTracksSA;       //! Array of stand alone tracks\r
   TObjArray        *fTracksKink;     //! Array of kink tracks\r
   TObjArray        *fV0List;         //! V0 container\r
+  TObjArray        *fClusters;       //! Clusters container\r
   TObjArray        *fContainer;      //! container to store results\r
   TObjArray        *fRecos;          //! array of reco params\r
   TTreeSRedirector *fDebugStream;    //! debug stream\r
index 41ddb89..b7d8dae 100644 (file)
@@ -17,7 +17,8 @@ public:
     ,kTracksBarrel
     ,kTracksSA
     ,kTracksKink
-    ,kV0List 
+    ,kV0List
+    ,kClusters
     ,kMonitor
     ,kNOutSlots
   };
index 3cfc7bb..9e84722 100644 (file)
@@ -51,6 +51,8 @@ AliTRDrecoTask::AliTRDrecoTask()
   ,fContainer(NULL)\r
   ,fEvent(NULL)\r
   ,fTracks(NULL)\r
+  ,fClusters(NULL)\r
+  ,fkClusters(NULL)\r
   ,fkTrack(NULL)\r
   ,fkMC(NULL)\r
   ,fkESD(NULL)\r
@@ -59,6 +61,7 @@ AliTRDrecoTask::AliTRDrecoTask()
   ,fPhi(0.)\r
   ,fEta(0.)\r
   ,fPlotFuncList(NULL)\r
+  ,fDetFuncList(NULL)\r
   ,fRunTerminate(kFALSE)\r
 {\r
 // Default constructor\r
@@ -73,6 +76,8 @@ AliTRDrecoTask::AliTRDrecoTask(const char *name, const char *title)
   ,fContainer(NULL)\r
   ,fEvent(NULL)\r
   ,fTracks(NULL)\r
+  ,fClusters(NULL)\r
+  ,fkClusters(NULL)\r
   ,fkTrack(NULL)\r
   ,fkMC(NULL)\r
   ,fkESD(NULL)\r
@@ -81,6 +86,7 @@ AliTRDrecoTask::AliTRDrecoTask(const char *name, const char *title)
   ,fPhi(0.)\r
   ,fEta(0.)\r
   ,fPlotFuncList(NULL)\r
+  ,fDetFuncList(NULL)\r
   ,fRunTerminate(kFALSE)\r
 {\r
 // Constructor for all derived performance tasks\r
@@ -89,6 +95,7 @@ AliTRDrecoTask::AliTRDrecoTask(const char *name, const char *title)
   snprintf(fNameId, 10, "no name");\r
   DefineInput (1, TObjArray::Class()); // track list\r
   DefineInput (2, AliTRDeventInfo::Class()); // event info object\r
+  DefineInput (3, TObjArray::Class()); // cluster list object\r
   DefineOutput(1, TObjArray::Class()); // histogram list\r
 }\r
 \r
@@ -109,6 +116,11 @@ AliTRDrecoTask::~AliTRDrecoTask()
     delete fPlotFuncList;\r
     fPlotFuncList = NULL;\r
   }\r
+  if(fDetFuncList){\r
+    fDetFuncList->Delete();\r
+    delete fDetFuncList;\r
+    fDetFuncList = NULL;\r
+  }\r
   \r
   if(fDets){\r
     if(fDets->IsOwner()) fDets->Delete();\r
@@ -151,11 +163,12 @@ void AliTRDrecoTask::UserExec(Option_t *)
 {\r
 // Loop over Plot functors published by particular tasks\r
 \r
-  fTracks = dynamic_cast<TObjArray *>(GetInputData(1));\r
-  fEvent  = dynamic_cast<AliTRDeventInfo *>(GetInputData(2));\r
+  fTracks   = dynamic_cast<TObjArray *>(GetInputData(1));\r
+  fEvent    = dynamic_cast<AliTRDeventInfo *>(GetInputData(2));\r
+  fClusters = dynamic_cast<TObjArray*>(GetInputData(3));\r
 \r
   if(!fPlotFuncList){\r
-    AliWarning("No functor list defined for the reference plots");\r
+    AliWarning("No track functor list defined for the task");\r
     return;\r
   }\r
   if(!fTracks) return;\r
@@ -189,6 +202,20 @@ void AliTRDrecoTask::UserExec(Option_t *)
       plot->Execute(this);\r
     }\r
   }\r
+  if(!fClusters) return;\r
+  if(!fDetFuncList){\r
+    AliDebug(1, "No detector functor list defined for the task");\r
+    return;\r
+  }\r
+  TIter detIter(fDetFuncList);\r
+  for(Int_t idet(0); idet<AliTRDgeometry::kNdet; idet++){\r
+    if(!(fkClusters = (TObjArray*)fClusters->At(idet))) continue;\r
+    TMethodCall *det(NULL);\r
+    detIter.Reset();\r
+    while((det=dynamic_cast<TMethodCall*>(detIter()))){\r
+      det->Execute(this);\r
+    }\r
+  }\r
 }\r
 \r
 //_______________________________________________________\r
@@ -218,14 +245,19 @@ void AliTRDrecoTask::InitFunctorList()
 \r
   TClass *c = this->IsA();\r
   if(fPlotFuncList) fPlotFuncList->Clear();\r
+  if(fDetFuncList) fDetFuncList->Clear();\r
 \r
-  TMethod *m = NULL;\r
+  TMethod *m(NULL);\r
   TIter methIter(c->GetListOfMethods());\r
   while((m=dynamic_cast<TMethod*>(methIter()))){\r
     TString name(m->GetName());\r
-    if(!name.BeginsWith("Plot")) continue;\r
-    if(!fPlotFuncList) fPlotFuncList = new TList();\r
-    fPlotFuncList->AddLast(new TMethodCall(c, (const char*)name, ""));\r
+    if(name.BeginsWith("Plot")){\r
+      if(!fPlotFuncList) fPlotFuncList = new TList();\r
+      fPlotFuncList->AddLast(new TMethodCall(c, (const char*)name, ""));\r
+    } else if(name.BeginsWith("Det")){\r
+      if(!fDetFuncList) fDetFuncList = new TList();\r
+      fDetFuncList->AddLast(new TMethodCall(c, (const char*)name, ""));\r
+    }\r
   }\r
 }\r
 \r
@@ -332,8 +364,8 @@ void AliTRDrecoTask::MakeDetectorPlot(Int_t ly)
     if(idet%6 != ly) continue;\r
     TVectorF *det((TVectorF*)fDets->At(idet));\r
     if(!det) continue;\r
-    AliDebug(2, Form("det[%03d] 0[%+4.1f %+4.1f] 1[%+4.1f %+4.1f]", idet, (*det)[0], (*det)[1], (*det)[2], (*det)[3]));\r
     Int_t iopt = Int_t((*det)[4]);\r
+    AliDebug(2, Form("det[%03d] 0[%+4.1f %+4.1f] 1[%+4.1f %+4.1f] opt[%d]", idet, (*det)[0], (*det)[1], (*det)[2], (*det)[3], iopt));\r
     if(iopt==1){\r
       gdet->SetFillStyle(style[1]);gdet->SetFillColor(kBlack);\r
       gdet->DrawBox((*det)[0], (*det)[1], (*det)[2], (*det)[3]);\r
index 5466295..3c80945 100644 (file)
@@ -85,6 +85,8 @@ protected:
   TObjArray             *fContainer;       //! container to store results\r
   AliTRDeventInfo       *fEvent;           //! Event Info\r
   TObjArray             *fTracks;          //! Array of tracks\r
+  TObjArray             *fClusters;        //! Array of clusters\r
+  const TObjArray       *fkClusters;       //! current detector clusters array\r
   const AliTRDtrackV1   *fkTrack;          //! current track\r
   const AliTRDtrackInfo::AliMCinfo  *fkMC; //! MC info\r
   const AliTRDtrackInfo::AliESDinfo *fkESD;//! ESD info\r
@@ -97,10 +99,11 @@ private:
   AliTRDrecoTask(const AliTRDrecoTask&);\r
   AliTRDrecoTask& operator=(const AliTRDrecoTask&);\r
 \r
-  TList             *fPlotFuncList;//! plot functors list\r
-  Bool_t            fRunTerminate;  // Switch for Terminate Function\r
-  static TList      *fgTrendPoint;          //! trend point\r
-  static TTreeSRedirector *fgDebugStream;  //! Debug stream \r
+  TList             *fPlotFuncList;        //! track functors list\r
+  TList             *fDetFuncList;         //! detector functors list\r
+  Bool_t            fRunTerminate;         // Switch for Terminate Function\r
+  static TList      *fgTrendPoint;         //! trend point\r
+  static TTreeSRedirector *fgDebugStream;  //! Debug stream\r
 \r
   ClassDef(AliTRDrecoTask, 5) // base TRD reconstruction task\r
 };\r
index 7d92794..4632f6f 100644 (file)
@@ -137,7 +137,8 @@ Char_t const *AliTRDresolution::fgkTitle[kNdim] = {
 };  //! title of projection
 
 Char_t const * AliTRDresolution::fgPerformanceName[kNclasses] = {
-    "Cluster2Track"
+    "Det2Cluster"
+    ,"Cluster2Track"
     ,"Tracklet2Track"
     ,"Tracklet2TRDin"
     ,"Cluster2MC"
@@ -272,6 +273,56 @@ Bool_t AliTRDresolution::Pulls(Double_t* /*dyz[2]*/, Double_t* /*cov[3]*/, Doubl
 }
 
 //________________________________________________________
+TH1* AliTRDresolution::DetCluster(const TObjArray *cls)
+{
+  //
+  // Plot the cluster distributions
+  //
+
+  if(cls) fkClusters = cls;
+  if(!fkClusters){
+    AliDebug(4, "No Clusters defined.");
+    return NULL;
+  }
+  Int_t ncl(0);
+  if(!(ncl = fkClusters->GetEntriesFast())){
+    AliDebug(1, "No RecPoints defined.");
+    return NULL;
+  }
+  Int_t det(-1);
+  AliTRDcluster *cl(NULL);
+  for(Int_t icl(0); icl<ncl; icl++){
+    if(!(cl = (AliTRDcluster*)(*fkClusters)[icl])) continue;
+    det = cl->GetDetector(); break;
+  }
+  if(det<0){
+    AliDebug(1, "No useful clusters defined.");
+    return NULL;
+  }
+  THnSparse *H(NULL);
+  if(!fContainer || !(H = ((THnSparse*)fContainer->At(kDetector)))){
+    AliWarning("No output container defined.");
+    return NULL;
+  }
+  Int_t ly(AliTRDgeometry::GetLayer(det));
+  Double_t val[kNdim],
+           alpha((0.5+AliTRDgeometry::GetSector(det))*AliTRDgeometry::GetAlpha()),
+           cs(TMath::Cos(alpha)),
+           sn(TMath::Sin(alpha));
+  for(Int_t icl(0); icl<ncl; icl++){
+    if(!(cl = (AliTRDcluster*)(*fkClusters)[icl])) continue;
+    val[kBC]  = ly;
+    val[kPhi] = TMath::ATan2(cl->GetX()*sn + cl->GetY()*cs, cl->GetX()*cs - cl->GetY()*sn);
+    Float_t tgl = cl->GetZ()/cl->GetX()/TMath::Sqrt(1.+cl->GetY()*cl->GetY()/cl->GetX()/cl->GetX());
+    val[kEta] = -TMath::Log(TMath::Tan(0.5 *  (0.5*TMath::Pi() - TMath::ATan(tgl))));
+    val[kYrez]= TMath::Abs(cl->GetQ());
+    val[4]    = fEvent->GetMultiplicity();
+    H->Fill(val);
+  }
+  return NULL;
+}
+
+//________________________________________________________
 TH1* AliTRDresolution::PlotCluster(const AliTRDtrackV1 *track)
 {
   //
@@ -1070,6 +1121,24 @@ void AliTRDresolution::MakeSummary()
         if(nplot==6) cOut->SaveAs(Form("%s.gif", cOut->GetName()));
         else delete cOut;
       }
+      // species
+      cOut = new TCanvas(Form("%s_%sSpecies", GetName(), typName[ityp]), "Track IN Resolution", Int_t(1.5*nx), Int_t(1.5*ny));
+      cOut->Divide(5,3, 1.e-5, 1.e-5);
+      Int_t nplot(0); const Char_t *chName[] = {"p", "n", ""};
+      for(Int_t iplot(0); iplot<3; iplot++){
+        for(Int_t ispec(0); ispec<AliPID::kSPECIES; ispec++){
+          p=cOut->cd(iplot*AliPID::kSPECIES+ispec+1); p->SetRightMargin(0.1572581); p->SetTopMargin(0.08262712);
+          if(!(h2 = (TH2*)arr->FindObject(Form("H%sTrkInY%s%d_2D", typName[ityp], chName[iplot], ispec)))) {
+            AliInfo(Form("Missing H%sTrkInY%s%d_2D", typName[ityp], chName[iplot], ispec));
+            continue;
+          }
+          nplot++;
+          h2->Draw("colz");
+          MakeDetectorPlot(0);
+        }
+      }
+      if(nplot==15) cOut->SaveAs(Form("%s.gif", cOut->GetName()));
+      else delete cOut;
     }
   }
   // track MC systematic
@@ -1180,6 +1249,88 @@ void AliTRDresolution::GetRange(TH2 *h2, Char_t mod, Float_t *range)
   return;
 }
 
+//________________________________________________________
+Bool_t AliTRDresolution::MakeProjectionDetector()
+{
+// Analyse cluster
+  const Int_t kNcontours(9);
+  const Int_t kNstat(100);
+  if(fProj && fProj->At(kDetector)) return kTRUE;
+  if(!fContainer){
+    AliError("Missing data container.");
+    return kFALSE;
+  }
+  THnSparse *H(NULL);
+  if(!(H = (THnSparse*)fContainer->FindObject("hDet2Cluster"))){
+    AliInfo(Form("Missing/Wrong data @ hDet2Cluster."));
+    return kTRUE;
+  }
+  Int_t ndim(H->GetNdimensions());
+  Int_t coord[kNdim]; memset(coord, 0, sizeof(Int_t) * kNdim); Double_t v = 0.;
+  TAxis *aa[kNdim], *ac(NULL); memset(aa, 0, sizeof(TAxis*) * kNdim);
+  for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id);
+  Int_t nCen(1);
+  if(ndim > 4){
+    ac = H->GetAxis(4);
+    nCen = AliTRDeventInfo::kCentralityClasses;
+  }
+  // build list of projections
+  const Int_t nsel(AliTRDgeometry::kNlayer*AliTRDeventInfo::kCentralityClasses);
+  // define rebinning strategy
+  const Int_t nEtaPhi(4); Int_t rebinEtaPhiX[nEtaPhi] = {1, 2, 5, 1}, rebinEtaPhiY[nEtaPhi] = {2, 1, 1, 5};
+  const Char_t *cenName[AliTRDeventInfo::kCentralityClasses] = {"0-10%", "10-20%", "20-50%", "50-80%", "80-100%"};
+  AliTRDresolutionProjection hp[kDetNproj];  TObjArray php(kDetNproj);
+  Int_t ih(0), isel(-1), np[nsel]; memset(np, 0, nsel*sizeof(Int_t));
+  for(Int_t icen(0); icen<nCen; icen++){
+    for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
+      isel++; // new selection
+      hp[ih].Build(Form("HDetQ%d%d", ily, icen),
+                   Form("Detectors :: Q Ly[%d] Cen[%s]", ily, cenName[icen]),
+                   kEta, kPhi, kYrez, aa);
+      hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
+      hp[ih].SetShowRange(10., 55.);
+      php.AddLast(&hp[ih++]); np[isel]++;
+    }
+  }
+  AliInfo(Form("Build %3d 3D projections.", ih));
+
+  Int_t ly(0), cen(0);
+  for (Long64_t ib(0); ib < H->GetNbins(); ib++) {
+    v = H->GetBinContent(ib, coord); if(v<1.) continue;
+    ly = coord[kBC]-1;
+
+    // centrality selection
+    cen = 0;
+    if(ac) cen = coord[4]-1;
+
+    isel = cen*AliTRDgeometry::kNlayer+ly; Int_t ioff=isel;
+//    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);
+  }
+  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(!(h2 = hp[ih].Projection2D(kNstat, kNcontours, 2))) continue;
+    arr->AddAt(h2, jh++);
+  }
+  AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
+  for(Int_t ily(0); ily<AliTRDgeometry::kNlayer; ily++){
+    if((pr0 = (AliTRDresolutionProjection*)php.FindObject(Form("HDetQ%d%d", ily, 0)))){
+      for(Int_t icen(1); icen<nCen; icen++){
+        if((pr1 = (AliTRDresolutionProjection*)php.FindObject(Form("HDetQ%d%d", ily, icen)))){
+          (*pr0)+=(*pr1);
+        }
+      }
+      pr0->fH->SetNameTitle(Form("HDetQ%d", ily), Form("Detectors :: Q Ly[%d]", ily));
+      if((h2 = pr0->Projection2D(kNstat, kNcontours))) arr->AddAt(h2, jh++);
+    }
+  }
+  AliInfo(Form("Done %3d 2D projections.", jh));
+  return kTRUE;
+}
 
 //________________________________________________________
 Bool_t AliTRDresolution::MakeProjectionCluster(Bool_t mc)
@@ -1193,9 +1344,10 @@ Bool_t AliTRDresolution::MakeProjectionCluster(Bool_t mc)
     AliError("Missing data container.");
     return kFALSE;
   }
+  const Char_t *projName[] = {"hCluster2Track", "hCluster2MC"};
   THnSparse *H(NULL);
-  if(!(H = (THnSparse*)fContainer->At(cidx))){
-    AliError(Form("Missing/Wrong data @ %d.", cidx));
+  if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){
+    AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)]));
     return kFALSE;
   }
   Int_t ndim(H->GetNdimensions());
@@ -1298,9 +1450,10 @@ Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc)
     AliError("Missing data container.");
     return kFALSE;
   }
+  const Char_t *projName[] = {"hTracklet2Track", "hTracklet2MC"};
   THnSparse *H(NULL);
-  if(!(H = (THnSparse*)fContainer->At(cidx))){
-    AliError(Form("Missing/Wrong data @ %d.", cidx));
+  if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){
+    AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)]));
     return kFALSE;
   }
   const Int_t mdim(kNdim+8);
@@ -1334,25 +1487,25 @@ Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc)
           for(Int_t ich(0); ich<nCh; ich++){
             isel++; // new selection
             hp[ih].Build(Form("H%sTrkltY%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen),
-                        Form("Tracklets[%s%c]:: #Deltay{%s} Ly[%d] Cen[%s]", AliPID::ParticleShortName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
+                        Form("Tracklets[%s%c]:: #Deltay{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
                         kEta, kPhi, kYrez, aa);
             //hp[ih].SetShowRange(-0.1,0.1);
             hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
             php.AddLast(&hp[ih++]); np[isel]++;
             hp[ih].Build(Form("H%sTrkltPh%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen),
-                        Form("Tracklets[%s%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", AliPID::ParticleShortName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
+                        Form("Tracklets[%s%c]:: #Delta#phi{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
                         kEta, kPhi, kPrez, aa);
             //hp[ih].SetShowRange(-0.5,0.5);
             hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
             php.AddLast(&hp[ih++]); np[isel]++;
             hp[ih].Build(Form("H%sTrkltQ%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen),
-                        Form("Tracklets[%s%c]:: dQdl{%s} Ly[%d] Cen[%s]", AliPID::ParticleShortName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
+                        Form("Tracklets[%s%c]:: dQdl{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
                         kEta, kPhi, kNdim, aa);
-            hp[ih].SetShowRange(1.7,2.1);
+            hp[ih].SetShowRange(1.,2.3);
             hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
             php.AddLast(&hp[ih++]); np[isel]++;
             hp[ih].Build(Form("H%sTrkltTB%c%c%d%d%d", mc?"MC":"", chName[ich], ptName[ipt], isp, ily, icen),
-                        Form("Tracklets[%s%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", AliPID::ParticleShortName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
+                        Form("Tracklets[%s%c]:: OccupancyTB{%s} Ly[%d] Cen[%s]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily, cenName[icen]),
                         kEta, kPhi, kNdim+2, aa);
             hp[ih].SetShowRange(30., 70.);
             hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
@@ -1471,7 +1624,7 @@ Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc)
             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),
                                       Form("Tracklets[%c]:: dQdl{%s} Ly[%d] Cen[%s]", chSgn[ich], ptCut[ipt], ily, cenName[icen]));
-            pr0->SetShowRange(2.5, 4.5);
+            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);
           }
@@ -1505,11 +1658,11 @@ Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc)
         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),
                                 Form("Tracklets[%c]:: dQdl Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
-          pr0->SetShowRange(1.7,2.1);
+          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),
                                 Form("Tracklets[%c]:: dQdl Ly[%d] Cen[%s]", chSgn[ich], ily, cenName[icen]));
-          pr0->SetShowRange(2.5,4.5);
+          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);
         }
@@ -1536,10 +1689,10 @@ Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc)
       /*!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));
-        pr0->SetShowRange(1.7,2.1);
+        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->SetShowRange(2.5,4.5);
+        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);
       }
@@ -1600,7 +1753,6 @@ Bool_t AliTRDresolution::MakeProjectionTracklet(Bool_t mc)
 Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
 {
 // Analyse track in
-
   const Int_t kNcontours(9);
   const Int_t kNstat(30);
   Int_t cidx=mc?kMCtrackIn:kTrackIn;
@@ -1609,9 +1761,10 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
     AliError("Missing data container.");
     return kFALSE;
   }
+  const Char_t *projName[] = {"hTracklet2TRDin", "hTRDin2MC"};
   THnSparse *H(NULL);
-  if(!(H = (THnSparse*)fContainer->At(cidx))){
-    AliError(Form("Missing/Wrong data @ %d.", Int_t(cidx)));
+  if(!(H = (THnSparse*)fContainer->FindObject(projName[Int_t(mc)]))){
+    AliError(Form("Missing/Wrong data @ %s.", projName[Int_t(mc)]));
     return kFALSE;
   }
 
@@ -1621,12 +1774,13 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
   TAxis *aa[mdim], *as(NULL), *ap(NULL), *abf(NULL); memset(aa, 0, sizeof(TAxis*) * (mdim));
   for(Int_t id(0); id<ndim; id++) aa[id] = H->GetAxis(id);
   if(ndim > kSpeciesChgRC) as = H->GetAxis(kSpeciesChgRC);
-  if(ndim > kPt) ap = H->GetAxis(kPt);
-  if(ndim > (kNdim+2)) abf = H->GetAxis(kNdim+2);
+  if(ndim > kPt)           ap = H->GetAxis(kPt);
+  if(ndim > (kNdim+2))    abf = H->GetAxis(kNdim+2);
   AliInfo(Form("Using : Species[%c] Pt[%c] BunchFill[%c]", as?'y':'n', ap?'y':'n', abf?'y':'n'));
+  const Int_t nPt(ndim>kNdimTrkIn?kNpt:1);
 
   // build list of projections
-  const Int_t nsel(33);
+  const Int_t nsel(kNpt*(AliPID::kSPECIES*kNcharge + 1));
   const Char_t chName[kNcharge] = {'n', 'p'};const Char_t chSgn[kNcharge] = {'-', '+'};
   const Char_t ptName[kNpt] = {'l', 'i', 'h'};
   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"};
@@ -1635,22 +1789,22 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
   AliTRDresolutionProjection 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<kNpt; ipt++){
+  for(Int_t ipt(0); ipt<nPt; ipt++){
     for(Int_t isp(0); isp<AliPID::kSPECIES; isp++){
       for(Int_t ich(0); ich<kNcharge; ich++){
         isel++; // new selection
         hp[ih].Build(Form("H%sTrkInY%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp),
-                     Form("TrackIn[%s%c]:: #Deltay{%s}", AliPID::ParticleShortName(isp), chSgn[ich], ptCut[ipt]),
+                     Form("TrackIn[%s%c]:: #Deltay{%s}", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt]),
                      kEta, kPhi, kYrez, aa);
         hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
         php.AddLast(&hp[ih++]); np[isel]++;
         hp[ih].Build(Form("H%sTrkInPh%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp),
-                     Form("TrackIn[%s%c]:: #Delta#phi{%s}", AliPID::ParticleShortName(isp), chSgn[ich], ptCut[ipt]),
+                     Form("TrackIn[%s%c]:: #Delta#phi{%s}", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt]),
                      kEta, kPhi, kPrez, aa);
         hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
         php.AddLast(&hp[ih++]); np[isel]++;
         hp[ih].Build(Form("H%sTrkInX%c%c%d", mc?"MC":"", chName[ich], ptName[ipt], isp),
-                     Form("TrackIn[%s%c]:: #Deltax{%s}", AliPID::ParticleShortName(isp), chSgn[ich], ptCut[ipt]),
+                     Form("TrackIn[%s%c]:: #Deltax{%s}", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt]),
                      kEta, kPhi, kNdim+1, aa);
         hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
         php.AddLast(&hp[ih++]); np[isel]++;
@@ -1681,7 +1835,7 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
   AliInfo(Form("Build %3d 3D projections.", ih));
 
   // fill projections
-  Int_t ch(0), pt(0), sp(1), rcBin(as?as->FindBin(0.):-1);
+  Int_t ch(0), pt(0), sp(1), rcBin(as?as->FindBin(0.):-1), ioff(0);
   for (Long64_t ib(0); ib < H->GetNbins(); ib++) {
     v = H->GetBinContent(ib, coord);
     if(v<1.) continue;
@@ -1699,7 +1853,7 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
     if(ap) pt = TMath::Min(coord[kPt]-1, Int_t(kNpt)-1);
     // global selection
     isel = pt*11; isel+=sp<0?10:(sp*kNcharge+ch);
-    Int_t ioff = pt*34; ioff+=3*(sp<0?10:(sp*kNcharge+ch));
+    ioff = pt*34; ioff+=3*(sp<0?10:(sp*kNcharge+ch));
     AliDebug(4, Form("SELECTION[%d] :: ch[%c] pt[%c] sp[%d]\n", np[isel], ch==2?'Z':chName[ch], ptName[pt], sp));
     for(Int_t jh(0); jh<np[isel]; jh++) ((AliTRDresolutionProjection*)php.At(ioff+jh))->Increment(coord, v);
   }
@@ -1715,9 +1869,42 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
   // build combined performance plots
   // combine up the tree of projections
   AliTRDresolutionProjection *pr0(NULL), *pr1(NULL);
-  AliTRDresolutionProjection xlow[2];
+  AliTRDresolutionProjection xlow[2], specY[kNcharge*AliPID::kSPECIES], specPh[kNcharge*AliPID::kSPECIES];
   for(Int_t ich(0); ich<kNcharge; ich++){
-    for(Int_t ipt(0); ipt<kNpt; ipt++){
+    // 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)))){
+        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),
+                              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;
+          specY[idx]+=(*pr1);
+        }
+        php.AddLast(&specY[idx]);
+        if((h2 = specY[idx].Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
+        if(ich && (pr1 = (AliTRDresolutionProjection*)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)))){
+        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),
+                              Form("TrackIn[%s%c]:: #Delta#phi", AliPID::ParticleLatexName(isp), chSgn[ich]));
+        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;
+          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];
+      }
+    }
+    // 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)))){
         for(Int_t isp(1); isp<AliPID::kSPECIES; isp++){
@@ -1778,7 +1965,7 @@ Bool_t AliTRDresolution::MakeProjectionTrackIn(Bool_t mc)
     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]),
                             Form("TrackIn[%c]:: #Delta#phi", chSgn[ich]));
-      pr0->SetShowRange(-0.1, 0.1);
+      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);
     }
@@ -1798,10 +1985,23 @@ 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)));
+      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%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((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
+    }
+  }
   /*!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");
-    pr0->SetShowRange(-0.15, 0.15);
+    pr0->SetShowRange(-0.3, 0.3);
     if((h2 = pr0->Projection2D(kNstat, kNcontours, 1))) arr->AddAt(h2, jh++);
   }
   /*!dphi*/
@@ -1868,8 +2068,8 @@ Bool_t AliTRDresolution::MakeProjectionTrack()
     return kFALSE;
   }
   THnSparse *H(NULL);
-  if(!(H = (THnSparse*)fContainer->At(cidx))){
-    AliError(Form("Missing/Wrong data @ %d.", cidx));
+  if(!(H = (THnSparse*)fContainer->FindObject("hTRD2MC"))){
+    AliError("Missing/Wrong data @ hTRD2MC.");
     return kFALSE;
   }
   Int_t ndim(H->GetNdimensions());
@@ -1894,17 +2094,17 @@ Bool_t AliTRDresolution::MakeProjectionTrack()
         for(Int_t ich(0); ich<kNcharge; ich++){
           isel++; // new selection
           hp[ih].Build(Form("HMCTrkY%c%c%d%d", chName[ich], ptName[ipt], isp, ily),
-                       Form("Tracks[%s%c]:: #Deltay{%s} Ly[%d]", AliPID::ParticleShortName(isp), chSgn[ich], ptCut[ipt], ily),
+                       Form("Tracks[%s%c]:: #Deltay{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily),
                        kEta, kPhi, kYrez, aa);
           hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
           php.AddLast(&hp[ih++]); np[isel]++;
           hp[ih].Build(Form("HMCTrkPh%c%c%d%d", chName[ich], ptName[ipt], isp, ily),
-                       Form("Tracks[%s%c]:: #Delta#phi{%s} Ly[%d]", AliPID::ParticleShortName(isp), chSgn[ich], ptCut[ipt], ily),
+                       Form("Tracks[%s%c]:: #Delta#phi{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily),
                        kEta, kPhi, kPrez, aa);
           hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
           php.AddLast(&hp[ih++]); np[isel]++;
           hp[ih].Build(Form("HMCTrkDPt%c%c%d%d", chName[ich], ptName[ipt], isp, ily),
-                       Form("Tracks[%s%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", AliPID::ParticleShortName(isp), chSgn[ich], ptCut[ipt], ily),
+                       Form("Tracks[%s%c]:: #Deltap_{t}/p_{t}{%s} Ly[%d]", AliPID::ParticleLatexName(isp), chSgn[ich], ptCut[ipt], ily),
                        kEta, kPhi, kNdim, aa);
           hp[ih].SetShowRange(0.,10.);
           hp[ih].SetRebinStrategy(nEtaPhi, rebinEtaPhiX, rebinEtaPhiY);
@@ -2052,8 +2252,10 @@ Bool_t AliTRDresolution::PostProcess()
   }
 
   //PROCESS EXPERIMENTAL DISTRIBUTIONS
+  // Clusters detector
+  if(!MakeProjectionDetector()) return kFALSE;
   // Clusters residuals
-//  if(!MakeProjectionCluster()) return kFALSE;
+  if(!MakeProjectionCluster()) return kFALSE;
   fNRefFigures = 3;
   // Tracklet residual/pulls
   if(!MakeProjectionTracklet()) return kFALSE;
@@ -2289,6 +2491,22 @@ TObjArray* AliTRDresolution::Histos()
   const Int_t nhn(100); Char_t hn[nhn]; TString st;
 
   //++++++++++++++++++++++
+  // cluster to detector
+  snprintf(hn, nhn, "h%s", fgPerformanceName[kDetector]);
+  if(!(H = (THnSparseI*)gROOT->FindObject(hn))){
+    const Int_t mdim(5);
+    const Char_t *cldTitle[mdim] = {"layer", fgkTitle[kPhi], fgkTitle[kEta], "q [a.u.]", "centrality"/*, "occupancy", "tb [10 Hz]"*/};
+    const Int_t cldNbins[mdim]   = {AliTRDgeometry::kNlayer, fgkNbins[kPhi], fgkNbins[kEta], 100, AliTRDeventInfo::kCentralityClasses};
+    const Double_t cldMin[mdim]  = {-0.5, fgkMin[kPhi], fgkMin[kEta], 0., -0.5},
+                   cldMax[mdim]  = {AliTRDgeometry::kNlayer-0.5, fgkMax[kPhi], fgkMax[kEta], 1200., AliTRDeventInfo::kCentralityClasses - 0.5};
+    st = "cluster proprieties;";
+    // define minimum info to be saved in non debug mode
+    Int_t ndim=DebugLevel()>=1?mdim:Int_t(kNdimDet);
+    for(Int_t idim(0); idim<ndim; idim++){ st += cldTitle[idim]; st+=";";}
+    H = new THnSparseI(hn, st.Data(), ndim, cldNbins, cldMin, cldMax);
+  } else H->Reset();
+  fContainer->AddAt(H, kDetector);
+  //++++++++++++++++++++++
   // cluster to tracklet residuals/pulls
   snprintf(hn, nhn, "h%s", fgPerformanceName[kCluster]);
   if(!(H = (THnSparseI*)gROOT->FindObject(hn))){
index 8cf10b0..6a62046 100644 (file)
@@ -53,7 +53,8 @@ public:
     ,kNSlots     = 4
   };
   enum ETRDresolutionClass {
-    kCluster=0        // cluster - track
+     kDetector=0      // cluster - detector
+    ,kCluster         // cluster - track
     ,kTracklet        // tracklet - track residuals/pulls
     ,kTrackIn         // tracklet - track residuals/pulls at lower TRD entrance
     ,kMCcluster       // cluster-mc resolution/pulls
@@ -65,7 +66,8 @@ public:
     ,kNclasses        // total number of resolution classes
   };
   enum ETRDresolutionClassProjs {
-    kClNproj=60        // cluster projections
+    kDetNproj=60       // detector projections
+    ,kClNproj=60       // cluster projections
     ,kTrkltNproj=8000  // tracklet projections
     ,kTrkInNproj=142   // trackIn projections
     ,kTrkNproj=2500    // track projections
@@ -83,7 +85,8 @@ public:
     ,kNdim  // no of dimensions in the THnSparse
   };
   enum ETRDresolutionSize {
-     kNdimCl      = 4
+     kNdimDet     = 4
+    ,kNdimCl      = 4
     ,kNdimTrklt   = 4
     ,kNdimTrkIn   = 7
     ,kNbunchCross = 3  // no of classes for bunch crossing
@@ -123,6 +126,7 @@ public:
   Bool_t          UseExchangeContainers() const         { return TestBit(kXchange);}
   Bool_t          PostProcess();
 
+  TH1*            DetCluster(const TObjArray *cl=NULL);
   TH1*            PlotCluster(const AliTRDtrackV1 *t=NULL);
   TH1*            PlotTracklet(const AliTRDtrackV1 *t=NULL);
   TH1*            PlotTrackIn(const AliTRDtrackV1 *t=NULL);
@@ -181,6 +185,7 @@ public:
   void        GetRange(TH2 *h2, Char_t mod, Float_t *range);
 
 protected:
+  Bool_t      MakeProjectionDetector();
   Bool_t      MakeProjectionCluster(Bool_t mc=kFALSE);
   Bool_t      MakeProjectionTracklet(Bool_t mc=kFALSE);
   Bool_t      MakeProjectionTrackIn(Bool_t mc=kFALSE);
index 9d225ce..ad8895c 100644 (file)
@@ -10,7 +10,7 @@
 
 void AddTRDcheckDET(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContainer **ci/*, AliAnalysisDataContainer **co*/)
 {
-  Info("AddTRDcheckDET", Form("[0]=\"%s\" [1]=\"%s\" [2]=\"%s\" [3]=\"%s\"", ci[0]->GetName(), ci[1]->GetName(), ci[2]->GetName(), ci[3]->GetName()));
+  Info("AddTRDcheckDET", Form("[0]=\"%s\" [1]=\"%s\" [2]=\"%s\" [3]=\"%s\" [4]=\"%s\"", ci[0]->GetName(), ci[1]->GetName(), ci[2]->GetName(), ci[3]->GetName(), ci[4]->GetName()));
   AliAnalysisDataContainer *evInfoContainer = ci[3];
 
   //AliLog::SetClassDebugLevel("AliTRDcheckDET", 5);
@@ -27,6 +27,7 @@ void AddTRDcheckDET(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContainer
   mgr->ConnectInput ( task, 0, mgr->GetCommonInputContainer()); // connect main (ESD) container
   mgr->ConnectInput ( task, 1, ci[trackStatus]);                // conect track info container
   mgr->ConnectInput ( task, 2, evInfoContainer);                // conect event info container
+  mgr->ConnectInput ( task, 3, ci[4]);                          // conect clusters container
   mgr->ConnectOutput( task, 1, mgr->CreateContainer(task->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Performance",mgr->GetCommonFileName())));
   
 
index 838e102..a141233 100644 (file)
@@ -11,7 +11,7 @@
 
 void AddTRDcheckTRK(AliAnalysisManager *mgr, Int_t /*map*/, AliAnalysisDataContainer **ci/*, AliAnalysisDataContainer **co*/)
 {
-  Info("AddTRDcheckTRK", Form("[0]=\"%s\" [1]=\"%s\"", ci[0]->GetName(), ci[1]->GetName()));
+  Info("AddTRDcheckTRK", Form("[0]=\"%s\" [1]=\"%s\" [2]=\"%s\"", ci[0]->GetName(), ci[1]->GetName(), ci[2]->GetName()));
 
   //AliLog::SetClassDebugLevel("AliTRDcheckTRK", 3);
   // global settings for tracking
@@ -50,6 +50,7 @@ void AddTRDcheckTRK(AliAnalysisManager *mgr, Int_t /*map*/, AliAnalysisDataConta
   mgr->ConnectInput( trk, 0, mgr->GetCommonInputContainer()); // connect main (ESD) container
   mgr->ConnectInput( trk, 1, ci[0]);                          // connect barrel tracks container
   mgr->ConnectInput( trk, 2, ci[1]);                          // connect event info container
+  mgr->ConnectInput( trk, 3, ci[2]);                          // connect clusters container
 
   mgr->ConnectOutput(trk, 1, mgr->CreateContainer(trk->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Performance",mgr->GetCommonFileName())));
 }
index c434f7d..f15171e 100644 (file)
@@ -10,7 +10,7 @@
 
 void AddTRDefficiency(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContainer **ci/*, AliAnalysisDataContainer **co*/)
 {
-  Info("AddTRDefficiency", Form("[0]=\"%s\" [1]=\"%s\" [2]=\"%s\" [3]=\"%s\"", ci[0]->GetName(), ci[1]->GetName(), ci[2]->GetName(), ci[3]->GetName()));
+  Info("AddTRDefficiency", Form("[0]=\"%s\" [1]=\"%s\" [2]=\"%s\" [3]=\"%s\" [4]=\"%s\"", ci[0]->GetName(), ci[1]->GetName(), ci[2]->GetName(), ci[3]->GetName(), ci[4]->GetName()));
 
   AliAnalysisDataContainer *evInfoContainer = ci[3];
   AliTRDrecoTask *eff(NULL);
@@ -23,6 +23,7 @@ void AddTRDefficiency(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContain
   mgr->ConnectInput(eff, 0, mgr->GetCommonInputContainer());  // connect main (ESD) container
   mgr->ConnectInput(eff, 1, ci[trackStatus]);                 // conect track info container
   mgr->ConnectInput(eff, 2, evInfoContainer);                 // conect event info container
+  mgr->ConnectInput(eff, 3, ci[4]);                 // conect clusters container
   mgr->ConnectOutput(eff,1, mgr->CreateContainer(eff->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Performance", mgr->GetCommonFileName())));
     
 
index 8fb9528..b8d8989 100644 (file)
@@ -46,6 +46,7 @@ void AddTRDinfoGen(AliAnalysisManager *mgr, Int_t /*map*/, AliAnalysisDataContai
   co[AliTRDpwg1Helper::kTracksSA] = mgr->CreateContainer("tracksSA", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
   co[AliTRDpwg1Helper::kTracksKink] = mgr->CreateContainer("tracksKink", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
   co[AliTRDpwg1Helper::kV0List] = mgr->CreateContainer("v0List", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
+  co[AliTRDpwg1Helper::kClusters] = mgr->CreateContainer("clusters", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
   for(Int_t ios(1);ios<AliTRDpwg1Helper::kNOutSlots-1;ios++) mgr->ConnectOutput(info, ios, co[ios]);
   
   // add last monitor container
index 87602ab..64caf47 100644 (file)
@@ -13,7 +13,7 @@
 
 void AddTRDresolution(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContainer **ci)
 {
-  Info("AddTRDresolution", Form("[0]=\"%s\" [1]=\"%s\" [2]=\"%s\" [3]=\"%s\"", ci[0]->GetName(), ci[1]->GetName(), ci[2]->GetName(), ci[3]->GetName()));
+  Info("AddTRDresolution", Form("[0]=\"%s\" [1]=\"%s\" [2]=\"%s\" [3]=\"%s\" [4]=\"%s\"", ci[0]->GetName(), ci[1]->GetName(), ci[2]->GetName(), ci[3]->GetName(), ci[4]->GetName()));
   AliAnalysisDataContainer *evInfoContainer = ci[3];
 
   //AliLog::SetClassDebugLevel("AliTRDrecoTask", 2);
@@ -25,14 +25,12 @@ void AddTRDresolution(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContain
     res->SetMCdata(mgr->GetMCtruthEventHandler());
     res->SetPostProcess(kFALSE);
     //res->SetDebugLevel(3);
-    //if(itq==0) res->SetSegmentationLevel(AliTRDresolution::kDetector);
-    // use these settings if you know what you are doing !
-    //res->SetTrackRefit(); 
     res->SetPtThreshold(0.2);
     res->SetNameId(suffix[itq]);
     mgr->ConnectInput(res, 0, mgr->GetCommonInputContainer()); // connect main (ESD) container 
     mgr->ConnectInput(res, 1, ci[itq]);                        // conect track info container
     mgr->ConnectInput(res, 2, evInfoContainer);                // conect event info container
+    mgr->ConnectInput(res, 3, ci[4]);                          // conect clusters container
     mgr->ConnectOutput(res,1, mgr->CreateContainer(res->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Performance", mgr->GetCommonFileName())));
   
     // Create output containers for calibration tasks
index 8944b55..edb82ca 100644 (file)
@@ -108,6 +108,7 @@ Bool_t AddTrainPerformanceTRD(Char_t *trd="ALL", const Char_t *addMacroPath = "$
       ce[1]=ci[AliTRDpwg1Helper::kTracksSA];\r
       ce[2]=ci[AliTRDpwg1Helper::kTracksKink];\r
       ce[3]=ci[AliTRDpwg1Helper::kEventInfo];\r
+      ce[4]=ci[AliTRDpwg1Helper::kClusters];\r
       AddTRDcheckDET(mgr, bitmap, ce);\r
       break;\r
     case AliTRDpwg1Helper::kEfficiency:\r
@@ -116,6 +117,7 @@ Bool_t AddTrainPerformanceTRD(Char_t *trd="ALL", const Char_t *addMacroPath = "$
       ce[1]=ci[AliTRDpwg1Helper::kTracksSA];\r
       ce[2]=ci[AliTRDpwg1Helper::kTracksKink];\r
       ce[3]=ci[AliTRDpwg1Helper::kEventInfo];\r
+      ce[4]=ci[AliTRDpwg1Helper::kClusters];\r
       AddTRDefficiency(mgr, bitmap, ce);\r
       break;\r
     case AliTRDpwg1Helper::kResolution:\r
@@ -124,6 +126,7 @@ Bool_t AddTrainPerformanceTRD(Char_t *trd="ALL", const Char_t *addMacroPath = "$
       ce[1]=ci[AliTRDpwg1Helper::kTracksSA];\r
       ce[2]=ci[AliTRDpwg1Helper::kTracksKink];\r
       ce[3]=ci[AliTRDpwg1Helper::kEventInfo];\r
+      ce[4]=ci[AliTRDpwg1Helper::kClusters];\r
       AddTRDresolution(mgr, bitmap, ce); \r
       break;\r
     case AliTRDpwg1Helper::kCheckPID:\r
@@ -137,6 +140,7 @@ Bool_t AddTrainPerformanceTRD(Char_t *trd="ALL", const Char_t *addMacroPath = "$
       // map slots\r
       ce[0]=ci[AliTRDpwg1Helper::kTracksBarrel];\r
       ce[1]=ci[AliTRDpwg1Helper::kEventInfo];\r
+      ce[2]=ci[AliTRDpwg1Helper::kClusters];\r
       AddTRDcheckTRK(mgr, 0, ce);\r
       break;\r
     case AliTRDpwg1Helper::kV0Monitor:\r