diff --git a/src/docs/part3/running_juggler.md b/src/docs/part3/running_juggler.md index 0fa93e8e2e2c0628d5a12a8350683a19b8b8ba49..dfab78f3208b6b9dd5d73413e1d4be03453983f9 100644 --- a/src/docs/part3/running_juggler.md +++ b/src/docs/part3/running_juggler.md @@ -4,6 +4,67 @@ Juggler is a Gaudi based event processing framework which uses the [eicd](https://eic.phy.anl.gov/eicd) data model. +### Algorithms -## +Algorithms are implemented as C++ in the [juggler repository](https://eicweb.phy.anl.gov/eic/juggler). + +### Options file + +The set of algorithms, their input data, and output data are assembled in so-called "options" files (typically in an `options` directory). +These are actually python that is interpreted by the `gaudirun.py` program. +Once compiled and install as part of juggler, the algorithms can be imported into juggler. + + +``` +from Gaudi.Configuration import * +from GaudiKernel.DataObjectHandleBase import DataObjectHandleBase +from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc +from GaudiKernel import SystemOfUnits as units +from Configurables import Jug__Digi__EMCalorimeterDigi as EMCalorimeterDigi + +podioinput = PodioInput("PodioReader", + collections=["mcparticles","EcalBarrelHits"]) + +ecal_digi = EMCalorimeterDigi("ecal_digi", + inputHitCollection="EcalBarrelHits", + outputHitCollection="RawEcalBarrelHits") + + +ecal_reco = EMCalReconstruction("ecal_reco", + inputHitCollection="RawEcalBarrelHits", + outputHitCollection="RecEcalBarrelHits", + minModuleEdep=0.0*units.MeV) + +out = PodioOutput("out", filename=output_rec_file) +out.outputCommands = ["keep *", + "drop BarrelTrackSourceLinks", + "drop InitTrackParams", + "drop trajectories", + "drop outputSourceLinks", + "drop outputInitialTrackParameters", + "drop mcparticles" + ] + +ApplicationMgr( + TopAlg = [podioinput, ecal_digi, ecal_reco, out], + EvtSel = 'NONE', + EvtMax = 10, + ExtSvc = [podioevent,geo_service], + OutputLevel=DEBUG + ) + +``` + + +### Executing Juggler + +If using the container-installed juggler algorithms you can run the reconstruction with: +``` + gaudirun.py options/demo_reco.py +``` +When adding your own algorithm and installed into a custom location, you will need do the following: + +``` + xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py options/demo_reco.py +```