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