]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/oldmacros/ConfigSPD02.C
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / ITS / oldmacros / ConfigSPD02.C
1 #include <TPDGCode.h>
2
3 void Config(){
4     // Set Random Number seed
5     // gRandom->SetSeed(12345);
6     // libraries required by geant321
7     gSystem->Load("libgeant321");
8     new TGeant3("C++ Interface to Geant3");
9     if (!gSystem->Getenv("CONFIG_FILE")){
10         cout<<"Config.C: Creating Run Loader ..."<<endl;
11         AliRunLoader *rl = AliRunLoader::Open("galice.root",
12                       AliConfig::fgkDefaultEventFolderName,"recreate");
13         if (rl == 0x0){
14             gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
15             return;
16         } // end if rl==0x0
17         rl->SetCompressionLevel(2);
18         rl->SetNumberOfEventsPerFile(1000);
19         gAlice->SetRunLoader(rl);
20     } // end if !gSystem
21     TGeant3 *geant3 = (TGeant3 *) gMC;
22     // Set External decayer
23     AliDecayer *decayer = new AliDecayerPythia();
24     decayer->SetForceDecay(kAll);
25     decayer->Init();
26     gMC->SetExternalDecayer(decayer);
27     //=======================================================================
28     // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
29     geant3->SetTRIG(1);         //Number of events to be processed 
30     geant3->SetSWIT(4, 10);
31     geant3->SetDEBU(0, 0, 1);
32     //geant3->SetSWIT(2,2);
33     geant3->SetDCAY(1);
34     geant3->SetPAIR(1);
35     geant3->SetCOMP(1);
36     geant3->SetPHOT(1);
37     geant3->SetPFIS(0);
38     geant3->SetDRAY(0);
39     geant3->SetANNI(1);
40     geant3->SetBREM(1);
41     geant3->SetMUNU(1);
42     geant3->SetCKOV(1);
43     geant3->SetHADR(1);//Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
44     geant3->SetLOSS(2);
45     geant3->SetMULS(1);
46     geant3->SetRAYL(1);
47     geant3->SetAUTO(1);//Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
48     geant3->SetABAN(0);//Restore 3.16 behaviour for abandoned tracks
49     geant3->SetOPTI(2);//Select optimisation level for GEANT geometry searches (0,1,2)
50     geant3->SetERAN(5.e-7);
51     Float_t cut = 1.e-3;        // 1MeV cut by default
52     Float_t tofmax = 1.e10;
53     //             GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
54     geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
55                     tofmax);
56     //=======================================================================
57     // ************* STEERING parameters FOR ALICE SIMULATION **************
58     // --- Specify event type to be tracked through the ALICE setup
59     // --- All positions are in cm, angles in degrees, and P and E in GeV
60     if (gSystem->Getenv("CONFIG_NPARTICLES")){
61         int     nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
62     }else{
63         int     nParticles = 1;
64     } // end if
65     //*********************************************
66     // Example for Moving Particle Gun            *
67     //*********************************************
68     AliGenBox *gener = new AliGenBox(nParticles);
69     gener->SetMomentumRange(100.,300.);
70     gener->SetPhiRange(0,0.1);
71     gener->SetThetaRange(0.0, .1);
72     gener->SetOrigin(0.,0.,-50.);
73     //vertex position
74     gener->SetSigma(0.1,0.1,0.0); //Sigma in (X,Y,Z) (cm) on IP position
75     gener->SetPart(kPiPlus);
76     gener->Init();
77     // Activate this line if you want the vertex smearing to happen
78     // track by track
79     //
80     //gener->SetVertexSmear(perTrack); 
81     // Field (L3 0.4 T)
82     rootfile->cd();
83     //gAlice->SetField(field);
84
85     Int_t   iHALL  =  0;
86     Int_t   iITS   =  1;
87     rl->CdGAFile();
88     //=================== Alice BODY parameters =============================
89     AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
90
91     if (iHALL){
92         //=================== HALL parameters ============================
93         AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
94     } // end if
95     if(iITS) {
96         //=================== ITS parameters ============================
97         AliITSvSPD02 *ITS  = new AliITSvSPD02("SPD test beam 2002");
98     }
99     return;
100 }
101
102 Float_t EtaToTheta(Float_t arg){
103   return (180./TMath::Pi())*2.*atan(exp(-arg));
104 }