]>
Commit | Line | Data |
---|---|---|
4c039060 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* | |
17 | $Log$ | |
4c475d27 | 18 | Revision 1.30 2002/10/22 14:26:28 alibrary |
19 | Introducing Riostream.h | |
20 | ||
f8014e68 | 21 | Revision 1.29 2002/10/14 14:57:42 hristov |
22 | Merging the VirtualMC branch to the main development branch (HEAD) | |
23 | ||
b9d0a01d | 24 | Revision 1.25.6.3 2002/07/25 06:24:27 alibrary |
25 | Updating TOF on VirtualMC | |
26 | ||
27 | Revision 1.28 2002/07/24 16:13:56 vicinanz | |
28 | Fixed bub in BuildGeometry | |
29 | ||
9e9add11 | 30 | Revision 1.27 2002/06/24 14:09:12 vicinanz |
31 | review on materials and | |
32 | ||
43808676 | 33 | Revision 1.26 2002/05/08 13:24:50 vicinanz |
34 | AliTOFanalyzeMatching.C macro added and minor changes to the AliTOF code | |
35 | ||
b213b8bd | 36 | Revision 1.25 2001/11/22 11:22:51 hristov |
37 | Updated version of TOF digitization, N^2 problem solved (J.Chudoba) | |
38 | ||
e59d8a81 | 39 | Revision 1.23 2001/09/27 10:39:20 vicinanz |
40 | SDigitizer and Merger added | |
41 | ||
517b7f8f | 42 | Revision 1.22 2001/09/20 15:54:22 vicinanz |
43 | Updated Strip Structure (Double Stack) | |
44 | ||
dfacde63 | 45 | Revision 1.21 2001/08/28 08:45:59 vicinanz |
46 | TTask and TFolder structures implemented | |
47 | ||
68861244 | 48 | Revision 1.20 2001/05/16 14:57:24 alibrary |
49 | New files for folders and Stack | |
50 | ||
9e1a0ddb | 51 | Revision 1.19 2001/05/04 10:09:48 vicinanz |
52 | Major upgrades to the strip structure | |
53 | ||
b94fa26c | 54 | Revision 1.18 2000/12/04 08:48:20 alibrary |
55 | Fixing problems in the HEAD | |
56 | ||
0cc62300 | 57 | Revision 1.17 2000/10/02 21:28:17 fca |
58 | Removal of useless dependecies via forward declarations | |
59 | ||
94de3818 | 60 | Revision 1.16 2000/05/10 16:52:18 vicinanz |
61 | New TOF version with holes for PHOS/RICH | |
62 | ||
2cef3cb2 | 63 | Revision 1.14.2.1 2000/05/10 09:37:16 vicinanz |
64 | New version with Holes for PHOS/RICH | |
65 | ||
da39da0c | 66 | Revision 1.14 1999/11/05 22:39:06 fca |
67 | New hits structure | |
68 | ||
2cef3cb2 | 69 | Revision 1.13 1999/11/02 11:26:39 fca |
70 | added stdlib.h for exit | |
71 | ||
72 | Revision 1.12 1999/11/01 20:41:57 fca | |
826b71ec | 73 | Added protections against using the wrong version of FRAME |
74 | ||
2cef3cb2 | 75 | Revision 1.11 1999/10/22 08:04:14 fca |
ab76897d | 76 | Correct improper use of negative parameters |
77 | ||
2cef3cb2 | 78 | Revision 1.10 1999/10/16 19:30:06 fca |
d0a635a0 | 79 | Corrected Rotation Matrix and CVS log |
80 | ||
2cef3cb2 | 81 | Revision 1.9 1999/10/15 15:35:20 fca |
00e5f8d9 | 82 | New version for frame1099 with and without holes |
83 | ||
2cef3cb2 | 84 | Revision 1.8 1999/09/29 09:24:33 fca |
937fe4a4 | 85 | Introduction of the Copyright and cvs Log |
86 | ||
4c039060 | 87 | */ |
88 | ||
fe4da5cc | 89 | /////////////////////////////////////////////////////////////////////////////// |
9e9add11 | 90 | // |
68861244 | 91 | // This class contains the functions for version 2 of the Time Of Flight // |
fe4da5cc | 92 | // detector. // |
937fe4a4 | 93 | // |
94 | // VERSION WITH 5 MODULES AND TILTED STRIPS | |
95 | // | |
2cef3cb2 | 96 | // HOLES FOR PHOS AND RICH DETECTOR |
937fe4a4 | 97 | // |
2cef3cb2 | 98 | // Authors: |
937fe4a4 | 99 | // |
100 | // Alessio Seganti | |
101 | // Domenico Vicinanza | |
102 | // | |
103 | // University of Salerno - Italy | |
104 | // | |
b94fa26c | 105 | // Fabrizio Pierella |
106 | // University of Bologna - Italy | |
107 | // | |
937fe4a4 | 108 | // |
fe4da5cc | 109 | //Begin_Html |
110 | /* | |
3fe3a833 | 111 | <img src="picts/AliTOFv2Class.gif"> |
fe4da5cc | 112 | */ |
113 | //End_Html | |
114 | // // | |
115 | /////////////////////////////////////////////////////////////////////////////// | |
116 | ||
f8014e68 | 117 | #include <Riostream.h> |
ab76897d | 118 | #include <stdlib.h> |
119 | ||
fe4da5cc | 120 | #include "AliTOFv2.h" |
2cef3cb2 | 121 | #include "TBRIK.h" |
94de3818 | 122 | #include "TGeometry.h" |
2cef3cb2 | 123 | #include "TNode.h" |
0cc62300 | 124 | #include <TLorentzVector.h> |
2cef3cb2 | 125 | #include "TObject.h" |
fe4da5cc | 126 | #include "AliRun.h" |
94de3818 | 127 | #include "AliMagF.h" |
fe4da5cc | 128 | #include "AliConst.h" |
2cef3cb2 | 129 | |
fe4da5cc | 130 | |
131 | ClassImp(AliTOFv2) | |
132 | ||
133 | //_____________________________________________________________________________ | |
151e057e | 134 | AliTOFv2::AliTOFv2() |
fe4da5cc | 135 | { |
136 | // | |
137 | // Default constructor | |
138 | // | |
139 | } | |
140 | ||
141 | //_____________________________________________________________________________ | |
142 | AliTOFv2::AliTOFv2(const char *name, const char *title) | |
2cef3cb2 | 143 | : AliTOF(name,title) |
fe4da5cc | 144 | { |
145 | // | |
146 | // Standard constructor | |
147 | // | |
da39da0c | 148 | // |
149 | // Check that FRAME is there otherwise we have no place where to | |
150 | // put TOF | |
b94fa26c | 151 | AliModule* frame=gAlice->GetModule("FRAME"); |
152 | if(!frame) { | |
da39da0c | 153 | Error("Ctor","TOF needs FRAME to be present\n"); |
154 | exit(1); | |
2cef3cb2 | 155 | } else |
b94fa26c | 156 | if(frame->IsVersion()!=1) { |
da39da0c | 157 | Error("Ctor","FRAME version 1 needed with this version of TOF\n"); |
158 | exit(1); | |
159 | } | |
160 | ||
fe4da5cc | 161 | } |
2cef3cb2 | 162 | |
b94fa26c | 163 | //____________________________________________________________________________ |
68861244 | 164 | |
2cef3cb2 | 165 | void AliTOFv2::BuildGeometry() |
166 | { | |
167 | // | |
168 | // Build TOF ROOT geometry for the ALICE event display | |
169 | // | |
b94fa26c | 170 | TNode *node, *top; |
2cef3cb2 | 171 | const int kColorTOF = 27; |
9e9add11 | 172 | |
2cef3cb2 | 173 | // Find top TNODE |
b94fa26c | 174 | top = gAlice->GetGeometry()->GetNode("alice"); |
9e9add11 | 175 | |
2cef3cb2 | 176 | // Position the different copies |
b94fa26c | 177 | const Float_t krTof =(fRmax+fRmin)/2; |
178 | const Float_t khTof = fRmax-fRmin; | |
179 | const Int_t kNTof = fNTof; | |
2cef3cb2 | 180 | const Float_t kPi = TMath::Pi(); |
b94fa26c | 181 | const Float_t kangle = 2*kPi/kNTof; |
2cef3cb2 | 182 | Float_t ang; |
9e9add11 | 183 | |
184 | // define offset for nodes | |
185 | Float_t zOffsetC = fZtof - fZlenC*0.5; | |
186 | Float_t zOffsetB = fZtof - fZlenC - fZlenB*0.5; | |
187 | Float_t zOffsetA = 0.; | |
2cef3cb2 | 188 | // Define TOF basic volume |
189 | ||
b94fa26c | 190 | char nodeName0[6], nodeName1[6], nodeName2[6]; |
191 | char nodeName3[6], nodeName4[6], rotMatNum[6]; | |
9e9add11 | 192 | |
2cef3cb2 | 193 | new TBRIK("S_TOF_C","TOF box","void", |
9e9add11 | 194 | fStripLn*0.5,khTof*0.5,fZlenC*0.5); |
2cef3cb2 | 195 | new TBRIK("S_TOF_B","TOF box","void", |
9e9add11 | 196 | fStripLn*0.5,khTof*0.5,fZlenB*0.5); |
2cef3cb2 | 197 | new TBRIK("S_TOF_A","TOF box","void", |
9e9add11 | 198 | fStripLn*0.5,khTof*0.5,fZlenA*0.5); |
199 | ||
b94fa26c | 200 | for (Int_t nodeNum=1;nodeNum<19;nodeNum++){ |
9e9add11 | 201 | |
202 | if (nodeNum<10) { | |
203 | sprintf(rotMatNum,"rot50%i",nodeNum); | |
204 | sprintf(nodeName0,"FTO00%i",nodeNum); | |
205 | sprintf(nodeName1,"FTO10%i",nodeNum); | |
206 | sprintf(nodeName2,"FTO20%i",nodeNum); | |
207 | sprintf(nodeName3,"FTO30%i",nodeNum); | |
208 | sprintf(nodeName4,"FTO40%i",nodeNum); | |
209 | } | |
210 | if (nodeNum>9) { | |
211 | sprintf(rotMatNum,"rot5%i",nodeNum); | |
212 | sprintf(nodeName0,"FTO0%i",nodeNum); | |
213 | sprintf(nodeName1,"FTO1%i",nodeNum); | |
214 | sprintf(nodeName2,"FTO2%i",nodeNum); | |
215 | sprintf(nodeName3,"FTO3%i",nodeNum); | |
216 | sprintf(nodeName4,"FTO4%i",nodeNum); | |
217 | } | |
218 | ||
219 | new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0); | |
220 | ang = (4.5-nodeNum) * kangle; | |
221 | ||
222 | top->cd(); | |
223 | node = new TNode(nodeName0,nodeName0,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetC,rotMatNum); | |
224 | node->SetLineColor(kColorTOF); | |
225 | fNodes->Add(node); | |
226 | ||
227 | top->cd(); | |
228 | node = new TNode(nodeName1,nodeName1,"S_TOF_C",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetC,rotMatNum); | |
229 | node->SetLineColor(kColorTOF); | |
230 | fNodes->Add(node); | |
231 | if (nodeNum !=1 && nodeNum!=17 && nodeNum !=18) | |
232 | { | |
233 | top->cd(); | |
234 | node = new TNode(nodeName2,nodeName2,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetB,rotMatNum); | |
235 | node->SetLineColor(kColorTOF); | |
236 | fNodes->Add(node); | |
237 | ||
238 | top->cd(); | |
239 | node = new TNode(nodeName3,nodeName3,"S_TOF_B",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),-zOffsetB,rotMatNum); | |
240 | node->SetLineColor(kColorTOF); | |
241 | fNodes->Add(node); | |
242 | } // Holes for RICH detector | |
243 | ||
244 | if ((nodeNum<7 || nodeNum>11) && nodeNum !=1 && nodeNum!=17 && nodeNum !=18) | |
245 | { | |
246 | top->cd(); | |
247 | node = new TNode(nodeName4,nodeName4,"S_TOF_A",krTof*TMath::Cos(ang),krTof*TMath::Sin(ang),zOffsetA,rotMatNum); | |
248 | node->SetLineColor(kColorTOF); | |
249 | fNodes->Add(node); | |
250 | } // Holes for PHOS detector (+ Holes for RICH detector, central part) | |
b94fa26c | 251 | } // end loop on nodeNum |
2cef3cb2 | 252 | } |
253 | ||
fe4da5cc | 254 | |
255 | //_____________________________________________________________________________ | |
256 | void AliTOFv2::CreateGeometry() | |
257 | { | |
258 | // | |
3fe3a833 | 259 | // Create geometry for Time Of Flight version 0 |
fe4da5cc | 260 | // |
261 | //Begin_Html | |
262 | /* | |
3fe3a833 | 263 | <img src="picts/AliTOFv2.gif"> |
fe4da5cc | 264 | */ |
265 | //End_Html | |
266 | // | |
937fe4a4 | 267 | // Creates common geometry |
fe4da5cc | 268 | // |
269 | AliTOF::CreateGeometry(); | |
270 | } | |
271 | ||
272 | //_____________________________________________________________________________ | |
2cef3cb2 | 273 | void AliTOFv2::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, |
274 | Float_t zlenB, Float_t zlenA, Float_t ztof0) | |
fe4da5cc | 275 | { |
276 | // | |
277 | // Definition of the Time Of Fligh Resistive Plate Chambers | |
937fe4a4 | 278 | // xFLT, yFLT, zFLT - sizes of TOF modules (large) |
3fe3a833 | 279 | |
937fe4a4 | 280 | Float_t ycoor, zcoor; |
b94fa26c | 281 | Float_t par[3]; |
2cef3cb2 | 282 | Int_t *idtmed = fIdtmed->GetArray()-499; |
283 | Int_t idrotm[100]; | |
284 | Int_t nrot = 0; | |
285 | Float_t hTof = fRmax-fRmin; | |
fe4da5cc | 286 | |
b94fa26c | 287 | Float_t radius = fRmin+2.;//cm |
937fe4a4 | 288 | |
2cef3cb2 | 289 | par[0] = xtof * 0.5; |
290 | par[1] = ytof * 0.5; | |
291 | par[2] = zlenC * 0.5; | |
292 | gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3); | |
293 | par[2] = zlenB * 0.5; | |
294 | gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3); | |
295 | par[2] = zlenA * 0.5; | |
296 | gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3); | |
937fe4a4 | 297 | |
937fe4a4 | 298 | |
43808676 | 299 | // Positioning of modules |
937fe4a4 | 300 | |
43808676 | 301 | Float_t zcor1 = ztof0 - zlenC*0.5; |
302 | Float_t zcor2 = ztof0 - zlenC - zlenB*0.5; | |
303 | Float_t zcor3 = 0.; | |
304 | ||
305 | AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.); | |
306 | AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.); | |
307 | gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY"); | |
308 | gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY"); | |
309 | gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY"); | |
310 | gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY"); | |
311 | gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY"); | |
312 | gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY"); | |
313 | ||
314 | gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY"); | |
315 | gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY"); | |
316 | gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY"); | |
317 | gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY"); | |
318 | ||
319 | gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY"); | |
320 | ||
2cef3cb2 | 321 | Float_t db = 0.5;//cm |
322 | Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC; | |
43808676 | 323 | |
2cef3cb2 | 324 | xFLT = fStripLn; |
937fe4a4 | 325 | yFLT = ytof; |
2cef3cb2 | 326 | zFLTA = zlenA; |
327 | zFLTB = zlenB; | |
328 | zFLTC = zlenC; | |
329 | ||
330 | xFST = xFLT-fDeadBndX*2;//cm | |
937fe4a4 | 331 | |
937fe4a4 | 332 | // Sizes of MRPC pads |
333 | ||
2cef3cb2 | 334 | Float_t yPad = 0.505;//cm |
fe4da5cc | 335 | |
b94fa26c | 336 | // Large not sensitive volumes with Insensitive Freon |
2cef3cb2 | 337 | par[0] = xFLT*0.5; |
338 | par[1] = yFLT*0.5; | |
b94fa26c | 339 | |
9e1a0ddb | 340 | if(fDebug) |
341 | cout <<ClassName() | |
342 | <<": ************************* TOF geometry **************************" | |
343 | <<endl; | |
937fe4a4 | 344 | |
2cef3cb2 | 345 | par[2] = (zFLTA *0.5); |
b94fa26c | 346 | gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon |
2cef3cb2 | 347 | gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY"); |
937fe4a4 | 348 | |
2cef3cb2 | 349 | par[2] = (zFLTB * 0.5); |
b94fa26c | 350 | gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon |
2cef3cb2 | 351 | gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY"); |
937fe4a4 | 352 | |
b94fa26c | 353 | par[2] = (zFLTC * 0.5); |
354 | gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon | |
2cef3cb2 | 355 | gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY"); |
937fe4a4 | 356 | |
43808676 | 357 | ///// Layers of Aluminum before and after detector ///// |
358 | ///// Aluminum Box for Modules (1.8 mm thickness) ///// | |
359 | ///// lateral walls not simulated for the time being | |
360 | //const Float_t khAlWall = 0.18; | |
361 | // fp to be checked | |
362 | const Float_t khAlWall = 0.11; | |
b94fa26c | 363 | par[0] = xFLT*0.5; |
43808676 | 364 | par[1] = khAlWall/2.;//cm |
937fe4a4 | 365 | ycoor = -yFLT/2 + par[1]; |
b94fa26c | 366 | par[2] = (zFLTA *0.5); |
367 | gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium | |
368 | gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY"); | |
369 | gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY"); | |
370 | par[2] = (zFLTB *0.5); | |
371 | gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium | |
372 | gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY"); | |
373 | gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY"); | |
374 | par[2] = (zFLTC *0.5); | |
375 | gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium | |
376 | gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY"); | |
377 | gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY"); | |
378 | ||
43808676 | 379 | ///////////////// Detector itself ////////////////////// |
380 | ||
b94fa26c | 381 | const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge |
43808676 | 382 | //and the boundary of the strip |
b94fa26c | 383 | const Int_t knx = fNpadX; // number of pads along x |
384 | const Int_t knz = fNpadZ; // number of pads along z | |
385 | const Float_t kspace = fSpace; //cm distance from the front plate of the box | |
43808676 | 386 | |
2cef3cb2 | 387 | Float_t zSenStrip = fZpad*fNpadZ;//cm |
b94fa26c | 388 | Float_t stripWidth = zSenStrip + 2*kdeadBound; |
43808676 | 389 | |
2cef3cb2 | 390 | par[0] = xFLT*0.5; |
391 | par[1] = yPad*0.5; | |
b94fa26c | 392 | par[2] = stripWidth*0.5; |
937fe4a4 | 393 | |
43808676 | 394 | // new description for strip volume -double stack strip- |
395 | // -- all constants are expressed in cm | |
396 | // heigth of different layers | |
397 | const Float_t khhony = 0.8 ; // heigth of HONY Layer | |
398 | const Float_t khpcby = 0.08 ; // heigth of PCB Layer | |
b94fa26c | 399 | const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer |
400 | const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer | |
43808676 | 401 | const Float_t khglasseiy = 0.135; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm) |
b94fa26c | 402 | const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture |
403 | const Float_t kwsensmz = 2*3.5 ; // cm | |
404 | const Float_t klsensmx = 48*2.5; // cm | |
405 | const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume | |
406 | const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume | |
407 | ||
408 | // heigth of the FSTR Volume (the strip volume) | |
dfacde63 | 409 | const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy; |
b94fa26c | 410 | // width of the FSTR Volume (the strip volume) |
411 | const Float_t kwstripz = 10.; | |
412 | // length of the FSTR Volume (the strip volume) | |
413 | const Float_t klstripx = 122.; | |
414 | ||
415 | Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5}; | |
43808676 | 416 | // coordinates of the strip center in the strip reference frame; used for positioning |
417 | // internal strip volumes | |
b94fa26c | 418 | Float_t posfp[3]={0.,0.,0.}; |
43808676 | 419 | |
b94fa26c | 420 | |
421 | // FSTR volume definition and filling this volume with non sensitive Gas Mixture | |
422 | gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3); | |
423 | //-- HONY Layer definition | |
43808676 | 424 | // parfp[0] = -1; |
b94fa26c | 425 | parfp[1] = khhony*0.5; |
43808676 | 426 | // parfp[2] = -1; |
b94fa26c | 427 | gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3); |
428 | // positioning 2 HONY Layers on FSTR volume | |
43808676 | 429 | |
b94fa26c | 430 | posfp[1]=-khstripy*0.5+parfp[1]; |
431 | gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
432 | gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
43808676 | 433 | |
b94fa26c | 434 | //-- PCB Layer definition |
435 | parfp[1] = khpcby*0.5; | |
436 | gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3); | |
437 | // positioning 2 PCB Layers on FSTR volume | |
438 | posfp[1]=-khstripy*0.5+khhony+parfp[1]; | |
439 | gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
440 | gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
dfacde63 | 441 | // positioning the central PCB layer |
442 | gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY"); | |
43808676 | 443 | |
444 | ||
445 | ||
b94fa26c | 446 | //-- MYLAR Layer definition |
447 | parfp[1] = khmyly*0.5; | |
448 | gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3); | |
449 | // positioning 2 MYLAR Layers on FSTR volume | |
450 | posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1]; | |
451 | gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
452 | gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
dfacde63 | 453 | // adding further 2 MYLAR Layers on FSTR volume |
454 | posfp[1] = khpcby*0.5+parfp[1]; | |
455 | gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
456 | gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
43808676 | 457 | |
458 | ||
b94fa26c | 459 | //-- Graphite Layer definition |
460 | parfp[1] = khgraphy*0.5; | |
461 | gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3); | |
462 | // positioning 2 Graphite Layers on FSTR volume | |
463 | posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1]; | |
464 | gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
465 | gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
dfacde63 | 466 | // adding further 2 Graphite Layers on FSTR volume |
467 | posfp[1] = khpcby*0.5+khmyly+parfp[1]; | |
468 | gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
469 | gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
43808676 | 470 | |
471 | ||
b94fa26c | 472 | //-- Glass (EXT. +Semi INT.) Layer definition |
473 | parfp[1] = khglasseiy*0.5; | |
474 | gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3); | |
475 | // positioning 2 Glass Layers on FSTR volume | |
476 | posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1]; | |
477 | gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
478 | gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
dfacde63 | 479 | // adding further 2 Glass Layers on FSTR volume |
480 | posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1]; | |
481 | gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
482 | gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
43808676 | 483 | |
b94fa26c | 484 | |
485 | //-- Sensitive Mixture Layer definition | |
486 | parfp[0] = klsensmx*0.5; | |
487 | parfp[1] = khsensmy*0.5; | |
dfacde63 | 488 | parfp[2] = kwsensmz*0.5; |
b94fa26c | 489 | gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3); |
dfacde63 | 490 | gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3); |
491 | // positioning 2 gas Layers on FSTR volume | |
492 | // the upper is insensitive freon | |
493 | // while the remaining is sensitive | |
494 | posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1]; | |
495 | gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY"); | |
496 | gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY"); | |
43808676 | 497 | |
b94fa26c | 498 | // dividing FSEN along z in knz=2 and along x in knx=48 |
499 | gMC->Gsdvn("FSEZ","FSEN",knz,3); | |
500 | gMC->Gsdvn("FSEX","FSEZ",knx,1); | |
501 | ||
502 | // FPAD volume definition | |
503 | parfp[0] = klpadx*0.5; | |
504 | parfp[1] = khsensmy*0.5; | |
505 | parfp[2] = kwpadz*0.5; | |
506 | gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3); | |
507 | // positioning the FPAD volumes on previous divisions | |
508 | gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY"); | |
937fe4a4 | 509 | |
43808676 | 510 | //// Positioning the Strips (FSTR) in the FLT volumes ///// |
511 | ||
2cef3cb2 | 512 | // Plate A (Central) |
513 | ||
514 | Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel | |
43808676 | 515 | |
b213b8bd | 516 | Float_t gap = fGapA+0.5; //cm updated distance between the strip axis |
937fe4a4 | 517 | Float_t zpos = 0; |
2cef3cb2 | 518 | Float_t ang = 0; |
937fe4a4 | 519 | Int_t i=1,j=1; |
2cef3cb2 | 520 | nrot = 0; |
521 | zcoor = 0; | |
b94fa26c | 522 | ycoor = -14.5 + kspace ; //2 cm over front plate |
43808676 | 523 | |
2cef3cb2 | 524 | AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.); |
525 | gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); | |
43808676 | 526 | |
9e1a0ddb | 527 | if(fDebug) { |
43808676 | 528 | printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); |
529 | printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); | |
9e1a0ddb | 530 | } |
43808676 | 531 | |
2cef3cb2 | 532 | zcoor -= zSenStrip; |
533 | j++; | |
b94fa26c | 534 | Int_t upDown = -1; // upDown=-1 -> Upper strip |
43808676 | 535 | // upDown=+1 -> Lower strip |
937fe4a4 | 536 | do{ |
43808676 | 537 | ang = atan(zcoor/radius); |
538 | ang *= kRaddeg; | |
539 | AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.); | |
540 | AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.); | |
541 | ang /= kRaddeg; | |
542 | ycoor = -14.5+ kspace; //2 cm over front plate | |
543 | ycoor += (1-(upDown+1)/2)*gap; | |
544 | gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); | |
545 | gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); | |
546 | ||
547 | if(fDebug) { | |
548 | printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); | |
549 | printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); | |
550 | } | |
551 | ||
552 | j += 2; | |
553 | upDown*= -1; // Alternate strips | |
554 | zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)- | |
555 | upDown*gap*TMath::Tan(ang)- | |
556 | (zSenStrip/2)/TMath::Cos(ang); | |
b94fa26c | 557 | } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2); |
937fe4a4 | 558 | |
2cef3cb2 | 559 | zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+ |
43808676 | 560 | upDown*gap*TMath::Tan(ang)+ |
561 | (zSenStrip/2)/TMath::Cos(ang); | |
562 | ||
b94fa26c | 563 | gap = fGapB; |
2cef3cb2 | 564 | zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)- |
43808676 | 565 | upDown*gap*TMath::Tan(ang)- |
566 | (zSenStrip/2)/TMath::Cos(ang); | |
567 | ||
b94fa26c | 568 | ang = atan(zcoor/radius); |
2cef3cb2 | 569 | ang *= kRaddeg; |
570 | AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.); | |
571 | AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.); | |
572 | ang /= kRaddeg; | |
43808676 | 573 | |
b94fa26c | 574 | ycoor = -14.5+ kspace; //2 cm over front plate |
575 | ycoor += (1-(upDown+1)/2)*gap; | |
2cef3cb2 | 576 | gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); |
577 | gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); | |
43808676 | 578 | |
68861244 | 579 | if(fDebug) { |
43808676 | 580 | printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,i); |
581 | printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); | |
68861244 | 582 | } |
43808676 | 583 | |
b94fa26c | 584 | ycoor = -hTof/2.+ kspace;//2 cm over front plate |
43808676 | 585 | |
2cef3cb2 | 586 | // Plate B |
43808676 | 587 | |
937fe4a4 | 588 | nrot = 0; |
589 | i=1; | |
b94fa26c | 590 | upDown = 1; |
591 | Float_t deadRegion = 1.0;//cm | |
2cef3cb2 | 592 | |
593 | zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)- | |
43808676 | 594 | upDown*gap*TMath::Tan(ang)- |
595 | (zSenStrip/2)/TMath::Cos(ang)- | |
596 | deadRegion/TMath::Cos(ang); | |
597 | ||
b94fa26c | 598 | ang = atan(zpos/radius); |
2cef3cb2 | 599 | ang *= kRaddeg; |
600 | AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.); | |
601 | ang /= kRaddeg; | |
b94fa26c | 602 | ycoor = -hTof*0.5+ kspace ; //2 cm over front plate |
603 | ycoor += (1-(upDown+1)/2)*gap; | |
2cef3cb2 | 604 | zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB |
605 | gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); | |
43808676 | 606 | |
68861244 | 607 | if(fDebug) { |
43808676 | 608 | printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); |
609 | printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); | |
68861244 | 610 | } |
43808676 | 611 | |
2cef3cb2 | 612 | i++; |
b94fa26c | 613 | upDown*=-1; |
43808676 | 614 | |
937fe4a4 | 615 | do { |
43808676 | 616 | zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)- |
617 | upDown*gap*TMath::Tan(ang)- | |
618 | (zSenStrip/2)/TMath::Cos(ang); | |
619 | ang = atan(zpos/radius); | |
620 | ang *= kRaddeg; | |
621 | AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.); | |
622 | ang /= kRaddeg; | |
623 | Float_t deltaSpaceinB=-0.5; // [cm] to avoid overlaps with the end of freon frame | |
624 | Float_t deltaGapinB=0.5; // [cm] to avoid overlaps in between initial strips | |
625 | ycoor = -hTof*0.5+ kspace+deltaSpaceinB ; //2 cm over front plate | |
626 | ycoor += (1-(upDown+1)/2)*(gap+deltaGapinB); | |
627 | zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB | |
628 | gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); | |
629 | ||
630 | if(fDebug) { | |
631 | printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); | |
632 | printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); | |
633 | } | |
634 | ||
635 | upDown*=-1; | |
636 | i++; | |
2cef3cb2 | 637 | } while (TMath::Abs(ang*kRaddeg)<22.5); |
638 | //till we reach a tilting angle of 22.5 degrees | |
43808676 | 639 | |
b94fa26c | 640 | ycoor = -hTof*0.5+ kspace ; //2 cm over front plate |
2cef3cb2 | 641 | zpos = zpos - zSenStrip/TMath::Cos(ang); |
b213b8bd | 642 | // this avoid overlaps in between outer strips in plate B |
643 | Float_t deltaMovingUp=0.8; // [cm] | |
644 | Float_t deltaMovingDown=-0.5; // [cm] | |
43808676 | 645 | |
2cef3cb2 | 646 | do { |
43808676 | 647 | ang = atan(zpos/radius); |
648 | ang *= kRaddeg; | |
649 | AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.); | |
650 | ang /= kRaddeg; | |
651 | zcoor = zpos+(zFLTB/2+zFLTA/2+db); | |
652 | gMC->Gspos("FSTR",i, "FLTB", 0., ycoor+deltaMovingDown+deltaMovingUp, zcoor,idrotm[nrot], "ONLY"); | |
653 | deltaMovingUp+=0.8; // update delta moving toward the end of the plate | |
654 | zpos = zpos - zSenStrip/TMath::Cos(ang); | |
655 | if(fDebug) { | |
656 | printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); | |
657 | printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); | |
658 | } | |
659 | i++; | |
660 | ||
b94fa26c | 661 | } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db); |
43808676 | 662 | |
2cef3cb2 | 663 | // Plate C |
664 | ||
665 | zpos = zpos + zSenStrip/TMath::Cos(ang); | |
43808676 | 666 | |
2cef3cb2 | 667 | zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+ |
43808676 | 668 | gap*TMath::Tan(ang)- |
669 | (zSenStrip/2)/TMath::Cos(ang); | |
670 | ||
937fe4a4 | 671 | nrot = 0; |
672 | i=0; | |
b213b8bd | 673 | Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate |
674 | ycoor= -hTof*0.5+kspace+gap+deltaGap; | |
43808676 | 675 | |
2cef3cb2 | 676 | do { |
43808676 | 677 | i++; |
678 | ang = atan(zpos/radius); | |
679 | ang *= kRaddeg; | |
680 | AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.); | |
681 | ang /= kRaddeg; | |
682 | zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2); | |
683 | gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); | |
684 | ||
685 | if(fDebug) { | |
686 | printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i); | |
687 | printf("%s: y = %f, z = %f, zpos = %f \n",ClassName(),ycoor,zcoor,zpos); | |
688 | } | |
689 | ||
690 | zpos = zpos - zSenStrip/TMath::Cos(ang); | |
b94fa26c | 691 | } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t); |
43808676 | 692 | |
693 | ||
694 | ////////// Layers after strips ///////////////// | |
695 | // Al Layer thickness (2.3mm) factor 0.7 | |
696 | ||
b94fa26c | 697 | Float_t overSpace = fOverSpc;//cm |
43808676 | 698 | |
b94fa26c | 699 | par[0] = xFLT*0.5; |
43808676 | 700 | par[1] = 0.115*0.7; // factor 0.7 |
b94fa26c | 701 | par[2] = (zFLTA *0.5); |
702 | ycoor = -yFLT/2 + overSpace + par[1]; | |
43808676 | 703 | gMC->Gsvolu("FPEA", "BOX ", idtmed[508], par, 3); // Al |
2cef3cb2 | 704 | gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY"); |
b94fa26c | 705 | par[2] = (zFLTB *0.5); |
43808676 | 706 | gMC->Gsvolu("FPEB", "BOX ", idtmed[508], par, 3); // Al |
2cef3cb2 | 707 | gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY"); |
b94fa26c | 708 | par[2] = (zFLTC *0.5); |
43808676 | 709 | gMC->Gsvolu("FPEC", "BOX ", idtmed[508], par, 3); // Al |
2cef3cb2 | 710 | gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY"); |
937fe4a4 | 711 | |
43808676 | 712 | |
713 | // plexiglass thickness: 1.5 mm ; factor 0.3 | |
937fe4a4 | 714 | ycoor += par[1]; |
b94fa26c | 715 | par[0] = xFLT*0.5; |
43808676 | 716 | par[1] = 0.075*0.3; // factor 0.3 |
b94fa26c | 717 | par[2] = (zFLTA *0.5); |
937fe4a4 | 718 | ycoor += par[1]; |
43808676 | 719 | gMC->Gsvolu("FECA", "BOX ", idtmed[505], par, 3); // Plexigl. |
2cef3cb2 | 720 | gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY"); |
b94fa26c | 721 | par[2] = (zFLTB *0.5); |
43808676 | 722 | gMC->Gsvolu("FECB", "BOX ", idtmed[505], par, 3); // Plexigl. |
2cef3cb2 | 723 | gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY"); |
b94fa26c | 724 | par[2] = (zFLTC *0.5); |
43808676 | 725 | gMC->Gsvolu("FECC", "BOX ", idtmed[505], par, 3); // Plexigl. |
2cef3cb2 | 726 | gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY"); |
43808676 | 727 | |
728 | // frame of Air | |
b94fa26c | 729 | ycoor += par[1]; |
730 | par[0] = xFLT*0.5; | |
43808676 | 731 | par[1] = (yFLT/2-ycoor-khAlWall)*0.5; // Aluminum layer considered (0.18 cm) |
b94fa26c | 732 | par[2] = (zFLTA *0.5); |
733 | ycoor += par[1]; | |
734 | gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air | |
735 | gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY"); | |
736 | par[2] = (zFLTB *0.5); | |
737 | gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air | |
738 | gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY"); | |
739 | par[2] = (zFLTC *0.5); | |
740 | gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air | |
741 | gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY"); | |
43808676 | 742 | |
743 | ||
744 | // start with cards and cooling tubes | |
745 | // finally, cards, cooling tubes and layer for thermal dispersion | |
746 | // 3 volumes | |
747 | // card volume definition | |
748 | ||
749 | // see GEOM200 in GEANT manual | |
750 | AliMatrix(idrotm[98], 90., 0., 90., 90., 0., 0.); // 0 deg | |
751 | ||
752 | Float_t cardpar[3]; | |
753 | cardpar[0]= 61.; | |
754 | cardpar[1]= 5.; | |
755 | cardpar[2]= 0.1; | |
756 | gMC->Gsvolu("FCAR", "BOX ", idtmed[504], cardpar, 3); // PCB Card | |
757 | //alu plate volume definition | |
758 | cardpar[1]= 3.5; | |
759 | cardpar[2]= 0.05; | |
760 | gMC->Gsvolu("FALP", "BOX ", idtmed[508], cardpar, 3); // Alu Plate | |
761 | ||
762 | ||
763 | // central module positioning (FAIA) | |
764 | Float_t cardpos[3], aplpos2, stepforcardA=6.625; | |
765 | cardpos[0]= 0.; | |
766 | cardpos[1]= -0.5; | |
767 | cardpos[2]= -53.; | |
768 | Float_t aplpos1 = -2.; | |
769 | Int_t icard; | |
770 | for (icard=0; icard<15; ++icard) { | |
771 | cardpos[2]= cardpos[2]+stepforcardA; | |
772 | aplpos2 = cardpos[2]+0.15; | |
773 | gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY"); | |
774 | gMC->Gspos("FALP",icard,"FAIA",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY"); | |
775 | ||
776 | } | |
777 | ||
778 | ||
779 | // intermediate module positioning (FAIB) | |
780 | Float_t stepforcardB= 7.05; | |
781 | cardpos[2]= -70.5; | |
782 | for (icard=0; icard<19; ++icard) { | |
783 | cardpos[2]= cardpos[2]+stepforcardB; | |
784 | aplpos2 = cardpos[2]+0.15; | |
785 | gMC->Gspos("FCAR",icard,"FAIB",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY"); | |
786 | gMC->Gspos("FALP",icard,"FAIB",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY"); | |
787 | } | |
788 | ||
789 | ||
790 | // outer module positioning (FAIC) | |
791 | Float_t stepforcardC= 8.45238; | |
792 | cardpos[2]= -88.75; | |
793 | for (icard=0; icard<20; ++icard) { | |
794 | cardpos[2]= cardpos[2]+stepforcardC; | |
795 | aplpos2 = cardpos[2]+0.15; | |
796 | gMC->Gspos("FCAR",icard,"FAIC",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY"); | |
797 | gMC->Gspos("FALP",icard,"FAIC",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY"); | |
798 | } | |
799 | ||
800 | // tube volume definition | |
801 | Float_t tubepar[3]; | |
802 | tubepar[0]= 0.; | |
803 | tubepar[1]= 0.4; | |
804 | tubepar[2]= 61.; | |
805 | gMC->Gsvolu("FTUB", "TUBE", idtmed[516], tubepar, 3); // cooling tubes (steel) | |
806 | tubepar[0]= 0.; | |
807 | tubepar[1]= 0.35; | |
808 | tubepar[2]= 61.; | |
809 | gMC->Gsvolu("FITU", "TUBE", idtmed[515], tubepar, 3); // cooling water | |
810 | // positioning water tube into the steel one | |
811 | gMC->Gspos("FITU",1,"FTUB",0.,0.,0.,0,"ONLY"); | |
812 | ||
813 | ||
814 | // rotation matrix | |
815 | AliMatrix(idrotm[99], 180., 90., 90., 90., 90., 0.); | |
816 | // central module positioning (FAIA) | |
817 | Float_t tubepos[3], tdis=0.6; | |
818 | tubepos[0]= 0.; | |
819 | tubepos[1]= cardpos[1]; | |
820 | tubepos[2]= -53.+tdis; | |
821 | // tub1pos = 5.; | |
822 | Int_t itub; | |
823 | for (itub=0; itub<15; ++itub) { | |
824 | tubepos[2]= tubepos[2]+stepforcardA; | |
825 | gMC->Gspos("FTUB",itub,"FAIA",tubepos[0],tubepos[1],tubepos[2],idrotm[99], | |
826 | "ONLY"); | |
827 | } | |
828 | ||
829 | ||
830 | // intermediate module positioning (FAIB) | |
831 | tubepos[2]= -70.5+tdis; | |
832 | for (itub=0; itub<19; ++itub) { | |
833 | tubepos[2]= tubepos[2]+stepforcardB; | |
834 | gMC->Gspos("FTUB",itub,"FAIB",tubepos[0],tubepos[1],tubepos[2],idrotm[99], | |
835 | "ONLY"); | |
836 | } | |
837 | ||
838 | // outer module positioning (FAIC) | |
839 | tubepos[2]= -88.75+tdis; | |
840 | for (itub=0; itub<20; ++itub) { | |
841 | tubepos[2]= tubepos[2]+stepforcardC; | |
842 | gMC->Gspos("FTUB",itub,"FAIC",tubepos[0],tubepos[1],tubepos[2],idrotm[99], | |
843 | "ONLY"); | |
844 | } | |
845 | ||
fe4da5cc | 846 | } |
847 | ||
848 | //_____________________________________________________________________________ | |
68861244 | 849 | void AliTOFv2::DrawModule() const |
fe4da5cc | 850 | { |
851 | // | |
517b7f8f | 852 | // Draw a shaded view of the Time Of Flight version 2 |
fe4da5cc | 853 | // |
fe4da5cc | 854 | // Set everything unseen |
cfce8870 | 855 | gMC->Gsatt("*", "seen", -1); |
fe4da5cc | 856 | // |
857 | // Set ALIC mother transparent | |
cfce8870 | 858 | gMC->Gsatt("ALIC","SEEN",0); |
fe4da5cc | 859 | // |
860 | // Set the volumes visible | |
cfce8870 | 861 | gMC->Gsatt("ALIC","SEEN",0); |
2cef3cb2 | 862 | |
863 | gMC->Gsatt("FTOA","SEEN",1); | |
864 | gMC->Gsatt("FTOB","SEEN",1); | |
865 | gMC->Gsatt("FTOC","SEEN",1); | |
866 | gMC->Gsatt("FLTA","SEEN",1); | |
867 | gMC->Gsatt("FLTB","SEEN",1); | |
868 | gMC->Gsatt("FLTC","SEEN",1); | |
869 | gMC->Gsatt("FPLA","SEEN",1); | |
870 | gMC->Gsatt("FPLB","SEEN",1); | |
871 | gMC->Gsatt("FPLC","SEEN",1); | |
872 | gMC->Gsatt("FSTR","SEEN",1); | |
873 | gMC->Gsatt("FPEA","SEEN",1); | |
874 | gMC->Gsatt("FPEB","SEEN",1); | |
875 | gMC->Gsatt("FPEC","SEEN",1); | |
876 | ||
877 | gMC->Gsatt("FLZ1","SEEN",0); | |
878 | gMC->Gsatt("FLZ2","SEEN",0); | |
879 | gMC->Gsatt("FLZ3","SEEN",0); | |
880 | gMC->Gsatt("FLX1","SEEN",0); | |
881 | gMC->Gsatt("FLX2","SEEN",0); | |
882 | gMC->Gsatt("FLX3","SEEN",0); | |
883 | gMC->Gsatt("FPAD","SEEN",0); | |
884 | ||
cfce8870 | 885 | gMC->Gdopt("hide", "on"); |
886 | gMC->Gdopt("shad", "on"); | |
887 | gMC->Gsatt("*", "fill", 7); | |
888 | gMC->SetClipBox("."); | |
889 | gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000); | |
890 | gMC->DefaultRange(); | |
891 | gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02); | |
892 | gMC->Gdhead(1111, "Time Of Flight"); | |
893 | gMC->Gdman(18, 4, "MAN"); | |
894 | gMC->Gdopt("hide","off"); | |
fe4da5cc | 895 | } |
517b7f8f | 896 | //_____________________________________________________________________________ |
897 | void AliTOFv2::DrawDetectorModules() | |
898 | { | |
899 | // | |
900 | // Draw a shaded view of the TOF detector version 2 | |
901 | // | |
902 | ||
517b7f8f | 903 | //Set ALIC mother transparent |
4c475d27 | 904 | gMC->Gsatt("ALIC","SEEN",0); |
517b7f8f | 905 | |
906 | // | |
907 | //Set volumes visible | |
908 | // | |
909 | //=====> Level 1 | |
910 | // Level 1 for TOF volumes | |
911 | gMC->Gsatt("B077","seen",0); | |
912 | ||
913 | ||
914 | //==========> Level 2 | |
915 | // Level 2 | |
916 | gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped - | |
917 | gMC->Gsatt("B071","seen",0); | |
918 | gMC->Gsatt("B074","seen",0); | |
919 | gMC->Gsatt("B075","seen",0); | |
920 | gMC->Gsatt("B080","seen",0); // B080 does not has sub-level | |
921 | ||
922 | ||
923 | // Level 2 of B071 | |
924 | gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped - | |
925 | gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped - | |
926 | gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped - | |
927 | gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped - | |
928 | gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels - | |
929 | gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped - | |
930 | gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped - | |
931 | gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels - | |
932 | gMC->Gsatt("BTO1","seen",0); | |
933 | ||
934 | ||
935 | // Level 2 of B074 | |
936 | gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels - | |
937 | gMC->Gsatt("BTO2","seen",0); | |
938 | ||
939 | // Level 2 of B075 | |
940 | gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels - | |
941 | gMC->Gsatt("BTO3","seen",0); | |
942 | ||
943 | // ==================> Level 3 | |
944 | // Level 3 of B071 / Level 2 of BTO1 | |
945 | gMC->Gsatt("FTOC","seen",-2); | |
946 | gMC->Gsatt("FTOB","seen",-2); | |
947 | gMC->Gsatt("FTOA","seen",-2); | |
948 | ||
949 | // Level 3 of B074 / Level 2 of BTO2 | |
950 | // -> cfr previous settings | |
951 | ||
952 | // Level 3 of B075 / Level 2 of BTO3 | |
953 | // -> cfr previous settings | |
954 | ||
955 | gMC->Gdopt("hide","on"); | |
956 | gMC->Gdopt("shad","on"); | |
957 | gMC->Gsatt("*", "fill", 5); | |
958 | gMC->SetClipBox("."); | |
959 | gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000); | |
960 | gMC->DefaultRange(); | |
961 | gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015); | |
962 | gMC->Gdhead(1111,"TOF detector V1"); | |
963 | gMC->Gdman(18, 4, "MAN"); | |
964 | gMC->Gdopt("hide","off"); | |
965 | } | |
966 | ||
967 | //_____________________________________________________________________________ | |
968 | void AliTOFv2::DrawDetectorStrips() | |
969 | { | |
970 | // | |
971 | // Draw a shaded view of the TOF strips for version 2 | |
972 | // | |
973 | ||
517b7f8f | 974 | //Set ALIC mother transparent |
4c475d27 | 975 | gMC->Gsatt("ALIC","SEEN",0); |
517b7f8f | 976 | |
977 | // | |
978 | //Set volumes visible | |
979 | //=====> Level 1 | |
980 | // Level 1 for TOF volumes | |
981 | gMC->Gsatt("B077","seen",0); | |
982 | ||
983 | //==========> Level 2 | |
984 | // Level 2 | |
985 | gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped - | |
986 | gMC->Gsatt("B071","seen",0); | |
987 | gMC->Gsatt("B074","seen",0); | |
988 | gMC->Gsatt("B075","seen",0); | |
989 | gMC->Gsatt("B080","seen",0); // B080 does not has sub-level | |
990 | ||
991 | // Level 2 of B071 | |
992 | gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped - | |
993 | gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped - | |
994 | gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped - | |
995 | gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped - | |
996 | gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels - | |
997 | gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped - | |
998 | gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped - | |
999 | gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels - | |
1000 | gMC->Gsatt("BTO1","seen",0); | |
1001 | ||
1002 | // ==================> Level 3 | |
1003 | // Level 3 of B071 / Level 2 of BTO1 | |
1004 | gMC->Gsatt("FTOC","seen",0); | |
1005 | gMC->Gsatt("FTOB","seen",0); | |
1006 | gMC->Gsatt("FTOA","seen",0); | |
1007 | ||
1008 | // Level 3 of B074 / Level 2 of BTO2 | |
1009 | // -> cfr previous settings | |
1010 | ||
1011 | // Level 3 of B075 / Level 2 of BTO3 | |
1012 | // -> cfr previous settings | |
1013 | ||
1014 | ||
1015 | // ==========================> Level 4 | |
1016 | // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC | |
1017 | gMC->Gsatt("FLTC","seen",0); | |
1018 | // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB | |
1019 | gMC->Gsatt("FLTB","seen",0); | |
1020 | // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA | |
1021 | gMC->Gsatt("FLTA","seen",0); | |
1022 | ||
1023 | // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC | |
1024 | // -> cfr previous settings | |
1025 | // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB | |
1026 | // -> cfr previous settings | |
1027 | ||
1028 | // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC | |
1029 | // -> cfr previous settings | |
1030 | ||
1031 | //======================================> Level 5 | |
1032 | // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC | |
1033 | gMC->Gsatt("FALC","seen",0); // no children for FALC | |
1034 | gMC->Gsatt("FSTR","seen",-2); | |
1035 | gMC->Gsatt("FPEC","seen",0); // no children for FPEC | |
1036 | gMC->Gsatt("FECC","seen",0); // no children for FECC | |
1037 | gMC->Gsatt("FWAC","seen",0); // no children for FWAC | |
1038 | gMC->Gsatt("FAIC","seen",0); // no children for FAIC | |
1039 | ||
1040 | // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB | |
1041 | gMC->Gsatt("FALB","seen",0); // no children for FALB | |
1042 | //--> gMC->Gsatt("FSTR","seen",-2); | |
1043 | ||
1044 | ||
1045 | // -> cfr previous settings | |
1046 | gMC->Gsatt("FPEB","seen",0); // no children for FPEB | |
1047 | gMC->Gsatt("FECB","seen",0); // no children for FECB | |
1048 | gMC->Gsatt("FWAB","seen",0); // no children for FWAB | |
1049 | gMC->Gsatt("FAIB","seen",0); // no children for FAIB | |
1050 | ||
1051 | // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA | |
1052 | gMC->Gsatt("FALA","seen",0); // no children for FALB | |
1053 | //--> gMC->Gsatt("FSTR","seen",-2); | |
1054 | // -> cfr previous settings | |
1055 | gMC->Gsatt("FPEA","seen",0); // no children for FPEA | |
1056 | gMC->Gsatt("FECA","seen",0); // no children for FECA | |
1057 | gMC->Gsatt("FWAA","seen",0); // no children for FWAA | |
1058 | gMC->Gsatt("FAIA","seen",0); // no children for FAIA | |
1059 | ||
1060 | // Level 2 of B074 | |
1061 | gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels - | |
1062 | gMC->Gsatt("BTO2","seen",0); | |
1063 | ||
1064 | // Level 2 of B075 | |
1065 | gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels - | |
1066 | gMC->Gsatt("BTO3","seen",0); | |
1067 | ||
1068 | // for others Level 5, cfr. previous settings | |
1069 | ||
1070 | gMC->Gdopt("hide","on"); | |
1071 | gMC->Gdopt("shad","on"); | |
1072 | gMC->Gsatt("*", "fill", 5); | |
1073 | gMC->SetClipBox("."); | |
1074 | gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000); | |
1075 | gMC->DefaultRange(); | |
1076 | gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015); | |
1077 | gMC->Gdhead(1111,"TOF Strips V1"); | |
1078 | gMC->Gdman(18, 4, "MAN"); | |
1079 | gMC->Gdopt("hide","off"); | |
1080 | } | |
fe4da5cc | 1081 | |
1082 | //_____________________________________________________________________________ | |
1083 | void AliTOFv2::CreateMaterials() | |
1084 | { | |
1085 | // | |
1086 | // Define materials for the Time Of Flight | |
1087 | // | |
1088 | AliTOF::CreateMaterials(); | |
1089 | } | |
1090 | ||
1091 | //_____________________________________________________________________________ | |
1092 | void AliTOFv2::Init() | |
1093 | { | |
1094 | // | |
1095 | // Initialise the detector after the geometry has been defined | |
1096 | // | |
68861244 | 1097 | if(fDebug) { |
9e1a0ddb | 1098 | printf("%s: **************************************" |
68861244 | 1099 | " TOF " |
1100 | "**************************************\n",ClassName()); | |
9e1a0ddb | 1101 | printf("\n%s: Version 2 of TOF initialing, " |
68861244 | 1102 | "TOF with holes for PHOS and RICH \n",ClassName()); |
1103 | } | |
ab76897d | 1104 | |
fe4da5cc | 1105 | AliTOF::Init(); |
ab76897d | 1106 | |
2cef3cb2 | 1107 | fIdFTOA = gMC->VolId("FTOA"); |
1108 | fIdFTOB = gMC->VolId("FTOB"); | |
1109 | fIdFTOC = gMC->VolId("FTOC"); | |
1110 | fIdFLTA = gMC->VolId("FLTA"); | |
1111 | fIdFLTB = gMC->VolId("FLTB"); | |
1112 | fIdFLTC = gMC->VolId("FLTC"); | |
1113 | ||
9e1a0ddb | 1114 | if(fDebug) { |
1115 | printf("%s: **************************************" | |
68861244 | 1116 | " TOF " |
1117 | "**************************************\n",ClassName()); | |
9e1a0ddb | 1118 | } |
fe4da5cc | 1119 | } |
1120 | ||
1121 | //_____________________________________________________________________________ | |
1122 | void AliTOFv2::StepManager() | |
1123 | { | |
1124 | // | |
1125 | // Procedure called at each step in the Time Of Flight | |
1126 | // | |
3fe3a833 | 1127 | TLorentzVector mom, pos; |
2cef3cb2 | 1128 | Float_t xm[3],pm[3],xpad[3],ppad[3]; |
1129 | Float_t hits[13],phi,phid,z; | |
1130 | Int_t vol[5]; | |
b94fa26c | 1131 | Int_t sector, plate, padx, padz, strip; |
1132 | Int_t copy, padzid, padxid, stripid, i; | |
2cef3cb2 | 1133 | Int_t *idtmed = fIdtmed->GetArray()-499; |
b94fa26c | 1134 | Float_t incidenceAngle; |
826b71ec | 1135 | |
1136 | if(gMC->GetMedium()==idtmed[513] && | |
0a6d8768 | 1137 | gMC->IsTrackEntering() && gMC->TrackCharge() |
826b71ec | 1138 | && gMC->CurrentVolID(copy)==fIdSens) |
2cef3cb2 | 1139 | { |
1140 | // getting information about hit volumes | |
826b71ec | 1141 | |
b94fa26c | 1142 | padzid=gMC->CurrentVolOffID(2,copy); |
1143 | padz=copy; | |
826b71ec | 1144 | |
b94fa26c | 1145 | padxid=gMC->CurrentVolOffID(1,copy); |
1146 | padx=copy; | |
826b71ec | 1147 | |
b94fa26c | 1148 | stripid=gMC->CurrentVolOffID(4,copy); |
826b71ec | 1149 | strip=copy; |
1150 | ||
0a6d8768 | 1151 | gMC->TrackPosition(pos); |
1152 | gMC->TrackMomentum(mom); | |
826b71ec | 1153 | |
2cef3cb2 | 1154 | // Double_t NormPos=1./pos.Rho(); |
b94fa26c | 1155 | Double_t normMom=1./mom.Rho(); |
2cef3cb2 | 1156 | |
1157 | // getting the cohordinates in pad ref system | |
1158 | xm[0] = (Float_t)pos.X(); | |
1159 | xm[1] = (Float_t)pos.Y(); | |
1160 | xm[2] = (Float_t)pos.Z(); | |
1161 | ||
b94fa26c | 1162 | pm[0] = (Float_t)mom.X()*normMom; |
1163 | pm[1] = (Float_t)mom.Y()*normMom; | |
1164 | pm[2] = (Float_t)mom.Z()*normMom; | |
2cef3cb2 | 1165 | |
1166 | gMC->Gmtod(xm,xpad,1); | |
1167 | gMC->Gmtod(pm,ppad,2); | |
5919c40c | 1168 | |
1169 | if (ppad[1] > 1.) ppad[1]=1; | |
1170 | if (ppad[1] < -1.) ppad[1]=-1; | |
b94fa26c | 1171 | incidenceAngle = TMath::ACos(ppad[1])*kRaddeg; |
826b71ec | 1172 | |
1173 | z = pos[2]; | |
2cef3cb2 | 1174 | |
1175 | plate = 0; | |
1176 | if (TMath::Abs(z) <= fZlenA*0.5) plate = 3; | |
1177 | if (z < (fZlenA*0.5+fZlenB) && | |
1178 | z > fZlenA*0.5) plate = 4; | |
1179 | if (z >-(fZlenA*0.5+fZlenB) && | |
1180 | z < -fZlenA*0.5) plate = 2; | |
1181 | if (z > (fZlenA*0.5+fZlenB)) plate = 5; | |
1182 | if (z <-(fZlenA*0.5+fZlenB)) plate = 1; | |
1183 | ||
1184 | phi = pos.Phi(); | |
1185 | phid = phi*kRaddeg+180.; | |
826b71ec | 1186 | sector = Int_t (phid/20.); |
1187 | sector++; | |
1188 | ||
0a6d8768 | 1189 | for(i=0;i<3;++i) { |
2cef3cb2 | 1190 | hits[i] = pos[i]; |
1191 | hits[i+3] = pm[i]; | |
0a6d8768 | 1192 | } |
2cef3cb2 | 1193 | |
1194 | hits[6] = mom.Rho(); | |
1195 | hits[7] = pos[3]; | |
1196 | hits[8] = xpad[0]; | |
1197 | hits[9] = xpad[1]; | |
1198 | hits[10]= xpad[2]; | |
b94fa26c | 1199 | hits[11]= incidenceAngle; |
2cef3cb2 | 1200 | hits[12]= gMC->Edep(); |
1201 | ||
1202 | vol[0]= sector; | |
1203 | vol[1]= plate; | |
1204 | vol[2]= strip; | |
b94fa26c | 1205 | vol[3]= padx; |
1206 | vol[4]= padz; | |
2cef3cb2 | 1207 | |
1208 | AddHit(gAlice->CurrentTrack(),vol, hits); | |
fe4da5cc | 1209 | } |
1210 | } |