def make_qr(): #quasi-real total cross section #sigma_qr = 53.839868617 # micro barn #infile = "../data/lmon_18x275_qr_Qd_beff2_5Mevt.root" sigma_qr = 55.1027755249 # micro barn infile = "../../lgen/data/lgen_18x275_qr_Qe_beff2_5Mevt.root" lqbin = 0.2 lqmin = -11 lqmax = 5 inp = TFile.Open(infile) #tree = inp.Get("DetectorTree") tree = inp.Get("ltree") #can = ut.box_canvas() hQ2 = ut.prepare_TH1D("hQ2", lqbin, lqmin, lqmax) tree.Draw("TMath::Log10(true_Q2) >> hQ2") ut.norm_to_integral(hQ2, sigma_qr) gQr = ut.h1_to_graph(hQ2) gQr.SetLineColor(rt.kRed) gQr.SetLineWidth(3) return gQr hQ2.Draw() ut.invert_col(rt.gPad) can.SaveAs("01fig.pdf")
def make_py(): #Pythia6 total cross section sigma_py = 54.700142803416348 # micro barn infile = "../data/lmon_py_18x275_Q2all_beff2_5Mevt.root" lqbin = 0.2 lqmin = -11 lqmax = 5 inp = TFile.Open(infile) tree = inp.Get("DetectorTree") #can = ut.box_canvas() hQ2 = ut.prepare_TH1D("hQ2", lqbin, lqmin, lqmax) tree.Draw("TMath::Log10(true_Q2) >> hQ2") ut.norm_to_integral(hQ2, sigma_py) gPy = ut.h1_to_graph(hQ2) gPy.SetLineColor(rt.kRed) gPy.SetLineWidth(3) gPy.SetLineStyle(rt.kDashed) return gPy #print hQ2.Integral("width") hQ2.Draw() ut.invert_col(rt.gPad) can.SaveAs("01fig.pdf")
def make_qr_10x100(): #quasi-real total cross section for 10x100 beams sigma_qr = 56.3121075698 # micro barn infile = "../../lgen/data/lgen_10x100_qr_Qe_5Mevt.root" lqbin = 0.2 lqmin = -11 lqmax = 5 inp = TFile.Open(infile) tree = inp.Get("ltree") hQ2 = ut.prepare_TH1D("hQ2", lqbin, lqmin, lqmax) tree.Draw("TMath::Log10(true_Q2) >> hQ2") ut.norm_to_integral(hQ2, sigma_qr) gQr = ut.h1_to_graph(hQ2) gQr.SetLineColor(rt.kYellow + 1) gQr.SetLineWidth(3) return gQr
def make_qr_5x41(): #quasi-real total cross section for 5x41 beams sigma_qr = 65.0648514567 # micro barn infile = "../../lgen/data/lgen_5x41_qr_Qe_5Mevt.root" lqbin = 0.2 lqmin = -11 lqmax = 5 inp = TFile.Open(infile) tree = inp.Get("ltree") hQ2 = ut.prepare_TH1D("hQ2", lqbin, lqmin, lqmax) tree.Draw("TMath::Log10(true_Q2) >> hQ2") ut.norm_to_integral(hQ2, sigma_qr) gQr = ut.h1_to_graph(hQ2) gQr.SetLineColor(rt.kBlue) gQr.SetLineWidth(3) return gQr
def make_sigma_2(inp, plot, xbin, xmin, xmax, sigma, tnam="ltree"): #cross section in two binning intervals from the tree infile = TFile.Open(inp) tree = infile.Get(tnam) #point to start longer bins xmid = 1 bin2 = xbin * 10. # 4. hx = ut.prepare_TH1D_vec("hx", ut.get_bins_vec_2pt(xbin, bin2, xmin, xmax, xmid)) tree.Draw(plot + " >> hx") #normalize to the width of each bin, necessary for variable binning for ibin in range(hx.GetNbinsX() + 1): hx.SetBinContent(ibin, hx.GetBinContent(ibin) / hx.GetBinWidth(ibin)) ut.norm_to_integral(hx, sigma) gx = ut.h1_to_graph(hx) gx.SetLineWidth(3) return gx
def loat_flat_pt2(): bgen = TFile.Open( "/home/jaroslav/sim/bgen_tx/bgen_pTsq0p14_eta1p2_6Mevt.root") bgen_tree = bgen.Get("bgen_tree") hFlat = ut.prepare_TH1D("hFlat", 0.002, 0., 0.12) bgen_tree.Draw("pT2rec >> hFlat") ut.norm_to_integral(hFlat, 0.025) # norm to Starlight gFlat = ut.h1_to_graph(hFlat) gFlat.SetLineColor(rt.kViolet) gFlat.SetLineWidth(3) gFlat.SetLineStyle(rt.kDashed) return gFlat
def make_FastZDC(nam, hZ): #infile = "/home/jaroslav/analyza/star-upc-data/ana/FastZDC/STnOOn_eta1p2_1Mevt/FastZDC_HCal_allADC.root" infile = "/home/jaroslav/analyza/star-upc-data/ana/FastZDC/STnOOn_eta1p2_1Mevt/FastZDC_Grupen_allADC.root" inp = TFile.Open(infile) tree = inp.Get("jRecTree") hF = ut.prepare_TH1D("hF", 5, 0, 400) tree.Draw(nam + " >> hF") ut.norm_to_data(hF, hZ) gF = ut.h1_to_graph(hF) gF.SetLineColor(rt.kBlue) gF.SetLineWidth(3) return gF
def make_sigma(inp, sigma): lqbin = 0.2 lqmin = -11 lqmax = 5 infile = TFile.Open(inp) tree = infile.Get("ltree") hx = ut.prepare_TH1D("hx", lqbin, lqmin, lqmax) tree.Draw("TMath::Log10(true_Q2) >> hx") ut.norm_to_integral(hx, sigma) gx = ut.h1_to_graph(hx) #gx.SetLineColor(rt.kYellow+1) gx.SetLineWidth(3) return gx
def load_starlight(dy): slight = TFile.Open( "/home/jaroslav/sim/starlight_tx/slight_AuAu_200GeV_Jpsi_coh_intmax0p34_6Mevt.root" ) slight_tree = slight.Get("slight_tree") #hSlight = ut.prepare_TH1D("hSlight", 0.002, 0., 0.12) hSlight = ut.prepare_TH1D_vec( "hSlight", ut.get_bins_vec_2pt(0.0002, 0.002, 0, 0.12, 0.004)) nall = float(slight_tree.GetEntries()) ny = float( slight_tree.Draw("pT*pT >> hSlight", "rapidity>-1 && rapidity<1")) #normalize to the width of each bin, necessary for variable binning for ibin in xrange(hSlight.GetNbinsX() + 1): hSlight.SetBinContent( ibin, hSlight.GetBinContent(ibin) / hSlight.GetBinWidth(ibin)) sigma_sl_tot = 67.958 # total Starlight cross section, ub sigma_sl = (ny / nall) * sigma_sl_tot / 1000. # ub to mb sigma_sl = sigma_sl / dy # rapidity interval print "sigma_sl:", sigma_sl #normalize to Starlight total cross section ut.norm_to_integral(hSlight, sigma_sl) #convert to graph gSlight = ut.h1_to_graph(hSlight) gSlight.SetLineColor(rt.kBlue) gSlight.SetLineWidth(3) gSlight.SetLineStyle(9) # kDashDotted return gSlight