1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.20 2007/10/03 18:07:22 arcelli
19 right handling of l2t matrices and alignable entries in case of TOF holes (Annalisa)
21 Revision 1.19 2007/10/03 10:41:12 arcelli
22 adding tracking-to-local matrices for new AliTOFcluster
24 Revision 1.18 2007/07/27 08:14:48 morsch
25 Write all track references into the same branch.
27 Revision 1.17 2007/05/14 14:41:13 decaro
28 Fix a bug in FTOA volume positionig inside BTOF13,14,15,16,17 in case of holes in 11th and 12th sectors
30 Revision 1.16 2007/05/04 12:59:26 arcelli
31 Change the TOF SM paths for misalignment (one layer up)
33 Revision 1.15 2007/02/19 15:41:55 decaro
34 Coding convention: few corrections
36 Revision 1.14 2006/10/17 15:33:14 arcelli
37 Moving some printout from Info to Debug level
39 Revision 1.13 2006/10/12 16:35:43 arcelli
40 definition of the alignable volumes symbolic names added
42 Revision 1.12 2006/08/22 13:34:46 arcelli
43 removal of effective c++ warnings (C.Zampolli)
45 Revision 1.11 2006/07/12 16:03:44 arcelli
46 updates to match the new numbering of the TOF/TRD mother volumes in FRAME (ALICE convention)
48 Revision 1.10 2006/05/10 18:40:17 hristov
49 Larger strings for the names
51 Revision 1.9 2006/05/04 19:41:42 hristov
52 Possibility for partial TOF geometry (S.Arcelli)
54 Revision 1.8 2006/04/20 22:30:50 hristov
55 Coding conventions (Annalisa)
57 Revision 1.7 2006/04/16 22:29:05 hristov
58 Coding conventions (Annalisa)
60 Revision 1.6 2006/03/20 08:20:35 decaro
61 Al layer: positioning correction
63 Revision 1.5 2006/03/20 07:54:20 decaro
64 Correction of some layer thickness
66 Revision 1.4 2006/03/13 12:35:44 decaro
67 Suppression of fractional Z warning
69 Revision 1.3 2006/02/28 10:38:00 decaro
70 AliTOFGeometry::fAngles, AliTOFGeometry::fHeights,
71 AliTOFGeometry::fDistances arrays: dimension definition in the right
74 Revision 1.2 2006/02/27 18:12:14 decaro
75 Remove in StepManager the dependence of hit indexes from parametrized
78 Revision 1.1 2005/12/15 08:55:33 decaro
79 New TOF geometry description (V5) -G. Cara Romeo and A. De Caro
82 Revision 0.1 2004 November G. Cara Romeo and A. De Caro
83 Implement new TOF geometry version
85 suppress few volume overlaps
86 (in the 4th TOF geometry version),
87 insert the realistic strip numbers and positions
91 ///////////////////////////////////////////////////////////////////////////////
93 // This class contains the functions for version 5 of the Time Of Flight //
96 // VERSION WITH 5 MODULES AND TILTED STRIPS //
98 // FULL COVERAGE VERSION + OPTION for PHOS holes //
103 <img src="picts/AliTOFv5T0Class.gif"> //
107 ///////////////////////////////////////////////////////////////////////////////
110 #include "TGeometry.h"
111 #include "TLorentzVector.h"
113 #include "TVirtualMC.h"
114 #include "TGeoManager.h"
115 #include <TGeoMatrix.h>
116 #include <TGeoPhysicalNode.h>
117 #include <TGeoVolume.h>
119 #include "AliConst.h"
124 #include "AliTrackReference.h"
126 #include "AliTOFGeometry.h"
127 #include "AliTOFv5T0.h"
129 extern TDirectory *gDirectory;
130 extern TVirtualMC *gMC;
131 extern TGeoManager *gGeoManager;
133 extern AliRun *gAlice;
137 //_____________________________________________________________________________
138 AliTOFv5T0::AliTOFv5T0():
148 // Default constructor
152 //_____________________________________________________________________________
153 AliTOFv5T0::AliTOFv5T0(const char *name, const char *title):
154 AliTOF(name,title,"tzero"),
164 // Standard constructor
167 // Check that FRAME is there otherwise we have no place where to
171 AliModule* frame = (AliModule*)gAlice->GetModule("FRAME");
173 AliFatal("TOF needs FRAME to be present");
176 if (fTOFGeometry) delete fTOFGeometry;
177 fTOFGeometry = new AliTOFGeometry();
179 if(frame->IsVersion()==1) {
180 AliDebug(1,Form("Frame version %d", frame->IsVersion()));
181 AliDebug(1,"Full Coverage for TOF");
184 AliDebug(1,Form("Frame version %d", frame->IsVersion()));
185 AliDebug(1,"TOF with Holes for PHOS");
188 fTOFGeometry->SetHoles(fTOFHoles);
190 //AliTOF::fTOFGeometry = fTOFGeometry;
193 TDirectory* saveDir = gDirectory;
194 gAlice->GetRunLoader()->CdGAFile();
195 fTOFGeometry->Write("TOFgeometry");
200 //_____________________________________________________________________________
201 void AliTOFv5T0::AddAlignableVolumes() const
204 // Create entries for alignable volumes associating the symbolic volume
205 // name with the corresponding volume path. Needs to be syncronized with
206 // eventual changes in the geometry.
212 TString vpL0 = "ALIC_1/B077_1/BSEGMO";
213 TString vpL1 = "_1/BTOF";
215 TString vpL3 = "/FTOA_0";
216 TString vpL4 = "/FLTA_0/FSTR_";
218 TString snSM = "TOF/sm";
219 TString snSTRIP = "/strip";
221 Int_t nSectors=fTOFGeometry->NSectors();
222 Int_t nStrips =fTOFGeometry->NStripA()+
223 2*fTOFGeometry->NStripB()+
224 2*fTOFGeometry->NStripC();
227 // The TOF MRPC Strips
228 // The symbolic names are: TOF/sm00/strip01
234 for (Int_t isect = 0; isect < nSectors; isect++) {
235 for (Int_t istr = 1; istr <= nStrips; istr++) {
237 if (fTOFHoles && (isect==11 || isect==12)) {
240 vpL4 = "/FLTB_0/FSTR_";
244 vpL4 = "/FLTC_0/FSTR_";
250 vpL4 = "/FLTA_0/FSTR_";
264 symName += Form("%02d",isect);
266 symName += Form("%02d",istr);
268 AliDebug(2,"--------------------------------------------");
269 AliDebug(2,Form("Alignable object %d", imod));
270 AliDebug(2,Form("volPath=%s\n",volPath.Data()));
271 AliDebug(2,Form("symName=%s\n",symName.Data()));
272 AliDebug(2,"--------------------------------------------");
274 gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
276 //T2L matrices for alignment
277 TGeoPNEntry *e = gGeoManager->GetAlignableEntry(symName.Data());
279 const char *path = e->GetTitle();
280 if (!gGeoManager->cd(path)) {
281 AliFatal(Form("Volume path %s not valid!",path));
283 TGeoHMatrix *globMatrix = gGeoManager->GetCurrentMatrix();
284 Double_t phi = 20.0 * (isect % 18) + 10.0;
285 TGeoHMatrix *t2l = new TGeoHMatrix();
287 t2l->MultiplyLeft(&(globMatrix->Inverse()));
291 AliError(Form("Alignable entry %s is not valid!",symName.Data()));
299 // The TOF supermodules
300 // The symbolic names are: TOF/sm00
304 for (Int_t isect = 0; isect < nSectors; isect++) {
313 symName += Form("%02d",isect);
315 AliDebug(2,"--------------------------------------------");
316 AliDebug(2,Form("Alignable object %d", isect+imod));
317 AliDebug(2,Form("volPath=%s\n",volPath.Data()));
318 AliDebug(2,Form("symName=%s\n",symName.Data()));
319 AliDebug(2,"--------------------------------------------");
321 gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
326 //____________________________________________________________________________
327 void AliTOFv5T0::BuildGeometry()
330 // Build TOF ROOT geometry for the ALICE event display
333 const int kColorTOF = 27;
335 TGeometry *globalGeometry = (TGeometry*)gAlice->GetGeometry();
338 top = globalGeometry->GetNode("alice");
340 // Position the different copies
341 const Float_t krTof =(fTOFGeometry->Rmax()+fTOFGeometry->Rmin())/2.;
342 const Float_t khTof = fTOFGeometry->Rmax()-fTOFGeometry->Rmin();
343 const Int_t kNTof = fTOFGeometry->NSectors();
344 const Float_t kangle = k2PI/kNTof;
346 const Float_t kInterCentrModBorder1 = 49.5;
347 const Float_t kInterCentrModBorder2 = 57.5;
351 // define offset for nodes
352 Float_t zOffsetB = (fTOFGeometry->ZlenA()*0.5 + (kInterCentrModBorder1+kInterCentrModBorder2)*0.5)*0.5;
353 Float_t zOffsetA = 0.;
354 // Define TOF basic volume
356 char nodeName0[16], nodeName1[16], nodeName2[16];
357 char nodeName3[16], nodeName4[16], rotMatNum[16];
360 new TBRIK("S_TOF_B","TOF box","void",
361 fTOFGeometry->StripLength()*0.5, khTof*0.5, fTOFGeometry->ZlenB()*0.5);
362 new TBRIK("S_TOF_C","TOF box","void",
363 fTOFGeometry->StripLength()*0.5, khTof*0.5, fTOFGeometry->ZlenB()*0.5);
365 new TBRIK("S_TOF_A","TOF box","void",
366 fTOFGeometry->StripLength()*0.5, khTof*0.5, fTOFGeometry->ZlenA()*0.5);
368 for (Int_t nodeNum=1;nodeNum<19;nodeNum++){
371 sprintf(rotMatNum,"rot50%i",nodeNum);
372 sprintf(nodeName0,"FTO00%i",nodeNum);
373 sprintf(nodeName1,"FTO10%i",nodeNum);
374 sprintf(nodeName2,"FTO20%i",nodeNum);
375 sprintf(nodeName3,"FTO30%i",nodeNum);
376 sprintf(nodeName4,"FTO40%i",nodeNum);
379 sprintf(rotMatNum,"rot5%i",nodeNum);
380 sprintf(nodeName0,"FTO0%i",nodeNum);
381 sprintf(nodeName1,"FTO1%i",nodeNum);
382 sprintf(nodeName2,"FTO2%i",nodeNum);
383 sprintf(nodeName3,"FTO3%i",nodeNum);
384 sprintf(nodeName4,"FTO4%i",nodeNum);
387 new TRotMatrix(rotMatNum,rotMatNum,90,-20*nodeNum,90,90-20*nodeNum,0,0);
388 ang = (4.5-nodeNum) * kangle;
392 node = new TNode(nodeName2,nodeName2,"S_TOF_B", krTof*TMath::Cos(ang), krTof*TMath::Sin(ang), zOffsetB,rotMatNum);
393 node->SetLineColor(kColorTOF);
397 node = new TNode(nodeName3,nodeName3,"S_TOF_C", krTof*TMath::Cos(ang), krTof*TMath::Sin(ang),-zOffsetB,rotMatNum);
398 node->SetLineColor(kColorTOF);
403 node = new TNode(nodeName4,nodeName4,"S_TOF_A", krTof*TMath::Cos(ang), krTof*TMath::Sin(ang), zOffsetA,rotMatNum);
404 node->SetLineColor(kColorTOF);
406 } // end loop on nodeNum
410 //_____________________________________________________________________________
411 void AliTOFv5T0::CreateGeometry()
414 // Create geometry for Time Of Flight version 0
418 <img src="picts/AliTOFv5T0.gif">
422 // Creates common geometry
424 AliTOF::CreateGeometry();
428 //_____________________________________________________________________________
429 void AliTOFv5T0::TOFpc(Float_t xtof, Float_t ytof, Float_t zlenA,
433 // Definition of the Time Of Fligh Resistive Plate Chambers
436 const Float_t kPi = TMath::Pi();
438 const Float_t kInterCentrModBorder1 = 49.5;
439 const Float_t kInterCentrModBorder2 = 57.5;
440 const Float_t kExterInterModBorder1 = 196.0;
441 const Float_t kExterInterModBorder2 = 203.5;
443 const Float_t kLengthExInModBorder = 4.7;
444 const Float_t kLengthInCeModBorder = 7.0;
446 // Al layers over all internal module walls (cm)
447 const Float_t khAlWall = 0.03;
449 // module wall thickness (cm)
450 const Float_t kModuleWallThickness = 0.3;
452 // Al honeycomb layer between strips and cards (cm)
453 const Float_t kHoneycombLayerThickness = 1.5;
455 AliDebug(2,Form("zlenA*0.5 = %d", zlenA*0.5));
456 AliDebug(1, "************************* TOF geometry **************************");
458 // Definition of the Time Of Fligh Resistive Plate Chambers
459 // xFLT, yFLT, zFLT - sizes of TOF modules (large)
461 Float_t xcoor, ycoor, zcoor;
463 Int_t *idtmed = fIdtmed->GetArray()-499;
468 par[2] = zlenA * 0.5;
469 gMC->Gsvolu("FTOA", "BOX ", idtmed[503], par, 3); // fibre glass
474 par[2] = (zlenA*0.5 - kInterCentrModBorder1)*0.5;
475 gMC->Gsvolu("FTOB", "BOX ", idtmed[503], par, 3); // fibre glass
476 gMC->Gsvolu("FTOC", "BOX ", idtmed[503], par, 3); // fibre glass
479 // Positioning of fibre glass modules (FTOA, FTOB and FTOC)
481 //AliMatrix(idrotm[0], 90., 0., 0., 0., 90.,-90.);
482 AliMatrix(idrotm[0], 90., 0., 0., 0., 90.,270.);
487 for(Int_t isec=0;isec<18;isec++){
488 if(fTOFSectors[isec]==-1)continue;
490 sprintf(name, "BTOF%d",isec);
491 if (fTOFHoles && (isec==11||isec==12)) {
492 // if (fTOFHoles && (isec==16||isec==17)) { \\Old 6h convention
494 ycoor = (zlenA*0.5 + kInterCentrModBorder1)*0.5;
496 gMC->Gspos("FTOB", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
497 gMC->Gspos("FTOC", 0, name, xcoor,-ycoor, zcoor, idrotm[0], "ONLY");
503 gMC->Gspos("FTOA", 0,name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
507 // Large not sensitive volumes with Insensitive Freon (FLTA, FLTB and FLTC)
509 Float_t xFLT, yFLT, zFLTA;
511 xFLT = xtof - kModuleWallThickness*2.;
512 yFLT = ytof - kModuleWallThickness*2.;
513 zFLTA = zlenA - kModuleWallThickness*2.;
518 gMC->Gsvolu("FLTA", "BOX ", idtmed[507], par, 3); // Freon mix
523 gMC->Gspos ("FLTA", 0, "FTOA", xcoor, ycoor, zcoor, 0, "ONLY");
528 par[2] = (zlenA*0.5 - kInterCentrModBorder1-kModuleWallThickness)*0.5;
529 gMC->Gsvolu("FLTB", "BOX ", idtmed[507], par, 3); // Freon mix
530 gMC->Gsvolu("FLTC", "BOX ", idtmed[507], par, 3); // Freon mix
534 zcoor = kModuleWallThickness*0.5;
535 gMC->Gspos ("FLTB", 0, "FTOB", xcoor, ycoor, zcoor, 0, "ONLY");
536 gMC->Gspos ("FLTC", 0, "FTOC", xcoor, ycoor,-zcoor, 0, "ONLY");
539 // Layer of Aluminum before detector (FALA, FALB and FALC)
542 par[1] = khAlWall*0.5;
543 par[2] = kInterCentrModBorder1 - (kModuleWallThickness + khAlWall);
544 gMC->Gsvolu("FALA", "BOX ", idtmed[505], par, 3); // Alluminium
547 ycoor = (-yFLT + khAlWall)*0.5;
549 gMC->Gspos ("FALA", 0, "FLTA", xcoor, ycoor, zcoor, 0, "ONLY");
552 par[1] = khAlWall*0.5;
553 par[2] = (kExterInterModBorder2 - kInterCentrModBorder1 - 2.*(kModuleWallThickness + khAlWall))*0.5;
554 gMC->Gsvolu("FALB", "BOX ", idtmed[505], par, 3); // Alluminium
557 ycoor = (-yFLT + khAlWall)*0.5;
558 zcoor = (kExterInterModBorder2 + kInterCentrModBorder1)*0.5;
559 gMC->Gspos ("FALB", 1, "FLTA", xcoor, ycoor, zcoor, 0, "ONLY");
560 gMC->Gspos ("FALB", 2, "FLTA", xcoor, ycoor,-zcoor, 0, "ONLY");
563 par[1] = khAlWall*0.5;
564 par[2] = (zlenA*0.5 - kExterInterModBorder2 - 2.*(kModuleWallThickness + khAlWall))*0.5;
565 gMC->Gsvolu("FALC", "BOX ", idtmed[505], par, 3); // Alluminium
568 ycoor = (-yFLT + khAlWall)*0.5;
569 zcoor = (kExterInterModBorder2+zlenA*0.5)*0.5;
570 gMC->Gspos ("FALC", 1, "FLTA", xcoor, ycoor, zcoor, 0, "ONLY");
571 gMC->Gspos ("FALC", 2, "FLTA", xcoor, ycoor,-zcoor, 0, "ONLY");
575 ycoor = (-yFLT + khAlWall)*0.5;
576 zcoor = (zlenA*0.5 - kExterInterModBorder2)*0.5 - kModuleWallThickness*0.5;
577 gMC->Gspos ("FALB", 1, "FLTB", xcoor, ycoor, zcoor, 0, "ONLY");
578 gMC->Gspos ("FALB", 2, "FLTC", xcoor, ycoor,-zcoor, 0, "ONLY");
581 ycoor = (-yFLT + khAlWall)*0.5;
582 zcoor = (kExterInterModBorder2 - kInterCentrModBorder1)*0.5 + kModuleWallThickness*0.5;
583 gMC->Gspos ("FALC", 1, "FLTB", xcoor, ycoor,-zcoor, 0, "ONLY");
584 gMC->Gspos ("FALC", 2, "FLTC", xcoor, ycoor, zcoor, 0, "ONLY");
587 Float_t y0, alpha, tgal, beta, tgbe, trpa[11];
589 // Fibre glass walls between central and intermediate modules (FWZ1 and FWZ2; holes -> FZ1B, FZ1C, FZ2B)
591 tgal = (yFLT*0.5 - 2.*kLengthInCeModBorder)/(kInterCentrModBorder2 - kInterCentrModBorder1);
592 alpha = TMath::ATan(tgal);
593 beta = (kPi*0.5 - alpha)*0.5;
594 tgbe = TMath::Tan(beta);
598 trpa[3] = kModuleWallThickness;
599 trpa[4] = (kLengthInCeModBorder - kModuleWallThickness*tgbe)*0.5;
600 trpa[5] = (kLengthInCeModBorder + kModuleWallThickness*tgbe)*0.5;
601 trpa[6] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
602 trpa[7] = kModuleWallThickness;
603 trpa[8] = (kLengthInCeModBorder - kModuleWallThickness*tgbe)*0.5;
604 trpa[9] = (kLengthInCeModBorder + kModuleWallThickness*tgbe)*0.5;
605 trpa[10] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
606 gMC->Gsvolu("FWZ1","TRAP", idtmed[503], trpa, 11); // fibre glass
608 AliMatrix (idrotm[1],90., 90.,180.,0.,90.,180.);
609 AliMatrix (idrotm[4],90., 90., 0.,0.,90., 0.);
612 ycoor = -yFLT*0.5 + kLengthInCeModBorder*0.5;
613 zcoor = kInterCentrModBorder1;
614 gMC->Gspos("FWZ1", 1,"FLTA", xcoor, ycoor, zcoor,idrotm[1],"ONLY");
615 gMC->Gspos("FWZ1", 2,"FLTA", xcoor, ycoor,-zcoor,idrotm[4],"ONLY");
618 y0 = kLengthInCeModBorder - kModuleWallThickness*0.5*tgbe;
622 trpa[3] = kModuleWallThickness*0.5;
623 trpa[4] = (y0 - kModuleWallThickness*0.5*tgbe)*0.5;
624 trpa[5] = (y0 + kModuleWallThickness*0.5*tgbe)*0.5;
625 trpa[6] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
626 trpa[7] = kModuleWallThickness*0.5;
627 trpa[8] = (y0 - kModuleWallThickness*0.5*tgbe)*0.5;
628 trpa[9] = (y0 + kModuleWallThickness*0.5*tgbe)*0.5;
629 trpa[10] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
630 gMC->Gsvolu("FZ1B","TRAP", idtmed[503], trpa, 11); // fibre glass
633 ycoor = -yFLT*0.5 + kLengthInCeModBorder*0.5 - kModuleWallThickness*0.25*tgbe;
634 zcoor = -kInterCentrModBorder1 + (zlenA*0.5 + kInterCentrModBorder1)*0.5 - kModuleWallThickness;
635 gMC->Gspos("FZ1B", 1,"FLTB", xcoor, ycoor, zcoor,idrotm[4],"ONLY");
636 gMC->Gspos("FZ1B", 2,"FLTC", xcoor, ycoor,-zcoor,idrotm[1],"ONLY");
639 AliMatrix (idrotm[2],90.,270., 0.,0.,90.,180.);
640 AliMatrix (idrotm[5],90.,270.,180.,0.,90., 0.);
643 ycoor = -kLengthInCeModBorder*0.5;
644 zcoor = kInterCentrModBorder2;
645 gMC->Gspos("FWZ1", 3,"FLTA", xcoor, ycoor, zcoor,idrotm[2],"ONLY");
646 gMC->Gspos("FWZ1", 4,"FLTA", xcoor, ycoor,-zcoor,idrotm[5],"ONLY");
649 y0 = kLengthInCeModBorder + kModuleWallThickness*0.5*tgbe;
653 trpa[3] = kModuleWallThickness*0.5;
654 trpa[4] = (y0 - kModuleWallThickness*0.5*tgbe)*0.5;
655 trpa[5] = (y0 + kModuleWallThickness*0.5*tgbe)*0.5;
656 trpa[6] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
657 trpa[7] = kModuleWallThickness*0.5;
658 trpa[8] = (y0 - kModuleWallThickness*0.5*tgbe)*0.5;
659 trpa[9] = (y0 + kModuleWallThickness*0.5*tgbe)*0.5;
660 trpa[10] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
661 gMC->Gsvolu("FZ1C","TRAP", idtmed[503], trpa, 11); // fibre glass
664 ycoor = -kLengthInCeModBorder*0.5 - kModuleWallThickness*0.25*tgbe;
665 zcoor = -kInterCentrModBorder2 + (zlenA*0.5 + kInterCentrModBorder1)*0.5 - kModuleWallThickness;
666 gMC->Gspos("FZ1C", 1,"FLTB", xcoor, ycoor, zcoor,idrotm[5],"ONLY");
667 gMC->Gspos("FZ1C", 2,"FLTC", xcoor, ycoor,-zcoor,idrotm[2],"ONLY");
670 trpa[0] = 0.5*(kInterCentrModBorder2 - kInterCentrModBorder1)/TMath::Cos(alpha);
671 trpa[1] = kModuleWallThickness;
673 trpa[3] = -beta*kRaddeg;
676 gMC->Gsvolu("FWZ2","PARA", idtmed[503], trpa, 6); // fibre glass
678 AliMatrix (idrotm[3], alpha*kRaddeg,90.,90.+alpha*kRaddeg,90.,90.,180.);
679 AliMatrix (idrotm[6],180.-alpha*kRaddeg,90.,90.-alpha*kRaddeg,90.,90., 0.);
683 zcoor = (kInterCentrModBorder2 + kInterCentrModBorder1)*0.5;
684 gMC->Gspos("FWZ2", 1,"FLTA", xcoor, ycoor, zcoor,idrotm[3],"ONLY");
685 gMC->Gspos("FWZ2", 2,"FLTA", xcoor, ycoor,-zcoor,idrotm[6],"ONLY");
688 trpa[0] = 0.5*(kInterCentrModBorder2 - kInterCentrModBorder1)/TMath::Cos(alpha);
689 trpa[1] = kModuleWallThickness*0.5;
691 trpa[3] = -beta*kRaddeg;
694 gMC->Gsvolu("FZ2B","PARA", idtmed[503], trpa, 6); // fibre glass
697 ycoor = -yFLT*0.25 - kModuleWallThickness*0.5*tgbe;
698 zcoor = -(kInterCentrModBorder2 + kInterCentrModBorder1)*0.5 + (zlenA*0.5 + kInterCentrModBorder1)*0.5 - kModuleWallThickness;
699 gMC->Gspos("FZ2B", 1,"FLTB", xcoor, ycoor, zcoor,idrotm[6],"ONLY");
700 gMC->Gspos("FZ2B", 2,"FLTC", xcoor, ycoor,-zcoor,idrotm[3],"ONLY");
703 // Fibre glass walls between intermediate and lateral modules (FWZ3 and FWZ4)
705 tgal = (yFLT*0.5 - 2.*kLengthExInModBorder)/(kExterInterModBorder2 - kExterInterModBorder1);
706 alpha = TMath::ATan(tgal);
707 beta = (kPi*0.5 - alpha)*0.5;
708 tgbe = TMath::Tan(beta);
712 trpa[3] = kModuleWallThickness;
713 trpa[4] = (kLengthExInModBorder - kModuleWallThickness*tgbe)*0.5;
714 trpa[5] = (kLengthExInModBorder + kModuleWallThickness*tgbe)*0.5;
715 trpa[6] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
716 trpa[7] = kModuleWallThickness;
717 trpa[8] = (kLengthExInModBorder - kModuleWallThickness*tgbe)*0.5;
718 trpa[9] = (kLengthExInModBorder + kModuleWallThickness*tgbe)*0.5;
719 trpa[10] = TMath::ATan(tgbe*0.5)*kRaddeg; //TMath::ATan((trpa[5] - trpa[4])/(2.*trpa[3]))*kRaddeg;
720 gMC->Gsvolu("FWZ3","TRAP", idtmed[503], trpa, 11); // fibre glass
723 ycoor = -kLengthExInModBorder*0.5;
724 zcoor = kExterInterModBorder1;
725 gMC->Gspos("FWZ3", 1,"FLTA", xcoor, ycoor, zcoor,idrotm[5],"ONLY");
726 gMC->Gspos("FWZ3", 2,"FLTA", xcoor, ycoor,-zcoor,idrotm[2],"ONLY");
730 ycoor = -kLengthExInModBorder*0.5;
731 zcoor = -kExterInterModBorder1 + (zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5;
732 gMC->Gspos("FWZ3", 5,"FLTB", xcoor, ycoor, zcoor,idrotm[2],"ONLY");
733 gMC->Gspos("FWZ3", 6,"FLTC", xcoor, ycoor,-zcoor,idrotm[5],"ONLY");
737 ycoor = -yFLT*0.5 + kLengthExInModBorder*0.5;
738 zcoor = kExterInterModBorder2;
739 gMC->Gspos("FWZ3", 3,"FLTA", xcoor, ycoor, zcoor,idrotm[4],"ONLY");
740 gMC->Gspos("FWZ3", 4,"FLTA", xcoor, ycoor,-zcoor,idrotm[1],"ONLY");
744 ycoor = -yFLT*0.5 + kLengthExInModBorder*0.5;
745 zcoor = -kExterInterModBorder2 + (zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5;
746 gMC->Gspos("FWZ3", 7,"FLTB", xcoor, ycoor, zcoor,idrotm[1],"ONLY");
747 gMC->Gspos("FWZ3", 8,"FLTC", xcoor, ycoor,-zcoor,idrotm[4],"ONLY");
750 trpa[0] = 0.5*(kExterInterModBorder2 - kExterInterModBorder1)/TMath::Cos(alpha);
751 trpa[1] = kModuleWallThickness;
753 trpa[3] = -beta*kRaddeg;
756 gMC->Gsvolu("FWZ4","PARA", idtmed[503], trpa, 6); // fibre glass
758 AliMatrix (idrotm[13],alpha*kRaddeg,90.,90.+alpha*kRaddeg,90.,90.,180.);
759 AliMatrix (idrotm[16],180.-alpha*kRaddeg,90.,90.-alpha*kRaddeg,90.,90.,0.);
763 zcoor = (kExterInterModBorder2 + kExterInterModBorder1)*0.5;
764 gMC->Gspos("FWZ4", 1,"FLTA", xcoor, ycoor, zcoor,idrotm[16],"ONLY");
765 gMC->Gspos("FWZ4", 2,"FLTA", xcoor, ycoor,-zcoor,idrotm[13],"ONLY");
770 zcoor = -(kExterInterModBorder2 + kExterInterModBorder1)*0.5 + (zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5;
771 gMC->Gspos("FWZ4", 3,"FLTB", xcoor, ycoor, zcoor,idrotm[13],"ONLY");
772 gMC->Gspos("FWZ4", 4,"FLTC", xcoor, ycoor,-zcoor,idrotm[16],"ONLY");
776 ///////////////// Detector itself //////////////////////
778 const Int_t knx = fTOFGeometry->NpadX(); // number of pads along x
779 const Int_t knz = fTOFGeometry->NpadZ(); // number of pads along z
780 const Float_t kPadX = fTOFGeometry->XPad(); // pad length along x
781 const Float_t kPadZ = fTOFGeometry->ZPad(); // pad length along z
783 // new description for strip volume -double stack strip-
784 // -- all constants are expressed in cm
785 // heigth of different layers
786 const Float_t khhony = 1.0 ; // heigth of HONY Layer
787 const Float_t khpcby = 0.08 ; // heigth of PCB Layer
788 const Float_t khrgly = 0.055 ; // heigth of RED GLASS Layer
790 const Float_t khfiliy = 0.125 ; // heigth of FISHLINE Layer
791 const Float_t khglassy = 0.160*0.5; // heigth of GLASS Layer
792 const Float_t khglfy = khfiliy+2.*khglassy;// heigth of GLASS+FISHLINE Layer
794 const Float_t khcpcby = 0.16 ; // heigth of PCB Central Layer
795 const Float_t kwhonz = 8.1 ; // z dimension of HONEY Layer
796 const Float_t kwpcbz1 = 10.6 ; // z dimension of PCB Lower Layer
797 const Float_t kwpcbz2 = 11.6 ; // z dimension of PCB Upper Layer
798 const Float_t kwcpcbz = 12.4 ; // z dimension of PCB Central Layer
799 const Float_t kwrglz = 8. ; // z dimension of RED GLASS Layer
800 const Float_t kwglfz = 7. ; // z dimension of GLASS+FISHLN Layer
801 const Float_t klsensmx = knx*kPadX; // length of Sensitive Layer
802 const Float_t khsensmy = 0.05;//0.11;//0.16;// heigth of Sensitive Layer
803 const Float_t kwsensmz = knz*kPadZ; // width of Sensitive Layer
805 // heigth of the FSTR Volume (the strip volume)
806 const Float_t khstripy = 2.*khhony+2.*khpcby+4.*khrgly+2.*khglfy+khcpcby;
808 // width of the FSTR Volume (the strip volume)
809 const Float_t kwstripz = kwcpcbz;
810 // length of the FSTR Volume (the strip volume)
811 const Float_t klstripx = fTOFGeometry->StripLength();
813 Float_t parfp[3]={klstripx*0.5,khstripy*0.5,kwstripz*0.5};
814 // Coordinates of the strip center in the strip reference frame;
815 // used for positioning internal strip volumes
816 Float_t posfp[3]={0.,0.,0.};
818 // FSTR volume definition-filling this volume with non sensitive Gas Mixture
819 gMC->Gsvolu("FSTR","BOX",idtmed[507],parfp,3); // Freon mix
821 //-- HONY Layer definition
822 parfp[1] = khhony*0.5;
823 parfp[2] = kwhonz*0.5;
824 gMC->Gsvolu("FHON","BOX",idtmed[501],parfp,3); // honeycomb (Nomex)
825 // positioning 2 HONY Layers on FSTR volume
826 posfp[1] =-khstripy*0.5+parfp[1];
827 gMC->Gspos("FHON",1,"FSTR",0., posfp[1],0.,0,"ONLY");
828 gMC->Gspos("FHON",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
830 //-- PCB Layer definition
831 parfp[1] = khpcby*0.5;
832 parfp[2] = kwpcbz1*0.5;
833 gMC->Gsvolu("FPC1","BOX",idtmed[502],parfp,3); // G10
834 parfp[2] = kwpcbz2*0.5;
835 gMC->Gsvolu("FPC2","BOX",idtmed[502],parfp,3); // G10
836 // positioning 2 PCB Layers on FSTR volume
837 posfp[1] =-khstripy*0.5+khhony+parfp[1];
838 gMC->Gspos("FPC1",1,"FSTR",0.,-posfp[1],0.,0,"ONLY");
839 gMC->Gspos("FPC2",1,"FSTR",0., posfp[1],0.,0,"ONLY");
841 //-- central PCB layer definition
842 parfp[1] = khcpcby*0.5;
843 parfp[2] = kwcpcbz*0.5;
844 gMC->Gsvolu("FPCB","BOX",idtmed[502],parfp,3); // G10
845 // positioning the central PCB layer
846 gMC->Gspos("FPCB",1,"FSTR",0.,0.,0.,0,"ONLY");
849 Float_t parfs[3] = {klsensmx*0.5, khsensmy*0.5, kwsensmz*0.5};
850 gMC->Gsvolu("FSEN","BOX",idtmed[508],parfs,3); // sensitive ...
851 // dividing FSEN along z in knz=2 and along x in knx=48
852 gMC->Gsdvn("FSEZ","FSEN",knz,3);
853 gMC->Gsdvn("FPAD","FSEZ",knx,1);
854 // positioning a Sensitive layer inside FPCB
855 gMC->Gspos("FSEN",1,"FPCB",0.,0.,0.,0,"ONLY");
857 //-- RED GLASS Layer definition
858 parfp[1] = khrgly*0.5;
859 parfp[2] = kwrglz*0.5;
860 gMC->Gsvolu("FRGL","BOX",idtmed[509],parfp,3); // glass
861 // positioning 4 RED GLASS Layers on FSTR volume
862 posfp[1] = -khstripy*0.5+khhony+khpcby+parfp[1];
863 gMC->Gspos("FRGL",1,"FSTR",0., posfp[1],0.,0,"ONLY");
864 gMC->Gspos("FRGL",4,"FSTR",0.,-posfp[1],0.,0,"ONLY");
865 posfp[1] = (khcpcby+khrgly)*0.5;
866 gMC->Gspos("FRGL",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
867 gMC->Gspos("FRGL",3,"FSTR",0., posfp[1],0.,0,"ONLY");
869 //-- GLASS Layer definition
870 parfp[1] = khglassy*0.5;
871 parfp[2] = kwglfz*0.5;
872 gMC->Gsvolu("FGLA","BOX",idtmed[509],parfp,3); // glass
874 // positioning 4 GLASS Layers on FSTR volume
875 posfp[1] = -khstripy*0.5+khhony+khpcby+khrgly+parfp[1];
876 gMC->Gspos("FGLA",1,"FSTR",0.,-posfp[1],0.,0,"ONLY");
877 gMC->Gspos("FGLA",4,"FSTR",0., posfp[1],0.,0,"ONLY");
878 posfp[1] = khcpcby*0.5+khrgly+khglassy*0.5;
879 gMC->Gspos("FGLA",2,"FSTR",0.,-posfp[1],0.,0,"ONLY");
880 gMC->Gspos("FGLA",3,"FSTR",0., posfp[1],0.,0,"ONLY");
882 //-- FREON Layer definition
883 parfp[1] = khfiliy*0.5;
884 gMC->Gsvolu("FFIS","BOX",idtmed[507],parfp,3); // freon
886 // positioning 2 FREON Layers on FSTR volume
887 posfp[1] = -khstripy*0.5+khhony+khpcby+khrgly+khglassy+parfp[1];
888 gMC->Gspos("FFIS",1,"FSTR",0.,-posfp[1],0.,0,"ONLY");
889 gMC->Gspos("FFIS",2,"FSTR",0., posfp[1],0.,0,"ONLY");
892 //-- GLASS+FISHLINE Layer definition
893 parfp[1] = khglfy*0.5;
894 parfp[2] = kwglfz*0.5;
895 gMC->Gsvolu("FGLF","BOX",idtmed[504],parfp,3);
897 // positioning 2 GLASS+FISHLINE Layers on FSTR volume
898 posfp[1] = (khcpcby+khglfy)*0.5+khrgly;
899 gMC->Gspos("FGLF",1,"FSTR",0.,-posfp[1],0.,0,"ONLY");
900 gMC->Gspos("FGLF",2,"FSTR",0., posfp[1],0.,0,"ONLY");
903 // Positioning the Strips (FSTR) in the FLT volumes
904 Int_t maxStripNumbers [5] ={fTOFGeometry->NStripC(),
905 fTOFGeometry->NStripB(),
906 fTOFGeometry->NStripA(),
907 fTOFGeometry->NStripB(),
908 fTOFGeometry->NStripC()};
910 Int_t totalStrip = 0;
911 Float_t xpos, zpos, ypos, ang;
912 for(Int_t iplate =0; iplate < fTOFGeometry->NPlates(); iplate++){
913 if (iplate>0) totalStrip += maxStripNumbers[iplate-1];
914 for(Int_t istrip =0; istrip < maxStripNumbers[iplate]; istrip++){
916 ang = fTOFGeometry->GetAngles(iplate,istrip);
917 AliDebug(1, Form(" iplate = %1i, istrip = %2i ---> ang = %f", iplate, istrip, ang));
919 if (ang>0.) AliMatrix (idrotm[istrip+totalStrip+1],90.,0.,90.+ang,90., ang, 90.);
920 else if (ang==0.) AliMatrix (idrotm[istrip+totalStrip+1],90.,0.,90.,90., 0., 0.);
921 else if (ang<0.) AliMatrix (idrotm[istrip+totalStrip+1],90.,0.,90.+ang,90.,-ang,270.);
924 zpos = fTOFGeometry->GetDistances(iplate,istrip);
925 ypos = fTOFGeometry->GetHeights(iplate,istrip);
927 gMC->Gspos("FSTR",istrip+totalStrip+1,"FLTA", xpos, ypos,-zpos,idrotm[istrip+totalStrip+1], "ONLY");
930 if (istrip+totalStrip+1>53) gMC->Gspos("FSTR",istrip+totalStrip+1,"FLTC", xpos, ypos,-zpos-(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[istrip+totalStrip+1],"ONLY");
931 if (istrip+totalStrip+1<39) gMC->Gspos("FSTR",istrip+totalStrip+1,"FLTB", xpos, ypos,-zpos+(zlenA*0.5 + kInterCentrModBorder1 - kModuleWallThickness)*0.5,idrotm[istrip+totalStrip+1],"ONLY");
936 // 1.5 cm Al honeycomb layer between strips and cards
938 par[1] = kHoneycombLayerThickness*0.5;
940 gMC->Gsvolu("FPEA", "BOX ", idtmed[506], par, 3); // Al honeycomb
943 ycoor = kHoneycombLayerThickness*0.5;
945 gMC->Gspos ("FPEA", 0, "FLTA", xcoor, ycoor, zcoor, 0, "ONLY");
949 par[1] = kHoneycombLayerThickness*0.5;
950 par[2] = (zlenA*0.5 - kInterCentrModBorder2-kModuleWallThickness)*0.5;
951 gMC->Gsvolu("FPEB", "BOX ", idtmed[506], par, 3); // Al honeycomb
954 ycoor = kHoneycombLayerThickness*0.5;
955 zcoor = (kInterCentrModBorder2-kInterCentrModBorder1)*0.5;
956 gMC->Gspos ("FPEB", 1, "FLTB", xcoor, ycoor,-zcoor, 0, "ONLY");
957 gMC->Gspos ("FPEB", 2, "FLTC", xcoor, ycoor, zcoor, 0, "ONLY");
962 par[1] = (yFLT*0.5 - kHoneycombLayerThickness)*0.5;
964 gMC->Gsvolu("FAIA", "BOX ", idtmed[500], par, 3); // Air
967 ycoor = kHoneycombLayerThickness + (yFLT*0.5 - kHoneycombLayerThickness)*0.5;
969 gMC->Gspos ("FAIA", 0, "FLTA", xcoor, ycoor, zcoor, 0, "ONLY");
973 par[1] = (yFLT*0.5 - kHoneycombLayerThickness)*0.5;
974 par[2] = (zlenA*0.5 - kInterCentrModBorder2 - kModuleWallThickness)*0.5;
975 gMC->Gsvolu("FAIB", "BOX ", idtmed[500], par, 3); // Air
976 gMC->Gsvolu("FAIC", "BOX ", idtmed[500], par, 3); // Air
979 ycoor = kHoneycombLayerThickness + (yFLT*0.5 - kHoneycombLayerThickness)*0.5;
980 zcoor = (kInterCentrModBorder2-kInterCentrModBorder1)*0.5;
981 gMC->Gspos ("FAIB", 0, "FLTB", xcoor, ycoor,-zcoor, 0, "ONLY");
982 gMC->Gspos ("FAIC", 0, "FLTC", xcoor, ycoor, zcoor, 0, "ONLY");
985 // start with cards and cooling tubes
986 // finally, cards, cooling tubes and layer for thermal dispersion
989 // see GEOM200 in GEANT manual
993 // card volume definition
994 cardpar[0]= xFLT*0.5;
997 gMC->Gsvolu("FCAR", "BOX ", idtmed[502], cardpar, 3); // PCB Card
999 //alu plate volume definition
1002 gMC->Gsvolu("FALP", "BOX ", idtmed[505], cardpar, 3); // Alu Plate
1004 // tube volume definition
1009 gMC->Gsvolu("FTUB", "TUBE", idtmed[511], tubepar, 3); // cooling tubes (steel)
1014 gMC->Gsvolu("FITU", "TUBE", idtmed[510], tubepar, 3); // cooling water
1015 // positioning water tube into the steel one
1016 gMC->Gspos("FITU",1,"FTUB",0.,0.,0.,0,"ONLY");
1019 AliMatrix(idrotm[99], 180., 90., 90., 90., 90., 0.);
1021 // central module positioning
1022 Float_t cardpos[3], aplpos2;
1023 Float_t stepforcardA = 6.625;
1025 Float_t aplpos1 = -2.;
1030 // tubepos= -53.+tdis;
1032 for (icard=39; icard<54; ++icard) {
1033 cardpos[2]= cardpos[2]+stepforcardA;
1034 aplpos2 = cardpos[2]+0.15;
1035 gMC->Gspos("FCAR",icard,"FAIA",cardpos[0],cardpos[1], cardpos[2], 0,"ONLY");
1036 gMC->Gspos("FALP",icard,"FAIA",cardpos[0], aplpos1, aplpos2, 0,"ONLY");
1037 gMC->Gspos("FTUB",icard,"FAIA", 0.,cardpos[1],cardpos[2]+tdis,idrotm[99],"ONLY");
1040 // intermediate module positioning
1041 Float_t stepforcardB= 7.05;
1045 for (icard=20; icard<39; ++icard) {
1046 cardpos[2]= cardpos[2]+stepforcardB;
1047 aplpos2 = cardpos[2]+0.15;
1049 gMC->Gspos("FCAR",icard+34,"FAIA",cardpos[0],cardpos[1], cardpos[2], 0,"ONLY");
1050 gMC->Gspos("FALP",icard+34,"FAIA",cardpos[0], aplpos1, aplpos2, 0,"ONLY");
1051 gMC->Gspos("FTUB",icard+34,"FAIA", 0.,cardpos[1], cardpos[2]+tdis,idrotm[99],"ONLY");
1052 gMC->Gspos("FCAR",58-icard,"FAIA",cardpos[0],cardpos[1], -cardpos[2], 0,"ONLY");
1053 gMC->Gspos("FALP",58-icard,"FAIA",cardpos[0], aplpos1, -aplpos2, 0,"ONLY");
1054 gMC->Gspos("FTUB",58-icard,"FAIA", 0.,cardpos[1],-cardpos[2]-tdis,idrotm[99],"ONLY");
1057 gMC->Gspos("FCAR",icard+34+182,"FAIC",cardpos[0],cardpos[1], cardpos[2]-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
1058 gMC->Gspos("FALP",icard+34+182,"FAIC",cardpos[0], aplpos1, aplpos2-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
1059 gMC->Gspos("FTUB",icard+34+182,"FAIC", 0.,cardpos[1], cardpos[2]+tdis-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5,idrotm[99],"ONLY");
1060 gMC->Gspos("FCAR",58-icard+ 91,"FAIB",cardpos[0],cardpos[1], -cardpos[2]+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
1061 gMC->Gspos("FALP",58-icard+ 91,"FAIB",cardpos[0], aplpos1, -aplpos2+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
1062 gMC->Gspos("FTUB",58-icard+ 91,"FAIB", 0.,cardpos[1],-cardpos[2]-tdis+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5,idrotm[99],"ONLY");
1067 // outer module positioning
1068 Float_t stepforcardC= 8.45238;
1071 for (icard=1; icard<20; ++icard) {
1072 cardpos[2]= cardpos[2]+stepforcardC;
1073 aplpos2 = cardpos[2]+0.15;
1075 gMC->Gspos("FCAR",icard+72,"FAIA",cardpos[0],cardpos[1], cardpos[2], 0,"ONLY");
1076 gMC->Gspos("FALP",icard+72,"FAIA",cardpos[0], aplpos1, aplpos2, 0,"ONLY");
1077 gMC->Gspos("FTUB",icard+72,"FAIA", 0.,cardpos[1], cardpos[2]+tdis,idrotm[99],"ONLY");
1078 gMC->Gspos("FCAR",20-icard,"FAIA",cardpos[0],cardpos[1], -cardpos[2], 0,"ONLY");
1079 gMC->Gspos("FALP",20-icard,"FAIA",cardpos[0], aplpos1, -aplpos2, 0,"ONLY");
1080 gMC->Gspos("FTUB",20-icard,"FAIA", 0.,cardpos[1],-cardpos[2]-tdis,idrotm[99],"ONLY");
1083 gMC->Gspos("FCAR",icard+72+182,"FAIC",cardpos[0],cardpos[1], cardpos[2]-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
1084 gMC->Gspos("FALP",icard+72+182,"FAIC",cardpos[0], aplpos1, aplpos2-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
1085 gMC->Gspos("FTUB",icard+72+182,"FAIC", 0.,cardpos[1], cardpos[2]+tdis-(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5,idrotm[99],"ONLY");
1086 gMC->Gspos("FCAR",20-icard+ 91,"FAIB",cardpos[0],cardpos[1], -cardpos[2]+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
1087 gMC->Gspos("FALP",20-icard+ 91,"FAIB",cardpos[0], aplpos1, -aplpos2+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5, 0,"ONLY");
1088 gMC->Gspos("FTUB",20-icard+ 91,"FAIB", 0.,cardpos[1],-cardpos[2]-tdis+(zlenA*0.5 + kInterCentrModBorder2 - kModuleWallThickness)*0.5,idrotm[99],"ONLY");
1093 //_____________________________________________________________________________
1094 void AliTOFv5T0::DrawModule() const
1097 // Draw a shaded view of the Time Of Flight version 4
1100 // Set everything unseen
1101 gMC->Gsatt("*", "seen", -1);
1104 //Set volumes visible
1107 //Set ALIC mother transparent
1108 gMC->Gsatt("ALIC","SEEN", 0);
1111 // Level 1 for TOF volumes
1112 gMC->Gsatt("B077","seen", 0);
1115 // Level 2 for TOF volumes
1116 gMC->Gsatt("B071","seen", 0);
1117 gMC->Gsatt("B074","seen", 0);
1118 gMC->Gsatt("B075","seen", 0);
1119 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
1120 gMC->Gsatt("B080","seen", 0); // B080 does not has sub-level
1123 gMC->Gsatt("B056","seen", 0); // B056 does not has sub-levels -
1124 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
1125 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
1126 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
1127 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
1129 gMC->Gsatt("BTR1","seen", 0); // all BTR1 sub-levels skipped -
1130 gMC->Gsatt("BTO1","seen", 0);
1133 gMC->Gsatt("BTR2","seen", 0); // all BTR1 sub-levels skipped -
1134 gMC->Gsatt("BTO2","seen", 0);
1137 gMC->Gsatt("BTR3","seen", 0); // all BTR1 sub-levels skipped -
1138 gMC->Gsatt("BTO3","seen", 0);
1140 // Level 3 of B071, B074 and B075
1141 gMC->Gsatt("FTOA","SEEN", 0);
1142 if (fTOFHoles) gMC->Gsatt("FTOB","SEEN", 0);
1144 // Level 4 of B071, B074 and B075
1145 gMC->Gsatt("FLTA","SEEN", 0);
1146 if (fTOFHoles) gMC->Gsatt("FLTB","SEEN",0);
1147 if (fTOFHoles) gMC->Gsatt("FLTC","SEEN",0);
1149 // Level 5 of B071, B074 and B075
1150 gMC->Gsatt("FAIA","SEEN",-1); // all FAIA sub-levels skipped -
1151 if (fTOFHoles) gMC->Gsatt("FAIB","SEEN",-1); // all FAIB sub-levels skipped -
1152 if (fTOFHoles) gMC->Gsatt("FAIC","SEEN",-1); // all FAIC sub-levels skipped -
1154 gMC->Gsatt("FALA","SEEN", 0);
1155 if (fTOFHoles) gMC->Gsatt("FALB","SEEN", 0);
1157 gMC->Gsatt("FPEA","SEEN", 1);
1158 if (fTOFHoles) gMC->Gsatt("FPEB","SEEN", 1);
1160 gMC->Gsatt("FSTR","SEEN",-1); // all FSTR sub-levels skipped -
1162 gMC->Gsatt("FWZ1","SEEN", 0);
1163 gMC->Gsatt("FWZ2","SEEN", 0);
1164 gMC->Gsatt("FWZ3","SEEN", 0);
1165 gMC->Gsatt("FWZ4","SEEN", 0);
1167 gMC->Gsatt("FZ1B","SEEN", 0);
1168 gMC->Gsatt("FZ1C","SEEN", 0);
1169 gMC->Gsatt("FZ2B","SEEN", 0);
1172 gMC->Gdopt("hide", "on");
1173 gMC->Gdopt("shad", "on");
1174 gMC->Gsatt("*", "fill", 7);
1175 gMC->SetClipBox(".");
1176 gMC->SetClipBox("*", 100, 1000, 100, 1000, 100, 1000);
1177 gMC->DefaultRange();
1178 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .018, .018);
1179 gMC->Gdhead(1111, "Time Of Flight");
1180 gMC->Gdman(18, 3, "MAN");
1181 gMC->Gdopt("hide","off");
1183 //_____________________________________________________________________________
1184 void AliTOFv5T0::DrawDetectorModules() const
1187 // Draw a shaded view of the TOF detector version 4
1190 // Set everything unseen
1191 gMC->Gsatt("*", "seen", -1);
1194 //Set volumes visible
1197 //Set ALIC mother transparent
1198 gMC->Gsatt("ALIC","SEEN", 0);
1201 // Level 1 for TOF volumes
1202 gMC->Gsatt("B077","seen", 0);
1205 // Level 2 for TOF volumes
1206 gMC->Gsatt("B071","seen", 0);
1207 gMC->Gsatt("B074","seen", 0);
1208 gMC->Gsatt("B075","seen", 0);
1209 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
1210 gMC->Gsatt("B080","seen", 0); // B080 does not has sub-level
1213 gMC->Gsatt("B056","seen", 0); // B056 does not has sub-levels -
1214 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
1215 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
1216 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
1217 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
1219 gMC->Gsatt("BTR1","seen", 0); // all BTR1 sub-levels skipped -
1220 gMC->Gsatt("BTO1","seen", 0);
1223 gMC->Gsatt("BTR2","seen", 0); // all BTR1 sub-levels skipped -
1224 gMC->Gsatt("BTO2","seen", 0);
1227 gMC->Gsatt("BTR3","seen", 0); // all BTR1 sub-levels skipped -
1228 gMC->Gsatt("BTO3","seen", 0);
1230 // Level 3 of B071, B075 and B074
1231 gMC->Gsatt("FTOA","seen",-2); // all FTOA sub-levels skipped -
1233 gMC->Gsatt("FTOB","seen",-2); // all FTOB sub-levels skipped -
1234 gMC->Gsatt("FTOC","seen",-2); // all FTOC sub-levels skipped -
1237 gMC->Gdopt("hide","on");
1238 gMC->Gdopt("shad","on");
1239 gMC->Gsatt("*", "fill", 5);
1240 gMC->SetClipBox(".");
1241 gMC->SetClipBox("*", 100, 1000, 100, 1000, 0, 1000);
1242 gMC->DefaultRange();
1243 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .018, .018);
1244 gMC->Gdhead(1111,"TOF detector");
1245 gMC->Gdman(18, 3, "MAN");
1246 gMC->Gdopt("hide","off");
1249 //_____________________________________________________________________________
1250 void AliTOFv5T0::DrawDetectorStrips() const
1253 // Draw a shaded view of the TOF strips for version 4
1256 // Set everything unseen
1257 gMC->Gsatt("*", "seen", -1);
1260 //Set volumes visible
1263 //Set ALIC mother transparent
1264 gMC->Gsatt("ALIC","SEEN", 0);
1267 // Level 1 for TOF volumes
1268 gMC->Gsatt("B077","seen", 0);
1271 // Level 2 for TOF volumes
1272 gMC->Gsatt("B071","seen", 0);
1273 gMC->Gsatt("B074","seen", 0);
1274 gMC->Gsatt("B075","seen", 0);
1275 gMC->Gsatt("B076","seen",-1); // all B076 sub-levels skipped -
1276 gMC->Gsatt("B080","seen", 0); // B080 does not has sub-level
1279 gMC->Gsatt("B063","seen",-1); // all B063 sub-levels skipped -
1280 gMC->Gsatt("B065","seen",-1); // all B065 sub-levels skipped -
1281 gMC->Gsatt("B067","seen",-1); // all B067 sub-levels skipped -
1282 gMC->Gsatt("B056","seen", 0); // B056 does not has sub-levels -
1283 gMC->Gsatt("B072","seen",-1); // all B072 sub-levels skipped -
1285 gMC->Gsatt("BTR1","seen", 0); // all BTR1 sub-levels skipped -
1286 gMC->Gsatt("BTO1","seen", 0);
1289 gMC->Gsatt("BTR2","seen", 0); // all BTR1 sub-levels skipped -
1290 gMC->Gsatt("BTO2","seen", 0);
1293 gMC->Gsatt("BTR3","seen", 0); // all BTR1 sub-levels skipped -
1294 gMC->Gsatt("BTO3","seen", 0);
1296 // Level 3 of B071, B074 and B075
1297 gMC->Gsatt("FTOA","SEEN", 0);
1299 gMC->Gsatt("FTOB","SEEN", 0);
1300 gMC->Gsatt("FTOC","SEEN", 0);
1303 // Level 4 of B071, B074 and B075
1304 gMC->Gsatt("FLTA","SEEN", 0);
1306 gMC->Gsatt("FLTB","SEEN", 0);
1307 gMC->Gsatt("FLTC","SEEN", 0);
1310 // Level 5 of B071, B074 and B075
1311 gMC->Gsatt("FAIA","SEEN",-1); // all FAIA sub-levels skipped -
1313 gMC->Gsatt("FAIB","SEEN",-1); // all FAIB sub-levels skipped -
1314 gMC->Gsatt("FAIC","SEEN",-1); // all FAIC sub-levels skipped -
1317 gMC->Gsatt("FALA","SEEN", 0);
1318 if (fTOFHoles) gMC->Gsatt("FALB","SEEN", 0);
1320 gMC->Gsatt("FPEA","SEEN", 0);
1321 if (fTOFHoles) gMC->Gsatt("FPEB","SEEN", 0);
1323 gMC->Gsatt("FSTR","SEEN",-2); // all FSTR sub-levels skipped -
1325 gMC->Gsatt("FWZ1","SEEN", 0);
1326 gMC->Gsatt("FWZ2","SEEN", 0);
1327 gMC->Gsatt("FWZ3","SEEN", 0);
1328 gMC->Gsatt("FWZ4","SEEN", 0);
1330 gMC->Gsatt("FZ1B","SEEN", 0);
1331 gMC->Gsatt("FZ1C","SEEN", 0);
1332 gMC->Gsatt("FZ2B","SEEN", 0);
1339 gMC->Gsatt("FALP","SEEN",0);
1340 gMC->Gsatt("FCAR","SEEN",0);
1341 gMC->Gsatt("FTUB","SEEN",-1); // all FTUB sub-levels skipped -
1344 gMC->Gsatt("FITU","SEEN",0);
1349 gMC->Gsatt("FGLF","SEEN",0);
1350 gMC->Gsatt("FHON","SEEN",0);
1351 gMC->Gsatt("FPC1","SEEN",0);
1352 gMC->Gsatt("FPC2","SEEN",0);
1353 gMC->Gsatt("FPCB","SEEN",0);
1354 gMC->Gsatt("FRGL","SEEN",0);
1356 // Level 2 of FPCB => Level 3 of FSTR
1357 gMC->Gsatt("FSEN","SEEN",0);
1358 gMC->Gsatt("FSEZ","SEEN",0);
1359 gMC->Gsatt("FPAD","SEEN",1);
1362 gMC->Gdopt("hide","on");
1363 gMC->Gdopt("shad","on");
1364 gMC->Gsatt("*", "fill", 5);
1365 gMC->SetClipBox(".");
1366 gMC->SetClipBox("*", 0, 1000, 0, 1000, 0, 1000);
1367 gMC->DefaultRange();
1368 gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .018, .018);
1369 gMC->Gdhead(1111,"TOF Strips");
1370 gMC->Gdman(18, 3, "MAN");
1371 gMC->Gdopt("hide","off");
1374 //_____________________________________________________________________________
1375 void AliTOFv5T0::CreateMaterials()
1378 // Define materials for the Time Of Flight
1381 //AliTOF::CreateMaterials();
1383 AliMagF *magneticField = (AliMagF*)gAlice->Field();
1385 Int_t isxfld = magneticField->Integ();
1386 Float_t sxmgmx = magneticField->Max();
1388 Float_t we[7], ae[7], na[7], fr[7], vl[7];
1391 //--- Quartz (SiO2) to simulate float glass
1392 // density tuned to have correct float glass
1394 Float_t aq[2] = { 28.0855,15.9994 };
1395 Float_t zq[2] = { 14.,8. };
1396 Float_t wq[2] = { 1.,2. };
1397 Float_t dq = 2.55; // std value: 2.2
1401 Float_t anox[4] = {12.01,1.01,16.00,14.01};
1402 Float_t znox[4] = { 6., 1., 8., 7.};
1403 Float_t wnox[4] = {14., 22., 2., 2.};
1404 Float_t dnox = 0.048;
1408 Float_t ag10[4] = {28.09,12.01,1.01,16.00};
1409 Float_t zg10[4] = {14., 6., 1., 8.};
1412 for (i = 0; i < nlmatg10; ++i) {
1428 MaterialMixer(we,ae,na,fr,vl,5);
1434 Float_t densg10 = 1.7;
1437 Float_t awa[2] = { 1., 16. };
1438 Float_t zwa[2] = { 1., 8. };
1439 Float_t wwa[2] = { 2., 1. };
1444 Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
1445 Float_t zsteel[4] = { 26.,24.,28.,14. };
1446 Float_t wsteel[4] = { .715,.18,.1,.005 };
1449 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1450 Float_t zAir[4]={6.,7.,8.,18.};
1451 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1452 Float_t dAir = 1.20479E-3;
1455 Float_t afg[4] = {28.09,16.00,12.01,1.01};
1456 Float_t zfg[4] = {14., 8., 6., 1.};
1457 Float_t wfg[4] = {0.12906,0.29405,0.51502,0.06187};
1458 Float_t dfg = 1.111;
1461 // --- Freon C2F4H2 + SF6
1462 Float_t afre[4]= {12.01,1.01,19.00,32.07};
1463 Float_t zfre[4]= { 6., 1., 9., 16.};
1464 Float_t wfre[4]= {0.21250,0.01787,0.74827,0.021355};
1465 Float_t densfre= 0.00375;
1468 //char namat[15] = " ";
1469 //Float_t ama[2], zma[2], dma, radl, absl, buf[1];
1472 AliMixture ( 0, "Air$", aAir, zAir, dAir, 4, wAir);
1473 AliMixture ( 1, "Nomex$", anox, znox, dnox, nnox, wnox);
1474 AliMixture ( 2, "G10$", ag10, zg10, densg10, nlmatg10, wmatg10);
1475 AliMixture ( 3, "fibre glass$", afg, zfg, dfg, nfg, wfg);
1476 AliMaterial( 4, "Al $", 26.98, 13., 2.7, 8.9, 37.2);
1477 AliMaterial( 5, "Al honeycomb$", 26.98, 13., 0.0496, 483., 2483.);
1478 AliMixture ( 6, "Freon$", afre, zfre, densfre, nfre, wfre);
1479 AliMixture ( 7, "Glass$", aq, zq, dq, nq, wq);
1481 // get freon and glass
1482 gMC->Gfmate((*fIdmate)[6],namat,ama[0],zma[0],dma,radl,absl,buf,nbuf);
1483 gMC->Gfmate((*fIdmate)[7],namat,ama[1],zma[1],dma,radl,absl,buf,nbuf);
1486 Float_t wgfr[2]= {0.0011,0.9989};
1487 Float_t dgfr = 1.434;
1489 AliMixture ( 8, "glass-freon$", ama, zma, dgfr, ngfr, wgfr);
1491 AliMixture ( 9, "Water$", awa, zwa, dwa, nwa, wwa);
1492 AliMixture (10, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
1494 Float_t epsil, stmin, deemax, stemax;
1497 // EPSIL = 0.1 ! Tracking precision,
1498 // STEMAX = 0.1 ! Maximum displacement for multiple scattering
1499 // DEEMAX = 0.1 ! Maximum fractional energy loss, DLS
1503 epsil = .001; // Tracking precision,
1504 stemax = -1.; // Maximum displacement for multiple scattering
1505 deemax = -.3; // Maximum fractional energy loss, DLS
1508 AliMedium( 1, "Air$", 0, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1509 AliMedium( 2,"Nomex$", 1, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1510 AliMedium( 3,"G10$", 2, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1511 AliMedium( 4,"fibre glass$", 3, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1512 //AliMedium( 5,"glass-freon$", 8, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1513 AliMedium( 6,"Al Frame$", 4, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1514 AliMedium( 7,"Al honeycomb$", 5, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1515 AliMedium( 8,"Fre$", 6, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1516 AliMedium( 9,"PCB-S$", 2, 1, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1517 AliMedium(10,"Glass$", 7, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1518 AliMedium(11,"Water$", 9, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1519 AliMedium(12,"STEEL$", 10, 0, isxfld, sxmgmx, 10., stemax, deemax, epsil, stmin);
1522 //_____________________________________________________________________________
1523 void AliTOFv5T0::Init()
1526 // Initialise the detector after the geometry has been defined
1528 AliDebug(1, "**************************************"
1530 "**************************************");
1531 AliDebug(1, " Version 4 of TOF initialing, "
1532 "symmetric TOF - Full Coverage version");
1536 fIdFTOA = gMC->VolId("FTOA");
1538 fIdFTOB = gMC->VolId("FTOB");
1539 fIdFTOC = gMC->VolId("FTOC");
1541 fIdFLTA = gMC->VolId("FLTA");
1543 fIdFLTB = gMC->VolId("FLTB");
1544 fIdFLTC = gMC->VolId("FLTC");
1547 AliDebug(1, "**************************************"
1549 "**************************************");
1552 //_____________________________________________________________________________
1553 void AliTOFv5T0::StepManager()
1557 // Procedure called at each step in the Time Of Flight
1560 TLorentzVector mom, pos;
1561 Float_t xm[3],pm[3],xpad[3],ppad[3];
1564 Int_t sector, plate, padx, padz, strip;
1565 Int_t copy, padzid, padxid, stripid, i;
1566 Int_t *idtmed = fIdtmed->GetArray()-499;
1567 Float_t incidenceAngle;
1569 const char* volpath;
1574 gMC->IsTrackEntering()
1575 && gMC->TrackCharge()
1576 //&& gMC->GetMedium()==idtmed[508]
1577 && gMC->CurrentMedium()==idtmed[508]
1578 && gMC->CurrentVolID(copy)==fIdSens
1582 AliMC *mcApplication = (AliMC*)gAlice->GetMCApp();
1584 AddTrackReference(mcApplication->GetCurrentTrackNumber(), AliTrackReference::kTOF);
1585 //AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
1587 // getting information about hit volumes
1589 padzid=gMC->CurrentVolOffID(1,copy);
1593 padxid=gMC->CurrentVolOffID(0,copy);
1597 stripid=gMC->CurrentVolOffID(4,copy);
1601 gMC->TrackPosition(pos);
1602 gMC->TrackMomentum(mom);
1604 Double_t normMom=1./mom.Rho();
1606 // getting the coordinates in pad ref system
1608 xm[0] = (Float_t)pos.X();
1609 xm[1] = (Float_t)pos.Y();
1610 xm[2] = (Float_t)pos.Z();
1612 pm[0] = (Float_t)mom.X()*normMom;
1613 pm[1] = (Float_t)mom.Y()*normMom;
1614 pm[2] = (Float_t)mom.Z()*normMom;
1616 gMC->Gmtod(xm,xpad,1); // from MRS to DRS: coordinates convertion
1617 gMC->Gmtod(pm,ppad,2); // from MRS to DRS: direction cosinus convertion
1620 if (TMath::Abs(ppad[1])>1) {
1621 AliWarning("Abs(ppad) > 1");
1622 ppad[1]=TMath::Sign((Float_t)1,ppad[1]);
1624 incidenceAngle = TMath::ACos(ppad[1])*kRaddeg;
1627 if (strip < fTOFGeometry->NStripC()) {
1631 else if (strip >= fTOFGeometry->NStripC() &&
1632 strip < fTOFGeometry->NStripC() + fTOFGeometry->NStripB()) {
1634 strip = strip - fTOFGeometry->NStripC();
1636 else if (strip >= fTOFGeometry->NStripC() + fTOFGeometry->NStripB() &&
1637 strip < fTOFGeometry->NStripC() + fTOFGeometry->NStripB() + fTOFGeometry->NStripA()) {
1639 strip = strip - fTOFGeometry->NStripC() - fTOFGeometry->NStripB();
1641 else if (strip >= fTOFGeometry->NStripC() + fTOFGeometry->NStripB() + fTOFGeometry->NStripA() &&
1642 strip < fTOFGeometry->NStripC() + fTOFGeometry->NStripB() + fTOFGeometry->NStripA() + fTOFGeometry->NStripB()) {
1644 strip = strip - fTOFGeometry->NStripC() - fTOFGeometry->NStripB() - fTOFGeometry->NStripA();
1648 strip = strip - fTOFGeometry->NStripC() - fTOFGeometry->NStripB() - fTOFGeometry->NStripA() - fTOFGeometry->NStripB();
1651 volpath=gMC->CurrentVolOffName(7);
1652 index=atoi(&volpath[4]);
1669 hits[6] = mom.Rho();
1674 hits[11]= incidenceAngle;
1675 hits[12]= gMC->Edep();
1676 hits[13]= gMC->TrackLength();
1684 AddT0Hit(mcApplication->GetCurrentTrackNumber(),vol, hits);
1685 //AddT0Hit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
1688 //-------------------------------------------------------------------
1689 void AliTOFv5T0::MaterialMixer(Float_t* p,Float_t* a,Float_t* m,Float_t* d,Float_t* s,Int_t n) const
1691 // a[] atomic weights vector (in)
1692 // (atoms present in more compound appear separately)
1693 // m[] number of corresponding atoms in the mixture (in)
1694 // d[] fraction of the compound relative to the corresponding atoms (in)
1695 // s[] further possible weights " " " " (in)
1697 for (Int_t i = 0; i < n; ++i) {
1698 p[i] = a[i]*m[i]*d[i]*s[i];
1701 for (Int_t i = 0; i < n; ++i) {
1703 // AliInfo(Form((\n weight[%i] = %f (,i,p[i]));