Skip to content
Snippets Groups Projects
Commit b758f28c authored by Chao Peng's avatar Chao Peng
Browse files

Add EndcapCals

parent 94e5550c
No related branches found
No related tags found
1 merge request!109Add EndcapCals
...@@ -3,7 +3,7 @@ clustering:process : ...@@ -3,7 +3,7 @@ clustering:process :
stage: process stage: process
timeout: 8 hour timeout: 8 hour
script: 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: clustering:results:
extends: .rec_benchmark extends: .rec_benchmark
......
...@@ -11,7 +11,8 @@ detector_path = str(os.environ.get("DETECTOR_PATH", ".")) ...@@ -11,7 +11,8 @@ detector_path = str(os.environ.get("DETECTOR_PATH", "."))
compact_path = os.path.join(detector_path, detector_name) compact_path = os.path.join(detector_path, detector_name)
# get sampling fractions from system environment variable, 1.0 by default # 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)) cb_hcal_sf = float(os.environ.get("CB_HCAL_SAMP_FRAC", 1.0))
# input and output # input and output
...@@ -42,6 +43,7 @@ from Configurables import Jug__Reco__ImagingClusterReco as ImagingClusterReco ...@@ -42,6 +43,7 @@ from Configurables import Jug__Reco__ImagingClusterReco as ImagingClusterReco
sim_coll = [ sim_coll = [
"mcparticles", "mcparticles",
"CrystalEcalHits", "CrystalEcalHits",
"EcalEndcapHits",
"EcalBarrelHits", "EcalBarrelHits",
"HcalBarrelHits", "HcalBarrelHits",
] ]
...@@ -88,6 +90,46 @@ ce_ecal_clreco = RecoCoG("ce_ecal_clreco", ...@@ -88,6 +90,46 @@ ce_ecal_clreco = RecoCoG("ce_ecal_clreco",
logWeightBase=4.6) 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.) # Central Barrel Ecal (Imaging Cal.)
cb_ecal_digi = CalHitDigi("cb_ecal_digi", cb_ecal_digi = CalHitDigi("cb_ecal_digi",
inputHitCollection="EcalBarrelHits", inputHitCollection="EcalBarrelHits",
...@@ -116,7 +158,7 @@ cb_ecal_cl = ImagingCluster("cb_ecal_cl", ...@@ -116,7 +158,7 @@ cb_ecal_cl = ImagingCluster("cb_ecal_cl",
adjLayerDiff=2, # id diff for adjacent layer adjLayerDiff=2, # id diff for adjacent layer
adjSectorDist=3.*cm) # different sector adjSectorDist=3.*cm) # different sector
cb_ecal_clreco = ImagingClusterReco("cb_ecal_clreco", cb_ecal_clreco = ImagingClusterReco("cb_ecal_clreco",
samplingFraction=cb_hcal_sf, samplingFraction=cb_ecal_sf,
inputClusterCollection="EcalBarrelClusters", inputClusterCollection="EcalBarrelClusters",
outputLayerCollection="EcalBarrelLayers") outputLayerCollection="EcalBarrelLayers")
...@@ -141,10 +183,11 @@ cb_hcal_reco = CalHitReco("cb_hcal_reco", ...@@ -141,10 +183,11 @@ cb_hcal_reco = CalHitReco("cb_hcal_reco",
# merge hits in different layer (projection to local x-y plane) # merge hits in different layer (projection to local x-y plane)
cb_hcal_merger = CalHitsMerger("cb_hcal_merger", cb_hcal_merger = CalHitsMerger("cb_hcal_merger",
fields=["layer", "slice"], inputHitCollection="HcalBarrelHitsReco",
fieldRefNumbers=[1, 0], outputHitCollection="HcalBarrelHitsRecoXY",
inputHitCollection="HcalBarrelHitsReco", readoutClass="HcalBarrelHits",
outputHitCollection="HcalBarrelHitsRecoXY") fields=["layer", "slice"],
fieldRefNumbers=[1, 0])
cb_hcal_cl = IslandCluster("cb_hcal_cl", cb_hcal_cl = IslandCluster("cb_hcal_cl",
inputHitCollection="HcalBarrelHitsRecoXY", inputHitCollection="HcalBarrelHitsRecoXY",
...@@ -164,6 +207,7 @@ podout.outputCommands = ["keep *"] ...@@ -164,6 +207,7 @@ podout.outputCommands = ["keep *"]
ApplicationMgr( ApplicationMgr(
TopAlg = [podin, copier, TopAlg = [podin, copier,
ce_ecal_digi, ce_ecal_reco, ce_ecal_cl, ce_ecal_clreco, 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_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, cb_hcal_digi, cb_hcal_reco, cb_hcal_merger, cb_hcal_cl, cb_hcal_clreco,
podout], podout],
......
...@@ -74,7 +74,7 @@ def thrown_particles_figure(df, save): ...@@ -74,7 +74,7 @@ def thrown_particles_figure(df, save):
plt.close(fig) 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([ data = df.AsNumpy([
'{}.nhits'.format(collection), '{}.nhits'.format(collection),
'{}.energy'.format(collection), '{}.energy'.format(collection),
...@@ -92,6 +92,7 @@ def general_clusters_figure(df, collection, save, min_nhits=5): ...@@ -92,6 +92,7 @@ def general_clusters_figure(df, collection, save, min_nhits=5):
dfp.loc[:, 'evn'] = evns dfp.loc[:, 'evn'] = evns
# select the max. energy cluster for each event # select the max. energy cluster for each event
dfp = dfp.loc[dfp.groupby('evn')['edep'].idxmax()] dfp = dfp.loc[dfp.groupby('evn')['edep'].idxmax()]
dfp = dfp.loc[dfp['nhits'] >= min_nhits]
# figure # figure
fig, axs = plt.subplots(2, 2, figsize=(16, 12), dpi=120) fig, axs = plt.subplots(2, 2, figsize=(16, 12), dpi=120)
labels = [ labels = [
...@@ -138,7 +139,12 @@ if __name__ == '__main__': ...@@ -138,7 +139,12 @@ if __name__ == '__main__':
rdf = ROOT.RDataFrame('events', args.file) rdf = ROOT.RDataFrame('events', args.file)
thrown_particles_figure(rdf, save=os.path.join(args.outdir, 'thrown_particles.png')) 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='CrystalEcalClusters', min_nhits=5,
general_clusters_figure(rdf, collection='EcalBarrelClusters', save=os.path.join(args.outdir, 'ecal_barrel_clusters.png')) save=os.path.join(args.outdir, 'crystal_ecal_clusters.png'))
general_clusters_figure(rdf, collection='HcalBarrelClusters', save=os.path.join(args.outdir, 'hcal_barrel_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'))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment