]>
Commit | Line | Data |
---|---|---|
937fe4a4 | 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 | ||
88cb7938 | 16 | /* $Id$ */ |
937fe4a4 | 17 | |
18 | /////////////////////////////////////////////////////////////////////////////// | |
da3d3acd | 19 | // // |
68861244 | 20 | // This class contains the functions for version 4 of the Time Of Flight // |
937fe4a4 | 21 | // detector. // |
da3d3acd | 22 | // // |
23 | // VERSION WITH 5 MODULES AND TILTED STRIPS // | |
24 | // // | |
25 | // FULL COVERAGE VERSION // | |
26 | // // | |
27 | // // | |
28 | // Authors: // | |
29 | // // | |
30 | // Alessio Seganti // | |
31 | // Domenico Vicinanza // | |
32 | // // | |
33 | // University of Salerno - Italy // | |
34 | // // | |
35 | // Fabrizio Pierella // | |
36 | // University of Bologna - Italy // | |
37 | // // | |
38 | // // | |
39 | //Begin_Html // | |
40 | /* // | |
41 | <img src="picts/AliTOFv4Class.gif"> // | |
42 | */ // | |
43 | //End_Html // | |
937fe4a4 | 44 | // // |
45 | /////////////////////////////////////////////////////////////////////////////// | |
46 | ||
f8014e68 | 47 | #include <Riostream.h> |
ab76897d | 48 | #include <stdlib.h> |
49 | ||
0cc62300 | 50 | #include <TLorentzVector.h> |
88cb7938 | 51 | #include <TObject.h> |
52 | #include <TVirtualMC.h> | |
2cef3cb2 | 53 | |
88cb7938 | 54 | #include "AliConst.h" |
55 | #include "AliRun.h" | |
56 | #include "AliTOFv4.h" | |
da3d3acd | 57 | #include "AliTOFConstants.h" // AdC |
5d12ce38 | 58 | #include "AliMC.h" |
937fe4a4 | 59 | |
60 | ClassImp(AliTOFv4) | |
61 | ||
62 | //_____________________________________________________________________________ | |
63 | AliTOFv4::AliTOFv4() | |
64 | { | |
65 | // | |
66 | // Default constructor | |
67 | // | |
68 | } | |
69 | ||
70 | //_____________________________________________________________________________ | |
71 | AliTOFv4::AliTOFv4(const char *name, const char *title) | |
2cef3cb2 | 72 | : AliTOF(name,title) |
937fe4a4 | 73 | { |
74 | // | |
75 | // Standard constructor | |
76 | // | |
da39da0c | 77 | // |
78 | // Check that FRAME is there otherwise we have no place where to | |
79 | // put TOF | |
b94fa26c | 80 | AliModule* frame=gAlice->GetModule("FRAME"); |
81 | if(!frame) { | |
da39da0c | 82 | Error("Ctor","TOF needs FRAME to be present\n"); |
83 | exit(1); | |
2cef3cb2 | 84 | } else |
b94fa26c | 85 | if(frame->IsVersion()!=1) { |
2cef3cb2 | 86 | Error("Ctor","FRAME version 1 needed with this version of TOF\n"); |
da39da0c | 87 | exit(1); |
88 | } | |
2cef3cb2 | 89 | |
90 | } | |
937fe4a4 | 91 | |
92 | //_____________________________________________________________________________ | |
93 | void AliTOFv4::CreateGeometry() | |
94 | { | |
95 | // | |
96 | // Create geometry for Time Of Flight version 0 | |
97 | // | |
98 | //Begin_Html | |
99 | /* | |
100 | <img src="picts/AliTOFv4.gif"> | |
101 | */ | |
102 | //End_Html | |
103 | // | |
104 | // Creates common geometry | |
105 | // | |
106 | AliTOF::CreateGeometry(); | |
107 | } | |
108 | ||
109 | //_____________________________________________________________________________ | |
2cef3cb2 | 110 | void AliTOFv4::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC, |
111 | Float_t zlenB, Float_t zlenA, Float_t ztof0) | |
937fe4a4 | 112 | { |
113 | // | |
114 | // Definition of the Time Of Fligh Resistive Plate Chambers | |
115 | // xFLT, yFLT, zFLT - sizes of TOF modules (large) | |
116 | ||
937fe4a4 | 117 | Float_t ycoor, zcoor; |
b94fa26c | 118 | Float_t par[3]; |
2cef3cb2 | 119 | Int_t *idtmed = fIdtmed->GetArray()-499; |
120 | Int_t idrotm[100]; | |
121 | Int_t nrot = 0; | |
122 | Float_t hTof = fRmax-fRmin; | |
937fe4a4 | 123 | |
b94fa26c | 124 | Float_t radius = fRmin+2.;//cm |
937fe4a4 | 125 | |
2cef3cb2 | 126 | par[0] = xtof * 0.5; |
127 | par[1] = ytof * 0.5; | |
128 | par[2] = zlenC * 0.5; | |
129 | gMC->Gsvolu("FTOC", "BOX ", idtmed[506], par, 3); | |
130 | par[2] = zlenB * 0.5; | |
131 | gMC->Gsvolu("FTOB", "BOX ", idtmed[506], par, 3); | |
132 | par[2] = zlenA * 0.5; | |
133 | gMC->Gsvolu("FTOA", "BOX ", idtmed[506], par, 3); | |
937fe4a4 | 134 | |
135 | ||
43808676 | 136 | // Positioning of modules |
2cef3cb2 | 137 | |
43808676 | 138 | Float_t zcor1 = ztof0 - zlenC*0.5; |
139 | Float_t zcor2 = ztof0 - zlenC - zlenB*0.5; | |
140 | Float_t zcor3 = 0.; | |
141 | ||
142 | AliMatrix(idrotm[0], 90., 0., 0., 0., 90,-90.); | |
143 | AliMatrix(idrotm[1], 90.,180., 0., 0., 90, 90.); | |
144 | gMC->Gspos("FTOC", 1, "BTO1", 0, zcor1, 0, idrotm[0], "ONLY"); | |
145 | gMC->Gspos("FTOC", 2, "BTO1", 0, -zcor1, 0, idrotm[1], "ONLY"); | |
146 | gMC->Gspos("FTOC", 1, "BTO2", 0, zcor1, 0, idrotm[0], "ONLY"); | |
147 | gMC->Gspos("FTOC", 2, "BTO2", 0, -zcor1, 0, idrotm[1], "ONLY"); | |
148 | gMC->Gspos("FTOC", 1, "BTO3", 0, zcor1, 0, idrotm[0], "ONLY"); | |
149 | gMC->Gspos("FTOC", 2, "BTO3", 0, -zcor1, 0, idrotm[1], "ONLY"); | |
150 | ||
151 | gMC->Gspos("FTOB", 1, "BTO1", 0, zcor2, 0, idrotm[0], "ONLY"); | |
152 | gMC->Gspos("FTOB", 2, "BTO1", 0, -zcor2, 0, idrotm[1], "ONLY"); | |
153 | gMC->Gspos("FTOB", 1, "BTO2", 0, zcor2, 0, idrotm[0], "ONLY"); | |
154 | gMC->Gspos("FTOB", 2, "BTO2", 0, -zcor2, 0, idrotm[1], "ONLY"); | |
155 | gMC->Gspos("FTOB", 1, "BTO3", 0, zcor2, 0, idrotm[0], "ONLY"); | |
156 | gMC->Gspos("FTOB", 2, "BTO3", 0, -zcor2, 0, idrotm[1], "ONLY"); | |
157 | ||
158 | gMC->Gspos("FTOA", 0, "BTO1", 0, zcor3, 0, idrotm[0], "ONLY"); | |
159 | gMC->Gspos("FTOA", 0, "BTO2", 0, zcor3, 0, idrotm[0], "ONLY"); | |
160 | gMC->Gspos("FTOA", 0, "BTO3", 0, zcor3, 0, idrotm[0], "ONLY"); | |
161 | ||
2cef3cb2 | 162 | Float_t db = 0.5;//cm |
163 | Float_t xFLT, xFST, yFLT, zFLTA, zFLTB, zFLTC; | |
43808676 | 164 | |
2cef3cb2 | 165 | xFLT = fStripLn; |
937fe4a4 | 166 | yFLT = ytof; |
2cef3cb2 | 167 | zFLTA = zlenA; |
168 | zFLTB = zlenB; | |
169 | zFLTC = zlenC; | |
43808676 | 170 | |
2cef3cb2 | 171 | xFST = xFLT-fDeadBndX*2;//cm |
937fe4a4 | 172 | |
43808676 | 173 | // Sizes of MRPC pads |
174 | ||
2cef3cb2 | 175 | Float_t yPad = 0.505;//cm |
176 | ||
43808676 | 177 | // Large not sensitive volumes with Insensitive Freon |
2cef3cb2 | 178 | par[0] = xFLT*0.5; |
179 | par[1] = yFLT*0.5; | |
b94fa26c | 180 | |
9e1a0ddb | 181 | if (fDebug) cout << ClassName() << |
43808676 | 182 | ": ************************* TOF geometry **************************"<<endl; |
183 | ||
2cef3cb2 | 184 | par[2] = (zFLTA *0.5); |
b94fa26c | 185 | gMC->Gsvolu("FLTA", "BOX ", idtmed[512], par, 3); // Insensitive Freon |
2cef3cb2 | 186 | gMC->Gspos ("FLTA", 0, "FTOA", 0., 0., 0., 0, "ONLY"); |
43808676 | 187 | |
2cef3cb2 | 188 | par[2] = (zFLTB * 0.5); |
b94fa26c | 189 | gMC->Gsvolu("FLTB", "BOX ", idtmed[512], par, 3); // Insensitive Freon |
2cef3cb2 | 190 | gMC->Gspos ("FLTB", 0, "FTOB", 0., 0., 0., 0, "ONLY"); |
43808676 | 191 | |
b94fa26c | 192 | par[2] = (zFLTC * 0.5); |
193 | gMC->Gsvolu("FLTC", "BOX ", idtmed[512], par, 3); // Insensitive Freon | |
2cef3cb2 | 194 | gMC->Gspos ("FLTC", 0, "FTOC", 0., 0., 0., 0, "ONLY"); |
43808676 | 195 | |
196 | ///// Layers of Aluminum before and after detector ///// | |
197 | ///// Aluminum Box for Modules (1.8 mm thickness) ///// | |
198 | ///// lateral walls not simulated for the time being | |
199 | //const Float_t khAlWall = 0.18; | |
200 | // fp to be checked | |
201 | const Float_t khAlWall = 0.11; | |
b94fa26c | 202 | par[0] = xFLT*0.5; |
43808676 | 203 | par[1] = khAlWall/2.;//cm |
937fe4a4 | 204 | ycoor = -yFLT/2 + par[1]; |
b94fa26c | 205 | par[2] = (zFLTA *0.5); |
206 | gMC->Gsvolu("FALA", "BOX ", idtmed[508], par, 3); // Alluminium | |
207 | gMC->Gspos ("FALA", 1, "FLTA", 0., ycoor, 0., 0, "ONLY"); | |
208 | gMC->Gspos ("FALA", 2, "FLTA", 0.,-ycoor, 0., 0, "ONLY"); | |
209 | par[2] = (zFLTB *0.5); | |
210 | gMC->Gsvolu("FALB", "BOX ", idtmed[508], par, 3); // Alluminium | |
211 | gMC->Gspos ("FALB", 1, "FLTB", 0., ycoor, 0., 0, "ONLY"); | |
212 | gMC->Gspos ("FALB", 2, "FLTB", 0.,-ycoor, 0., 0, "ONLY"); | |
213 | par[2] = (zFLTC *0.5); | |
214 | gMC->Gsvolu("FALC", "BOX ", idtmed[508], par, 3); // Alluminium | |
215 | gMC->Gspos ("FALC", 1, "FLTC", 0., ycoor, 0., 0, "ONLY"); | |
216 | gMC->Gspos ("FALC", 2, "FLTC", 0.,-ycoor, 0., 0, "ONLY"); | |
217 | ||
43808676 | 218 | ///////////////// Detector itself ////////////////////// |
937fe4a4 | 219 | |
b94fa26c | 220 | const Float_t kdeadBound = fDeadBndZ; //cm non-sensitive between the pad edge |
43808676 | 221 | //and the boundary of the strip |
b94fa26c | 222 | const Int_t knx = fNpadX; // number of pads along x |
223 | const Int_t knz = fNpadZ; // number of pads along z | |
224 | const Float_t kspace = fSpace; //cm distance from the front plate of the box | |
43808676 | 225 | |
2cef3cb2 | 226 | Float_t zSenStrip = fZpad*fNpadZ;//cm |
b94fa26c | 227 | Float_t stripWidth = zSenStrip + 2*kdeadBound; |
43808676 | 228 | |
2cef3cb2 | 229 | par[0] = xFLT*0.5; |
da3d3acd | 230 | par[1] = yPad*0.5; |
b94fa26c | 231 | par[2] = stripWidth*0.5; |
2cef3cb2 | 232 | |
43808676 | 233 | // new description for strip volume -double stack strip- |
234 | // -- all constants are expressed in cm | |
235 | // heigth of different layers | |
236 | const Float_t khhony = 0.8 ; // heigth of HONY Layer | |
237 | const Float_t khpcby = 0.08 ; // heigth of PCB Layer | |
b94fa26c | 238 | const Float_t khmyly = 0.035 ; // heigth of MYLAR Layer |
239 | const Float_t khgraphy = 0.02 ; // heigth of GRAPHITE Layer | |
43808676 | 240 | const Float_t khglasseiy = 0.135; // 0.6 Ext. Glass + 1.1 i.e. (Int. Glass/2) (mm) |
b94fa26c | 241 | const Float_t khsensmy = 0.11 ; // heigth of Sensitive Freon Mixture |
242 | const Float_t kwsensmz = 2*3.5 ; // cm | |
243 | const Float_t klsensmx = 48*2.5; // cm | |
244 | const Float_t kwpadz = 3.5; // cm z dimension of the FPAD volume | |
245 | const Float_t klpadx = 2.5; // cm x dimension of the FPAD volume | |
246 | ||
247 | // heigth of the FSTR Volume (the strip volume) | |
dfacde63 | 248 | const Float_t khstripy = 2*khhony+3*khpcby+4*(khmyly+khgraphy+khglasseiy)+2*khsensmy; |
b94fa26c | 249 | // width of the FSTR Volume (the strip volume) |
250 | const Float_t kwstripz = 10.; | |
251 | // length of the FSTR Volume (the strip volume) | |
252 | const Float_t klstripx = 122.; | |
253 | ||
254 | Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5}; | |
43808676 | 255 | // coordinates of the strip center in the strip reference frame; used for positioning |
256 | // internal strip volumes | |
da3d3acd | 257 | Float_t posfp[3]={0.,0.,0.}; |
43808676 | 258 | |
b94fa26c | 259 | |
260 | // FSTR volume definition and filling this volume with non sensitive Gas Mixture | |
261 | gMC->Gsvolu("FSTR","BOX",idtmed[512],parfp,3); | |
262 | //-- HONY Layer definition | |
43808676 | 263 | // parfp[0] = -1; |
b94fa26c | 264 | parfp[1] = khhony*0.5; |
43808676 | 265 | // parfp[2] = -1; |
b94fa26c | 266 | gMC->Gsvolu("FHON","BOX",idtmed[503],parfp,3); |
267 | // positioning 2 HONY Layers on FSTR volume | |
43808676 | 268 | |
b94fa26c | 269 | posfp[1]=-khstripy*0.5+parfp[1]; |
270 | gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
271 | gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
43808676 | 272 | |
b94fa26c | 273 | //-- PCB Layer definition |
274 | parfp[1] = khpcby*0.5; | |
275 | gMC->Gsvolu("FPCB","BOX",idtmed[504],parfp,3); | |
276 | // positioning 2 PCB Layers on FSTR volume | |
277 | posfp[1]=-khstripy*0.5+khhony+parfp[1]; | |
278 | gMC->Gspos("FPCB",1,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
279 | gMC->Gspos("FPCB",2,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
dfacde63 | 280 | // positioning the central PCB layer |
281 | gMC->Gspos("FPCB",3,"FSTR",0.,0.,0.,0,"ONLY"); | |
43808676 | 282 | |
283 | ||
284 | ||
b94fa26c | 285 | //-- MYLAR Layer definition |
286 | parfp[1] = khmyly*0.5; | |
287 | gMC->Gsvolu("FMYL","BOX",idtmed[511],parfp,3); | |
288 | // positioning 2 MYLAR Layers on FSTR volume | |
da3d3acd | 289 | posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1]; |
b94fa26c | 290 | gMC->Gspos("FMYL",1,"FSTR",0., posfp[1],0.,0,"ONLY"); |
291 | gMC->Gspos("FMYL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
dfacde63 | 292 | // adding further 2 MYLAR Layers on FSTR volume |
293 | posfp[1] = khpcby*0.5+parfp[1]; | |
294 | gMC->Gspos("FMYL",3,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
295 | gMC->Gspos("FMYL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
43808676 | 296 | |
297 | ||
b94fa26c | 298 | //-- Graphite Layer definition |
299 | parfp[1] = khgraphy*0.5; | |
300 | gMC->Gsvolu("FGRP","BOX",idtmed[502],parfp,3); | |
301 | // positioning 2 Graphite Layers on FSTR volume | |
302 | posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+parfp[1]; | |
303 | gMC->Gspos("FGRP",1,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
304 | gMC->Gspos("FGRP",2,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
dfacde63 | 305 | // adding further 2 Graphite Layers on FSTR volume |
306 | posfp[1] = khpcby*0.5+khmyly+parfp[1]; | |
307 | gMC->Gspos("FGRP",3,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
308 | gMC->Gspos("FGRP",4,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
43808676 | 309 | |
310 | ||
b94fa26c | 311 | //-- Glass (EXT. +Semi INT.) Layer definition |
312 | parfp[1] = khglasseiy*0.5; | |
313 | gMC->Gsvolu("FGLA","BOX",idtmed[514],parfp,3); | |
314 | // positioning 2 Glass Layers on FSTR volume | |
315 | posfp[1] = -khstripy*0.5+khhony+khpcby+khmyly+khgraphy+parfp[1]; | |
316 | gMC->Gspos("FGLA",1,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
317 | gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
dfacde63 | 318 | // adding further 2 Glass Layers on FSTR volume |
319 | posfp[1] = khpcby*0.5+khmyly+khgraphy+parfp[1]; | |
320 | gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY"); | |
321 | gMC->Gspos("FGLA",4,"FSTR",0.,-posfp[1],0.,0,"ONLY"); | |
43808676 | 322 | |
b94fa26c | 323 | |
324 | //-- Sensitive Mixture Layer definition | |
325 | parfp[0] = klsensmx*0.5; | |
326 | parfp[1] = khsensmy*0.5; | |
dfacde63 | 327 | parfp[2] = kwsensmz*0.5; |
b94fa26c | 328 | gMC->Gsvolu("FSEN","BOX",idtmed[513],parfp,3); |
dfacde63 | 329 | gMC->Gsvolu("FNSE","BOX",idtmed[512],parfp,3); |
330 | // positioning 2 gas Layers on FSTR volume | |
331 | // the upper is insensitive freon | |
332 | // while the remaining is sensitive | |
333 | posfp[1] = khpcby*0.5+khmyly+khgraphy+khglasseiy+parfp[1]; | |
334 | gMC->Gspos("FNSE",0,"FSTR", 0., posfp[1],0.,0,"ONLY"); | |
335 | gMC->Gspos("FSEN",0,"FSTR", 0.,-posfp[1],0.,0,"ONLY"); | |
43808676 | 336 | |
b94fa26c | 337 | // dividing FSEN along z in knz=2 and along x in knx=48 |
338 | gMC->Gsdvn("FSEZ","FSEN",knz,3); | |
339 | gMC->Gsdvn("FSEX","FSEZ",knx,1); | |
340 | ||
341 | // FPAD volume definition | |
da3d3acd | 342 | parfp[0] = klpadx*0.5; |
b94fa26c | 343 | parfp[1] = khsensmy*0.5; |
344 | parfp[2] = kwpadz*0.5; | |
345 | gMC->Gsvolu("FPAD","BOX",idtmed[513],parfp,3); | |
346 | // positioning the FPAD volumes on previous divisions | |
347 | gMC->Gspos("FPAD",0,"FSEX",0.,0.,0.,0,"ONLY"); | |
2cef3cb2 | 348 | |
43808676 | 349 | //// Positioning the Strips (FSTR) in the FLT volumes ///// |
350 | ||
2cef3cb2 | 351 | // Plate A (Central) |
352 | ||
353 | Float_t t = zFLTC+zFLTB+zFLTA*0.5+ 2*db;//Half Width of Barrel | |
43808676 | 354 | |
b213b8bd | 355 | Float_t gap = fGapA+0.5; //cm updated distance between the strip axis |
2cef3cb2 | 356 | Float_t zpos = 0; |
357 | Float_t ang = 0; | |
da3d3acd | 358 | Int_t j=1; // AdC |
2cef3cb2 | 359 | nrot = 0; |
360 | zcoor = 0; | |
b94fa26c | 361 | ycoor = -14.5 + kspace ; //2 cm over front plate |
2cef3cb2 | 362 | |
da3d3acd | 363 | AliMatrix (idrotm[0], 90., 0.,90.,90.,0., 90.); |
364 | ||
365 | Int_t centerLoc= (Int_t)(fNStripA/2.) + 1; // AdC | |
366 | ||
367 | //gMC->Gspos("FSTR",j,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); | |
368 | gMC->Gspos("FSTR",centerLoc,"FLTA",0.,ycoor, 0.,idrotm[0],"ONLY"); // AdC | |
61e4c9ba | 369 | if(fDebug>=1) { |
da3d3acd | 370 | printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC |
371 | printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); | |
9e1a0ddb | 372 | } |
2cef3cb2 | 373 | zcoor -= zSenStrip; |
da3d3acd | 374 | //j++; // AdC |
b94fa26c | 375 | Int_t upDown = -1; // upDown=-1 -> Upper strip |
376 | // upDown=+1 -> Lower strip | |
2cef3cb2 | 377 | do{ |
b94fa26c | 378 | ang = atan(zcoor/radius); |
2cef3cb2 | 379 | ang *= kRaddeg; |
da3d3acd | 380 | AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.); |
2cef3cb2 | 381 | AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.); |
382 | ang /= kRaddeg; | |
b94fa26c | 383 | ycoor = -14.5+ kspace; //2 cm over front plate |
384 | ycoor += (1-(upDown+1)/2)*gap; | |
da3d3acd | 385 | //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); |
386 | //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); | |
387 | gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC | |
388 | gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC | |
61e4c9ba | 389 | if(fDebug>=1) { |
da3d3acd | 390 | printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC |
9e1a0ddb | 391 | printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); |
392 | } | |
da3d3acd | 393 | j++; //j += 2; // AdC |
b94fa26c | 394 | upDown*= -1; // Alternate strips |
2cef3cb2 | 395 | zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)- |
b94fa26c | 396 | upDown*gap*TMath::Tan(ang)- |
2cef3cb2 | 397 | (zSenStrip/2)/TMath::Cos(ang); |
b94fa26c | 398 | } while (zcoor-(stripWidth/2)*TMath::Cos(ang)>-t+zFLTC+zFLTB+db*2); |
2cef3cb2 | 399 | |
400 | zcoor = zcoor+(zSenStrip/2)/TMath::Cos(ang)+ | |
b94fa26c | 401 | upDown*gap*TMath::Tan(ang)+ |
2cef3cb2 | 402 | (zSenStrip/2)/TMath::Cos(ang); |
403 | ||
b94fa26c | 404 | gap = fGapB; |
2cef3cb2 | 405 | zcoor = zcoor-(zSenStrip/2)/TMath::Cos(ang)- |
b94fa26c | 406 | upDown*gap*TMath::Tan(ang)- |
2cef3cb2 | 407 | (zSenStrip/2)/TMath::Cos(ang); |
408 | ||
b94fa26c | 409 | ang = atan(zcoor/radius); |
2cef3cb2 | 410 | ang *= kRaddeg; |
da3d3acd | 411 | AliMatrix (idrotm[nrot], 90., 0.,90.-ang,90.,-ang, 90.); |
2cef3cb2 | 412 | AliMatrix (idrotm[nrot+1],90.,180.,90.+ang,90., ang, 90.); |
413 | ang /= kRaddeg; | |
414 | ||
b94fa26c | 415 | ycoor = -14.5+ kspace; //2 cm over front plate |
416 | ycoor += (1-(upDown+1)/2)*gap; | |
da3d3acd | 417 | //gMC->Gspos("FSTR",j ,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); |
418 | //gMC->Gspos("FSTR",j+1,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); | |
419 | gMC->Gspos("FSTR",centerLoc-j,"FLTA",0.,ycoor, zcoor,idrotm[nrot], "ONLY"); // AdC | |
420 | gMC->Gspos("FSTR",centerLoc+j,"FLTA",0.,ycoor,-zcoor,idrotm[nrot+1],"ONLY"); // AdC | |
61e4c9ba | 421 | if(fDebug>=1) { |
da3d3acd | 422 | printf("%s: %f, St. %2i, Pl.3 ",ClassName(),ang*kRaddeg,j); // AdC |
423 | printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); | |
68861244 | 424 | } |
b94fa26c | 425 | ycoor = -hTof/2.+ kspace;//2 cm over front plate |
2cef3cb2 | 426 | |
427 | // Plate B | |
428 | ||
429 | nrot = 0; | |
da3d3acd | 430 | Int_t i=1; // AdC |
b94fa26c | 431 | upDown = 1; |
432 | Float_t deadRegion = 1.0;//cm | |
937fe4a4 | 433 | |
2cef3cb2 | 434 | zpos = zcoor - (zSenStrip/2)/TMath::Cos(ang)- |
b94fa26c | 435 | upDown*gap*TMath::Tan(ang)- |
2cef3cb2 | 436 | (zSenStrip/2)/TMath::Cos(ang)- |
b94fa26c | 437 | deadRegion/TMath::Cos(ang); |
2cef3cb2 | 438 | |
b94fa26c | 439 | ang = atan(zpos/radius); |
2cef3cb2 | 440 | ang *= kRaddeg; |
441 | AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.); | |
442 | ang /= kRaddeg; | |
b94fa26c | 443 | ycoor = -hTof*0.5+ kspace ; //2 cm over front plate |
444 | ycoor += (1-(upDown+1)/2)*gap; | |
2cef3cb2 | 445 | zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB |
446 | gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); | |
61e4c9ba | 447 | if(fDebug>=1) { |
da3d3acd | 448 | printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); |
449 | printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); | |
68861244 | 450 | } |
2cef3cb2 | 451 | i++; |
b94fa26c | 452 | upDown*=-1; |
2cef3cb2 | 453 | |
454 | do { | |
455 | zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)- | |
b94fa26c | 456 | upDown*gap*TMath::Tan(ang)- |
2cef3cb2 | 457 | (zSenStrip/2)/TMath::Cos(ang); |
b94fa26c | 458 | ang = atan(zpos/radius); |
2cef3cb2 | 459 | ang *= kRaddeg; |
460 | AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.); | |
461 | ang /= kRaddeg; | |
b213b8bd | 462 | Float_t deltaSpaceinB=-0.5; // [cm] to avoid overlaps with the end of freon frame |
463 | Float_t deltaGapinB=0.5; // [cm] to avoid overlaps in between initial strips | |
464 | ycoor = -hTof*0.5+ kspace+deltaSpaceinB ; //2 cm over front plate | |
465 | ycoor += (1-(upDown+1)/2)*(gap+deltaGapinB); | |
2cef3cb2 | 466 | zcoor = zpos+(zFLTA*0.5+zFLTB*0.5+db); // Moves to the system of the modulus FLTB |
467 | gMC->Gspos("FSTR",i, "FLTB", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); | |
61e4c9ba | 468 | if(fDebug>=1) { |
68861244 | 469 | printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); |
9e1a0ddb | 470 | printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); |
471 | } | |
b94fa26c | 472 | upDown*=-1; |
2cef3cb2 | 473 | i++; |
474 | } while (TMath::Abs(ang*kRaddeg)<22.5); | |
475 | //till we reach a tilting angle of 22.5 degrees | |
476 | ||
b94fa26c | 477 | ycoor = -hTof*0.5+ kspace ; //2 cm over front plate |
2cef3cb2 | 478 | zpos = zpos - zSenStrip/TMath::Cos(ang); |
b213b8bd | 479 | // this avoid overlaps in between outer strips in plate B |
480 | Float_t deltaMovingUp=0.8; // [cm] | |
481 | Float_t deltaMovingDown=-0.5; // [cm] | |
2cef3cb2 | 482 | |
483 | do { | |
b94fa26c | 484 | ang = atan(zpos/radius); |
2cef3cb2 | 485 | ang *= kRaddeg; |
486 | AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.); | |
487 | ang /= kRaddeg; | |
488 | zcoor = zpos+(zFLTB/2+zFLTA/2+db); | |
b213b8bd | 489 | gMC->Gspos("FSTR",i, "FLTB", 0., ycoor+deltaMovingDown+deltaMovingUp, zcoor,idrotm[nrot], "ONLY"); |
490 | deltaMovingUp+=0.8; // update delta moving toward the end of the plate | |
2cef3cb2 | 491 | zpos = zpos - zSenStrip/TMath::Cos(ang); |
61e4c9ba | 492 | if(fDebug>=1) { |
68861244 | 493 | printf("%s: %f, St. %2i, Pl.4 ",ClassName(),ang*kRaddeg,i); |
9e1a0ddb | 494 | printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); |
495 | } | |
2cef3cb2 | 496 | i++; |
497 | ||
b94fa26c | 498 | } while (zpos-stripWidth*0.5/TMath::Cos(ang)>-t+zFLTC+db); |
2cef3cb2 | 499 | |
500 | // Plate C | |
501 | ||
502 | zpos = zpos + zSenStrip/TMath::Cos(ang); | |
503 | ||
504 | zpos = zpos - (zSenStrip/2)/TMath::Cos(ang)+ | |
b94fa26c | 505 | gap*TMath::Tan(ang)- |
2cef3cb2 | 506 | (zSenStrip/2)/TMath::Cos(ang); |
507 | ||
508 | nrot = 0; | |
509 | i=0; | |
b213b8bd | 510 | Float_t deltaGap=-2.5; // [cm] update distance from strip center and plate |
511 | ycoor= -hTof*0.5+kspace+gap+deltaGap; | |
2cef3cb2 | 512 | |
513 | do { | |
514 | i++; | |
b94fa26c | 515 | ang = atan(zpos/radius); |
2cef3cb2 | 516 | ang *= kRaddeg; |
517 | AliMatrix (idrotm[nrot], 90., 0., 90.-ang,90.,ang, 270.); | |
518 | ang /= kRaddeg; | |
519 | zcoor = zpos+(zFLTC*0.5+zFLTB+zFLTA*0.5+db*2); | |
520 | gMC->Gspos("FSTR",i, "FLTC", 0., ycoor, zcoor,idrotm[nrot], "ONLY"); | |
61e4c9ba | 521 | if(fDebug>=1) { |
68861244 | 522 | printf("%s: %f, St. %2i, Pl.5 ",ClassName(),ang*kRaddeg,i); |
9e1a0ddb | 523 | printf("y = %f, z = %f, zpos = %f \n",ycoor,zcoor,zpos); |
524 | } | |
2cef3cb2 | 525 | zpos = zpos - zSenStrip/TMath::Cos(ang); |
b94fa26c | 526 | } while (zpos-stripWidth*TMath::Cos(ang)*0.5>-t); |
2cef3cb2 | 527 | |
43808676 | 528 | |
529 | ////////// Layers after strips ///////////////// | |
530 | // Al Layer thickness (2.3mm) factor 0.7 | |
531 | ||
b94fa26c | 532 | Float_t overSpace = fOverSpc;//cm |
43808676 | 533 | |
b94fa26c | 534 | par[0] = xFLT*0.5; |
43808676 | 535 | par[1] = 0.115*0.7; // factor 0.7 |
b94fa26c | 536 | par[2] = (zFLTA *0.5); |
537 | ycoor = -yFLT/2 + overSpace + par[1]; | |
43808676 | 538 | gMC->Gsvolu("FPEA", "BOX ", idtmed[508], par, 3); // Al |
2cef3cb2 | 539 | gMC->Gspos ("FPEA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY"); |
b94fa26c | 540 | par[2] = (zFLTB *0.5); |
43808676 | 541 | gMC->Gsvolu("FPEB", "BOX ", idtmed[508], par, 3); // Al |
2cef3cb2 | 542 | gMC->Gspos ("FPEB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY"); |
b94fa26c | 543 | par[2] = (zFLTC *0.5); |
43808676 | 544 | gMC->Gsvolu("FPEC", "BOX ", idtmed[508], par, 3); // Al |
2cef3cb2 | 545 | gMC->Gspos ("FPEC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY"); |
937fe4a4 | 546 | |
43808676 | 547 | |
548 | // plexiglass thickness: 1.5 mm ; factor 0.3 | |
2cef3cb2 | 549 | ycoor += par[1]; |
b94fa26c | 550 | par[0] = xFLT*0.5; |
43808676 | 551 | par[1] = 0.075*0.3; // factor 0.3 |
b94fa26c | 552 | par[2] = (zFLTA *0.5); |
2cef3cb2 | 553 | ycoor += par[1]; |
43808676 | 554 | gMC->Gsvolu("FECA", "BOX ", idtmed[505], par, 3); // Plexigl. |
2cef3cb2 | 555 | gMC->Gspos ("FECA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY"); |
b94fa26c | 556 | par[2] = (zFLTB *0.5); |
43808676 | 557 | gMC->Gsvolu("FECB", "BOX ", idtmed[505], par, 3); // Plexigl. |
2cef3cb2 | 558 | gMC->Gspos ("FECB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY"); |
b94fa26c | 559 | par[2] = (zFLTC *0.5); |
43808676 | 560 | gMC->Gsvolu("FECC", "BOX ", idtmed[505], par, 3); // Plexigl. |
2cef3cb2 | 561 | gMC->Gspos ("FECC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY"); |
43808676 | 562 | |
563 | // frame of Air | |
b94fa26c | 564 | ycoor += par[1]; |
565 | par[0] = xFLT*0.5; | |
43808676 | 566 | par[1] = (yFLT/2-ycoor-khAlWall)*0.5; // Aluminum layer considered (0.18 cm) |
b94fa26c | 567 | par[2] = (zFLTA *0.5); |
568 | ycoor += par[1]; | |
569 | gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air | |
570 | gMC->Gspos ("FAIA", 0, "FLTA", 0., ycoor, 0., 0, "ONLY"); | |
571 | par[2] = (zFLTB *0.5); | |
572 | gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air | |
573 | gMC->Gspos ("FAIB", 0, "FLTB", 0., ycoor, 0., 0, "ONLY"); | |
574 | par[2] = (zFLTC *0.5); | |
575 | gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air | |
576 | gMC->Gspos ("FAIC", 0, "FLTC", 0., ycoor, 0., 0, "ONLY"); | |
43808676 | 577 | |
578 | ||
579 | // start with cards and cooling tubes | |
580 | // finally, cards, cooling tubes and layer for thermal dispersion | |
581 | // 3 volumes | |
582 | // card volume definition | |
583 | ||
584 | // see GEOM200 in GEANT manual | |
585 | AliMatrix(idrotm[98], 90., 0., 90., 90., 0., 0.); // 0 deg | |
586 | ||
587 | Float_t cardpar[3]; | |
588 | cardpar[0]= 61.; | |
589 | cardpar[1]= 5.; | |
590 | cardpar[2]= 0.1; | |
591 | gMC->Gsvolu("FCAR", "BOX ", idtmed[504], cardpar, 3); // PCB Card | |
592 | //alu plate volume definition | |
593 | cardpar[1]= 3.5; | |
594 | cardpar[2]= 0.05; | |
595 | gMC->Gsvolu("FALP", "BOX ", idtmed[508], cardpar, 3); // Alu Plate | |
596 | ||
597 | ||
598 | // central module positioning (FAIA) | |
599 | Float_t cardpos[3], aplpos2, stepforcardA=6.625; | |
600 | cardpos[0]= 0.; | |
601 | cardpos[1]= -0.5; | |
602 | cardpos[2]= -53.; | |
603 | Float_t aplpos1 = -2.; | |
604 | Int_t icard; | |
605 | for (icard=0; icard<15; ++icard) { | |
606 | cardpos[2]= cardpos[2]+stepforcardA; | |
607 | aplpos2 = cardpos[2]+0.15; | |
da3d3acd | 608 | gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY"); |
43808676 | 609 | gMC->Gspos("FALP",icard,"FAIA",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY"); |
610 | ||
611 | } | |
612 | ||
613 | ||
614 | // intermediate module positioning (FAIB) | |
615 | Float_t stepforcardB= 7.05; | |
616 | cardpos[2]= -70.5; | |
617 | for (icard=0; icard<19; ++icard) { | |
618 | cardpos[2]= cardpos[2]+stepforcardB; | |
da3d3acd | 619 | aplpos2 = cardpos[2]+0.15; |
620 | gMC->Gspos("FCAR",icard,"FAIB",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY"); | |
621 | gMC->Gspos("FALP",icard,"FAIB",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY"); | |
43808676 | 622 | } |
623 | ||
624 | ||
625 | // outer module positioning (FAIC) | |
626 | Float_t stepforcardC= 8.45238; | |
627 | cardpos[2]= -88.75; | |
628 | for (icard=0; icard<20; ++icard) { | |
629 | cardpos[2]= cardpos[2]+stepforcardC; | |
630 | aplpos2 = cardpos[2]+0.15; | |
da3d3acd | 631 | gMC->Gspos("FCAR",icard,"FAIC",cardpos[0],cardpos[1],cardpos[2],idrotm[98],"ONLY"); |
43808676 | 632 | gMC->Gspos("FALP",icard,"FAIC",cardpos[0],aplpos1,aplpos2,idrotm[98],"ONLY"); |
633 | } | |
634 | ||
635 | // tube volume definition | |
636 | Float_t tubepar[3]; | |
637 | tubepar[0]= 0.; | |
638 | tubepar[1]= 0.4; | |
639 | tubepar[2]= 61.; | |
640 | gMC->Gsvolu("FTUB", "TUBE", idtmed[516], tubepar, 3); // cooling tubes (steel) | |
641 | tubepar[0]= 0.; | |
642 | tubepar[1]= 0.35; | |
643 | tubepar[2]= 61.; | |
644 | gMC->Gsvolu("FITU", "TUBE", idtmed[515], tubepar, 3); // cooling water | |
645 | // positioning water tube into the steel one | |
646 | gMC->Gspos("FITU",1,"FTUB",0.,0.,0.,0,"ONLY"); | |
647 | ||
648 | ||
649 | // rotation matrix | |
650 | AliMatrix(idrotm[99], 180., 90., 90., 90., 90., 0.); | |
651 | // central module positioning (FAIA) | |
652 | Float_t tubepos[3], tdis=0.6; | |
653 | tubepos[0]= 0.; | |
654 | tubepos[1]= cardpos[1]; | |
655 | tubepos[2]= -53.+tdis; | |
656 | // tub1pos = 5.; | |
657 | Int_t itub; | |
658 | for (itub=0; itub<15; ++itub) { | |
659 | tubepos[2]= tubepos[2]+stepforcardA; | |
660 | gMC->Gspos("FTUB",itub,"FAIA",tubepos[0],tubepos[1],tubepos[2],idrotm[99], | |
661 | "ONLY"); | |
662 | } | |
663 | ||
664 | ||
665 | // intermediate module positioning (FAIB) | |
666 | tubepos[2]= -70.5+tdis; | |
667 | for (itub=0; itub<19; ++itub) { | |
668 | tubepos[2]= tubepos[2]+stepforcardB; | |
669 | gMC->Gspos("FTUB",itub,"FAIB",tubepos[0],tubepos[1],tubepos[2],idrotm[99], | |
670 | "ONLY"); | |
671 | } | |
672 | ||
673 | // outer module positioning (FAIC) | |
674 | tubepos[2]= -88.75+tdis; | |
675 | for (itub=0; itub<20; ++itub) { | |
676 | tubepos[2]= tubepos[2]+stepforcardC; | |
677 | gMC->Gspos("FTUB",itub,"FAIC",tubepos[0],tubepos[1],tubepos[2],idrotm[99], | |
678 | "ONLY"); | |
679 | } | |
680 | ||
937fe4a4 | 681 | } |
682 | ||
683 | //_____________________________________________________________________________ | |
68861244 | 684 | void AliTOFv4::DrawModule() const |
937fe4a4 | 685 | { |
686 | // | |
517b7f8f | 687 | // Draw a shaded view of the Time Of Flight version 4 |
937fe4a4 | 688 | // |
689 | // Set everything unseen | |
690 | gMC->Gsatt("*", "seen", -1); | |
691 | // | |
692 | // Set ALIC mother transparent | |
693 | gMC->Gsatt("ALIC","SEEN",0); | |
694 | // | |
695 | // Set the volumes visible | |
696 | gMC->Gsatt("ALIC","SEEN",0); | |
2cef3cb2 | 697 | |
698 | gMC->Gsatt("FTOA","SEEN",1); | |
699 | gMC->Gsatt("FTOB","SEEN",1); | |
700 | gMC->Gsatt("FTOC","SEEN",1); | |
701 | gMC->Gsatt("FLTA","SEEN",1); | |
702 | gMC->Gsatt("FLTB","SEEN",1); | |
703 | gMC->Gsatt("FLTC","SEEN",1); | |
704 | gMC->Gsatt("FPLA","SEEN",1); | |
705 | gMC->Gsatt("FPLB","SEEN",1); | |
706 | gMC->Gsatt("FPLC","SEEN",1); | |
707 | gMC->Gsatt("FSTR","SEEN",1); | |
708 | gMC->Gsatt("FPEA","SEEN",1); | |
709 | gMC->Gsatt("FPEB","SEEN",1); | |
710 | gMC->Gsatt("FPEC","SEEN",1); | |
711 | ||
712 | gMC->Gsatt("FLZ1","SEEN",0); | |
713 | gMC->Gsatt("FLZ2","SEEN",0); | |
714 | gMC->Gsatt("FLZ3","SEEN",0); | |
715 | gMC->Gsatt("FLX1","SEEN",0); | |
716 | gMC->Gsatt("FLX2","SEEN",0); | |
717 | gMC->Gsatt("FLX3","SEEN",0); | |
718 | gMC->Gsatt("FPAD","SEEN",0); | |
719 | ||
937fe4a4 | 720 | gMC->Gdopt("hide", "on"); |
721 | gMC->Gdopt("shad", "on"); | |
722 | gMC->Gsatt("*", "fill", 7); | |
723 | gMC->SetClipBox("."); | |
724 | gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000); | |
725 | gMC->DefaultRange(); | |
726 | gMC->Gdraw("alic", 40, 30, 0, 12, 9.5, .02, .02); | |
727 | gMC->Gdhead(1111, "Time Of Flight"); | |
728 | gMC->Gdman(18, 4, "MAN"); | |
729 | gMC->Gdopt("hide","off"); | |
730 | } | |
517b7f8f | 731 | //_____________________________________________________________________________ |
732 | void AliTOFv4::DrawDetectorModules() | |
733 | { | |
734 | // | |
735 | // Draw a shaded view of the TOF detector version 4 | |
736 | // | |
737 | ||
517b7f8f | 738 | |
739 | //Set ALIC mother transparent | |
4c475d27 | 740 | gMC->Gsatt("ALIC","SEEN",0); |
517b7f8f | 741 | |
742 | // | |
743 | //Set volumes visible | |
744 | // | |
745 | //=====> Level 1 | |
746 | // Level 1 for TOF volumes | |
747 | gMC->Gsatt("B077","seen",0); | |
748 | ||
749 | ||
750 | //==========> Level 2 | |
751 | // Level 2 | |
752 | gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped - | |
753 | gMC->Gsatt("B071","seen",0); | |
754 | gMC->Gsatt("B074","seen",0); | |
755 | gMC->Gsatt("B075","seen",0); | |
756 | gMC->Gsatt("B080","seen",0); // B080 does not has sub-level | |
757 | ||
758 | ||
759 | // Level 2 of B071 | |
760 | gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped - | |
761 | gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped - | |
762 | gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped - | |
763 | gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped - | |
764 | gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels - | |
765 | gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped - | |
766 | gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped - | |
767 | gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels - | |
768 | gMC->Gsatt("BTO1","seen",0); | |
769 | ||
770 | ||
771 | // Level 2 of B074 | |
772 | gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels - | |
773 | gMC->Gsatt("BTO2","seen",0); | |
774 | ||
775 | // Level 2 of B075 | |
776 | gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels - | |
777 | gMC->Gsatt("BTO3","seen",0); | |
778 | ||
779 | // ==================> Level 3 | |
780 | // Level 3 of B071 / Level 2 of BTO1 | |
781 | gMC->Gsatt("FTOC","seen",-2); | |
782 | gMC->Gsatt("FTOB","seen",-2); | |
783 | gMC->Gsatt("FTOA","seen",-2); | |
784 | ||
785 | // Level 3 of B074 / Level 2 of BTO2 | |
786 | // -> cfr previous settings | |
787 | ||
788 | // Level 3 of B075 / Level 2 of BTO3 | |
789 | // -> cfr previous settings | |
790 | ||
791 | gMC->Gdopt("hide","on"); | |
792 | gMC->Gdopt("shad","on"); | |
793 | gMC->Gsatt("*", "fill", 5); | |
794 | gMC->SetClipBox("."); | |
795 | gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000); | |
796 | gMC->DefaultRange(); | |
797 | gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015); | |
798 | gMC->Gdhead(1111,"TOF detector V1"); | |
799 | gMC->Gdman(18, 4, "MAN"); | |
800 | gMC->Gdopt("hide","off"); | |
801 | } | |
802 | ||
803 | //_____________________________________________________________________________ | |
804 | void AliTOFv4::DrawDetectorStrips() | |
805 | { | |
806 | // | |
807 | // Draw a shaded view of the TOF strips for version 4 | |
808 | // | |
809 | ||
517b7f8f | 810 | //Set ALIC mother transparent |
4c475d27 | 811 | gMC->Gsatt("ALIC","SEEN",0); |
517b7f8f | 812 | |
813 | // | |
814 | //Set volumes visible | |
815 | //=====> Level 1 | |
816 | // Level 1 for TOF volumes | |
817 | gMC->Gsatt("B077","seen",0); | |
818 | ||
819 | //==========> Level 2 | |
820 | // Level 2 | |
821 | gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped - | |
822 | gMC->Gsatt("B071","seen",0); | |
823 | gMC->Gsatt("B074","seen",0); | |
824 | gMC->Gsatt("B075","seen",0); | |
825 | gMC->Gsatt("B080","seen",0); // B080 does not has sub-level | |
826 | ||
827 | // Level 2 of B071 | |
828 | gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped - | |
829 | gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped - | |
830 | gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped - | |
831 | gMC->Gsatt("B069","seen",-1); // all B069 sub-levels skipped - | |
832 | gMC->Gsatt("B056","seen",0); // B056 does not has sub-levels - | |
833 | gMC->Gsatt("B059","seen",-1); // all B059 sub-levels skipped - | |
834 | gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped - | |
835 | gMC->Gsatt("BTR1","seen",0); // BTR1 do not have sub-levels - | |
836 | gMC->Gsatt("BTO1","seen",0); | |
837 | ||
838 | // ==================> Level 3 | |
839 | // Level 3 of B071 / Level 2 of BTO1 | |
840 | gMC->Gsatt("FTOC","seen",0); | |
841 | gMC->Gsatt("FTOB","seen",0); | |
842 | gMC->Gsatt("FTOA","seen",0); | |
843 | ||
844 | // Level 3 of B074 / Level 2 of BTO2 | |
845 | // -> cfr previous settings | |
846 | ||
847 | // Level 3 of B075 / Level 2 of BTO3 | |
848 | // -> cfr previous settings | |
849 | ||
850 | ||
851 | // ==========================> Level 4 | |
852 | // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOC | |
853 | gMC->Gsatt("FLTC","seen",0); | |
854 | // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOB | |
855 | gMC->Gsatt("FLTB","seen",0); | |
856 | // Level 4 of B071 / Level 3 of BTO1 / Level 2 of FTOA | |
857 | gMC->Gsatt("FLTA","seen",0); | |
858 | ||
859 | // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOC | |
860 | // -> cfr previous settings | |
861 | // Level 4 of B074 / Level 3 of BTO2 / Level 2 of FTOB | |
862 | // -> cfr previous settings | |
863 | ||
864 | // Level 4 of B075 / Level 3 of BTO3 / Level 2 of FTOC | |
865 | // -> cfr previous settings | |
866 | ||
867 | //======================================> Level 5 | |
868 | // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOC / Level 2 of FLTC | |
869 | gMC->Gsatt("FALC","seen",0); // no children for FALC | |
870 | gMC->Gsatt("FSTR","seen",-2); | |
871 | gMC->Gsatt("FPEC","seen",0); // no children for FPEC | |
872 | gMC->Gsatt("FECC","seen",0); // no children for FECC | |
873 | gMC->Gsatt("FWAC","seen",0); // no children for FWAC | |
874 | gMC->Gsatt("FAIC","seen",0); // no children for FAIC | |
875 | ||
876 | // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOB / Level 2 of FLTB | |
877 | gMC->Gsatt("FALB","seen",0); // no children for FALB | |
878 | //--> gMC->Gsatt("FSTR","seen",-2); | |
879 | ||
880 | ||
881 | // -> cfr previous settings | |
882 | gMC->Gsatt("FPEB","seen",0); // no children for FPEB | |
883 | gMC->Gsatt("FECB","seen",0); // no children for FECB | |
884 | gMC->Gsatt("FWAB","seen",0); // no children for FWAB | |
885 | gMC->Gsatt("FAIB","seen",0); // no children for FAIB | |
886 | ||
887 | // Level 5 of B071 / Level 4 of BTO1 / Level 3 of FTOA / Level 2 of FLTA | |
888 | gMC->Gsatt("FALA","seen",0); // no children for FALB | |
889 | //--> gMC->Gsatt("FSTR","seen",-2); | |
890 | // -> cfr previous settings | |
891 | gMC->Gsatt("FPEA","seen",0); // no children for FPEA | |
892 | gMC->Gsatt("FECA","seen",0); // no children for FECA | |
893 | gMC->Gsatt("FWAA","seen",0); // no children for FWAA | |
894 | gMC->Gsatt("FAIA","seen",0); // no children for FAIA | |
895 | ||
896 | // Level 2 of B074 | |
897 | gMC->Gsatt("BTR2","seen",0); // BTR2 does not has sub-levels - | |
898 | gMC->Gsatt("BTO2","seen",0); | |
899 | ||
900 | // Level 2 of B075 | |
901 | gMC->Gsatt("BTR3","seen",0); // BTR3 do not have sub-levels - | |
902 | gMC->Gsatt("BTO3","seen",0); | |
903 | ||
904 | // for others Level 5, cfr. previous settings | |
905 | ||
906 | gMC->Gdopt("hide","on"); | |
907 | gMC->Gdopt("shad","on"); | |
908 | gMC->Gsatt("*", "fill", 5); | |
909 | gMC->SetClipBox("."); | |
910 | gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000); | |
911 | gMC->DefaultRange(); | |
912 | gMC->Gdraw("alic", 45, 40, 0, 10, 10, .015, .015); | |
913 | gMC->Gdhead(1111,"TOF Strips V1"); | |
914 | gMC->Gdman(18, 4, "MAN"); | |
915 | gMC->Gdopt("hide","off"); | |
916 | } | |
937fe4a4 | 917 | |
918 | //_____________________________________________________________________________ | |
919 | void AliTOFv4::CreateMaterials() | |
920 | { | |
921 | // | |
922 | // Define materials for the Time Of Flight | |
923 | // | |
924 | AliTOF::CreateMaterials(); | |
925 | } | |
926 | ||
927 | //_____________________________________________________________________________ | |
928 | void AliTOFv4::Init() | |
929 | { | |
930 | // | |
931 | // Initialise the detector after the geometry has been defined | |
932 | // | |
68861244 | 933 | if(fDebug) { |
9e1a0ddb | 934 | printf("%s: **************************************" |
68861244 | 935 | " TOF " |
936 | "**************************************\n",ClassName()); | |
9e1a0ddb | 937 | printf("\n%s: Version 4 of TOF initialing, " |
68861244 | 938 | "symmetric TOF - Full Coverage version\n",ClassName()); |
9e1a0ddb | 939 | } |
68861244 | 940 | |
937fe4a4 | 941 | AliTOF::Init(); |
ab76897d | 942 | |
2cef3cb2 | 943 | fIdFTOA = gMC->VolId("FTOA"); |
944 | fIdFTOB = gMC->VolId("FTOB"); | |
945 | fIdFTOC = gMC->VolId("FTOC"); | |
946 | fIdFLTA = gMC->VolId("FLTA"); | |
947 | fIdFLTB = gMC->VolId("FLTB"); | |
948 | fIdFLTC = gMC->VolId("FLTC"); | |
68861244 | 949 | |
950 | if(fDebug) { | |
9e1a0ddb | 951 | printf("%s: **************************************" |
68861244 | 952 | " TOF " |
953 | "**************************************\n",ClassName()); | |
954 | } | |
937fe4a4 | 955 | } |
956 | ||
957 | //_____________________________________________________________________________ | |
958 | void AliTOFv4::StepManager() | |
959 | { | |
960 | // | |
961 | // Procedure called at each step in the Time Of Flight | |
962 | // | |
963 | TLorentzVector mom, pos; | |
2cef3cb2 | 964 | Float_t xm[3],pm[3],xpad[3],ppad[3]; |
965 | Float_t hits[13],phi,phid,z; | |
966 | Int_t vol[5]; | |
b94fa26c | 967 | Int_t sector, plate, padx, padz, strip; |
968 | Int_t copy, padzid, padxid, stripid, i; | |
2cef3cb2 | 969 | Int_t *idtmed = fIdtmed->GetArray()-499; |
b94fa26c | 970 | Float_t incidenceAngle; |
2cef3cb2 | 971 | |
fa914fe6 | 972 | if(gMC->CurrentMedium()==idtmed[513] && |
937fe4a4 | 973 | gMC->IsTrackEntering() && gMC->TrackCharge() |
2cef3cb2 | 974 | && gMC->CurrentVolID(copy)==fIdSens) |
975 | { | |
976 | // getting information about hit volumes | |
826b71ec | 977 | |
b94fa26c | 978 | padzid=gMC->CurrentVolOffID(2,copy); |
da3d3acd | 979 | padz=copy; |
826b71ec | 980 | |
b94fa26c | 981 | padxid=gMC->CurrentVolOffID(1,copy); |
da3d3acd | 982 | padx=copy; |
826b71ec | 983 | |
b94fa26c | 984 | stripid=gMC->CurrentVolOffID(4,copy); |
da3d3acd | 985 | strip=copy; |
2cef3cb2 | 986 | |
987 | gMC->TrackPosition(pos); | |
988 | gMC->TrackMomentum(mom); | |
989 | ||
990 | // Double_t NormPos=1./pos.Rho(); | |
b94fa26c | 991 | Double_t normMom=1./mom.Rho(); |
2cef3cb2 | 992 | |
993 | // getting the cohordinates in pad ref system | |
994 | xm[0] = (Float_t)pos.X(); | |
995 | xm[1] = (Float_t)pos.Y(); | |
996 | xm[2] = (Float_t)pos.Z(); | |
997 | ||
b94fa26c | 998 | pm[0] = (Float_t)mom.X()*normMom; |
999 | pm[1] = (Float_t)mom.Y()*normMom; | |
1000 | pm[2] = (Float_t)mom.Z()*normMom; | |
2cef3cb2 | 1001 | |
1002 | gMC->Gmtod(xm,xpad,1); | |
1003 | gMC->Gmtod(pm,ppad,2); | |
5919c40c | 1004 | |
b94fa26c | 1005 | incidenceAngle = TMath::ACos(ppad[1])*kRaddeg; |
2cef3cb2 | 1006 | |
1007 | z = pos[2]; | |
1008 | ||
da3d3acd | 1009 | plate = 0; |
1010 | if (TMath::Abs(z) <= fZlenA*0.5) plate = 2; //3; // AdC | |
2cef3cb2 | 1011 | if (z < (fZlenA*0.5+fZlenB) && |
da3d3acd | 1012 | z > fZlenA*0.5) plate = 1; //4; // AdC |
2cef3cb2 | 1013 | if (z >-(fZlenA*0.5+fZlenB) && |
da3d3acd | 1014 | z < -fZlenA*0.5) plate = 3; //2; // AdC |
1015 | if (z > (fZlenA*0.5+fZlenB)) plate = 0; //5; // AdC | |
1016 | if (z <-(fZlenA*0.5+fZlenB)) plate = 4; //1; // AdC | |
1017 | ||
1018 | if (plate==0) strip=AliTOFConstants::fgkNStripC-strip; // AdC | |
1019 | else if (plate==1) strip=AliTOFConstants::fgkNStripB-strip; // AdC | |
1020 | else strip--; // AdC | |
1021 | ||
1022 | if (z<=0.) padx=AliTOFConstants::fgkNpadX-padx; // AdC | |
1023 | else padx--; // AdC | |
1024 | ||
1025 | if (plate==3 || plate==4) padz=AliTOFConstants::fgkNpadZ-padz; // AdC | |
1026 | else padz--; // AdC | |
2cef3cb2 | 1027 | |
1028 | phi = pos.Phi(); | |
da3d3acd | 1029 | if (phi>=0.) phid = phi*kRaddeg; //+180.; // AdC |
1030 | else phid = phi*kRaddeg + 360.; // AdC | |
1031 | sector = Int_t (phid/20.); // AdC | |
1032 | //sector++; // AdC | |
2cef3cb2 | 1033 | |
937fe4a4 | 1034 | for(i=0;i<3;++i) { |
2cef3cb2 | 1035 | hits[i] = pos[i]; |
1036 | hits[i+3] = pm[i]; | |
937fe4a4 | 1037 | } |
2cef3cb2 | 1038 | |
1039 | hits[6] = mom.Rho(); | |
1040 | hits[7] = pos[3]; | |
1041 | hits[8] = xpad[0]; | |
1042 | hits[9] = xpad[1]; | |
1043 | hits[10]= xpad[2]; | |
b94fa26c | 1044 | hits[11]= incidenceAngle; |
2cef3cb2 | 1045 | hits[12]= gMC->Edep(); |
1046 | ||
1047 | vol[0]= sector; | |
1048 | vol[1]= plate; | |
1049 | vol[2]= strip; | |
b94fa26c | 1050 | vol[3]= padx; |
1051 | vol[4]= padz; | |
2cef3cb2 | 1052 | |
5d12ce38 | 1053 | AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits); |
937fe4a4 | 1054 | } |
1055 | } |