From abde7a09994fad7d795fb7248cd2d2e6eabf85b0 Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Mon, 12 Jul 2021 20:59:45 -0500
Subject: [PATCH] 	modified:   part3/running_juggler.md

---
 src/docs/part3/running_juggler.md | 63 ++++++++++++++++++++++++++++++-
 1 file changed, 62 insertions(+), 1 deletion(-)

diff --git a/src/docs/part3/running_juggler.md b/src/docs/part3/running_juggler.md
index 0fa93e8..dfab78f 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
+```
 
-- 
GitLab