]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/CalibMacros/CalibQA.C
added track ID also for the tracks from ESD input
[u/mrichter/AliRoot.git] / TPC / CalibMacros / CalibQA.C
1 /*
2   Make default plotsfrom AliTPCdataQA components:
3
4   aliroot -b -q  $ALICE_ROOT/TPC/CalibMacros/CalibQA.C\(121694\);
5   
6   .L $ALICE_ROOT/TPC/CalibMacros/CalibQA.C
7   Int_t run=121694;
8   CalibQA(run);
9 */
10
11 TCut cutNoise="PadNoise.fElements<1.5&&abs(PadNoise.fElements/PadNoise_Median-1)<0.5";
12 TCut cutTime="abs(TimePosition.fElements-TimePosition_Median)<100";
13 TCut cutOccu="abs(NoThreshold.fElements/NoThreshold_Median-1)<0.9";
14 TCut cutAmp="abs(MaxCharge.fElements/MaxCharge_Median-1)<0.99";
15 TCut cutIROC="sector<36";
16 TCut cutOROC="sector>=36";
17
18
19 void CalibQA(Int_t run){
20   InitOCDB(run);
21   MakeTree();
22   TCanvas *canvas=0;
23   //
24   TPostScript *ps = new TPostScript("rawQA.ps", 112);  
25   ps->NewPage();
26   canvas=DrawOccupancy();
27   ps->NewPage();
28   canvas->Update();
29   ps->Close();
30   delete ps;
31
32 }
33
34 void InitOCDB(Int_t run){
35   gSystem->Load("libANALYSIS");
36   gSystem->Load("libTPCcalib");
37   gROOT->LoadMacro("$ALICE_ROOT/TPC/scripts/OCDBscan/ConfigOCDBLustre.C");
38   //gROOT->LoadMacro("$ALICE_ROOT/TPC/scripts/OCDBscan/ConfigOCDB.C");
39   gROOT->Macro("$ALICE_ROOT/TPC/scripts/OCDBscan/NimStyle.C");
40   ConfigOCDB(run);
41 }
42
43 void MakeTree(){
44   //
45   // make summary tree
46   //
47   AliTPCcalibDB::Instance()->UpdateNonRec();
48   AliTPCdataQA* dataQA =   AliTPCcalibDB::Instance()->GetDataQA();
49   AliTPCCalPad* gain   =   AliTPCcalibDB::Instance()->GetDedxGainFactor();
50   AliTPCCalPad * padNoise = AliTPCcalibDB::Instance()->GetPadNoise();
51   AliTPCPreprocessorOnline preprocesor;
52   gain->SetName("krGain");
53   preprocesor.AddComponent(gain);
54   preprocesor.AddComponent(dataQA->GetNPads());
55   preprocesor.AddComponent(dataQA->GetNTimeBins());
56   preprocesor.AddComponent(dataQA->GetMaxCharge());
57   preprocesor.AddComponent(dataQA->GetNoThreshold());
58   preprocesor.AddComponent(dataQA->GetNLocalMaxima());
59   preprocesor.AddComponent(dataQA->GetTimePosition());
60   preprocesor.AddComponent(padNoise);
61   preprocesor.DumpToFile("QA.root");
62 }
63
64
65 TCanvas * DrawOccupancy(){
66   TH1::AddDirectory(0);
67   gStyle->SetOptStat(0);
68   TFile f("QA.root");
69   TTree  * tree = (TTree*)f.Get("calPads");
70   TLegend *legend=0;
71   TProfile * phoccGainIROC=0;
72   TProfile * phoccGainOROC=0;
73   //
74   TCanvas * canvas = new TCanvas("occupancy","occupancy",700,700);
75   canvas->Divide(2,2);
76   canvas->cd(1);
77   tree->Draw("NoThreshold.fElements:gy.fElements:gx.fElements>>hisOccuA(250,-250,250,250,-250,250)",cutNoise+cutTime+cutOccu+"sector%36<18","profcolz");
78   canvas->cd(2);
79   tree->Draw("NoThreshold.fElements:gy.fElements:gx.fElements>>hisOccuC(250,-250,250,250,-250,250)",cutNoise+cutTime+cutOccu+"sector%36>=18","profcolz");
80
81   canvas->cd(3);
82   tree->Draw("NoThreshold.fElements:krGain.fElements>>hoccGainIROC(20,0.7,1.2)",cutNoise+cutTime+cutOccu+cutIROC,"prof");
83   legend = new TLegend(0.45,0.15,0.85,0.35, "Raw cluster occupancy");
84   phoccGainIROC = (TProfile*)(gROOT->FindObject("hoccGainIROC")->Clone());
85   phoccGainIROC->Draw();
86   phoccGainIROC->SetTitle("IROC");
87   phoccGainIROC->SetName("IROC");
88   phoccGainIROC->GetXaxis()->SetTitle("Krypton Amp (a.u.)");
89   legend->AddEntry(phoccGainIROC);
90   legend->Draw();
91
92   canvas->cd(4);
93   tree->Draw("NoThreshold.fElements:krGain.fElements>>hoccGainOROC(20,0.8,1.2)",cutNoise+cutTime+cutOccu+cutOROC+"lx.fElements<200","prof");
94   phoccGainOROC = (TProfile*)(gROOT->FindObject("hoccGainOROC")->Clone());
95   phoccGainOROC->Draw();
96   phoccGainOROC->SetTitle("OROC");
97   phoccGainOROC->SetName("OROC");
98   phoccGainOROC->GetXaxis()->SetTitle("Krypton Amp (a.u.)");
99   legend = new TLegend(0.45,0.15,0.85,0.35, "Raw cluster occupancy");
100   legend->AddEntry(phoccGainOROC);
101   legend->Draw();
102   return canvas;
103 }
104
105 TCanvas * DrawGain(){
106   //
107   // Compare the amplitude with krypton gain amplitude
108   // Similar filtering as in occupancy plot
109   //                                            
110   return 0;
111 }