int const Nfoil = 13; Double_t const z0 = -(12+15.32)*1e-3; //-15.32e-3 Double_t const dz = 25e-3; Double_t const dpeak = 10e-3; Double_t zlocate[Nfoil] = { z0-6*dz, z0-5*dz, z0-4*dz, z0-3*dz, z0-2*dz, z0-1*dz, z0, z0+1*dz, z0+2*dz, z0+3*dz, z0+4*dz, z0+5*dz, z0+6*dz }; const int Nhole = 7; Double_t ph0 =0;// -(4.49)*1e-3; Double_t th0 =0;// (-0.34)*1e-3; Double_t dph = 1.025*25.400e-3; Double_t dth = 0.513*25.400e-3; void DrawIdeal(void){//optics TLine *foils[Nfoil]; Double_t max_y; TCanvas *c = new TCanvas("vertex_z","vertex_z",800,600); T->Draw("L.tr.vz>>vz(1000,-0.2,0.2)"); max_y = vz->GetMaximum(); cout<SetLineColor(3); foils[i]->Draw("same"); } } void DrawPatternVertex(void){ gStyle->SetOptFit(0000); TLine *foils[Nfoil]; Double_t max_y; TF1 * gr[Nfoil]; TF1 * total; char name[200]; Double_t par[3*Nfoil]; Double_t mean[Nfoil],sigma[Nfoil]; for(int i=0;iSetLineColor(i+1); } total = new TF1("total", "gaus(0)+gaus(3)+gaus(6)+gaus(9)+gaus(12)+gaus(15)+gaus(18)+gaus(21)+gaus(24)+gaus(27)+gaus(30)+gaus(33)+gaus(36)", zlocate[0]-dz,zlocate[Nfoil-1]+dz); TCanvas *c = new TCanvas("vertex_z","vertex_z",900,600); T->Draw("rpl.z>>vz(500,-0.2,0.2)","abs(L.gold.dp)<0.05"); max_y = vz->GetMaximum(); for(int i=0;iFit(gr[i],"R"); else vz->Fit(gr[i],"R+"); gr[i]->GetParameters(&par[i*3]); mean[i] = gr[i]->GetParameter("Mean"); sigma[i] = gr[i]->GetParameter("Sigma"); } total->SetParameters(par); total->GetXaxis()->SetTitle("L.tr.vz (m)"); total->SetLineColor(2); vz->Fit(total,"R+"); // T->Draw("L.tr.vz>>vzfit(500,-0.2,0.2)","abs(L.gold.dp)<0.05"); // vzfit->GetXaxis()->SetTitle("L.tr.vz (m)"); // vzfit->Fit(total,"R+"); for(int i=0;iSetLineColor(3); foils[i]->Draw("same"); } TLatex *txt= new TLatex(); TString txtstr; Double_t txt_x,txt_y; txt->SetTextSize(0.025); txt->SetTextColor(2); max_y *=0.90; for(int i=0;iSetTextColor(8); txtstr=Form("%2.0lf",(zlocate[i])*1e3); txt->DrawLatex(txt_x,txt_y,txtstr); txt_y = max_y*(0.9/*+(i%3)*0.05*/); txt->SetTextColor(9); txtstr=Form("%2.1lf",(mean[i]-zlocate[i])*1e3); txt->DrawLatex(txt_x,txt_y,txtstr); txt_y = max_y*(0.85/*+(i%3)*0.05*/); txt->SetTextColor(9); txtstr=Form("+-%2.1lf",(sigma[i])*1e3); txt->DrawLatex(txt_x,txt_y,txtstr); } txt_x = zlocate[0]-1.0*dz; txt_y = max_y*1.0; txt->SetTextColor(8); txtstr=Form("ideal_z"); txt->DrawLatex(txt_x,txt_y,txtstr); txt_y = max_y*0.95; txt->SetTextColor(8); txtstr=Form("(mm)"); txt->DrawLatex(txt_x,txt_y,txtstr); txt_y = max_y*0.9; txt->SetTextColor(9); txtstr=Form("#Delta z:="); txt->DrawLatex(txt_x,txt_y,txtstr); txt_y = max_y*0.85; txt->SetTextColor(9); txtstr=Form("#sigma:="); txt->DrawLatex(txt_x,txt_y,txtstr); } void DrawPatternSieve(void){ gStyle->SetPalette(1); TLine *ph[Nhole]; TLine *th[Nhole]; Double_t temp_x,temp_y; for(int i=0;iDraw("L.gold.th*1157e-3:L.gold.ph*1157e-3>>phth(600,-0.1,0.1,600,-0.1,0.1)","abs(rpl.z)<0.015","colz"); for(int i=0;iDraw("same"); th[i]->Draw("same"); } } void DrawPattern(void){ DrawPatternVertex(); //DrawPatternSieve(); }