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