data analysis scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

78 lines
4.0 KiB

{
gROOT->ProcessLine(".x lhcbStyle.C");
TCanvas c1_mg1_e9;
TGraph * ge9_p = new TGraph("energylist_p_bpmbeta1.txt","%lg %lg ");
TGraph * ge9_he = new TGraph("energylist_he_bpmbeta1.txt","%lg %lg");
TGraph * ge9_c = new TGraph("energylist_c_bpmbeta1.txt","%lg %lg ");
TGraph * ge9_o = new TGraph("energylist_o_bpmbeta1.txt","%lg %lg ");
TMultiGraph * mg_e9 = new TMultiGraph();
mg_e9->Add(ge9_p,"p"); ge9_p->SetMarkerStyle(20);
mg_e9->Add(ge9_he,"p"); ge9_he->SetMarkerStyle(21);
mg_e9->Add(ge9_c,"p"); ge9_c->SetMarkerStyle(22);
mg_e9->Add(ge9_o,"p"); ge9_o->SetMarkerStyle(23);
// mg_e9->Add(ge9_sum,"p"); ge9_sum->SetMarkerStyle(1);
TF1 * tf1_btvbeta1 = new TF1("tf1_btvbeta1","[0]*( (1- 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x )) / (1+[2]* (1- 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x ))*1*1.65901*TMath::Power(x,-1.7218)) + 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x ) ) ",0,1);
tf1_btvbeta1->SetParLimits(0,0,1.5);
tf1_btvbeta1->SetParLimits(1,0,1E4.);
tf1_btvbeta1->SetParLimits(2,0.001,.03);
tf1_btvbeta1->SetParameters(1,0, 0.01);
TF1 * tf1_btvbeta2 = new TF1("tf1_btvbeta1","[0]*( (1- 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x )) / (1+[2]* (1- 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x ))*4*1.65901*TMath::Power(x,-1.7218)) + 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x ) ) ",0,1);
tf1_btvbeta2->SetParLimits(0,0,1.5);
tf1_btvbeta2->SetParLimits(1,0,1E4.);
tf1_btvbeta2->SetParLimits(2,0.001,.03);
tf1_btvbeta2->SetParameters(1,0.002, 0.01);
TF1 * tf1_btvbeta3 = new TF1("tf1_btvbeta1","[0]*( (1- 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x )) / (1+[2]* (1- 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x ))*36*1.65901*TMath::Power(x,-1.7218)) + 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x ) ) ",0,1);
tf1_btvbeta3->SetParLimits(0,0,2.5);
tf1_btvbeta3->SetParLimits(1,0,1E4.);
tf1_btvbeta3->SetParLimits(2,0.001,0.03);
tf1_btvbeta3->SetParameters(1,9.7E3, 0.01);
TF1 * tf1_btvbeta4 = new TF1("tf1_btvbeta1","[0]*( (1- 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x )) / (1+[2]* (1- 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x ))*64*1.65901*TMath::Power(x,-1.7218)) + 0.5*(TMath::Log(2*0.511E6*x*x/(1-x*x)/[1]) -x*x )/(TMath::Log(2*0.511E6*x*x/(1-x*x)/68.7) -x*x ) ) ",0,1);
tf1_btvbeta4->SetParLimits(0,0,2.5);
tf1_btvbeta4->SetParLimits(1,0,1E4.);
tf1_btvbeta4->SetParLimits(2,0.01,0.03);
tf1_btvbeta4->SetParameters(1,9.7E3, 0.01);
mg_e9->Draw("a");
mg_e9->SetTitle(" ");
mg_e9->GetXaxis()->SetTitle("Lorentz #beta");
mg_e9->GetYaxis()->SetTitle("#frac{dA}{dE}");
mg_e9->SetMinimum(0.0);
// mg_e9->SetMaximum(40.);
// gPad->SetLogx();
ge9_p->Fit(tf1_btvbeta1);
ge9_he->Fit(tf1_btvbeta2);
ge9_c->Fit(tf1_btvbeta3);
ge9_o->Fit(tf1_btvbeta4);
mylegende9 = new TLegend(0.70,0.7,0.9,0.9);
mylegende9->SetFillColor(0); // white background
mylegende9->SetTextFont(22);
mylegende9->SetBorderSize(0); // get rid of the box
mylegende9->SetTextSize(0.047); // set text size
mylegende9->AddEntry(ge9_p,"Protons","p"); // options: p,l,f
mylegende9->AddEntry(ge9_he,"Helium","p"); // options: p,l,f
mylegende9->AddEntry(ge9_c,"Carbon","p"); // options: p,l,f
mylegende9->AddEntry(ge9_o,"Oxygen","p"); // options: p,l,f
// mylegende9->AddEntry(tf1_pow1,"[1]#upointpow(#beta,[2])}","l"); // options: p,l,f
mylegende9->Draw();
gPad->Modified();
c1_mg1_e9->SaveAs("figs/bpmbeta1.pdf");
c1_mg1_e9->SaveAs("figs/bpmbeta1.png");
c1_mg1_e9->SaveAs("figs/bpmbeta1.C");
}