Skip to content
Snippets Groups Projects

modify clustering to use the latest components

Merged Chao Peng requested to merge update_clustering into master
2 files
+ 137
66
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -4,7 +4,7 @@ import ROOT
from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase
from Configurables import ApplicationMgr, EICDataSvc, PodioInput, PodioOutput, GeoSvc
from GaudiKernel.SystemOfUnits import MeV, GeV, cm
from GaudiKernel.SystemOfUnits import MeV, GeV, mm, cm, mrad
detector_name = str(os.environ.get("JUGGLER_DETECTOR", "athena"))
detector_path = str(os.environ.get("DETECTOR_PATH", "."))
@@ -15,14 +15,14 @@ cb_ecal_sf = float(os.environ.get("CB_EMCAL_SAMP_FRAC", 1.0))
cb_hcal_sf = float(os.environ.get("CB_HCAL_SAMP_FRAC", 1.0))
# input and output
input_sims = [f.strip() for f in str.split(os.environ["JUGGLER_SIM_FILE"], ",") if f.strip()]
output_rec = str(os.environ["JUGGLER_REC_FILE"])
n_events = int(os.environ["JUGGLER_N_EVENTS"])
input_sims = [f.strip() for f in str.split(os.environ["FULL_CAL_SIM_FILE"], ",") if f.strip()]
output_rec = str(os.environ["FULL_CAL_REC_FILE"])
n_events = int(os.environ["FULL_CAL_NUMEV"])
# geometry service
geo_service = GeoSvc("GeoSvc", detectors=["{}.xml".format(detector_name)])
geo_service = GeoSvc("GeoSvc", detectors=["{}.xml".format(compact_path)])
# data service
podioevent = EICDataSvc("EventDataSvc", inputs=[input_sims])
podioevent = EICDataSvc("EventDataSvc", inputs=input_sims)
# juggler components
@@ -48,11 +48,11 @@ sim_coll = [
# input and output
podin = PodioInput("PodioReader", collections=sim_coll)
podout = PodioOutput("out", filename=output_rec_file)
podout = PodioOutput("out", filename=output_rec)
# copier needed to get around input --> output copy bug. So truth (mcparticles) can be saved in output file
copier = MCCopier("MCCopier", inputCollection="mcparticles", outputCollection="mcparticles2")
# Crystal Endcap Ecal
ce_ecal_digi = CalHitDigi("ce_ecal_digi",
inputHitCollection="CrystalEcalHits",
@@ -77,8 +77,9 @@ ce_ecal_cl = IslandCluster("ce_ecal_cl",
# OutputLevel=DEBUG,
inputHitCollection="CrystalEcalHitsReco",
outputClusterCollection="CrystalEcalClusters",
splitHitCollection="CrystalEcalHitsSplit",
splitCluster=False,
minClusterCenterEdep=30*units.MeV,
minClusterCenterEdep=30*MeV,
groupRanges=[2.2*cm, 2.2*cm])
ce_ecal_clreco = RecoCoG("ce_ecal_clreco",
@@ -86,7 +87,7 @@ ce_ecal_clreco = RecoCoG("ce_ecal_clreco",
logWeightBase=4.6)
# central barrel Ecal
# Central Barrel Ecal (Imaging Cal.)
cb_ecal_digi = CalHitDigi("cb_ecal_digi",
inputHitCollection="EcalBarrelHits",
outputHitCollection="EcalBarrelHitsDigi",
@@ -95,7 +96,7 @@ cb_ecal_digi = CalHitDigi("cb_ecal_digi",
capacityADC=8192,
pedestalMean=400,
pedestalSigma=20) # about 6 keV
cb_ecal_reco = ImaCalPixelReco("cb_ecal_reco",
cb_ecal_reco = ImCalPixelReco("cb_ecal_reco",
inputHitCollection="EcalBarrelHitsDigi",
outputHitCollection="EcalBarrelHitsReco",
dynamicRangeADC=3.*MeV,
@@ -109,15 +110,16 @@ cb_ecal_reco = ImaCalPixelReco("cb_ecal_reco",
cb_ecal_cl = ImagingCluster("cb_ecal_cl",
inputHitCollection="EcalBarrelHitsReco",
outputClusterCollection="EcalBarrelClusters",
localRanges=[2.*units.mm, 2*units.mm], # same layer
adjLayerRanges=[10*units.mrad, 10*units.mrad], # adjacent layer
adjLayerDiff=2, # id diff for adjacent layer
adjSectorDist=3.*units.cm) # different sector
localRanges=[2.*mm, 2*mm], # same layer
adjLayerRanges=[10*mrad, 10*mrad], # adjacent layer
adjLayerDiff=2, # id diff for adjacent layer
adjSectorDist=3.*cm) # different sector
cb_ecal_clreco = ImagingClusterReco("cb_ecal_clreco",
inputClusterCollection="EcalBarrelClusters",
outputLayerCollection="EcalBarrelLayers")
# central barrel hcal
# Central Barrel Hcal
cb_hcal_digi = CalHitDigi("cb_hcal_digi",
inputHitCollection="HcalBarrelHits",
outputHitCollection="HcalBarrelHitsDigi",
@@ -145,25 +147,24 @@ cb_hcal_merger = CalHitsMerger("cb_hcal_merger",
cb_hcal_cl = IslandCluster("cb_hcal_cl",
inputHitCollection="HcalBarrelHitsRecoXY",
outputClusterCollection="HcalBarrelClusters",
splitHitCollection="HcalBarrelHitsSplit",
splitCluster=False,
minClusterCenterEdep=30.*MeV,
groupRanges=[15.*cm, 15.*cm],
OutputLevel=DEBUG)
groupRanges=[15.*cm, 15.*cm])
cb_hcal_clreco = RecoCoG("cb_hcal_clreco",
clusterCollection="HcalBarrelClusters",
logWeightBase=6.2,
samplingFraction=cb_hcal_sf,
OutputLevel=DEBUG)
samplingFraction=cb_hcal_sf)
out.outputCommands = ["keep *"]
podout.outputCommands = ["keep *"]
ApplicationMgr(
TopAlg = [podioinput, copier,
TopAlg = [podin, copier,
ce_ecal_digi, ce_ecal_reco, ce_ecal_cl, ce_ecal_clreco,
cb_ecal_digi, cb_ecal_reco, cb_ecal_cl, cb_ecal_clreco,
cb_hcal_digi, cb_hcal_reco, cb_hcal_cl, cb_hcal_clreco,
out],
cb_hcal_digi, cb_hcal_reco, cb_hcal_merger, cb_hcal_cl, cb_hcal_clreco,
podout],
EvtSel = 'NONE',
EvtMax = n_events,
ExtSvc = [podioevent],
Loading