File indexing completed on 2025-08-05 08:11:19
0001
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
0014
0015 gROOT.SetBatch(True)
0016
0017 if __name__ == '__main__':
0018 parser = OptionParser(usage="usage: %prog ver [options -n]")
0019 parser.add_option("--histdir", dest="histdir", type="string", default='/sphenix/user/hjheng/TrackletAna/analysis_INTT/plot/hists/HIJING_ana398_xvtx-0p04cm_yvtx0p24cm_zvtx-20cm_dummyAlignParams/dRcut0p5/hists_merged.root', help="Input file name")
0020 parser.add_option("--plotdir", dest="plotdir", type="string", default='./RecoTracklet/HIJING_ana398_xvtx-0p04cm_yvtx0p24cm_zvtx-20cm_dummyAlignParams/dRcut0p5/', help="Plot directory")
0021 parser.add_option("--isdata", dest="isdata", action="store_true", default=False, help="Is data")
0022
0023 (opt, args) = parser.parse_args()
0024
0025 histdir = opt.histdir
0026 plotdir = opt.plotdir
0027 isdata = opt.isdata
0028
0029 if os.path.isfile("{}/hists_merged.root".format(histdir)):
0030 os.system("rm {}/hists_merged.root".format(histdir))
0031 os.system("hadd -f -j 20 {}/hists_merged.root {}/hists_*.root".format(histdir, histdir))
0032 else:
0033 os.system("hadd -f -j 20 {}/hists_merged.root {}/hists_*.root".format(histdir, histdir))
0034
0035 os.makedirs(plotdir, exist_ok=True)
0036
0037
0038 hM_Eta_vtxZ_reco_incl = GetHistogram('{}/hists_merged.root'.format(histdir), 'hM_Eta_vtxZ_reco_incl')
0039 hM_Eta_vtxZ_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10 = GetHistogram('{}/hists_merged.root'.format(histdir), 'hM_Eta_vtxZ_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10')
0040 hM_Eta_Phi_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10 = GetHistogram('{}/hists_merged.root'.format(histdir), 'hM_Eta_Phi_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10')
0041
0042
0043 Draw_2Dhist(hM_Eta_vtxZ_reco_incl, isdata, False, False, 0.16, 'Reco-tracklet #eta', 'INTT Z_{vtx} [cm]', '', 'colz', plotdir+'/RecoTracklet_Eta_vtxZ')
0044 Draw_2Dhist(hM_Eta_vtxZ_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10, isdata, False, False, 0.16, 'Reco-tracklet #eta', 'INTT Z_{vtx} [cm]', '', 'colz', plotdir+'/RecoTracklet_Eta_vtxZ_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10')
0045 Draw_2Dhist(hM_Eta_Phi_reco_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10, isdata, False, False, 0.16, 'Reco-tracklet #eta', 'Reco-tracklet #phi', '', 'colz', plotdir+'/RecoTracklet_Eta_Phi_Centrality0to70_MBDAsymLe0p75_VtxZm30tom10')