]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New versions which work both with v5 and vPPR geometries
authorbarbera <barbera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 May 2001 08:26:13 +0000 (08:26 +0000)
committerbarbera <barbera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 May 2001 08:26:13 +0000 (08:26 +0000)
ITS/ITSsddanalysis.C
ITS/ITSsddtest.C [new file with mode: 0644]

index c15f1fc5ed58786fdc9bb382c86faa0cc734dcc1..ed94d881f2a81a73f6d6efdeb872bd7aa77cb025 100644 (file)
@@ -20,6 +20,9 @@ void ITSsddanalysis (Int_t evNumber1=0,Int_t evNumber2=0)
   if (gClassTable->GetID("AliRun") < 0) {
     gROOT->LoadMacro("loadlibs.C");
     loadlibs();
+  } else {
+      delete gAlice;
+      gAlice=0;
   }
   
   // Connect the Root Galice file containing Geometry, Kine and Hits
diff --git a/ITS/ITSsddtest.C b/ITS/ITSsddtest.C
new file mode 100644 (file)
index 0000000..8e32619
--- /dev/null
@@ -0,0 +1,401 @@
+{
+
+gROOT->Reset();
+
+// Dynamically link some shared libs
+
+  if (gClassTable->GetID("AliRun") < 0) {
+    gROOT->LoadMacro("loadlibs.C");
+    loadlibs();
+  } else {
+      delete gAlice;
+      gAlice=0;
+  }
+
+TFile f("SDD_histos_test.root");
+
+Int_t nbins = 18;
+Float_t dmax = 36.;
+
+a = local->ProjectionX();
+t = local->ProjectionY();
+local->Draw();
+
+TF1 *faa = new TF1("faa","gaus",-100.,100.);
+a->Fit("faa","R","Q",-100.,100.);
+TF1 *fat = new TF1("fat","gaus",-50,50);
+t->Fit("fat","R","Q",-50,50);
+
+//c1->Size(21.,15.);
+c1->SetFillColor(0);
+c1->Clear();
+c1->Divide(1,3);
+c1->cd(1);
+local->Draw();
+c1->cd(2);
+a->Draw();
+c1->cd(3);
+t->Draw();
+
+c1->SaveAs("ITS_res_1.ps");
+
+TH1F *anode_resolution = new TH1F("anoder","Anode resolution vs Drift Path",nbins,0.,dmax);
+TH1D *anodes[nbins];
+Float_t res_anodes[nbins];
+Float_t errres_anodes[nbins];
+Float_t dmin = 60.;
+
+for(Int_t i=0;i<nbins;i++){
+  if(i>6) dmin = 70.;
+  if(i>11) dmin = 90.;
+  TString *aa = new TString("aa_");
+  Char_t ai[2];
+  sprintf(ai,"%d",i+1);
+  aa->Append(ai);
+  anodes[i] = at->ProjectionY(aa->Data(),i,i+1);
+  TF1 *fa = new TF1("fa","gaus",-1.*dmin,dmin);
+  anodes[i]->Fit("fa","R","Q",-1.*dmin,dmin);
+  res_anodes[i] = fa->GetParameter(2);
+  Float_t RMS = anodes[i]->GetRMS();
+  //if(res_anodes[i] > RMS) 
+  res_anodes[i] = RMS;
+  errres_anodes[i] = fa->GetParError(2);
+  anode_resolution->Fill(i*dmax/nbins+dmax/(2*nbins),res_anodes[i]);
+  anode_resolution->SetBinError(i+1,(Stat_t) errres_anodes[i]);
+  anode_resolution->SetMarkerColor(2);
+  anode_resolution->SetLineColor(2);
+}
+c1->Clear();
+f->cd();
+
+TH1F *time_resolution = new TH1F("timer","Time resolution vs Drift Path",nbins,0.,dmax);
+TH1D *times[nbins];
+Float_t res_times[nbins];
+Float_t errres_times[nbins];
+for(Int_t i=0;i<nbins;i++){
+  TString *ta = new TString("tt_");
+  Char_t ti[2];
+  sprintf(ti,"%d",i+1);
+  ta->Append(ti);
+  times[i] = tt->ProjectionY(ta->Data(),i,i+1);
+  TF1 *ft = new TF1("ft","gaus",-50,50);
+  times[i]->Fit("ft","R","Q",-50,50);
+  res_times[i] = ft->GetParameter(2);
+  Float_t RMS = times[i]->GetRMS();
+  //if(res_times[i] > RMS) 
+  res_times[i] = RMS;
+  errres_times[i] = ft->GetParError(2);
+  time_resolution->Fill(i*dmax/nbins+dmax/(2*nbins),res_times[i]);
+  time_resolution->SetBinError(i+1,(Stat_t) errres_times[i]);
+  time_resolution->SetMarkerColor(6);
+  time_resolution->SetLineColor(6);
+}
+c1->Clear();
+
+Float_t x1 = 4000.;
+Float_t x2 = x1;
+Float_t y1 = 94;
+Float_t y2 = 84;
+
+TMarker *m1 = new TMarker(x1,y1,21);
+TMarker *m2 = new TMarker(x2,y2,22);
+Text_t *text1 = "Anode";
+Text_t *text2 = "Time";
+TText *t1 = new TText(x1 + 250,y1-2,text1);
+TText *t2 = new TText(x2 + 250,y2-2,text2);
+//text1->SetLineColor(2);
+//text2->SetLineColor(4);
+
+anode_resolution->SetMarkerStyle(21);
+anode_resolution->SetMaximum(100.);
+anode_resolution->SetMinimum(0.);
+anode_resolution->Draw("Ep");
+//m1->SetColor(2);
+//m2->SetColor(4);
+m1->Draw();
+m2->Draw();
+//t1->Draw();
+//t2->Draw();
+time_resolution->SetMarkerStyle(23);
+time_resolution->Draw("Ep,same");
+c1->SaveAs("ITS_res.ps");
+
+c1->Clear();
+/*
+c1->Divide(1,2);
+c1->cd(1);
+dtrh->Draw();
+dtrp->SetLineColor(2);
+dtrp->Draw("SAME");
+
+c1->cd(2);
+dtrhall->Draw();
+dtrpall->SetLineColor(1);
+//dtrpall->SetLineStyle(2);
+dtrpall->SetLineColor(2);
+dtrpall->Draw("SAME");
+
+c1->SaveAs("ITS_dtr_1.ps");
+*/
+//c1->Size(21.,14.);
+
+c1->Clear();
+at->Draw();
+c1->SaveAs("ITS_at.ps");
+
+c1->Clear();
+tt->Draw();
+c1->SaveAs("ITS_tt.ps");
+
+/*
+c1->cd(2);
+dtrh->Draw();
+dtrp->SetLineColor(1);
+//dtrp->SetLineStyle(2);
+dtrp->SetLineColor(2);
+dtrp->Draw("SAME");
+
+c1->SaveAs("ITS_dtr_2.ps");
+
+effh->SetMinimum(0.9);
+effh->Draw();
+effp->SetLineColor(2);
+effp->Draw("SAME");
+c1->SaveAs("ITS_eff_1.ps");
+*/
+
+hit_vs_time->Draw();
+rec_vs_time->SetLineColor(2);
+rec_vs_time->Draw("SAME");
+c1->SaveAs("ITS_eff_2.ps");
+
+nanodes->ProfileX();
+nanodes_pfx->Draw();
+nsampls->ProfileX();
+nsampls_pfx->Draw();
+nanodes_pfx->SetLineColor(2);
+nanodes_pfx->Draw("SAME");
+c1->SaveAs("ITS_clsize.ps");
+
+/*
+occupancy3->Draw();
+occupancy4->Draw("SAME");
+c1->SaveAs("ITS_occ.ps");
+
+xy3->ProjectionX();
+xz3->ProjectionX();
+xy3->ProjectionY();
+
+xy3_py->Draw();
+xy3_px->Draw("SAME");
+xz3_px->Draw("SAME");
+
+c1->SaveAs("ITS_xyz_3.ps");
+
+xy4->ProjectionX();
+xz4->ProjectionX();
+xy4->ProjectionY();
+
+xy4_py->Draw();
+xy4_px->Draw("SAME");
+xz4_px->Draw("SAME");
+
+c1->SaveAs("ITS_xyz_4.ps");
+*/
+amplit->Draw();
+c1->SaveAs("ITS_ampl_1.ps");
+
+amplit->ProfileX();
+amplit_pfx->Draw();
+c1->SaveAs("ITS_ampl_2.ps");
+
+TF1 *fhc = new TF1("fhc","gaus",-5,5);
+hitpnt->Fit("fhc","R","Q",-5,5);
+hitpnt->Draw();
+c1->SaveAs("ITS_hitpnt.ps");
+
+f.cd();
+anoder->SetMinimum(0.);
+anoder->Draw();
+anoder->SetXTitle("Drift Path (mm)");
+anoder->SetYTitle("Resolution (um)");
+
+TMarker *mk2 = new TMarker(16.,62.,21);
+mk2->SetMarkerColor(2);
+mk2->Draw();
+TMarker *mk3 = new TMarker(16.,54.,23);
+mk3->SetMarkerColor(6);
+mk3->Draw();
+Text_t *text = "294 um pitch detector";
+TText *t3 = new TText(2,90,text);
+Text_t *text0 = "Spatial Resolution";
+TText *t0 = new TText(2,82,text0);
+Text_t *text2 = "Simulation (Anode)";
+TText *t2 = new TText(18,60,text2);
+Text_t *text4 = "Simulation (Time)";
+TText *t4 = new TText(18,52,text4);
+
+t4->Draw();
+t3->Draw();
+t0->Draw();
+t2->Draw();
+
+timer->Draw("SAME");
+c1->SaveAs("ITS_res_check_294.ps");
+
+f.cd();
+nanodes_pfx->SetXTitle("Drift Time (ns)");
+nanodes_pfx->SetYTitle("Anodes/Cluster");
+nanodes_pfx->SetMaximum(3.);
+nanodes_pfx->SetMarkerStyle(21);
+nanodes_pfx->SetLineColor(2);
+nanodes_pfx->SetMarkerColor(2);
+nanodes_pfx->Draw();
+
+TMarker *mk2 = new TMarker(4000.,0.3,21);
+mk2->SetMarkerColor(2);
+mk2->Draw();
+Text_t *text = "294 um pitch detector";
+TText *t3 = new TText(200,2.7,text);
+Text_t *text0 = "Average Number of Anodes/Cluster";
+TText *t0 = new TText(200,2.4,text0);
+Text_t *text2 = "Simulation";
+TText *t2 = new TText(4200,0.2,text2);
+t3->Draw();
+t0->Draw();
+t2->Draw();
+c1->SaveAs("ITS_and_check_294.ps");
+
+f.cd();
+nsampls_pfx->SetXTitle("Drift Time (ns)");
+nsampls_pfx->SetYTitle("Time bins/Anode/Cluster");
+nsampls_pfx->SetMaximum(10.);
+nsampls_pfx->SetMarkerStyle(21);
+nsampls_pfx->SetLineColor(2);
+nsampls_pfx->SetMarkerColor(2);
+nsampls_pfx->Draw();
+TMarker *mk2 = new TMarker(4000.,1.,21);
+mk2->SetMarkerColor(2);
+mk2->Draw();
+Text_t *text = "294 um pitch detector";
+TText *t3 = new TText(200,9.,text);
+Text_t *text0 = "Average Number of Time bins/Anode/Cluster";
+TText *t0 = new TText(200,8.,text0);
+Text_t *text2 = "Simulation";
+TText *t2 = new TText(4200,0.8,text2);
+t3->Draw();
+t0->Draw();
+t2->Draw();
+c1->SaveAs("ITS_tim_check_294.ps");
+
+f.cd();
+amplit->ProfileX();
+amplit_pfx->SetLineColor(2);
+amplit_pfx->SetMaximum(500.);
+amplit_pfx->SetMarkerStyle(21);
+amplit_pfx->SetMarkerColor(2);
+amplit_pfx->Draw();
+TMarker *mk2 = new TMarker(500.,50,21);
+mk2->SetMarkerColor(2);
+mk2->Draw();
+Text_t *text = "294 um pitch detector";
+TText *t3 = new TText(1000,450.,text);
+Text_t *text0 = "Peak Amplitude";
+TText *t0 = new TText(1000,400.,text0);
+Text_t *text2 = "Simulation";
+TText *t2 = new TText(700,40.,text2);
+t3->Draw();
+t0->Draw();
+t2->Draw();
+c1->SaveAs("ITS_amp_check_294.ps");
+
+f.cd();
+chp->ProfileX();
+chp_pfx->SetLineColor(2);
+chp_pfx->SetMaximum(2000.);
+chp_pfx->SetMarkerStyle(21);
+chp_pfx->SetMarkerColor(2);
+chp_pfx->Draw();
+TMarker *mk2 = new TMarker(500.,200.,21);
+mk2->SetMarkerColor(2);
+mk2->Draw();
+Text_t *text = "294 um pitch detector";
+TText *t3 = new TText(300,1800.,text);
+Text_t *text0 = "Total Charge";
+TText *t0 = new TText(300,1600.,text0);
+Text_t *text2 = "Simulation";
+TText *t2 = new TText(700,150.,text2);
+t3->Draw();
+t0->Draw();
+t2->Draw();
+c1->SaveAs("ITS_cha_check_294.ps");
+
+TH1F *eff = f.Get("rec_vs_time");
+TH1F *efh = f.Get("hit_vs_time");
+eff->Divide(efh);
+
+TH1F *effn = new TH1F("effn","Efficiency vs. drift path (mm)",18,0.,36.);
+effn->SetMinimum(0.9);
+
+for(Int_t i=1;i<=36;i++) {
+  Float_t cont = eff->GetBinContent(i);
+  i++;
+  cont += eff->GetBinContent(i);
+  cont /= 2.;
+  effn->SetBinContent(i/2,cont);
+}
+
+effn->SetXTitle("Drift Path (mm)");
+effn->SetYTitle("Reconstruction Efficiency");
+effn->SetMaximum(1.2);
+effn->SetMinimum(0.6);
+effn->SetMarkerStyle(21);
+effn->SetLineColor(2);
+effn->SetMarkerColor(2);
+effn->Draw("p");
+TMarker *mk2 = new TMarker(20.,0.7,21);
+mk2->SetMarkerColor(2);
+mk2->Draw();
+Text_t *text = "294 um pitch detector";
+TText *t3 = new TText(2.,1.13,text);
+Text_t *text2 = "Simulation";
+TText *t2 = new TText(22,0.685,text2);
+t3->Draw();
+t0->Draw();
+t2->Draw();
+c1->SaveAs("ITS_eff_check_294.ps");
+
+f.cd();
+TH1F *pa = (TH1F *) amplit_pfx;
+TH1F *pc = (TH1F *) chp_pfx;
+
+TH1F *sd = pa;
+sd->Divide(pc);
+
+sd->SetMaximum(0.4);
+TH1F *nsd = new TH1F("nsd","nsd",28,0.,7000.);
+for(Int_t i=1;i<=28;i++) {
+  Float_t sc = sd->GetBinContent(i);
+  nsd->SetBinContent(i,sc);
+}
+nsd->SetMarkerStyle(21);
+nsd->SetMarkerColor(2);
+nsd->SetLineColor(2);
+nsd->SetMaximum(0.4);
+nsd->Draw("p");
+TMarker *mk2 = new TMarker(300.,0.05,21);
+mk2->SetMarkerColor(2);
+mk2->Draw();
+Text_t *text0 = "294 um pitch detector";
+TText *t0 = new TText(300.,0.35,text0);
+Text_t *text = "Peak Amplitude / Total Charge";
+TText *t3 = new TText(300.,0.3,text);
+Text_t *text2 = "Simulation";
+TText *t2 = new TText(500,0.04,text2);
+t3->Draw();
+t0->Draw();
+t2->Draw();
+
+c1->SaveAs("ITS_coa_check_294.ps");
+
+}