From f2467c40390b4363d918d3bdde8ef9aacf25d197 Mon Sep 17 00:00:00 2001
From: Markus Frank <Markus.Frank@cern.ch>
Date: Fri, 28 Oct 2022 20:19:46 +0200
Subject: [PATCH] Reduce top users of test time by simulating less events

---
 examples/CLICSiD/CMakeLists.txt            | 4 ++--
 examples/CLICSiD/scripts/CLICSiDAClick.C   | 4 +++-
 examples/CLICSiD/scripts/CLICSiDXML.C      | 4 +++-
 examples/LHeD/CMakeLists.txt               | 4 ++--
 examples/LHeD/scripts/LHeDACLick.C         | 4 +++-
 examples/LHeD/scripts/LHeDXML.C            | 3 +++
 examples/OpticalTracker/scripts/richsim.py | 2 +-
 7 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/examples/CLICSiD/CMakeLists.txt b/examples/CLICSiD/CMakeLists.txt
index 11d89bc07..f147b2bc6 100644
--- a/examples/CLICSiD/CMakeLists.txt
+++ b/examples/CLICSiD/CMakeLists.txt
@@ -170,14 +170,14 @@ if (DD4HEP_USE_GEANT4)
     dd4hep_add_test_reg( CLICSiD_DDG4_${script}_as_AClick_LONGTEST
       COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh"
       EXEC_ARGS  root.exe -b -x -n -q -l "${DD4hep_ROOT}/examples/DDG4/examples/run.C(\"${CLICSiDEx_INSTALL}/scripts/${script}\")"
-      REGEX_PASS "UserEvent_1      INFO  Geant4TestEventAction> calling end.event_id=9"
+      REGEX_PASS "UserEvent_1      INFO  Geant4TestEventAction> calling end.event_id=2"
       REGEX_FAIL "EXCEPTION;ERROR;Error" )
     #
     # Execute identical source linked executable 
     dd4hep_add_test_reg( CLICSiD_DDG4_${script}_as_exe_LONGTEST
       COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_CLICSiD.sh"
       EXEC_ARGS  ${script}
-      REGEX_PASS "UserEvent_1      INFO  Geant4TestEventAction> calling end.event_id=9"
+      REGEX_PASS "UserEvent_1      INFO  Geant4TestEventAction> calling end.event_id=2"
       REGEX_FAIL "EXCEPTION;ERROR;Error" )
   endforeach(script)
   #
diff --git a/examples/CLICSiD/scripts/CLICSiDAClick.C b/examples/CLICSiD/scripts/CLICSiDAClick.C
index d1a522409..1bc18b259 100644
--- a/examples/CLICSiD/scripts/CLICSiDAClick.C
+++ b/examples/CLICSiD/scripts/CLICSiDAClick.C
@@ -56,7 +56,6 @@ int setupG4_CINT(bool interactive)  {
   kernel.loadGeometry(("file:"+det_dir+"/DDDetectors/compact/SiD.xml").c_str());
   kernel.loadXML(("file:"+install_dir+"/examples/CLICSiD/sim/field.xml").c_str());
 
-  kernel.property("NumEvents") = 10;
   if ( interactive )   {
     kernel.property("UI") = "UI";
     setPrintLevel(DEBUG);
@@ -67,6 +66,9 @@ int setupG4_CINT(bool interactive)  {
     ui["SessionType"] = "csh";
     kernel.registerGlobalAction(ui);
   }
+  else  {
+    kernel.property("NumEvents") = 3;
+  }
 
   GenAction gun(kernel,"Geant4ParticleGun/Gun");
   gun["energy"]       = 10*CLHEP::GeV;
diff --git a/examples/CLICSiD/scripts/CLICSiDXML.C b/examples/CLICSiD/scripts/CLICSiDXML.C
index d61d5b4ff..6952e2c27 100644
--- a/examples/CLICSiD/scripts/CLICSiDXML.C
+++ b/examples/CLICSiD/scripts/CLICSiDXML.C
@@ -40,10 +40,12 @@ int setupG4_XML(bool interactive)  {
   kernel.loadXML((prefix+"CLICSiD/sim/field.xml").c_str());
   kernel.loadXML((prefix+"CLICSiD/sim/sequences.xml").c_str());
   kernel.loadXML((prefix+"CLICSiD/sim/physics.xml").c_str());
-  kernel.property("NumEvents") = 10;
   if ( interactive )  {
     kernel.property("UI") = "UI";
   }
+  else   {
+    kernel.property("NumEvents") = 3;
+  }
   kernel.configure();
   kernel.initialize();
   kernel.run();
diff --git a/examples/LHeD/CMakeLists.txt b/examples/LHeD/CMakeLists.txt
index e30e22997..609c8fb93 100644
--- a/examples/LHeD/CMakeLists.txt
+++ b/examples/LHeD/CMakeLists.txt
@@ -107,7 +107,7 @@ if (DD4HEP_USE_GEANT4)
     dd4hep_add_test_reg( LHeD_DDG4_${script}_as_ACLick_LONGTEST
       COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh"
       EXEC_ARGS  root.exe -b -x -n -q -l "${LHeDEx_INSTALL}/scripts/run.C(\"${LHeDEx_INSTALL}/scripts/${script}\")"
-      REGEX_PASS "UserEvent_1      INFO  Geant4TestEventAction> calling end.event_id=9"
+      REGEX_PASS "UserEvent_1      INFO  Geant4TestEventAction> calling end.event_id=2"
       REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" )
     set_property(TEST t_LHeD_DDG4_${script}_as_ACLick_LONGTEST PROPERTY RESOURCE_LOCK "INIT_ACLICK")
     #
@@ -115,7 +115,7 @@ if (DD4HEP_USE_GEANT4)
     dd4hep_add_test_reg( LHeD_DDG4_${script}_as_exe_LONGTEST
       COMMAND    "${CMAKE_INSTALL_PREFIX}/bin/run_test_LHeD.sh"
       EXEC_ARGS  ${script}
-      REGEX_PASS "UserEvent_1      INFO  Geant4TestEventAction> calling end.event_id=9"
+      REGEX_PASS "UserEvent_1      INFO  Geant4TestEventAction> calling end.event_id=2"
       REGEX_FAIL "Exception;EXCEPTION;ERROR;Error" )
   endforeach(script)
 endif()
diff --git a/examples/LHeD/scripts/LHeDACLick.C b/examples/LHeD/scripts/LHeDACLick.C
index c85d3f2b0..d9d203f32 100644
--- a/examples/LHeD/scripts/LHeDACLick.C
+++ b/examples/LHeD/scripts/LHeDACLick.C
@@ -59,7 +59,9 @@ int setupG4_CINT(bool interactive)  {
     ui["SessionType"] = "csh";
     kernel.registerGlobalAction(ui);
   }
-
+  else   {
+    kernel.property("NumEvents") = 3;
+  }
   GenAction gun(kernel,"Geant4ParticleGun/Gun");
   gun["energy"]       = 10*CLHEP::GeV;
   gun["particle"]     = "e-";
diff --git a/examples/LHeD/scripts/LHeDXML.C b/examples/LHeD/scripts/LHeDXML.C
index 10b6b881e..73f5b0323 100644
--- a/examples/LHeD/scripts/LHeDXML.C
+++ b/examples/LHeD/scripts/LHeDXML.C
@@ -37,6 +37,9 @@ int setupG4_XML(bool interactive)  {
   if ( interactive )  {
     kernel.property("UI") = "UI";
   }
+  else  {
+    kernel.property("NumEvents") = 3;
+  }
   kernel.configure();
   kernel.initialize();
   kernel.run();
diff --git a/examples/OpticalTracker/scripts/richsim.py b/examples/OpticalTracker/scripts/richsim.py
index b371ce3a9..3eaefd0a4 100755
--- a/examples/OpticalTracker/scripts/richsim.py
+++ b/examples/OpticalTracker/scripts/richsim.py
@@ -62,7 +62,7 @@ if __name__ == "__main__":
     SIM.part.userParticleHandler = ""
 
     # Particle gun settings: pions with fixed energy and theta, varying phi
-    SIM.numberOfEvents = 500
+    SIM.numberOfEvents = 100
     SIM.enableGun = True
     SIM.gun.energy = "40*GeV"
     SIM.gun.particle = "pi+"
-- 
GitLab