]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - test/QA/Config.C
Replace the PHOS version from IHEP to Run1 and fix the compilation, when possibletest...
[u/mrichter/AliRoot.git] / test / QA / Config.C
index 5ccaa0fd5e70ea51256e84e9f57fd7e6c1b536df..97ca7d64e9df38873f7f103e3806decfa1792d21 100644 (file)
 
 // 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_PDC07.C++")
+// root [1] gSystem->Load("libpythia6.4.25.so");
+// root [2] gSystem->Load("libqpythia.so");
+// root [3] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
+//                   -I$ALICE/geant3/TGeant3");
+// root [4] AliSimulation sim
+// root [5] sim.SetConfigFile("Config.C++")
+// root [6] sim.Run()
 
 #if !defined(__CINT__) || defined(__MAKECINT__)
 #include <Riostream.h>
 #include <TSystem.h>
 #include <TVirtualMC.h>
 #include <TGeant3TGeo.h>
-#include "EVGEN/AliGenCocktail.h"
-#include "EVGEN/AliGenParam.h"
-#include "EVGEN/AliGenMUONlib.h"
-#include "STEER/AliRunLoader.h"
-#include "STEER/AliRun.h"
-#include "STEER/AliConfig.h"
-#include "PYTHIA6/AliDecayerPythia.h"
-#include "PYTHIA6/AliGenPythia.h"
-#include "STEER/AliMagFMaps.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/AliITSgeom.h"
-#include "ITS/AliITSvPPRasymmFMD.h"
-#include "TPC/AliTPCv2.h"
-#include "TOF/AliTOFv6T0.h"
-#include "HMPID/AliHMPIDv2.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 <TGeoGlobalMagField.h>
+#include "AliGenCocktail.h"
+#include "AliGenParam.h"
+#include "AliGenMUONlib.h"
+#include "AliRunLoader.h"
+#include "AliRun.h"
+#include "AliConfig.h"
+#include "AliDecayerPythia.h"
+#include "AliGenPythia.h"
+#include "AliMagF.h"
+#include "AliBODY.h"
+#include "AliMAG.h"
+#include "AliABSOv3.h"
+#include "AliDIPOv3.h"
+#include "AliHALLv3.h"
+#include "AliFRAMEv2.h"
+#include "AliSHILv3.h"
+#include "AliPIPEv3.h"
+#include "AliITSgeom.h"
+#include "AliITSv11.h"
+#include "AliTPCv2.h"
+#include "AliTOFv6T0.h"
+#include "AliHMPIDv3.h"
+#include "AliZDCv4.h"
+#include "AliTRDv1.h"
+#include "AliFMDv1.h"
+#include "AliMUONv1.h"
+#include "AliPHOSv1.h"
+#include "AliPMDv1.h"
+#include "AliT0v1.h"
+#include "AliEMCALv2.h"
+#include "AliACORDEv1.h"
+#include "AliVZEROv7.h"
+#include "AliSimulation.h"
+#include "AliGenerator.h"
 #endif
 
 
@@ -99,17 +106,16 @@ enum DecayHvFl_t
 {
   kNature,  kHadr, kSemiEl, kSemiMu
 };
-//--- Magnetic Field ---
-enum Mag_t
-{
-    k2kG, k4kG, k5kG
-};
-
 //--- Trigger config ---
 enum TrigConf_t
 {
     kDefaultPPTrig, kDefaultPbPbTrig
 };
+//--- U cut ---
+enum YCut_t
+{
+  kFull, kBarrel, kMuonArm
+};
 
 const char * TrigConfName[] = {
     "p-p","Pb-Pb"
@@ -124,7 +130,7 @@ enum  PprGeo_t
   };
 
 static PprGeo_t geo = kHoles;
-class AliGenPythia ;
+
 //--- Functions ---
 AliGenPythia *PythiaHard(PDC07Proc_t );
 AliGenPythia *PythiaHVQ(PDC07Proc_t );
@@ -134,8 +140,9 @@ void ProcessEnvironmentVars();
 
 // This part for configuration
 static DecayHvFl_t   decHvFl  = kNature;
-static Mag_t         mag      = k5kG;
+static AliMagF::BMap_t mag    = AliMagF::k5kG;
 static TrigConf_t    trig     = kDefaultPPTrig; // default pp trigger configuration
+static YCut_t    ycut     = kFull; // default pp trigger configuration
 static Int_t         runNumber= 0;
 static Int_t         eventNumber= 0;
 //========================//
@@ -180,19 +187,26 @@ static TString comment;
 
 void Config()
 {
-
-
-  // Get settings from environment variables
+       // Get settings from environment variables
   ProcessEnvironmentVars();
 
+  // Random Number seed
+  if (gSystem->Getenv("CONFIG_SEED")) {
+    seed = atoi(gSystem->Getenv("CONFIG_SEED"));
+  }
+  else if(gSystem->Getenv("DC_EVENT") && gSystem->Getenv("DC_RUN")){
+    seed = runNumber * 100000 + eventNumber;
+  }
+  gRandom->SetSeed(seed);
+  cout<<"Seed for random number generation= "<<gRandom->GetSeed()<<endl; 
+
   // libraries required by geant321
 #if defined(__CINT__)
-       gSystem->Load("liblhapdf.so");      // Parton density functions
-       gSystem->Load("libpythia6.so");     // Pythia
+       gSystem->Load("liblhapdf");      // Parton density functions
+       gSystem->Load("libEGPythia6");   // TGenerator interface
+       gSystem->Load("libpythia6");     // Pythia
+       gSystem->Load("libAliPythia6");  // ALICE specific implementations
        gSystem->Load("libgeant321");
-       gSystem->Load("libEG");
-       gSystem->Load("libEGPythia6.so");   // TGenerator interface
-       gSystem->Load("libAliPythia6.so");  // ALICE specific implementations
 #endif
   new TGeant3TGeo("C++ Interface to Geant3");
 
@@ -202,6 +216,9 @@ void Config()
   //=======================================================================
   // Run loader
   AliRunLoader* rl=0x0;
+
+  AliLog::Message(AliLog::kInfo, "Creating Run Loader", "", "", "Config()"," ConfigPPR.C", __LINE__);
+
   rl = AliRunLoader::Open("galice.root",
                          AliConfig::GetDefaultEventFolderName(),
                          "recreate");
@@ -211,16 +228,38 @@ void Config()
       return;
     }
   rl->SetCompressionLevel(2);
-  rl->SetNumberOfEventsPerFile(1000);
+  rl->SetNumberOfEventsPerFile(100);
   gAlice->SetRunLoader(rl);
 
-  // Run number
-  //gAlice->SetRunNumber(runNumber);
-
   // Set the trigger configuration
-  gAlice->SetTriggerDescriptor(TrigConfName[trig]);
+  AliSimulation::Instance()->SetTriggerConfig(TrigConfName[trig]);
   cout<<"Trigger configuration is set to  "<<TrigConfName[trig]<<endl;
 
+  //======================//
+  // Set External decayer //
+  //======================//
+  TVirtualMCDecayer* decayer = new AliDecayerPythia();
+  // DECAYS
+  //
+  switch(decHvFl) {
+    case kNature:
+      decayer->SetForceDecay(kAll);
+      break;
+    case kHadr:
+      decayer->SetForceDecay(kHadronicD);
+      break;
+    case kSemiEl:
+      decayer->SetForceDecay(kSemiElectronic);
+      break;
+    case kSemiMu:
+      decayer->SetForceDecay(kSemiMuonic);
+      break;
+  }
+  decayer->Init();
+  gMC->SetExternalDecayer(decayer);
+  if(proc == kPyJetJetPHOSv2) // in this case we decay the pi0
+    decayer->SetForceDecay(kNeutralPion);
+
   //
   //=======================================================================
   // ************* STEERING parameters FOR ALICE SIMULATION **************
@@ -258,30 +297,6 @@ void Config()
     gMC->SetCut("PPCUTM", cut);
     gMC->SetCut("TOFMAX", tofmax);
 
-  //======================//
-  // Set External decayer //
-  //======================//
-  TVirtualMCDecayer* decayer = new AliDecayerPythia();
-  // DECAYS
-  //
-  switch(decHvFl) {
-  case kNature:
-    decayer->SetForceDecay(kAll);
-    break;
-  case kHadr:
-    decayer->SetForceDecay(kHadronicD);
-    break;
-  case kSemiEl:
-    decayer->SetForceDecay(kSemiElectronic);
-    break;
-  case kSemiMu:
-    decayer->SetForceDecay(kSemiMuonic);
-    break;
-  }
-  decayer->Init();
-  gMC->SetExternalDecayer(decayer);
-  if(proc == kPyJetJetPHOSv2) // in this case we decay the pi0
-    decayer->SetForceDecay(kNeutralPion);
 
   //=========================//
   // Generator Configuration //
@@ -353,14 +368,14 @@ void Config()
     //       pythia->SetThetaRange(45,135);
 
    if(proc == kPyJetJetPHOSv2)
-        pythia->SetForceDecay(kNeutralPion);
-   else
-        pythia->SetForceDecay(kAll);
-
-    pythia->SetPycellParameters(2., 274, 432, 0., 4., 5., 1.0);
+                pythia->SetForceDecay(kNeutralPion);
+        else
+                pythia->SetForceDecay(kAll);
+               
+               pythia->SetPycellParameters(2., 274, 432, 0., 4., 5., 1.0);
     pythia->SetPtKick(5); // set the intrinsic kt to 5 GeV/c
     gener = pythia;
-  }
+       }
 
 
   // PRIMARY VERTEX
@@ -390,27 +405,23 @@ void Config()
     Float_t k = 6e5*(qhat/1.7) ; //qhat=1.7, k = 6e5, default  value
     AliPythia::Instance()->InitQuenching(0.,0.1,k,0,0.95,6);
 
 }
+ }
   // FIELD
 
-  if (mag == k2kG) {
+  if (mag == AliMagF::k2kG) {
     comment = comment.Append(" | L3 field 0.2 T");
-  } else if (mag == k4kG) {
-    comment = comment.Append(" | L3 field 0.4 T");
-  } else if (mag == k5kG) {
+  } else if (mag == AliMagF::k5kG) {
     comment = comment.Append(" | L3 field 0.5 T");
   }
   printf("\n \n Comment: %s \n \n", comment.Data());
-
-  AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
-  field->SetL3ConstField(0); //Using const. field in the barrel
+  // to use constant field in the barrel use:
+  //  AliMagF* field = new AliMagF("Maps","Maps", -1., -1., AliMagF::k5kGUniform);
+  AliMagF* field = new AliMagF("Maps","Maps", -1., -1., mag);
+  TGeoGlobalMagField::Instance()->SetField(field);
   rl->CdGAFile();
-  gAlice->SetField(field);
-
-
 
   Int_t iABSO  = 1;
-  Int_t iACORDE= 0;
+  Int_t iACORDE= 1;
   Int_t iDIPO  = 1;
   Int_t iEMCAL = 1;
   Int_t iFMD   = 1;
@@ -443,8 +454,8 @@ void Config()
         // --- on the selected Magnet dimensions ---
         AliMAG *MAG = new AliMAG("MAG", "Magnet");
     }
-
-
+//
+//
     if (iABSO)
     {
         //=================== ABSO parameters ============================
@@ -496,7 +507,7 @@ void Config()
     //=================== ITS parameters ============================
     //
 
-      AliITS *ITS  = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
+      AliITS *ITS  = new AliITSv11("ITS","ITS v11");
     }
 
 
@@ -516,7 +527,7 @@ void Config()
     if (iHMPID)
     {
         //=================== HMPID parameters ===========================
-        AliHMPID *HMPID = new AliHMPIDv2("HMPID", "normal HMPID");
+        AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
 
     }
 
@@ -525,15 +536,15 @@ void Config()
     {
         //=================== ZDC parameters ============================
 
-        AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
+        AliZDC *ZDC = new AliZDCv4("ZDC", "normal ZDC");
     }
 
-    if (iTRD)
+   if (iTRD)
     {
         //=================== TRD parameters ============================
-
         AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
-        AliTRDgeometry *geoTRD = TRD->GetGeometry();
+       AliTRDgeometry *geoTRD = TRD->GetGeometry();
     }
 
     if (iFMD)
@@ -552,7 +563,7 @@ void Config()
 
     if (iPHOS)
     {
-        AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
+        AliPHOS *PHOS = new AliPHOSv1("PHOS", "Run1");
     }
 
 
@@ -571,13 +582,13 @@ void Config()
     if (iEMCAL)
     {
         //=================== EMCAL parameters ============================
-        AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "ESHISH_77_TRD1_2X2_FINAL_110DEG scTh=0.176 pbTh=0.144");
+        AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETEV1 scTh=0.176 pbTh=0.144");
     }
 
      if (iACORDE)
     {
         //=================== CRT parameters ============================
-        AliACORDE *ACORDE = new AliACORDEv1("CRT", "normal ACORDE");
+        AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
     }
 
      if (iVZERO)
@@ -920,15 +931,7 @@ void ProcessEnvironmentVars()
     }
     //cout<<"Event number "<<eventNumber<<endl;
 
-   // Random Number seed
-    if (gSystem->Getenv("CONFIG_SEED")) {
-      seed = atoi(gSystem->Getenv("CONFIG_SEED"));
-    }
-    else if(gSystem->Getenv("DC_EVENT") && gSystem->Getenv("DC_RUN")){
-      seed = runNumber * 100000 + eventNumber;
-    }
 
-    gRandom->SetSeed(seed);
 
     cout<<"////////////////////////////////////////////////////////////////////////////////////"<<endl;
     cout<<"Seed for random number generation= "<< seed<<"  "<< gRandom->GetSeed()<<endl;