]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
improve user interface
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Feb 2009 16:09:36 +0000 (16:09 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 26 Feb 2009 16:09:36 +0000 (16:09 +0000)
TRD/qaRec/AliTRDcheckESD.cxx
TRD/qaRec/AliTRDcheckESD.h

index 6b09d0fe36ab9563ba8a3336ddcafffd02e18395..958533759d04b494c925f664a59c3d4be2f5c38e 100644 (file)
@@ -96,32 +96,7 @@ void AliTRDcheckESD::CreateOutputObjects()
   // Create Output Containers (TObjectArray containing 1D histograms)
   //
   OpenFile(0, "RECREATE");  
-  fHistos = new TObjArray(5);
-  //fHistos->SetOwner(kTRUE);
-  
-  TH1 *h = 0x0;
-
-  // clusters per tracklet
-  if(!(h = (TH1I*)gROOT->FindObject("hNCl"))){
-    h = new TH1I("hNCl", "Clusters per TRD track", 100, 0., 200.);
-    h->GetXaxis()->SetTitle("N_{cl}^{TRD}");
-    h->GetYaxis()->SetTitle("entries");
-  } else h->Reset();
-  fHistos->AddAt(h, kNCl);
-
-  // status bits histogram
-  if(!(h = (TH2I*)gROOT->FindObject("hTRDstat"))){
-    h = new TH2I("hTRDstat", "TRD status bits", 100, 0., 20., kNbits, .5, kNbits+.5);
-    h->GetXaxis()->SetTitle("p_{T} [GeV/c]");
-    h->GetYaxis()->SetTitle("status bits");
-    h->GetZaxis()->SetTitle("entries");
-  } else h->Reset();
-  fHistos->AddAt(h, kTRDstat);
-
-  // results array
-  TObjArray *res = new TObjArray();
-  res->SetName("Results");
-  fHistos->AddAt(res, kResults);
+  Histos();
 }
 
 //____________________________________________________________________
@@ -276,6 +251,40 @@ void AliTRDcheckESD::Exec(Option_t *){
   PostData(0, fHistos);
 }
 
+//____________________________________________________________________
+TObjArray* AliTRDcheckESD::Histos()
+{
+  if(fHistos) return fHistos;
+
+  fHistos = new TObjArray(kNhistos);
+  //fHistos->SetOwner(kTRUE);
+  
+  TH1 *h = 0x0;
+
+  // clusters per tracklet
+  if(!(h = (TH1I*)gROOT->FindObject("hNCl"))){
+    h = new TH1I("hNCl", "Clusters per TRD track", 100, 0., 200.);
+    h->GetXaxis()->SetTitle("N_{cl}^{TRD}");
+    h->GetYaxis()->SetTitle("entries");
+  } else h->Reset();
+  fHistos->AddAt(h, kNCl);
+
+  // status bits histogram
+  if(!(h = (TH2I*)gROOT->FindObject("hTRDstat"))){
+    h = new TH2I("hTRDstat", "TRD status bits", 100, 0., 20., kNbits, .5, kNbits+.5);
+    h->GetXaxis()->SetTitle("p_{T} [GeV/c]");
+    h->GetYaxis()->SetTitle("status bits");
+    h->GetZaxis()->SetTitle("entries");
+  } else h->Reset();
+  fHistos->AddAt(h, kTRDstat);
+
+  // results array
+  TObjArray *res = new TObjArray();
+  res->SetName("Results");
+  fHistos->AddAt(res, kResults);
+  return fHistos;
+}
+
 //____________________________________________________________________
 Bool_t AliTRDcheckESD::Load(const Char_t *filename, const Char_t *name)
 {
index 151bb56a255b42133d23e055677b475bf13ab86c..15bc2ba70dabbd8e86d172d31d5d27ee45bd9273 100644 (file)
@@ -47,6 +47,7 @@ public:
   void          Exec(Option_t *);
 
   Bool_t        HasMC() const { return TESTBIT(fStatus, kMC);}
+  TObjArray*    Histos();
   Bool_t        Load(const Char_t *fn, const Char_t *name=0x0);
   void          SetMC(Bool_t mc = kTRUE) { mc ? SETBIT(fStatus, kMC) : CLRBIT(fStatus, kMC);}
   void          Terminate(Option_t *);