]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ZDC/CheckTDCHistos.C
Adding printouts (R. Preghenella)
[u/mrichter/AliRoot.git] / ZDC / CheckTDCHistos.C
CommitLineData
7fb8fc58 1#if !defined(__CINT__) || defined(__MAKECINT__)
2
3#include <TROOT.h>
4#include <TStyle.h>
5#include <Riostream.h>
6#include <TStopwatch.h>
7#include <TDatime.h>
8#include <TClassTable.h>
9#include <TH1.h>
10#include <TH2.h>
11#include <TF1.h>
12#include <TProfile.h>
13#include <TFunction.h>
14#include <TCanvas.h>
15#include <TGrid.h>
16#include <TFile.h>
17
18#endif
19
20void CheckTDCHistos(Int_t nRun=0, Bool_t optPlot=kTRUE)
21{
22 if(nRun==0){
23 printf("\n\n YOU MUST PROVIDE A RUN NUMBER!!! \n\n");
24 return;
25 }
26
27 TGrid::Connect("alien:",0,0,"t");
28
29 char histoFName[150];
30 sprintf(histoFName,"alien:///alice/data/2011/Reference/ZDC/%d_tdcReference.root",nRun);
31
32 TFile *file = TFile::Open(histoFName);
33 file->cd();
34 TH1F::AddDirectory(0);
35 //
36 TH1F *hTDC[6];
37 for(Int_t it=0; it<6; it++){
38 if(it==0) hTDC[it] = dynamic_cast<TH1F*> (file->Get("TDCZNC"));
39 else if(it==1) hTDC[it] = dynamic_cast<TH1F*> (file->Get("TDCZNA"));
40 else if(it==2) hTDC[it] = dynamic_cast<TH1F*> (file->Get("TDCZPC"));
41 else if(it==3) hTDC[it] = dynamic_cast<TH1F*> (file->Get("TDCZPA"));
42 else if(it==4) hTDC[it] = dynamic_cast<TH1F*> (file->Get("TDCZEM1"));
43 else if(it==5) hTDC[it] = dynamic_cast<TH1F*> (file->Get("TDCZEM2"));
44 }
45
46
47 if(optPlot){
48 // Plot the retrieved histos
49 //***********************************************************
50 // #### ROOT initialization
51 gROOT->Reset();
52 gStyle->SetCanvasColor(10);
53 gStyle->SetFrameFillColor(10);
54 gStyle->SetOptTitle(0);
55 gStyle->SetOptStat(1111);
56 gStyle->SetOptFit(111);
57 gStyle->SetTitleTextColor(9);
58 gStyle->SetStatTextColor(4);
59 gStyle->SetLineColor(1);
60 gStyle->SetPalette(1);
61 //***********************************************************
62 TCanvas *c6 = new TCanvas("c6","Side C correlations",0,200,1000,800);
63 c6->Divide(3,2);
64 for(Int_t t=0; t<6; t++){
65 c6->cd(t+1); gPad->SetLogy(1);
66 hTDC[t]->SetLineColor(kAzure+t);
67 hTDC[t]->Draw();
68 }
69 char psname[16];
70 sprintf(psname,"TDCrun%d.gif",nRun);
71 c6->Print(psname);
72 }
73}