diff --git a/benchmarks/ecal/options/barrel.py b/benchmarks/ecal/options/barrel.py index ae58419b03bf7da3110b16cfcdbf6c80fa09cd89..c2915cd3dd524eb7d9a4b9a1d0a9b45c67078050 100644 --- a/benchmarks/ecal/options/barrel.py +++ b/benchmarks/ecal/options/barrel.py @@ -52,6 +52,7 @@ from Configurables import Jug__Reco__CalorimeterIslandCluster as IslandCluster from Configurables import Jug__Reco__ImagingPixelReco as ImCalPixelReco from Configurables import Jug__Reco__ImagingTopoCluster as ImagingCluster from Configurables import Jug__Reco__ImagingClusterReco as ImagingClusterReco +from Configurables import Jug__Reco__ClusterRecoCoG as RecoCoG # branches needed from simulation root file sim_coll = [ @@ -108,12 +109,10 @@ if has_ecal_barrel_scfi: ) # different sector algorithms.append(cb_ecal_cl) - cb_ecal_clreco = ImagingClusterReco( + cb_ecal_clreco = RecoCoG( "cb_ecal_clreco", - inputProtoClusters=cb_ecal_cl.outputProtoClusterCollection, - outputClusters="EcalBarrelImagingClusters", - outputLayers="EcalBarrelImagingLayers", - mcHits="EcalBarrelHits", + inputProtoClusterCollection=cb_ecal_cl.outputProtoClusterCollection, + outputClusterCollection="EcalBarrelImagingClusters", ) algorithms.append(cb_ecal_clreco) @@ -155,15 +154,24 @@ else: ) algorithms.append(sciglass_ecal_cl) - sciglass_ecal_clreco = ImagingClusterReco( + sciglass_ecal_clreco = RecoCoG( "sciglass_ecal_clreco", - inputProtoClusters=sciglass_ecal_cl.outputProtoClusterCollection, - mcHits="EcalBarrelHits", - outputClusters="EcalBarrelClusters", - outputLayers="EcalBarrelLayers", + inputProtoClusterCollection=sciglass_ecal_cl.outputProtoClusterCollection, + # mcHits="EcalBarrelHits", + outputClusterCollection="EcalBarrelClusters", + #OutputLevel=DEBUG ) algorithms.append(sciglass_ecal_clreco) + # sciglass_barrel_clreco = RecoCoG( + # "sciglass_barrel_clreco", + # inputProtoClusterCollection=sciglass_ecal_cl.outputProtoClusterCollection, + # outputClusterCollection="EcalBarrelScFiClusters", + # logWeightBase=6.2, + # ) + # algorithms.append(sciglass_barrel_clreco) + + podout.outputCommands = [ "drop *", "keep MCParticles", diff --git a/benchmarks/ecal/run_emcal_benchmarks.py b/benchmarks/ecal/run_emcal_benchmarks.py index 24a277f5d701caf6f5cf93ec239387a27b5eb533..b0c27a4fa640b2005cd578c15fba83985a5704c9 100755 --- a/benchmarks/ecal/run_emcal_benchmarks.py +++ b/benchmarks/ecal/run_emcal_benchmarks.py @@ -25,6 +25,11 @@ default_type = { ['barrel.py'], ['draw_clusters.py'], ['EcalBarrelImagingClusters']], + 'barrel_sciglass': [ + ['barrel.py'], + ['draw_clusters.py'], + ['EcalBarrelClusters']], + # 'all': [ # ['all_ecal.py'], # ['draw_clusters.py'], diff --git a/benchmarks/ecal/scripts/draw_clusters.py b/benchmarks/ecal/scripts/draw_clusters.py index 74c7fe228ba540e35118fc1f4ff11e3e892488bc..0f9f72793a42ad1fa89aad582d884ea5d741f33d 100644 --- a/benchmarks/ecal/scripts/draw_clusters.py +++ b/benchmarks/ecal/scripts/draw_clusters.py @@ -58,7 +58,9 @@ if __name__ == '__main__': parser.add_argument('--collections', dest='coll', default='', help='Collection names for clusters, separated by \",\"') args = parser.parse_args() - + + #rec_file='home/vaibhavi/eic/benchmarks/reconstruction_benchmarks/rec_barrel_electron_5.0_5.0.root' + # multi-threading for RDataFrame nthreads = os.cpu_count()//2 ROOT.ROOT.EnableImplicitMT(nthreads) @@ -69,6 +71,7 @@ if __name__ == '__main__': load_root_macros(args.macros) rdf_rec = ROOT.RDataFrame('events', args.rec_file) + #rdf_rec = ROOT.RDataFrame('events', rec_file) if not args.coll: print('No collection names provided, no plots generated.') @@ -88,14 +91,17 @@ if __name__ == '__main__': plots = [ ('nhits', 'Number of Hits', 50), ('energy', 'Energy (GeV)', 50), - ('eta', '$\eta$', 50), + #('eta', '$\eta$', 50), ] for coll in [c.strip() for c in args.coll.split(',')]: df = flatten_collection(rdf_rec, coll) fig, axs = plt.subplots(2, 2, figsize=(12, 8), dpi=160) - ncl = df.groupby('event')['{}.ID.value'.format(coll)].nunique().values - axs[0][0].hist(ncl, weights=np.repeat(1./float(ncl.shape[0]), ncl.shape[0]), - bins=np.arange(0, 10), align='mid', ec='k') + #ncl = df.groupby('event')['{}.ID.value'.format(coll)].nunique().values + #axs[0][0].hist(ncl, weights=np.repeat(1./float(ncl.shape[0]), ncl.shape[0]), + #bins=np.arange(0, 10), align='mid', ec='k') + ncl = df.groupby('event')['event'].count() + axs[0][0].hist(ncl, weights=np.repeat(1./float(ncl.count()), ncl.count()), + bins=np.arange(0, 10), align='mid', ec='k') axs[0][0].set_xlabel('Number of Clusters', fontsize=16) for ax, (branch, xlabel, bins) in zip(axs.flat[1:], plots):