]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFv6T0.cxx
Update on calibration classes by Raphaelle
[u/mrichter/AliRoot.git] / TOF / AliTOFv6T0.cxx
CommitLineData
dfef1a15 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
17$Log$
9f8488c2 18Revision 1.3.2 2007/05/29 decaro
19FEA+cooling zone description: update
20 FEA+cooling orientation (side A/ side C) -> correction
21Revision 1.3.1 2007/05/24 decaro
22Change the FEA+cooling zone description:
23 - FCA1/FCA2, air boxes, contain:
24 FFEA volume, G10 box,
25 FAL1/FAL2/FAL3 volumes, aluminium boxes;
26 - FRO1/FRO2/FRO3/FRO4/FBAR, aluminum boxes;
27 - changed FTUB positions;
28
29Revision 1.3 2007/05/04 14:05:42 decaro
30Ineffective comment cleanup
31
e41ca6a9 32Revision 1.2 2007/05/04 12:59:22 arcelli
33Change the TOF SM paths for misalignment (one layer up)
34
6e2570fc 35Revision 1.1 2007/05/02 17:32:58 decaro
36TOF geometry description as installed (G. Cara Romeo, A. De Caro)
37
dfef1a15 38Revision 0.1 2007 March G. Cara Romeo and A. De Caro
39 Implemented a more realistic TOF geometry description,
40 in terms of:
41 - material badget,
42 - services and front end electronics description,
43 - TOF crate readout modules
44 (added volume FTOS in ALIC_1/BBMO_1/BBCE_%i -for i=1,...,18-,
45 and in ALIC_1/BFMO_%i -for i=19,...,36- volumes)
46 As the 5th version in terms of geometrical positioning of volumes.
47
48*/
49
50///////////////////////////////////////////////////////////////////////////////
51// //
52// This class contains the functions for version 6 of the Time Of Flight //
53// detector. //
54// //
55// VERSION WITH 6 MODULES AND TILTED STRIPS //
56// //
57// FULL COVERAGE VERSION + OPTION for PHOS holes //
58// //
59// //
60//Begin_Html //
61/* //
62<img src="picts/AliTOFv6T0Class.gif"> //
63*/ //
64//End_Html //
65// //
66///////////////////////////////////////////////////////////////////////////////
67
68#include "TBRIK.h"
69#include "TGeometry.h"
70#include "TLorentzVector.h"
71#include "TNode.h"
72#include "TVirtualMC.h"
73#include "TGeoManager.h"
74
75#include "AliConst.h"
76#include "AliLog.h"
77#include "AliMagF.h"
78#include "AliMC.h"
79#include "AliRun.h"
80
81#include "AliTOFGeometry.h"
82#include "AliTOFGeometryV5.h"
83#include "AliTOFv6T0.h"
84
85extern TDirectory *gDirectory;
86extern TVirtualMC *gMC;
87extern TGeoManager *gGeoManager;
88
89extern AliRun *gAlice;
90
91ClassImp(AliTOFv6T0)
92
93//_____________________________________________________________________________
94 AliTOFv6T0::AliTOFv6T0():
95 fIdFTOA(-1),
96 fIdFTOB(-1),
97 fIdFTOC(-1),
98 fIdFLTA(-1),
99 fIdFLTB(-1),
100 fIdFLTC(-1),
101 fTOFHoles(kFALSE)
102{
103 //
104 // Default constructor
105 //
106}
107
108//_____________________________________________________________________________
109AliTOFv6T0::AliTOFv6T0(const char *name, const char *title):
110 AliTOF(name,title,"tzero"),
111 fIdFTOA(-1),
112 fIdFTOB(-1),
113 fIdFTOC(-1),
114 fIdFLTA(-1),
115 fIdFLTB(-1),
116 fIdFLTC(-1),
117 fTOFHoles(kFALSE)
118{
119 //
120 // Standard constructor
121 //
122 //
123 // Check that FRAME is there otherwise we have no place where to
124 // put TOF
125
126
127 AliModule* frame = (AliModule*)gAlice->GetModule("FRAME");
128 if(!frame) {
129 AliFatal("TOF needs FRAME to be present");
130 } else{
131
132 if (fTOFGeometry) delete fTOFGeometry;
133 fTOFGeometry = new AliTOFGeometryV5();
134
135 if(frame->IsVersion()==1) {
136 AliDebug(1,Form("Frame version %d", frame->IsVersion()));
137 AliDebug(1,"Full Coverage for TOF");
138 fTOFHoles=false;}
139 else {
140 AliDebug(1,Form("Frame version %d", frame->IsVersion()));
141 AliDebug(1,"TOF with Holes for PHOS");
142 fTOFHoles=true;}
143 }
144 fTOFGeometry->SetHoles(fTOFHoles);
145
146 //AliTOF::fTOFGeometry = fTOFGeometry;
147
148 // Save the geometry
149 TDirectory* saveDir = gDirectory;
150 gAlice->GetRunLoader()->CdGAFile();
151 fTOFGeometry->Write("TOFgeometry");
152 saveDir->cd();
153
154}
155
156//_____________________________________________________________________________
157void AliTOFv6T0::AddAlignableVolumes() const
158{
159 //
160 // Create entries for alignable volumes associating the symbolic volume
161 // name with the corresponding volume path. Needs to be syncronized with
162 // eventual changes in the geometry.
163 //
164
165 TString volPath;
166 TString symName;
167
168 TString vpL0 = "ALIC_1/B077_1/BSEGMO";
169 TString vpL1 = "_1/BTOF";
170 TString vpL2 = "_1";
171 TString vpL3 = "/FTOA_0";
172 TString vpL4 = "/FLTA_0/FSTR_";
173
174 TString snSM = "TOF/sm";
175 TString snSTRIP = "/strip";
176
177 Int_t nSectors=fTOFGeometry->NSectors();
178 Int_t nStrips =fTOFGeometry->NStripA()+
179 2*fTOFGeometry->NStripB()+
180 2*fTOFGeometry->NStripC();
181
182 //
183 // The TOF MRPC Strips
184 // The symbolic names are: TOF/sm00/strip01
185 // ...
186 // TOF/sm17/strip91
187
188 Int_t imod=0;
189
190 for (Int_t isect = 0; isect < nSectors; isect++) {
191 for (Int_t istr = 1; istr <= nStrips; istr++) {
192
193 volPath = vpL0;
194 volPath += isect;
195 volPath += vpL1;
196 volPath += isect;
197 volPath += vpL2;
198 volPath += vpL3;
199 volPath += vpL4;
200 volPath += istr;
201
202
203 symName = snSM;
204 symName += Form("%02d",isect);
205 symName += snSTRIP;
206 symName += Form("%02d",istr);
207
208 AliDebug(2,"--------------------------------------------");
209 AliDebug(2,Form("Alignable object %d", imod));
210 AliDebug(2,Form("volPath=%s\n",volPath.Data()));
211 AliDebug(2,Form("symName=%s\n",symName.Data()));
212 AliDebug(2,"--------------------------------------------");
213
214 gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
215 imod++;
216 }
217 }
218
219
220 //
221 // The TOF supermodules
222 // The symbolic names are: TOF/sm00
223 // ...
224 // TOF/sm17
225 //
226 for (Int_t isect = 0; isect < nSectors; isect++) {
227
228 volPath = vpL0;
229 volPath += isect;
230 volPath += vpL1;
231 volPath += isect;
232 volPath += vpL2;
dfef1a15 233
234 symName = snSM;
235 symName += Form("%02d",isect);
236
237 AliDebug(2,"--------------------------------------------");
238 AliDebug(2,Form("Alignable object %d", isect+imod));
239 AliDebug(2,Form("volPath=%s\n",volPath.Data()));
240 AliDebug(2,Form("symName=%s\n",symName.Data()));
241 AliDebug(2,"--------------------------------------------");
242
243 gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
244
245 }
246
247}
248//____________________________________________________________________________
249void AliTOFv6T0::BuildGeometry()
250{
251 //
252 // Build TOF ROOT geometry for the ALICE event display
253 //
254 TNode *node, *top;
255 const int kColorTOF = 27;
256
257 TGeometry *globalGeometry = (TGeometry*)gAlice->GetGeometry();
258
259 // Find top TNODE
260 top = globalGeometry->GetNode("alice");
261
262 // Position the different copies
263 const Float_t krTof =(fTOFGeometry->Rmax()+fTOFGeometry->Rmin())/2.;
264 const Float_t khTof = fTOFGeometry->Rmax()-fTOFGeometry->Rmin();
265 const Int_t kNTof = fTOFGeometry->NSectors();
266 const Float_t kangle = k2PI/kNTof;
267
268 const Float_t kInterCentrModBorder1 = 49.5;
269 const Float_t kInterCentrModBorder2 = 57.5;
270
271 Float_t ang;
272
273 // define offset for nodes
274 Float_t zOffsetB = (fTOFGeometry->ZlenA()*0.5 + (kInterCentrModBorder1+kInterCentrModBorder2)*0.5)*0.5;
275 Float_t zOffsetA = 0.;
276 // Define TOF basic volume
277
278 char nodeName0[16], nodeName1[16], nodeName2[16];
279 char nodeName3[16], nodeName4[16], rotMatNum[16];
280
281 if (fTOFHoles) {
282 new TBRIK("S_TOF_B","TOF box","void",
283 fTOFGeometry->StripLength()*0.5, khTof*0.5, fTOFGeometry->ZlenB()*0.5);
284 new TBRIK("S_TOF_C","TOF box","void",
285 fTOFGeometry->StripLength()*0.5, khTof*0.5, fTOFGeometry->ZlenB()*0.5);
286 }
287 new TBRIK("S_TOF_A","TOF box","void",
288 fTOFGeometry->StripLength()*0.5, khTof*0.5, fTOFGeometry->ZlenA()*0.5);
289
290 for (Int_t nodeNum=1;nodeNum<kNTof+1;nodeNum++){
291
292 if (nodeNum<10) {
293 sprintf(rotMatNum,"rot50%i",nodeNum);
294 sprintf(nodeName0,"FTO00%i",nodeNum);
295 sprintf(nodeName1,"FTO10%i",nodeNum);
296 sprintf(nodeName2,"FTO20%i",nodeNum);
297 sprintf(nodeName3,"FTO30%i",nodeNum);
298 sprintf(nodeName4,"FTO40%i",nodeNum);
299 }
300 if (nodeNum>9) {
301 sprintf(rotMatNum,"rot5%i",nodeNum);
302 sprintf(nodeName0,"FTO0%i",nodeNum);
303 sprintf(nodeName1,"FTO1%i",nodeNum);
304 sprintf(nodeName2,"FTO2%i",nodeNum);
305 sprintf(nodeName3,"FTO3%i",nodeNum);
306 sprintf(nodeName4,"FTO4%i",nodeNum);
307 }
308
309 new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
310 ang = (4.5-nodeNum) * kangle;
311
312 if (fTOFHoles) {
313 top->cd();
314 node = new TNode(nodeName2,nodeName2,"S_TOF_B", krTof*TMath::Cos(ang), krTof*TMath::Sin(ang), zOffsetB,rotMatNum);
315 node->SetLineColor(kColorTOF);
316 fNodes->Add(node);
317
318 top->cd();
319 node = new TNode(nodeName3,nodeName3,"S_TOF_C", krTof*TMath::Cos(ang), krTof*TMath::Sin(ang),-zOffsetB,rotMatNum);
320 node->SetLineColor(kColorTOF);
321 fNodes->Add(node);
322 }
323
324 top->cd();
325 node = new TNode(nodeName4,nodeName4,"S_TOF_A", krTof*TMath::Cos(ang), krTof*TMath::Sin(ang), zOffsetA,rotMatNum);
326 node->SetLineColor(kColorTOF);
327 fNodes->Add(node);
328 } // end loop on nodeNum
329
330}
331
332//_____________________________________________________________________________
333void AliTOFv6T0::CreateGeometry()
334{
335 //
336 // Create geometry for Time Of Flight version 0
337 //
338 //Begin_Html
339 /*
340 <img src="picts/AliTOFv6T0.gif">
341 */
342 //End_Html
343 //
344 // Creates common geometry
345 //
346 AliTOF::CreateGeometry();
347}
348
349
350//_____________________________________________________________________________
351void AliTOFv6T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenA)
352{
353 //
354 // Definition of the Time Of Fligh Resistive Plate Chambers
355 //
356
357 const Float_t kPi = TMath::Pi();
358
359 const Float_t kInterCentrModBorder1 = 49.5;
360 const Float_t kInterCentrModBorder2 = 57.5;
361 const Float_t kExterInterModBorder1 = 196.0;
362 const Float_t kExterInterModBorder2 = 203.5;
363
364 const Float_t kLengthExInModBorder = 4.7;
365 const Float_t kLengthInCeModBorder = 7.0;
366
367 // module wall thickness (cm)
368 const Float_t kModuleWallThickness = 0.33;
369
370 // honeycomb layer between strips and cards (cm)
371 const Float_t kHoneycombLayerThickness = 2.;
372
373 AliDebug(1, "************************* TOF geometry **************************");
374 AliDebug(1,Form(" xtof %d", xtof));
375 AliDebug(1,Form(" ytof %d", ytof));
376 AliDebug(1,Form(" zlenA %d", zlenA));
377 AliDebug(2,Form(" zlenA*0.5 = %d", zlenA*0.5));
378
379 // Definition of the of fibre glass modules (FTOA, FTOB and FTOC)
6e2570fc 380
dfef1a15 381 Float_t xcoor, ycoor, zcoor;
382 Float_t par[3];
383 Int_t *idtmed = fIdtmed->GetArray()-499;
384 Int_t idrotm[100];
385
386 par[0] = xtof * 0.5;
387 par[1] = ytof * 0.25;
388 par[2] = zlenA * 0.5;
389 gMC->Gsvolu("FTOA", "BOX ", idtmed[503], par, 3); // fibre glass
6e2570fc 390
dfef1a15 391 if (fTOFHoles) {
392 par[0] = xtof * 0.5;
393 par[1] = ytof * 0.25;
394 par[2] = (zlenA*0.5 - kInterCentrModBorder1)*0.5;
395 gMC->Gsvolu("FTOB", "BOX ", idtmed[503], par, 3); // fibre glass
396 gMC->Gsvolu("FTOC", "BOX ", idtmed[503], par, 3); // fibre glass
397 }
398
399 // New supermodule card section description
400 // 2 cm honeycomb layer between strips and cards
401 par[0] = xtof*0.5 + 2.;
402 par[1] = kHoneycombLayerThickness*0.5;
403 par[2] = zlenA*0.5 + 2.;
404 gMC->Gsvolu("FPEA", "BOX ", idtmed[506], par, 3); // Al + Cu honeycomb
405 if (fTOFHoles) {
406 //par[0] = xtof*0.5 + 2.;
407 //par[1] = kHoneycombLayerThickness*0.5;
408 par[2] = (zlenA*0.5 - kInterCentrModBorder1)*0.5 + 2.;
409 gMC->Gsvolu("FPEB", "BOX ", idtmed[506], par, 3); // Al + Cu honeycomb
410 }
411
412 // Definition of the air card containers (FAIA and FAIB)
413
414 par[0] = xtof*0.5;
415 par[1] = (ytof*0.5 - kHoneycombLayerThickness)*0.5;
416 par[2] = zlenA*0.5;
417 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
418 if (fTOFHoles) gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
419
420 // Positioning of fibre glass modules (FTOA, FTOB and FTOC) and
421 // card containers (FPEA, FAIA and FAIB)
422
423 //AliMatrix(idrotm[0], 90., 0., 0., 0., 90.,-90.);
424 AliMatrix(idrotm[0], 90., 0., 0., 0., 90.,270.);
dfef1a15 425 xcoor = 0.;
426 for(Int_t isec=0; isec<fTOFGeometry->NSectors(); isec++){
427 if(fTOFSectors[isec]==-1)continue;
428 char name[16];
429 sprintf(name, "BTOF%d",isec);
430 if (fTOFHoles && (isec==11||isec==12)) {
431 //if (fTOFHoles && (isec==16||isec==17)) { \\Old 6h convention
432 //xcoor = 0.;
433 ycoor = (zlenA*0.5 + kInterCentrModBorder1)*0.5;
434 zcoor = -ytof * 0.25;
435 gMC->Gspos("FTOB", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
436 gMC->Gspos("FTOC", 0, name, xcoor,-ycoor, zcoor, idrotm[0], "ONLY");
437 //xcoor = 0.;
438 //ycoor = (zlenA*0.5 + kInterCentrModBorder1)*0.5;
439 zcoor = kHoneycombLayerThickness*0.5;
440 gMC->Gspos("FPEB", 1, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
441 gMC->Gspos("FPEB", 2, name, xcoor,-ycoor, zcoor, idrotm[0], "ONLY");
442 //xcoor = 0.;
443 ycoor = 0.;
444 zcoor = kHoneycombLayerThickness + (ytof*0.5 - kHoneycombLayerThickness)*0.5;
445 gMC->Gspos("FAIB", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
446 }
447 else {
448 //xcoor = 0.;
449 ycoor = 0.;
450 zcoor = -ytof * 0.25;
451 gMC->Gspos("FTOA", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
452 //xcoor = 0.;
453 //ycoor = 0.;
454 zcoor = kHoneycombLayerThickness*0.5;
455 gMC->Gspos("FPEA", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
456 //xcoor = 0.;
457 //ycoor = 0.;
458 zcoor = kHoneycombLayerThickness + (ytof*0.5 - kHoneycombLayerThickness)*0.5;
459 gMC->Gspos("FAIA", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
460 }
461 }
462
463 // Definition and positioning
464 // of the not sensitive volumes with Insensitive Freon (FLTA, FLTB and FLTC)
465
466 Float_t xFLT, yFLT, zFLTA;
467
468 xFLT = xtof - kModuleWallThickness*2.;
469 yFLT = ytof*0.5 - kModuleWallThickness;
470 zFLTA = zlenA - kModuleWallThickness*2.;
471
472 par[0] = xFLT*0.5;
473 par[1] = yFLT*0.5;
474 par[2] = zFLTA*0.5;
475 gMC->Gsvolu("FLTA", "BOX ", idtmed[507], par, 3); // Freon mix
476
477 xcoor = 0.;
478 ycoor = kModuleWallThickness*0.5;
479 zcoor = 0.;
480 gMC->Gspos ("FLTA", 0, "FTOA", xcoor, ycoor, zcoor, 0, "ONLY");
481
482 if (fTOFHoles) {
483 par[2] = (zlenA*0.5 - kInterCentrModBorder1 - kModuleWallThickness)*0.5;
484 gMC->Gsvolu("FLTB", "BOX ", idtmed[507], par, 3); // Freon mix
485 gMC->Gsvolu("FLTC", "BOX ", idtmed[507], par, 3); // Freon mix
486
487 //xcoor = 0.;
488 //ycoor = kModuleWallThickness*0.5;
489 //zcoor = 0.;
490 gMC->Gspos ("FLTB", 0, "FTOB", xcoor, ycoor, zcoor, 0, "ONLY");
491 gMC->Gspos ("FLTC", 0, "FTOC", xcoor, ycoor, zcoor, 0, "ONLY");
492 }
493
494 Float_t alpha, tgal, beta, tgbe, trpa[11];
495
496 // Definition and positioning
497 // of the fibre glass walls between central and intermediate modules (FWZ1 and FWZ2)
498
499 tgal = (yFLT - 2.*kLengthInCeModBorder)/(kInterCentrModBorder2 - kInterCentrModBorder1);
500 alpha = TMath::ATan(tgal);
501 beta = (kPi*0.5 - alpha)*0.5;
502 tgbe = TMath::Tan(beta);
503 trpa[0] = xFLT*0.5;
504 trpa[1] = 0.;
505 trpa[2] = 0.;
506 trpa[3] = kModuleWallThickness;
507 trpa[4] = (kLengthInCeModBorder - kModuleWallThickness*tgbe)*0.5;
508 trpa[5] = (kLengthInCeModBorder + kModuleWallThickness*tgbe)*0.5;
509 trpa[6] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
510 trpa[7] = kModuleWallThickness;
511 trpa[8] = (kLengthInCeModBorder - kModuleWallThickness*tgbe)*0.5;
512 trpa[9] = (kLengthInCeModBorder + kModuleWallThickness*tgbe)*0.5;
513 trpa[10] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
514 gMC->Gsvolu("FWZ1","TRAP", idtmed[503], trpa, 11); // fibre glass
515
516 AliMatrix (idrotm[1],90., 90.,180.,0.,90.,180.);
517 AliMatrix (idrotm[4],90., 90., 0.,0.,90., 0.);
518
519 xcoor = 0.;
520 ycoor = -(yFLT - kLengthInCeModBorder)*0.5;
521 zcoor = kInterCentrModBorder1;
522 gMC->Gspos("FWZ1", 1,"FLTA", xcoor, ycoor, zcoor,idrotm[1],"ONLY");
523 gMC->Gspos("FWZ1", 2,"FLTA", xcoor, ycoor,-zcoor,idrotm[4],"ONLY");
524
525 AliMatrix (idrotm[2],90.,270., 0.,0.,90.,180.);
526 AliMatrix (idrotm[5],90.,270.,180.,0.,90., 0.);
527
528 xcoor = 0.;
529 ycoor = (yFLT - kLengthInCeModBorder)*0.5;
530 zcoor = kInterCentrModBorder2;
531 gMC->Gspos("FWZ1", 3,"FLTA", xcoor, ycoor, zcoor,idrotm[2],"ONLY");
532 gMC->Gspos("FWZ1", 4,"FLTA", xcoor, ycoor,-zcoor,idrotm[5],"ONLY");
533
534 trpa[0] = 0.5*(kInterCentrModBorder2 - kInterCentrModBorder1)/TMath::Cos(alpha);
535 trpa[1] = kModuleWallThickness;
536 trpa[2] = xFLT*0.5;
537 trpa[3] = -beta*kRaddeg;
538 trpa[4] = 0.;
539 trpa[5] = 0.;
540 gMC->Gsvolu("FWZ2","PARA", idtmed[503], trpa, 6); // fibre glass
541
542 AliMatrix (idrotm[3], alpha*kRaddeg,90.,90.+alpha*kRaddeg,90.,90.,180.);
543 AliMatrix (idrotm[6],180.-alpha*kRaddeg,90.,90.-alpha*kRaddeg,90.,90., 0.);
544
545 xcoor = 0.;
546 ycoor = 0.;
547 zcoor = (kInterCentrModBorder2 + kInterCentrModBorder1)*0.5;
548 gMC->Gspos("FWZ2", 1,"FLTA", xcoor, ycoor, zcoor,idrotm[3],"ONLY");
549 gMC->Gspos("FWZ2", 2,"FLTA", xcoor, ycoor,-zcoor,idrotm[6],"ONLY");
550
551 // Definition and positioning
552 // of the fibre glass walls between intermediate and lateral modules (FWZ3 and FWZ4)
553
554 tgal = (yFLT - 2.*kLengthExInModBorder)/(kExterInterModBorder2 - kExterInterModBorder1);
555 alpha = TMath::ATan(tgal);
556 beta = (kPi*0.5 - alpha)*0.5;
557 tgbe = TMath::Tan(beta);
558 trpa[0] = xFLT*0.5;
559 trpa[1] = 0.;
560 trpa[2] = 0.;
561 trpa[3] = kModuleWallThickness;
562 trpa[4] = (kLengthExInModBorder - kModuleWallThickness*tgbe)*0.5;
563 trpa[5] = (kLengthExInModBorder + kModuleWallThickness*tgbe)*0.5;
564 trpa[6] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
565 trpa[7] = kModuleWallThickness;
566 trpa[8] = (kLengthExInModBorder - kModuleWallThickness*tgbe)*0.5;
567 trpa[9] = (kLengthExInModBorder + kModuleWallThickness*tgbe)*0.5;
568 trpa[10] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
569 gMC->Gsvolu("FWZ3","TRAP", idtmed[503], trpa, 11); // fibre glass
570
571 xcoor = 0.;
572 ycoor = (yFLT - kLengthExInModBorder)*0.5;
573 zcoor = kExterInterModBorder1;
574 gMC->Gspos("FWZ3", 1,"FLTA", xcoor, ycoor, zcoor,idrotm[5],"ONLY");
575 gMC->Gspos("FWZ3", 2,"FLTA", xcoor, ycoor,-zcoor,idrotm[2],"ONLY");
576
577 if (fTOFHoles) {
578 //xcoor = 0.;
579 //ycoor = (yFLT - kLengthExInModBorder)*0.5;
580 zcoor = -kExterInterModBorder1 + (zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5;
581 gMC->Gspos("FWZ3", 5,"FLTB", xcoor, ycoor, zcoor,idrotm[2],"ONLY");
582 gMC->Gspos("FWZ3", 6,"FLTC", xcoor, ycoor,-zcoor,idrotm[5],"ONLY");
583 }
584
585 //xcoor = 0.;
586 ycoor = -(yFLT - kLengthExInModBorder)*0.5;
587 zcoor = kExterInterModBorder2;
588 gMC->Gspos("FWZ3", 3,"FLTA", xcoor, ycoor, zcoor,idrotm[4],"ONLY");
589 gMC->Gspos("FWZ3", 4,"FLTA", xcoor, ycoor,-zcoor,idrotm[1],"ONLY");
590
591 if (fTOFHoles) {
592 //xcoor = 0.;
593 //ycoor = -(yFLT - kLengthExInModBorder)*0.5;
594 zcoor = -kExterInterModBorder2 + (zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5;
595 gMC->Gspos("FWZ3", 7,"FLTB", xcoor, ycoor, zcoor,idrotm[1],"ONLY");
596 gMC->Gspos("FWZ3", 8,"FLTC", xcoor, ycoor,-zcoor,idrotm[4],"ONLY");
597 }
598
599 trpa[0] = 0.5*(kExterInterModBorder2 - kExterInterModBorder1)/TMath::Cos(alpha);
600 trpa[1] = kModuleWallThickness;
601 trpa[2] = xFLT*0.5;
602 trpa[3] = -beta*kRaddeg;
603 trpa[4] = 0.;
604 trpa[5] = 0.;
605 gMC->Gsvolu("FWZ4","PARA", idtmed[503], trpa, 6); // fibre glass
606
607 AliMatrix (idrotm[13],alpha*kRaddeg,90.,90.+alpha*kRaddeg,90.,90.,180.);
608 AliMatrix (idrotm[16],180.-alpha*kRaddeg,90.,90.-alpha*kRaddeg,90.,90.,0.);
609
610 //xcoor = 0.;
611 ycoor = 0.;
612 zcoor = (kExterInterModBorder2 + kExterInterModBorder1)*0.5;
613 gMC->Gspos("FWZ4", 1,"FLTA", xcoor, ycoor, zcoor,idrotm[16],"ONLY");
614 gMC->Gspos("FWZ4", 2,"FLTA", xcoor, ycoor,-zcoor,idrotm[13],"ONLY");
615
616 if (fTOFHoles) {
617 //xcoor = 0.;
618 //ycoor = 0.;
619 zcoor = -(kExterInterModBorder2 + kExterInterModBorder1)*0.5 +
620 (zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5;
621 gMC->Gspos("FWZ4", 3,"FLTB", xcoor, ycoor, zcoor,idrotm[13],"ONLY");
622 gMC->Gspos("FWZ4", 4,"FLTC", xcoor, ycoor,-zcoor,idrotm[16],"ONLY");
623 }
624
625
626 ///////////////// Detector itself //////////////////////
627
628 const Int_t knx = fTOFGeometry->NpadX(); // number of pads along x
629 const Int_t knz = fTOFGeometry->NpadZ(); // number of pads along z
630 const Float_t kPadX = fTOFGeometry->XPad(); // pad length along x
631 const Float_t kPadZ = fTOFGeometry->ZPad(); // pad length along z
632
633 // new description for strip volume -double stack strip-
634 // -- all constants are expressed in cm
635 // heigth of different layers
636 const Float_t khhony = 1.0; // heigth of HONY Layer
637 const Float_t khpcby = 0.08; // heigth of PCB Layer
638 const Float_t khrgly = 0.055; // heigth of RED GLASS Layer
639
640 const Float_t khfiliy = 0.125; // heigth of FISHLINE Layer
641 const Float_t khglassy = 0.160*0.5; // heigth of GLASS Layer
642 const Float_t khglfy = khfiliy+2.*khglassy; // heigth of GLASS+FISHLINE Layer
643
644 const Float_t khcpcby = 0.16; // heigth of PCB Central Layer
645 const Float_t kwhonz = 8.1; // z dimension of HONEY Layer
646 const Float_t kwpcbz1 = 10.6; // z dimension of PCB Lower Layer
647 const Float_t kwpcbz2 = 11.6; // z dimension of PCB Upper Layer
648 const Float_t kwcpcbz = 13.; // z dimension of PCB Central Layer
649 const Float_t kwrglz = 8.; // z dimension of RED GLASS Layer
650 const Float_t kwglfz = 7.; // z dimension of GLASS+FISHLN Layer
651 const Float_t klsensmx = knx*kPadX; // length of Sensitive Layer
652 const Float_t khsensmy = 0.05; // heigth of Sensitive Layer
653 const Float_t kwsensmz = knz*kPadZ; // width of Sensitive Layer
654
655 // heigth of the FSTR Volume (the strip volume)
656 const Float_t khstripy = 2.*khhony+2.*khpcby+4.*khrgly+2.*khglfy+khcpcby;
657
658 // width of the FSTR Volume (the strip volume)
659 const Float_t kwstripz = kwcpcbz;
660 // length of the FSTR Volume (the strip volume)
661 const Float_t klstripx = fTOFGeometry->StripLength();
662
663 Float_t parfp[3]={klstripx*0.5, khstripy*0.5, kwstripz*0.5};
664 // Coordinates of the strip center in the strip reference frame;
665 // used for positioning internal strip volumes
666 Float_t posfp[3]={0.,0.,0.};
667
668 // FSTR volume definition-filling this volume with non sensitive Gas Mixture
669 gMC->Gsvolu("FSTR","BOX",idtmed[507],parfp,3); // Freon mix
670
671 //-- HONY Layer definition
672 //parfp[0] = klstripx*0.5;
673 parfp[1] = khhony*0.5;
674 parfp[2] = kwhonz*0.5;
675 gMC->Gsvolu("FHON","BOX",idtmed[501],parfp,3); // honeycomb (Nomex)
676 // positioning 2 HONY Layers on FSTR volume
677 //posfp[0] = 0.;
678 posfp[1] =-khstripy*0.5+parfp[1];
679 //posfp[2] = 0.;
680 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
681 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
682
683 //-- PCB Layer definition
684 //parfp[0] = klstripx*0.5;
685 parfp[1] = khpcby*0.5;
686 parfp[2] = kwpcbz1*0.5;
687 gMC->Gsvolu("FPC1","BOX",idtmed[502],parfp,3); // G10
688 //parfp[0] = klstripx*0.5;
689 //parfp[1] = khpcby*0.5;
690 parfp[2] = kwpcbz2*0.5;
691 gMC->Gsvolu("FPC2","BOX",idtmed[502],parfp,3); // G10
692 // positioning 2 PCB Layers on FSTR volume
693 //posfp[0] = 0.;
694 posfp[1] =-khstripy*0.5+khhony+parfp[1];
695 //posfp[2] = 0.;
696 gMC->Gspos("FPC1",1,"FSTR",0.,-posfp[1],0.,0,"ONLY");
697 gMC->Gspos("FPC2",1,"FSTR",0., posfp[1],0.,0,"ONLY");
698
699 //-- central PCB layer definition
700 //parfp[0] = klstripx*0.5;
701 parfp[1] = khcpcby*0.5;
702 parfp[2] = kwcpcbz*0.5;
703 gMC->Gsvolu("FPCB","BOX",idtmed[502],parfp,3); // G10
704 // positioning the central PCB layer
705 gMC->Gspos("FPCB",1,"FSTR",0.,0.,0.,0,"ONLY");
706
707 // Sensitive volume
708 Float_t parfs[3] = {klsensmx*0.5, khsensmy*0.5, kwsensmz*0.5};
709 gMC->Gsvolu("FSEN","BOX",idtmed[508],parfs,3); // sensitive
710 // dividing FSEN along z in knz=2 and along x in knx=48
711 gMC->Gsdvn("FSEZ","FSEN",knz,3);
712 gMC->Gsdvn("FPAD","FSEZ",knx,1);
713 // positioning a Sensitive layer inside FPCB
714 gMC->Gspos("FSEN",1,"FPCB",0.,0.,0.,0,"ONLY");
715
716 //-- RED GLASS Layer definition
717 //parfp[0] = klstripx*0.5;
718 parfp[1] = khrgly*0.5;
719 parfp[2] = kwrglz*0.5;
720 gMC->Gsvolu("FRGL","BOX",idtmed[509],parfp,3); // glass
721 // positioning 4 RED GLASS Layers on FSTR volume
722 //posfp[0] = 0.;
723 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
724 //posfp[2] = 0.;
725 gMC->Gspos("FRGL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
726 gMC->Gspos("FRGL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
727 //posfp[0] = 0.;
728 posfp[1] = (khcpcby+khrgly)*0.5;
729 //posfp[2] = 0.;
730 gMC->Gspos("FRGL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
731 gMC->Gspos("FRGL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
732
733 //-- GLASS+FISHLINE Layer definition
734 //parfp[0] = klstripx*0.5;
735 parfp[1] = khglfy*0.5;
736 parfp[2] = kwglfz*0.5;
737 gMC->Gsvolu("FGLF","BOX",idtmed[504],parfp,3);
738
739 // positioning 2 GLASS+FISHLINE Layers on FSTR volume
740 //posfp[0] = 0.;
741 posfp[1] = (khcpcby + khglfy)*0.5 + khrgly;
742 //posfp[2] = 0.;
743 gMC->Gspos("FGLF",1,"FSTR",0.,-posfp[1],0.,0,"ONLY");
744 gMC->Gspos("FGLF",2,"FSTR",0., posfp[1],0.,0,"ONLY");
745
746 // Positioning the Strips (FSTR volumes) in the FLT volumes
747 Int_t maxStripNumbers [5] ={fTOFGeometry->NStripC(),
748 fTOFGeometry->NStripB(),
749 fTOFGeometry->NStripA(),
750 fTOFGeometry->NStripB(),
751 fTOFGeometry->NStripC()};
752
753 Int_t totalStrip = 0;
754 Float_t xpos, zpos, ypos, ang;
755 for(Int_t iplate = 0; iplate < fTOFGeometry->NPlates(); iplate++){
756 if (iplate>0) totalStrip += maxStripNumbers[iplate-1];
757 for(Int_t istrip = 0; istrip < maxStripNumbers[iplate]; istrip++){
758
759 ang = fTOFGeometry->GetAngles(iplate,istrip);
760 AliDebug(1, Form(" iplate = %1i, istrip = %2i ---> ang = %f", iplate, istrip, ang));
761
762 if (ang>0.) AliMatrix (idrotm[istrip+totalStrip+1],90.,0.,90.+ang,90., ang, 90.);
763 else if (ang==0.) AliMatrix (idrotm[istrip+totalStrip+1],90.,0.,90.,90., 0., 0.);
764 else if (ang<0.) AliMatrix (idrotm[istrip+totalStrip+1],90.,0.,90.+ang,90.,-ang,270.);
765
766 xpos = 0.;
767 zpos = fTOFGeometry->GetDistances(iplate,istrip);
768 ypos = fTOFGeometry->GetHeights(iplate,istrip) + yFLT*0.5;
769
770 gMC->Gspos("FSTR",istrip+totalStrip+1,"FLTA", xpos, ypos,-zpos,idrotm[istrip+totalStrip+1], "ONLY");
771
772 if (fTOFHoles) {
773 if (istrip+totalStrip+1>53)
774 gMC->Gspos("FSTR",istrip+totalStrip+1,"FLTC", xpos, ypos,-zpos-(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[istrip+totalStrip+1],"ONLY");
775 if (istrip+totalStrip+1<39)
776 gMC->Gspos("FSTR",istrip+totalStrip+1,"FLTB", xpos, ypos,-zpos+(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[istrip+totalStrip+1],"ONLY");
777 }
778 }
779 }
780
781 // Definition of the cards, cooling tubes and layer for thermal dispersion
782 // (3 volumes)
783
784 // card volume definition
9f8488c2 785 //Float_t carpar[3] = {9.5, 5.75, 0.5};
786 Float_t carpar[3] = {9.5, 5.6, 0.55};
787 //gMC->Gsvolu("FCA1", "BOX ", idtmed[514], carpar, 3); // PCB+Alu small Card
788 gMC->Gsvolu("FCA1", "BOX ", idtmed[500], carpar, 3); // air
dfef1a15 789 carpar[0] = 19.25;
9f8488c2 790 //carpar[1] = 5.6;//5.75;
791 //carpar[2] = 0.55;//0.5;
792 //gMC->Gsvolu("FCA2", "BOX ", idtmed[514], carpar, 3); // PCB+Alu long Card
793 gMC->Gsvolu("FCA2", "BOX ", idtmed[500], carpar, 3); // air
794
795
796 Float_t feaParam1[3] = {9.5, 5.6, 0.1};
797 gMC->Gsvolu("FFEA", "BOX ", idtmed[502], feaParam1, 3); // G10
798
799 Float_t al1[3] = {9.5, 0.5, 0.25};
800 gMC->Gsvolu("FAL1", "BOX ", idtmed[505], al1, 3); // Aluminium
801 Float_t al2[3] = {7.2, 0.8, 0.25};
802 gMC->Gsvolu("FAL2", "BOX ", idtmed[505], al2, 3); // Aluminium
803 Float_t al3[3] = {3.35, 3.7, 0.1};
804 gMC->Gsvolu("FAL3", "BOX ", idtmed[505], al3, 3); // Aluminium
805
806 gMC->Gspos("FFEA", 1, "FCA1", 0., 0., -carpar[2]+feaParam1[2], 0, "ONLY");
807 gMC->Gspos("FAL1", 1, "FCA1", 0., carpar[1]-al1[1], -carpar[2]+2.*feaParam1[2]+al1[2], 0, "ONLY");
808 gMC->Gspos("FAL3", 1, "FCA1", 0., carpar[1]-al3[1], carpar[2]-al3[2], 0, "ONLY");
809 gMC->Gspos("FAL2", 1, "FCA1", 0., carpar[1]-2.*al3[1], carpar[2]-2.*al3[2]-al2[2], 0, "ONLY");
810
811
812 gMC->Gspos("FFEA", 2, "FCA2", -(feaParam1[0]+0.25), 0., -carpar[2]+feaParam1[2], 0, "ONLY");
813 gMC->Gspos("FAL1", 2, "FCA2", -(feaParam1[0]+0.25), carpar[1]-al1[1], -carpar[2]+2.*feaParam1[2]+al1[2], 0, "ONLY");
814 gMC->Gspos("FAL3", 2, "FCA2", -(feaParam1[0]+0.25), carpar[1]-al3[1], carpar[2]-al3[2], 0, "ONLY");
815 gMC->Gspos("FAL2", 2, "FCA2", -(feaParam1[0]+0.25), carpar[1]-2.*al3[1], carpar[2]-2.*al3[2]-al2[2], 0, "ONLY");
816
817 gMC->Gspos("FFEA", 3, "FCA2", (feaParam1[0]+0.25), 0., -carpar[2]+feaParam1[2], 0, "ONLY");
818 gMC->Gspos("FAL1", 3, "FCA2", (feaParam1[0]+0.25), carpar[1]-al1[1], -carpar[2]+2.*feaParam1[2]+al1[2], 0, "ONLY");
819 gMC->Gspos("FAL3", 3, "FCA2", (feaParam1[0]+0.25), carpar[1]-al3[1], carpar[2]-al3[2], 0, "ONLY");
820 gMC->Gspos("FAL2", 3, "FCA2", (feaParam1[0]+0.25), carpar[1]-2.*al3[1], carpar[2]-2.*al3[2]-al2[2], 0, "ONLY");
821
822 Float_t feaRoof1[3] = {9.5, 0.25, 1.7};
823 gMC->Gsvolu("FRO1", "BOX ", idtmed[505], feaRoof1, 3); // Aluminium
824 Float_t feaRoof2[3] = {3.35, 0.05, 1.5};
825 gMC->Gsvolu("FRO2", "BOX ", idtmed[505], feaRoof2, 3); // Aluminium
826 Float_t feaRoof3[3] = {3.35, feaRoof1[1]+feaRoof2[1], 0.1};
827 gMC->Gsvolu("FRO3", "BOX ", idtmed[505], feaRoof3, 3); // Aluminium
828
829 Float_t feaRoof4[3] = {3.35,
830 0.05,
831 carpar[2]-feaParam1[2]-al1[2]-al3[2]};
832 gMC->Gsvolu("FRO4", "BOX ", idtmed[505], feaRoof4, 3); // Aluminium
833
834 Float_t bar[3] = {8.575, 0.6, 0.15};
835 gMC->Gsvolu("FBAR", "BOX ", idtmed[505], bar, 3); // Aluminium
836
dfef1a15 837
838 // tube volume definition
839 Float_t tubepar[3] = {0., 0.4, xFLT*0.5-15.};
840 gMC->Gsvolu("FTUB", "TUBE", idtmed[513], tubepar, 3); // copper cooling tubes
841 //tubepar[0]= 0.;
842 tubepar[1]= 0.3;
843 //tubepar[2]= xFLT*0.5 - 15.;
844 gMC->Gsvolu("FITU", "TUBE", idtmed[510], tubepar, 3); // cooling water
845 // Positioning of the water tube into the steel one
846 gMC->Gspos("FITU",1,"FTUB",0.,0.,0.,0,"ONLY");
847
848 // cable
849 Float_t cbpar[3] = {0., 0.5, tubepar[2]};
850 gMC->Gsvolu("FCAB", "TUBE", idtmed[511], cbpar, 3); // copper+alu
851
852 // Alluminium components
853 Float_t lonpar[3] = {tubepar[2], 6.15, 0.7};
854 gMC->Gsvolu("FTLN", "BOX ", idtmed[505], lonpar, 3); // alluminium
855 lonpar[0] = 2.;
856 lonpar[1] = 1.;
857 lonpar[2] = zlenA*0.5;
858 gMC->Gsvolu("FLON", "BOX ", idtmed[505], lonpar, 3); // alluminium
859
860 // rotation matrix
861 AliMatrix(idrotm[99], 180., 90., 90., 90., 90., 0.);
9f8488c2 862 AliMatrix(idrotm[98], 90.,180., 90., 90.,180., 0.);
dfef1a15 863
864 // cards, tubes, cables positioning
865 Float_t carpos[3], rowstep = 6.66, ytub= 3.65, ycab= ytub-3.;
866 Float_t rowgap[5] = {13.5, 22.9, 16.94, 23.8, 20.4};
867 Int_t row, rowb[5] = {6, 7, 6, 19, 7}, nrow;
868 carpos[0] = 25. - xtof*0.5;
869 carpos[1] = (11.5 - (ytof*0.5 - kHoneycombLayerThickness))*0.5;
870 row = 1;
871 for (Int_t sg= -1; sg< 2; sg+= 2) {
872 carpos[2] = sg*zlenA*0.5;
873 for (Int_t nb=0; nb<5; ++nb) {
874 carpos[2] = carpos[2] - sg*(rowgap[nb] - rowstep);
875 nrow = row + rowb[nb];
876 for ( ; row < nrow ; ++row) {
9f8488c2 877
dfef1a15 878 carpos[2] -= sg*rowstep;
9f8488c2 879
880 if (nb==4) {
881 gMC->Gspos("FCA1",2*row, "FAIA", carpos[0],carpos[1],carpos[2], 0,"ONLY");
882 gMC->Gspos("FCA1",2*row-1,"FAIA",-carpos[0],carpos[1],carpos[2], 0,"ONLY");
883 gMC->Gspos("FCA2", row, "FAIA", 0., carpos[1], carpos[2], 0, "ONLY");
884
885 //gMC->Gspos("FTUB", row, "FAIA", 0., ytub, carpos[2]-sg, idrotm[99], "ONLY");
886 gMC->Gspos("FTUB", row, "FAIA", 0., carpos[1]+carpar[1]-bar[1], carpos[2]-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-bar[1]), idrotm[99], "ONLY");
887 gMC->Gspos("FCAB", row, "FAIA", 0., ycab, carpos[2]-1.1, idrotm[99], "ONLY");
888
889 gMC->Gspos("FRO1",4*row, "FAIA", carpos[0],carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
890 gMC->Gspos("FRO1",4*row-1,"FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
891 gMC->Gspos("FRO1",4*row-2,"FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
892 gMC->Gspos("FRO1",4*row-3,"FAIA",-carpos[0],carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
893
894 gMC->Gspos("FRO2",4*row, "FAIA", carpos[0],carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
895 gMC->Gspos("FRO2",4*row-1,"FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
896 gMC->Gspos("FRO2",4*row-2,"FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
897 gMC->Gspos("FRO2",4*row-3,"FAIA",-carpos[0],carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
898
899 gMC->Gspos("FRO3",4*row, "FAIA", carpos[0],carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+(carpar[2]-feaRoof3[2]), 0,"ONLY");
900 gMC->Gspos("FRO3",4*row-1,"FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+(carpar[2]-feaRoof3[2]), 0,"ONLY");
901 gMC->Gspos("FRO3",4*row-2,"FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+(carpar[2]-feaRoof3[2]), 0,"ONLY");
902 gMC->Gspos("FRO3",4*row-3,"FAIA",-carpos[0],carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+(carpar[2]-feaRoof3[2]), 0,"ONLY");
903
904 gMC->Gspos("FRO4",4*row, "FAIA", carpos[0], carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
905 gMC->Gspos("FRO4",4*row-1,"FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
906 gMC->Gspos("FRO4",4*row-2,"FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
907 gMC->Gspos("FRO4",4*row-3,"FAIA",-carpos[0], carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
908
909 gMC->Gspos("FBAR",4*row, "FAIA", carpos[0],carpos[1]+carpar[1]-bar[1],carpos[2]-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
910 gMC->Gspos("FBAR",4*row-1,"FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+-bar[1],carpos[2]-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
911 gMC->Gspos("FBAR",4*row-2,"FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+-bar[1],carpos[2]-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
912 gMC->Gspos("FBAR",4*row-3,"FAIA",-carpos[0],carpos[1]+carpar[1]-bar[1],carpos[2]-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
913
914 }
915 else {
916 switch (sg) {
917 case 1:
918 gMC->Gspos("FCA1",2*row, "FAIA", carpos[0],carpos[1],carpos[2], 0,"ONLY");
919 gMC->Gspos("FCA1",2*row-1,"FAIA",-carpos[0],carpos[1],carpos[2], 0,"ONLY");
920 gMC->Gspos("FCA2", row, "FAIA", 0., carpos[1], carpos[2], 0, "ONLY");
921 break;
922 case -1:
923 gMC->Gspos("FCA1",2*row, "FAIA", carpos[0],carpos[1],carpos[2], idrotm[98],"ONLY");
924 gMC->Gspos("FCA1",2*row-1,"FAIA",-carpos[0],carpos[1],carpos[2], idrotm[98],"ONLY");
925 gMC->Gspos("FCA2", row, "FAIA", 0., carpos[1], carpos[2], idrotm[98], "ONLY");
926 break;
927 }
928
929 //gMC->Gspos("FTUB", row, "FAIA", 0., ytub, carpos[2]-sg, idrotm[99], "ONLY");
930 gMC->Gspos("FTUB", row, "FAIA", 0., carpos[1]+carpar[1]-bar[1], carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-bar[1]), idrotm[99], "ONLY");
931 gMC->Gspos("FCAB", row, "FAIA", 0., ycab, carpos[2]-sg*1.1, idrotm[99], "ONLY");
932
933 gMC->Gspos("FRO1",4*row, "FAIA", carpos[0],carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
934 gMC->Gspos("FRO1",4*row-1,"FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
935 gMC->Gspos("FRO1",4*row-2,"FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
936 gMC->Gspos("FRO1",4*row-3,"FAIA",-carpos[0],carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
937
938 gMC->Gspos("FRO2",4*row, "FAIA", carpos[0],carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+sg*(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
939 gMC->Gspos("FRO2",4*row-1,"FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+sg*(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
940 gMC->Gspos("FRO2",4*row-2,"FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+sg*(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
941 gMC->Gspos("FRO2",4*row-3,"FAIA",-carpos[0],carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+sg*(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
942
943 gMC->Gspos("FRO3",4*row, "FAIA", carpos[0],carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+sg*(carpar[2]-feaRoof3[2]), 0,"ONLY");
944 gMC->Gspos("FRO3",4*row-1,"FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+sg*(carpar[2]-feaRoof3[2]), 0,"ONLY");
945 gMC->Gspos("FRO3",4*row-2,"FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+sg*(carpar[2]-feaRoof3[2]), 0,"ONLY");
946 gMC->Gspos("FRO3",4*row-3,"FAIA",-carpos[0],carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+sg*(carpar[2]-feaRoof3[2]), 0,"ONLY");
947
948 gMC->Gspos("FRO4",4*row, "FAIA", carpos[0], carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+sg*(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
949 gMC->Gspos("FRO4",4*row-1,"FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+sg*(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
950 gMC->Gspos("FRO4",4*row-2,"FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+sg*(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
951 gMC->Gspos("FRO4",4*row-3,"FAIA",-carpos[0], carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+sg*(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
952
953 gMC->Gspos("FBAR",4*row, "FAIA", carpos[0],carpos[1]+carpar[1]-bar[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
954 gMC->Gspos("FBAR",4*row-1,"FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+-bar[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
955 gMC->Gspos("FBAR",4*row-2,"FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+-bar[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
956 gMC->Gspos("FBAR",4*row-3,"FAIA",-carpos[0],carpos[1]+carpar[1]-bar[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
957
958 }
dfef1a15 959 }
960 }
961 gMC->Gspos("FTLN", 5+4*sg, "FAIA", 0., -0.1, 369.9*sg, 0, "ONLY");
962 gMC->Gspos("FTLN", 5+3*sg, "FAIA", 0., -0.1, 366.9*sg, 0, "ONLY");
963 gMC->Gspos("FTLN", 5+2*sg, "FAIA", 0., -0.1, 198.8*sg, 0, "ONLY");
964 gMC->Gspos("FTLN", 5+sg, "FAIA", 0., -0.1, 56.82*sg, 0, "ONLY");
965 }
9f8488c2 966 gMC->Gspos("FCA1", 182, "FAIA", carpos[0],carpos[1],0., 0,"ONLY");
967 gMC->Gspos("FCA1", 181, "FAIA",-carpos[0],carpos[1],0., 0,"ONLY");
dfef1a15 968 gMC->Gspos("FCA2", 91, "FAIA", 0., carpos[1], 0., 0, "ONLY");
9f8488c2 969
970 //gMC->Gspos("FTUB", 91, "FAIA", 0., ytub, -1., idrotm[99], "ONLY");
971 gMC->Gspos("FTUB", 91, "FAIA", 0., carpos[1]+carpar[1]-bar[1],-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-bar[1]), idrotm[99], "ONLY");
972 gMC->Gspos("FCAB", 91, "FAIA", 0., ycab, -1.1, idrotm[99], "ONLY");
973
974 gMC->Gspos("FRO1",364, "FAIA", carpos[0],carpos[1]+carpar[1]+feaRoof1[1],-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
975 gMC->Gspos("FRO1",363, "FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof1[1],-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
976 gMC->Gspos("FRO1",362, "FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof1[1],-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
977 gMC->Gspos("FRO1",361, "FAIA",-carpos[0],carpos[1]+carpar[1]+feaRoof1[1],-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
978
979 gMC->Gspos("FRO2",364, "FAIA", carpos[0],carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
980 gMC->Gspos("FRO2",363, "FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
981 gMC->Gspos("FRO2",362, "FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
982 gMC->Gspos("FRO2",361, "FAIA",-carpos[0],carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
983
984 gMC->Gspos("FRO3",364, "FAIA", carpos[0],carpos[1]+carpar[1]+feaRoof3[1],(carpar[2]-feaRoof3[2]), 0,"ONLY");
985 gMC->Gspos("FRO3",363, "FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof3[1],(carpar[2]-feaRoof3[2]), 0,"ONLY");
986 gMC->Gspos("FRO3",362, "FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof3[1],(carpar[2]-feaRoof3[2]), 0,"ONLY");
987 gMC->Gspos("FRO3",361, "FAIA",-carpos[0],carpos[1]+carpar[1]+feaRoof3[1],(carpar[2]-feaRoof3[2]), 0,"ONLY");
988
989 gMC->Gspos("FRO4",364, "FAIA", carpos[0], carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
990 gMC->Gspos("FRO4",363, "FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
991 gMC->Gspos("FRO4",362, "FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
992 gMC->Gspos("FRO4",361, "FAIA",-carpos[0], carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
993
994 gMC->Gspos("FBAR",364, "FAIA", carpos[0],carpos[1]+carpar[1]-bar[1],-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
995 gMC->Gspos("FBAR",363, "FAIA", (feaParam1[0]+0.25),carpos[1]+carpar[1]+-bar[1],-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
996 gMC->Gspos("FBAR",362, "FAIA",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+-bar[1],-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
997 gMC->Gspos("FBAR",361, "FAIA",-carpos[0],carpos[1]+carpar[1]-bar[1],-(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
998
999 gMC->Gspos("FLON", 2, "FAIA",-24., ytub+1.4, 0., 0, "MANY");
1000 gMC->Gspos("FLON", 1, "FAIA", 24., ytub+1.4, 0., 0, "MANY");
1001
1002
dfef1a15 1003 if (fTOFHoles) {
1004 row = 1;
1005 for (Int_t sg= -1; sg< 2; sg+= 2) {
1006 carpos[2] = sg*zlenA*0.5;
1007 for (Int_t nb=0; nb<4; ++nb) {
1008 carpos[2] = carpos[2] - sg*(rowgap[nb] - rowstep);
1009 nrow = row + rowb[nb];
1010 for ( ; row < nrow ; ++row) {
1011 carpos[2] -= sg*rowstep;
9f8488c2 1012
1013 switch (sg) {
1014 case 1:
1015 gMC->Gspos("FCA1",2*row, "FAIB", carpos[0],carpos[1],carpos[2], 0,"ONLY");
1016 gMC->Gspos("FCA1",2*row-1,"FAIB",-carpos[0],carpos[1],carpos[2], 0,"ONLY");
1017 gMC->Gspos("FCA2", row, "FAIB", 0., carpos[1], carpos[2], 0, "ONLY");
1018 break;
1019 case -1:
1020 gMC->Gspos("FCA1",2*row, "FAIB", carpos[0],carpos[1],carpos[2], idrotm[98],"ONLY");
1021 gMC->Gspos("FCA1",2*row-1,"FAIB",-carpos[0],carpos[1],carpos[2], idrotm[98],"ONLY");
1022 gMC->Gspos("FCA2", row, "FAIB", 0., carpos[1], carpos[2], idrotm[98], "ONLY");
1023 break;
1024 }
1025
1026 //gMC->Gspos("FTUB", row, "FAIB", 0., ytub,carpos[2]-sg, idrotm[99], "ONLY");
1027 gMC->Gspos("FTUB", row, "FAIB", 0., carpos[1]+carpar[1]-bar[1], carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-bar[1]), idrotm[99], "ONLY");
1028 gMC->Gspos("FCAB", row, "FAIB", 0., ycab,carpos[2]-sg*1.1, idrotm[99], "ONLY");
1029
1030 gMC->Gspos("FRO1",4*row, "FAIB", carpos[0],carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
1031 gMC->Gspos("FRO1",4*row-1,"FAIB", (feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
1032 gMC->Gspos("FRO1",4*row-2,"FAIB",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
1033 gMC->Gspos("FRO1",4*row-3,"FAIB",-carpos[0],carpos[1]+carpar[1]+feaRoof1[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+feaRoof1[2]), 0,"ONLY");
1034
1035 gMC->Gspos("FRO2",4*row, "FAIB", carpos[0],carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+sg*(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
1036 gMC->Gspos("FRO2",4*row-1,"FAIB", (feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+sg*(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
1037 gMC->Gspos("FRO2",4*row-2,"FAIB",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+sg*(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
1038 gMC->Gspos("FRO2",4*row-3,"FAIB",-carpos[0],carpos[1]+carpar[1]+2.*feaRoof1[1]+feaRoof2[1],carpos[2]+sg*(carpar[2]-2.*feaRoof3[2]-feaRoof2[2]), 0,"ONLY");
1039
1040 gMC->Gspos("FRO3",4*row, "FAIB", carpos[0],carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+sg*(carpar[2]-feaRoof3[2]), 0,"ONLY");
1041 gMC->Gspos("FRO3",4*row-1,"FAIB", (feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+sg*(carpar[2]-feaRoof3[2]), 0,"ONLY");
1042 gMC->Gspos("FRO3",4*row-2,"FAIB",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+sg*(carpar[2]-feaRoof3[2]), 0,"ONLY");
1043 gMC->Gspos("FRO3",4*row-3,"FAIB",-carpos[0],carpos[1]+carpar[1]+feaRoof3[1],carpos[2]+sg*(carpar[2]-feaRoof3[2]), 0,"ONLY");
1044
1045 gMC->Gspos("FRO4",4*row, "FAIB", carpos[0], carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+sg*(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
1046 gMC->Gspos("FRO4",4*row-1,"FAIB", (feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+sg*(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
1047 gMC->Gspos("FRO4",4*row-2,"FAIB",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+sg*(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
1048 gMC->Gspos("FRO4",4*row-3,"FAIB",-carpos[0], carpos[1]+carpar[1]+2.*feaRoof1[1]-feaRoof4[1],carpos[2]+sg*(carpar[2]-2.*al3[2]-feaRoof4[2]), 0,"ONLY");
1049
1050 gMC->Gspos("FBAR",4*row, "FAIB", carpos[0],carpos[1]+carpar[1]-bar[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
1051 gMC->Gspos("FBAR",4*row-1,"FAIB", (feaParam1[0]+0.25),carpos[1]+carpar[1]+-bar[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
1052 gMC->Gspos("FBAR",4*row-2,"FAIB",-(feaParam1[0]+0.25),carpos[1]+carpar[1]+-bar[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
1053 gMC->Gspos("FBAR",4*row-3,"FAIB",-carpos[0],carpos[1]+carpar[1]-bar[1],carpos[2]-sg*(carpar[2]-2.*feaParam1[2]-2.*al1[2]+2.*feaRoof1[2]-2.*bar[1]), 0,"ONLY");
1054
dfef1a15 1055 }
1056 }
1057 gMC->Gspos("FTLN", 5+4*sg, "FAIB", 0., -0.1, 369.9*sg, 0, "ONLY");
1058 gMC->Gspos("FTLN", 5+3*sg, "FAIB", 0., -0.1, 366.9*sg, 0, "ONLY");
1059 gMC->Gspos("FTLN", 5+2*sg, "FAIB", 0., -0.1, 198.8*sg, 0, "ONLY");
1060 gMC->Gspos("FTLN", 5+sg, "FAIB", 0., -0.1, 56.82*sg, 0, "ONLY");
1061 }
9f8488c2 1062 gMC->Gspos("FLON", 2, "FAIB",-24., ytub+1.4, 0., 0, "MANY");
1063 gMC->Gspos("FLON", 1, "FAIB", 24., ytub+1.4, 0., 0, "MANY");
dfef1a15 1064 }
1065
1066 // Cables and tubes on the side blocks
1067 const Float_t kcbll = zlenA*0.5; // length of block
1068 const Float_t kcbllh = zlenA*0.5 - kInterCentrModBorder2; // length of block in case of hole
1069 const Float_t kcblw = 13.5; // width of block
1070 const Float_t kcblh1 = 2.; // min. heigth of block
1071 const Float_t kcblh2 = 12.3; // max. heigth of block
1072 // volume definition
1073 Float_t cblpar[11];
1074 tgal = (kcblh2 - kcblh1)/(2.*kcbll);
1075 cblpar[0] = kcblw *0.5;
1076 cblpar[1] = 0.;
1077 cblpar[2] = 0.;
1078 cblpar[3] = kcbll *0.5;
1079 cblpar[4] = kcblh1 *0.5;
1080 cblpar[5] = kcblh2 *0.5;
1081 cblpar[6] = TMath::ATan(tgal)*kRaddeg;
1082 cblpar[7] = kcbll *0.5;
1083 cblpar[8] = kcblh1 *0.5;
1084 cblpar[9] = kcblh2 *0.5;
1085 cblpar[10]= cblpar[6];
1086 gMC->Gsvolu("FCBL", "TRAP", idtmed[512], cblpar, 11); // cables & tubes mix
1087 Float_t sawpar[3] = {0.5, kcblh2*0.5, kcbll};
1088 gMC->Gsvolu("FSAW", "BOX ", idtmed[505], sawpar, 3); // Side Al walls
1089 // volume positioning
1090 AliMatrix(idrotm[7], 90., 90., 180., 0., 90., 180.);
1091 AliMatrix(idrotm[8], 90., 90., 0., 0., 90., 0.);
1092 xcoor = (xtof-kcblw)*0.5 - 2.*sawpar[0];
1093 ycoor = (kcblh1+kcblh2)*0.25 - (ytof*0.5 - kHoneycombLayerThickness)*0.5;
1094 zcoor = kcbll*0.5;
1095 gMC->Gspos("FCBL", 1, "FAIA", -xcoor, ycoor, -zcoor, idrotm[7], "ONLY");
1096 gMC->Gspos("FCBL", 2, "FAIA", xcoor, ycoor, -zcoor, idrotm[7], "ONLY");
1097 gMC->Gspos("FCBL", 3, "FAIA", -xcoor, ycoor, zcoor, idrotm[8], "ONLY");
1098 gMC->Gspos("FCBL", 4, "FAIA", xcoor, ycoor, zcoor, idrotm[8], "ONLY");
1099 xcoor = xtof*0.5-sawpar[0];
1100 ycoor = (kcblh2 - ytof*0.5 + kHoneycombLayerThickness)*0.5;
1101 gMC->Gspos("FSAW", 1, "FAIA", -xcoor, ycoor, 0., 0, "ONLY");
1102 gMC->Gspos("FSAW", 2, "FAIA", xcoor, ycoor, 0., 0, "ONLY");
1103 if (fTOFHoles) {
1104 cblpar[3] = kcbllh *0.5;
1105 cblpar[5] = kcblh1*0.5 + kcbllh*tgal;
1106 cblpar[7] = kcbllh *0.5;
1107 cblpar[9] = cblpar[5];
1108 gMC->Gsvolu("FCBB", "TRAP", idtmed[512], cblpar, 11); // cables & tubes mix
1109 xcoor = (xtof - kcblw)*0.5 - 2.*sawpar[0];
1110 ycoor = (kcblh1 + 2.*cblpar[5])*0.25 - (ytof*0.5 - kHoneycombLayerThickness)*0.5;
1111 zcoor = kcbll-kcbllh*0.5;
1112 gMC->Gspos("FCBB", 1, "FAIB", -xcoor, ycoor, -zcoor, idrotm[7], "ONLY");
1113 gMC->Gspos("FCBB", 2, "FAIB", xcoor, ycoor, -zcoor, idrotm[7], "ONLY");
1114 gMC->Gspos("FCBB", 3, "FAIB", -xcoor, ycoor, zcoor, idrotm[8], "ONLY");
1115 gMC->Gspos("FCBB", 4, "FAIB", xcoor, ycoor, zcoor, idrotm[8], "ONLY");
1116 xcoor = xtof*0.5 - sawpar[0];
1117 ycoor = (kcblh2 - ytof*0.5 + kHoneycombLayerThickness)*0.5;
1118 gMC->Gspos("FSAW", 1, "FAIB", -xcoor, ycoor, 0., 0, "ONLY");
1119 gMC->Gspos("FSAW", 2, "FAIB", xcoor, ycoor, 0., 0, "ONLY");
1120 }
1121
1122 // TOF Supermodule cover definition and positioning
1123 Float_t covpar[3] = {xtof*0.5, 0.1, zlenA*0.5};
1124 gMC->Gsvolu("FCOV", "BOX ", idtmed[505], covpar, 3); // Al cover
1125 xcoor = 0.;
1126 ycoor = 12.5*0.5 - 0.1;
1127 zcoor = 0.;
1128 gMC->Gspos("FCOV", 0, "FAIA", xcoor, ycoor, zcoor, 0, "ONLY");
1129 if (fTOFHoles) gMC->Gspos("FCOV", 0, "FAIB", xcoor, ycoor, zcoor, 0, "ONLY");
1130
1131 // Services Volumes
1132
1133 // Empty crate weight: 50 Kg, electronics cards + cables ~ 52 Kg.
1134 // Per each side (A and C) the total weight is: 2x102 ~ 204 Kg.
1135 // ... + weight of the connection pannel for the steel cooling system (Cr 18%, Ni 12%, Fe 70%)
1136 // + other remaining elements + various supports
1137
1138 // Each FEA card weight + all supports
1139 // (including all bolts and not including the cable connectors)
1140 // 353.1 g.
1141 // Per each strip there are 4 FEA cards, then
1142 // the total weight of the front-end electonics section is: 353.1 g x 4 = 1412.4 g.
1143
1144 Float_t serpar[3] = {29.*0.5, 121.*0.5, 90.*0.5};
1145 gMC->Gsvolu("FTOS", "BOX ", idtmed[515], serpar, 3); // Al + Cu + steel
1146 zcoor = (118.-90.)*0.5;
1147 Float_t phi = -10., ra = fTOFGeometry->Rmin() + ytof*0.5;
1148 for (Int_t i = 0; i < fTOFGeometry->NSectors(); i++) {
1149 phi += 20.;
1150 xcoor = ra * TMath::Cos(phi * kDegrad);
1151 ycoor = ra * TMath::Sin(phi * kDegrad);
1152 AliMatrix(idrotm[20+i], 90., phi, 90., phi + 270., 0., 0.);
1153 gMC->Gspos("FTOS", i, "BFMO", xcoor, ycoor, zcoor, idrotm[20+i], "ONLY");
1154 }
1155 zcoor = (90. - 223.)*0.5;
1156 gMC->Gspos("FTOS", 1, "BBCE", ra, 0., zcoor, 0, "ONLY");
1157
1158}
1159//_____________________________________________________________________________
1160void AliTOFv6T0::DrawModule() const
1161{
1162 //
1163 // Draw a shaded view of the Time Of Flight version 5
1164 //
1165
1166 // Set everything unseen
1167 gMC->Gsatt("*", "seen", -1);
1168
1169 //
1170 //Set volumes visible
1171 //
1172
1173 //Set ALIC mother transparent
1174 gMC->Gsatt("ALIC","SEEN", 0);
1175
1176//=====> Level 1
1177 // Level 1 for TOF volumes
1178 gMC->Gsatt("B077","seen", 0);
1179
1180//=====> Level 2
1181 // Level 2 for TOF volumes
1182 gMC->Gsatt("B071","seen", 0);
1183 gMC->Gsatt("B074","seen", 0);
1184 gMC->Gsatt("B075","seen", 0);
1185 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
1186 gMC->Gsatt("B080","seen", 0); // B080 does not has sub-level
1187
1188 // Level 2 of B071
1189 gMC->Gsatt("B056","seen", 0); // B056 does not has sub-levels -
1190 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
1191 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
1192 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
1193 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
1194
1195 char name[16];
1196 for (Int_t isec=0; isec<fTOFGeometry->NSectors(); isec++) {
1197 sprintf(name, "BREF%d",isec);
1198 gMC->Gsatt(name,"seen", 0); // all BREF%d sub-levels skipped -
1199 sprintf(name, "BTRD%d",isec);
1200 gMC->Gsatt(name,"seen", 0); // all BTRD%d sub-levels skipped -
1201 sprintf(name, "BTOF%d",isec);
1202 gMC->Gsatt(name,"seen",-2); // all BTOF%d sub-levels skipped -
1203 }
1204
1205 gMC->Gdopt("hide", "on");
1206 gMC->Gdopt("shad", "on");
1207 gMC->Gsatt("*", "fill", 7);
1208 gMC->SetClipBox(".");
1209 gMC->SetClipBox("*", 100, 1000, 100, 1000, 100, 1000);
1210 gMC->DefaultRange();
1211 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .018, .018);
1212 gMC->Gdhead(1111, "Time Of Flight");
1213 gMC->Gdman(18, 3, "MAN");
1214 gMC->Gdopt("hide","off");
1215}
1216//_____________________________________________________________________________
1217void AliTOFv6T0::DrawDetectorModules() const
1218{
1219 //
1220 // Draw a shaded view of the TOF detector SuperModules version 5
1221 //
1222
1223 // Set everything unseen
1224 gMC->Gsatt("*", "seen", -1);
1225
1226 //
1227 //Set volumes visible
1228 //
1229
1230 //Set ALIC mother transparent
1231 gMC->Gsatt("ALIC","SEEN", 0);
1232
1233//=====> Level 1
1234 // Level 1 for TOF volumes
1235 gMC->Gsatt("B077","seen", 0);
1236
1237//=====> Level 2
1238 // Level 2 for TOF volumes
1239 gMC->Gsatt("B071","seen", 0);
1240 gMC->Gsatt("B074","seen", 0);
1241 gMC->Gsatt("B075","seen", 0);
1242 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
1243 gMC->Gsatt("B080","seen", 0); // B080 does not has sub-level
1244
1245 // Level 2 of B071
1246 gMC->Gsatt("B056","seen", 0); // B056 does not has sub-levels -
1247 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
1248 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
1249 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
1250 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
1251
1252 char name[16];
1253 for (Int_t isec=0; isec<fTOFGeometry->NSectors(); isec++) {
1254 sprintf(name, "BREF%d",isec);
1255 gMC->Gsatt(name,"seen", 0); // all BREF%d sub-levels skipped -
1256 sprintf(name, "BTRD%d",isec);
1257 gMC->Gsatt(name,"seen", 0); // all BTRD%d sub-levels skipped -
1258 sprintf(name, "BTOF%d",isec);
1259 gMC->Gsatt(name,"seen", 0); // all BTOF%d sub-levels skipped -
1260 }
1261
1262 // Level 3 of B071, B075 and B074
1263 gMC->Gsatt("FTOA","seen",-2); // all FTOA sub-levels skipped -
1264 if (fTOFHoles) gMC->Gsatt("FTOB","seen",-2); // all FTOB sub-levels skipped -
1265 if (fTOFHoles) gMC->Gsatt("FTOC","seen",-2); // all FTOC sub-levels skipped -
1266
1267 // Level 3 of B071, B075 and B074
1268 gMC->Gsatt("FAIA","seen",-1); // all FAIA sub-levels skipped -
1269 if (fTOFHoles) gMC->Gsatt("FAIB","seen",-1); // all FAIB sub-levels skipped -
1270
1271 // Level 3 of B071, B075 and B074
1272 gMC->Gsatt("FPEA","seen",1); // all FPEA sub-levels skipped -
1273 if (fTOFHoles) gMC->Gsatt("FPEB","seen",1); // all FPEB sub-levels skipped -
1274
1275 gMC->Gdopt("hide","on");
1276 gMC->Gdopt("shad","on");
1277 gMC->Gsatt("*", "fill", 5);
1278 gMC->SetClipBox(".");
1279 gMC->SetClipBox("*", 100, 1000, 100, 1000, 0, 1000);
1280 gMC->DefaultRange();
1281 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .018, .018);
1282 gMC->Gdhead(1111,"TOF detector");
1283 gMC->Gdman(18, 3, "MAN");
1284 gMC->Gdopt("hide","off");
1285}
1286
1287//_____________________________________________________________________________
1288void AliTOFv6T0::DrawDetectorStrips() const
1289{
1290 //
1291 // Draw a shaded view of the TOF strips for version 5
1292 //
1293
1294 // Set everything unseen
1295 gMC->Gsatt("*", "seen", -1);
1296
1297 //
1298 //Set volumes visible
1299 //
1300
1301 //Set ALIC mother transparent
1302 gMC->Gsatt("ALIC","SEEN", 0);
1303
1304//=====> Level 1
1305 // Level 1 for TOF volumes
1306 gMC->Gsatt("B077","seen", 0);
1307
1308//=====> Level 2
1309 // Level 2 for TOF volumes
1310 gMC->Gsatt("B071","seen", 0);
1311 gMC->Gsatt("B074","seen", 0);
1312 gMC->Gsatt("B075","seen", 0);
1313 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
1314 gMC->Gsatt("B080","seen", 0); // B080 does not has sub-level
1315
1316 // Level 2 of B071
1317 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
1318 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
1319 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
1320 gMC->Gsatt("B056","seen", 0); // B056 does not has sub-levels -
1321 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
1322
1323 char name[16];
1324 for (Int_t isec=0; isec<fTOFGeometry->NSectors(); isec++) {
1325 sprintf(name, "BREF%d",isec);
1326 gMC->Gsatt(name,"seen", 0); // all BREF%d sub-levels skipped -
1327 sprintf(name, "BTRD%d",isec);
1328 gMC->Gsatt(name,"seen", 0); // all BTRD%d sub-levels skipped -
1329 sprintf(name, "BTOF%d",isec);
1330 gMC->Gsatt(name,"seen", 0); // all BTOF%d sub-levels skipped -
1331 }
1332
1333 // Level 3 of B071, B074 and B075
1334 gMC->Gsatt("FTOA","SEEN", 0);
1335 if (fTOFHoles) gMC->Gsatt("FTOB","SEEN", 0);
1336 if (fTOFHoles) gMC->Gsatt("FTOC","SEEN", 0);
1337
1338 // Level 4 of B071, B074 and B075
1339 gMC->Gsatt("FLTA","SEEN", 0);
1340 if (fTOFHoles) gMC->Gsatt("FLTB","SEEN", 0);
1341 if (fTOFHoles) gMC->Gsatt("FLTC","SEEN", 0);
1342
1343 // Level 5 of B071, B074 and B075
1344 gMC->Gsatt("FAIA","SEEN", 0);
1345 if (fTOFHoles) gMC->Gsatt("FAIB","SEEN", 0);
1346
1347 gMC->Gsatt("FPEA","SEEN", 1);
1348 if (fTOFHoles) gMC->Gsatt("FPEB","SEEN", 1);
1349
1350 gMC->Gsatt("FSTR","SEEN",-2); // all FSTR sub-levels skipped -
1351
1352 gMC->Gsatt("FWZ1","SEEN", 1);
1353 gMC->Gsatt("FWZ2","SEEN", 1);
1354 gMC->Gsatt("FWZ3","SEEN", 1);
1355 gMC->Gsatt("FWZ4","SEEN", 1);
1356
1357
1358 // Level 2 of FAIA
1359 // Level 2 of FAIB
1360 gMC->Gsatt("FCA1","SEEN", 0);
1361 gMC->Gsatt("FCA2","SEEN", 0);
1362 gMC->Gsatt("FCAB","SEEN", 0);
1363 gMC->Gsatt("FTUB","SEEN",-1); // all FTUB sub-levels skipped -
1364 gMC->Gsatt("FTLN","SEEN", 0);
1365 gMC->Gsatt("FLTN","SEEN", 0);
1366 gMC->Gsatt("FCBL","SEEN", 0);
1367 gMC->Gsatt("FSAW","SEEN", 0);
1368 gMC->Gsatt("FCOV","SEEN", 0);
1369 if (fTOFHoles) gMC->Gsatt("FCBB","SEEN", 0);
1370
1371 // Level 2 of FTUB
1372 gMC->Gsatt("FITU","SEEN", 0);
1373
1374 // Level 2 of FSTR
1375 gMC->Gsatt("FHON","SEEN", 1);
1376 gMC->Gsatt("FPC1","SEEN", 1);
1377 gMC->Gsatt("FPC2","SEEN", 1);
1378 gMC->Gsatt("FPCB","SEEN", 1);
1379 gMC->Gsatt("FRGL","SEEN", 1);
1380 gMC->Gsatt("FGLF","SEEN", 1);
1381
1382 // Level 2 of FPCB => Level 3 of FSTR
1383 gMC->Gsatt("FSEN","SEEN", 0);
1384 gMC->Gsatt("FSEZ","SEEN", 0);
1385 gMC->Gsatt("FPAD","SEEN", 1);
1386
1387 gMC->Gdopt("hide","on");
1388 gMC->Gdopt("shad","on");
1389 gMC->Gsatt("*", "fill", 5);
1390 gMC->SetClipBox(".");
1391 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
1392 gMC->DefaultRange();
1393 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .018, .018);
1394 gMC->Gdhead(1111,"TOF Strips");
1395 gMC->Gdman(18, 3, "MAN");
1396 gMC->Gdopt("hide","off");
1397}
1398
1399//_____________________________________________________________________________
1400void AliTOFv6T0::CreateMaterials()
1401{
1402 //
1403 // Define materials for the Time Of Flight
1404 //
1405
1406 //AliTOF::CreateMaterials();
1407
1408 AliMagF *magneticField = (AliMagF*)gAlice->Field();
1409
1410 Int_t isxfld = magneticField->Integ();
1411 Float_t sxmgmx = magneticField->Max();
1412
1413 Float_t we[7], na[7];
1414
1415 //--- Quartz (SiO2) to simulate float glass
1416 // density tuned to have correct float glass
1417 // radiation length
1418 Float_t aq[2] = { 28.09,16. };
1419 Float_t zq[2] = { 14.,8. };
1420 Float_t wq[2] = { 1.,2. };
1421 //Float_t dq = 2.55; // std value: 2.2
1422 Float_t dq = 2.7; // (+5.9%)
1423 Int_t nq = -2;
1424
1425 // --- Nomex
1426 Float_t anox[4] = {12.01,1.01,16.00,14.01};
1427 Float_t znox[4] = { 6., 1., 8., 7.};
1428 Float_t wnox[4] = {14., 22., 2., 2.};
1429 //Float_t dnox = 0.048; //old value
1430 Float_t dnox = 0.22; // (x 4.6)
1431 Int_t nnox = -4;
1432
1433 // --- glass+freon { Si, O, C, F, H, S }
1434 Float_t agfr[6]= {28.09,16.00,12.01,19.00,1.01,32.065};
1435 Float_t zgfr[6]= {14., 8., 6., 9., 1., 16.};
1436 Float_t wgfr[6]= {0.465, 0.530, 0.000484, 0.00383, 4.0e-05, 0.000646};
1437 Int_t ngfr = 6;
1438 AliDebug(1,Form("wgfr: %d %d %d %d %d %d", wgfr[0], wgfr[1], wgfr[2], wgfr[3], wgfr[4], wgfr[5]));
1439 //Float_t dgfr = 1.35; // + FISHLINE (old value)
1440 Float_t dgfr = 1.6; // + FISHLINE(+18.5 %)
1441
1442 // --- G10 {Si, O, C, H, O}
1443 Float_t ag10[5] = {28.09,16.00,12.01,1.01,16.00};
1444 Float_t zg10[5] = {14., 8., 6., 1., 8.};
1445 Float_t wmatg10[5];
1446 Int_t nlmatg10 = 5;
1447 na[0]= 1. , na[1]= 2. , na[2]= 0. , na[3]= 0. , na[4]= 0.;
1448 MaterialMixer(we,ag10,na,5);
1449 wmatg10[0]= we[0]*0.6;
1450 wmatg10[1]= we[1]*0.6;
1451 na[0]= 0. , na[1]= 0. , na[2]= 14. , na[3]= 20. , na[4]= 3.;
1452 MaterialMixer(we,ag10,na,5);
1453 wmatg10[2]= we[2]*0.4;
1454 wmatg10[3]= we[3]*0.4;
1455 wmatg10[4]= we[4]*0.4;
1456 AliDebug(1,Form("wg10 %d %d %d %d %d", wmatg10[0], wmatg10[1], wmatg10[2], wmatg10[3], wmatg10[4]));
1457 // Float_t densg10 = 1.7; //old value
e41ca6a9 1458 Float_t densg10 = 2.0; // (+17.8%)
dfef1a15 1459
1460 // -- Water
1461 Float_t awa[2] = { 1., 16. };
1462 Float_t zwa[2] = { 1., 8. };
1463 Float_t wwa[2] = { 2., 1. };
1464 Float_t dwa = 1.0;
1465 Int_t nwa = -2;
1466
1467 // AIR
1468 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1469 Float_t zAir[4]={6.,7.,8.,18.};
1470 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1471 Float_t dAir = 1.20479E-3;
1472
1473 // --- fibre glass
1474 Float_t afg[4] = {28.09,16.00,12.01,1.01};
1475 Float_t zfg[4] = {14., 8., 6., 1.};
1476 Float_t wfg[4] = {0.12906,0.29405,0.51502,0.06187};
1477 //Float_t dfg = 1.111;
1478 Float_t dfg = 2.; // (+1.8%)
1479 Int_t nfg = 4;
1480
1481 // --- Freon C2F4H2 + SF6
1482 Float_t afre[4]= {12.01,1.01,19.00,32.07};
1483 Float_t zfre[4]= { 6., 1., 9., 16.};
1484 Float_t wfre[4]= {0.21250,0.01787,0.74827,0.021355};
1485 Float_t densfre= 0.00375;
1486 Int_t nfre = 4;
1487
1488 // --- Al + Cu + G10 {Al, Cu, Si, O, C, H, O}
9f8488c2 1489 Float_t acar[10]= {26.98,
1490 /*63.55,*/
1491 ag10[0], ag10[1], ag10[2], ag10[3], ag10[4],
1492 aAir[0], aAir[1], aAir[2], aAir[3]};
1493 Float_t zcar[10]= {13.,
1494 /*29.,*/
1495 zg10[0], zg10[1], zg10[2], zg10[3], zg10[4],
1496 zAir[0], zAir[1], zAir[2], zAir[3]};
1497 Float_t wcar[10];
1498 wcar[0]= 0.4732;//0.7;
1499 //wcar[1]= 0.04;//0.05;
1500 wcar[1]= 0.2854*wmatg10[0];//0.25*wmatg10[0];
1501 wcar[2]= 0.2854*wmatg10[1];//0.25*wmatg10[1];
1502 wcar[3]= 0.2854*wmatg10[2];//0.25*wmatg10[2];
1503 wcar[4]= 0.2854*wmatg10[3];//0.25*wmatg10[3];
1504 wcar[5]= 0.2854*wmatg10[4];//0.25*wmatg10[4];
1505 wcar[6]= 0.2414*wAir[0];
1506 wcar[7]= 0.2414*wAir[1];
1507 wcar[8]= 0.2414*wAir[2];
1508 wcar[9]= 0.2414*wAir[3];
1509
1510 AliDebug(1,Form("wcar %f %f %f %f %f %f %f %f %f %f", wcar[0], wcar[1], wcar[2], wcar[3], wcar[4],
1511 wcar[5], wcar[6], wcar[7], wcar[8], wcar[9]));
1512 Float_t dcar = 1.85;//1.9;
dfef1a15 1513
1514 // --- Cables, tubes {Al, Cu} ---
1515 Float_t acbt[2]= {26.98,63.55};
1516 Float_t zcbt[2]= {13., 29.};
1517 //Float_t wcbt[2]= {0.541,0.459};
1518 Float_t wcbt[2]= {0.407,0.593};
1519 //Float_t decbt = 0.95;
1520 Float_t decbt = 0.68;
1521
1522 // --- Cable {Al, Cu}
1523 Float_t wcb[2] = {0.165,0.835};
1524 Float_t decb = 0.962;
1525
1526 // --- Honeycomb layer {Al, Cu}
1527 Float_t whon[2]= {0.9,0.1};
1528 //Float_t dhon = 0.44;
1529 Float_t dhon = 1.095; // (x 2.56)
1530
1531 // --- Crates boxes {Al, Cu, Fe, Cr, Ni}
1532 Float_t acra[5]= {26.98,63.55,55.845,52.00,58.69};
1533 Float_t zcra[5]= {13., 29., 26., 24., 28.};
1534 Float_t wcra[5]= {0.7,0.2,0.07,0.018,0.012};
1535 Float_t dcra = 0.77;
1536
1537 AliMixture ( 0, "Air$", aAir, zAir, dAir, 4, wAir);
1538 AliMixture ( 1, "Nomex$", anox, znox, dnox, nnox, wnox);
1539 AliMixture ( 2, "G10$", ag10, zg10, densg10, nlmatg10, wmatg10);
1540 AliMixture ( 3, "fibre glass$", afg, zfg, dfg, nfg, wfg);
1541 AliMaterial( 4, "Al $", 26.98, 13., 2.7, 8.9, 37.2);
1542 AliMixture ( 5, "Al+Cu honeycomb$", acbt, zcbt, dhon, 2, whon);
1543 AliMixture ( 6, "Freon$", afre, zfre, densfre, nfre, wfre);
1544 AliMixture ( 7, "Glass$", aq, zq, dq, nq, wq);
1545 AliMixture ( 8, "glass-freon$", agfr, zgfr, dgfr, ngfr, wgfr);
1546 AliMixture ( 9, "Water$", awa, zwa, dwa, nwa, wwa);
1547 AliMixture (10, "Al+Cu$", acbt, zcbt, decbt, 2, wcbt);
9f8488c2 1548 AliMaterial(11, "Cu $", 63.54, 29., 8.96, 1.43, 10.);
dfef1a15 1549 AliMixture (12, "Al+Cu (cable)$", acbt, zcbt, decb, 2, wcb);
9f8488c2 1550 AliMixture (13, "Al+Cu+G10$", acar, zcar, dcar, 10/*7*/, wcar);
dfef1a15 1551 AliMixture (14, "Al+Cu+steel$", acra, zcra, dcra, 5, wcra);
9f8488c2 1552 AliMaterial(15, "Cu_sensitive$", 63.54, 29., 3.392, 1.43, 10.);
dfef1a15 1553
1554 Float_t epsil, stmin, deemax, stemax;
1555
1556 // STD data
1557 // EPSIL = 0.1 ! Tracking precision,
1558 // STEMAX = 0.1 ! Maximum displacement for multiple scattering
1559 // DEEMAX = 0.1 ! Maximum fractional energy loss, DLS
1560 // STMIN = 0.1
1561
1562 // TOF data
1563 epsil = .001; // Tracking precision,
1564 stemax = -1.; // Maximum displacement for multiple scattering
1565 deemax = -.3; // Maximum fractional energy loss, DLS
1566 stmin = -.8;
1567
1568 AliMedium( 1, "Air$", 0, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1569 AliMedium( 2,"Nomex$", 1, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1570 AliMedium( 3,"G10$", 2, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1571 AliMedium( 4,"fibre glass$", 3, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1572 AliMedium( 5,"glass-freon$", 8, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1573 AliMedium( 6,"Al Frame$", 4, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1574 AliMedium( 7,"honeycomb$", 5, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1575 AliMedium( 8,"Fre$", 6, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
9f8488c2 1576 AliMedium( 9,"Cu-S$", 15, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
dfef1a15 1577 AliMedium(10,"Glass$", 7, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1578 AliMedium(11,"Water$", 9, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1579 AliMedium(12,"Cable$", 12, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1580 AliMedium(13,"Al+Cables$", 10, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1581 AliMedium(14,"Copper$", 11, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1582 AliMedium(15,"Cards$", 13, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1583 AliMedium(16,"Crates$", 14, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1584
1585}
1586//_____________________________________________________________________________
1587void AliTOFv6T0::Init()
1588{
1589 //
1590 // Initialise the detector after the geometry has been defined
1591 //
1592 AliDebug(1, "**************************************"
1593 " TOF "
1594 "**************************************");
1595 AliDebug(1, " Version 4 of TOF initialing, "
1596 "symmetric TOF - Full Coverage version");
1597
1598 AliTOF::Init();
1599
1600 fIdFTOA = gMC->VolId("FTOA");
1601 if (fTOFHoles) {
1602 fIdFTOB = gMC->VolId("FTOB");
1603 fIdFTOC = gMC->VolId("FTOC");
1604 }
1605 fIdFLTA = gMC->VolId("FLTA");
1606 if (fTOFHoles) {
1607 fIdFLTB = gMC->VolId("FLTB");
1608 fIdFLTC = gMC->VolId("FLTC");
1609 }
1610
1611 AliDebug(1, "**************************************"
1612 " TOF "
1613 "**************************************");
1614}
1615
1616//_____________________________________________________________________________
1617void AliTOFv6T0::StepManager()
1618{
1619
1620 //
1621 // Procedure called at each step in the Time Of Flight
1622 //
1623
1624 TLorentzVector mom, pos;
1625 Float_t xm[3],pm[3],xpad[3],ppad[3];
1626 Float_t hits[14];
1627 Int_t vol[5];
1628 Int_t sector, plate, padx, padz, strip;
1629 Int_t copy, padzid, padxid, stripid, i;
1630 Int_t *idtmed = fIdtmed->GetArray()-499;
1631 Float_t incidenceAngle;
1632
1633 const char* volpath;
1634
1635 Int_t index = 0;
1636
1637 if(
1638 gMC->IsTrackEntering()
1639 && gMC->TrackCharge()
1640 //&& gMC->GetMedium()==idtmed[508]
1641 && gMC->CurrentMedium()==idtmed[508]
1642 && gMC->CurrentVolID(copy)==fIdSens
1643 )
1644 {
1645
1646 AliMC *mcApplication = (AliMC*)gAlice->GetMCApp();
1647
1648 AddTrackReference(mcApplication->GetCurrentTrackNumber());
1649 //AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
1650
1651 // getting information about hit volumes
1652
1653 padzid=gMC->CurrentVolOffID(1,copy);
1654 padz=copy;
1655 padz--;
1656
1657 padxid=gMC->CurrentVolOffID(0,copy);
1658 padx=copy;
1659 padx--;
1660
1661 stripid=gMC->CurrentVolOffID(4,copy);
1662 strip=copy;
1663 strip--;
1664
1665 gMC->TrackPosition(pos);
1666 gMC->TrackMomentum(mom);
1667
1668 Double_t normMom=1./mom.Rho();
1669
1670 // getting the coordinates in pad ref system
1671
1672 xm[0] = (Float_t)pos.X();
1673 xm[1] = (Float_t)pos.Y();
1674 xm[2] = (Float_t)pos.Z();
1675
1676 pm[0] = (Float_t)mom.X()*normMom;
1677 pm[1] = (Float_t)mom.Y()*normMom;
1678 pm[2] = (Float_t)mom.Z()*normMom;
1679
1680 gMC->Gmtod(xm,xpad,1); // from MRS to DRS: coordinates convertion
1681 gMC->Gmtod(pm,ppad,2); // from MRS to DRS: direction cosinus convertion
1682
1683
1684 if (TMath::Abs(ppad[1])>1) {
1685 AliWarning("Abs(ppad) > 1");
1686 ppad[1]=TMath::Sign((Float_t)1,ppad[1]);
1687 }
1688 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
1689
1690 plate = -1;
1691 if (strip < fTOFGeometry->NStripC()) {
1692 plate = 0;
1693 //strip = strip;
1694 }
1695 else if (strip >= fTOFGeometry->NStripC() &&
1696 strip < fTOFGeometry->NStripC() + fTOFGeometry->NStripB()) {
1697 plate = 1;
1698 strip = strip - fTOFGeometry->NStripC();
1699 }
1700 else if (strip >= fTOFGeometry->NStripC() + fTOFGeometry->NStripB() &&
1701 strip < fTOFGeometry->NStripC() + fTOFGeometry->NStripB() + fTOFGeometry->NStripA()) {
1702 plate = 2;
1703 strip = strip - fTOFGeometry->NStripC() - fTOFGeometry->NStripB();
1704 }
1705 else if (strip >= fTOFGeometry->NStripC() + fTOFGeometry->NStripB() + fTOFGeometry->NStripA() &&
1706 strip < fTOFGeometry->NStripC() + fTOFGeometry->NStripB() + fTOFGeometry->NStripA() + fTOFGeometry->NStripB()) {
1707 plate = 3;
1708 strip = strip - fTOFGeometry->NStripC() - fTOFGeometry->NStripB() - fTOFGeometry->NStripA();
1709 }
1710 else {
1711 plate = 4;
1712 strip = strip - fTOFGeometry->NStripC() - fTOFGeometry->NStripB() - fTOFGeometry->NStripA() - fTOFGeometry->NStripB();
1713 }
1714
1715 volpath=gMC->CurrentVolOffName(7);
1716 index=atoi(&volpath[4]);
1717 sector=-1;
1718 sector=index;
1719
1720 //Old 6h convention
1721 // if(index<5){
1722 // sector=index+13;
1723 // }
1724 // else{
1725 // sector=index-5;
1726 // }
1727
1728 for(i=0;i<3;++i) {
1729 hits[i] = pos[i];
1730 hits[i+3] = pm[i];
1731 }
1732
1733 hits[6] = mom.Rho();
1734 hits[7] = pos[3];
1735 hits[8] = xpad[0];
1736 hits[9] = xpad[1];
1737 hits[10]= xpad[2];
1738 hits[11]= incidenceAngle;
1739 hits[12]= gMC->Edep();
1740 hits[13]= gMC->TrackLength();
1741
1742 vol[0]= sector;
1743 vol[1]= plate;
1744 vol[2]= strip;
1745 vol[3]= padx;
1746 vol[4]= padz;
1747
1748 AddT0Hit(mcApplication->GetCurrentTrackNumber(),vol, hits);
1749 //AddT0Hit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
1750 }
1751}
1752//-------------------------------------------------------------------
1753void AliTOFv6T0::MaterialMixer(Float_t* p,Float_t* a,Float_t* m,Int_t n) const
1754{
1755 // a[] atomic weights vector (in)
1756 // (atoms present in more compound appear separately)
1757 // m[] number of corresponding atoms in the compound (in)
1758 Float_t t = 0.;
1759 for (Int_t i = 0; i < n; ++i) {
1760 p[i] = a[i]*m[i];
1761 t += p[i];
1762 }
1763 for (Int_t i = 0; i < n; ++i) {
1764 p[i] = p[i]/t;
1765 //AliDebug(1,Form((\n weight[%i] = %f (,i,p[i]));
1766 }
1767}