Adding tests for different generators (Natalia)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Jul 2010 13:02:05 +0000 (13:02 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 14 Jul 2010 13:02:05 +0000 (13:02 +0000)
35 files changed:
test/generators/TUHKMgen/Config.C [new file with mode: 0644]
test/generators/TUHKMgen/aod.C [new file with mode: 0644]
test/generators/TUHKMgen/check.C [new file with mode: 0644]
test/generators/TUHKMgen/monrec.C [new file with mode: 0644]
test/generators/TUHKMgen/monsim.C [new file with mode: 0644]
test/generators/TUHKMgen/rec.C [new file with mode: 0644]
test/generators/TUHKMgen/runtest.sh [new file with mode: 0755]
test/generators/TUHKMgen/sim.C [new file with mode: 0644]
test/generators/TUHKMgen/testvert.C [new file with mode: 0644]
test/generators/epos/Config.C [new file with mode: 0644]
test/generators/epos/aod.C [new file with mode: 0644]
test/generators/epos/check.C [new file with mode: 0644]
test/generators/epos/monrec.C [new file with mode: 0644]
test/generators/epos/monsim.C [new file with mode: 0644]
test/generators/epos/rec.C [new file with mode: 0644]
test/generators/epos/runtest.sh [new file with mode: 0755]
test/generators/epos/sim.C [new file with mode: 0644]
test/generators/epos/testvert.C [new file with mode: 0644]
test/generators/herwig/Config.C [new file with mode: 0644]
test/generators/herwig/aod.C [new file with mode: 0644]
test/generators/herwig/check.C [new file with mode: 0644]
test/generators/herwig/monrec.C [new file with mode: 0644]
test/generators/herwig/monsim.C [new file with mode: 0644]
test/generators/herwig/runtest.sh [new file with mode: 0755]
test/generators/herwig/sim.C [new file with mode: 0644]
test/generators/herwig/testvert.C [new file with mode: 0644]
test/generators/therminator/Config.C [new file with mode: 0644]
test/generators/therminator/aod.C [new file with mode: 0644]
test/generators/therminator/check.C [new file with mode: 0644]
test/generators/therminator/monrec.C [new file with mode: 0644]
test/generators/therminator/monsim.C [new file with mode: 0644]
test/generators/therminator/rec.C [new file with mode: 0644]
test/generators/therminator/runtest.sh [new file with mode: 0755]
test/generators/therminator/sim.C [new file with mode: 0644]
test/generators/therminator/testvert.C [new file with mode: 0644]

diff --git a/test/generators/TUHKMgen/Config.C b/test/generators/TUHKMgen/Config.C
new file mode 100644 (file)
index 0000000..81435e7
--- /dev/null
@@ -0,0 +1,389 @@
+// One can use the configuration macro in compiled mode by
+// root [0] gSystem->Load("libgeant321");
+// root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
+//                   -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
+// root [0] .x grun.C(1,"Config.C++")
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <Riostream.h>
+#include <TPDGCode.h>
+#include <TRandom.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
+#include <TGeant3TGeo.h>
+#include "STEER/AliRunLoader.h"
+#include "STEER/AliRun.h"
+#include "STEER/AliConfig.h"
+#include "PYTHIA6/AliDecayerPythia.h"
+#include "EVGEN/AliGenCocktail.h"
+#include "EVGEN/AliGenHIJINGpara.h"
+#include "STEER/AliMagF.h"
+#include "STRUCT/AliBODY.h"
+#include "STRUCT/AliMAG.h"
+#include "STRUCT/AliABSOv3.h"
+#include "STRUCT/AliDIPOv3.h"
+#include "STRUCT/AliHALLv3.h"
+#include "STRUCT/AliFRAMEv2.h"
+#include "STRUCT/AliSHILv3.h"
+#include "STRUCT/AliPIPEv3.h"
+#include "ITS/AliITSv11Hybrid.h"
+#include "TPC/AliTPCv2.h"
+#include "TOF/AliTOFv6T0.h"
+#include "HMPID/AliHMPIDv3.h"
+#include "ZDC/AliZDCv3.h"
+#include "TRD/AliTRDv1.h"
+#include "FMD/AliFMDv1.h"
+#include "MUON/AliMUONv1.h"
+#include "PHOS/AliPHOSv1.h"
+#include "PMD/AliPMDv1.h"
+#include "T0/AliT0v1.h"
+#include "EMCAL/AliEMCALv2.h"
+#include "ACORDE/AliACORDEv1.h"
+#include "VZERO/AliVZEROv7.h"
+#endif
+
+enum PprTrigConf_t
+{
+    kDefaultPPTrig, kDefaultPbPbTrig
+};
+
+const char * pprTrigConfName[] = {
+    "p-p","Pb-Pb"
+};
+
+static PprTrigConf_t strig = kDefaultPbPbTrig;
+Float_t EtaToTheta(Float_t arg);
+void    LoadPythia();
+
+
+void Config()
+{
+    // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
+    // Theta range given through pseudorapidity limits 22/6/2001
+
+    // Set Random Number seed
+  //gRandom->SetSeed(123456); // Set 0 to use the current time
+
+  AliLog::Message(AliLog::kInfo, Form("Seed for random number generation = %d",gRandom->GetSeed()), "Config.C", "Config.C", "Config()","Config.C", __LINE__);
+
+  // Load Pythia libraries
+  LoadPythia();
+  // Libraries required by geant321
+#if defined(__CINT__)
+    gSystem->Load("libgeant321");
+#endif
+
+    new     TGeant3TGeo("C++ Interface to Geant3");
+
+    AliRunLoader* rl=0x0;
+
+    AliLog::Message(AliLog::kInfo, "Creating Run Loader", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
+
+    rl = AliRunLoader::Open("galice.root",
+          AliConfig::GetDefaultEventFolderName(),
+          "recreate");
+    if (rl == 0x0)
+      {
+  gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
+  return;
+      }
+    rl->SetCompressionLevel(2);
+    rl->SetNumberOfEventsPerFile(3);
+    gAlice->SetRunLoader(rl);
+
+
+
+    // gAlice->SetGeometryFromFile("geometry.root");
+
+    // Uncomment if you want to load geometry from OCDB!   >>>>
+/*
+    if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
+   cout << "#####################################################" << endl;
+   cout << "#                                                   #" << endl;
+   cout << "#     WARNING: CDB DEFAULT STORAGE NOT SET !!!      #" << endl;
+   cout << "#     SETTING IT TO local://$ALICE_ROOT/OCDB !!!         #" << endl;
+   cout << "#                                                   #" << endl;
+   cout << "#####################################################" << endl;
+
+         AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+
+    if(AliCDBManager::Instance()->GetRun() < 0){
+   cout << "#####################################################" << endl;
+   cout << "#                                                   #" << endl;
+   cout << "#     WARNING: RUN NUMBER NOT SET !!!               #" << endl;
+   cout << "#     SETTING IT TO 0 !!!                           #" << endl;
+   cout << "#                                                   #" << endl;
+   cout << "#####################################################" << endl;
+
+         AliCDBManager::Instance()->SetRun(0);
+    }
+    gAlice->SetGeometryFromCDB();
+*/
+
+
+
+    // Set the trigger configuration
+    gAlice->SetTriggerDescriptor(pprTrigConfName[strig]);
+    cout<<"Trigger configuration is set to  "<<pprTrigConfName[strig]<<endl;
+
+    //
+    // Set External decayer
+    TVirtualMCDecayer *decayer = new AliDecayerPythia();
+
+    decayer->SetForceDecay(kAll);
+    decayer->Init();
+    gMC->SetExternalDecayer(decayer);
+    //=======================================================================
+    // ************* STEERING parameters FOR ALICE SIMULATION **************
+    // --- Specify event type to be tracked through the ALICE setup
+    // --- All positions are in cm, angles in degrees, and P and E in GeV
+
+
+    gMC->SetProcess("DCAY",1);
+    gMC->SetProcess("PAIR",1);
+    gMC->SetProcess("COMP",1);
+    gMC->SetProcess("PHOT",1);
+    gMC->SetProcess("PFIS",0);
+    gMC->SetProcess("DRAY",0);
+    gMC->SetProcess("ANNI",1);
+    gMC->SetProcess("BREM",1);
+    gMC->SetProcess("MUNU",1);
+    gMC->SetProcess("CKOV",1);
+    gMC->SetProcess("HADR",1);
+    gMC->SetProcess("LOSS",2);
+    gMC->SetProcess("MULS",1);
+    gMC->SetProcess("RAYL",1);
+
+    Float_t cut = 1.e-3;        // 1MeV cut by default
+    Float_t tofmax = 1.e10;
+
+    gMC->SetCut("CUTGAM", cut);
+    gMC->SetCut("CUTELE", cut);
+    gMC->SetCut("CUTNEU", cut);
+    gMC->SetCut("CUTHAD", cut);
+    gMC->SetCut("CUTMUO", cut);
+    gMC->SetCut("BCUTE",  cut); 
+    gMC->SetCut("BCUTM",  cut); 
+    gMC->SetCut("DCUTE",  cut); 
+    gMC->SetCut("DCUTM",  cut); 
+    gMC->SetCut("PPCUTM", cut);
+    gMC->SetCut("TOFMAX", tofmax); 
+
+    int nParticles = 100;
+      if (gSystem->Getenv("CONFIG_NPARTICLES"))
+      {
+        nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
+      }
+
+    AliGenCocktail *gener = new AliGenCocktail();
+    gener->SetPhiRange(0, 360);
+    // Set pseudorapidity range from -8 to 8.
+    Float_t thmin = EtaToTheta(8);   // theta min. <---> eta max
+    Float_t thmax = EtaToTheta(-8);  // theta max. <---> eta min
+    gener->SetThetaRange(thmin,thmax);
+    gener->SetOrigin(0, 0, 0);  //vertex position
+    gener->SetSigma(0, 0, 0);   //Sigma in (X,Y,Z) (cm) on IP position
+
+    gSystem->Load("libTUHKMgen");
+    AliGenUHKM *tuhkMgen = new AliGenUHKM(nParticles);
+    tuhkMgen->SetAllParametersLHC();
+    gener->AddGenerator(tuhkMgen,"TUHKM",1);
+
+    gener->Init();
+
+    //
+    // Activate this line if you want the vertex smearing to happen
+    // track by track
+    //
+    //gener->SetVertexSmear(perTrack);
+    // Field (L3 0.4 T)
+    TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG));
+
+    Int_t   iABSO   = 1;
+    Int_t   iDIPO   = 1;
+    Int_t   iFMD    = 1;
+    Int_t   iFRAME  = 1;
+    Int_t   iHALL   = 1;
+    Int_t   iITS    = 1;
+    Int_t   iMAG    = 1;
+    Int_t   iMUON   = 1;
+    Int_t   iPHOS   = 1;
+    Int_t   iPIPE   = 1;
+    Int_t   iPMD    = 1;
+    Int_t   iHMPID  = 1;
+    Int_t   iSHIL   = 1;
+    Int_t   iT0     = 1;
+    Int_t   iTOF    = 1;
+    Int_t   iTPC    = 1;
+    Int_t   iTRD    = 1;
+    Int_t   iZDC    = 1;
+    Int_t   iEMCAL  = 1;
+    Int_t   iACORDE = 1;
+    Int_t   iVZERO  = 1;
+    rl->CdGAFile();
+    //=================== Alice BODY parameters =============================
+    AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
+
+    if (iMAG)
+    {
+        //=================== MAG parameters ============================
+        // --- Start with Magnet since detector layouts may be depending ---
+        // --- on the selected Magnet dimensions ---
+        AliMAG *MAG = new AliMAG("MAG", "Magnet");
+    }
+
+
+    if (iABSO)
+    {
+        //=================== ABSO parameters ============================
+        AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
+    }
+
+    if (iDIPO)
+    {
+        //=================== DIPO parameters ============================
+
+        AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
+    }
+
+    if (iHALL)
+    {
+        //=================== HALL parameters ============================
+
+        AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
+    }
+
+
+    if (iFRAME)
+    {
+        //=================== FRAME parameters ============================
+
+        AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
+  FRAME->SetHoles(1);
+    }
+
+    if (iSHIL)
+    {
+        //=================== SHIL parameters ============================
+
+        AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
+    }
+
+
+    if (iPIPE)
+    {
+        //=================== PIPE parameters ============================
+
+        AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
+    }
+    if (iITS)
+    {
+        //=================== ITS parameters ============================
+
+  AliITS *ITS  = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
+    }
+
+    if (iTPC)
+    {
+        //============================ TPC parameters ===================
+        AliTPC *TPC = new AliTPCv2("TPC", "Default");
+    }
+
+
+    if (iTOF) {
+        //=================== TOF parameters ============================
+  AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
+    }
+
+
+    if (iHMPID)
+    {
+        //=================== HMPID parameters ===========================
+        AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
+
+    }
+
+
+    if (iZDC)
+    {
+        //=================== ZDC parameters ============================
+
+        AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
+    }
+
+    if (iTRD)
+    {
+        //=================== TRD parameters ============================
+
+        AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
+    }
+
+    if (iFMD)
+    {
+        //=================== FMD parameters ============================
+  AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
+   }
+
+    if (iMUON)
+    {
+        //=================== MUON parameters ===========================
+        // New MUONv1 version (geometry defined via builders)
+        AliMUON *MUON = new AliMUONv1("MUON", "default");
+    }
+    //=================== PHOS parameters ===========================
+
+    if (iPHOS)
+    {
+        AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
+    }
+
+
+    if (iPMD)
+    {
+        //=================== PMD parameters ============================
+        AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
+    }
+
+    if (iT0)
+    {
+        //=================== T0 parameters ============================
+        AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
+    }
+
+    if (iEMCAL)
+    {
+        //=================== EMCAL parameters ============================
+        AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
+    }
+
+     if (iACORDE)
+    {
+        //=================== ACORDE parameters ============================
+        AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
+    }
+
+     if (iVZERO)
+    {
+        //=================== VZERO parameters ============================
+        AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
+    }
+
+     AliLog::Message(AliLog::kInfo, "End of Config", "Config.C", "Config.C", "Config()"," Config.C", __LINE__);
+
+}
+
+Float_t EtaToTheta(Float_t arg){
+  return (180./TMath::Pi())*2.*atan(exp(-arg));
+}
+
+
+void LoadPythia()
+{
+    // Load Pythia related libraries
+    gSystem->Load("liblhapdf.so");      // Parton density functions
+    gSystem->Load("libEGPythia6.so");   // TGenerator interface
+    gSystem->Load("libpythia6.so");     // Pythia
+    gSystem->Load("libAliPythia6.so");  // ALICE specific implementations
+}
diff --git a/test/generators/TUHKMgen/aod.C b/test/generators/TUHKMgen/aod.C
new file mode 100644 (file)
index 0000000..a87c0b3
--- /dev/null
@@ -0,0 +1,16 @@
+void aod(){
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibs.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+
+  gSystem->Load("liblhapdf");      // Parton density functions
+  gSystem->Load("libEGPythia6");   // TGenerator interface
+  gSystem->Load("libpythia6");     // Pythia
+  gSystem->Load("libAliPythia6");  // ALICE specific implementations
+  gSystem->Load("libdpmjet");
+  gSystem->Load("libTDPMjet");
+  gROOT->Macro("$ALICE_ROOT/STEER/CreateAODfromESD.C");
+}
diff --git a/test/generators/TUHKMgen/check.C b/test/generators/TUHKMgen/check.C
new file mode 100644 (file)
index 0000000..5f336be
--- /dev/null
@@ -0,0 +1,16 @@
+void check(){
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibs.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+
+  gSystem->Load("liblhapdf");      // Parton density functions
+  gSystem->Load("libEGPythia6");   // TGenerator interface
+  gSystem->Load("libpythia6");     // Pythia
+  gSystem->Load("libAliPythia6");  // ALICE specific implementations
+  gSystem->Load("libdpmjet");
+  gSystem->Load("libTDPMjet");
+  gROOT->Macro("$ALICE_ROOT/STEER/CheckESD.C");
+}
diff --git a/test/generators/TUHKMgen/monrec.C b/test/generators/TUHKMgen/monrec.C
new file mode 100644 (file)
index 0000000..c6f1330
--- /dev/null
@@ -0,0 +1,28 @@
+void monrec() {
+  // MonaLisa monitoring
+  gSystem->Load("libNet.so");
+  gSystem->Load("libMonaLisa.so");
+
+  new TMonaLisaWriter("aliendb3.cern.ch", "Reconstruction pp", gSystem->Getenv("TEST_PLATFORMID"), gSystem->Getenv("TEST_PLATFORMID"), "global");
+
+
+  gROOT->LoadMacro("rec.C");
+  rec();
+  if (gMonitoringWriter) gMonitoringWriter->SendProcessingProgress(1,1,kTRUE);  
+
+  // Send the size of the AliESDs.root file
+
+  FileStat_t buf;
+  gSystem->GetPathInfo("./AliESDs.root",buf);
+
+  TList *valuelist = new TList();
+  valuelist->SetOwner(kTRUE);
+
+  TMonaLisaValue* valdouble = new TMonaLisaValue("AliESDs.root size",buf.fSize);
+  valuelist->Add(valdouble);
+
+  if (gMonitoringWriter) gMonitoringWriter->SendParameters(valuelist);
+  delete valuelist;
+
+  printf("#Test finished successfully#\n");
+}
diff --git a/test/generators/TUHKMgen/monsim.C b/test/generators/TUHKMgen/monsim.C
new file mode 100644 (file)
index 0000000..fcc88ff
--- /dev/null
@@ -0,0 +1,27 @@
+void monsim(Int_t nev=20){ 
+  // MonaLisa monitoring
+  gSystem->Load("libNet.so");
+  gSystem->Load("libMonaLisa.so");
+
+  new TMonaLisaWriter("aliendb3.cern.ch", "Simulation pp", gSystem->Getenv("TEST_PLATFORMID"), gSystem->Getenv("TEST_PLATFORMID"), "global");
+
+  gROOT->LoadMacro("sim.C");
+  sim(nev);
+  if (gMonitoringWriter) gMonitoringWriter->SendProcessingProgress(1,1,kTRUE);  
+
+  // Send the size of the raw.root file
+
+  FileStat_t buf;
+  gSystem->GetPathInfo("./raw.root",buf);
+
+  TList *valuelist = new TList();
+  valuelist->SetOwner(kTRUE);
+
+  TMonaLisaValue* valdouble = new TMonaLisaValue("raw.root size",buf.fSize);
+  valuelist->Add(valdouble);
+
+  if (gMonitoringWriter) gMonitoringWriter->SendParameters(valuelist);
+  delete valuelist;
+
+  printf("#Test finished successfully#\n");
+}
diff --git a/test/generators/TUHKMgen/rec.C b/test/generators/TUHKMgen/rec.C
new file mode 100644 (file)
index 0000000..ebed8d3
--- /dev/null
@@ -0,0 +1,27 @@
+void rec() {
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibsrec.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+  AliReconstruction reco;
+
+  reco.SetWriteESDfriend();
+  reco.SetWriteAlignmentData();
+
+  reco.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  reco.SetSpecificStorage("GRP/GRP/Data",
+                         Form("local://%s",gSystem->pwd()));
+
+  AliGRPRecoParam *grpRecoParam = AliGRPRecoParam::GetLowFluxParam();
+  grpRecoParam->SetVertexerTracksConstraintITS(kFALSE);
+  grpRecoParam->SetVertexerTracksConstraintTPC(kFALSE);
+  reco.SetRecoParam("GRP",grpRecoParam);
+
+  TStopwatch timer;
+  timer.Start();
+  reco.Run();
+  timer.Stop();
+  timer.Print();
+}
diff --git a/test/generators/TUHKMgen/runtest.sh b/test/generators/TUHKMgen/runtest.sh
new file mode 100755 (executable)
index 0000000..4b69e14
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Root
+# export ROOTSYS=/afs/cern.ch/alice/library/root/new
+# export PATH=$ROOTSYS/bin:$PATH
+# export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
+# AliRoot
+# export ALICE=/afs/cern.ch/alice/library
+# export ALICE_LEVEL=new
+# export ALICE_ROOT=$ALICE/$ALICE_LEVEL
+# export ALICE_TARGET=`$ROOTSYS/bin/root-config --arch`
+# export PATH=$ALICE_ROOT/bin/tgt_${ALICE_TARGET}:$PATH
+# export LD_LIBRARY_PATH=$ALICE_ROOT/lib/tgt_${ALICE_TARGET}:$LD_LIBRARY_PATH
+# Geant3
+# export LD_LIBRARY_PATH=$ALICE/geant3/lib/tgt_${ALICE_TARGET}:$LD_LIBRARY_PATH
+
+rm -rf *.root *.dat *.log fort* hlt hough raw* recraw/*.root recraw/*.log
+aliroot -b -q $1sim.C      2>&1 | tee sim.log
+mv syswatch.log simwatch.log
+aliroot -b -q $1rec.C      2>&1 | tee rec.log
+mv syswatch.log recwatch.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CheckESD.C 2>&1 | tee check.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CreateAODfromESD.C 2>&1 | tee aod.log
+
+cd recraw
+ln -s ../raw.root
+aliroot -b -q rec.C      2>&1 | tee rec.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CreateAODfromESD.C 2>&1 | tee aod.log
+
+
+
diff --git a/test/generators/TUHKMgen/sim.C b/test/generators/TUHKMgen/sim.C
new file mode 100644 (file)
index 0000000..84333ed
--- /dev/null
@@ -0,0 +1,18 @@
+void sim(Int_t nev=5) {
+
+
+  AliSimulation simulator;
+  simulator.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO");
+  simulator.SetMakeDigitsFromHits("ITS TPC");
+  simulator.SetWriteRawData("ALL","raw.root",kTRUE);
+
+  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/generators/TUHKMgen/testvert.C b/test/generators/TUHKMgen/testvert.C
new file mode 100644 (file)
index 0000000..dab13a7
--- /dev/null
@@ -0,0 +1,25 @@
+void testvert() {
+
+  TFile f("AliESDs.root");
+
+  TTree * tree = (TTree*)f.Get("esdTree");
+
+  AliESDEvent * esd = new AliESDEvent();// The signal ESD object is put here
+  esd->ReadFromTree(tree);
+
+  Int_t nev = tree->GetEntriesFast();
+  
+  for (Int_t iev=0; iev<nev; iev++) {
+    cout << "---------- Signal event ----------" << iev << endl;
+
+    // Get ESD
+    tree->GetEntry(iev);
+
+    AliESDVertex * vert = esd->GetPrimaryVertex();
+
+    if (vert) cout << vert->GetTitle() << endl;
+
+    if (strstr(vert->GetTitle(),"VertexerTracks")) cout << "OK" << endl;
+
+  }
+}
diff --git a/test/generators/epos/Config.C b/test/generators/epos/Config.C
new file mode 100644 (file)
index 0000000..3ec4b16
--- /dev/null
@@ -0,0 +1,406 @@
+// One can use the configuration macro in compiled mode by
+// root [0] gSystem->Load("libgeant321");
+// root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
+//                   -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
+// root [0] .x grun.C(1,"ConfigPPR.C++")
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <Riostream.h>
+#include <TRandom.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
+#include <TGeant3TGeo.h>
+#include <TPDGCode.h>
+#include <TF1.h>
+#include "STEER/AliRunLoader.h"
+#include "STEER/AliRun.h"
+#include "STEER/AliConfig.h"
+#include "STEER/AliGenerator.h"
+#include "STEER/AliLog.h"
+#include "PYTHIA6/AliDecayerPythia.h"
+#include "EVGEN/AliGenHIJINGpara.h"
+#include "THijing/AliGenHijing.h"
+#include "EVGEN/AliGenCocktail.h"
+#include "EVGEN/AliGenSlowNucleons.h"
+#include "EVGEN/AliSlowNucleonModelExp.h"
+#include "EVGEN/AliGenParam.h"
+#include "EVGEN/AliGenMUONlib.h"
+#include "EVGEN/AliGenSTRANGElib.h"
+#include "EVGEN/AliGenMUONCocktail.h"
+#include "EVGEN/AliGenCocktail.h"
+#include "EVGEN/AliGenGeVSim.h"
+#include "EVGEN/AliGeVSimParticle.h"
+#include "PYTHIA6/AliGenPythia.h"
+#include "STEER/AliMagF.h"
+#include "STRUCT/AliBODY.h"
+#include "STRUCT/AliMAG.h"
+#include "STRUCT/AliABSOv3.h"
+#include "STRUCT/AliDIPOv3.h"
+#include "STRUCT/AliHALLv3.h"
+#include "STRUCT/AliFRAMEv2.h"
+#include "STRUCT/AliSHILv3.h"
+#include "STRUCT/AliPIPEv3.h"
+#include "ITS/AliITSv11Hybrid.h"
+#include "TPC/AliTPCv2.h"
+#include "TOF/AliTOFv6T0.h"
+#include "HMPID/AliHMPIDv3.h"
+#include "ZDC/AliZDCv3.h"
+#include "TRD/AliTRDv1.h"
+#include "FMD/AliFMDv1.h"
+#include "MUON/AliMUONv1.h"
+#include "PHOS/AliPHOSv1.h"
+#include "PMD/AliPMDv1.h"
+#include "T0/AliT0v1.h"
+#include "EMCAL/AliEMCALv2.h"
+#include "ACORDE/AliACORDEv1.h"
+#include "VZERO/AliVZEROv7.h"
+#include "EPOS/AliGenEpos.h"
+#endif
+
+enum PprTrigConf_t
+{
+    kDefaultPPTrig, kDefaultPbPbTrig
+};
+
+const char * pprTrigConfName[] = {
+    "p-p","Pb-Pb"
+};
+
+// This part for configuration    
+
+static AliMagF::BMap_t smag = AliMagF::k5kG;
+static Int_t    sseed = 0; //Set 0 to use the current time
+static PprTrigConf_t strig = kDefaultPPTrig; // default pp trigger configuration
+static Float_t energy = 900;
+
+// Comment line 
+static TString  comment;
+
+// Functions
+Float_t EtaToTheta(Float_t arg);
+void ProcessEnvironmentVars();
+
+void Config()
+{
+    // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
+    // Theta range given through pseudorapidity limits 22/6/2001
+
+    // Get settings from environment variables
+    ProcessEnvironmentVars();
+
+    // Set Random Number seed
+    gRandom->SetSeed(sseed);
+    cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl; 
+
+
+   // libraries required by geant321
+#if defined(__CINT__)
+    gSystem->Load("liblhapdf");
+    gSystem->Load("libEGPythia6");
+    gSystem->Load("libpythia6");
+    gSystem->Load("libAliPythia6");
+    gSystem->Load("libgeant321");
+    gSystem->Load("libEPOS.so");
+#endif
+
+    new     TGeant3TGeo("C++ Interface to Geant3");
+
+  // Output every 100 tracks
+  ((TGeant3*)gMC)->SetSWIT(4,100);
+
+    AliRunLoader* rl=0x0;
+
+    AliLog::Message(AliLog::kInfo, "Creating Run Loader", "", "", "Config()","ConfigPPR.C", __LINE__);
+
+    rl = AliRunLoader::Open("galice.root",
+                           AliConfig::GetDefaultEventFolderName(),
+                           "recreate");
+    if (rl == 0x0)
+      {
+       gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
+       return;
+      }
+    rl->SetCompressionLevel(2);
+    rl->SetNumberOfEventsPerFile(100);
+    gAlice->SetRunLoader(rl);
+
+    // Set the trigger configuration
+    gAlice->SetTriggerDescriptor(pprTrigConfName[strig]);
+    cout<<"Trigger configuration is set to  "<<pprTrigConfName[strig]<<endl;
+
+    //
+    // Set External decayer
+    AliDecayer *decayer = new AliDecayerPythia();
+    decayer->Init();
+    gMC->SetExternalDecayer(decayer);
+    //
+    //
+    //=======================================================================
+    //
+    //=======================================================================
+    // ************* STEERING parameters FOR ALICE SIMULATION **************
+    // --- Specify event type to be tracked through the ALICE setup
+    // --- All positions are in cm, angles in degrees, and P and E in GeV
+
+    gMC->SetProcess("DCAY",1);
+    gMC->SetProcess("PAIR",1);
+    gMC->SetProcess("COMP",1);
+    gMC->SetProcess("PHOT",1);
+    gMC->SetProcess("PFIS",0);
+    gMC->SetProcess("DRAY",0);
+    gMC->SetProcess("ANNI",1);
+    gMC->SetProcess("BREM",1);
+    gMC->SetProcess("MUNU",1);
+    gMC->SetProcess("CKOV",1);
+    gMC->SetProcess("HADR",1);
+    gMC->SetProcess("LOSS",2);
+    gMC->SetProcess("MULS",1);
+    gMC->SetProcess("RAYL",1);
+
+    Float_t cut = 1.e-3;        // 1MeV cut by default
+    Float_t tofmax = 1.e10;
+
+    gMC->SetCut("CUTGAM", cut);
+    gMC->SetCut("CUTELE", cut);
+    gMC->SetCut("CUTNEU", cut);
+    gMC->SetCut("CUTHAD", cut);
+    gMC->SetCut("CUTMUO", cut);
+    gMC->SetCut("BCUTE",  cut); 
+    gMC->SetCut("BCUTM",  cut); 
+    gMC->SetCut("DCUTE",  cut); 
+    gMC->SetCut("DCUTM",  cut); 
+    gMC->SetCut("PPCUTM", cut);
+    gMC->SetCut("TOFMAX", tofmax); 
+
+    // Generator Configuration
+
+    AliGenerator* gener = 0x0;
+
+    AliGenEpos *epos = new AliGenEpos();
+    epos->SetProjectile("p", 1, 1);
+    epos->SetTarget("p", 1, 1);
+    epos->SetEnergyCMS(energy);
+    gener = epos;
+
+    gener->SetOrigin(0, 0, 0);    // vertex position
+    gener->SetSigma(0, 0, 5.3);   // Sigma in (X,Y,Z) (cm) on IP position
+    gener->SetCutVertexZ(1.);     // Truncate at 1 sigma
+    gener->SetVertexSmear(kPerEvent); 
+    gener->SetTrackingFlag(1);
+    gener->Init();
+    
+    AliMagF* field = 0x0;
+    if (smag == AliMagF::k2kG) {
+       comment = comment.Append(" | L3 field 0.2 T");
+       field = new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG,AliMagF::kBeamTypepp, energy/2.0);
+    } else if (smag == AliMagF::k5kG) {
+       comment = comment.Append(" | L3 field 0.5 T");
+       field = new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG,AliMagF::kBeamTypepp, energy/2.0);
+    }
+    
+    printf("\n \n Comment: %s \n \n", comment.Data());
+    
+    
+// Field
+    TGeoGlobalMagField::Instance()->SetField(field);
+
+    rl->CdGAFile();
+//
+    Int_t   iABSO   = 1;
+    Int_t   iDIPO   = 1;
+    Int_t   iFMD    = 1;
+    Int_t   iFRAME  = 1;
+    Int_t   iHALL   = 1;
+    Int_t   iITS    = 1;
+    Int_t   iMAG    = 1;
+    Int_t   iMUON   = 1;
+    Int_t   iPHOS   = 1;
+    Int_t   iPIPE   = 1;
+    Int_t   iPMD    = 1;
+    Int_t   iHMPID  = 1;
+    Int_t   iSHIL   = 1;
+    Int_t   iT0     = 1;
+    Int_t   iTOF    = 1;
+    Int_t   iTPC    = 1;
+    Int_t   iTRD    = 1;
+    Int_t   iZDC    = 1;
+    Int_t   iEMCAL  = 1;
+    Int_t   iVZERO  = 1;
+    Int_t   iACORDE = 1;
+
+    //=================== Alice BODY parameters =============================
+    AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
+
+
+    if (iMAG)
+    {
+        //=================== MAG parameters ============================
+        // --- Start with Magnet since detector layouts may be depending ---
+        // --- on the selected Magnet dimensions ---
+        AliMAG *MAG = new AliMAG("MAG", "Magnet");
+    }
+
+
+    if (iABSO)
+    {
+        //=================== ABSO parameters ============================
+        AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
+    }
+
+    if (iDIPO)
+    {
+        //=================== DIPO parameters ============================
+
+        AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
+    }
+
+    if (iHALL)
+    {
+        //=================== HALL parameters ============================
+
+        AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
+    }
+
+
+    if (iFRAME)
+    {
+        //=================== FRAME parameters ============================
+
+        AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
+       FRAME->SetHoles(1);
+    }
+
+    if (iSHIL)
+    {
+        //=================== SHIL parameters ============================
+
+        AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
+    }
+
+
+    if (iPIPE)
+    {
+        //=================== PIPE parameters ============================
+
+        AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
+    }
+    if (iITS)
+    {
+        //=================== ITS parameters ============================
+
+       AliITS *ITS  = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
+    }
+
+    if (iTPC)
+    {
+      //============================ TPC parameters =====================
+        AliTPC *TPC = new AliTPCv2("TPC", "Default");
+    }
+
+
+    if (iTOF) {
+        //=================== TOF parameters ============================
+       AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
+    }
+
+
+    if (iHMPID)
+    {
+        //=================== HMPID parameters ===========================
+        AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
+
+    }
+
+
+    if (iZDC)
+    {
+        //=================== ZDC parameters ============================
+
+        AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
+    }
+
+    if (iTRD)
+    {
+        //=================== TRD parameters ============================
+
+        AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
+    }
+
+    if (iFMD)
+    {
+        //=================== FMD parameters ============================
+       AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
+   }
+
+    if (iMUON)
+    {
+        //=================== MUON parameters ===========================
+        // New MUONv1 version (geometry defined via builders)
+        AliMUON *MUON = new AliMUONv1("MUON", "default");
+    }
+    //=================== PHOS parameters ===========================
+
+    if (iPHOS)
+    {
+        AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
+    }
+
+
+    if (iPMD)
+    {
+        //=================== PMD parameters ============================
+        AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
+    }
+
+    if (iT0)
+    {
+        //=================== T0 parameters ============================
+        AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
+    }
+
+    if (iEMCAL)
+    {
+        //=================== EMCAL parameters ============================
+        AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
+    }
+
+     if (iACORDE)
+    {
+        //=================== ACORDE parameters ============================
+        AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
+    }
+
+     if (iVZERO)
+    {
+        //=================== VZERO parameters ============================
+        AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
+    }
+             
+}
+
+Float_t EtaToTheta(Float_t arg){
+  return (180./TMath::Pi())*2.*atan(exp(-arg));
+}
+
+
+
+
+void ProcessEnvironmentVars()
+{
+    // Run type
+    if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
+      for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
+       if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
+         srun = (PprRun_t)iRun;
+         cout<<"Run type set to "<<pprRunName[iRun]<<endl;
+       }
+      }
+    }
+
+    // Random Number seed
+    if (gSystem->Getenv("CONFIG_SEED")) {
+      sseed = atoi(gSystem->Getenv("CONFIG_SEED"));
+    }
+}
diff --git a/test/generators/epos/aod.C b/test/generators/epos/aod.C
new file mode 100644 (file)
index 0000000..a87c0b3
--- /dev/null
@@ -0,0 +1,16 @@
+void aod(){
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibs.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+
+  gSystem->Load("liblhapdf");      // Parton density functions
+  gSystem->Load("libEGPythia6");   // TGenerator interface
+  gSystem->Load("libpythia6");     // Pythia
+  gSystem->Load("libAliPythia6");  // ALICE specific implementations
+  gSystem->Load("libdpmjet");
+  gSystem->Load("libTDPMjet");
+  gROOT->Macro("$ALICE_ROOT/STEER/CreateAODfromESD.C");
+}
diff --git a/test/generators/epos/check.C b/test/generators/epos/check.C
new file mode 100644 (file)
index 0000000..5f336be
--- /dev/null
@@ -0,0 +1,16 @@
+void check(){
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibs.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+
+  gSystem->Load("liblhapdf");      // Parton density functions
+  gSystem->Load("libEGPythia6");   // TGenerator interface
+  gSystem->Load("libpythia6");     // Pythia
+  gSystem->Load("libAliPythia6");  // ALICE specific implementations
+  gSystem->Load("libdpmjet");
+  gSystem->Load("libTDPMjet");
+  gROOT->Macro("$ALICE_ROOT/STEER/CheckESD.C");
+}
diff --git a/test/generators/epos/monrec.C b/test/generators/epos/monrec.C
new file mode 100644 (file)
index 0000000..c6f1330
--- /dev/null
@@ -0,0 +1,28 @@
+void monrec() {
+  // MonaLisa monitoring
+  gSystem->Load("libNet.so");
+  gSystem->Load("libMonaLisa.so");
+
+  new TMonaLisaWriter("aliendb3.cern.ch", "Reconstruction pp", gSystem->Getenv("TEST_PLATFORMID"), gSystem->Getenv("TEST_PLATFORMID"), "global");
+
+
+  gROOT->LoadMacro("rec.C");
+  rec();
+  if (gMonitoringWriter) gMonitoringWriter->SendProcessingProgress(1,1,kTRUE);  
+
+  // Send the size of the AliESDs.root file
+
+  FileStat_t buf;
+  gSystem->GetPathInfo("./AliESDs.root",buf);
+
+  TList *valuelist = new TList();
+  valuelist->SetOwner(kTRUE);
+
+  TMonaLisaValue* valdouble = new TMonaLisaValue("AliESDs.root size",buf.fSize);
+  valuelist->Add(valdouble);
+
+  if (gMonitoringWriter) gMonitoringWriter->SendParameters(valuelist);
+  delete valuelist;
+
+  printf("#Test finished successfully#\n");
+}
diff --git a/test/generators/epos/monsim.C b/test/generators/epos/monsim.C
new file mode 100644 (file)
index 0000000..fcc88ff
--- /dev/null
@@ -0,0 +1,27 @@
+void monsim(Int_t nev=20){ 
+  // MonaLisa monitoring
+  gSystem->Load("libNet.so");
+  gSystem->Load("libMonaLisa.so");
+
+  new TMonaLisaWriter("aliendb3.cern.ch", "Simulation pp", gSystem->Getenv("TEST_PLATFORMID"), gSystem->Getenv("TEST_PLATFORMID"), "global");
+
+  gROOT->LoadMacro("sim.C");
+  sim(nev);
+  if (gMonitoringWriter) gMonitoringWriter->SendProcessingProgress(1,1,kTRUE);  
+
+  // Send the size of the raw.root file
+
+  FileStat_t buf;
+  gSystem->GetPathInfo("./raw.root",buf);
+
+  TList *valuelist = new TList();
+  valuelist->SetOwner(kTRUE);
+
+  TMonaLisaValue* valdouble = new TMonaLisaValue("raw.root size",buf.fSize);
+  valuelist->Add(valdouble);
+
+  if (gMonitoringWriter) gMonitoringWriter->SendParameters(valuelist);
+  delete valuelist;
+
+  printf("#Test finished successfully#\n");
+}
diff --git a/test/generators/epos/rec.C b/test/generators/epos/rec.C
new file mode 100644 (file)
index 0000000..ebed8d3
--- /dev/null
@@ -0,0 +1,27 @@
+void rec() {
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibsrec.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+  AliReconstruction reco;
+
+  reco.SetWriteESDfriend();
+  reco.SetWriteAlignmentData();
+
+  reco.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  reco.SetSpecificStorage("GRP/GRP/Data",
+                         Form("local://%s",gSystem->pwd()));
+
+  AliGRPRecoParam *grpRecoParam = AliGRPRecoParam::GetLowFluxParam();
+  grpRecoParam->SetVertexerTracksConstraintITS(kFALSE);
+  grpRecoParam->SetVertexerTracksConstraintTPC(kFALSE);
+  reco.SetRecoParam("GRP",grpRecoParam);
+
+  TStopwatch timer;
+  timer.Start();
+  reco.Run();
+  timer.Stop();
+  timer.Print();
+}
diff --git a/test/generators/epos/runtest.sh b/test/generators/epos/runtest.sh
new file mode 100755 (executable)
index 0000000..4b69e14
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Root
+# export ROOTSYS=/afs/cern.ch/alice/library/root/new
+# export PATH=$ROOTSYS/bin:$PATH
+# export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
+# AliRoot
+# export ALICE=/afs/cern.ch/alice/library
+# export ALICE_LEVEL=new
+# export ALICE_ROOT=$ALICE/$ALICE_LEVEL
+# export ALICE_TARGET=`$ROOTSYS/bin/root-config --arch`
+# export PATH=$ALICE_ROOT/bin/tgt_${ALICE_TARGET}:$PATH
+# export LD_LIBRARY_PATH=$ALICE_ROOT/lib/tgt_${ALICE_TARGET}:$LD_LIBRARY_PATH
+# Geant3
+# export LD_LIBRARY_PATH=$ALICE/geant3/lib/tgt_${ALICE_TARGET}:$LD_LIBRARY_PATH
+
+rm -rf *.root *.dat *.log fort* hlt hough raw* recraw/*.root recraw/*.log
+aliroot -b -q $1sim.C      2>&1 | tee sim.log
+mv syswatch.log simwatch.log
+aliroot -b -q $1rec.C      2>&1 | tee rec.log
+mv syswatch.log recwatch.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CheckESD.C 2>&1 | tee check.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CreateAODfromESD.C 2>&1 | tee aod.log
+
+cd recraw
+ln -s ../raw.root
+aliroot -b -q rec.C      2>&1 | tee rec.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CreateAODfromESD.C 2>&1 | tee aod.log
+
+
+
diff --git a/test/generators/epos/sim.C b/test/generators/epos/sim.C
new file mode 100644 (file)
index 0000000..84333ed
--- /dev/null
@@ -0,0 +1,18 @@
+void sim(Int_t nev=5) {
+
+
+  AliSimulation simulator;
+  simulator.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO");
+  simulator.SetMakeDigitsFromHits("ITS TPC");
+  simulator.SetWriteRawData("ALL","raw.root",kTRUE);
+
+  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/generators/epos/testvert.C b/test/generators/epos/testvert.C
new file mode 100644 (file)
index 0000000..dab13a7
--- /dev/null
@@ -0,0 +1,25 @@
+void testvert() {
+
+  TFile f("AliESDs.root");
+
+  TTree * tree = (TTree*)f.Get("esdTree");
+
+  AliESDEvent * esd = new AliESDEvent();// The signal ESD object is put here
+  esd->ReadFromTree(tree);
+
+  Int_t nev = tree->GetEntriesFast();
+  
+  for (Int_t iev=0; iev<nev; iev++) {
+    cout << "---------- Signal event ----------" << iev << endl;
+
+    // Get ESD
+    tree->GetEntry(iev);
+
+    AliESDVertex * vert = esd->GetPrimaryVertex();
+
+    if (vert) cout << vert->GetTitle() << endl;
+
+    if (strstr(vert->GetTitle(),"VertexerTracks")) cout << "OK" << endl;
+
+  }
+}
diff --git a/test/generators/herwig/Config.C b/test/generators/herwig/Config.C
new file mode 100644 (file)
index 0000000..842bca8
--- /dev/null
@@ -0,0 +1,554 @@
+//
+// Configuration for the first physics production 2008
+//
+
+// One can use the configuration macro in compiled mode by
+// root [0] gSystem->Load("libgeant321");
+// root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
+//                   -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
+// root [0] .x grun.C(1,"Config.C++")
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <Riostream.h>
+#include <TRandom.h>
+#include <TDatime.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
+#include <TGeant3TGeo.h>
+#include "STEER/AliRunLoader.h"
+#include "STEER/AliRun.h"
+#include "STEER/AliConfig.h"
+#include "PYTHIA6/AliDecayerPythia.h"
+#include "PYTHIA6/AliGenPythia.h"
+#include "TDPMjet/AliGenDPMjet.h"
+#include "THerwig/AliGenHerwig.h"
+#include "STEER/AliMagFCheb.h"
+#include "STRUCT/AliBODY.h"
+#include "STRUCT/AliMAG.h"
+#include "STRUCT/AliABSOv3.h"
+#include "STRUCT/AliDIPOv3.h"
+#include "STRUCT/AliHALLv3.h"
+#include "STRUCT/AliFRAMEv2.h"
+#include "STRUCT/AliSHILv3.h"
+#include "STRUCT/AliPIPEv3.h"
+#include "ITS/AliITSv11Hybrid.h"
+#include "TPC/AliTPCv2.h"
+#include "TOF/AliTOFv6T0.h"
+#include "HMPID/AliHMPIDv3.h"
+#include "ZDC/AliZDCv3.h"
+#include "TRD/AliTRDv1.h"
+#include "TRD/AliTRDgeometry.h"
+#include "FMD/AliFMDv1.h"
+#include "MUON/AliMUONv1.h"
+#include "PHOS/AliPHOSv1.h"
+#include "PHOS/AliPHOSSimParam.h"
+#include "PMD/AliPMDv1.h"
+#include "T0/AliT0v1.h"
+#include "EMCAL/AliEMCALv2.h"
+#include "ACORDE/AliACORDEv1.h"
+#include "VZERO/AliVZEROv7.h"
+#endif
+
+enum PDC06Proc_t
+{
+  kPythia6, kPhojet, kHerwig, kRunMax
+};
+
+const char * pprRunName[] =
+{ "kPythia6", "kPhojet", "kHerwig" };
+
+enum Mag_t
+{
+  kNoField, k5kG, kFieldMax
+};
+
+const char * pprField[] =
+{ "kNoField", "k5kG" };
+
+enum PprTrigConf_t
+{
+  kDefaultPPTrig, kDefaultPbPbTrig
+};
+
+const char * pprTrigConfName[] =
+{ "p-p", "Pb-Pb" };
+
+static PprTrigConf_t strig = kDefaultPPTrig;// default PP trigger configuration
+
+//--- Functions ---
+
+class AliGenPythia;
+AliGenerator *MbPythia();
+AliGenerator *MbPhojet();
+AliGenerator *Herwig();
+void ProcessEnvironmentVars();
+
+// Geterator, field, beam energy
+static PDC06Proc_t proc = kHerwig;
+static Mag_t mag = k5kG;
+static Float_t energy = 10000; // energy in CMS
+//========================//
+// Set Random Number seed //
+//========================//
+TDatime dt;
+static UInt_t seed = dt.Get();
+
+// Comment line
+static TString comment;
+
+void Config()
+{
+
+  // Get settings from environment variables
+  ProcessEnvironmentVars();
+
+  gRandom->SetSeed(seed);
+  cerr << "Seed for random number generation= " << seed << endl;
+
+  // Libraries required by geant321
+#if defined(__CINT__)
+  gSystem->Load("liblhapdf"); // Parton density functions
+  gSystem->Load("libEGPythia6"); // TGenerator interface
+  gSystem->Load("libpythia6"); // Pythia
+  gSystem->Load("libAliPythia6"); // ALICE specific implementations
+  gSystem->Load("libgeant321");
+#endif
+
+  new TGeant3TGeo("C++ Interface to Geant3");
+
+  //=======================================================================
+  //  Create the output file
+
+
+  AliRunLoader* rl = 0x0;
+
+  cout << "Config.C: Creating Run Loader ..." << endl;
+  rl = AliRunLoader::Open("galice.root", AliConfig::GetDefaultEventFolderName(), "recreate");
+  if (rl == 0x0)
+  {
+    gAlice->Fatal("Config.C", "Can not instatiate the Run Loader");
+    return;
+  }
+  rl->SetCompressionLevel(2);
+  rl->SetNumberOfEventsPerFile(1000);
+  gAlice->SetRunLoader(rl);
+
+  // Set the trigger configuration: proton-proton
+  gAlice->SetTriggerDescriptor(pprTrigConfName[strig]);
+  cout << "Trigger configuration is set to  " << pprTrigConfName[strig] << endl;
+
+  //
+  //=======================================================================
+  // ************* STEERING parameters FOR ALICE SIMULATION **************
+  // --- Specify event type to be tracked through the ALICE setup
+  // --- All positions are in cm, angles in degrees, and P and E in GeV
+
+
+  gMC->SetProcess("DCAY", 1);
+  gMC->SetProcess("PAIR", 1);
+  gMC->SetProcess("COMP", 1);
+  gMC->SetProcess("PHOT", 1);
+  gMC->SetProcess("PFIS", 0);
+  gMC->SetProcess("DRAY", 0);
+  gMC->SetProcess("ANNI", 1);
+  gMC->SetProcess("BREM", 1);
+  gMC->SetProcess("MUNU", 1);
+  gMC->SetProcess("CKOV", 1);
+  gMC->SetProcess("HADR", 1);
+  gMC->SetProcess("LOSS", 2);
+  gMC->SetProcess("MULS", 1);
+  gMC->SetProcess("RAYL", 1);
+
+  Float_t cut = 1.e-3; // 1MeV cut by default
+  Float_t tofmax = 1.e10;
+
+  gMC->SetCut("CUTGAM", cut);
+  gMC->SetCut("CUTELE", cut);
+  gMC->SetCut("CUTNEU", cut);
+  gMC->SetCut("CUTHAD", cut);
+  gMC->SetCut("CUTMUO", cut);
+  gMC->SetCut("BCUTE", cut);
+  gMC->SetCut("BCUTM", cut);
+  gMC->SetCut("DCUTE", cut);
+  gMC->SetCut("DCUTM", cut);
+  gMC->SetCut("PPCUTM", cut);
+  gMC->SetCut("TOFMAX", tofmax);
+
+  //======================//
+  // Set External decayer //
+  //======================//
+  TVirtualMCDecayer* decayer = new AliDecayerPythia();
+  decayer->SetForceDecay(kAll);
+  decayer->Init();
+  gMC->SetExternalDecayer(decayer);
+
+  //=========================//
+  // Generator Configuration //
+  //=========================//
+  AliGenerator* gener = 0x0;
+
+  switch (proc)
+  {
+  case kPythia6:
+    gener = MbPythia();
+    break;
+  case kPhojet:
+    gener = MbPhojet();
+    break;
+  case kHerwig:
+    gener = Herwig();
+    break;
+  }
+
+  // PRIMARY VERTEX
+  //
+  gener->SetOrigin(0., 0., 0.); // vertex position
+  //
+  // Size of the interaction diamond
+  // Longitudinal
+  Float_t sigmaz = 5.4 / TMath::Sqrt(2.); // [cm]
+  if (energy == 900)
+    sigmaz = 10.5 / TMath::Sqrt(2.); // [cm]
+  //
+  // Transverse
+  Float_t betast = 10; // beta* [m]
+  Float_t eps = 3.75e-6; // emittance [m]
+  Float_t gamma = energy / 2.0 / 0.938272; // relativistic gamma [1]
+  Float_t sigmaxy = TMath::Sqrt(eps * betast / gamma) / TMath::Sqrt(2.) * 100.; // [cm]
+  printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
+
+  gener->SetSigma(sigmaxy, sigmaxy, sigmaz); // Sigma in (X,Y,Z) (cm) on IP position
+  gener->SetCutVertexZ(3.); // Truncate at 3 sigma
+  gener->SetVertexSmear(kPerEvent);
+
+  gener->Init();
+
+  // FIELD
+  AliMagF* field = 0x0;
+
+  if (mag == kNoField)
+  {
+    comment = comment.Append(" | L3 field 0.0 T");
+    field = new AliMagF("Maps", "Maps", -1., -1., AliMagF::k2kG);
+  }
+  else if (mag == k5kG)
+  {
+    comment = comment.Append(" | L3 field 0.5 T");
+    field = new AliMagF("Maps", "Maps", -1., -1., AliMagF::k5kG);
+  }
+  printf("\n \n Comment: %s \n \n", comment.Data());
+
+  TGeoGlobalMagField::Instance()->SetField(field);
+
+  rl->CdGAFile();
+
+  Int_t iABSO = 1;
+  Int_t iACORDE = 0;
+  Int_t iDIPO = 1;
+  Int_t iEMCAL = 0;
+  Int_t iFMD = 1;
+  Int_t iFRAME = 1;
+  Int_t iHALL = 1;
+  Int_t iITS = 1;
+  Int_t iMAG = 1;
+  Int_t iMUON = 1;
+  Int_t iPHOS = 1;
+  Int_t iPIPE = 1;
+  Int_t iPMD = 0;
+  Int_t iHMPID = 1;
+  Int_t iSHIL = 1;
+  Int_t iT0 = 1;
+  Int_t iTOF = 1;
+  Int_t iTPC = 1;
+  Int_t iTRD = 1;
+  Int_t iVZERO = 1;
+  Int_t iZDC = 1;
+
+  //=================== Alice BODY parameters =============================
+  AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
+
+  if (iMAG)
+  {
+    //=================== MAG parameters ============================
+    // --- Start with Magnet since detector layouts may be depending ---
+    // --- on the selected Magnet dimensions ---
+    AliMAG *MAG = new AliMAG("MAG", "Magnet");
+  }
+
+  if (iABSO)
+  {
+    //=================== ABSO parameters ============================
+    AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
+  }
+
+  if (iDIPO)
+  {
+    //=================== DIPO parameters ============================
+
+    AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
+  }
+
+  if (iHALL)
+  {
+    //=================== HALL parameters ============================
+
+    AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
+  }
+
+  if (iFRAME)
+  {
+    //=================== FRAME parameters ============================
+
+    AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
+    FRAME->SetHoles(1);
+  }
+
+  if (iSHIL)
+  {
+    //=================== SHIL parameters ============================
+
+    AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
+  }
+
+  if (iPIPE)
+  {
+    //=================== PIPE parameters ============================
+
+    AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
+  }
+
+  if (iITS)
+  {
+    //=================== ITS parameters ============================
+
+    AliITS *ITS = new AliITSv11Hybrid("ITS", "ITS v11Hybrid");
+  }
+
+  if (iTPC)
+  {
+    //============================ TPC parameters =====================
+
+    AliTPC *TPC = new AliTPCv2("TPC", "Default");
+  }
+
+  if (iTOF)
+  {
+    //=================== TOF parameters ============================
+
+    AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
+  }
+
+  if (iHMPID)
+  {
+    //=================== HMPID parameters ===========================
+
+    AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
+
+  }
+
+  if (iZDC)
+  {
+    //=================== ZDC parameters ============================
+
+    AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
+  }
+
+  if (iTRD)
+  {
+    //=================== TRD parameters ============================
+
+    AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
+    AliTRDgeometry *geoTRD = TRD->GetGeometry();
+    // Partial geometry: modules at 0,1,7,8,9,10,17
+    // starting at 3h in positive direction
+    geoTRD->SetSMstatus(2, 0);
+    geoTRD->SetSMstatus(3, 0);
+    geoTRD->SetSMstatus(4, 0);
+    geoTRD->SetSMstatus(5, 0);
+    geoTRD->SetSMstatus(6, 0);
+    geoTRD->SetSMstatus(11, 0);
+    geoTRD->SetSMstatus(12, 0);
+    geoTRD->SetSMstatus(13, 0);
+    geoTRD->SetSMstatus(14, 0);
+    geoTRD->SetSMstatus(15, 0);
+    geoTRD->SetSMstatus(16, 0);
+  }
+
+  if (iFMD)
+  {
+    //=================== FMD parameters ============================
+
+    AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
+  }
+
+  if (iMUON)
+  {
+    //=================== MUON parameters ===========================
+    // New MUONv1 version (geometry defined via builders)
+
+    AliMUON *MUON = new AliMUONv1("MUON", "default");
+  }
+
+  if (iPHOS)
+  {
+    //=================== PHOS parameters ===========================
+
+    AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
+    //Set simulation parameters different from the default ones.
+    AliPHOSSimParam* simEmc = AliPHOSSimParam::GetInstance();
+
+    // APD noise of warm (+20C) PHOS:
+    // a2 = a1*(Y1/Y2)*(M1/M2), where a1 = 0.012 is APD noise at -25C,
+    // Y1 = 4.3 photo-electrons/MeV, Y2 = 1.7 p.e/MeV - light yields at -25C and +20C,
+    // M1 = 50, M2 = 50 - APD gain factors chosen for t1 = -25C and t2 = +20C,
+    // Y = MeanLightYield*APDEfficiency.
+
+    Float_t apdNoise = 0.012 * 2.5;
+    simEmc->SetAPDNoise(apdNoise);
+
+    //Raw Light Yield at +20C
+    simEmc->SetMeanLightYield(18800);
+
+    //ADC channel width at +18C.
+    simEmc->SetADCchannelW(0.0125);
+  }
+
+  if (iPMD)
+  {
+    //=================== PMD parameters ============================
+
+    AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
+  }
+
+  if (iT0)
+  {
+    //=================== T0 parameters ============================
+    AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
+  }
+
+  if (iEMCAL)
+  {
+    //=================== EMCAL parameters ============================
+
+    AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
+  }
+
+  if (iACORDE)
+  {
+    //=================== ACORDE parameters ============================
+
+    AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
+  }
+
+  if (iVZERO)
+  {
+    //=================== ACORDE parameters ============================
+
+    AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
+  }
+}
+
+//           PYTHIA
+AliGenerator* MbPythia()
+{
+  comment = comment.Append(" pp at 14 TeV: Pythia low-pt");
+
+  AliGenPythia* pythia = new AliGenPythia(-1);
+  pythia->SetMomentumRange(0, 999999.);
+  pythia->SetThetaRange(0., 180.);
+  pythia->SetYRange(-12., 12.);
+  pythia->SetPtRange(0, 1000.);
+  pythia->SetProcess(kPyMb);
+  pythia->SetEnergyCMS(energy);
+
+  return pythia;
+}
+
+//          DPMJET
+AliGenerator* MbPhojet()
+{
+  comment = comment.Append(" pp at 14 TeV: Phojet low-pt");
+
+#if defined(__CINT__)
+  gSystem->Load("libdpmjet"); // Parton density functions
+  gSystem->Load("libTDPMjet"); // Parton density functions
+#endif
+
+  AliGenDPMjet* dpmjet = new AliGenDPMjet(-1);
+  dpmjet->SetMomentumRange(0, 999999.);
+  dpmjet->SetThetaRange(0., 180.);
+  dpmjet->SetYRange(-12., 12.);
+  dpmjet->SetPtRange(0, 1000.);
+  dpmjet->SetProcess(kDpmMb);
+  dpmjet->SetEnergyCMS(energy);
+
+  return dpmjet;
+}
+
+//          HERWIG
+AliGenerator* Herwig()
+{
+  comment = comment.Append("pp at 14 TeV: Herwig");
+
+#if defined(__CINT__)
+  gSystem->Load("libherwig"); // HERWIG library
+  gSystem->Load("libTHerwig"); // HERWIG library
+#endif
+
+    AliGenHerwig *herwig = new AliGenHerwig(-1);
+    // final state kinematic cuts
+    herwig->SetOrigin(0,0,0); // vertex position
+    herwig->SetVertexSmear(kPerEvent);
+    herwig->SetSigma(0, 0, 5.6); // Sigma in (X,Y,Z) (cm) on IP position
+    // Beams
+    herwig->SetProjectile("P");
+    herwig->SetTarget("P");
+    // Beam momenta
+    herwig->SetBeamMomenta(3500., 3500.);
+    // bbar
+    herwig->SetProcess(1705);
+
+  return herwig;
+}
+
+void ProcessEnvironmentVars()
+{
+  // Run type
+  if (gSystem->Getenv("CONFIG_RUN_TYPE"))
+  {
+    for (Int_t iRun = 0; iRun < kRunMax; iRun++)
+    {
+      if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun]) == 0)
+      {
+        proc = (PDC06Proc_t) iRun;
+        cout << "Run type set to " << pprRunName[iRun] << endl;
+      }
+    }
+  }
+
+  // Field
+  if (gSystem->Getenv("CONFIG_FIELD"))
+  {
+    for (Int_t iField = 0; iField < kFieldMax; iField++)
+    {
+      if (strcmp(gSystem->Getenv("CONFIG_FIELD"), pprField[iField]) == 0)
+      {
+        mag = (Mag_t) iField;
+        cout << "Field set to " << pprField[iField] << endl;
+      }
+    }
+  }
+
+  // Energy
+  if (gSystem->Getenv("CONFIG_ENERGY"))
+  {
+    energy = atoi(gSystem->Getenv("CONFIG_ENERGY"));
+    cout << "Energy set to " << energy << " GeV" << endl;
+  }
+
+  // Random Number seed
+  if (gSystem->Getenv("CONFIG_SEED"))
+  {
+    seed = atoi(gSystem->Getenv("CONFIG_SEED"));
+  }
+}
diff --git a/test/generators/herwig/aod.C b/test/generators/herwig/aod.C
new file mode 100644 (file)
index 0000000..a87c0b3
--- /dev/null
@@ -0,0 +1,16 @@
+void aod(){
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibs.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+
+  gSystem->Load("liblhapdf");      // Parton density functions
+  gSystem->Load("libEGPythia6");   // TGenerator interface
+  gSystem->Load("libpythia6");     // Pythia
+  gSystem->Load("libAliPythia6");  // ALICE specific implementations
+  gSystem->Load("libdpmjet");
+  gSystem->Load("libTDPMjet");
+  gROOT->Macro("$ALICE_ROOT/STEER/CreateAODfromESD.C");
+}
diff --git a/test/generators/herwig/check.C b/test/generators/herwig/check.C
new file mode 100644 (file)
index 0000000..5f336be
--- /dev/null
@@ -0,0 +1,16 @@
+void check(){
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibs.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+
+  gSystem->Load("liblhapdf");      // Parton density functions
+  gSystem->Load("libEGPythia6");   // TGenerator interface
+  gSystem->Load("libpythia6");     // Pythia
+  gSystem->Load("libAliPythia6");  // ALICE specific implementations
+  gSystem->Load("libdpmjet");
+  gSystem->Load("libTDPMjet");
+  gROOT->Macro("$ALICE_ROOT/STEER/CheckESD.C");
+}
diff --git a/test/generators/herwig/monrec.C b/test/generators/herwig/monrec.C
new file mode 100644 (file)
index 0000000..c6f1330
--- /dev/null
@@ -0,0 +1,28 @@
+void monrec() {
+  // MonaLisa monitoring
+  gSystem->Load("libNet.so");
+  gSystem->Load("libMonaLisa.so");
+
+  new TMonaLisaWriter("aliendb3.cern.ch", "Reconstruction pp", gSystem->Getenv("TEST_PLATFORMID"), gSystem->Getenv("TEST_PLATFORMID"), "global");
+
+
+  gROOT->LoadMacro("rec.C");
+  rec();
+  if (gMonitoringWriter) gMonitoringWriter->SendProcessingProgress(1,1,kTRUE);  
+
+  // Send the size of the AliESDs.root file
+
+  FileStat_t buf;
+  gSystem->GetPathInfo("./AliESDs.root",buf);
+
+  TList *valuelist = new TList();
+  valuelist->SetOwner(kTRUE);
+
+  TMonaLisaValue* valdouble = new TMonaLisaValue("AliESDs.root size",buf.fSize);
+  valuelist->Add(valdouble);
+
+  if (gMonitoringWriter) gMonitoringWriter->SendParameters(valuelist);
+  delete valuelist;
+
+  printf("#Test finished successfully#\n");
+}
diff --git a/test/generators/herwig/monsim.C b/test/generators/herwig/monsim.C
new file mode 100644 (file)
index 0000000..fcc88ff
--- /dev/null
@@ -0,0 +1,27 @@
+void monsim(Int_t nev=20){ 
+  // MonaLisa monitoring
+  gSystem->Load("libNet.so");
+  gSystem->Load("libMonaLisa.so");
+
+  new TMonaLisaWriter("aliendb3.cern.ch", "Simulation pp", gSystem->Getenv("TEST_PLATFORMID"), gSystem->Getenv("TEST_PLATFORMID"), "global");
+
+  gROOT->LoadMacro("sim.C");
+  sim(nev);
+  if (gMonitoringWriter) gMonitoringWriter->SendProcessingProgress(1,1,kTRUE);  
+
+  // Send the size of the raw.root file
+
+  FileStat_t buf;
+  gSystem->GetPathInfo("./raw.root",buf);
+
+  TList *valuelist = new TList();
+  valuelist->SetOwner(kTRUE);
+
+  TMonaLisaValue* valdouble = new TMonaLisaValue("raw.root size",buf.fSize);
+  valuelist->Add(valdouble);
+
+  if (gMonitoringWriter) gMonitoringWriter->SendParameters(valuelist);
+  delete valuelist;
+
+  printf("#Test finished successfully#\n");
+}
diff --git a/test/generators/herwig/runtest.sh b/test/generators/herwig/runtest.sh
new file mode 100755 (executable)
index 0000000..4b69e14
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Root
+# export ROOTSYS=/afs/cern.ch/alice/library/root/new
+# export PATH=$ROOTSYS/bin:$PATH
+# export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
+# AliRoot
+# export ALICE=/afs/cern.ch/alice/library
+# export ALICE_LEVEL=new
+# export ALICE_ROOT=$ALICE/$ALICE_LEVEL
+# export ALICE_TARGET=`$ROOTSYS/bin/root-config --arch`
+# export PATH=$ALICE_ROOT/bin/tgt_${ALICE_TARGET}:$PATH
+# export LD_LIBRARY_PATH=$ALICE_ROOT/lib/tgt_${ALICE_TARGET}:$LD_LIBRARY_PATH
+# Geant3
+# export LD_LIBRARY_PATH=$ALICE/geant3/lib/tgt_${ALICE_TARGET}:$LD_LIBRARY_PATH
+
+rm -rf *.root *.dat *.log fort* hlt hough raw* recraw/*.root recraw/*.log
+aliroot -b -q $1sim.C      2>&1 | tee sim.log
+mv syswatch.log simwatch.log
+aliroot -b -q $1rec.C      2>&1 | tee rec.log
+mv syswatch.log recwatch.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CheckESD.C 2>&1 | tee check.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CreateAODfromESD.C 2>&1 | tee aod.log
+
+cd recraw
+ln -s ../raw.root
+aliroot -b -q rec.C      2>&1 | tee rec.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CreateAODfromESD.C 2>&1 | tee aod.log
+
+
+
diff --git a/test/generators/herwig/sim.C b/test/generators/herwig/sim.C
new file mode 100644 (file)
index 0000000..84333ed
--- /dev/null
@@ -0,0 +1,18 @@
+void sim(Int_t nev=5) {
+
+
+  AliSimulation simulator;
+  simulator.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO");
+  simulator.SetMakeDigitsFromHits("ITS TPC");
+  simulator.SetWriteRawData("ALL","raw.root",kTRUE);
+
+  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/generators/herwig/testvert.C b/test/generators/herwig/testvert.C
new file mode 100644 (file)
index 0000000..dab13a7
--- /dev/null
@@ -0,0 +1,25 @@
+void testvert() {
+
+  TFile f("AliESDs.root");
+
+  TTree * tree = (TTree*)f.Get("esdTree");
+
+  AliESDEvent * esd = new AliESDEvent();// The signal ESD object is put here
+  esd->ReadFromTree(tree);
+
+  Int_t nev = tree->GetEntriesFast();
+  
+  for (Int_t iev=0; iev<nev; iev++) {
+    cout << "---------- Signal event ----------" << iev << endl;
+
+    // Get ESD
+    tree->GetEntry(iev);
+
+    AliESDVertex * vert = esd->GetPrimaryVertex();
+
+    if (vert) cout << vert->GetTitle() << endl;
+
+    if (strstr(vert->GetTitle(),"VertexerTracks")) cout << "OK" << endl;
+
+  }
+}
diff --git a/test/generators/therminator/Config.C b/test/generators/therminator/Config.C
new file mode 100644 (file)
index 0000000..0d191a7
--- /dev/null
@@ -0,0 +1,560 @@
+//
+// Configuration for the first physics production 2008
+//
+
+// One can use the configuration macro in compiled mode by
+// root [0] gSystem->Load("libgeant321");
+// root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
+//                   -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
+// root [0] .x grun.C(1,"Config.C++")
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <Riostream.h>
+#include <TRandom.h>
+#include <TDatime.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
+#include <TGeant3TGeo.h>
+#include "STEER/AliRunLoader.h"
+#include "STEER/AliRun.h"
+#include "STEER/AliConfig.h"
+#include "PYTHIA6/AliDecayerPythia.h"
+#include "PYTHIA6/AliGenPythia.h"
+#include "TDPMjet/AliGenDPMjet.h"
+#include "STEER/AliMagFCheb.h"
+#include "STRUCT/AliBODY.h"
+#include "STRUCT/AliMAG.h"
+#include "STRUCT/AliABSOv3.h"
+#include "STRUCT/AliDIPOv3.h"
+#include "STRUCT/AliHALLv3.h"
+#include "STRUCT/AliFRAMEv2.h"
+#include "STRUCT/AliSHILv3.h"
+#include "STRUCT/AliPIPEv3.h"
+#include "ITS/AliITSv11Hybrid.h"
+#include "TPC/AliTPCv2.h"
+#include "TOF/AliTOFv6T0.h"
+#include "HMPID/AliHMPIDv3.h"
+#include "ZDC/AliZDCv3.h"
+#include "TRD/AliTRDv1.h"
+#include "TRD/AliTRDgeometry.h"
+#include "FMD/AliFMDv1.h"
+#include "MUON/AliMUONv1.h"
+#include "PHOS/AliPHOSv1.h"
+#include "PHOS/AliPHOSSimParam.h"
+#include "PMD/AliPMDv1.h"
+#include "T0/AliT0v1.h"
+#include "EMCAL/AliEMCALv2.h"
+#include "ACORDE/AliACORDEv1.h"
+#include "VZERO/AliVZEROv7.h"
+#endif
+
+enum PDC06Proc_t
+{
+  kPythia6, kPhojet, kTherminator, kRunMax
+};
+
+const char  * pprRunName[] =
+{
+  "kPythia6", "kPhojet", "kTherminator"
+};
+
+enum Mag_t
+{
+  kNoField, k5kG, kFieldMax
+};
+
+const char * pprField[] =
+{
+"kNoField", "k5kG"
+};
+
+enum PprTrigConf_t
+{
+kDefaultPPTrig, kDefaultPbPbTrig
+};
+
+const char * pprTrigConfName[] =
+{
+"p-p","Pb-Pb"
+};
+
+static PprTrigConf_t strig = kDefaultPbPbTrig;// default PP trigger configuration
+
+//--- Functions ---
+class AliGenPythia;
+AliGenerator *MbPythia();
+AliGenerator *MbPhojet();
+AliGenerator *Therminator();
+void ProcessEnvironmentVars();
+
+// Geterator, field, beam energy
+static PDC06Proc_t proc = kTherminator;
+static Mag_t mag = k5kG;
+static Float_t energy = 10000; // energy in CMS
+//======================= =//
+// Set Random Number seed //
+//========================//
+TDatime dt;
+static UInt_t seed = dt.Get();
+
+// Comment line
+static TString comment;
+
+void Config()
+{
+
+  // Get settings from environment variables
+  ProcessEnvironmentVars();
+
+  gRandom->SetSeed(seed);
+  cerr<<"Seed for random number generation= "<<seed<<endl;
+
+  // Libraries required by geant321
+#if defined(__CINT__)
+  gSystem->Load("liblhapdf"); // Parton density functions
+  gSystem->Load("libEGPythia6"); // TGenerator interface
+  gSystem->Load("libpythia6"); // Pythia
+  gSystem->Load("libAliPythia6"); // ALICE specific implementations
+  gSystem->Load("libgeant321");
+#endif
+
+  new TGeant3TGeo("C++ Interface to Geant3");
+
+  //=======================================================================
+  //  Create the output file
+
+
+  AliRunLoader* rl=0x0;
+
+  cout<<"Config.C: Creating Run Loader ..."<<endl;
+  rl = AliRunLoader::Open("galice.root",
+      AliConfig::GetDefaultEventFolderName(),
+      "recreate");
+  if (rl == 0x0)
+  {
+    gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
+    return;
+  }
+  rl->SetCompressionLevel(2);
+  rl->SetNumberOfEventsPerFile(1000);
+  gAlice->SetRunLoader(rl);
+
+  // Set the trigger configuration: proton-proton
+  gAlice->SetTriggerDescriptor(pprTrigConfName[strig]);
+  cout<<"Trigger configuration is set to  "<<pprTrigConfName[strig]<<endl;
+
+  //
+  //=======================================================================
+  // ************* STEERING parameters FOR ALICE SIMULATION **************
+  // --- Specify event type to be tracked through the ALICE setup
+  // --- All positions are in cm, angles in degrees, and P and E in GeV
+
+
+  gMC->SetProcess("DCAY",1);
+  gMC->SetProcess("PAIR",1);
+  gMC->SetProcess("COMP",1);
+  gMC->SetProcess("PHOT",1);
+  gMC->SetProcess("PFIS",0);
+  gMC->SetProcess("DRAY",0);
+  gMC->SetProcess("ANNI",1);
+  gMC->SetProcess("BREM",1);
+  gMC->SetProcess("MUNU",1);
+  gMC->SetProcess("CKOV",1);
+  gMC->SetProcess("HADR",1);
+  gMC->SetProcess("LOSS",2);
+  gMC->SetProcess("MULS",1);
+  gMC->SetProcess("RAYL",1);
+
+  Float_t cut = 1.e-3; // 1MeV cut by default
+  Float_t tofmax = 1.e10;
+
+  gMC->SetCut("CUTGAM", cut);
+  gMC->SetCut("CUTELE", cut);
+  gMC->SetCut("CUTNEU", cut);
+  gMC->SetCut("CUTHAD", cut);
+  gMC->SetCut("CUTMUO", cut);
+  gMC->SetCut("BCUTE", cut);
+  gMC->SetCut("BCUTM", cut);
+  gMC->SetCut("DCUTE", cut);
+  gMC->SetCut("DCUTM", cut);
+  gMC->SetCut("PPCUTM", cut);
+  gMC->SetCut("TOFMAX", tofmax);
+
+  //======================//
+  // Set External decayer //
+  //======================//
+  TVirtualMCDecayer* decayer = new AliDecayerPythia();
+  decayer->SetForceDecay(kAll);
+  decayer->Init();
+  gMC->SetExternalDecayer(decayer);
+
+  //=========================//
+  // Generator Configuration //
+  //=========================//
+  AliGenerator* gener = 0x0;
+
+  switch (proc)
+  {
+    case kPythia6:
+    gener = MbPythia();
+    break;
+    case kPhojet:
+    gener = MbPhojet();
+    break;
+    case kTherminator:
+    gener = Therminator();
+    break;
+  }
+
+  // PRIMARY VERTEX
+  //
+  gener->SetOrigin(0., 0., 0.); // vertex position
+  //
+  // Size of the interaction diamond
+  // Longitudinal
+  Float_t sigmaz = 5.4 / TMath::Sqrt(2.); // [cm]
+  if (energy == 900)
+  sigmaz = 10.5 / TMath::Sqrt(2.); // [cm]
+  //
+  // Transverse
+  Float_t betast = 10; // beta* [m]
+  Float_t eps = 3.75e-6; // emittance [m]
+  Float_t gamma = energy / 2.0 / 0.938272; // relativistic gamma [1]
+  Float_t sigmaxy = TMath::Sqrt(eps * betast / gamma) / TMath::Sqrt(2.) * 100.; // [cm]
+  printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
+
+  gener->SetSigma(sigmaxy, sigmaxy, sigmaz); // Sigma in (X,Y,Z) (cm) on IP position
+  gener->SetCutVertexZ(3.); // Truncate at 3 sigma
+  gener->SetVertexSmear(kPerEvent);
+
+  gener->Init();
+
+  // FIELD
+  AliMagF* field = 0x0;
+
+  if (mag == kNoField)
+  {
+    comment = comment.Append(" | L3 field 0.0 T");
+    field = new AliMagF("Maps","Maps", -1., -1., AliMagF::k2kG);
+  }
+  else if (mag == k5kG)
+  {
+    comment = comment.Append(" | L3 field 0.5 T");
+    field = new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kG);
+  }
+  printf("\n \n Comment: %s \n \n", comment.Data());
+
+  TGeoGlobalMagField::Instance()->SetField(field);
+
+  rl->CdGAFile();
+
+  Int_t iABSO = 1;
+  Int_t iACORDE= 0;
+  Int_t iDIPO = 1;
+  Int_t iEMCAL = 0;
+  Int_t iFMD = 1;
+  Int_t iFRAME = 1;
+  Int_t iHALL = 1;
+  Int_t iITS = 1;
+  Int_t iMAG = 1;
+  Int_t iMUON = 1;
+  Int_t iPHOS = 1;
+  Int_t iPIPE = 1;
+  Int_t iPMD = 0;
+  Int_t iHMPID = 1;
+  Int_t iSHIL = 1;
+  Int_t iT0 = 1;
+  Int_t iTOF = 1;
+  Int_t iTPC = 1;
+  Int_t iTRD = 1;
+  Int_t iVZERO = 1;
+  Int_t iZDC = 1;
+
+  //=================== Alice BODY parameters =============================
+  AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
+
+  if (iMAG)
+  {
+    //=================== MAG parameters ============================
+    // --- Start with Magnet since detector layouts may be depending ---
+    // --- on the selected Magnet dimensions ---
+    AliMAG *MAG = new AliMAG("MAG", "Magnet");
+  }
+
+  if (iABSO)
+  {
+    //=================== ABSO parameters ============================
+    AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
+  }
+
+  if (iDIPO)
+  {
+    //=================== DIPO parameters ============================
+
+    AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
+  }
+
+  if (iHALL)
+  {
+    //=================== HALL parameters ============================
+
+    AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
+  }
+
+  if (iFRAME)
+  {
+    //=================== FRAME parameters ============================
+
+    AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
+    FRAME->SetHoles(1);
+  }
+
+  if (iSHIL)
+  {
+    //=================== SHIL parameters ============================
+
+    AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
+  }
+
+  if (iPIPE)
+  {
+    //=================== PIPE parameters ============================
+
+    AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
+  }
+
+  if (iITS)
+  {
+    //=================== ITS parameters ============================
+
+    AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
+  }
+
+  if (iTPC)
+  {
+    //============================ TPC parameters =====================
+
+    AliTPC *TPC = new AliTPCv2("TPC", "Default");
+  }
+
+  if (iTOF)
+  {
+    //=================== TOF parameters ============================
+
+    AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
+  }
+
+  if (iHMPID)
+  {
+    //=================== HMPID parameters ===========================
+
+    AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
+
+  }
+
+  if (iZDC)
+  {
+    //=================== ZDC parameters ============================
+
+    AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
+  }
+
+  if (iTRD)
+  {
+    //=================== TRD parameters ============================
+
+    AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
+    AliTRDgeometry *geoTRD = TRD->GetGeometry();
+    // Partial geometry: modules at 0,1,7,8,9,10,17
+    // starting at 3h in positive direction
+    geoTRD->SetSMstatus(2,0);
+    geoTRD->SetSMstatus(3,0);
+    geoTRD->SetSMstatus(4,0);
+    geoTRD->SetSMstatus(5,0);
+    geoTRD->SetSMstatus(6,0);
+    geoTRD->SetSMstatus(11,0);
+    geoTRD->SetSMstatus(12,0);
+    geoTRD->SetSMstatus(13,0);
+    geoTRD->SetSMstatus(14,0);
+    geoTRD->SetSMstatus(15,0);
+    geoTRD->SetSMstatus(16,0);
+  }
+
+  if (iFMD)
+  {
+    //=================== FMD parameters ============================
+
+    AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
+  }
+
+  if (iMUON)
+  {
+    //=================== MUON parameters ===========================
+    // New MUONv1 version (geometry defined via builders)
+
+    AliMUON *MUON = new AliMUONv1("MUON", "default");
+  }
+
+  if (iPHOS)
+  {
+    //=================== PHOS parameters ===========================
+
+    AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
+    //Set simulation parameters different from the default ones.
+    AliPHOSSimParam* simEmc = AliPHOSSimParam::GetInstance();
+
+    // APD noise of warm (+20C) PHOS:
+    // a2 = a1*(Y1/Y2)*(M1/M2), where a1 = 0.012 is APD noise at -25C,
+    // Y1 = 4.3 photo-electrons/MeV, Y2 = 1.7 p.e/MeV - light yields at -25C and +20C,
+    // M1 = 50, M2 = 50 - APD gain factors chosen for t1 = -25C and t2 = +20C,
+    // Y = MeanLightYield*APDEfficiency.
+
+    Float_t apdNoise = 0.012*2.5;
+    simEmc->SetAPDNoise(apdNoise);
+
+    //Raw Light Yield at +20C
+    simEmc->SetMeanLightYield(18800);
+
+    //ADC channel width at +18C.
+    simEmc->SetADCchannelW(0.0125);
+  }
+
+  if (iPMD)
+  {
+    //=================== PMD parameters ============================
+
+    AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
+      }
+
+      if (iT0)
+{
+  //=================== T0 parameters ============================
+AliT0  *T0 = new AliT0v1("T0", "T0 Detector");
+}
+
+if (iEMCAL)
+{
+  //=================== EMCAL parameters ============================
+
+  AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
+}
+
+if (iACORDE)
+{
+  //  =================== ACORDE parameters ============================
+
+AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
+}
+
+if (iVZERO)
+{
+//=================== ACORDE parameters ============================
+
+AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
+}
+}
+//
+//           PYTHIA
+//
+
+AliGenerator* MbPythia()
+{
+comment = comment.Append(" pp at 14 TeV: Pythia low-pt");
+//
+//    Pythia
+AliGenPythia* pythia = new AliGenPythia(-1);
+pythia->SetMomentumRange(0, 999999.);
+pythia->SetThetaRange(0., 180.);
+pythia->SetYRange(-12.,12.);
+pythia->SetPtRange(0,1000.);
+pythia->SetProcess(kPyMb);
+pythia->SetEnergyCMS(energy);
+
+return pythia;
+}
+
+AliGenerator* MbPhojet()
+{
+comment = comment.Append(" pp at 14 TeV: Phojet low-pt");
+//
+//    DPMJET
+#if defined(__CINT__)
+gSystem->Load("libdpmjet"); // Parton density functions
+gSystem->Load("libTDPMjet"); // Parton density functions
+#endif
+AliGenDPMjet* dpmjet = new AliGenDPMjet(-1);
+dpmjet->SetMomentumRange(0, 999999.);
+dpmjet->SetThetaRange(0., 180.);
+dpmjet->SetYRange(-12.,12.);
+dpmjet->SetPtRange(0,1000.);
+dpmjet->SetProcess(kDpmMb);
+dpmjet->SetEnergyCMS(energy);
+
+return dpmjet;
+}
+
+AliGenerator* Therminator()
+{
+comment = comment.Append(" pp at 14 TeV: Therminator");
+
+#if defined(__CINT__)
+gSystem->Load("libTTherminator"); // Therminator library
+#endif
+AliGenTherminator *genther = new AliGenTherminator();
+genther->SetFileName("event.out");
+genther->SetEventNumberInFile(1);
+genther->SetTemperature(0.145);
+genther->SetMiuI(-0.0009);
+genther->SetMiuS(0.000);
+genther->SetMiuB(0.0008);
+genther->SetAlfaRange(8.0);
+genther->SetRapRange(4.0);
+genther->SetRhoMax(7.74);
+genther->SetTau(9.74);
+genther->SetModel("Lhyquid3D");
+genther->SetLhyquidSet("LHC500C2030");
+
+return genther;
+}
+
+void ProcessEnvironmentVars()
+{
+// Run type
+if (gSystem->Getenv("CONFIG_RUN_TYPE"))
+{
+  for (Int_t iRun = 0; iRun < kRunMax; iRun++)
+  {
+    if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0)
+    {
+      proc = (PDC06Proc_t)iRun;
+      cout<<"Run type set to "<<pprRunName[iRun]<<endl;
+    }
+  }
+}
+
+// Field
+if (gSystem->Getenv("CONFIG_FIELD"))
+{
+  for (Int_t iField = 0; iField < kFieldMax; iField++)
+  {
+    if (strcmp(gSystem->Getenv("CONFIG_FIELD"), pprField[iField])==0)
+    {
+      mag = (Mag_t)iField;
+      cout<<"Field set to "<<pprField[iField]<<endl;
+    }
+  }
+}
+
+// Energy
+if (gSystem->Getenv("CONFIG_ENERGY"))
+{
+  energy = atoi(gSystem->Getenv("CONFIG_ENERGY"));
+  cout<<"Energy set to "<<energy<<" GeV"<<endl;
+}
+
+// Random Number seed
+if (gSystem->Getenv("CONFIG_SEED"))
+{
+  seed = atoi(gSystem->Getenv("CONFIG_SEED"));
+}
+}
diff --git a/test/generators/therminator/aod.C b/test/generators/therminator/aod.C
new file mode 100644 (file)
index 0000000..a87c0b3
--- /dev/null
@@ -0,0 +1,16 @@
+void aod(){
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibs.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+
+  gSystem->Load("liblhapdf");      // Parton density functions
+  gSystem->Load("libEGPythia6");   // TGenerator interface
+  gSystem->Load("libpythia6");     // Pythia
+  gSystem->Load("libAliPythia6");  // ALICE specific implementations
+  gSystem->Load("libdpmjet");
+  gSystem->Load("libTDPMjet");
+  gROOT->Macro("$ALICE_ROOT/STEER/CreateAODfromESD.C");
+}
diff --git a/test/generators/therminator/check.C b/test/generators/therminator/check.C
new file mode 100644 (file)
index 0000000..5f336be
--- /dev/null
@@ -0,0 +1,16 @@
+void check(){
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibs.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+
+  gSystem->Load("liblhapdf");      // Parton density functions
+  gSystem->Load("libEGPythia6");   // TGenerator interface
+  gSystem->Load("libpythia6");     // Pythia
+  gSystem->Load("libAliPythia6");  // ALICE specific implementations
+  gSystem->Load("libdpmjet");
+  gSystem->Load("libTDPMjet");
+  gROOT->Macro("$ALICE_ROOT/STEER/CheckESD.C");
+}
diff --git a/test/generators/therminator/monrec.C b/test/generators/therminator/monrec.C
new file mode 100644 (file)
index 0000000..c6f1330
--- /dev/null
@@ -0,0 +1,28 @@
+void monrec() {
+  // MonaLisa monitoring
+  gSystem->Load("libNet.so");
+  gSystem->Load("libMonaLisa.so");
+
+  new TMonaLisaWriter("aliendb3.cern.ch", "Reconstruction pp", gSystem->Getenv("TEST_PLATFORMID"), gSystem->Getenv("TEST_PLATFORMID"), "global");
+
+
+  gROOT->LoadMacro("rec.C");
+  rec();
+  if (gMonitoringWriter) gMonitoringWriter->SendProcessingProgress(1,1,kTRUE);  
+
+  // Send the size of the AliESDs.root file
+
+  FileStat_t buf;
+  gSystem->GetPathInfo("./AliESDs.root",buf);
+
+  TList *valuelist = new TList();
+  valuelist->SetOwner(kTRUE);
+
+  TMonaLisaValue* valdouble = new TMonaLisaValue("AliESDs.root size",buf.fSize);
+  valuelist->Add(valdouble);
+
+  if (gMonitoringWriter) gMonitoringWriter->SendParameters(valuelist);
+  delete valuelist;
+
+  printf("#Test finished successfully#\n");
+}
diff --git a/test/generators/therminator/monsim.C b/test/generators/therminator/monsim.C
new file mode 100644 (file)
index 0000000..fcc88ff
--- /dev/null
@@ -0,0 +1,27 @@
+void monsim(Int_t nev=20){ 
+  // MonaLisa monitoring
+  gSystem->Load("libNet.so");
+  gSystem->Load("libMonaLisa.so");
+
+  new TMonaLisaWriter("aliendb3.cern.ch", "Simulation pp", gSystem->Getenv("TEST_PLATFORMID"), gSystem->Getenv("TEST_PLATFORMID"), "global");
+
+  gROOT->LoadMacro("sim.C");
+  sim(nev);
+  if (gMonitoringWriter) gMonitoringWriter->SendProcessingProgress(1,1,kTRUE);  
+
+  // Send the size of the raw.root file
+
+  FileStat_t buf;
+  gSystem->GetPathInfo("./raw.root",buf);
+
+  TList *valuelist = new TList();
+  valuelist->SetOwner(kTRUE);
+
+  TMonaLisaValue* valdouble = new TMonaLisaValue("raw.root size",buf.fSize);
+  valuelist->Add(valdouble);
+
+  if (gMonitoringWriter) gMonitoringWriter->SendParameters(valuelist);
+  delete valuelist;
+
+  printf("#Test finished successfully#\n");
+}
diff --git a/test/generators/therminator/rec.C b/test/generators/therminator/rec.C
new file mode 100644 (file)
index 0000000..ebed8d3
--- /dev/null
@@ -0,0 +1,27 @@
+void rec() {
+  if (!strcmp(gSystem->GetBuildArch(),"win32gcc")) {
+    gSystem->Load("libProof");
+    gSystem->Load("libGui");
+    gROOT->Macro("loadlibsrec.C");
+    new AliRun("gAlice","The ALICE Off-line Simulation Framework");
+  }
+  AliReconstruction reco;
+
+  reco.SetWriteESDfriend();
+  reco.SetWriteAlignmentData();
+
+  reco.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+  reco.SetSpecificStorage("GRP/GRP/Data",
+                         Form("local://%s",gSystem->pwd()));
+
+  AliGRPRecoParam *grpRecoParam = AliGRPRecoParam::GetLowFluxParam();
+  grpRecoParam->SetVertexerTracksConstraintITS(kFALSE);
+  grpRecoParam->SetVertexerTracksConstraintTPC(kFALSE);
+  reco.SetRecoParam("GRP",grpRecoParam);
+
+  TStopwatch timer;
+  timer.Start();
+  reco.Run();
+  timer.Stop();
+  timer.Print();
+}
diff --git a/test/generators/therminator/runtest.sh b/test/generators/therminator/runtest.sh
new file mode 100755 (executable)
index 0000000..4b69e14
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Root
+# export ROOTSYS=/afs/cern.ch/alice/library/root/new
+# export PATH=$ROOTSYS/bin:$PATH
+# export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
+# AliRoot
+# export ALICE=/afs/cern.ch/alice/library
+# export ALICE_LEVEL=new
+# export ALICE_ROOT=$ALICE/$ALICE_LEVEL
+# export ALICE_TARGET=`$ROOTSYS/bin/root-config --arch`
+# export PATH=$ALICE_ROOT/bin/tgt_${ALICE_TARGET}:$PATH
+# export LD_LIBRARY_PATH=$ALICE_ROOT/lib/tgt_${ALICE_TARGET}:$LD_LIBRARY_PATH
+# Geant3
+# export LD_LIBRARY_PATH=$ALICE/geant3/lib/tgt_${ALICE_TARGET}:$LD_LIBRARY_PATH
+
+rm -rf *.root *.dat *.log fort* hlt hough raw* recraw/*.root recraw/*.log
+aliroot -b -q $1sim.C      2>&1 | tee sim.log
+mv syswatch.log simwatch.log
+aliroot -b -q $1rec.C      2>&1 | tee rec.log
+mv syswatch.log recwatch.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CheckESD.C 2>&1 | tee check.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CreateAODfromESD.C 2>&1 | tee aod.log
+
+cd recraw
+ln -s ../raw.root
+aliroot -b -q rec.C      2>&1 | tee rec.log
+aliroot -b -q ${ALICE_ROOT}/STEER/CreateAODfromESD.C 2>&1 | tee aod.log
+
+
+
diff --git a/test/generators/therminator/sim.C b/test/generators/therminator/sim.C
new file mode 100644 (file)
index 0000000..84333ed
--- /dev/null
@@ -0,0 +1,18 @@
+void sim(Int_t nev=5) {
+
+
+  AliSimulation simulator;
+  simulator.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON FMD ZDC PMD T0 VZERO");
+  simulator.SetMakeDigitsFromHits("ITS TPC");
+  simulator.SetWriteRawData("ALL","raw.root",kTRUE);
+
+  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/generators/therminator/testvert.C b/test/generators/therminator/testvert.C
new file mode 100644 (file)
index 0000000..dab13a7
--- /dev/null
@@ -0,0 +1,25 @@
+void testvert() {
+
+  TFile f("AliESDs.root");
+
+  TTree * tree = (TTree*)f.Get("esdTree");
+
+  AliESDEvent * esd = new AliESDEvent();// The signal ESD object is put here
+  esd->ReadFromTree(tree);
+
+  Int_t nev = tree->GetEntriesFast();
+  
+  for (Int_t iev=0; iev<nev; iev++) {
+    cout << "---------- Signal event ----------" << iev << endl;
+
+    // Get ESD
+    tree->GetEntry(iev);
+
+    AliESDVertex * vert = esd->GetPrimaryVertex();
+
+    if (vert) cout << vert->GetTitle() << endl;
+
+    if (strstr(vert->GetTitle(),"VertexerTracks")) cout << "OK" << endl;
+
+  }
+}