]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDconfig.C
Put AliFMD, AliFMDv0, and AliFMDv1 in separate header/source files,
[u/mrichter/AliRoot.git] / TRD / AliTRDconfig.C
CommitLineData
793ff80c 1void Config()
2{
3
f9428ca8 4 Int_t iField = 0;
5
95cd7d4c 6 // libraries required by geant321
7 gSystem->Load("libgeant321");
8
9 new TGeant3("C++ Interface to Geant3");
793ff80c 10
11 // Create the output file
12 TFile *rootfile = new TFile("TRD_test.root","recreate");
13 rootfile->SetCompressionLevel(2);
14
15 // Define the monte carlo
16 TGeant3 *geant3 = (TGeant3*) gMC;
17
1f4ee546 18 AliRunLoader* rl=0x0;
19 cout << "AliTRDconfig.C: Creating Run Loader ..." <<endl;
20 rl = AliRunLoader::Open("TRD_test.root"
f5a857b2 21 ,AliConfig::GetDefaultEventFolderName()
1f4ee546 22 ,"recreate");
23 if (rl == 0x0) {
24 gAlice->Fatal("AliTRDconfig.C","Can not instatiate the Run Loader");
25 return;
26 }
27 rl->SetCompressionLevel(2);
28 rl->SetNumberOfEventsPerFile(3);
29 gAlice->SetRunLoader(rl);
30
793ff80c 31 // Set external decayer
1f4ee546 32 TVirtualMCDecayer *decayer = new AliDecayerPythia();
39207f8c 33 decayer->SetForceDecay(kAll);
793ff80c 34 decayer->Init();
35 gMC->SetExternalDecayer(decayer);
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 // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
64 geant3->SetCUTS(cut,cut, cut, cut, cut, cut, cut, cut, cut, cut, tofmax);
65
66 // ************* STEERING parameters FOR ALICE SIMULATION **************
67 // --- Specify event type to be tracked through the ALICE setup
68 // --- All positions are in cm, angles in degrees, and P and E in GeV
4a0fe73c 69
70 AliGenCocktail *gener = new AliGenCocktail();
71
72 AliGenBox *genEl = new AliGenBox(100);
73 genEl->SetOrigin(0,0,0); // Vertex position
74 genEl->SetSigma(0,0,0); // Sigma in (X,Y,Z) (cm) on IP position
75 genEl->SetPart(11); // Only electrons
76
77 AliGenBox *genPi = new AliGenBox(100);
78 genPi->SetOrigin(0,0,0); // Vertex position
79 genPi->SetSigma(0,0,0); // Sigma in (X,Y,Z) (cm) on IP position
80 genPi->SetPart(-211); // Only pions
81
82 gener->AddGenerator(genEl,"Electrons",1);
83 gener->AddGenerator(genPi,"Pions" ,1);
84
f9428ca8 85 if (iField) {
86
87 // With magnetic field on
88 AliGenerator *gg = gener->FirstGenerator()->Generator();
89 gg->SetMomentumRange(3.00,3.01);
90 gg->SetPhiRange(76.0,92.0);
91 gg->SetThetaRange(83.0,97.0);
92 gg = gener->NextGenerator()->Generator();
93 gg->SetMomentumRange(0.560,0.561);
94 gg->SetPhiRange(62.0,78.0);
95 gg->SetThetaRange(83.0,97.0);
96
97 gener->Init();
98
99 // Specify maximum magnetic field in Tesla (neg. ==> default field)
100 // 0.4 T
101 gAlice->SetField(-999,2,2.0);
102
103 }
104 else {
105
106 // With magnetic field off
107 AliGenerator *gg = gener->FirstGenerator()->Generator();
108 gg->SetMomentumRange(3.00,3.01);
109 gg->SetPhiRange(82.0,98.0);
110 gg->SetThetaRange(83.0,97.0);
111 gg = gener->NextGenerator()->Generator();
112 gg->SetMomentumRange(0.560,0.561);
113 gg->SetPhiRange(82.0,98.0);
114 gg->SetThetaRange(83.0,97.0);
115
116 gener->Init();
4a0fe73c 117
f9428ca8 118 // Specify maximum magnetic field in Tesla (neg. ==> default field)
119 // No field
120 gAlice->SetField(0);
793ff80c 121
f9428ca8 122 }
793ff80c 123
124 Int_t iMAG = 1;
125 Int_t iITS = 1;
126 Int_t iTPC = 1;
127 Int_t iTRD = 1;
128 Int_t iABSO = 1;
129 Int_t iDIPO = 1;
130 Int_t iHALL = 1;
131 Int_t iFRAME = 1;
132 Int_t iSHIL = 1;
133 Int_t iPIPE = 1;
134
1f4ee546 135 rl->CdGAFile();
136
793ff80c 137 //=================== Alice BODY parameters =============================
138 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
139
140 if (iMAG) {
141 //=================== MAG parameters ============================
142 // --- Start with Magnet since detector layouts may be depending ---
143 // --- on the selected Magnet dimensions ---
144 AliMAG *MAG = new AliMAG("MAG","Magnet");
145 }
146
147 if (iABSO) {
148 //=================== ABSO parameters ============================
149 AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
150 }
151
152 if (iDIPO) {
153 //=================== DIPO parameters ============================
154 AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
155 }
156
157 if (iHALL) {
158 //=================== HALL parameters ============================
159 AliHALL *HALL = new AliHALL("HALL","Alice Hall");
160 }
161
162 if (iFRAME) {
163 //=================== FRAME parameters ============================
164 AliFRAME *FRAME = new AliFRAMEv1("FRAME","Space Frame");
165 }
166
167 if (iSHIL) {
168 //=================== SHIL parameters ============================
169 AliSHIL *SHIL = new AliSHILv0("SHIL","Shielding");
170 }
171
172 if (iPIPE) {
173 //=================== PIPE parameters ============================
174 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
175 }
176
177 if (iITS) {
178 //=================== ITS parameters ============================
179 //
f9428ca8 180
a328fff9 181 AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","ITS PPR");
182 ITS->SetMinorVersion(2);
183 ITS->SetReadDet(kTRUE);
184 ITS->SetThicknessDet1(200.);
185 ITS->SetThicknessDet2(200.);
186 ITS->SetThicknessChip1(200.);
187 ITS->SetThicknessChip2(200.);
188 ITS->SetRails(0);
189 ITS->SetCoolingFluid(1);
793ff80c 190 ITS->SetEUCLID(0);
f9428ca8 191
793ff80c 192 }
193
194 if (iTPC) {
195 //============================ TPC parameters ================================
196 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
197 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
198 // --- sectors are specified, any value other than that requires at least one
199 // --- sector (lower or upper)to be specified!
200 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
201 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
202 // --- SecLows - number of lower sectors specified (up to 6)
203 // --- SecUps - number of upper sectors specified (up to 12)
204 // --- Sens - sensitive strips for the Slow Simulator !!!
205 // --- This does NOT work if all S or L-sectors are specified, i.e.
206 // --- if SecAL or SecAU < 0
207 //
208 //
209 //-----------------------------------------------------------------------------
210
6244debe 211 AliTPC *TPC = new AliTPCv2("TPC","Default");
212 // All sectors included
213 TPC->SetSecAL(-1);
214 TPC->SetSecAU(-1);
793ff80c 215
216 }
217
218 if (iTRD) {
219 //=================== TRD parameters ============================
220
221 AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
222 TRD->SetSensChamber(2);
223 TRD->SetSensSector(13);
224
793ff80c 225 // Set to detailed display
226 TRD->SetDisplayType(1);
227
f9428ca8 228 // Draw TR photons
229 TRD->SetDrawTR(1);
230
793ff80c 231 // Switch on TR
232 AliTRDsim *TRDsim = TRD->CreateTR();
233
234 }
235
236}