Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:11:19

0001 #! /usr/bin/env python
0002 from optparse import OptionParser
0003 import sys
0004 import os
0005 import datetime
0006 from array import *
0007 from ROOT import *
0008 import numpy
0009 import math
0010 import glob
0011 from plotUtil import *
0012 
0013 gROOT.SetBatch(True)
0014 
0015 def Draw_1Dhist_datasimcomp(hdata, hsims, gpadmargin, norm, logy, ymaxscale, XaxisName, Ytitle_unit, prelim, simlegtex, evtseltexts, outname):
0016     hsimcolor = colorset(len(hsims))
0017 
0018     hdata.Sumw2()
0019     for hsim in hsims:
0020         hsim.Sumw2()
0021 
0022     binwidth = hdata.GetXaxis().GetBinWidth(1)
0023 
0024     if norm == 'unity':
0025         hdata.Scale(1. / hdata.Integral(-1, -1))
0026         for hsim in hsims:
0027             hsim.Scale(1. / hsim.Integral(-1, -1))
0028     elif norm == 'data':
0029         for hsim in hsims:
0030             hsim.Scale(hdata.Integral(-1, -1) / hsim.Integral(-1, -1))
0031     else:
0032         if norm != 'none':
0033             print('Invalid normalization option: {}'.format(norm))
0034             sys.exit(1)
0035     
0036     # Get the maximum bin content 
0037     maxbincontent = max(hdata.GetMaximum(), hsim.GetMaximum())
0038 
0039     c = TCanvas('c', 'c', 800, 700)
0040     if logy:
0041         c.SetLogy()
0042     c.cd()
0043     gPad.SetRightMargin(gpadmargin[0])
0044     gPad.SetTopMargin(gpadmargin[1])
0045     gPad.SetLeftMargin(gpadmargin[2])
0046     gPad.SetBottomMargin(gpadmargin[3])
0047     
0048     for i, hsim in enumerate(hsims):
0049         if i == 0:
0050             if norm == 'unity':
0051                 if Ytitle_unit == '':
0052                     hsim.GetYaxis().SetTitle(
0053                         'Normalized entries / ({:g})'.format(binwidth))
0054                 else:
0055                     hsim.GetYaxis().SetTitle(
0056                         'Normalized entries / ({:g} {unit})'.format(binwidth, unit=Ytitle_unit))
0057             else:
0058                 if Ytitle_unit == '':
0059                     hsim.GetYaxis().SetTitle('Entries / ({:g})'.format(binwidth))
0060                 else:
0061                     hsim.GetYaxis().SetTitle(
0062                         'Entries / ({:g} {unit})'.format(binwidth, unit=Ytitle_unit))
0063 
0064             if logy:
0065                 hsim.GetYaxis().SetRangeUser(hsim.GetMinimum(0)*0.5, (hsim.GetMaximum()) * ymaxscale)
0066             else:
0067                 hsim.GetYaxis().SetRangeUser(0., (hsim.GetMaximum()) * ymaxscale)
0068 
0069             hsim.GetXaxis().SetTitle(XaxisName)
0070             hsim.GetXaxis().SetTitleOffset(1.1)
0071             hsim.GetYaxis().SetTitleOffset(1.35)
0072             hsim.SetLineColor(TColor.GetColor(hsimcolor[i]))
0073             hsim.SetLineWidth(2)
0074             hsim.SetMarkerSize(0)
0075             hsim.Draw('histe')
0076         else:
0077             hsim.SetLineColor(TColor.GetColor(hsimcolor[i]))
0078             hsim.SetLineWidth(2)
0079             hsim.SetMarkerSize(0)
0080             hsim.Draw('histe same')
0081 
0082     hdata.SetMarkerStyle(20)
0083     hdata.SetMarkerSize(1)
0084     hdata.SetMarkerColor(1)
0085     hdata.SetLineColor(1)
0086     hdata.SetLineWidth(2)
0087     hdata.Draw('same PE1')
0088     shift = 0.45 if prelim else 0.75
0089     legylow = 0.2 + 0.04 * (len(hsims) - 1)
0090     leg = TLegend((1-RightMargin)-shift, (1-TopMargin)-legylow,
0091                   (1-RightMargin)-0.1, (1-TopMargin)-0.03)
0092     leg.SetTextSize(0.04)
0093     leg.SetFillStyle(0)
0094     # prelimtext = 'Preliminary' if prelim else 'Work-in-progress'
0095     prelimtext = 'Preliminary' if prelim else 'Internal'
0096     leg.AddEntry('', '#it{#bf{sPHENIX}} '+prelimtext, '')
0097     leg.AddEntry('', 'Au+Au #sqrt{s_{NN}}=200 GeV', '')
0098     leg.AddEntry(hdata, 'Data', "PE1")
0099     for i, lt in enumerate(simlegtex):
0100         leg.AddEntry(hsims[i], lt, "le")
0101     leg.Draw('same')
0102     
0103     # event selection text
0104     legylow_evtselshift = 0.04 * len(evtseltexts)
0105     leg2 = TLegend((1-RightMargin)-shift, (1-TopMargin)-legylow-legylow_evtselshift,
0106                     (1-RightMargin)-0.1, (1-TopMargin)-legylow)
0107     leg2.SetTextSize(0.035)
0108     leg2.SetFillStyle(0)
0109     for i, evtseltext in enumerate(evtseltexts):
0110         leg2.AddEntry('', evtseltext, '')
0111     leg2.Draw('same')
0112     c.RedrawAxis()
0113     c.Draw()
0114     c.SaveAs(outname+'.pdf')
0115     c.SaveAs(outname+'.png')
0116     if(c):
0117         c.Close()
0118         gSystem.ProcessEvents()
0119         del c
0120         c = 0
0121 
0122 
0123 if __name__ == '__main__': 
0124     plotpath = './ClusEtaAdcPhisize/'
0125     os.makedirs(plotpath, exist_ok=True)
0126     
0127     gStyle.SetPalette(kRainBow)
0128 
0129     datahist = '/sphenix/user/hjheng/sPHENIXRepo/analysis/dNdEta_Run2023/analysis_INTT/plot/hists/Data_CombinedNtuple_Run20869_HotDead_BCO_ADC_Survey/Cluster/hists_merged.root'
0130     simhist_20240528 = '/sphenix/user/hjheng/sPHENIXRepo/analysis/dNdEta_Run2023/analysis_INTT/plot/hists/Sim_Ntuple_HIJING_ana419_20240528/Cluster/hists_merged.root'
0131     simhist_20240910 = '/sphenix/user/hjheng/sPHENIXRepo/analysis/dNdEta_Run2023/analysis_INTT/plot/hists/Sim_Ntuple_HIJING_ana419_20240910/Cluster/hists_merged.root'
0132     
0133     hM_ClusEtaPV_all_ClusADCg35_data = GetHistogram(datahist, 'hM_ClusEtaPV_all_ClusADCg35')
0134     hM_ClusEtaPV_all_ClusADCg35_sim_20240528 = GetHistogram(simhist_20240528, 'hM_ClusEtaPV_all_ClusADCg35') # with MVTX support
0135     hM_ClusEtaPV_all_ClusADCg35_sim_20240910 = GetHistogram(simhist_20240910, 'hM_ClusEtaPV_all_ClusADCg35') # without MVTX support
0136     hM_ClusEtaPV_all_ClusADCg35_weiClusADCoverPhiSize_data = GetHistogram(datahist, 'hM_ClusEtaPV_all_ClusADCg35_weiClusADCoverPhiSize')
0137     hM_ClusEtaPV_all_ClusADCg35_weiClusADCoverPhiSize_sim_20240528 = GetHistogram(simhist_20240528, 'hM_ClusEtaPV_all_ClusADCg35_weiClusADCoverPhiSize') # with MVTX support
0138     hM_ClusEtaPV_all_ClusADCg35_weiClusADCoverPhiSize_sim_20240910 = GetHistogram(simhist_20240910, 'hM_ClusEtaPV_all_ClusADCg35_weiClusADCoverPhiSize') # without MVTX support
0139     
0140     # take ratio of hM_ClusEtaPV_all_ClusADCg35_sim_20240528 and hM_ClusEtaPV_all_ClusADCg35_sim_20240910
0141     # first clone two histograms 
0142     hM_ClusEtaPV_all_ClusADCg35_sim_20240528_clone = GetHistogram(simhist_20240528, 'hM_ClusEtaPV_all_ClusADCg35') # with MVTX support
0143     hM_ClusEtaPV_all_ClusADCg35_sim_20240910_clone = GetHistogram(simhist_20240910, 'hM_ClusEtaPV_all_ClusADCg35') # without MVTX support
0144     hM_ClusEtaPV_all_ClusADCg35_sim_20240528_clone.Scale(1./hM_ClusEtaPV_all_ClusADCg35_sim_20240528_clone.Integral(-1, -1))
0145     hM_ClusEtaPV_all_ClusADCg35_sim_20240910_clone.Scale(1./hM_ClusEtaPV_all_ClusADCg35_sim_20240910_clone.Integral(-1, -1))
0146     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport = hM_ClusEtaPV_all_ClusADCg35_sim_20240910_clone.Clone('hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport')
0147     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.Divide(hM_ClusEtaPV_all_ClusADCg35_sim_20240528_clone)
0148     c = TCanvas('c', 'c', 800, 700)
0149     c.cd()
0150     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.GetXaxis().SetTitle('Cluster #eta')
0151     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.GetYaxis().SetTitle('w.o MVTX support / w. MVTX support')
0152     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.GetYaxis().SetTitleOffset(1.3)
0153     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.GetYaxis().SetRangeUser(0.8, 1.2)
0154     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.SetMarkerStyle(20)
0155     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.SetMarkerSize(0.7)
0156     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.SetMarkerColor(1)
0157     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.SetLineColor(1)
0158     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.SetLineWidth(2)
0159     hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.Draw('PE1')
0160     line = TLine(hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.GetXaxis().GetXmin(), 1, hM_ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.GetXaxis().GetXmax(), 1)
0161     line.SetLineColor(kRed)
0162     line.SetLineStyle(2)
0163     line.Draw()
0164     c.SaveAs(plotpath+'ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.pdf')
0165     c.SaveAs(plotpath+'ratio_ClusEtaPV_all_ClusADCg35_MVTXsupport.png')
0166     
0167     
0168     hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_data = hM_ClusEtaPV_all_ClusADCg35_weiClusADCoverPhiSize_data.Clone('hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_data')
0169     hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240528 = hM_ClusEtaPV_all_ClusADCg35_weiClusADCoverPhiSize_sim_20240528.Clone('hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240528')
0170     hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240910 = hM_ClusEtaPV_all_ClusADCg35_weiClusADCoverPhiSize_sim_20240910.Clone('hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240910')
0171     hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_data.Divide(hM_ClusEtaPV_all_ClusADCg35_data)
0172     hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240528.Divide(hM_ClusEtaPV_all_ClusADCg35_sim_20240528)
0173     hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240910.Divide(hM_ClusEtaPV_all_ClusADCg35_sim_20240910)
0174     hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_data.GetYaxis().SetRangeUser(0, hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_data.GetBinContent(hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_data.GetMaximumBin())*1.3)
0175     hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240528.GetYaxis().SetRangeUser(0, hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240528.GetBinContent(hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240528.GetMaximumBin())*1.3)
0176     hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240910.GetYaxis().SetRangeUser(0, hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240910.GetBinContent(hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240910.GetMaximumBin())*1.3)
0177     
0178     Draw_1Dhist_datasimcomp(hM_ClusEtaPV_all_ClusADCg35_data, [hM_ClusEtaPV_all_ClusADCg35_sim_20240528, hM_ClusEtaPV_all_ClusADCg35_sim_20240910], [0.05, 0.05, 0.15, 0.15], 'unity', False, 1.8, 'Cluster #eta', '', False, ['HIJING (w. MVTX support)', 'HIJING (w.o MVTX support)'], ['Cluster ADC > 35'], plotpath+'ClusEtaPV_all_ClusADCg35')
0179     Draw_1Dhist_datasimcomp(hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_data, [hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240528, hM_ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize_sim_20240910], [0.05, 0.05, 0.15, 0.15], 'none', False, 1.5, 'Cluster #eta', '', False, ['HIJING (w. MVTX support)', 'HIJING (w.o MVTX support)'], ['Cluster ADC > 35'], plotpath+'ClusEtaPV_all_ClusADCg35_avgclusadcoverphisize')
0180     
0181     hM_ClusEtaPV_ClusADC_all_data = GetHistogram(datahist, 'hM_ClusEtaPV_ClusADC_all_zoomin')
0182     hM_ClusEtaPV_ClusADC_all_sim_20240528 = GetHistogram(simhist_20240528, 'hM_ClusEtaPV_ClusADC_all_zoomin')
0183     hM_ClusEtaPV_ClusADC_all_sim_20240910 = GetHistogram(simhist_20240910, 'hM_ClusEtaPV_ClusADC_all_zoomin')
0184 
0185     # Draw_2Dhist(hist, IsData, logz, norm1, rmargin, XaxisName, YaxisName, ZaxisName, drawopt, outname)
0186     Draw_2Dhist(hM_ClusEtaPV_ClusADC_all_data, True, False, True, 0.15, 'Cluster #eta', 'Cluster ADC', 'Normalized counts', 'colz', plotpath+'ClusEtaPV_ClusADC_all_data')
0187     Draw_2Dhist(hM_ClusEtaPV_ClusADC_all_sim_20240528, False, False, True, 0.15, 'Cluster #eta', 'Cluster ADC', 'Normalized counts', 'colz', plotpath+'ClusEtaPV_ClusADC_all_sim_20240528')
0188     Draw_2Dhist(hM_ClusEtaPV_ClusADC_all_sim_20240910, False, False, True, 0.15, 'Cluster #eta', 'Cluster ADC', 'Normalized counts', 'colz', plotpath+'ClusEtaPV_ClusADC_all_sim_20240910')
0189 
0190     hM_ClusEtaPV_ClusADC_all_data.Scale(1./hM_ClusEtaPV_ClusADC_all_data.GetEntries())
0191     hM_ClusEtaPV_ClusADC_all_sim_20240528.Scale(1./hM_ClusEtaPV_ClusADC_all_sim_20240528.GetEntries())
0192     hM_ClusEtaPV_ClusADC_all_sim_20240910.Scale(1./hM_ClusEtaPV_ClusADC_all_sim_20240910.GetEntries())
0193     hM_ClusEtaPV_ClusADC_all_ratio = hM_ClusEtaPV_ClusADC_all_data.Clone('hM_ClusEtaPV_ClusADC_all_ratio')
0194     hM_ClusEtaPV_ClusADC_all_ratio.Divide(hM_ClusEtaPV_ClusADC_all_sim_20240528)
0195     hM_ClusEtaPV_ClusADC_all_ratio.GetZaxis().SetRangeUser(0, 2)
0196     Draw_2Dhist(hM_ClusEtaPV_ClusADC_all_ratio, True, False, False, 0.15, 'Cluster #eta', 'Cluster ADC', 'Data/Simulation (w. MVTX support)', 'colz', plotpath+'ClusEtaPV_ClusADC_all_datatosim')
0197     
0198     hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data = GetHistogram(datahist, 'hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35')
0199     hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240528 = GetHistogram(simhist_20240528, 'hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35')
0200     hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240910 = GetHistogram(simhist_20240910, 'hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35')
0201     # project to y axis
0202     hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data_projy = hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data.ProjectionY('hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data_projy')
0203     hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240528_projy = hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240528.ProjectionY('hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240528_projy')
0204     hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240910_projy = hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240910.ProjectionY('hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240910_projy')
0205     hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data_projy.Scale(1./hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data_projy.GetEntries())
0206     hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240528_projy.Scale(1./hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240528_projy.GetEntries())
0207     hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240910_projy.Scale(1./hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240910_projy.GetEntries())
0208     Draw_1Dhist_datasimcomp(hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data_projy, [hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240528_projy, hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_sim_20240910_projy], [0.05, 0.05, 0.15, 0.15], 'none', False, 1.3, 'Cluster ADC/Cluster #phi size', '', False, ['HIJING (w. MVTX support)', 'HIJING (w.o MVTX support)'], ['Cluster ADC > 35'], plotpath+'ClusEtaPV_ClusADCoverClusPhiSize_projy_all_ClusADCg35')
0209     # for hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data_projy, print out the bin range and bin content of each bin
0210     for i in range(1, hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data_projy.GetNbinsX()+1):
0211         print('bin {}: [{}, {}], content: {:.5f}'.format(i, hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data_projy.GetXaxis().GetBinLowEdge(i), hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data_projy.GetXaxis().GetBinUpEdge(i), hM_ClusEtaPV_ClusADCoverClusPhiSize_all_ClusADCg35_data_projy.GetBinContent(i)))
0212     
0213     hM_ClusEtaPV_all_ClusADCg35_ClusADCoverPhisizeCut_data = GetHistogram(datahist, 'hM_ClusEtaPV_all_ClusADCg35_ClusADCoverPhisizeCut')
0214     hM_ClusEtaPV_all_ClusADCg35_ClusADCoverPhisizeCut_sim_20240528 = GetHistogram(simhist_20240528, 'hM_ClusEtaPV_all_ClusADCg35_ClusADCoverPhisizeCut')
0215     hM_ClusEtaPV_all_ClusADCg35_ClusADCoverPhisizeCut_sim_20240910 = GetHistogram(simhist_20240910, 'hM_ClusEtaPV_all_ClusADCg35_ClusADCoverPhisizeCut')
0216     Draw_1Dhist_datasimcomp(hM_ClusEtaPV_all_ClusADCg35_ClusADCoverPhisizeCut_data, [hM_ClusEtaPV_all_ClusADCg35_ClusADCoverPhisizeCut_sim_20240528, hM_ClusEtaPV_all_ClusADCg35_ClusADCoverPhisizeCut_sim_20240910], [0.05, 0.05, 0.15, 0.15], 'unity', False, 1.8, 'Cluster #eta', '', False, ['HIJING (w. MVTX support)', 'HIJING (w.o MVTX support)'], ['Cluster ADC > 35','Cluster ADC/#phi size != ([79,82] & [111,114])'], plotpath+'ClusEtaPV_all_ClusADCg35_ClusADCoverPhisizeCut')
0217     
0218     datahist_tkl = '/sphenix/user/hjheng/sPHENIXRepo/analysis/dNdEta_Run2023/analysis_INTT/plot/hists/Data_CombinedNtuple_Run20869_HotDead_BCO_ADC_Survey/dRcut0p5_NominalVtxZ_RandomClusSet0_clusAdcCutSet0/hists_merged.root'
0219     simhist_20240528_tkl = '/sphenix/user/hjheng/sPHENIXRepo/analysis/dNdEta_Run2023/analysis_INTT/plot/hists/Sim_Ntuple_HIJING_ana419_20240528/dRcut0p5_NominalVtxZ_RandomClusSet0_clusAdcCutSet0/hists_merged.root'
0220     simhist_20240910_tkl = '/sphenix/user/hjheng/sPHENIXRepo/analysis/dNdEta_Run2023/analysis_INTT/plot/hists/Sim_Ntuple_HIJING_ana419_20240910/dRcut0p5_NominalVtxZ_RandomClusSet0_clusAdcCutSet0/hists_merged.root'
0221     hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_data = GetHistogram(datahist_tkl, 'hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10')
0222     hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240528 = GetHistogram(simhist_20240528_tkl, 'hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10')
0223     hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240910 = GetHistogram(simhist_20240910_tkl, 'hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10')
0224     Draw_1Dhist_datasimcomp(hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_data, [hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240528, hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240910], [0.05, 0.05, 0.15, 0.15], 'unity', False, 1.8, 'Tracklet #eta', '', False, ['HIJING (w. MVTX support)', 'HIJING (w.o MVTX support)'], ['Centrality 0-70%', 'MBD asymmetry < 0.75', '-30#leqZ_{vtx}#leq-10[cm]'], plotpath+'Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10')
0225     
0226     hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240528_clone = GetHistogram(simhist_20240528_tkl, 'hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10')
0227     hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240910_clone = GetHistogram(simhist_20240910_tkl, 'hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10')
0228     hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240528_clone.Scale(1./hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240528_clone.Integral(-1, -1))
0229     hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240910_clone.Scale(1./hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240910_clone.Integral(-1, -1))
0230     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport = hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240910_clone.Clone('hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport')
0231     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.Divide(hM_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_sim_20240528_clone)
0232     c = TCanvas('c', 'c', 800, 700)
0233     c.cd()
0234     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.GetXaxis().SetTitle('Tracklet #eta')
0235     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.GetYaxis().SetTitle('w.o MVTX support / w. MVTX support')
0236     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.GetYaxis().SetTitleOffset(1.3)
0237     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.GetYaxis().SetRangeUser(0.8, 1.2)
0238     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.SetMarkerStyle(20)
0239     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.SetMarkerSize(0.7)
0240     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.SetMarkerColor(1)
0241     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.SetLineColor(1)
0242     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.SetLineWidth(2)
0243     hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.Draw('PE1')
0244     line = TLine(hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.GetXaxis().GetXmin(), 1, hM_ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.GetXaxis().GetXmax(), 1)
0245     line.SetLineColor(kRed)
0246     line.SetLineStyle(2)
0247     line.Draw()
0248     c.SaveAs(plotpath+'ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.pdf')
0249     c.SaveAs(plotpath+'ratio_Eta_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10_MVTXsupport.png')
0250     
0251     # TH2F *hM_ClusEtaPV_PVz_all_ClusADCg35 = new TH2F("hM_ClusEtaPV_PVz_all_ClusADCg35", "hM_ClusEtaPV_PVz_all_ClusADCg35", 160, -4, 4, 160, -40, 0);
0252     # TH2F *hM_ClusEtaPV_PVz_layer1_ClusADCg35 = new TH2F("hM_ClusEtaPV_PVz_layer1_ClusADCg35", "hM_ClusEtaPV_PVz_layer1_ClusADCg35", 160, -4, 4, 160, -40, 0);
0253     # TH2F *hM_ClusEtaPV_PVz_layer2_ClusADCg35 = new TH2F("hM_ClusEtaPV_PVz_layer2_ClusADCg35", "hM_ClusEtaPV_PVz_layer2_ClusADCg35", 160, -4, 4, 160, -40, 0);
0254     # TH2F *hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize = new TH2F("hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize", "hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize", 160, -4, 4, 160, -40, 0);
0255     # TH2F *hM_ClusEtaPV_PVz_layer1_ClusADCg35_weiClusADCoverPhiSize = new TH2F("hM_ClusEtaPV_PVz_layer1_ClusADCg35_weiClusADCoverPhiSize", "hM_ClusEtaPV_PVz_layer1_ClusADCg35_weiClusADCoverPhiSize", 160, -4, 4, 160, -40, 0);
0256     # TH2F *hM_ClusEtaPV_PVz_layer2_ClusADCg35_weiClusADCoverPhiSize = new TH2F("hM_ClusEtaPV_PVz_layer2_ClusADCg35_weiClusADCoverPhiSize", "hM_ClusEtaPV_PVz_layer2_ClusADCg35_weiClusADCoverPhiSize", 160, -4, 4, 160, -40, 0);
0257     hM_ClusEtaPV_PVz_all_ClusADCg35_data = GetHistogram(datahist, 'hM_ClusEtaPV_PVz_all_ClusADCg35')
0258     hM_ClusEtaPV_PVz_all_ClusADCg35_sim_20240528 = GetHistogram(simhist_20240528, 'hM_ClusEtaPV_PVz_all_ClusADCg35')
0259     # hM_ClusEtaPV_PVz_all_ClusADCg35_sim_20240910 = GetHistogram(simhist_20240910, 'hM_ClusEtaPV_PVz_all_ClusADCg35')
0260     hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize_data = GetHistogram(datahist, 'hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize')
0261     hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize_sim_20240528 = GetHistogram(simhist_20240528, 'hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize')
0262     # hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize_sim_20240910 = GetHistogram(simhist_20240910, 'hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize')
0263     hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize_data.Divide(hM_ClusEtaPV_PVz_all_ClusADCg35_data)
0264     hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize_sim_20240528.Divide(hM_ClusEtaPV_PVz_all_ClusADCg35_sim_20240528)
0265     # hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize_sim_20240910.Divide(hM_ClusEtaPV_PVz_all_ClusADCg35_sim_20240910)
0266     # Draw_2Dhist(hist, IsData, logz, norm1, rmargin, XaxisName, YaxisName, ZaxisName, drawopt, outname)
0267     Draw_2Dhist(hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize_data, True, False, False, 0.15, 'Cluster #eta', 'PV_{z} [cm]', 'Cluster ADC/#phi size', 'colz', plotpath+'ClusEtaPV_PVz_all_ClusADCg35_avgClusADCoverPhiSize')
0268     Draw_2Dhist(hM_ClusEtaPV_PVz_all_ClusADCg35_weiClusADCoverPhiSize_sim_20240528, False, False, False, 0.15, 'Cluster #eta', 'PV_{z} [cm]', 'Cluster ADC/#phi size', 'colz', plotpath+'ClusEtaPV_PVz_all_ClusADCg35_avgClusADCoverPhiSize_sim_20240528')
0269     # Draw_2Dhist(hM_ClusEtaPV_PVz_all_ClusADCg35_sim_20240910, False, False, True, 0.15, 'Cluster #eta', 'PV_z [cm]', 'Cluster ADC/#phi size', 'colz', plotpath+'ClusEtaPV_PVz_all_ClusADCg35_sim_20240910')