/////////////////////////////////////////////////// // Author: J. McIntyre // 6 Apr 2021 /////////////////////////////////////////////////// // This file is a template for fitting histograms. // To change this file modify the following: // ------------------------------------------------ // This files name --> Spline_fit // Real data root file --> TwoGamma_nov_10_2020Analysis.root // Text Files --> Spline_fit // /nfs/direct/annex/mcintyre/analysisVIII // ------------------------------------------------ /* //////////////////////////////////////////////// TLine *zeroline3 = new TLine(0.74, 0, 1.18, 0); zeroline3->SetLineColor(1); zeroline3->SetLineStyle(10); zeroline3->SetLineWidth(2); zeroline3->Draw("hist"); //////////////////////////////////////////////// */ // ------------------------------------------------ // DRAWING OPTIONS //---------------- // gStyle->SetOptStat(0); // No Legend // gStyle->SetOptTitle(0); // No title // histo->SetLineWidth(5); // Line thickness // histo->SetLineStyle(5); // Line type (1=solid) // histo->SetLineColor(kBlue); // Line color // histo->SetFillColor(kBlue); // Filling color to histo (38 = light blue) // histo->SetFillColorAlpha(kBlue,0.25); // Suppose to be semi-transparent // ------------------------------------------------ #include #include #include #include #include #include #include #include #include #include #include "TMath.h" #include #include void TAGM_6_2GeV_Bundle_Rod_Fit() { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // I kept the above C++ formatting in case someone needed to run this file instead of a direct input of the code to the command line. // Copy & Paste into ROOT command line directly, then use the fitting tool for each histogram. // Enter the fit numbers for a pol1 fit into "TAGM_Weights.txt" to keep for reference. TFile *MyFile = new TFile("Tagm_Bundle_9_2GeV.root", "NEW"); //double E_ph[17] = {127.1157, 130.5520, 134.0248, 137.5351, 141.0836, 144.6712, 148.2990, 151.9679, 155.6788, 159.4329, 163.2311, 167.0747, 170.9648, 174.9026, 178.8893, 182.9263, 187.0149}; double E_ph[17] = {334.007143, 339.501203, 345.038795, 350.620632, 356.247445, 361.919985, 367.639019, 373.405333, 379.219737, 385.083057, 390.996144, 396.959869, 402.975126, 409.042834, 415.163936, 421.339400, 427.5702}; //double x_fp[17] = {-1.9599, -1.9391, -1.9184, -1.8976, -1.8768, -1.8560, -1.8351, -1.8142, -1.7933, -1.7724, -1.7514, -1.7304, -1.7093, -1.6883, -1.6672, -1.6461, -1.6250}; double x_fp[17] = {-1.2204, -1.2108, -1.2012, -1.1916, -1.1820, -1.1723, -1.1627, -1.1531, -1.1435, -1.1338, -1.1242, -1.1146, -1.1049, -1.0953, -1.0856, -1.0760, -1.0663}; //double w_pi_sb2_t[17] = {139.5991, 143.0539, 146.5451, 150.0734, 153.6398, 157.2452, 160.8905, 164.5766, 168.3047, 172.0757, 175.8907, 179.7508, 183.6572, 187.6111, 191.6138, 195.6665, 199.7706}; double w_pi_sb2_t[17] = {347.0186, 352.5178, 358.0604, 363.6473, 369.2792, 374.9567, 380.6806, 386.4518, 392.2711, 398.1392, 404.0571, 410.0255, 416.0455, 422.1178, 428.2435, 434.4236, 440.6589}; //double beta_ang[17] = {-6.6489, -6.5786, -6.5082, -6.4377, -6.3672, -6.2965, -6.2257, -6.1548, -6.0838, -6.0128, -5.9416, -5.8704, -5.7990, -5.7276, -5.6560, -5.5844, -5.5127}; double beta_ang[17] = {-4.1402, -4.1076, -4.0750, -4.0424, -4.0098, -3.9772, -3.9445, -3.9119, -3.8792, -3.8466, -3.8139, -3.7812, -3.7485, -3.7158, -3.6830, -3.6503, -3.6175}; int n = 17; TCanvas *c101 = new TCanvas("c101", "", 900, 600); c101->cd(); TGraph *grSig = new TGraph(n,E_ph,x_fp); grSig->SetTitle("Bundle Support Forwad Rod Positions"); //grSig->GetXaxis()->CenterTitle(true); grSig->GetXaxis()->SetTitle("X_{fp} [cm]"); grSig->GetYaxis()->CenterTitle(true); grSig->GetYaxis()->SetTitle("Y_{fp} [cm]"); grSig->Draw("AC*"); gFile = MyFile; gDirectory->WriteObject(grSig, "tagm_fwd_rod"); TCanvas *c102 = new TCanvas("c102", "", 900, 600); c102->cd(); TGraph *gr2 = new TGraph(n,w_pi_sb2_t,beta_ang); gr2->SetTitle("Bundle Support Rear Rod Positions;X_{fp} [cm.];Y_{fp} [cm.]"); gr2->GetYaxis()->CenterTitle(true); gr2->Draw("AC*"); gFile = MyFile; gDirectory->WriteObject(gr2, "tagm_rear_rod"); MyFile->Close(); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* TCanvas *c103 = new TCanvas("c103", "", 900, 600); c103->cd(); TGraph *gr = new TGraph(n,E_ph,w_pi_sb2_t); gr->SetTitle("#pi^{0} SB1 Region Weights;|t| [GeV^2];Fill Weight"); gr->GetYaxis()->CenterTitle(true); gr->Draw("AC*"); gFile = MyFile; gDirectory->WriteObject(gr, "Pi0_SB2Weight"); TSpline3 *s = new TSpline3("grs",gr); s->SetLineColor(kRed); s->Draw("same"); */ }