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