]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/ConfigSPD02.C
Macro to calculate the resolution and the efficiency of chamber(s) (Nicolas)
[u/mrichter/AliRoot.git] / ITS / ConfigSPD02.C
1 //
2 #if !defined(__CINT__) || defined(__MAKECINT__)
3 #include <Riostream.h>
4 #include <TRandom.h>
5 #include <TSystem.h>
6 #include <TVirtualMC.h>
7 #include <TGeant3.h>
8 #include "STEER/AliRunLoader.h"
9 #include "STEER/AliRun.h"
10 #include "STEER/AliConfig.h"
11 #include "PYTHIA6/AliDecayerPythia.h"
12 #include "EVGEN/AliGenCocktail.h"
13 #include "EVGEN/AliGenHIJINGpara.h"
14 #include "STEER/AliMagFMaps.h"
15 #include "STRUCT/AliBODY.h"
16 #include "STRUCT/AliMAG.h"
17 #include "STRUCT/AliABSOv0.h"
18 #include "STRUCT/AliDIPOv2.h"
19 #include "STRUCT/AliHALL.h"
20 #include "STRUCT/AliFRAMEv2.h"
21 #include "STRUCT/AliSHILv2.h"
22 #include "STRUCT/AliPIPEv0.h"
23 #include "ITS/AliITSvSPD02.h"
24 #endif
25
26 Float_t EtaToTheta(Float_t arg){
27   return (180./TMath::Pi())*2.*atan(exp(-arg));
28 }
29 //------------------------------------------------------------------
30 void Config(){
31     // Set Random Number seed
32     // gRandom->SetSeed(12345);
33     // libraries required by geant321
34 #if defined(__CINT__)
35     gSystem->Load("libgeant321");
36 #endif
37     new TGeant3("C++ Interface to Geant3");
38     AliRunLoader *rl = 0;
39     rl = AliRunLoader::Open("galice.root",
40                             AliConfig::GetDefaultEventFolderName(),"recreate");
41     if (rl == 0x0){
42       gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
43       return;
44     } // end if rl==0x0
45     rl->SetCompressionLevel(2);
46     rl->SetNumberOfEventsPerFile(1000);
47     gAlice->SetRunLoader(rl);
48     //
49     // Set External decayer
50     TVirtualMCDecayer *decayer = new AliDecayerPythia();
51     decayer->SetForceDecay(kAll);
52     decayer->Init();
53     gMC->SetExternalDecayer(decayer);
54     //=======================================================================
55     gMC->SetProcess("DCAY",1);
56     gMC->SetProcess("PAIR",1);
57     gMC->SetProcess("COMP",1);
58     gMC->SetProcess("PHOT",1);
59     gMC->SetProcess("PFIS",0);
60     gMC->SetProcess("DRAY",0);
61     gMC->SetProcess("ANNI",1);
62     gMC->SetProcess("BREM",1);
63     gMC->SetProcess("MUNU",1);
64     gMC->SetProcess("CKOV",1);
65     gMC->SetProcess("HADR",1);
66     gMC->SetProcess("LOSS",2);
67     gMC->SetProcess("MULS",1);
68     gMC->SetProcess("RAYL",1);
69     Float_t cut = 1.e-3;        // 1MeV cut by default
70     Float_t tofmax = 1.e10;
71     gMC->SetCut("CUTGAM", cut);
72     gMC->SetCut("CUTELE", cut);
73     gMC->SetCut("CUTNEU", cut);
74     gMC->SetCut("CUTHAD", cut);
75     gMC->SetCut("CUTMUO", cut);
76     gMC->SetCut("BCUTE",  cut);
77     gMC->SetCut("BCUTM",  cut);
78     gMC->SetCut("DCUTE",  cut);
79     gMC->SetCut("DCUTM",  cut);
80     gMC->SetCut("PPCUTM", cut);
81     gMC->SetCut("TOFMAX", tofmax);
82     int     nParticles = 1;
83     if (gSystem->Getenv("CONFIG_NPARTICLES")){
84       nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
85     } // end if
86     //*********************************************
87     // Example for Moving Particle Gun            *
88     //*********************************************
89     AliGenBox *gener = new AliGenBox(nParticles);
90     gener->SetMomentumRange(100.,300.);
91     gener->SetPhiRange(0,0.1);
92     gener->SetThetaRange(0.0, .1);
93     gener->SetOrigin(0.,0.,-50.);
94     //vertex position
95     gener->SetSigma(0.1,0.1,0.0); //Sigma in (X,Y,Z) (cm) on IP position
96     gener->SetPart(211);                //GEANT particle type
97     gener->Init();
98     // Activate this line if you want the vertex smearing to happen
99     // track by track
100     //
101     //gener->SetVertexSmear(perTrack); 
102     // Field (L3 0.4 T)
103     //gAlice->SetField(field);
104
105     Int_t   iHALL  =  0;
106     Int_t   iITS   =  1;
107     rl->CdGAFile();
108     //=================== Alice BODY parameters =============================
109     AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
110
111     if (iHALL){
112         //=================== HALL parameters ============================
113         AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
114     } // end if
115     if(iITS) {
116         //=================== ITS parameters ============================
117         AliITSvSPD02 *ITS  = new AliITSvSPD02("SPD test beam 2002",2002);
118     }
119     return;
120 }