]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Adding macros to run MC only (for performance tests)
authorihrivnac <ihrivnac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 Oct 2013 12:38:22 +0000 (12:38 +0000)
committerihrivnac <ihrivnac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 24 Oct 2013 12:38:22 +0000 (12:38 +0000)
- Adding macro to check particles mother-daugther relationship

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

diff --git a/test/vmctest/ppbench/runMC.sh b/test/vmctest/ppbench/runMC.sh
new file mode 100755 (executable)
index 0000000..15f91d3
--- /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=0
+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/ppbench/simMC.C b/test/vmctest/ppbench/simMC.C
new file mode 100644 (file)
index 0000000..0e3a063
--- /dev/null
@@ -0,0 +1,26 @@
+// $Id$
+//
+// Macro for running MC simulation only in test/vmctest/ppbench.
+// From test/ppbench. 
+
+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();
+}
diff --git a/test/vmctest/ppbench/testMD.C b/test/vmctest/ppbench/testMD.C
new file mode 100644 (file)
index 0000000..1d7b5dc
--- /dev/null
@@ -0,0 +1,54 @@
+// $Id$
+//
+// Macro for checking mother-daughter particles relationship in stack.
+// By A. Morsch, 24/10/2013
+
+void testMD(Int_t evNumber1 = 0, Int_t evNumber2 = 0) 
+{
+// Connect the Root Galice file containing Geometry, Kine and Hits
+
+    AliRunLoader* rl = AliRunLoader::Open("galice.root");
+//
+    TDatabasePDG*  DataBase = new TDatabasePDG();
+    
+//
+//   Loop over events 
+//
+    rl->LoadKinematics();
+    rl->LoadHeader();    
+    for (Int_t nev = evNumber1; nev <= evNumber2; nev++) {
+       rl->GetEvent(nev);
+       AliStack* stack = rl->Stack();
+       Int_t npart = stack->GetNtrack();
+       if (nev < evNumber1) continue;
+       printf("Event %5d \n", nev);
+//
+// Particle loop
+//       
+       
+       for (Int_t part = 0; part < npart; part++) {
+         TParticle *particle = stack->Particle(part);
+         Int_t pdg  = particle->GetPdgCode();
+         Int_t child1 = particle->GetFirstDaughter();
+         Int_t child2 = particle->GetLastDaughter();
+         if (child1 == -1 || part < 8) continue;
+         
+         for (Int_t i = child1; i<= child2; i++) 
+           {
+             TParticle *daughter = stack->Particle(i);
+             Int_t mo = daughter->GetFirstMother();
+             Int_t dodg = daughter->GetPdgCode();
+             if (mo != part) 
+               printf("Particle with index %5d (pdg %5d) has daughters from index %5d to %5d, however, daughter %5d (pdg %5d) points back to %5d \n", 
+                      part, pdg, child1, child2, i, dodg, mo);
+           }
+       } // primary loop
+    }
+}
+
+
+
+
+
+
+