Skip to content
Snippets Groups Projects
Commit 1647d08d authored by Jihee Kim's avatar Jihee Kim
Browse files

Resolve "Fix the cluster benchmark to use sampling fraction"

parent 08f89cc0
No related branches found
No related tags found
1 merge request!71Resolve "Fix the cluster benchmark to use sampling fraction"
...@@ -17,6 +17,10 @@ if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then ...@@ -17,6 +17,10 @@ if [[ ! -n "${JUGGLER_N_EVENTS}" ]] ; then
export JUGGLER_N_EVENTS=100 export JUGGLER_N_EVENTS=100
fi fi
if [[ ! -n "${CB_EMCAL_SAMP_FRAC}" ]] ; then
export CB_EMCAL_SAMP_FRAC=0.014
fi
export JUGGLER_FILE_NAME_TAG="barrel_clusters" export JUGGLER_FILE_NAME_TAG="barrel_clusters"
export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc" export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
......
...@@ -12,6 +12,11 @@ if "JUGGLER_DETECTOR" in os.environ : ...@@ -12,6 +12,11 @@ if "JUGGLER_DETECTOR" in os.environ :
if "JUGGLER_DETECTOR_PATH" in os.environ : if "JUGGLER_DETECTOR_PATH" in os.environ :
detector_name = str(os.environ["JUGGLER_DETECTOR_PATH"]) + "/" + detector_name detector_name = str(os.environ["JUGGLER_DETECTOR_PATH"]) + "/" + detector_name
# get sampling fraction from system environment variable, 1.0 by default
sf = 1.0
if "CB_EMCAL_SAMP_FRAC" in os.environ :
sf = str(os.environ["CB_EMCAL_SAMP_FRAC"])
# todo add checks # todo add checks
input_sim_file = str(os.environ["JUGGLER_SIM_FILE"]) input_sim_file = str(os.environ["JUGGLER_SIM_FILE"])
output_rec_file = str(os.environ["JUGGLER_REC_FILE"]) output_rec_file = str(os.environ["JUGGLER_REC_FILE"])
...@@ -70,6 +75,7 @@ ec_barrel_cluster = IslandCluster("ec_barrel_cluster", ...@@ -70,6 +75,7 @@ ec_barrel_cluster = IslandCluster("ec_barrel_cluster",
minClusterCenterEdep=1*units.MeV, minClusterCenterEdep=1*units.MeV,
groupRange=2.0, groupRange=2.0,
OutputLevel=DEBUG) OutputLevel=DEBUG)
crystal_ec_cluster = IslandCluster("crystal_ec_cluster", crystal_ec_cluster = IslandCluster("crystal_ec_cluster",
inputHitCollection="RecoEcalHits", inputHitCollection="RecoEcalHits",
outputClusterCollection="EcalClusters", outputClusterCollection="EcalClusters",
...@@ -82,8 +88,17 @@ simple_cluster = SimpleClustering("simple_cluster", ...@@ -82,8 +88,17 @@ simple_cluster = SimpleClustering("simple_cluster",
outputClusters="SimpleClusters", outputClusters="SimpleClusters",
OutputLevel=DEBUG) OutputLevel=DEBUG)
ec_barrel_clusterreco = RecoCoG("ec_barrel_clusterreco",
clusterCollection="EcalBarrelClusters",
logWeightBase=6.2,
samplingFraction=sf)
clusterreco = RecoCoG("cluster_reco", clusterCollection="EcalClusters", logWeightBase=4.2, moduleDimZName="CrystalBox_z_length",OutputLevel=DEBUG) clusterreco = RecoCoG("cluster_reco",
clusterCollection="EcalClusters",
logWeightBase=4.2,
moduleDimZName="CrystalBox_z_length",
samplingFraction=sf,
OutputLevel=DEBUG)
out = PodioOutput("out", filename=output_rec_file) out = PodioOutput("out", filename=output_rec_file)
...@@ -93,7 +108,7 @@ ApplicationMgr( ...@@ -93,7 +108,7 @@ ApplicationMgr(
TopAlg = [podioinput, copier, calcopier, TopAlg = [podioinput, copier, calcopier,
ecdigi, emcaldigi, ecdigi, emcaldigi,
crystal_ec_reco, ecal_reco, crystal_ec_reco, ecal_reco,
ec_barrel_cluster, crystal_ec_cluster, clusterreco, ec_barrel_cluster, crystal_ec_cluster, ec_barrel_clusterreco, clusterreco,
simple_cluster, simple_cluster,
out], out],
EvtSel = 'NONE', EvtSel = 'NONE',
......
...@@ -33,6 +33,11 @@ n_events = 100 ...@@ -33,6 +33,11 @@ n_events = 100
if "JUGGLER_N_EVENTS" in os.environ : if "JUGGLER_N_EVENTS" in os.environ :
n_events = str(os.environ["JUGGLER_N_EVENTS"]) n_events = str(os.environ["JUGGLER_N_EVENTS"])
# get sampling fraction from system environment variable, 1.0 by default
sf = 1.0
if "CB_EMCAL_SAMP_FRAC" in os.environ :
sf = str(os.environ["CB_EMCAL_SAMP_FRAC"])
geo_service = GeoSvc("GeoSvc", detectors=["{}.xml".format(detector_name)]) geo_service = GeoSvc("GeoSvc", detectors=["{}.xml".format(detector_name)])
podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=DEBUG) podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=DEBUG)
...@@ -99,7 +104,8 @@ embarrelcluster = IslandCluster("ecal_barrel_cluster", ...@@ -99,7 +104,8 @@ embarrelcluster = IslandCluster("ecal_barrel_cluster",
# Reconstruct the cluster with Center of Gravity method # Reconstruct the cluster with Center of Gravity method
embarrelclusterreco = RecoCoG("ecal_barrel_clusterreco", embarrelclusterreco = RecoCoG("ecal_barrel_clusterreco",
clusterCollection="EcalBarrelClusters", clusterCollection="EcalBarrelClusters",
logWeightBase=6.2) logWeightBase=6.2,
samplingFraction=sf)
out = PodioOutput("out", filename=output_rec_file) out = PodioOutput("out", filename=output_rec_file)
......
...@@ -25,6 +25,10 @@ if [[ ! -n "${E_end}" ]] ; then ...@@ -25,6 +25,10 @@ if [[ ! -n "${E_end}" ]] ; then
export E_end=5.0 export E_end=5.0
fi fi
if [[ ! -n "${CB_EMCAL_SAMP_FRAC}" ]] ; then
export CB_EMCAL_SAMP_FRAC=0.014
fi
export JUGGLER_FILE_NAME_TAG="emcal_barrel_uniform_electrons" export JUGGLER_FILE_NAME_TAG="emcal_barrel_uniform_electrons"
export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc" export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
......
...@@ -25,6 +25,10 @@ if [[ ! -n "${E_end}" ]] ; then ...@@ -25,6 +25,10 @@ if [[ ! -n "${E_end}" ]] ; then
export E_end=5.0 export E_end=5.0
fi fi
if [[ ! -n "${CB_EMCAL_SAMP_FRAC}" ]] ; then
export CB_EMCAL_SAMP_FRAC=0.01
fi
export JUGGLER_FILE_NAME_TAG="emcal_barrel_uniform_pions" export JUGGLER_FILE_NAME_TAG="emcal_barrel_uniform_pions"
export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc" export JUGGLER_GEN_FILE="${JUGGLER_FILE_NAME_TAG}.hepmc"
......
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