]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG1/TRD/AliTRDefficiency.cxx
set reco param on an event by event basis
[u/mrichter/AliRoot.git] / PWG1 / TRD / AliTRDefficiency.cxx
index 52cfca0577ce67e3956731c0ef65d28fa6da0660..6ade10f4cd144eb9832b57a57b3bf5c3917d84bf 100644 (file)
@@ -82,12 +82,11 @@ void  AliTRDefficiency::UserCreateOutputObjects()
   // Create output objects
   //
 
-  OpenFile(1, "RECREATE");
   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 = 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));
@@ -96,6 +95,7 @@ void  AliTRDefficiency::UserCreateOutputObjects()
   }
   fContainer->Add(h = new TProfile("h", "", nbins, xbins));
   h->SetMarkerStyle(7);
+  PostData(1, fContainer);
 } 
 
 //____________________________________________________________________
@@ -143,6 +143,7 @@ void AliTRDefficiency::UserExec(Option_t *)
     mom  = ref ? ref->P(): esd->P();
     pidx = AliTRDCalPID::GetPartIndex(track->GetPDG());
     pidx = TMath::Max(pidx, 0);
+    AliDebug(4, Form("PID: %d", pidx));
 
     //Int_t n = track->GetNumberOfClusters(); 
     // where are this tracklets ???
@@ -266,7 +267,6 @@ void AliTRDefficiency::UserExec(Option_t *)
        for(Int_t itk = 0; itk < nTRD - 1; itk++)
                if(labelsacc[indices[itk]] ==labelsacc[indices[itk + 1]]) printf("Double counted MC track: %d\n", labelsacc[indices[itk]]);
        }
-  PostData(1, fContainer);
 }
 
 
@@ -323,7 +323,7 @@ Bool_t AliTRDefficiency::GetRefFigure(Int_t ifig)
       }
       bFIRST = kFALSE;
     }
-    leg->Draw();
+    if(leg) leg->Draw();
     break;
   }
   return kTRUE;