From 56ad9ae3af7f7d13ccafb39ad35de346e35c1123 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Sun, 13 Oct 2024 02:22:41 -0400 Subject: [PATCH] Delete benchmarks/femc_photon/analysis/femc_photon_plots.py~ --- .../analysis/femc_photon_plots.py~ | 171 ------------------ 1 file changed, 171 deletions(-) delete mode 100644 benchmarks/femc_photon/analysis/femc_photon_plots.py~ diff --git a/benchmarks/femc_photon/analysis/femc_photon_plots.py~ b/benchmarks/femc_photon/analysis/femc_photon_plots.py~ deleted file mode 100644 index 4227b4e..0000000 --- a/benchmarks/femc_photon/analysis/femc_photon_plots.py~ +++ /dev/null @@ -1,171 +0,0 @@ -import numpy as np, pandas as pd, matplotlib.pyplot as plt, matplotlib as mpl, awkward as ak, sys, uproot as ur -import mplhep as hep -hep.style.use("CMS") - -plt.rcParams['figure.facecolor']='white' -plt.rcParams['savefig.facecolor']='white' -plt.rcParams['savefig.bbox']='tight' - -plt.rcParams["figure.figsize"] = (7, 7) - -config=sys.argv[1].split("/")[1] #results/{config}/{benchmark_name} -outdir=sys.argv[1]+"/" -try: - import os - os.mkdir(outdir[:-1]) -except: - pass - -import uproot as ur -arrays_sim={p:ur.open(f'sim_output/femc_photon/epic_craterlake_rec_e-_{p}GeV.edm4hep.root:events').arrays() for p in (20, 30, 40, 50, 60,70,80)} - -for p in arrays_sim: - array=arrays_sim[p] - tilt=-.025 - px=array['MCParticles.momentum.x'][:,2] - py=array['MCParticles.momentum.y'][:,2] - pz=array['MCParticles.momentum.z'][:,2] - p=np.sqrt(px**2+py**2+pz**2) - - pxp=px*np.cos(tilt)-pz*np.sin(tilt) - pyp=py - pzp=pz*np.cos(tilt)+px*np.sin(tilt) - - array['eta_truth']=1/2*np.log((p+pzp)/(p-pzp)) - array['nclust_endcap']=[len(array['EcalEndcapPClusters.energy'][i]) for i in range(len(array))] - -for array in arrays_sim.values(): - tilt=-0.025 - px=array['MCParticles.momentum.x'][:,2] - py=array['MCParticles.momentum.y'][:,2] - pz=array['MCParticles.momentum.z'][:,2] - p=np.sqrt(px**2+py**2+pz**2) - - pxp=px*np.cos(tilt)-pz*np.sin(tilt) - pyp=py - pzp=pz*np.cos(tilt)+px*np.sin(tilt) - - array['eta_truth']=1/2*np.log((p+pzp)/(p-pzp)) - array['phi_truth']=np.arctan2(pyp,pxp) - -#number of clusters -plt.figure() -for eta_min, eta_max, field in (1.5, 2.8, 'nclust_endcap'),: - for p in arrays_sim: - array=arrays_sim[p] - plt.hist(array[field][(array['eta_truth']>eta_min)&(array['eta_truth']