Skip to content
Snippets Groups Projects
Commit 108444fc authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Update benchmarks for new EICD

parent 5827fdc8
Branches
Tags
1 merge request!151Update eicd
This commit is part of merge request !151. Comments created here will be created in the context of that merge request.
......@@ -41,3 +41,13 @@ __pycache__/
calorimeters/test/
*.d
*.pcm
# transient directories and files
setup
results
*.root
fieldmaps
eic-env.sh
sim_output
*.obj
*.hepmc
......@@ -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,
......
......@@ -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']],
}
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment