AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CalibQA.C
Go to the documentation of this file.
1 
13 TCut cutNoise="PadNoise.fElements<1.5&&abs(PadNoise.fElements/PadNoise_Median-1)<0.5";
14 TCut cutTime="abs(TimePosition.fElements-TimePosition_Median)<100";
15 TCut cutOccu="abs(NoThreshold.fElements/NoThreshold_Median-1)<0.9";
16 TCut cutAmp="abs(MaxCharge.fElements/MaxCharge_Median-1)<0.99";
17 TCut cutIROC="sector<36";
18 TCut cutOROC="sector>=36";
19 
20 
21 void CalibQA(Int_t run){
22  InitOCDB(run);
23  MakeTree();
24  TCanvas *canvas=0;
25  //
26  TPostScript *ps = new TPostScript("rawQA.ps", 112);
27  ps->NewPage();
28  canvas=DrawOccupancy();
29  ps->NewPage();
30  canvas->Update();
31  ps->Close();
32  delete ps;
33 
34 }
35 
36 void InitOCDB(Int_t run){
37  gSystem->Load("libANALYSIS");
38  gSystem->Load("libTPCcalib");
39  gROOT->LoadMacro("$ALICE_ROOT/TPC/scripts/OCDBscan/ConfigOCDBLustre.C");
40  //gROOT->LoadMacro("$ALICE_ROOT/TPC/scripts/OCDBscan/ConfigOCDB.C");
41  gROOT->Macro("$ALICE_ROOT/TPC/scripts/OCDBscan/NimStyle.C");
42  ConfigOCDB(run);
43 }
44 
45 void MakeTree(){
47 
52  AliTPCPreprocessorOnline preprocesor;
53  gain->SetName("krGain");
54  preprocesor.AddComponent(gain);
55  preprocesor.AddComponent(dataQA->GetNPads());
56  preprocesor.AddComponent(dataQA->GetNTimeBins());
57  preprocesor.AddComponent(dataQA->GetMaxCharge());
58  preprocesor.AddComponent(dataQA->GetNoThreshold());
59  preprocesor.AddComponent(dataQA->GetNLocalMaxima());
60  preprocesor.AddComponent(dataQA->GetTimePosition());
61  preprocesor.AddComponent(padNoise);
62  preprocesor.DumpToFile("QA.root");
63 }
64 
65 
66 TCanvas * DrawOccupancy(){
67  TH1::AddDirectory(0);
68  gStyle->SetOptStat(0);
69  TFile f("QA.root");
70  TTree * tree = (TTree*)f.Get("calPads");
71  TLegend *legend=0;
72  TProfile * phoccGainIROC=0;
73  TProfile * phoccGainOROC=0;
74  //
75  TCanvas * canvas = new TCanvas("occupancy","occupancy",700,700);
76  canvas->Divide(2,2);
77  canvas->cd(1);
78  tree->Draw("NoThreshold.fElements:gy.fElements:gx.fElements>>hisOccuA(250,-250,250,250,-250,250)",cutNoise+cutTime+cutOccu+"sector%36<18","profcolz");
79  canvas->cd(2);
80  tree->Draw("NoThreshold.fElements:gy.fElements:gx.fElements>>hisOccuC(250,-250,250,250,-250,250)",cutNoise+cutTime+cutOccu+"sector%36>=18","profcolz");
81 
82  canvas->cd(3);
83  tree->Draw("NoThreshold.fElements:krGain.fElements>>hoccGainIROC(20,0.7,1.2)",cutNoise+cutTime+cutOccu+cutIROC,"prof");
84  legend = new TLegend(0.45,0.15,0.85,0.35, "Raw cluster occupancy");
85  phoccGainIROC = (TProfile*)(gROOT->FindObject("hoccGainIROC")->Clone());
86  phoccGainIROC->Draw();
87  phoccGainIROC->SetTitle("IROC");
88  phoccGainIROC->SetName("IROC");
89  phoccGainIROC->GetXaxis()->SetTitle("Krypton Amp (a.u.)");
90  legend->AddEntry(phoccGainIROC);
91  legend->Draw();
92 
93  canvas->cd(4);
94  tree->Draw("NoThreshold.fElements:krGain.fElements>>hoccGainOROC(20,0.8,1.2)",cutNoise+cutTime+cutOccu+cutOROC+"lx.fElements<200","prof");
95  phoccGainOROC = (TProfile*)(gROOT->FindObject("hoccGainOROC")->Clone());
96  phoccGainOROC->Draw();
97  phoccGainOROC->SetTitle("OROC");
98  phoccGainOROC->SetName("OROC");
99  phoccGainOROC->GetXaxis()->SetTitle("Krypton Amp (a.u.)");
100  legend = new TLegend(0.45,0.15,0.85,0.35, "Raw cluster occupancy");
101  legend->AddEntry(phoccGainOROC);
102  legend->Draw();
103  return canvas;
104 }
105 
106 TCanvas * DrawGain(){
109 
110  return 0;
111 }
static AliTPCcalibDB * Instance()
TStyle * gStyle
AliTPCCalPad * GetMaxCharge() const
Definition: AliTPCdataQA.h:60
TFile f("CalibObjects.root")
TROOT * gROOT
void CalibQA(Int_t run)
Definition: CalibQA.C:21
AliTPCCalPad * GetNTimeBins() const
Definition: AliTPCdataQA.h:66
AliTPCCalPad * GetTimePosition() const
Definition: AliTPCdataQA.h:68
TTree * tree
AliTPCdataQA * GetDataQA() const
TCut cutIROC
Definition: CalibQA.C:17
TCanvas * DrawOccupancy()
Definition: CalibQA.C:66
AliTPCCalPad * GetPadNoise() const
Definition: AliTPCcalibDB.h:79
void ConfigOCDB(Int_t crun)
void InitOCDB(Int_t run)
Definition: CalibQA.C:36
TCanvas * DrawGain()
Definition: CalibQA.C:106
AliTPCCalPad * GetNPads() const
Definition: AliTPCdataQA.h:67
void DumpToFile(const char *fileName)
TCut cutOROC
Definition: CalibQA.C:18
TCut cutNoise
Definition: CalibQA.C:13
Preprocessor class for HLT and DAQ.
TCut cutAmp
Definition: CalibQA.C:16
AliTPCCalPad * GetNLocalMaxima() const
Definition: AliTPCdataQA.h:62
AliTPCCalPad * GetDedxGainFactor() const
Definition: AliTPCcalibDB.h:68
void MakeTree()
Definition: CalibQA.C:45
AliTPCCalPad * GetNoThreshold() const
Definition: AliTPCdataQA.h:59
TCut cutOccu
Definition: CalibQA.C:15
TCut cutTime
Definition: CalibQA.C:14