From 8ea43dc0f90348d1694b325127959dfb0b033e82 Mon Sep 17 00:00:00 2001
From: Dave Casper <dcasper@localhost.localdomain>
Date: Sat, 25 Jan 2020 16:29:19 -0800
Subject: [PATCH] Document and clean-up

---
 Control/CalypsoExample/GeoModelTest/README.md | 19 +++++++++++++
 Simulation/G4Faser/G4FaserApp/test/runG4.py   |  1 -
 .../FaserSCT_Digitization/README.md           | 27 +++++++++++++++++++
 .../test/FaserSCT_DigitizationDbg.py          |  3 +--
 4 files changed, 47 insertions(+), 3 deletions(-)
 create mode 100644 Control/CalypsoExample/GeoModelTest/README.md
 create mode 100644 Tracker/TrackerDigitization/FaserSCT_Digitization/README.md

diff --git a/Control/CalypsoExample/GeoModelTest/README.md b/Control/CalypsoExample/GeoModelTest/README.md
new file mode 100644
index 00000000..b05f0c34
--- /dev/null
+++ b/Control/CalypsoExample/GeoModelTest/README.md
@@ -0,0 +1,19 @@
+This example package actually serves several purposes:
+
+*) It illustrates how to initialize and access the detector description and magnetic field.
+*) It checks that the expected number of detector elements are created.
+*) It generates a set of neutral alignment constants for the Tracker, which can be folded into the conditions database.
+*) It dumps a standalone GeoModel sqlite geometry database which could be used by external programs to display FASER without requiring any FASER software (only GeoModel)
+
+To run the algorithm, in a run directory where Calypso has been installed, do
+
+run > ./setup.sh
+run > python python/GeoModelTest/GeoModelTestConfig.py
+
+The file GeoModelTestConfig.py can be edited to change some run options.
+
+After running the algorithm, to add the alignment data into your local conditions DB, do:
+
+run > CopyAlignFolder.sh
+
+
diff --git a/Simulation/G4Faser/G4FaserApp/test/runG4.py b/Simulation/G4Faser/G4FaserApp/test/runG4.py
index 83f7b8ea..1b4a8c17 100644
--- a/Simulation/G4Faser/G4FaserApp/test/runG4.py
+++ b/Simulation/G4Faser/G4FaserApp/test/runG4.py
@@ -129,7 +129,6 @@ if __name__ == "__main__":
     acc.merge(veto)
     acc.merge(sct)
     acc.addService(G4GeometryNotifierSvcCfg(ConfigFlags, ActivateLVNotifier=True))
-    acc.getService("PoolSvc").SortReplicas = False # protects against random failures to find sqlite file
 
 #
 # Verbosity
diff --git a/Tracker/TrackerDigitization/FaserSCT_Digitization/README.md b/Tracker/TrackerDigitization/FaserSCT_Digitization/README.md
new file mode 100644
index 00000000..4b8569c2
--- /dev/null
+++ b/Tracker/TrackerDigitization/FaserSCT_Digitization/README.md
@@ -0,0 +1,27 @@
+This package will translate Geant4 hits (HITS) into RawDataObject (RDO) data files.
+
+Because input data and alignment is needed, there are a few steps to prepare. From a run directory where calypso is installed, do:
+
+*) run > ./setup.sh
+
+This sets up the runtime environment after building. The "." is mandatory.
+
+*) run > runG4.py >& runG4.log
+
+This will create a HITS file.
+
+*) run > python python/GeoModelTest/GeoModelTestConfig.py
+
+This will generate a set of neutral alignment data
+
+*) run > CopyAlignFolder.sh
+
+This will merge the alignment data into the conditions DB.
+
+All the above steps need only be done once after building calypso (but the second and third steps must be repeated each time you do "make install").
+
+Now you can run digitization on the HITS file you generated with the command:
+
+run > FaserSCT_DigitizationDbg.py >& digi.log
+
+This will read your g4.HITS.root generate an RDO data file with digitized raw data objects.
diff --git a/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py b/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py
index 4aeedcfc..666ff440 100644
--- a/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py
+++ b/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py
@@ -65,12 +65,11 @@ acc.foreach_component("*").OutputLevel = VERBOSE
 acc.foreach_component("*ClassID*").OutputLevel = INFO
 acc.getCondAlgo("FaserSCT_AlignCondAlg").OutputLevel = VERBOSE
 acc.getCondAlgo("FaserSCT_DetectorElementCondAlg").OutputLevel = VERBOSE
-acc.getService("PoolSvc").SortReplicas = False
 acc.getService("StoreGateSvc").Dump = True
 acc.getService("ConditionStore").Dump = True
 acc.printConfig(withDetails=True)
 ConfigFlags.dump()
 # Execute and finish
-sc = acc.run(maxEvents=5)
+sc = acc.run(maxEvents=-1)
 # Success should be 0
 sys.exit(not sc.isSuccess())
-- 
GitLab