diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ecb74acc18f776b41661d858ea908d9ad3a25e12..3224176e1c3e62ddbf01fc12805e22d1dfb0e36e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,7 +60,7 @@ include: - local: 'benchmarks/tracking/config.yml' - local: 'benchmarks/clustering/config.yml' - local: 'benchmarks/rich/config.yml' - - local: 'benchmarks/sampling_ecal/config.yml' + - local: 'benchmarks/imaging_ecal/config.yml' final_report: diff --git a/benchmarks/sampling_ecal/config.yml b/benchmarks/imaging_ecal/config.yml similarity index 64% rename from benchmarks/sampling_ecal/config.yml rename to benchmarks/imaging_ecal/config.yml index 011be71932e53dfb60b41745e9fa2fc5c826c571..69aba14e064c75361e1479249eae6d4ac675fdb8 100644 --- a/benchmarks/sampling_ecal/config.yml +++ b/benchmarks/imaging_ecal/config.yml @@ -1,4 +1,4 @@ -sampling_ecal_electrons: +imaging_ecal_electrons: image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:$JUGGLER_TAG needs: ["common:detector"] timeout: 48 hours @@ -8,10 +8,10 @@ sampling_ecal_electrons: - results/ stage: run script: - - bash benchmarks/sampling_ecal/run_emcal_barrel.sh -t emcal_barrel_electrons -p "electron" -n 1000 + - bash benchmarks/imaging_ecal/run_emcal_barrel.sh -t emcal_barrel_electrons -p "electron" -n 1000 allow_failure: true -sampling_ecal_photons: +imaging_ecal_photons: image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:$JUGGLER_TAG needs: ["common:detector"] timeout: 48 hours @@ -21,10 +21,10 @@ sampling_ecal_photons: - results/ stage: run script: - - bash benchmarks/sampling_ecal/run_emcal_barrel.sh -t emcal_barrel_photons -p "photon" -n 1000 + - bash benchmarks/imaging_ecal/run_emcal_barrel.sh -t emcal_barrel_photons -p "photon" -n 1000 allow_failure: true -sampling_ecal_pions: +imaging_ecal_pions: image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:$JUGGLER_TAG needs: ["common:detector"] timeout: 48 hours @@ -34,6 +34,6 @@ sampling_ecal_pions: - results/ stage: run script: - - bash benchmarks/sampling_ecal/run_emcal_barrel.sh -t emcal_barrel_pions -p "pion-" -n 1000 + - bash benchmarks/imaging_ecal/run_emcal_barrel.sh -t emcal_barrel_pions -p "pion-" -n 1000 allow_failure: true diff --git a/benchmarks/imaging_ecal/options/imaging_topocluster.py b/benchmarks/imaging_ecal/options/imaging_topocluster.py new file mode 100644 index 0000000000000000000000000000000000000000..dde4426aacd0b685ff9f8b74626dfbb0e8744e92 --- /dev/null +++ b/benchmarks/imaging_ecal/options/imaging_topocluster.py @@ -0,0 +1,87 @@ +import os +import ROOT +from Gaudi.Configuration import * +from GaudiKernel import SystemOfUnits as units + +from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase +from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc + +from Configurables import PodioInput +from Configurables import Jug__Base__InputCopier_dd4pod__Geant4ParticleCollection_dd4pod__Geant4ParticleCollection_ as MCCopier +from Configurables import Jug__Base__InputCopier_dd4pod__CalorimeterHitCollection_dd4pod__CalorimeterHitCollection_ as CalCopier +from Configurables import Jug__Digi__CalorimeterHitDigi as CalorimeterHitDigi +from Configurables import Jug__Reco__ImagingPixelReco as ImagingPixelReco +from Configurables import Jug__Reco__ImagingTopoCluster as ImagingTopoCluster +from Configurables import Jug__Reco__ImagingClusterReco as ImagingClusterReco + + +# input arguments through environment variables +kwargs = dict() +kwargs['sf'] = float(os.environ.get('CB_EMCAL_SAMP_FRAC', '1.0')) +kwargs['input'] = os.environ.get('CB_EMCAL_SIM_FILE', '../topside/barrel_pion0_5GeV.root') +kwargs['output'] = os.environ.get('CB_EMCAL_REC_FILE', 'barrel_pion0_5GeV_cluster.root') +kwargs['compact'] = os.environ.get('CB_EMCAL_COMPACT_PATH', '../topside/test.xml') +kwargs['nev'] = int(os.environ.get('CB_EMCAL_NUMEV', 10000)) + +if kwargs['nev'] < 1: + f = ROOT.TFile(kwargs['input']) + kwargs['nev'] = f.events.GetEntries() + +print(kwargs) + +# get sampling fraction from system environment variable, 1.0 by default +sf = float(os.environ.get('CB_EMCAL_SAMP_FRAC', '1.0')) + +geo_service = GeoSvc("GeoSvc", detectors=kwargs['compact'].split(',')) +podioevent = EICDataSvc("EventDataSvc", inputs=kwargs['input'].split(','), OutputLevel=DEBUG) +out = PodioOutput("out", filename=kwargs['output']) + +podioinput = PodioInput("PodioReader", collections=["mcparticles", "EcalBarrelHits"], OutputLevel=DEBUG) + +copier = MCCopier("MCCopier", + inputCollection="mcparticles", + outputCollection="mcparticles2", + OutputLevel=DEBUG) +calcopier = CalCopier("CalCopier", + inputCollection="EcalBarrelHits", + outputCollection="EcalBarrelHits2", + OutputLevel=DEBUG) + +imcaldigi = CalorimeterHitDigi("imcal_digi", + inputHitCollection="EcalBarrelHits", + outputHitCollection="DigiEcalBarrelHits", + inputEnergyUnit=units.GeV, + inputTimeUnit=units.ns, + energyResolutions=[0., 0.02, 0.], + dynamicRangeADC=3*units.MeV, + pedestalSigma=40, + OutputLevel=DEBUG) +imcalreco = ImagingPixelReco("imcal_reco", + inputHitCollection="DigiEcalBarrelHits", + outputHitCollection="RecoEcalBarrelHits", + dynamicRangeADC=3.*units.MeV, + pedestalSigma=40, + readoutClass="EcalBarrelHits", + layerField="layer", + sectorField="module") +imcalcluster = ImagingTopoCluster(inputHitCollection="RecoEcalBarrelHits", + outputClusterCollection="EcalBarrelClusters", + localRanges=[2.*units.mm, 2*units.mm], + adjLayerRanges=[10*units.mrad, 10*units.mrad], + adjLayerDiff=2, + adjSectorDist=3.*units.cm) +clusterreco = ImagingClusterReco(inputClusterCollection="EcalBarrelClusters", + outputLayerCollection="EcalBarrelClustersLayers", + samplingFraction=sf, + OutputLevel=DEBUG) + +out.outputCommands = ["keep *"] + +ApplicationMgr( + TopAlg=[podioinput, copier, calcopier, imcaldigi, imcalreco, imcalcluster, clusterreco, out], + EvtSel='NONE', + EvtMax=kwargs['nev'], + ExtSvc=[podioevent], + OutputLevel=DEBUG +) + diff --git a/benchmarks/sampling_ecal/requirements.txt b/benchmarks/imaging_ecal/requirements.txt similarity index 100% rename from benchmarks/sampling_ecal/requirements.txt rename to benchmarks/imaging_ecal/requirements.txt diff --git a/benchmarks/sampling_ecal/run_emcal_barrel.sh b/benchmarks/imaging_ecal/run_emcal_barrel.sh similarity index 88% rename from benchmarks/sampling_ecal/run_emcal_barrel.sh rename to benchmarks/imaging_ecal/run_emcal_barrel.sh index 6e719c9f600905781480737e63f6777d7d46c581..4157142e2acb7d7b88dd5d6ea97082b3d5825c4b 100644 --- a/benchmarks/sampling_ecal/run_emcal_barrel.sh +++ b/benchmarks/imaging_ecal/run_emcal_barrel.sh @@ -37,7 +37,7 @@ echo "CB_EMCAL_NUMEV = ${CB_EMCAL_NUMEV}" echo "CB_EMCAL_COMPACT_PATH = ${CB_EMCAL_COMPACT_PATH}" # Generate the input events -python benchmarks/sampling_ecal/scripts/gen_particles.py ${CB_EMCAL_GEN_FILE} -n ${CB_EMCAL_NUMEV}\ +python benchmarks/imaging_ecal/scripts/gen_particles.py ${CB_EMCAL_GEN_FILE} -n ${CB_EMCAL_NUMEV}\ --angmin 60 --angmax 120 --parray ${CB_EMCAL_ENERGY} --particles="${particle}" if [[ "$?" -ne "0" ]] ; then echo "ERROR running script: generating input events" @@ -65,20 +65,20 @@ rootls -t "${CB_EMCAL_SIM_FILE}" mkdir -p results # CB_EMCAL_OPTION_DIR=${JUGGLER_INSTALL_PREFIX}/Examples/options -# CB_EMCAL_SCRIPT_DIR=${JUGGLER_INSTALL_PREFIX}/Examples/scripts/sampling_calorimeter -CB_EMCAL_OPTION_DIR=benchmarks/sampling_ecal/options -CB_EMCAL_SCRIPT_DIR=benchmarks/sampling_ecal/scripts +# CB_EMCAL_SCRIPT_DIR=${JUGGLER_INSTALL_PREFIX}/Examples/scripts/imaging_calorimeter +CB_EMCAL_OPTION_DIR=benchmarks/imaging_ecal/options +CB_EMCAL_SCRIPT_DIR=benchmarks/imaging_ecal/scripts # Run Juggler -xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py ${CB_EMCAL_OPTION_DIR}/sampling_cluster3d.py -# gaudirun.py ${CB_EMCAL_OPTION_DIR}/sampling_cluster3d.py +xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py ${CB_EMCAL_OPTION_DIR}/imaging_topocluster.py +# gaudirun.py ${CB_EMCAL_OPTION_DIR}/imaging_topocluster.py if [[ "$?" -ne "0" ]] ; then echo "ERROR running juggler" exit 1 fi # check required python modules -python -m pip install -r benchmarks/sampling_ecal/requirements.txt +python -m pip install -r benchmarks/imaging_ecal/requirements.txt IFS=',' read -ra ADDR <<< "$CB_EMCAL_IEV" for iev in "${ADDR[@]}"; do diff --git a/benchmarks/sampling_ecal/scripts/draw_cluster.py b/benchmarks/imaging_ecal/scripts/draw_cluster.py similarity index 98% rename from benchmarks/sampling_ecal/scripts/draw_cluster.py rename to benchmarks/imaging_ecal/scripts/draw_cluster.py index 5b6c93bd21a06f409df8c2e067007cff3b8619e2..315f689174d497801b285500cad1cf2b249f3faa 100644 --- a/benchmarks/sampling_ecal/scripts/draw_cluster.py +++ b/benchmarks/imaging_ecal/scripts/draw_cluster.py @@ -95,13 +95,13 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description='Visualize the cluster from analysis') parser.add_argument('file', type=str, help='path to root file') parser.add_argument('-e', type=int, default=0, dest='iev', help='event number to plot') - parser.add_argument('-c', type=int, default=0, dest='icl', help='cluster number to plot') + parser.add_argument('-c', type=int, default=0, dest='icl', help='cluster number to plot (0: all, -1: no cluster)') parser.add_argument('-s', type=int, default=8, dest='stop', help='stop layer for track fit') parser.add_argument('-o', type=str, default='./plots', dest='outdir', help='output directory') parser.add_argument('--compact', type=str, default='', dest='compact', help='compact file') parser.add_argument('-m', '--macros', type=str, default='rootlogon.C', dest='macros', help='root macros to load (accept multiple paths separated by \",\")') - parser.add_argument('-b', '--branch-name', type=str, default='EcalBarrelClustersLayers', dest='branch', + parser.add_argument('-b', '--branch-name', type=str, default='RecoEcalBarrelHits', dest='branch', help='branch name in the root file (outputLayerCollection from ImagingClusterReco)') parser.add_argument('--topo-size', type=float, default=2.0, dest='topo_size', help='bin size for projection plot (mrad)') @@ -132,7 +132,8 @@ if __name__ == '__main__': # read data load_root_macros(args.macros) df = get_hits_data(args.file, args.iev, branch=args.branch) - df = df[df['cluster'] == args.icl] + if args.icl != 0: + df = df[df['cluster'] == args.icl] if not len(df): print("Error: do not find any hits for cluster {:d} in event {:d}".format(args.icl, args.iev)) exit(-1) diff --git a/benchmarks/sampling_ecal/scripts/draw_cluster_layers.py b/benchmarks/imaging_ecal/scripts/draw_cluster_layers.py similarity index 98% rename from benchmarks/sampling_ecal/scripts/draw_cluster_layers.py rename to benchmarks/imaging_ecal/scripts/draw_cluster_layers.py index 18ce1c2a84d3ef1fdfbb9120d4b768956f2c398a..fa4a96c4a028e8ce67a34e86bfba679bd1a6560e 100644 --- a/benchmarks/sampling_ecal/scripts/draw_cluster_layers.py +++ b/benchmarks/imaging_ecal/scripts/draw_cluster_layers.py @@ -50,14 +50,14 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description='Visualize the cluster (layer-wise) from analysis') parser.add_argument('file', type=str, help='path to root file') parser.add_argument('-e', type=int, default=0, dest='iev', help='event number to plot') - parser.add_argument('-c', type=int, default=0, dest='icl', help='cluster number to plot') + parser.add_argument('-c', type=int, default=0, dest='icl', help='cluster number to plot (0: all, -1: no cluster)') parser.add_argument('-s', type=int, default=8, dest='stop', help='stop layer for track fit') parser.add_argument('-o', type=str, default='./plots', dest='outdir', help='output directory') parser.add_argument('-d', type=float, default=1.0, dest='dura', help='duration of gif') parser.add_argument('--compact', type=str, default='', dest='compact', help='compact file') parser.add_argument('-m', '--macros', type=str, default='rootlogon.C', dest='macros', help='root macros to load (accept multiple paths separated by \",\")') - parser.add_argument('-b', '--branch-name', type=str, default='EcalBarrelClustersLayers', dest='branch', + parser.add_argument('-b', '--branch-name', type=str, default='RecoEcalBarrelHits', dest='branch', help='branch name in the root file (outputLayerCollection from ImagingClusterReco)') parser.add_argument('--topo-size', type=float, default=2.0, dest='topo_size', help='bin size for projection plot (mrad)') @@ -86,7 +86,8 @@ if __name__ == '__main__': # read data load_root_macros(args.macros) df = get_hits_data(args.file, args.iev, args.branch) - df = df[df['cluster'] == args.icl] + if args.icl != 0: + df = df[df['cluster'] == args.icl] if not len(df): print("Error: do not find any hits for cluster {:d} in event {:d}".format(args.icl, args.iev)) exit(-1) diff --git a/benchmarks/sampling_ecal/scripts/energy_profile.py b/benchmarks/imaging_ecal/scripts/energy_profile.py similarity index 100% rename from benchmarks/sampling_ecal/scripts/energy_profile.py rename to benchmarks/imaging_ecal/scripts/energy_profile.py diff --git a/benchmarks/sampling_ecal/scripts/epi_separation.py b/benchmarks/imaging_ecal/scripts/epi_separation.py similarity index 100% rename from benchmarks/sampling_ecal/scripts/epi_separation.py rename to benchmarks/imaging_ecal/scripts/epi_separation.py diff --git a/benchmarks/sampling_ecal/scripts/gen_particles.py b/benchmarks/imaging_ecal/scripts/gen_particles.py similarity index 100% rename from benchmarks/sampling_ecal/scripts/gen_particles.py rename to benchmarks/imaging_ecal/scripts/gen_particles.py diff --git a/benchmarks/sampling_ecal/scripts/utils.py b/benchmarks/imaging_ecal/scripts/utils.py similarity index 94% rename from benchmarks/sampling_ecal/scripts/utils.py rename to benchmarks/imaging_ecal/scripts/utils.py index a1e31a807064f5e464f9a652e9cd414f1c27a60f..ff8e368829eef58aa89e9585de3c05535a8e4ae0 100644 --- a/benchmarks/sampling_ecal/scripts/utils.py +++ b/benchmarks/imaging_ecal/scripts/utils.py @@ -56,8 +56,32 @@ def get_mcp_data(path, evnums=None, branch='mcparticles2'): return pd.DataFrame(data=dbuf[:idb], columns=['event', 'px', 'py', 'pz', 'pid', 'status']) +# read mc particles from root file +def get_mcp_simple(path, evnums=None, branch='mcparticles2'): + f = ROOT.TFile(path) + events = f.events + if evnums is None: + evnums = np.arange(events.GetEntries()) + elif isinstance(evnums, int): + evnums = [evnums] + + dbuf = np.zeros(shape=(len(evnums), 6)) + idb = 0 + for iev in evnums: + if iev >= events.GetEntries(): + print('Error: event {:d} is out of range (0 - {:d})'.format(iev, events.GetEntries() - 1)) + continue + + events.GetEntry(iev) + # extract full mc particle data + part = getattr(events, branch)[2] + dbuf[idb] = (iev, part.psx, part.psy, part.psz, part.pdgID, part.status) + idb += 1 + return pd.DataFrame(data=dbuf[:idb], columns=['event', 'px', 'py', 'pz', 'pid', 'status']) + + # read hits data from root file -def get_hits_data(path, evnums=None, branch='EcalBarrelClustersLayers'): +def get_hits_data(path, evnums=None, branch='RecoEcalBarrelHits'): f = ROOT.TFile(path) events = f.events if evnums is None: @@ -73,11 +97,9 @@ def get_hits_data(path, evnums=None, branch='EcalBarrelClustersLayers'): continue events.GetEntry(iev) - for layer in getattr(events, branch): - for k, hit in enumerate(layer.hits): - if k < layer.nhits: - dbuf[idb] = (iev, layer.clusterID, layer.layerID, hit.x, hit.y, hit.z, hit.E) - idb += 1 + for hit in getattr(events, branch): + dbuf[idb] = (iev, hit.clusterID, hit.layerID, hit.position.x, hit.position.y, hit.position.z, hit.edep) + idb += 1 return pd.DataFrame(data=dbuf[:idb], columns=['event', 'cluster', 'layer', 'x', 'y', 'z', 'edep']) @@ -107,22 +129,6 @@ def get_layers_data(path, evnums=None, branch="EcalBarrelClustersLayers"): return pd.DataFrame(data=dbuf[:idb], columns=['event', 'cluster', 'layer', 'x', 'y', 'z', 'edep']) -def compact_constants(path, names): - if not os.path.exists(path): - print('Cannot find compact file \"{}\".'.format(path)) - return [] - kernel = DDG4.Kernel() - description = kernel.detectorDescription() - kernel.loadGeometry("file:{}".format(path)) - try: - vals = [description.constantAsDouble(n) for n in names] - except: - print('Fail to extract values from {}, return empty.'.format(names)) - vals = [] - kernel.terminate() - return vals - - # read clusters data from root file def get_clusters_data(path, evnums=None, branch='EcalBarrelClustersReco'): f = ROOT.TFile(path) @@ -147,28 +153,20 @@ def get_clusters_data(path, evnums=None, branch='EcalBarrelClustersReco'): return pd.DataFrame(data=dbuf[:idb], columns=['event', 'cluster', 'nhits', 'edep', 'cl_theta', 'cl_phi']) -# read mc particles from root file -def get_mcp_simple(path, evnums=None, branch='mcparticles2'): - f = ROOT.TFile(path) - events = f.events - if evnums is None: - evnums = np.arange(events.GetEntries()) - elif isinstance(evnums, int): - evnums = [evnums] - - dbuf = np.zeros(shape=(len(evnums), 6)) - idb = 0 - for iev in evnums: - if iev >= events.GetEntries(): - print('Error: event {:d} is out of range (0 - {:d})'.format(iev, events.GetEntries() - 1)) - continue - - events.GetEntry(iev) - # extract full mc particle data - part = getattr(events, branch)[2] - dbuf[idb] = (iev, part.psx, part.psy, part.psz, part.pdgID, part.status) - idb += 1 - return pd.DataFrame(data=dbuf[:idb], columns=['event', 'px', 'py', 'pz', 'pid', 'status']) +def compact_constants(path, names): + if not os.path.exists(path): + print('Cannot find compact file \"{}\".'.format(path)) + return [] + kernel = DDG4.Kernel() + description = kernel.detectorDescription() + kernel.loadGeometry("file:{}".format(path)) + try: + vals = [description.constantAsDouble(n) for n in names] + except: + print('Fail to extract values from {}, return empty.'.format(names)) + vals = [] + kernel.terminate() + return vals diff --git a/benchmarks/sampling_ecal/options/sampling_cluster3d.py b/benchmarks/sampling_ecal/options/sampling_cluster3d.py deleted file mode 100644 index ae202681ffeacb2ddc4f7deccb592735b7b9793d..0000000000000000000000000000000000000000 --- a/benchmarks/sampling_ecal/options/sampling_cluster3d.py +++ /dev/null @@ -1,88 +0,0 @@ -import os -import ROOT -from Gaudi.Configuration import * -from GaudiKernel import SystemOfUnits as units - -from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase -from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc - -from Configurables import PodioInput -from Configurables import Jug__Base__InputCopier_dd4pod__Geant4ParticleCollection_dd4pod__Geant4ParticleCollection_ as MCCopier -from Configurables import Jug__Base__InputCopier_dd4pod__CalorimeterHitCollection_dd4pod__CalorimeterHitCollection_ as CalCopier -from Configurables import Jug__Digi__EcalTungstenSamplingDigi as EcalTungstenSamplingDigi -from Configurables import Jug__Reco__EcalTungstenSamplingReco as EcalTungstenSamplingReco -from Configurables import Jug__Reco__TopologicalCellCluster as TopologicalCellCluster -from Configurables import Jug__Reco__ImagingClusterReco as ImagingReco - - -# input arguments through environment variables -kwargs = dict() -kwargs['sf'] = float(os.environ.get('CB_EMCAL_SAMP_FRAC', '1.0')) -kwargs['input'] = os.environ.get('CB_EMCAL_SIM_FILE', '../topside/barrel_pion0_5GeV.root') -kwargs['output'] = os.environ.get('CB_EMCAL_REC_FILE', 'barrel_pion0_5GeV_cluster.root') -kwargs['compact'] = os.environ.get('CB_EMCAL_COMPACT_PATH', '../topside/test.xml') -kwargs['nev'] = int(os.environ.get('CB_EMCAL_NUMEV', 10000)) - -if kwargs['nev'] < 1: - f = ROOT.TFile(kwargs['input']) - kwargs['nev'] = f.events.GetEntries() - -# get sampling fraction from system environment variable, 1.0 by default -sf = float(os.environ.get('CB_EMCAL_SAMP_FRAC', '1.0')) - -geo_service = GeoSvc("GeoSvc", detectors=kwargs['compact'].split(',')) -podioevent = EICDataSvc("EventDataSvc", inputs=kwargs['input'].split(','), OutputLevel=DEBUG) -out = PodioOutput("out", filename=kwargs['output']) - -podioinput = PodioInput("PodioReader", collections=["mcparticles", "EcalBarrelHits"], OutputLevel=DEBUG) - -copier = MCCopier("MCCopier", - inputCollection="mcparticles", - outputCollection="mcparticles2", - OutputLevel=DEBUG) -calcopier = CalCopier("CalCopier", - inputCollection="EcalBarrelHits", - outputCollection="EcalBarrelHits2", - OutputLevel=DEBUG) - -emcaldigi = EcalTungstenSamplingDigi("ecal_digi", - inputHitCollection="EcalBarrelHits", - outputHitCollection="DigiEcalBarrelHits", - inputEnergyUnit=units.GeV, - inputTimeUnit=units.ns, - energyResolutions=[0., 0.02, 0.], - dynamicRangeADC=3*units.MeV, - pedestalSigma=40, - OutputLevel=DEBUG) -emcalreco = EcalTungstenSamplingReco("ecal_reco", - inputHitCollection="DigiEcalBarrelHits", - outputHitCollection="RecoEcalBarrelHits", - dynamicRangeADC=3.*units.MeV, - pedestalSigma=40, - OutputLevel=DEBUG) -emcalcluster = TopologicalCellCluster(inputHitCollection="RecoEcalBarrelHits", - outputClusterCollection="EcalBarrelClusters", - minClusterCenterEdep=0.3*units.MeV, - localRanges=[2.*units.mm, 2*units.mm], - adjLayerRanges=[5*units.mrad, 5*units.mrad], - adjLayerDiff=1, - adjSectorDist=1*units.cm, - layerField="layer", - sectorField="module") -clusterreco = ImagingReco(inputClusterCollection="EcalBarrelClusters", - outputClusterCollection="EcalBarrelClustersReco", - outputLayerCollection="EcalBarrelClustersLayers", - samplingFraction=sf, - layerIDMaskRange=[15, 24], - OutputLevel=DEBUG) - -out.outputCommands = ["keep *"] - -ApplicationMgr( - TopAlg=[podioinput, copier, calcopier, emcaldigi, emcalreco, emcalcluster, clusterreco, out], - EvtSel='NONE', - EvtMax=kwargs['nev'], - ExtSvc=[podioevent], - OutputLevel=DEBUG -) -