diff --git a/.gitignore b/.gitignore index ec2bfe8293d51f70a0d5a6eb53ae175511bec0a7..8fdeae7104dc3f3bc8bdc0586e2f8cab338df867 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,13 @@ __pycache__/ calorimeters/test/ *.d *.pcm + +# transient directories and files +setup +results +*.root +fieldmaps +eic-env.sh +sim_output +*.obj +*.hepmc diff --git a/benchmarks/ecal/options/barrel.py b/benchmarks/ecal/options/barrel.py index e2df5b3b0c7f8e76b8242b35744f3adb4a8558f1..870f6bf03b2ca7944f313e43f19a2c53e680a498 100644 --- a/benchmarks/ecal/options/barrel.py +++ b/benchmarks/ecal/options/barrel.py @@ -58,7 +58,7 @@ cb_ecal_digi = CalHitDigi("cb_ecal_digi", **cb_ecal_daq) cb_ecal_reco = ImCalPixelReco("cb_ecal_reco", - inputHitCollection="EcalBarrelHitsDigi", + inputHitCollection=cb_ecal_digi.outputHitCollection, outputHitCollection="EcalBarrelHitsReco", thresholdFactor=3, # about 20 keV readoutClass="EcalBarrelHits", # readout class @@ -67,8 +67,8 @@ cb_ecal_reco = ImCalPixelReco("cb_ecal_reco", **cb_ecal_daq) cb_ecal_cl = ImagingCluster("cb_ecal_cl", - inputHitCollection="EcalBarrelHitsReco", - outputHitCollection="EcalBarrelClusterHits", + inputHitCollection=cb_ecal_reco.outputHitCollection, + outputProtoClusterCollection="EcalBarrelProtoClusters", localDistXY=[2.*mm, 2*mm], # same layer layerDistEtaPhi=[10*mrad, 10*mrad], # adjacent layer neighbourLayersRange=2, # id diff for adjacent layer @@ -76,16 +76,17 @@ cb_ecal_cl = ImagingCluster("cb_ecal_cl", cb_ecal_clreco = ImagingClusterReco("cb_ecal_clreco", samplingFraction=cb_ecal_sf, - inputHitCollection="EcalBarrelClusterHits", + inputHitCollection=cb_ecal_cl.inputHitCollection, + inputProtoClusterCollection=cb_ecal_cl.outputProtoClusterCollection, outputClusterCollection="EcalBarrelClusters", - outputLayerCollection="EcalBarrelLayers") + outputLayerCollection="EcalBarrelLayers", + outputInfoCollection="EcalBarrelClustersInfo") podout.outputCommands = ['drop *', 'keep mcparticles2', 'keep *HitsReco', 'keep *HitsDigi', - 'keep *ClusterHits', - 'keep *Clusters'] + 'keep *Cluster*'] ApplicationMgr( TopAlg = [podin, copier, diff --git a/benchmarks/ecal/run_emcal_benchmarks.py b/benchmarks/ecal/run_emcal_benchmarks.py index f3ecf610cb4e26476fddb5de721bf97e12f2debe..2380e4045d515d14a72091c3b245d25a70976abd 100755 --- a/benchmarks/ecal/run_emcal_benchmarks.py +++ b/benchmarks/ecal/run_emcal_benchmarks.py @@ -15,19 +15,19 @@ import argparse default_type = { 'endcap_e': [ ['endcap_e.py'], - ['draw_cluters.py'], + ['draw_clusters.py'], ['EcalEndcapNClusters']], 'endcap_i': [ ['endcap_i.py'], - ['draw_cluters.py'], + ['draw_clusters.py'], ['EcalEndcapPClusters']], 'barrel': [ ['barrel.py'], - ['draw_cluters.py'], + ['draw_clusters.py'], ['EcalBarrelClusters']], # 'all': [ # ['all_ecal.py'], -# ['draw_cluters.py'], +# ['draw_clusters.py'], # ['EcalEndcapNClusters', 'EcalEndcapPClusters', 'EcalBarrelClusters']], } diff --git a/benchmarks/ecal/scripts/draw_cluters.py b/benchmarks/ecal/scripts/draw_clusters.py similarity index 92% rename from benchmarks/ecal/scripts/draw_cluters.py rename to benchmarks/ecal/scripts/draw_clusters.py index fd03f2dcca16e271e856c8d95c48653297a50ee0..f4c81896156bc4210422d957a4f4e37f201fdf4e 100644 --- a/benchmarks/ecal/scripts/draw_cluters.py +++ b/benchmarks/ecal/scripts/draw_clusters.py @@ -25,7 +25,8 @@ def load_root_macros(arg_macros): # read from RDataFrame and flatten a given collection, return pandas dataframe def flatten_collection(rdf, collection, cols=None): if not cols: - cols = [str(c) for c in rdf.GetColumnNames() if str(c).startswith('{}.'.format(collection))] + cols = [str(c) for c in rdf.GetColumnNames() if str(c).startswith('{}.'.format(collection))] + cols += [str(c) for c in rdf.GetColumnNames() if str(c).startswith('{}Info.'.format(collection))] else: cols = ['{}.{}'.format(collection, c) for c in cols] if not cols: @@ -92,10 +93,10 @@ if __name__ == '__main__': ] for coll in [c.strip() for c in args.coll.split(',')]: df = flatten_collection(rdf_rec, coll) - # calculate eta - df.loc[:, '{}.eta'.format(coll)] = -np.log(np.tan(df['{}.polar.theta'.format(coll)].values/2.)) + # Get eta from info table + df[coll + '.eta'] = df[coll + 'Info.eta'] fig, axs = plt.subplots(2, 2, figsize=(12, 8), dpi=160) - ncl = df.groupby('event')['{}.clusterID'.format(coll)].nunique().values + 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') axs[0][0].set_xlabel('Number of Clusters', fontsize=16)