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