]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - macros/Config_PDC06_MUON.C
Removing obsolete macros, changes to work with the trunk, clean-up
[u/mrichter/AliRoot.git] / macros / Config_PDC06_MUON.C
index b8795da50cdf4a06c2b24dbd78822e88c358fe85..1ad6754f68f115730efb8af5d6edbbb6b58607c1 100644 (file)
@@ -4,17 +4,25 @@
 // gAlice->SetConfigFunction("Config('$HOME','box');");
 // april 3rd: added L3 magnet 
 
+void LoadPythia();
+
 void Config(char directory[100]="", char option[6]="trg1mu")
 {
  
   static Int_t sseed = 0; // Set 0 to use the current time
 
   //=====================================================================
-  //  Libraries required by geant321
+  LoadPythia();
   gSystem->Load("libgeant321.so");
   new TGeant3TGeo("C++ Interface to Geant3");
+  
   //=======================================================================
 
+  if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
+    AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    AliCDBManager::Instance()->SetRun(0);
+  }
+  
   // Set Random Number seed
   gRandom->SetSeed(sseed);
 
@@ -32,10 +40,12 @@ void Config(char directory[100]="", char option[6]="trg1mu")
   rl->SetCompressionLevel(2);
   rl->SetNumberOfEventsPerFile(1000);
   gAlice->SetRunLoader(rl);
+  // gAlice->SetGeometryFromFile("geometry.root");
+  // gAlice->SetGeometryFromCDB();
   
   //=======================================================================
   // Set the trigger configuration
-  gAlice->SetTriggerDescriptor("p-p");
+  AliSimulation::Instance()->SetTriggerConfig("p-p");
   cout<<"Trigger configuration is set to  p-p"<<endl;
 
   //=======================================================================
@@ -90,6 +100,20 @@ void Config(char directory[100]="", char option[6]="trg1mu")
   //   External Radius (in cm)
   //    183.,  245.,  395.,  560., 563., 850., 900.  
   //=======================================================================
+    AliGenPythia* PythiaForMUONCocktail(Decay_t dt)
+       {
+           AliGenPythia *pythia = new AliGenPythia(1);
+           pythia->SetProcess(kPyMbMSEL1);
+           pythia->SetStrucFunc(kCTEQ5L);
+           pythia->SetEnergyCMS(14000.);
+           pythia->SetForceDecay(dt);
+           pythia->SetPtRange(0.,100.);
+           pythia->SetYRange(-8.,8.);
+           pythia->SetPhiRange(0.,360.);
+           pythia->SetPtHard(2.76,-1.0);
+           pythia->SwitchHFOff();
+           return pythia;
+       }
 
   if (!strcmp(option,"trg2mu")) {
     AliGenMUONCocktailpp *gener = new AliGenMUONCocktailpp();
@@ -102,6 +126,10 @@ void Config(char directory[100]="", char option[6]="trg1mu")
       gener->SetOrigin(0.,0.,0.); 
       gener->SetSigma(0.,0.,5.);
       gener->SetVertexSmear(kPerEvent);
+      Decay_t dt = gener->GetDecayModePythia(dt);
+      AliGenPythia* pythia = PythiaForMUONCocktail(dt);
+      pythia->Init();     
+      gener->AddGenerator(pythia,"Pythia",1);
       gener->Init(); 
   }
  
@@ -116,13 +144,17 @@ void Config(char directory[100]="", char option[6]="trg1mu")
       gener->SetOrigin(0.,0.,0.); 
       gener->SetSigma(0.,0.,5.);
       gener->SetVertexSmear(kPerEvent);
+      Decay_t dt = gener->GetDecayModePythia();
+      AliGenPythia* pythia = PythiaForMUONCocktail(dt);
+      pythia->Init();     
+      gener->AddGenerator(pythia,"Pythia",1);
       gener->Init(); 
   }
   //============================================================= 
   // Field (L3 0.5 T) outside dimuon spectrometer
-  AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
+  AliMagF* field = new AliMagF("Maps","Maps",1.,1.,AliMagF::k5kG);
   field->SetL3ConstField(0); // Using const. field in the barrel 
-  gAlice->SetField(field);
+  TGeoGlobalMagField::Instance()->SetField(field);
 
   Int_t   iITS = 1;
   Int_t   iZDC = 1;
@@ -150,11 +182,11 @@ void Config(char directory[100]="", char option[6]="trg1mu")
   AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
   //=================== ITS parameters =============================
   if(iITS) {
-      AliITSvPPRasymmFMD *ITS  = new AliITSvPPRasymmFMD("ITS","ITS PPR detailed version with asymmetric services");
+      AliITS *ITS  = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
   }
  //=================== ZDC parameters =============================
   if(iZDC) {
-      AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
+      AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
   }      
  //=================== FMD parameters =============================
   if(iFMD) {
@@ -193,3 +225,15 @@ void Config(char directory[100]="", char option[6]="trg1mu")
 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
+}
+
+