]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
better ESD performance plot
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 30 Oct 2009 12:19:21 +0000 (12:19 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 30 Oct 2009 12:19:21 +0000 (12:19 +0000)
TRD/qaRec/AliTRDcheckESD.cxx
TRD/qaRec/AliTRDcheckESD.h
TRD/qaRec/macros/makeResults.C

index 030fb57ddee1e43fabdbcc91161270625bf5b54d..a0db74374bc94fc381d6bf5c55542925e9f2bca6 100644 (file)
@@ -118,6 +118,64 @@ void AliTRDcheckESD::CreateOutputObjects()
   Histos();
 }
 
+//____________________________________________________________________
+Bool_t AliTRDcheckESD::GetRefFigure(Int_t ifig)
+{
+  if(!gPad){
+    AliWarning("Please provide a canvas to draw results.");
+    return kFALSE;
+  }
+  TGraph *g(0x0); TH1 *h(0x0); TLegend *leg(0x0);
+  switch(ifig){
+  case kNCl:
+    if(!fHistos || !(h=(TH1I*)fHistos->At(kNCl))) break;
+    h->Draw("c");
+    return kTRUE;
+  case kTRDstat:
+    leg=new TLegend(.5, .75, .98, .98);
+    leg->SetBorderSize(1); leg->SetFillColor(0);
+    leg->SetHeader("Tracking Efficiency");
+    for(Int_t ieff=0; ieff<4; ieff++){
+      if(!(g=GetGraph(ieff, ""))) break;
+      if(!ieff){
+        if((h=(TH1S*)gROOT->FindObject("frame"))) delete h;
+        h=new TH1S("h","",100, 0., 15.);
+        h->SetLineColor(1);h->SetLineWidth(1);
+        h->SetMinimum(0.2);h->SetMaximum(1.2);
+        h->SetXTitle("p_{T} [GeV/c]");
+        h->SetYTitle("Efficiency");
+        h->Draw();
+      }
+      g->Draw("pc"); leg->AddEntry(g, g->GetTitle(), "pl");
+    }
+    leg->Draw();
+    return kTRUE;
+  case kTRDmom:
+    leg=new TLegend(.6, .75, .98, .98);
+    leg->SetBorderSize(1); leg->SetFillColor(0);
+    leg->SetHeader("Energy loss");
+    for(Int_t ieff=0; ieff<2; ieff++){
+      if(!(g=GetGraph(4+ieff, ""))) break;
+      if(!ieff){
+        if((h=(TH1S*)gROOT->FindObject("frame"))) delete h;
+        h=new TH1S("h","",100, -0.5, 5.5);
+        h->SetLineColor(0);h->SetLineWidth(1);
+        h->SetMinimum(-0.5);h->SetMaximum(1.2);
+        h->SetXTitle("layer");
+        h->SetYTitle("p_{T}^{Inner TPC} - p_{T}^{layer} [GeV/c]");
+        h->Draw();
+      }
+      g->Draw("p"); leg->AddEntry(g, g->GetTitle(), "pl");
+    }
+    leg->Draw();
+    return kTRUE;
+  default:
+    break;
+  }
+  AliInfo(Form("Reference plot [%d] missing result", ifig));
+  return kFALSE;
+}
+
 //____________________________________________________________________
 TGraph* AliTRDcheckESD::GetGraph(Int_t id, Option_t *opt)
 {
@@ -165,15 +223,23 @@ TGraph* AliTRDcheckESD::GetGraph(Int_t id, Option_t *opt)
       switch(id){
       case 0:
         g = new TGraphErrors();
+        g->SetMarkerStyle(7);g->SetMarkerColor(kBlack);
+        g->SetLineColor(kBlack);
         break;
       case 1:
         g = new TGraphErrors();
+        g->SetMarkerStyle(7);g->SetMarkerColor(kRed);
+        g->SetLineColor(kRed);
         break;
       case 2:
         g = new TGraphErrors();
+        g->SetMarkerStyle(7);g->SetMarkerColor(kBlue);
+        g->SetLineColor(kBlue);
         break;
       case 3:
         g = new TGraphErrors();
+        g->SetMarkerStyle(7);g->SetMarkerColor(kGreen);
+        g->SetLineColor(kGreen);
         break;
       case 4:
         g = new TGraphAsymmErrors(6);
index 6dd999bdab080421f53427ca41659a5eecd322ed..d07d508e8ebb2bc2c4cdf1f0c11a872a0f4e3f77 100644 (file)
@@ -49,11 +49,10 @@ public:
   
   void          ConnectInputData(Option_t *);
   void          CreateOutputObjects();
-  TGraph*       GetGraph(Int_t id, Option_t *opt="bc");
+  Bool_t        GetRefFigure(Int_t ifig);
   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);}
   Bool_t        PutTrendValue(const Char_t *name, Double_t val);
@@ -65,6 +64,8 @@ private:
 
   AliTRDcheckESD(const AliTRDcheckESD&);
   AliTRDcheckESD& operator=(const AliTRDcheckESD&);
+  TGraph*       GetGraph(Int_t id, Option_t *opt="bc");
+  TObjArray*    Histos();
   void          Process(TH1 **h, TGraphErrors *g);
   void          PrintStatus(ULong_t s);
 
index 29b04987b45bca864c19d67ba3628d5657b2a7e1..3ed28f912c515fd4f263b628bdfaa04ff4cecbfd 100644 (file)
@@ -161,10 +161,11 @@ void processESD(TNamed *otask)
 
   esd->Terminate();
 
-  TGraphErrors *g = 0x0; Int_t ipic=0;
-  while((g=esd->GetGraph(ipic, ""))){
-    c->Clear(); g->Draw("apl");
+  c->Clear();
+  Int_t ipic=0;
+  while((esd->GetRefFigure(ipic))){
     c->SaveAs(Form("%s_Fig%02d.gif", esd->GetName(), ipic));
+    c->Clear();
     ipic++;
   }
   delete esd;