Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-09 10:46:03

0001 """Per-event FSR photon multiplicity correlation between lAger samples.
0002 
0003 usage: fsr_corr.py REFERENCE.hepmc SEED1.hepmc SEED2.hepmc
0004 """
0005 import sys, numpy as np
0006 def ngam(path):
0007     out=[]; n=None
0008     for line in open(path):
0009         if line.startswith("E "):
0010             if n is not None: out.append(n)
0011             n=int(line.split()[3])
0012     out.append(n); return np.array(out)-9
0013 a,b,c=(ngam(p) for p in sys.argv[1:4])
0014 m=min(len(b),len(c))
0015 print("per-event FSR multiplicity sequence, seed1 vs seed2: identical in %.1f%% of events, corr=%.3f" % (100*np.mean(b[:m]==c[:m]), np.corrcoef(b[:m],c[:m])[0,1]))
0016 m=min(len(a),len(b))
0017 print("reference vs seed1: identical in %.1f%% of events, corr=%.3f" % (100*np.mean(a[:m]==b[:m]), np.corrcoef(a[:m],b[:m])[0,1]))