]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New plot with fraction of good channels per layer
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Jun 2010 09:08:39 +0000 (09:08 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 Jun 2010 09:08:39 +0000 (09:08 +0000)
ITS/PlotCalibSDDVsTime.C

index 81c31ac30df521a4e66e13bad2bd34371bef4deb..d69813779befdc4001a98ba61708d8d12b3d5703 100644 (file)
@@ -8,6 +8,8 @@
 #include <TCanvas.h>
 #include <TSystem.h>
 #include <TLatex.h>
+#include <TLegend.h>
+#include <TLegendEntry.h>
 #include <TObjArray.h>
 #include "AliCDBEntry.h"
 #include "AliITSCalibrationSDD.h"
@@ -36,18 +38,29 @@ void PlotCalibSDDVsTime(Int_t year=2010, Int_t firstRun=77677,
   TH1F* hnoise=new TH1F("hnoise","",100,0.,7.);
   TH1F* hgain=new TH1F("hgain","",100,0.,4.);
   TH1F* hchstatus=new TH1F("hchstatus","",2,-0.5,1.5);
+  TH1F* hchstatus3=new TH1F("hchstatus3","",2,-0.5,1.5);
+  TH1F* hchstatus4=new TH1F("hchstatus4","",2,-0.5,1.5);
   TGraphErrors* gbasevstim=new TGraphErrors(0);
   TGraphErrors* gnoisevstim=new TGraphErrors(0);
   TGraphErrors* ggainvstim=new TGraphErrors(0);
   TGraphErrors* gstatvstim=new TGraphErrors(0);
+  TGraphErrors* gfracvstim=new TGraphErrors(0);
+  TGraphErrors* gfrac3vstim=new TGraphErrors(0);
+  TGraphErrors* gfrac4vstim=new TGraphErrors(0);
   gbasevstim->SetName("gbasevstim");
   gnoisevstim->SetName("gnoisevstim");
   ggainvstim->SetName("ggainvstim");
   gstatvstim->SetName("gstatvstim");
+  gfracvstim->SetName("gfracvstim");
+  gfrac3vstim->SetName("gfrac3vstim");
+  gfrac4vstim->SetName("gfrac4vstim");
   gbasevstim->SetTitle("Baseline vs. run");
   gnoisevstim->SetTitle("Noise vs. run");
   ggainvstim->SetTitle("Gain vs. run");
   gstatvstim->SetTitle("Good Anodes vs. run");
+  gfracvstim->SetTitle("Fraction of Good Anodes vs. run");
+  gfrac3vstim->SetTitle("Fraction of Good Anodes vs. run");
+  gfrac4vstim->SetTitle("Fraction of Good Anodes vs. run");
 
 
   Char_t filnam[200],filnamalien[200];
@@ -59,6 +72,8 @@ void PlotCalibSDDVsTime(Int_t year=2010, Int_t firstRun=77677,
     hnoise->Reset();
     hgain->Reset();
     hchstatus->Reset();
+    hchstatus3->Reset();
+    hchstatus4->Reset();
     fscanf(listruns,"%s\n",filnam);    
     Char_t directory[100];
     sprintf(directory,"/alice/data/%d",year);
@@ -86,10 +101,16 @@ void PlotCalibSDDVsTime(Int_t year=2010, Int_t firstRun=77677,
        Float_t base=cal->GetBaseline(iAn);
        Float_t noise=cal->GetNoiseAfterElectronics(iAn);
        Float_t gain=cal->GetChannelGain(iAn);
-       if(cal->IsBadChannel(iAn)) hchstatus->Fill(0);
+       if(cal->IsBadChannel(iAn)){
+         hchstatus->Fill(0);
+         if(iMod<84) hchstatus3->Fill(0);
+         else hchstatus4->Fill(0);
+       }
        if(!cal->IsBadChannel(iAn) && !cal->IsChipBad(ic) && !cal->IsBad() ){
          hbase->Fill(base);
          hchstatus->Fill(1);
+         if(iMod<84) hchstatus3->Fill(1);
+         else hchstatus4->Fill(1);
          hnoise->Fill(noise);
          hgain->Fill(gain);
        }
@@ -104,6 +125,9 @@ void PlotCalibSDDVsTime(Int_t year=2010, Int_t firstRun=77677,
     ggainvstim->SetPoint(iPoint,(Double_t)nrun,hgain->GetMean());
     ggainvstim->SetPointError(iPoint,0.,hgain->GetRMS());
     gstatvstim->SetPoint(iPoint,(Double_t)nrun,hchstatus->GetBinContent(2));
+    gfracvstim->SetPoint(iPoint,(Double_t)nrun,hchstatus->GetBinContent(2)/260./512.);
+    gfrac3vstim->SetPoint(iPoint,(Double_t)nrun,hchstatus3->GetBinContent(2)/84./512.);
+    gfrac4vstim->SetPoint(iPoint,(Double_t)nrun,hchstatus4->GetBinContent(2)/176./512.);
     iPoint++;
     f->Close();
   }
@@ -124,7 +148,7 @@ void PlotCalibSDDVsTime(Int_t year=2010, Int_t firstRun=77677,
   gbasevstim->SetMaximum(70.);  
   gbasevstim->GetXaxis()->SetTitle("Run number");
   gbasevstim->GetYaxis()->SetTitle("<Baseline> (ADC counts)");
-  cbase->SaveAs("BaseRun09.gif");
+  cbase->SaveAs(Form("BaseRun%d.gif",year));
 
   TCanvas* cnoise=new TCanvas("cnoise","Noise");
   gnoisevstim->SetFillColor(kOrange-2);
@@ -135,7 +159,7 @@ void PlotCalibSDDVsTime(Int_t year=2010, Int_t firstRun=77677,
   gnoisevstim->SetMaximum(4.);
   gnoisevstim->GetXaxis()->SetTitle("Run number");
   gnoisevstim->GetYaxis()->SetTitle("<Noise> (ADC counts)");
-  cnoise->SaveAs("NoiseRun09.gif");
+  cnoise->SaveAs(Form("NoiseRun%d.gif",year));
 
   TCanvas* cgain=new TCanvas("cgain","Gain");
   ggainvstim->SetFillColor(kOrange-2);
@@ -146,9 +170,9 @@ void PlotCalibSDDVsTime(Int_t year=2010, Int_t firstRun=77677,
   ggainvstim->SetMaximum(4.);
   ggainvstim->GetXaxis()->SetTitle("Run number");
   ggainvstim->GetYaxis()->SetTitle("<Gain> (ADC/DAC)");
-  cgain->SaveAs("GainRun09.gif");
+  cgain->SaveAs(Form("GainRun%d.gif",year));
 
-  TCanvas* cfrac=new TCanvas("cfrac","Good channels");
+  TCanvas* cstatus=new TCanvas("cstatus","Good channels");
   gstatvstim->SetFillColor(kOrange-2);
   gstatvstim->SetMarkerStyle(20);
   gstatvstim->Draw("AP3");
@@ -157,6 +181,32 @@ void PlotCalibSDDVsTime(Int_t year=2010, Int_t firstRun=77677,
   gstatvstim->SetMaximum(133000.);
   gstatvstim->GetXaxis()->SetTitle("Run number");
   gstatvstim->GetYaxis()->SetTitle("Number of good anodes in acquisition");
-  cfrac->SaveAs("GoodAnodesRun09.gif");
+  cstatus->SaveAs(Form("GoodAnodesRun%d.gif",year));
+
+  TCanvas* cfrac=new TCanvas("cfrac","Fraction of Good");
+  gfracvstim->SetMarkerStyle(20);
+  gfrac3vstim->SetMarkerStyle(22);
+  gfrac3vstim->SetMarkerColor(2);
+  gfrac3vstim->SetLineColor(2);
+  gfrac4vstim->SetMarkerStyle(23);
+  gfrac4vstim->SetMarkerColor(4);
+  gfrac4vstim->SetLineColor(4);
+  gfracvstim->Draw("APL");
+  gfrac3vstim->Draw("PLSAME");
+  gfrac4vstim->Draw("PLSAME");
+  gfracvstim->SetMinimum(0.7);
+  gfracvstim->SetMaximum(1.05);
+  gfracvstim->GetXaxis()->SetTitle("Run number");
+  gfracvstim->GetYaxis()->SetTitle("Fraction of good anodes in acquisition");
+  TLegend* leg=new TLegend(0.2,0.15,0.45,0.35);
+  leg->SetFillColor(0);
+  TLegendEntry* entr=leg->AddEntry(gfrac3vstim,"Layer 3","P");
+  entr->SetTextColor(2);
+  entr=leg->AddEntry(gfrac4vstim,"Layer 4","P");
+  entr->SetTextColor(4);
+  entr=leg->AddEntry(gfracvstim,"All","P");
+  entr->SetTextColor(1);
+  leg->Draw();
+  cfrac->SaveAs(Form("FractionGoodRun%d.gif",year));
 
 }