- Activated 10m cut in low density materials (Geant4)
authorihrivnac <Ivana.Hrivnacova@cern.ch>
Thu, 31 Jul 2014 14:51:21 +0000 (16:51 +0200)
committerihrivnac <Ivana.Hrivnacova@cern.ch>
Thu, 31 Jul 2014 17:03:57 +0000 (19:03 +0200)
- Added runMC.sh test which allows to run MC only

test/vmctest/gun/g4Config.C
test/vmctest/gun/runMC.sh [new file with mode: 0755]
test/vmctest/gun/simMC.C [new file with mode: 0644]

index 9838af0..0fe16f5 100644 (file)
@@ -72,8 +72,8 @@ void Config()
     
     // Activate step limit defined in low density materials
     // (the default value is 10 cm)
-    //geant4->ProcessGeantCommand("/mcDet/setIsMaxStepInLowDensityMaterials true");
-    //geant4->ProcessGeantCommand("/mcDet/setMaxStepInLowDensityMaterials 1 cm");
+    geant4->ProcessGeantCommand("/mcDet/setIsMaxStepInLowDensityMaterials true");
+    geant4->ProcessGeantCommand("/mcDet/setMaxStepInLowDensityMaterials 10 m");
 
     // Activate step limit defined in tracking media
     // (Note: this slows down simulation significantly)
diff --git a/test/vmctest/gun/runMC.sh b/test/vmctest/gun/runMC.sh
new file mode 100755 (executable)
index 0000000..0b12e7f
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh
+# $Id$
+
+# Before running this script, you should run rungen.sh first.
+
+NEVENTS=1
+G3CONFIG="$ALICE_ROOT/test/vmctest/ppbench/g3Config.C" 
+G4CONFIG="$ALICE_ROOT/test/vmctest/ppbench/g4Config.C" 
+G3OUTDIR=g3
+G4OUTDIR=g4
+
+RUNG3=1
+RUNG4=1
+
+if [ "$RUNG3" = "1" ]; then 
+  rm -rf *.root *.dat *.log fort* hlt hough raw* recraw/*.root recraw/*.log
+  aliroot -b -q  simMC.C\($NEVENTS,\""$G3CONFIG"\"\)  2>&1 | tee sim.log
+  mv syswatch.log simwatch.log
+  rm -fr $G3OUTDIR
+  mkdir $G3OUTDIR
+  mv *.root *.log *.ps GRP $G3OUTDIR
+  cp g3Config.C $G3OUTDIR
+fi
+
+if [ "$RUNG4" = "1" ]; then 
+  rm -rf *.root *.dat *.log fort* hlt hough raw* recraw/*.root recraw/*.log
+  #cp geometry_zdc_only/geometry.root .
+  aliroot -b -q  simMC.C\($NEVENTS,\""$G4CONFIG"\"\)  2>&1 | tee sim.log
+  mv syswatch.log simwatch.log
+  rm -fr $G4OUTDIR
+  mkdir $G4OUTDIR
+  mv *.root *.log *.rndm *.ps *.gdml GRP $G4OUTDIR
+  cp g4Config.C $G4OUTDIR
+fi
diff --git a/test/vmctest/gun/simMC.C b/test/vmctest/gun/simMC.C
new file mode 100644 (file)
index 0000000..207fa6a
--- /dev/null
@@ -0,0 +1,26 @@
+// $Id$
+//
+// Macro for running MC simulation only in test/vmctest/gun.
+// Adapted from from sim.C. 
+
+void simMC(Int_t nev=3, const TString& config) {
+  if (gSystem->Getenv("EVENT"))
+   nev = atoi(gSystem->Getenv("EVENT")) ;   
+  
+  AliSimulation simulator(config);
+  simulator.SetMakeSDigits("");
+  simulator.SetMakeDigits("");
+  simulator.SetMakeDigitsFromHits("");
+  simulator.SetRunQA(":") ; 
+  simulator.SetRunHLT("") ; 
+
+  simulator.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  simulator.SetSpecificStorage("GRP/GRP/Data",
+                              Form("local://%s",gSystem->pwd()));
+  
+  TStopwatch timer;
+  timer.Start();
+  simulator.Run(nev);
+  timer.Stop();
+  timer.Print();
+}