From 8709797d2cb00b71a56eb57d677c8bb7e180e46a Mon Sep 17 00:00:00 2001
From: lintao <lintao51@gmail.com>
Date: Tue, 20 Dec 2022 11:14:13 +0800
Subject: [PATCH] add the script.

---
 Examples/options/dump_simhit.py | 62 +++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 Examples/options/dump_simhit.py

diff --git a/Examples/options/dump_simhit.py b/Examples/options/dump_simhit.py
new file mode 100644
index 00000000..1c699b7a
--- /dev/null
+++ b/Examples/options/dump_simhit.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+
+from Gaudi.Configuration import *
+
+##############################################################################
+# Geometry Svc
+##############################################################################
+
+# geometry_option = "CepC_v4-onlyTracker.xml"
+# geometry_option = "CepC_v4-onlyVXD.xml"
+geometry_option = "CepC_v4.xml"
+
+if not os.getenv("DETCEPCV4ROOT"):
+    print("Can't find the geometry. Please setup envvar DETCEPCV4ROOT." )
+    sys.exit(-1)
+
+geometry_path = os.path.join(os.getenv("DETCEPCV4ROOT"), "compact", geometry_option)
+if not os.path.exists(geometry_path):
+    print("Can't find the compact geometry file: %s"%geometry_path)
+    sys.exit(-1)
+
+from Configurables import GeomSvc
+geosvc = GeomSvc("GeomSvc")
+geosvc.compact = geometry_path
+
+##############################################################################
+# Event Data Svc
+##############################################################################
+
+from Configurables import k4DataSvc
+dsvc = k4DataSvc("EventDataSvc", input="test-detsim10.root")
+
+##############################################################################
+# NTuple Svc
+##############################################################################
+
+from Configurables import NTupleSvc
+ntsvc = NTupleSvc("NTupleSvc")
+ntsvc.Output = ["MyTuples DATAFILE='result.root' OPT='NEW' TYP='ROOT'"]
+
+##############################################################################
+# DumpAlg
+##############################################################################
+
+from Configurables import DumpSimHitAlg
+alg = DumpSimHitAlg("DumpSimHitAlg")
+
+from Configurables import PodioInput
+podioinput = PodioInput("PodioReader", collections=[
+        "MCParticle",
+        "VXDCollection"
+    ])
+
+# ApplicationMgr
+from Configurables import ApplicationMgr
+ApplicationMgr( TopAlg = [podioinput, alg],
+                EvtSel = 'NONE',
+                EvtMax = -1,
+                ExtSvc = [dsvc, ntsvc],
+                HistogramPersistency = "ROOT",
+                # OutputLevel=DEBUG
+)
-- 
GitLab