]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/ConfigSPD02.C
Changes to the Improve method (J. Belikov) Savannah bug 76361
[u/mrichter/AliRoot.git] / ITS / ConfigSPD02.C
index 52e29e1677c45ff0dd919a395de97223c9baa31f..4402d958f357c36d0c0995140be7882717f2d9f9 100644 (file)
+//
+#if !defined(__CINT__) || defined(__MAKECINT__)
+#include <Riostream.h>
+#include <TPDGCode.h>
+#include <TRandom.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
+#include <TGeant3.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 "STRUCT/AliBODY.h"
+#include "STRUCT/AliABSOv0.h"
+#include "STRUCT/AliDIPOv2.h"
+#include "STRUCT/AliHALL.h"
+#include "STRUCT/AliFRAMEv2.h"
+#include "STRUCT/AliSHILv2.h"
+#include "STRUCT/AliPIPEv0.h"
+#include "ITS/AliITSvSPD02.h"
+#endif
+
+Float_t EtaToTheta(Float_t arg){
+  return (180./TMath::Pi())*2.*atan(exp(-arg));
+}
+//------------------------------------------------------------------
 void Config(){
     // Set Random Number seed
     // gRandom->SetSeed(12345);
     // libraries required by geant321
+#if defined(__CINT__)
     gSystem->Load("libgeant321");
+#endif
     new TGeant3("C++ Interface to Geant3");
-    if (!gSystem->Getenv("CONFIG_FILE")){
-        TFile  *rootfile = new TFile("galice.root", "recreate");
-        rootfile->SetCompressionLevel(2);
-    } // end if
-    TGeant3 *geant3 = (TGeant3 *) gMC;
+    AliRunLoader *rl = 0;
+    rl = AliRunLoader::Open("galice.root",
+                           AliConfig::GetDefaultEventFolderName(),"recreate");
+    if (rl == 0x0){
+      gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
+      return;
+    } // end if rl==0x0
+    rl->SetCompressionLevel(2);
+    rl->SetNumberOfEventsPerFile(1000);
+    gAlice->SetRunLoader(rl);
+    //
     // Set External decayer
-    AliDecayer *decayer = new AliDecayerPythia();
+    TVirtualMCDecayer *decayer = new AliDecayerPythia();
     decayer->SetForceDecay(kAll);
     decayer->Init();
     gMC->SetExternalDecayer(decayer);
     //=======================================================================
-    // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
-    geant3->SetTRIG(1);         //Number of events to be processed 
-    geant3->SetSWIT(4, 10);
-    geant3->SetDEBU(0, 0, 1);
-    //geant3->SetSWIT(2,2);
-    geant3->SetDCAY(1);
-    geant3->SetPAIR(1);
-    geant3->SetCOMP(1);
-    geant3->SetPHOT(1);
-    geant3->SetPFIS(0);
-    geant3->SetDRAY(0);
-    geant3->SetANNI(1);
-    geant3->SetBREM(1);
-    geant3->SetMUNU(1);
-    geant3->SetCKOV(1);
-    geant3->SetHADR(1);//Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
-    geant3->SetLOSS(2);
-    geant3->SetMULS(1);
-    geant3->SetRAYL(1);
-    geant3->SetAUTO(1);//Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
-    geant3->SetABAN(0);//Restore 3.16 behaviour for abandoned tracks
-    geant3->SetOPTI(2);//Select optimisation level for GEANT geometry searches (0,1,2)
-    geant3->SetERAN(5.e-7);
+    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;
-    //             GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
-    geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
-                    tofmax);
-    //=======================================================================
-    // ************* 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->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 = 1;
     if (gSystem->Getenv("CONFIG_NPARTICLES")){
-        int     nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
-    }else{
-        int     nParticles = 50;
+      nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
     } // end if
     //*********************************************
     // Example for Moving Particle Gun            *
     //*********************************************
     AliGenBox *gener = new AliGenBox(nParticles);
     gener->SetMomentumRange(100.,300.);
-    gener->SetPhiRange(0,0.01);
-    gener->SetThetaRange(0.0, 1.0);
-    gener->SetOrigin(0.,0.,-100.);
+    gener->SetPhiRange(0,0.1);
+    gener->SetThetaRange(0.0, .1);
+    gener->SetOrigin(0.,0.,-50.);
     //vertex position
-    gener->SetSigma(1.0,1.00,0); //Sigma in (X,Y,Z) (cm) on IP position
-    gener->SetPart(211);                //GEANT particle type
+    gener->SetSigma(0.1,0.1,0.0); //Sigma in (X,Y,Z) (cm) on IP position
+    gener->SetPart(kPiPlus);
     gener->Init();
     // Activate this line if you want the vertex smearing to happen
     // track by track
     //
     //gener->SetVertexSmear(perTrack); 
     // Field (L3 0.4 T)
-    AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
-    rootfile->cd();
-    gAlice->SetField(field);
+    //gAlice->SetField(field);
 
     Int_t   iHALL  =  0;
     Int_t   iITS   =  1;
+    rl->CdGAFile();
     //=================== Alice BODY parameters =============================
     AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
 
@@ -84,11 +113,7 @@ void Config(){
     } // end if
     if(iITS) {
        //=================== ITS parameters ============================
-       AliITSvSPD02 *ITS  = new AliITSvSPD02("SPD test beam 2002");
+       AliITSvSPD02 *ITS  = new AliITSvSPD02("SPD test beam 2002",2002);
     }
     return;
 }
-
-Float_t EtaToTheta(Float_t arg){
-  return (180./TMath::Pi())*2.*atan(exp(-arg));
-}