]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/ITStestSDD.C
Some function moved to AliZDC
[u/mrichter/AliRoot.git] / ITS / ITStestSDD.C
CommitLineData
13787886 1{
2
3gROOT->Reset();
4
5TFile f("SDD_histos_test.root");
6
7Int_t nbins = 18;
8Float_t dmax = 36.;
9
10a = local->ProjectionX();
11t = local->ProjectionY();
12
13TF1 *faa = new TF1("faa","gaus",-100.,100.);
14a->Fit("faa","R","Q",-100.,100.);
15TF1 *fat = new TF1("fat","gaus",-50,50);
16t->Fit("fat","R","Q",-50,50);
17
18TH1F *anode_resolution = new TH1F("anoder","Anode resolution vs Drift Path",nbins,0.,dmax);
19TH1D *anodes[nbins];
20Float_t res_anodes[nbins];
21Float_t errres_anodes[nbins];
22Float_t dmin = 60.;
23
24for(Int_t i=0;i<nbins;i++){
25 if(i>6) dmin = 70.;
26 if(i>11) dmin = 90.;
27 TString *aa = new TString("aa_");
28 Char_t ai[2];
29 sprintf(ai,"%d",i+1);
30 aa->Append(ai);
31 anodes[i] = at->ProjectionY(aa->Data(),i,i+1);
32 TF1 *fa = new TF1("fa","gaus",-1.*dmin,dmin);
33 anodes[i]->Fit("fa","R","Q",-1.*dmin,dmin);
34 res_anodes[i] = fa->GetParameter(2);
35 Float_t RMS = anodes[i]->GetRMS();
36 //if(res_anodes[i] > RMS)
37 res_anodes[i] = RMS;
38 errres_anodes[i] = fa->GetParError(2);
39 anode_resolution->Fill(i*dmax/nbins+dmax/(2*nbins),res_anodes[i]);
40 anode_resolution->SetBinError(i+1,(Stat_t) errres_anodes[i]);
41 anode_resolution->SetMarkerColor(2);
42 anode_resolution->SetLineColor(2);
43}
44
45f->cd();
46
47TH1F *time_resolution = new TH1F("timer","Time resolution vs Drift Path",nbins,0.,dmax);
48TH1D *times[nbins];
49Float_t res_times[nbins];
50Float_t errres_times[nbins];
51for(Int_t i=0;i<nbins;i++){
52 TString *ta = new TString("tt_");
53 Char_t ti[2];
54 sprintf(ti,"%d",i+1);
55 ta->Append(ti);
56 times[i] = tt->ProjectionY(ta->Data(),i,i+1);
57 TF1 *ft = new TF1("ft","gaus",-50,50);
58 times[i]->Fit("ft","R","Q",-50,50);
59 res_times[i] = ft->GetParameter(2);
60 Float_t RMS = times[i]->GetRMS();
61 //if(res_times[i] > RMS)
62 res_times[i] = RMS;
63 errres_times[i] = ft->GetParError(2);
64 time_resolution->Fill(i*dmax/nbins+dmax/(2*nbins),res_times[i]);
65 time_resolution->SetBinError(i+1,(Stat_t) errres_times[i]);
66 time_resolution->SetMarkerColor(6);
67 time_resolution->SetLineColor(6);
68}
69Float_t x1 = 4000.;
70Float_t x2 = x1;
71Float_t y1 = 94;
72Float_t y2 = 84;
73
74TMarker *m1 = new TMarker(x1,y1,21);
75TMarker *m2 = new TMarker(x2,y2,22);
76Text_t *text1 = "Anode";
77Text_t *text2 = "Time";
78TText *t1 = new TText(x1 + 250,y1-2,text1);
79TText *t2 = new TText(x2 + 250,y2-2,text2);
80
81anode_resolution->SetMarkerStyle(21);
82anode_resolution->SetMaximum(100.);
83time_resolution->SetMarkerStyle(23);
84
85c1->Clear();
86at->Draw();
87c1->SaveAs("ITS_at.ps");
88
89c1->Clear();
90tt->Draw();
91c1->SaveAs("ITS_tt.ps");
92
93nanodes->ProfileX();
94nanodes_pfx->Draw();
95nsampls->ProfileX();
96nsampls_pfx->Draw();
97nanodes_pfx->SetLineColor(2);
98nanodes_pfx->Draw("SAME");
99c1->SaveAs("ITS_clsize.ps");
100
101f.cd();
102anoder->SetMinimum(0.);
103anoder->Draw();
104anoder->SetXTitle("Drift Path (mm)");
105anoder->SetYTitle("Resolution (um)");
106TMarker *mk0 = new TMarker(16.,54.,23);
107mk0->SetMarkerColor(6);
108mk0->Draw();
109TMarker *mk3 = new TMarker(16.,46.,21);
110mk3->SetMarkerColor(2);
111mk3->Draw();
112Text_t *text = "294 um pitch detector";
113TText *t3 = new TText(2,90,text);
114Text_t *text0 = "Spatial Resolution";
115TText *t0 = new TText(2,82,text0);
116Text_t *text2 = "Simulation (Anode)";
117TText *t2 = new TText(18,44,text2);
118Text_t *text4 = "Simulation (Time)";
119TText *t4 = new TText(18,52,text4);
120t4->Draw();
121t3->Draw();
122t2->Draw();
123t0->Draw();
124timer->Draw("SAME");
125c1->SaveAs("ITS_res_check_294.ps");
126
127f.cd();
128nanodes_pfx->SetXTitle("Drift Time (ns)");
129nanodes_pfx->SetYTitle("Anodes/Cluster");
130nanodes_pfx->SetMaximum(3.);
131nanodes_pfx->SetMarkerStyle(21);
132nanodes_pfx->SetLineColor(2);
133nanodes_pfx->SetMarkerColor(2);
134nanodes_pfx->Draw();
135TMarker *mk2 = new TMarker(4000.,0.3,21);
136mk2->SetMarkerColor(2);
137mk2->Draw();
138Text_t *text = "294 um pitch detector";
139TText *t3 = new TText(200,2.7,text);
140Text_t *text0 = "Average Number of Anodes/Cluster";
141TText *t0 = new TText(200,2.4,text0);
142Text_t *text2 = "Simulation";
143TText *t2 = new TText(4200,0.2,text2);
144t3->Draw();
145t0->Draw();
146t2->Draw();
147c1->SaveAs("ITS_and_check_294.ps");
148
149f.cd();
150nsampls_pfx->SetXTitle("Drift Time (ns)");
151nsampls_pfx->SetYTitle("Time bins/Anode/Cluster");
152nsampls_pfx->SetMaximum(10.);
153nsampls_pfx->SetMarkerStyle(21);
154nsampls_pfx->SetLineColor(2);
155nsampls_pfx->SetMarkerColor(2);
156nsampls_pfx->Draw();
157TMarker *mk2 = new TMarker(4000.,1.,21);
158mk2->SetMarkerColor(2);
159mk2->Draw();
160Text_t *text = "294 um pitch detector";
161TText *t3 = new TText(200,9.,text);
162Text_t *text0 = "Average Number of Time bins/Anode/Cluster";
163TText *t0 = new TText(200,8.,text0);
164Text_t *text2 = "Simulation";
165TText *t2 = new TText(4200,0.8,text2);
166t3->Draw();
167t0->Draw();
168t2->Draw();
169c1->SaveAs("ITS_tim_check_294.ps");
170
171f.cd();
172amplit->ProfileX();
173amplit_pfx->SetLineColor(2);
174amplit_pfx->SetMaximum(500.);
175amplit_pfx->SetMarkerStyle(21);
176amplit_pfx->SetMarkerColor(2);
177amplit_pfx->Draw();
178TMarker *mk2 = new TMarker(500.,50,21);
179mk2->SetMarkerColor(2);
180mk2->Draw();
181Text_t *text = "294 um pitch detector";
182TText *t3 = new TText(1000,450.,text);
183Text_t *text0 = "Peak Amplitude";
184TText *t0 = new TText(1000,400.,text0);
185Text_t *text2 = "Simulation";
186TText *t2 = new TText(700,40.,text2);
187t3->Draw();
188t0->Draw();
189t2->Draw();
190c1->SaveAs("ITS_amp_check_294.ps");
191
192f.cd();
193chp->ProfileX();
194chp_pfx->SetLineColor(2);
195chp_pfx->SetMaximum(2000.);
196chp_pfx->SetMarkerStyle(21);
197chp_pfx->SetMarkerColor(2);
198chp_pfx->Draw();
199TMarker *mk2 = new TMarker(500.,200.,21);
200mk2->SetMarkerColor(2);
201mk2->Draw();
202Text_t *text = "294 um pitch detector";
203TText *t3 = new TText(300,1800.,text);
204Text_t *text0 = "Total Charge";
205TText *t0 = new TText(300,1600.,text0);
206Text_t *text2 = "Simulation";
207TText *t2 = new TText(700,150.,text2);
208t3->Draw();
209t0->Draw();
210t2->Draw();
211c1->SaveAs("ITS_cha_check_294.ps");
212
213TH1F *eff = f.Get("rec_vs_time");
214TH1F *efh = f.Get("hit_vs_time");
215eff->Divide(efh);
216
217TH1F *effn = new TH1F("effn","Efficiency vs. drift path (mm)",18,0.,36.);
218effn->SetMinimum(0.9);
219
220for(Int_t i=1;i<=36;i++) {
221 Float_t cont = eff->GetBinContent(i);
222 i++;
223 cont += eff->GetBinContent(i);
224 cont /= 2.;
225 effn->SetBinContent(i/2,cont);
226}
227
228effn->SetXTitle("Drift Path (mm)");
229effn->SetYTitle("Reconstruction Efficiency");
230effn->SetMaximum(1.2);
231effn->SetMinimum(0.6);
232effn->SetMarkerStyle(21);
233effn->SetLineColor(2);
234effn->SetMarkerColor(2);
235effn->Draw("p");
236TMarker *mk2 = new TMarker(20.,0.7,21);
237mk2->SetMarkerColor(2);
238mk2->Draw();
239Text_t *text = "294 um pitch detector";
240TText *t3 = new TText(2.,1.13,text);
241Text_t *text2 = "Simulation";
242TText *t2 = new TText(22,0.685,text2);
243t3->Draw();
244t0->Draw();
245t2->Draw();
246c1->SaveAs("ITS_eff_check_294.ps");
247
248f.cd();
249ntotal->ProfileX();
250ntotal->SetMarkerStyle(21);
251ntotal->SetLineColor(2);
252ntotal->SetMarkerColor(2);
253ntotal_pfx->SetMaximum(20);
254ntotal_pfx->SetMarkerStyle(21);
255ntotal_pfx->SetMarkerColor(2);
256ntotal_pfx->SetLineColor(2);
257ntotal_pfx->SetXTitle("Drift Time (ns)");
258ntotal_pfx->SetYTitle("N_total");
259ntotal_pfx->Draw();
260/*
261TH1F *nsi = new TH1F("nsi","nsi",28,0.,7000.);
262for(Int_t i=1;i<=28;i++) {
263 f->cd();
264 Float_t tscal = nsampls_pfx->GetBinContent(i);
265 Float_t cont = nanodes_pfx->GetBinContent(i);
266 cont *= tscal;
267 nsi->SetMaximum(20.);
268 nsi->SetBinContent(i,cont);
269}
270nsi->SetMarkerStyle(21);
271nsi->SetMarkerColor(2);
272nsi->SetLineColor(2);
273nsi->Draw("p,SAME");
274*/
275TMarker *mk2 = new TMarker(300.,2.,21);
276mk2->SetMarkerColor(2);
277mk2->Draw();
278Text_t *text = "294 um pitch detector";
279TText *t3 = new TText(300.,18.,text);
280Text_t *text2 = "Simulation";
281TText *t2 = new TText(500,1.8,text2);
282t3->Draw();
283t2->Draw();
284
285c1->SaveAs("ITS_ncl_check_294.ps");
286
287}