]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/oldmacros/Config_bg.C
renaming function to avoid library conflict (discovered in test/generators/TUHKMgen)
[u/mrichter/AliRoot.git] / ITS / oldmacros / Config_bg.C
1 void Config(){
2     // 7-DEC-2000 09:00
3     // Switch on Transition Radiation simulation. 6/12/00 18:00
4     // iZDC=1  7/12/00 09:00
5     // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
6     // Theta range given through pseudorapidity limits 22/6/2001
7
8     // Set Random Number seed
9     // gRandom->SetSeed(12345);
10
11     // libraries required by geant321
12     gSystem->Load("libgeant321");
13
14     new     TGeant3("C++ Interface to Geant3");
15
16     if (!gSystem->Getenv("CONFIG_FILE"))
17     {
18         TFile  *rootfile = new TFile("galice.root", "recreate");
19
20         rootfile->SetCompressionLevel(2);
21     }
22
23     TGeant3 *geant3 = (TGeant3 *) gMC;
24
25     //
26     // Set External decayer
27     AliDecayer *decayer = new AliDecayerPythia();
28
29     decayer->SetForceDecay(kAll);
30     decayer->Init();
31     gMC->SetExternalDecayer(decayer);
32     //
33     //
34     //=======================================================================
35     // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
36     geant3->SetTRIG(1);         //Number of events to be processed 
37     geant3->SetSWIT(4, 10);
38     geant3->SetDEBU(0, 0, 1);
39     //geant3->SetSWIT(2,2);
40     geant3->SetDCAY(1);
41     geant3->SetPAIR(1);
42     geant3->SetCOMP(1);
43     geant3->SetPHOT(1);
44     geant3->SetPFIS(0);
45     geant3->SetDRAY(0);
46     geant3->SetANNI(1);
47     geant3->SetBREM(1);
48     geant3->SetMUNU(1);
49     geant3->SetCKOV(1);
50     geant3->SetHADR(1); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
51     geant3->SetLOSS(2);
52     geant3->SetMULS(1);
53     geant3->SetRAYL(1);
54     geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
55     geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
56     geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
57     geant3->SetERAN(5.e-7);
58
59     Float_t cut = 1.e-3;        // 1MeV cut by default
60     Float_t tofmax = 1.e10;
61
62     //             GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
63     geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
64                     tofmax);
65     //
66     //=======================================================================
67     // ************* STEERING parameters FOR ALICE SIMULATION **************
68     // --- Specify event type to be tracked through the ALICE setup
69     // --- All positions are in cm, angles in degrees, and P and E in GeV
70     if (gSystem->Getenv("CONFIG_NPARTICLES")){
71         int     nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
72     } else{
73         int     nParticles = 500;
74     } // end if
75     AliGenHIJINGpara *gener = new AliGenHIJINGpara(nParticles);
76
77     gener->SetMomentumRange(0, 999);
78     gener->SetPhiRange(0, 360);
79     // Set pseudorapidity range from -8 to 8.
80     Float_t thmin = EtaToTheta(8);   // theta min. <---> eta max
81     Float_t thmax = EtaToTheta(-8);  // theta max. <---> eta min 
82     gener->SetThetaRange(thmin,thmax);
83     gener->SetOrigin(0, 0, 0);  //vertex position
84     gener->SetSigma(0, 0, 0);   //Sigma in (X,Y,Z) (cm) on IP position
85     gener->Init();
86     // 
87     // Activate this line if you want the vertex smearing to happen
88     // track by track
89     //
90     //gener->SetVertexSmear(perTrack); 
91
92     gAlice->SetField(-999, 2);  //Specify maximum magnetic field in Tesla (neg. ==> default field)
93
94     Int_t   iABSO  = 1;
95     Int_t   iDIPO  = 1;
96     Int_t   iFMD   = 1;
97     Int_t   iFRAME = 1;
98     Int_t   iHALL  = 1;
99     Int_t   iITS   = 1;
100     Int_t   iMAG   = 1;
101     Int_t   iMUON  = 1;
102     Int_t   iPHOS  = 1;
103     Int_t   iPIPE  = 1;
104     Int_t   iPMD   = 1;
105     Int_t   iRICH  = 1;
106     Int_t   iSHIL  = 1;
107     Int_t   iT0 = 1;
108     Int_t   iTOF   = 1;
109     Int_t   iTPC   = 1;
110     Int_t   iTRD   = 1;
111     Int_t   iZDC   = 1;
112     Int_t   iEMCAL = 1;
113
114     //=================== Alice BODY parameters =============================
115     AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
116
117     if (iMAG){
118         //=================== MAG parameters ============================
119         // --- Start with Magnet since detector layouts may be depending ---
120         // --- on the selected Magnet dimensions ---
121         AliMAG *MAG = new AliMAG("MAG", "Magnet");
122     }
123     if (iABSO){
124         //=================== ABSO parameters ============================
125         AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
126     }
127     if (iDIPO){
128         //=================== DIPO parameters ============================
129         AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
130     }
131     if (iHALL){
132         //=================== HALL parameters ============================
133         AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
134     }
135     if (iFRAME){
136         //=================== FRAME parameters ============================
137         AliFRAME *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
138     }
139     if (iSHIL){
140         //=================== SHIL parameters ============================
141         AliSHIL *SHIL = new AliSHILvF("SHIL", "Shielding");
142     }
143     if (iPIPE){
144         //=================== PIPE parameters ============================
145         AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
146     }
147     if(iITS) {
148         //=================== ITS parameters ============================
149         //
150         // As the innermost detector in ALICE, the Inner Tracking System 
151         // "impacts" on almost all other detectors. This involves the fact
152         // that the ITS geometry still has several options to be followed
153         //in parallel in order to determine the best set-up which minimizes
154         // the induced background. All the geometries available to date are
155         // described in the following. Read carefully the comments and use
156         // the default version (the only one uncommented) unless you are making
157         // comparisons and you know what you are doing. In this case just
158         // uncomment the ITS geometry you want to use and run Aliroot.
159         // Detailed geometries:
160         AliITSvPPRasymm *ITS  = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
161         ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
162         ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
163         ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
164         ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
165         ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
166         ITS->SetThicknessChip2(200.);// chip thickness on layer 2 must be in the range [150,300]
167         ITS->SetRails(1);            // 1 --> rails in ; 0 --> rails out
168         ITS->SetCoolingFluid(1);   // 1 --> water ; 0 --> freon
169         // Geant3 <-> EUCLID conversion
170         // ============================
171         // SetEUCLID is a flag to output (=1) or not to output (=0) both
172         // geometry and media to two ASCII files (called by default
173         // ITSgeometry.euc and ITSgeometry.tme) in a format understandable
174         // to the CAD system EUCLID.  The default (=0) means that you dont
175         // want to use this facility.
176         ITS->SetEUCLID(0);  
177     }
178     if (iTPC){
179         //============================ TPC parameters =========================
180         // This allows the user to specify sectors for the SLOW (TPC geometry
181         // 2) Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
182         // sectors are specified, any value other than that requires at least
183         // one sector (lower or upper)to be specified!
184         // Reminder: sectors  1-24 are lower sectors  ( 1-12->z>0,13-24->z<0)
185         //           sectors 25-72 are the upper ones (25-48->z>0,49-72->z<0)
186         // SecLows - number of lower sectors specified (up to 6)
187         // SecUps - number of upper sectors specified (up to 12)
188         // Sens - sensitive strips for the Slow Simulator !!!
189         // This does NOT work if all S or L-sectors are specified, i.e.
190         // if SecAL or SecAU < 0
191         //---------------------------------------------------------------------
192         //  gROOT->LoadMacro("SetTPCParam.C");
193         //  AliTPCParam *param = SetTPCParam();
194         AliTPC *TPC = new AliTPCv2("TPC", "Default");
195         // All sectors included 
196         TPC->SetSecAL(-1);
197         TPC->SetSecAU(-1);
198     }
199     if (iTOF){
200         //=================== TOF parameters ============================
201         AliTOF *TOF = new AliTOFv2("TOF", "normal TOF");
202     }
203     if (iRICH){
204         //=================== RICH parameters ===========================
205         AliRICH *RICH = new AliRICHv3("RICH", "normal RICH");
206     }
207     if (iZDC){
208         //=================== ZDC parameters ============================
209         AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
210     }
211     if (iTRD){
212         //=================== TRD parameters ============================
213         AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
214         // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe +
215         // 10% CO2)
216         TRD->SetGasMix(1);
217         // With hole in front of PHOS
218         TRD->SetPHOShole();
219         // With hole in front of RICH
220         TRD->SetRICHhole();
221         // Switch on TR
222         AliTRDsim *TRDsim = TRD->CreateTR();
223     }
224     if (iFMD){
225         //=================== FMD parameters ============================
226         AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
227         FMD->SetRingsSi1(256);
228         FMD->SetRingsSi2(64);
229         FMD->SetSectorsSi1(20);
230         FMD->SetSectorsSi2(24);
231     }
232     if (iMUON){
233         //=================== MUON parameters ===========================
234         AliMUON *MUON = new AliMUONv1("MUON", "default");
235     }
236     if (iPHOS){
237         //=================== PHOS parameters ===========================
238         AliPHOS *PHOS = new AliPHOSv1("PHOS", "GPS2");
239     }
240     if (iPMD){
241         //=================== PMD parameters ============================
242         AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
243         PMD->SetPAR(1., 1., 0.8, 0.02);
244         PMD->SetIN(6., 18., -580., 27., 27.);
245         PMD->SetGEO(0.0, 0.2, 4.);
246         PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
247     }
248     if (iEMCAL){
249         //=================== EMCAL parameters ============================
250         AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "G56_2_55_19_104_14");
251     }
252     if (iT0){
253         //=================== T0 parameters ============================
254         AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
255     }
256 }
257 //----------------------------------------------------------------------
258 Float_t EtaToTheta(Float_t arg){
259   return (180./TMath::Pi())*2.*atan(exp(-arg));
260 }