void plot_wrapping (void) { // // plot the results of light transmission for various light guide wrappings // // #include #include gROOT->Reset(); //TTree *Bfield = (TTree *) gROOT->FindObject("Bfield"); gStyle->SetPalette(1,0); gStyle->SetOptStat(kFALSE); gStyle->SetOptFit(kTRUE); gStyle->SetOptFit(1111); gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); gStyle->SetFillColor(0); // char string[256]; char filename[80]; Int_t j,jj; #define npts1 5; #define npts2 4; #define npts3 6; #define jpts 10 Double_t ynone[npts1]={-1,427,553,450,-1}; Double_t xnone[npts1]={-1,1,1,1,5}; Double_t ytedlar[npts2]={-1,491,492,5}; Double_t xtedlar[npts2]={-1,1.95,2.05,-1}; Double_t ypaper[npts2]={-1,528,504,5}; Double_t xpaper[npts2]={-1,3,3,-1}; Double_t ynone2[npts1]={-1,210,192,224,-1}; Double_t xnone2[npts1]={-1,1,1,1,5}; Double_t ytedlar2[npts1]={-1,180,167,215,-1}; Double_t xtedlar2[npts1]={-1,2,2,2,-1}; Double_t ypaper2[npts1]={-1,171,177,224,-1}; Double_t xpaper2[npts1]={-1,3,3,3,-1}; Double_t ynone3[npts2]={-1,54.5,46.5,-1}; Double_t xnone3[npts2]={-1,1,1,-1}; Double_t ytedlar3[npts2]={-1,44.6,49.3,-1}; Double_t xtedlar3[npts2]={-1,2,2,-1}; Double_t ypaper3[npts2]={-1,48.2,51.6,-1}; Double_t xpaper3[npts2]={-1,3,3,-1}; Double_t ynone4[npts1]={-1,44.5,47.9,48.5,-1}; Double_t xnone4[npts1]={-1,1,1,1,6}; Double_t ytedlar4[npts1]={-1,41.7,43.3,45.2,-1}; Double_t xtedlar4[npts1]={-1,2,2,2,6}; Double_t ypaper4[npts1]={-1,48.1,47.1,41.3,-1}; Double_t xpaper4[npts1]={-1,3,3,3,6}; Double_t ymylar4[npts1]={-1,44,49.2,45.3,-1}; Double_t xmylar4[npts1]={-1,4,4,4,6}; Double_t factor1=2.5; Double_t factor2=10; for (j=0;jSetBorderMode(0); c1->SetFillColor(0); c1->SetGridx(); c1->SetGridy(); TLegend *leg = new TLegend(0.15,0.70,0.50,0.95); Double_t xmin=0; Double_t xmax=4; Double_t ymin=0; Double_t ymax=800; none->SetTitle(""); none->GetXaxis()->SetRangeUser(xmin,xmax); none->GetYaxis()->SetRangeUser(ymin,ymax); none->GetXaxis()->SetTitleSize(0.04); none->GetYaxis()->SetTitleSize(0.04); none->GetYaxis()->SetTitleOffset(1.5); // none->GetYaxis()->SetTitleOffset(2.0); none->GetXaxis()->SetTitle("Wrapping Type"); // none->GetYaxis()->SetTitle("Amplitude (mV)"); none->GetYaxis()->SetTitle("Normalized Amplitude (mV)"); none->GetXaxis()->SetNdivisions(505); none->SetMarkerColor(1); none->SetMarkerStyle(21); leg->AddEntry(none,"No Wrapping (22 mm)","p"); none->SetMarkerColor(4); none->SetMarkerStyle(21); none->Draw("Ap"); leg->AddEntry(tedlar,"Tedlar (22 mm)","p"); tedlar->SetMarkerColor(4); tedlar->SetMarkerStyle(21); tedlar->Draw("Samep"); leg->AddEntry(paper,"Acid-free Paper (22 mm)","p"); paper->SetMarkerColor(4); paper->SetMarkerStyle(21); paper->Draw("Samep"); leg->AddEntry(none2,"No Wrapping x 2.5 (80 mm)","p"); none2->SetMarkerColor(1); none2->SetMarkerStyle(25); none2->Draw("Samep"); leg->AddEntry(tedlar2,"Tedlar x 2.5 (80 mm)","p"); tedlar2->SetMarkerColor(1); tedlar2->SetMarkerStyle(25); tedlar2->Draw("Samep"); leg->AddEntry(paper2,"Acid-free Paper x 2.5 (80 mm)","p"); paper2->SetMarkerColor(1); paper2->SetMarkerStyle(25); paper2->Draw("Samep"); leg->AddEntry(none3,"No Wrapping x10 (diffuser)","p"); none3->SetMarkerColor(2); none3->SetMarkerStyle(20); none3->Draw("Samep"); leg->AddEntry(tedlar3,"Tedlar x10 (diffuser)","p"); tedlar3->SetMarkerColor(2); tedlar3->SetMarkerStyle(20); tedlar3->Draw("Samep"); leg->AddEntry(paper3,"Acid-free Paper x10 (diffuser)","p"); paper3->SetMarkerColor(2); paper3->SetMarkerStyle(20); paper3->Draw("Samep"); leg->Draw(); TCanvas *c2 = new TCanvas("c2","c2 plot_wrapping",200,10,700,700); c2->SetBorderMode(0); c2->SetFillColor(0); c2->SetGridx(); c2->SetGridy(); TLegend *leg1 = new TLegend(0.15,0.75,0.50,0.90); Double_t xmin=0; Double_t xmax=5; Double_t ymin=0; Double_t ymax=80; none4->SetTitle(""); none4->GetXaxis()->SetRangeUser(xmin,xmax); none4->GetYaxis()->SetRangeUser(ymin,ymax); none4->GetXaxis()->SetTitleSize(0.04); none4->GetYaxis()->SetTitleSize(0.04); none4->GetYaxis()->SetTitleOffset(1.5); // none4->GetYaxis()->SetTitleOffset(2.0); none4->GetXaxis()->SetTitle("Wrapping Type"); none4->GetYaxis()->SetTitle("Amplitude (mV)"); none4->GetXaxis()->SetNdivisions(510); none4->SetMarkerColor(1); none4->SetMarkerStyle(21); leg1->AddEntry(none4,"No Wrapping (diffuser)","p"); none4->SetMarkerColor(1); none4->SetMarkerStyle(21); none4->Draw("Ap"); leg1->AddEntry(tedlar4,"Tedlar (diffuser)","p"); tedlar4->SetMarkerColor(2); tedlar4->SetMarkerStyle(21); tedlar4->Draw("Samep"); leg1->AddEntry(paper4,"Acid-free Paper (diffuser)","p"); paper4->SetMarkerColor(4); paper4->SetMarkerStyle(21); paper4->Draw("Samep"); leg1->AddEntry(mylar4," Al Mylar (diffuser)","p"); mylar4->SetMarkerColor(3); mylar4->SetMarkerStyle(21); mylar4->Draw("Samep"); mean->SetMarkerColor(2); mean->SetMarkerStyle(20); mean->Draw("Samep"); Double_t barline= (mean_none+mean_tedlar+mean_paper+mean_mylar)/4; TLine *bar = new TLine(xmin,barline,xmax,barline); bar->SetLineColor(1); bar->Draw(); leg1->Draw(); sprintf(filename,"plot_wrapping_c1.eps"); c1->SaveAs(filename); sprintf(filename,"plot_wrapping_c1.png"); c1->SaveAs(filename); sprintf(filename,"plot_wrapping_c2.eps"); c2->SaveAs(filename); sprintf(filename,"plot_wrapping_c2.png"); c2->SaveAs(filename); /*sprintf(filename,"plot_wrapping_c3.eps"); c3->SaveAs(filename); sprintf(filename,"plot_wrapping_c3.png"); c3->SaveAs(filename);*/ } Double_t fit_func (Double_t *x, Double_t *par) { // Fit ln(thermal conductivity) as a funciton of ln(Temperature) Double_t p0=par[0]; Double_t p1=par[1]; Double_t p2=par[2]; Double_t p3=par[3]; Double_t p4=par[4]; Double_t x1=log(x[0]); Double_t pi=3.14159; char string[256]; Double_t func; func = p0 + p1*x1 + p2*x1*x1 + p3*x1*x1*x1 + p4*x1*x1*x1*x1; /*sprintf (string,"x1=%f func=%f\n",x1,func); printf ("string=%s",string);*/ if (func < 50) { return exp(func); } else { return exp(50); } }