Skip to content
Snippets Groups Projects

Analysis of truth/reconstruction associations

Merged Tooba Ali requested to merge truth_reconstruction into master
3 files
+ 12
21
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -6,32 +6,19 @@ import matplotlib.pyplot as plt
@@ -6,32 +6,19 @@ import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib as mpl
import mplhep
import mplhep
import argparse
import argparse
#
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser()
parser.add_argument('--rec_file', type=str, help='Reconstructed track file.')
parser.add_argument('--rec_file', type=str, help='Reconstructed track file.')
parser.add_argument('--config', type=str, help='Momentum configuration.')
parser.add_argument('--config', type=str, help='Momentum configuration.')
parser.add_argument('--ebeam', type=float, help='Electron beam energy.')
parser.add_argument('--pbeam', type=float, help='Proton (or ion) beam energy.')
parser.add_argument('--minq2', type=float, help='Minimum four-momentum transfer squared Q2.')
parser.add_argument('--nevents', type=float, help='Number of events to process.')
parser.add_argument('--nevents', type=float, help='Number of events to process.')
parser.add_argument('-o', dest='outdir', default='results/', help='Output directory.')
parser.add_argument('--result_path', type=str, help='Output directory.')
parser.add_argument('--benchmark_tag', type=str, help='Single or dis benchmarks')
args = parser.parse_args()
args = parser.parse_args()
kwargs = vars(args)
kwargs = vars(args)
rec_file = args.rec_file
rec_file = args.rec_file
config = args.config
config = args.config
minq2 = int(args.minq2)
k = int(args.ebeam)
p = int(args.pbeam)
Nevents = int(args.nevents)
Nevents = int(args.nevents)
benchmark_tag = args.benchmark_tag
r_path = os.path.join(args.result_path, '/truth_reconstruction/')
r_path = dis_path = 'dis/%gon%g/minQ2=%g/truth_reconstruction/'
single_path = 'single/truth_reconstruction/'
if benchmark_tag == 'single':
r_path = single_path
for array in ur.iterate(rec_file + ':events',['MCParticles/MCParticles.generatorStatus',
for array in ur.iterate(rec_file + ':events',['MCParticles/MCParticles.generatorStatus',
'MCParticles/MCParticles.mass',
'MCParticles/MCParticles.mass',
@@ -226,8 +213,12 @@ for i in range(len(MC_list)):
@@ -226,8 +213,12 @@ for i in range(len(MC_list)):
ax4.set_title('Electrons')
ax4.set_title('Electrons')
ax5.set_title('Neutrons')
ax5.set_title('Neutrons')
ax6.set_title('Photons')
ax6.set_title('Photons')
ax5.set_xlabel('%s'%(title_list[i]))
if i == 1:
ax6.set_xlabel('%s'%(title_list[i]))
ax5.set_xlabel('- %s'%(title_list[i]))
 
ax6.set_xlabel('- %s'%(title_list[i]))
 
else:
 
ax5.set_xlabel('%s'%(title_list[i]))
 
ax6.set_xlabel('%s'%(title_list[i]))
fig.set_figwidth(20)
fig.set_figwidth(20)
fig.set_figheight(10)
fig.set_figheight(10)
ax1.set_title('%s %s %s %s events'%(title_list[i],tratio,config,Nevents))
ax1.set_title('%s %s %s %s events'%(title_list[i],tratio,config,Nevents))
@@ -347,8 +338,8 @@ ax1.set_ylabel('rc-mc')
@@ -347,8 +338,8 @@ ax1.set_ylabel('rc-mc')
ax2.set_ylabel('rc-mc')
ax2.set_ylabel('rc-mc')
ax3.set_ylabel('Phi mc')
ax3.set_ylabel('Phi mc')
ax4.set_ylabel('Phi rc')
ax4.set_ylabel('Phi rc')
ax3.set_xlabel('Theta mc')
ax3.set_xlabel('- Theta mc')
ax4.set_xlabel('Theta rc')
ax4.set_xlabel('- Theta rc')
fig.set_figwidth(20)
fig.set_figwidth(20)
fig.set_figheight(10)
fig.set_figheight(10)
Loading