diff --git a/benchmarks/clustering/config.yml b/benchmarks/clustering/config.yml index 0a244d41cbcfc724c30f44e1691fbc8895261d1e..14a5d3e1d28f70ea93dda8a42f58a8af1d7f6cc0 100644 --- a/benchmarks/clustering/config.yml +++ b/benchmarks/clustering/config.yml @@ -3,7 +3,7 @@ clustering:process : stage: process timeout: 8 hour script: - - bash benchmarks/clustering/full_cal_clusters.sh -t fullcalo -n 1000 -p "pion-" --pmin 5 --pmax 5 + - bash benchmarks/clustering/full_cal_clusters.sh -t fullcalo -n 1000 -p "electron" --pmin 5 --pmax 5 clustering:results: extends: .rec_benchmark diff --git a/benchmarks/clustering/options/full_cal_clustering.py b/benchmarks/clustering/options/full_cal_clustering.py index c7dcf39407b9749e28fb1d2e3cfb4cf03cf99137..ed736e8e8be3cbc6047a206613256d2880968299 100644 --- a/benchmarks/clustering/options/full_cal_clustering.py +++ b/benchmarks/clustering/options/full_cal_clustering.py @@ -11,7 +11,8 @@ detector_path = str(os.environ.get("DETECTOR_PATH", ".")) compact_path = os.path.join(detector_path, detector_name) # get sampling fractions from system environment variable, 1.0 by default -cb_ecal_sf = float(os.environ.get("CB_EMCAL_SAMP_FRAC", 0.01324)) +ce_ecal_sf = float(os.environ.get("CE_ECAL_SAMP_FRAC", 0.253)) +cb_ecal_sf = float(os.environ.get("CB_ECAL_SAMP_FRAC", 0.01324)) cb_hcal_sf = float(os.environ.get("CB_HCAL_SAMP_FRAC", 1.0)) # input and output @@ -42,6 +43,7 @@ from Configurables import Jug__Reco__ImagingClusterReco as ImagingClusterReco sim_coll = [ "mcparticles", "CrystalEcalHits", + "EcalEndcapHits", "EcalBarrelHits", "HcalBarrelHits", ] @@ -88,6 +90,46 @@ ce_ecal_clreco = RecoCoG("ce_ecal_clreco", logWeightBase=4.6) +# Endcap Sampling Ecal +ce_ecal2_digi = CalHitDigi("ce_ecal2_digi", + inputHitCollection="EcalEndcapHits", + outputHitCollection="EcalEndcapHitsDigi", + dynamicRangeADC=50.*MeV, + capacityADC=32768, + pedestalMean=400, + pedestalSigma=10) + +ce_ecal2_reco = CalHitReco("ce_ecal2_reco", + inputHitCollection="EcalEndcapHitsDigi", + outputHitCollection="EcalEndcapHitsReco", + dynamicRangeADC=50.*MeV, + capacityADC=32768, + pedestalMean=400, + pedestalSigma=10, + thresholdFactor=5.0) + +# merge hits in different layer (projection to local x-y plane) +ce_ecal2_merger = CalHitsMerger("ce_ecal2_merger", + inputHitCollection="EcalEndcapHitsReco", + outputHitCollection="EcalEndcapHitsRecoXY", + fields=["layer", "slice"], + fieldRefNumbers=[1, 0], + readoutClass="EcalEndcapHits") + +ce_ecal2_cl = IslandCluster("ce_ecal2_cl", + inputHitCollection="EcalEndcapHitsRecoXY", + outputClusterCollection="EcalEndcapClusters", + splitHitCollection="EcalEndcapHitsSplit", + splitCluster=False, + minClusterCenterEdep=30.*MeV, + groupRanges=[5*mm, 5*mm]) + +ce_ecal2_clreco = RecoCoG("ce_ecal2_clreco", + clusterCollection="EcalEndcapClusters", + logWeightBase=6.2, + samplingFraction=ce_ecal_sf) + + # Central Barrel Ecal (Imaging Cal.) cb_ecal_digi = CalHitDigi("cb_ecal_digi", inputHitCollection="EcalBarrelHits", @@ -116,7 +158,7 @@ cb_ecal_cl = ImagingCluster("cb_ecal_cl", adjLayerDiff=2, # id diff for adjacent layer adjSectorDist=3.*cm) # different sector cb_ecal_clreco = ImagingClusterReco("cb_ecal_clreco", - samplingFraction=cb_hcal_sf, + samplingFraction=cb_ecal_sf, inputClusterCollection="EcalBarrelClusters", outputLayerCollection="EcalBarrelLayers") @@ -141,10 +183,11 @@ cb_hcal_reco = CalHitReco("cb_hcal_reco", # merge hits in different layer (projection to local x-y plane) cb_hcal_merger = CalHitsMerger("cb_hcal_merger", - fields=["layer", "slice"], - fieldRefNumbers=[1, 0], - inputHitCollection="HcalBarrelHitsReco", - outputHitCollection="HcalBarrelHitsRecoXY") + inputHitCollection="HcalBarrelHitsReco", + outputHitCollection="HcalBarrelHitsRecoXY", + readoutClass="HcalBarrelHits", + fields=["layer", "slice"], + fieldRefNumbers=[1, 0]) cb_hcal_cl = IslandCluster("cb_hcal_cl", inputHitCollection="HcalBarrelHitsRecoXY", @@ -164,6 +207,7 @@ podout.outputCommands = ["keep *"] ApplicationMgr( TopAlg = [podin, copier, ce_ecal_digi, ce_ecal_reco, ce_ecal_cl, ce_ecal_clreco, + ce_ecal2_digi, ce_ecal2_reco, ce_ecal2_merger, ce_ecal2_cl, ce_ecal2_clreco, cb_ecal_digi, cb_ecal_reco, cb_ecal_cl, cb_ecal_clreco, cb_hcal_digi, cb_hcal_reco, cb_hcal_merger, cb_hcal_cl, cb_hcal_clreco, podout], diff --git a/benchmarks/clustering/scripts/cluster_plots.py b/benchmarks/clustering/scripts/cluster_plots.py index 6b17413fb0d85fae2a1afb2395c701c699925036..71c596712e028d6ab08bb19b4094d64a1468c61d 100644 --- a/benchmarks/clustering/scripts/cluster_plots.py +++ b/benchmarks/clustering/scripts/cluster_plots.py @@ -74,7 +74,7 @@ def thrown_particles_figure(df, save): plt.close(fig) -def general_clusters_figure(df, collection, save, min_nhits=5): +def general_clusters_figure(df, collection, save, min_nhits=3): data = df.AsNumpy([ '{}.nhits'.format(collection), '{}.energy'.format(collection), @@ -92,6 +92,7 @@ def general_clusters_figure(df, collection, save, min_nhits=5): dfp.loc[:, 'evn'] = evns # select the max. energy cluster for each event dfp = dfp.loc[dfp.groupby('evn')['edep'].idxmax()] + dfp = dfp.loc[dfp['nhits'] >= min_nhits] # figure fig, axs = plt.subplots(2, 2, figsize=(16, 12), dpi=120) labels = [ @@ -138,7 +139,12 @@ if __name__ == '__main__': rdf = ROOT.RDataFrame('events', args.file) thrown_particles_figure(rdf, save=os.path.join(args.outdir, 'thrown_particles.png')) - general_clusters_figure(rdf, collection='CrystalEcalClusters', save=os.path.join(args.outdir, 'crystal_ecal_clusters.png')) - general_clusters_figure(rdf, collection='EcalBarrelClusters', save=os.path.join(args.outdir, 'ecal_barrel_clusters.png')) - general_clusters_figure(rdf, collection='HcalBarrelClusters', save=os.path.join(args.outdir, 'hcal_barrel_clusters.png')) + general_clusters_figure(rdf, collection='CrystalEcalClusters', min_nhits=5, + save=os.path.join(args.outdir, 'crystal_ecal_clusters.png')) + general_clusters_figure(rdf, collection='EcalEndcapClusters', min_nhits=10, + save=os.path.join(args.outdir, 'ecal_endcap_clusters.png')) + general_clusters_figure(rdf, collection='EcalBarrelClusters', + save=os.path.join(args.outdir, 'ecal_barrel_clusters.png')) + general_clusters_figure(rdf, collection='HcalBarrelClusters', + save=os.path.join(args.outdir, 'hcal_barrel_clusters.png'))