AliRoot Core  da88d91 (da88d91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gainCalib.C
Go to the documentation of this file.
1 
15 TChain * chain = 0;
16 TChain * chaing = 0;
17 
18 TStatToolkit toolkit;
19 
20 void Init(){
21 
22  AliCDBManager::Instance()->SetRun(0);
23  AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
26  //
27  AliXRDPROOFtoolkit tool;
28  chain = tool.MakeChain("cosmic.txt","dEdxT",0,1000)
29  chain->Lookup();
30  chaing = tool.MakeChain("cosmic.txt","TrackG",0,1000)
31  chaing->Lookup();
32  //
33  chain->SetAlias("dr","(250-abs(meanPos.fElements[4]))/250.");
34  chain->SetAlias("tz","(0+abs(parZ.fElements[1]))");
35  chain->SetAlias("ty","(0+abs(parY.fElements[1]))");
36  chain->SetAlias("corrg","sqrt((1+ty^2)*(1+tz^2))");
37 }
38 
39 
40 
41 
42 
43 void MakeFits(){
44  TStatToolkit toolkit;
45  Double_t chi2;
46  TVectorD param;
47  TMatrixD covar;
48  Int_t npoints;
49  TString *strq0 = toolkit.FitPlane(chain,"dedxQ.fElements[2]","dr++tz++ty++dr*tz++dr*ty++ty*tz","IPad==0",chi2,npoints,param,covar,0,20000);
50  TString *strq1 = toolkit.FitPlane(chain,"dedxQ.fElements[2]","dr++tz++ty++dr*tz++dr*ty++ty*tz","IPad==1",chi2,npoints,param,covar,0,20000);
51  TString *strq2 = toolkit.FitPlane(chain,"dedxQ.fElements[2]","dr++tz++ty++dr*tz++dr*ty++ty*tz","IPad==2",chi2,npoints,param,covar,0,20000);
52  TString *strm0 = toolkit.FitPlane(chain,"dedxM.fElements[2]","dr++tz++ty++dr*tz++dr*ty++ty*tz","IPad==0",chi2,npoints,param,covar,0,20000);
53  TString *strm1 = toolkit.FitPlane(chain,"dedxM.fElements[2]","dr++tz++ty++dr*tz++dr*ty++ty*tz","IPad==1",chi2,npoints,param,covar,0,20000);
54  TString *strm2 = toolkit.FitPlane(chain,"dedxM.fElements[2]","dr++tz++ty++dr*tz++dr*ty++ty*tz","IPad==2",chi2,npoints,param,covar,0,20000);
55  chain->SetAlias("normqt0",strq0.Data());
56  chain->SetAlias("normqt1",strq1.Data());
57  chain->SetAlias("normqt2",strq2.Data());
58  chain->SetAlias("normqm0",strm0.Data());
59  chain->SetAlias("normqm1",strm1.Data());
60  chain->SetAlias("normqm2",strm2.Data());
61 }
62 
63 TFile fqplot("qplot.root","update");
64 
65 
66 void MakePlotsQS(){
67 
68  chain->Draw("dedxQ.fElements[2]:sector>>hisQ_sector(36,0,36)","IPad==0&&P>1","prof*",1000000);
69  chain->Draw("dedxQ.fElements[2]/corrg:sector>>hisQ_sector_corrg(36,0,36)","IPad==0&&P>1","prof*",1000000);
70  chain->Draw("dedxQ.fElements[2]/AliTPCClusterParam::SQnorm(0,0,dr,ty,tz):sector>>hisQ_sector_corrcal(36,0,36)","IPad==0&&P>1","prof*",1000000);
71 
72  TProfile * profq_sector = (TProfile*) gROOT->FindObject("hisQ_sector");
73  TProfile * profq_sector_corrg = (TProfile*) gROOT->FindObject("hisQ_sector_corrg");
74  TProfile * profq_sector_corrcal = (TProfile*) gROOT->FindObject("hisQ_sector_corrcal");
75  profq_sector->SetMarkerStyle(22);
76  profq_sector_corrg->SetMarkerStyle(24);
77  profq_sector_corrcal->SetMarkerStyle(26);
78  //
79  profq_sector->SetXTitle("Sector number");
80  profq_sector->SetYTitle("Mean amplitude");
81  profq_sector->SetMinimum(0);
82  profq_sector->Draw();
83  profq_sector_corrg->Draw("same");
84  profq_sector_corrcal->Draw("same");
85  fqplot.cd();
86  profq_sector->Write("qt_sector_0");
87  profq_sector_corrg->Write("qt_sector_1");
88  profq_sector_corrcal->Write("qt_sector_2");
89  gPad->Write("qt_sector");
90 }
91 
92 
93 void MakePlotsTY(){
95 
96  chain->Draw("dedxQ.fElements[2]:ty>>hisQ_ty(20,0,1.5)","IPad==0&&P>1","prof*",1000000);
97  chain->Draw("dedxQ.fElements[2]/corrg:ty>>hisQ_ty_corrg(20,0,1.5)","IPad==0&&P>1","prof*",1000000);
98  chain->Draw("dedxQ.fElements[2]/AliTPCClusterParam::SQnorm(0,0,dr,ty,tz):ty>>hisQ_ty_corrcal(20,0,1.5)","IPad==0&&P>1","prof*",1000000);
99 
100  TProfile * profq_ty = (TProfile*) gROOT->FindObject("hisQ_ty");
101  TProfile * profq_ty_corrg = (TProfile*) gROOT->FindObject("hisQ_ty_corrg");
102  TProfile * profq_ty_corrcal = (TProfile*) gROOT->FindObject("hisQ_ty_corrcal");
103  profq_ty->SetMarkerStyle(22);
104  profq_ty_corrg->SetMarkerStyle(24);
105  profq_ty_corrcal->SetMarkerStyle(26);
106  //
107  profq_ty->SetXTitle("tan(#phi)");
108  profq_ty->SetYTitle("Mean amplitude");
109  profq_ty->SetMinimum(0);
110  profq_ty->Draw();
111  profq_ty_corrg->Draw("same");
112  profq_ty_corrcal->Draw("same");
113  fqplot.cd();
114  profq_ty->Write("qt_ty_0");
115  profq_ty_corrg->Write("qt_ty_1");
116  profq_ty_corrcal->Write("qt_ty_2");
117  gPad->Write("qt_ty");
118 }
119 
120 
121 void MakePlotsTZ(){
123 
124  chain->Draw("dedxQ.fElements[2]:tz>>hisQ_tz(20,0,1.5)","IPad==0&&P>1","prof*",1000000);
125  chain->Draw("dedxQ.fElements[2]/corrg:tz>>hisQ_tz_corrg(20,0,1.5)","IPad==0&&P>1","prof*",1000000);
126  chain->Draw("dedxQ.fElements[2]/AliTPCClusterParam::SQnorm(0,0,dr,ty,tz):tz>>hisQ_tz_corrcal(20,0,1.5)","IPad==0&&P>1","prof*",1000000);
127 
128  TProfile * profq_tz = (TProfile*) gROOT->FindObject("hisQ_tz");
129  TProfile * profq_tz_corrg = (TProfile*) gROOT->FindObject("hisQ_tz_corrg");
130  TProfile * profq_tz_corrcal = (TProfile*) gROOT->FindObject("hisQ_tz_corrcal");
131  profq_tz->SetMarkerStyle(22);
132  profq_tz_corrg->SetMarkerStyle(24);
133  profq_tz_corrcal->SetMarkerStyle(26);
134  //
135  profq_tz->SetXTitle("tan(#theta)");
136  profq_tz->SetYTitle("Mean amplitude");
137  profq_tz->SetMinimum(0);
138  profq_tz->Draw();
139  profq_tz_corrg->Draw("same");
140  profq_tz_corrcal->Draw("same");
141  fqplot.cd();
142  profq_tz->Write("qt_tz_0");
143  profq_tz_corrg->Write("qt_tz_1");
144  profq_tz_corrcal->Write("qt_tz_2");
145  gPad->Write("qt_tz");
146 }
147 
148 void MakePlotsDR(){
150 
151  chain->Draw("dedxQ.fElements[2]:dr>>hisQ_dr(20,0,1.)","IPad==0&&P>1","prof*",1000000);
152  chain->Draw("dedxQ.fElements[2]/corrg:dr>>hisQ_dr_corrg(20,0,1.)","IPad==0&&P>1","prof*",1000000);
153  chain->Draw("dedxQ.fElements[2]/AliTPCClusterParam::SQnorm(0,0,dr,ty,dr):dr>>hisQ_dr_corrcal(20,0,1.)","IPad==0&&P>1","prof*",1000000);
154 
155  TProfile * profq_dr = (TProfile*) gROOT->FindObject("hisQ_dr");
156  TProfile * profq_dr_corrg = (TProfile*) gROOT->FindObject("hisQ_dr_corrg");
157  TProfile * profq_dr_corrcal = (TProfile*) gROOT->FindObject("hisQ_dr_corrcal");
158  profq_dr->SetMarkerStyle(22);
159  profq_dr_corrg->SetMarkerStyle(24);
160  profq_dr_corrcal->SetMarkerStyle(26);
161  //
162  profq_dr->SetXTitle("drift length(unit)");
163  profq_dr->SetYTitle("Mean amplitude");
164  profq_dr->SetMinimum(0);
165  profq_dr->Draw();
166  profq_dr_corrg->Draw("same");
167  profq_dr_corrcal->Draw("same");
168  fqplot.cd();
169  profq_dr->Write("qt_dr_0");
170  profq_dr_corrg->Write("qt_dr_1");
171  profq_dr_corrcal->Write("qt_dr_2");
172  gPad->Write("qt_dr");
173 }
174 
175 
176 
177 void MakePlotsQ(){
179 
180  chaing->Draw("Track.fdEdx>>his0dedx(100,0,200)","Track.fN>100&&abs(Track.P()-15)<3","",20000);
181  chaing->Draw("Track.CookdEdxNorm(0.02,0.6,0,0,160)/3.71>>his0dedxnormQ(100,0,200)","Track.fN>100&&abs(Track.P()-15)<3","",20000);
182  TH1F * his0dedx = gROOT->FindObject("his0dedx");
183  TH1F * his0dedxnormq = gROOT->FindObject("his0dedxnormQ");
184  his0dedxnormq->SetXTitle("dEdx (rel. unit)")
185  his0dedxnormq->Draw();
186  his0dedx->Draw("same");
187 
188 
189  chaing->Draw("Track.CookdEdxNorm(0.02,0.6,0,0,160)/3.71:Track.GetP()>>hispdedxnorm(10,5,100)","Track.fN>100","prof",20000);
190 
191 
192  chaing->Draw("Track.fdEdx:sector0>>hisdedx(36,0,36)","Track.fN>60","prof",10000);
193  chaing->Draw("Track.CookdEdxNorm(0.02,0.6,0,0,160)/3.71:sector0>>hisdedxnormQ(36,0,36)","Track.fN>60","prof",10000);
194 
195 }
196 
197 
198 
199 
200 
201 
202 
203 
204 
205 
206 
207 
static AliTPCcalibDB * Instance()
TOOLKIT for chain manipulation:
AliTPCClusterParam * GetClusterParam() const
TChain * chaing
Definition: gainCalib.C:16
void MakeFits()
Definition: gainCalib.C:43
TROOT * gROOT
npoints
Definition: driftITSTPC.C:85
TPC cluster error, shape and charge parameterization as function of drift length and inclination angl...
Double_t chi2
Definition: AnalyzeLaser.C:7
void SetInstance(AliTPCClusterParam *const param)
void MakePlotsDR()
Definition: gainCalib.C:148
TStatToolkit toolkit
Definition: gainCalib.C:18
void MakePlotsTZ()
Definition: gainCalib.C:121
TFile fqplot("qplot.root","update")
void MakePlotsQS()
Definition: gainCalib.C:66
void Init()
Definition: gainCalib.C:20
void MakePlotsQ()
Definition: gainCalib.C:177
TChain * chain
Definition: gainCalib.C:15
void MakePlotsTY()
Definition: gainCalib.C:93
static TChain * MakeChain(const char *fileIn, const char *treeName, const char *fName=0, Int_t maxFiles=-1, Int_t startFile=0)