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.2 2003/01/26 14:35:15 nilsen
19 Some more geometry interface functions added and a start at the SSD support
20 cone geometry. Committed to allow easy updates of partical work between authors.
22 Revision 1.1 2003/01/20 23:32:49 nilsen
23 New ITS geometry. Only a Skeleton for now.
28 //////////////////////////////////////////////////////////////////////////////
30 // Inner Traking System version 11 //
31 // This class contains the base procedures for the Inner Tracking System //
33 // Authors: R. Barbera //
37 // NOTE: THIS IS THE SYMMETRIC PPR geometry of the ITS. //
38 // THIS WILL NOT WORK //
39 // with the geometry or module classes or any analysis classes. You are //
40 // strongly encouraged to uses AliITSv5. //
42 //////////////////////////////////////////////////////////////////////////////
43 // See AliITSv11::StepManager().
44 #include <Riostream.h>
48 #include <TGeometry.h>
53 #include <TFile.h> // only required for Tracking function?
55 #include <TObjArray.h>
56 #include <TLorentzVector.h>
57 #include <TObjString.h>
58 #include <TClonesArray.h>
66 #include "AliITSGeant3Geometry.h"
67 #include "AliITShit.h"
69 #include "AliITSv11.h"
70 #include "AliITSgeom.h"
71 #include "AliITSgeomSPD.h"
72 #include "AliITSgeomSDD.h"
73 #include "AliITSgeomSSD.h"
74 #include "AliITSDetType.h"
75 #include "AliITSresponseSPD.h"
76 #include "AliITSresponseSDD.h"
77 #include "AliITSresponseSSD.h"
78 #include "AliITSsegmentationSPD.h"
79 #include "AliITSsegmentationSDD.h"
80 #include "AliITSsegmentationSSD.h"
81 #include "AliITSsimulationSPD.h"
82 #include "AliITSsimulationSDD.h"
83 #include "AliITSsimulationSSD.h"
84 #include "AliITSClusterFinderSPD.h"
85 #include "AliITSClusterFinderSDD.h"
86 #include "AliITSClusterFinderSSD.h"
91 //______________________________________________________________________
92 AliITSv11::AliITSv11() : AliITS() {
93 ////////////////////////////////////////////////////////////////////////
94 // Standard default constructor for the ITS version 11.
95 ////////////////////////////////////////////////////////////////////////
97 //______________________________________________________________________
98 AliITSv11::AliITSv11(const char *title) : AliITS("ITS", title){
99 ////////////////////////////////////////////////////////////////////////
100 // Standard constructor for the ITS version 11.
101 ////////////////////////////////////////////////////////////////////////
103 //______________________________________________________________________
104 AliITSv11::~AliITSv11() {
105 ////////////////////////////////////////////////////////////////////////
106 // Standard destructor for the ITS version 11.
107 ////////////////////////////////////////////////////////////////////////
109 //______________________________________________________________________
110 void AliITSv11::Box(const char gnam[3],const TString &dis,
111 Double_t dx,Double_t dy,Double_t dz,Int_t med){
112 // Interface to TMC->Gsvolu() for ITS bos geometries. Box with faces
113 // perpendicular to the axes. It has 3 paramters. See SetScale() for
114 // units. Default units are geant 3 [cm].
116 // const char gnam[3] 3 character geant volume name. The letter "I"
117 // is appended to the front to indecate that this
119 // TString &dis String containging part discription.
120 // Double_t dx half-length of box in x-axis
121 // Double_t dy half-length of box in y-axis
122 // Double_t dz half-length of box in z-axis
123 // Int_t med media index number.
131 param[0] = fScale*dx;
132 param[1] = fScale*dy;
133 param[2] = fScale*dz;
135 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
136 gMC->Gsvolu(name,"BOX ",fidmed[med],param,3);
138 //______________________________________________________________________
139 void AliITSv11::Trapezoid1(const char gnam[3],const TString &dis,
140 Double_t dxn,Double_t dxp,Double_t dy,Double_t dz,
142 // Interface to TMC->Gsvolu() for ITS TRD1 geometries. Trapezoid with the
143 // x dimension varing along z. It has 4 parameters. See SetScale() for
144 // units. Default units are geant 3 [cm].
146 // const char gnam[3] 3 character geant volume name. The letter "I"
147 // is appended to the front to indecate that this
149 // TString &dis String containging part discription.
150 // Double_t dxn half-length along x at the z surface positioned
152 // Double_t dxp half-length along x at the z surface positioned
154 // Double_t dy half-length along the y-axis
155 // Double_t dz half-length along the z-axis
156 // Int_t med media index number.
164 param[0] = fScale*dxn;
165 param[1] = fScale*dxp;
166 param[2] = fScale*dy;
167 param[3] = fScale*dz;
169 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
170 gMC->Gsvolu(name,"TRD1",fidmed[med],param,4);
172 //______________________________________________________________________
173 void AliITSv11::Trapezoid2(const char gnam[3],const TString &dis,Double_t dxn,
174 Double_t dxp,Double_t dyn,Double_t dyp,Double_t dz,
176 // Interface to TMC->Gsvolu() for ITS TRD2 geometries. Trapezoid with the
177 // x and y dimension varing along z. It has 5 parameters. See SetScale()
178 // for units. Default units are geant 3 [cm].
180 // const char gnam[3] 3 character geant volume name. The letter "I"
181 // is appended to the front to indecate that this
183 // TString &dis String containging part discription.
184 // Double_t dxn half-length along x at the z surface positioned
186 // Double_t dxp half-length along x at the z surface positioned
188 // Double_t dyn half-length along x at the z surface positioned
190 // Double_t dyp half-length along x at the z surface positioned
192 // Double_t dz half-length along the z-axis
193 // Int_t med media index number.
201 param[0] = fScale*dxn;
202 param[1] = fScale*dxp;
203 param[2] = fScale*dyn;
204 param[3] = fScale*dyp;
205 param[4] = fScale*dz;
207 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
208 gMC->Gsvolu(name,"TRD2",fidmed[med],param,5);
210 //______________________________________________________________________
211 void AliITSv11::Trapezoid(const char gnam[3],const TString &dis,Double_t dz,
212 Double_t thet,Double_t phi,Double_t h1,Double_t bl1,
213 Double_t tl1,Double_t alp1,Double_t h2,Double_t bl2,
214 Double_t tl2,Double_t alp2,Int_t med){
215 // Interface to TMC->Gsvolu() for ITS TRAP geometries. General Trapezoid,
216 // The faces perpendicular to z are trapezia and their centers are not
217 // necessarily on a line parallel to the z axis. This shape has 11
218 // parameters, but only cosidering that the faces should be planar, only 9
219 // are really independent. A check is performed on the user parameters and
220 // a message is printed in case of non-planar faces. Ignoring this warning
221 // may cause unpredictable effects at tracking time. See SetScale()
222 // for units. Default units are geant 3 [cm].
224 // const char gnam[3] 3 character geant volume name. The letter "I"
225 // is appended to the front to indecate that this
227 // TString &dis String containging part discription.
228 // Double_t dz Half-length along the z-asix
229 // Double_t thet Polar angle of the line joing the center of the
230 // face at -dz to the center of the one at dz
232 // Double_t phi aximuthal angle of the line joing the center of
233 // the face at -dz to the center of the one at +dz
235 // Double_t h1 half-length along y of the face at -dz.
236 // Double_t bl1 half-length along x of the side at -h1 in y of
237 // the face at -dz in z.
238 // Double_t tl1 half-length along x of teh side at +h1 in y of
239 // the face at -dz in z.
240 // Double_t alp1 angle with respect to the y axis from the center
241 // of the side at -h1 in y to the cetner of the
242 // side at +h1 in y of the face at -dz in z
244 // Double_t h2 half-length along y of the face at +dz
245 // Double_t bl2 half-length along x of the side at -h2 in y of
246 // the face at +dz in z.
247 // Double_t tl2 half-length along x of the side at _h2 in y of
248 // the face at +dz in z.
249 // Double_t alp2 angle with respect to the y axis from the center
250 // of the side at -h2 in y to the center of the
251 // side at +h2 in y of the face at +dz in z
253 // Int_t med media index number.
261 param[0] = fScale*dz;
264 param[3] = fScale*h1;
265 param[4] = fScale*bl1;
266 param[5] = fScale*tl1;
268 param[7] = fScale*h2;
269 param[8] = fScale*bl2;
270 param[9] = fScale*tl2;
273 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
274 gMC->Gsvolu(name,"TRAP",fidmed[med],param,11);
276 //______________________________________________________________________
277 void AliITSv11::Tube(const char gnam[3],const TString &dis,Double_t rmin,
278 Double_t rmax,Double_t dz,Int_t med){
279 // Interface to TMC->Gsvolu() for ITS TUBE geometries. Simple Tube. It has
280 // 3 parameters. See SetScale()
281 // for units. Default units are geant 3 [cm].
283 // const char gnam[3] 3 character geant volume name. The letter "I"
284 // is appended to the front to indecate that this
286 // TString &dis String containging part discription.
287 // Double_t rmin Inside Radius.
288 // Double_t rmax Outside Radius.
289 // Double_t dz half-length along the z-axis
290 // Int_t med media index number.
298 param[0] = fScale*rmin;
299 param[1] = fScale*rmax;
300 param[2] = fScale*dz;
302 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
303 gMC->Gsvolu(name,"TUBE",fidmed[med],param,3);
305 //______________________________________________________________________
306 void AliITSv11::TubeSegment(const char gnam[3],const TString &dis,
307 Double_t rmin,Double_t rmax,Double_t dz,
308 Double_t phi1,Double_t phi2,Int_t med){
309 // Interface to TMC->Gsvolu() for ITS TUBE geometries. Phi segment of a
310 // tube. It has 5 parameters. Phi1 should be smaller than phi2. If this is
311 // not the case, the system adds 360 degrees to phi2. See SetScale()
312 // for units. Default units are geant 3 [cm].
314 // const char gnam[3] 3 character geant volume name. The letter "I"
315 // is appended to the front to indecate that this
317 // TString &dis String containging part discription.
318 // Double_t rmin Inside Radius.
319 // Double_t rmax Outside Radius.
320 // Double_t dz half-length along the z-axis
321 // Double_t phi1 Starting angle of the segment [degree].
322 // Double_t phi2 Ending angle of the segment [degree].
323 // Int_t med media index number.
331 param[0] = fScale*rmin;
332 param[1] = fScale*rmax;
333 param[2] = fScale*dz;
337 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
338 gMC->Gsvolu(name,"TUBS",fidmed[med],param,5);
340 //______________________________________________________________________
341 void AliITSv11::Cone(const char gnam[3],const TString &dis,Double_t dz,
342 Double_t rmin1,Double_t rmax1,Double_t rmin2,
343 Double_t rmax2,Int_t med){
344 // Interface to TMC->Gsvolu() for ITS Cone geometries. Conical tube. It
345 // has 5 parameters. See SetScale()
346 // for units. Default units are geant 3 [cm].
348 // const char gnam[3] 3 character geant volume name. The letter "I"
349 // is appended to the front to indecate that this
351 // TString &dis String containging part discription.
352 // Double_t dz half-length along the z-axis
353 // Double_t rmin1 Inside Radius at -dz.
354 // Double_t rmax1 Outside Radius at -dz.
355 // Double_t rmin2 inside radius at +dz.
356 // Double_t rmax2 outside radius at +dz.
357 // Int_t med media index number.
365 param[0] = fScale*dz;
366 param[1] = fScale*rmin1;
367 param[2] = fScale*rmax1;
368 param[3] = fScale*rmin2;
369 param[4] = fScale*rmax2;
371 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
372 gMC->Gsvolu(name,"CONS",fidmed[med],param,5);
374 //______________________________________________________________________
375 void AliITSv11::ConeSegment(const char gnam[3],const TString &dis,Double_t dz,
376 Double_t rmin1,Double_t rmax1,Double_t rmin2,
377 Double_t rmax2,Double_t phi1,Double_t phi2,
379 // Interface to TMC->Gsvolu() for ITS ConS geometries. One segment of a
380 // conical tube. It has 7 parameters. Phi1 should be smaller than phi2. If
381 // this is not the case, the system adds 360 degrees to phi2. See
382 // SetScale() for units. Default units are geant 3 [cm].
384 // const char gnam[3] 3 character geant volume name. The letter "I"
385 // is appended to the front to indecate that this
387 // TString &dis String containging part discription.
388 // Double_t dz half-length along the z-axis
389 // Double_t rmin1 Inside Radius at -dz.
390 // Double_t rmax1 Outside Radius at -dz.
391 // Double_t rmin2 inside radius at +dz.
392 // Double_t rmax2 outside radius at +dz.
393 // Double_t phi1 Starting angle of the segment [degree].
394 // Double_t phi2 Ending angle of the segment [degree].
395 // Int_t med media index number.
403 param[0] = fScale*dz;
404 param[1] = fScale*rmin1;
405 param[2] = fScale*rmax1;
406 param[3] = fScale*rmin2;
407 param[4] = fScale*rmax2;
411 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
412 gMC->Gsvolu(name,"CONS",fidmed[med],param,7);
414 //______________________________________________________________________
415 void AliITSv11::Sphere(const char gnam[3],const TString &dis,Double_t rmin,
416 Double_t rmax,Double_t the1,Double_t the2,Double_t phi1,
417 Double_t phi2,Int_t med){
418 // Interface to TMC->Gsvolu() for ITS SPHE geometries. Segment of a
419 // sphereical shell. It has 6 parameters. See SetScale()
420 // for units. Default units are geant 3 [cm].
422 // const char gnam[3] 3 character geant volume name. The letter "I"
423 // is appended to the front to indecate that this
425 // TString &dis String containging part discription.
426 // Double_t rmin Inside Radius.
427 // Double_t rmax Outside Radius.
428 // Double_t the1 staring polar angle of the shell [degree].
429 // Double_t the2 ending polar angle of the shell [degree].
430 // Double_t phui staring asimuthal angle of the shell [degree].
431 // Double_t phi2 ending asimuthal angle of the shell [degree].
432 // Int_t med media index number.
440 param[0] = fScale*rmin;
441 param[1] = fScale*rmax;
447 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
448 gMC->Gsvolu(name,"SPHE",fidmed[med],param,6);
450 //______________________________________________________________________
451 void AliITSv11::Parallelepiped(const char gnam[3],const TString &dis,
452 Double_t dx,Double_t dy,Double_t dz,
453 Double_t alph,Double_t thet,Double_t phi,
455 // Interface to TMC->Gsvolu() for ITS PARA geometries. Parallelepiped. It
456 // has 6 parameters. See SetScale() for units. Default units are geant 3
459 // const char gnam[3] 3 character geant volume name. The letter "I"
460 // is appended to the front to indecate that this
462 // TString &dis String containging part discription.
463 // Double_t dx half-length allong x-axis
464 // Double_t dy half-length allong y-axis
465 // Double_t dz half-length allong z-axis
466 // Double_t alpha angle formed by the y axis and by the plane
467 // joining the center of teh faces parallel to the
468 // z-x plane at -dY and +dy [degree].
469 // Double_t thet polar angle of the line joining the centers of
470 // the faces at -dz and +dz in z [degree].
471 // Double_t phi azimuthal angle of teh line joing the centers of
472 // the faaces at -dz and +dz in z [degree].
473 // Int_t med media index number.
481 param[0] = fScale*dx;
482 param[1] = fScale*dy;
483 param[2] = fScale*dz;
488 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
489 gMC->Gsvolu(name,"PARA",fidmed[med],param,6);
491 //______________________________________________________________________
492 void AliITSv11::Polygon(const char gnam[3],const TString &dis,Double_t phi1,
493 Double_t dphi,Int_t npdv,Int_t nz,Double_t *z,
494 Double_t *rmin,Double_t *rmax,Double_t ,Int_t med){
495 // Interface to TMC->Gsvolu() for ITS PGON geometry. Polygon It has 10
496 // parameters or more. See SetScale() for units. Default units are geant 3
499 // const char gnam[3] 3 character geant volume name. The letter "I"
500 // is appended to the front to indecate that this
502 // TString &dis String containging part discription.
503 // Double_t phi1 the azimuthal angle at which the volume begins
504 // (angles are counted clouterclockwise) [degrees].
505 // Double_t dphi opening angle of the volume, which extends from
506 // phi1 to phi1+dphi [degree].
507 // Int_t npdv the number of sides of teh cross section between
508 // the given phi limits.
509 // Int_t nz number of planes perpendicular to the z axis
510 // where the dimension of the section is given -
511 // this number should be at least 2 and NP triples
512 // of number must follow.
513 // Double_t *z array [nz] of z coordiates of the sections..
514 // Double_t *rmin array [nz] of radius of teh circle tangent to
515 // the sides of the inner polygon in teh
517 // Double_t *rmax array [nz] of radius of the circle tangent to
518 // the sides of the outer polygon in the
520 // Int_t med media index number.
530 param = new Float_t[n]
533 param[2] = (Float_t)npdv;
534 param[3] = (Float_t)nz;
537 param[5+3*i] = rmin[i];
538 param[6+3*i] = rmax[i];
541 for(i=0;i<3;i++) name[i+1] = gnam[i];
542 gMC->Gsvolu(name,"PGON",fidmed[med],param,n);
546 //______________________________________________________________________
547 void AliITSv11::PolyCone(const char gnam[3],const TString &dis,Double_t phi1,
548 Double_t dphi,Int_t nz,Double_t *z,Double_t *rmin,
549 Double_t *rmax,Int_t med){
550 // Interface to TMC->Gsvolu() for ITS PCON geometry. Poly-cone It has 9
551 // parameters or more. See SetScale() for units. Default units are geant 3
554 // const char gnam[3] 3 character geant volume name. The letter "I"
555 // is appended to the front to indecate that this
557 // TString &dis String containging part discription.
558 // Double_t phi1 the azimuthal angle at which the volume begins
559 // (angles are counted clouterclockwise) [degrees].
560 // Double_t dphi opening angle of the volume, which extends from
561 // phi1 to phi1+dphi [degree].
562 // Int_t nz number of planes perpendicular to the z axis
563 // where the dimension of the section is given -
564 // this number should be at least 2 and NP triples
565 // of number must follow.
566 // Double_t *z Array [nz] of z coordinate of the section.
567 // Double_t *rmin Array [nz] of radius of teh inner circle in the
569 // Double_t *rmax Array [nz] of radius of the outer circle in the
571 // Int_t med media index number.
581 param = new Float_t[n];
584 param[2] = (Float_t) nz;
587 param[4+3*i] = rmin[i];
588 param[5+3*i] = rmax[i];
591 for(i=0;i<3;i++) name[i+1] = gnam[i];
592 gMC->Gsvolu(name,"PCON",fidmed[med],param,n);
596 //______________________________________________________________________
597 void AliITSv11::TubeElliptical(const char gnam[3],const TString &dis,
598 Double_t p1,Double_t p2,Double_t dz,Int_t med){
599 // Interface to TMC->Gsvolu() for ITS ELTU geometries. Elliptical
600 // cross-section Tube. It has 3 parameters. See SetScale()
601 // for units. Default units are geant 3 [cm]. The equation of the surface
602 // is x^2 * p1^-2 + y^2 * p2^-2 = 1.
604 // const char gnam[3] 3 character geant volume name. The letter "I"
605 // is appended to the front to indecate that this
607 // TString &dis String containging part discription.
608 // Double_t p1 semi-axis of the elipse along x.
609 // Double_t p2 semi-axis of the elipse along y.
610 // Double_t dz half-length along the z-axis
611 // Int_t med media index number.
619 param[0] = fScale*p1;
620 param[1] = fScale*p2;
621 param[2] = fScale*dz;
623 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
624 gMC->Gsvolu(name,"ELTU",fidmed[med],param,3);
626 //______________________________________________________________________
627 void AliITSv11::HyperbolicTube(const char gnam[3],const TString &dis,
628 Double_t rmin,Double_t rmax,Double_t dz,
629 Double_t thet,Int_t med){
630 // Interface to TMC->Gsvolu() for ITS HYPE geometries. Hyperbolic tube.
631 // Fore example the inner and outer surfaces are hyperboloids, as would be
632 // foumed by a system of cylinderical wires which were then rotated
633 // tangentially about their centers. It has 4 parameters. See SetScale()
634 // for units. Default units are geant 3 [cm]. The hyperbolic surfaces are
635 // given by r^2 = (ztan(thet)^2 + r(z=0)^2.
637 // const char gnam[3] 3 character geant volume name. The letter "I"
638 // is appended to the front to indecate that this
640 // TString &dis String containging part discription.
641 // Double_t rmin Inner radius at z=0 where tube is narrowest.
642 // Double_t rmax Outer radius at z=0 where tube is narrowest.
643 // Double_t dz half-length along the z-axis
644 // Double_t thet stero angel of rotation of the two faces
646 // Int_t med media index number.
654 param[0] = fScale*rmin;
655 param[1] = fScale*rmax;
656 param[2] = fScale*dz;
659 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
660 gMC->Gsvolu(name,"HYPE",fidmed[med],param,4);
662 //______________________________________________________________________
663 void AliITSv11::TwistedTrapezoid(const char gnam[3],const TString &dis,
664 Double_t dz,Double_t thet,Double_t phi,
665 Double_t twist,Double_t h1,Double_t bl1,
666 Double_t tl1,Double_t apl1,Double_t h2,
667 Double_t bl2,Double_t tl2,Double_t apl2,
669 // Interface to TMC->Gsvolu() for ITS GTRA geometries. General twisted
670 // trapazoid. The faces perpendicular to z are trapazia and their centers
671 // are not necessarily on a line parallel to the z axis as the TRAP.
672 // Additionally, the faces may be twisted so that none of their edges are
673 // parallel. It is a TRAP shape, exept that it is twisted in the x-y plane
674 // as a function of z. The parallel sides perpendicular to the x axis are
675 // rotated with respect to the x axis by an angle TWIST, which is one of
676 // the parameters. The shape is defined by the eight corners and is assumed
677 // to be constructed of straight lines joingin points on the boundry of the
678 // trapezoidal face at Z=-dz to the coresponding points on the face at
679 // z=+dz. Divisions are not allowed. It has 12 parameters. See SetScale()
680 // for units. Default units are geant 3 [cm]. Note: This shape suffers from
681 // the same limitations than the TRAP. The tracking routines assume that
682 // the faces are planar, but htis constraint is not easily expressed in
683 // terms of the 12 parameters. Additionally, no check on th efaces is
684 // performed in this case. Users should avoid to use this shape as much as
685 // possible, and if they have to do so, they should make sure that the
686 // faces are really planes. If this is not the case, the result of the
687 // trasport is unpredictable. To accelerat ethe computations necessary for
688 // trasport, 18 additioanl parameters are calculated for this shape are
689 // 1 DXODZ dx/dz of the line joing the centers of the faces at z=+_dz.
690 // 2 DYODZ dy/dz of the line joing the centers of the faces at z=+_dz.
691 // 3 XO1 x at z=0 for line joing the + on parallel side, perpendicular
692 // corners at z=+_dz.
693 // 4 YO1 y at z=0 for line joing the + on parallel side, + on
694 // perpendicular corners at z=+-dz.
695 // 5 DXDZ1 dx/dz for line joing the + on parallel side, + on
696 // perpendicular corners at z=+-dz.
697 // 6 DYDZ1 dy/dz for line joing the + on parallel side, + on
698 // perpendicular corners at z=+-dz.
699 // 7 X02 x at z=0 for line joing the - on parallel side, + on
700 // perpendicular corners at z=+-dz.
701 // 8 YO2 y at z=0 for line joing the - on parallel side, + on
702 // perpendicular corners at z=+-dz.
703 // 9 DXDZ2 dx/dz for line joing the - on parallel side, + on
704 // perpendicular corners at z=+-dz.
705 // 10 DYDZ2dy/dz for line joing the - on parallel side, + on
706 // perpendicular corners at z=+-dz.
707 // 11 XO3 x at z=0 for line joing the - on parallel side, - on
708 // perpendicular corners at z=+-dz.
709 // 12 YO3 y at z=0 for line joing the - on parallel side, - on
710 // perpendicular corners at z=+-dz.
711 // 13 DXDZ3 dx/dzfor line joing the - on parallel side, - on
712 // perpendicular corners at z=+-dz.
713 // 14 DYDZ3 dydz for line joing the - on parallel side, - on
714 // perpendicular corners at z=+-dz.
715 // 15 XO4 x at z=0 for line joing the + on parallel side, - on
716 // perpendicular corners at z=+-dz.
717 // 16 YO4 y at z=0 for line joing the + on parallel side, - on
718 // perpendicular corners at z=+-dz.
719 // 17 DXDZ4 dx/dz for line joing the + on parallel side, - on
720 // perpendicular corners at z=+-dz.
721 // 18 DYDZ4 dydz for line joing the + on parallel side, - on
722 // perpendicular corners at z=+-dz.
724 // const char gnam[3] 3 character geant volume name. The letter "I"
725 // is appended to the front to indecate that this
727 // TString &dis String containging part discription.
728 // Double_t dz half-length along the z axis.
729 // Double_t thet polar angle of the line joing the center of the
730 // face at -dz to the center of the one at +dz
732 // Double_t phi Azymuthal angle of teh line joing the centre of
733 // the face at -dz to the center of the one at +dz
735 // Double_t twist Twist angle of the faces parallel to the x-y
736 // plane at z=+-dz around an axis parallel to z
737 // passing through their centre [degrees].
738 // Double_t h1 Half-length along y of the face at -dz.
739 // Double_t bl1 half-length along x of the side -h1 in y of the
741 // Double_t tl1 half-length along x of the side at +h1 in y of
742 // the face at -dz in z.
743 // Double_t apl1 Angle with respect to the y ais from the center
744 // of the side at -h1 in y to the centere of the
745 // side at +h1 in y of the face at -dz in z
747 // Double_t h2 half-length along the face at +dz.
748 // Double_t bl2 half-length along x of the side at -h2 in y of
749 // the face at -dz in z.
750 // Double_t tl2 half-length along x of the side at +h2 in y of
751 // the face at +dz in z.
752 // Double_t apl2 angle with respect to the y axis from the center
753 // of the side at -h2 in y to the center of the side
754 // at +h2 in y of the face at +dz in z [degrees].
755 // Int_t med media index number.
763 param[0] = fScale*dz;
767 param[4] = fScale*h1;
768 param[5] = fScale*bl1;
769 param[6] = fScale*tl1;
771 param[8] = fScale*h2;
772 param[9] = fScale*bl2;
773 param[10] = fScale*tl2;
776 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
777 gMC->Gsvolu(name,"GTRA",fidmed[med],param,12);
779 //______________________________________________________________________
780 void AliITSv11::CutTube(const char gnam[3],const TString &dis,Double_t rmin,
781 Double_t rmax,Double_t dz,Double_t phi1,Double_t phi2,
782 Double_t lx,Double_t ly,Double_t lz,Double_t hx,
783 Double_t hy,Double_t hz,Int_t med){
784 // Interface to TMC->Gsvolu() for ITS CTUB geometries. Cut tube. A tube cut
785 // at the extremities with planes not necessarily perpendicular tot he z
786 // axis. It has 11 parameters. See SetScale() for units. Default units are
787 // geant 3 [cm]. phi1 should be smaller than phi2. If this is not the case,
788 // the system adds 360 degrees to phi2.
790 // const char gnam[3] 3 character geant volume name. The letter "I"
791 // is appended to the front to indecate that this
793 // TString &dis String containging part discription.
794 // Double_t rmin Inner radius at z=0 where tube is narrowest.
795 // Double_t rmax Outer radius at z=0 where tube is narrowest.
796 // Double_t dz half-length along the z-axis
797 // Double_t dz half-length along the z-axis
798 // Double_t phi1 Starting angle of the segment [degree].
799 // Double_t phi2 Ending angle of the segment [degree].
800 // Double_t lx x component of a unit vector perpendicular to
802 // Double_t ly y component of a unit vector perpendicular to
804 // Double_t lz z component of a unit vector perpendicular to
806 // Double_t hx x component of a unit vector perpendicular to
808 // Double_t hy y component of a unit vector perpendicular to
810 // Double_t hz z component of a unit vector perpendicular to
812 // Int_t med media index number.
820 param[0] = fScale*rmin;
821 param[1] = fScale*rmax;
822 param[2] = fScale*dz;
832 for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
833 gMC->Gsvolu(name,"CTUB",fidmed[med],param,11);
835 //______________________________________________________________________
836 void AliITSv11::Pos(const char vol[3],Int_t cn,const char moth[3],Double_t x,
837 Double_t y,Double_t z,Int_t irot){
838 // Place a copy of a volume previously defined by a call to GSVOLU inside
839 // its mother volulme moth.
841 // const char vol[3] 3 character geant volume name. The letter "I"
842 // is appended to the front to indecate that this
844 // const char moth[3] 3 character geant volume name of the mother volume
845 // in which vol will be placed. The letter "I" is
846 // appended to the front to indecate that this is an
848 // Double_t x The x positon of the volume in the mother's
850 // Double_t y The y positon of the volume in the mother's
852 // Double_t z The z positon of the volume in the mother's
854 // Int_t irot the index for the rotation matrix to be used.
855 // irot=-1 => unit rotation.
860 char name[4],mother[4];
868 for(i=0;i<3;i++) name[i+1] = vol[i];
870 for(i=0;i<3;i++) mother[i+1] = moth[i];
871 if(irot>=0) r=fidrot[irot];
872 fMC->Gspos(name,mother,param[0],param[1],param[2],r,"ONLY");
874 //______________________________________________________________________
875 void AliITSv11::Matrix(Int_t irot,Double_t thet1,Double_t phi1,
876 Double_t thet2,Double_t phi2,
877 Double_t thet3,Double_t phi3){
878 // Defines a Geant rotation matrix. checks to see if it is the unit
879 // matrix. If so, then no additonal matrix is defined. Stores rotation
880 // matrix irot in the data structure JROTM. If the matrix is not
881 // orthonormal, it will be corrected by setting y' perpendicular to x'
882 // and z' = x' X y'. A warning message is printed in this case.
884 // Int_t irot Intex specifing which rotation matrix.
885 // Double_t thet1 Polar angle for axisw x [degrees].
886 // Double_t phi1 azimuthal angle for axis x [degrees].
887 // Double_t thet12Polar angle for axisw y [degrees].
888 // Double_t phi2 azimuthal angle for axis y [degrees].
889 // Double_t thet3 Polar angle for axisw z [degrees].
890 // Double_t phi3 azimuthal angle for axis z [degrees].
895 Float_t t1,p1,t2,p2,t3,p3;
897 if(thet1==90.0&&phi1==0.0&&thet2==90.0&&phi2==90.0&&thet3==0.0&&phi3==0.0){
898 fidrot[irot] = 0; // Unit matrix
906 AliMatrix(fidrot[irot],t1,p1,t2,p2,t3,p3);
909 //______________________________________________________________________
910 void AliITSv11::Matrix(Int_t irot,Int_t axis,Double_t thet){
911 // Defines a Geant rotation matrix. checks to see if it is the unit
912 // matrix. If so, then no additonal matrix is defined. Stores rotation
913 // matrix irot in the data structure JROTM. If the matrix is not
914 // orthonormal, it will be corrected by setting y' perpendicular to x'
915 // and z' = x' X y'. A warning message is printed in this case.
917 // Int_t irot Intex specifing which rotation matrix.
918 // Int_t axis Axis about which rotation is to be done.
919 // Double_t thet Angle to rotate by [degrees].
926 fidrot[irot] = 0; // Unit matrix
929 case 0: //Rotate about x-axis, x-axis does not change.
930 AliMatrix(fidrot[irot],90.0,0.0,90.0+thet,90.0,thet,90.0);
932 case 1: //Rotate about y-axis, y-axis does not change.
933 AliMatrix(fidrot[irot],-90.0-thet,0.0,90.0,90.0,thet,90.0);
935 case 2: //Rotate about z-axis, z-axis does not change.
936 AliMatrix(fidrot[irot],90.0,thet,90.0,-thet-90.0,0.0,0.0);
939 Error("Matrix","axis must be either 0, 1, or 2. for matrix=%d",
945 //______________________________________________________________________
946 void AliITSv11::Matrix(Int_t irot,Double_t rot[3][3]){
947 // Defines a Geant rotation matrix. checks to see if it is the unit
948 // matrix. If so, then no additonal matrix is defined. Stores rotation
949 // matrix irot in the data structure JROTM. If the matrix is not
950 // orthonormal, it will be corrected by setting y' perpendicular to x'
951 // and z' = x' X y'. A warning message is printed in this case.
953 // Int_t irot Intex specifing which rotation matrix.
954 // Double_t rot[3][3] The 3 by 3 rotation matrix.
960 if(rot[0][0]==1.0&&rot[1][1]==1.0&&rot[2][2]==1.0&&
961 rot[0][1]==0.0&&rot[0][2]==0.0&&rot[1][0]==0.0&&
962 rot[1][2]==0.0&&rot[2][0]==0.0&&rot[2][1]==0.0){
963 fidrot[irot] = 0; // Unit matrix
965 Double_t si,c=180./TMath::Pi();
968 ang[1] = TMath::ATan2(rot[0][1],rot[0][0]);
969 if(TMath::Cos(ang[1])!=0.0) si = rot[0][0]/TMath::Cos(ang[1]);
970 else si = rot[0][1]/TMath::Sin(ang[1]);
971 ang[0] = TMath::ATan2(si,rot[0][2]);
973 ang[3] = TMath::ATan2(rot[1][1],rot[1][0]);
974 if(TMath::Cos(ang[3])!=0.0) si = rot[1][0]/TMath::Cos(ang[3]);
975 else si = rot[1][1]/TMath::Sin(ang[3]);
976 ang[2] = TMath::ATan2(si,rot[1][2]);
978 ang[5] = TMath::ATan2(rot[2][1],rot[2][0]);
979 if(TMath::Cos(ang[5])!=0.0) si = rot[2][0]/TMath::Cos(ang[5]);
980 else si = rot[2][1]/TMath::Sin(ang[5]);
981 ang[4] = TMath::ATan2(si,rot[2][2]);
983 for(Int_t i=0;i<6;i++) {ang[i] *= c; if(ang[i]<0.0) ang[i] += 360.;}
984 AliMatrix(fidrot[irot],ang[0],ang[1],ang[2],ang[3],ang[4],ang[5]);
987 //______________________________________________________________________
988 Float_t AliITSv11::GetA(Int_t z){
989 // Returns the isotopicaly averaged atomic number.
991 // Int_t z Elemental number
995 // The atomic mass number.
996 const Float_t A[]={ 1.00794 , 4.0026902, 6.941 , 9.012182 , 10.811 ,
997 12.01007 , 14.00674 , 15.9994 , 18.9984032, 20.1797 ,
998 22.98970 , 24.3050 , 26.981538, 28.0855 , 30.973761,
999 32.066 , 35.4527 , 39.948 , 39.0983 , 40.078 ,
1000 44.95591 , 47.867 , 50.9415 , 51.9961 , 54.938049,
1001 55.845 , 58.933200 , 58.6934 , 63.546 , 65.39 ,
1002 69.723 , 72.61 , 74.92160 , 78.96 , 79.904 ,
1003 83.80 , 85.4678 , 87.62 , 88.9085 , 91.224 ,
1004 92.90638 , 95.94 , 97.907215, 101.07 ,102.90550 ,
1005 106.42 ,107.8682 ,112.411 ,114.818 ,118.710 ,
1006 121.760 ,127.60 ,126.90447 ,131.29 ,132.90545 ,
1007 137.327 ,138.9055 ,140.116 ,140.90765 ,144.24 ,
1008 144.912746,150.36 ,151.964 ,157.25 ,158.92534 ,
1009 162.50 ,164.93032 ,167.26 ,168.93421 ,173.04 ,
1010 174.967 ,178.49 ,180.9479 ,183.84 ,186.207 ,
1011 190.23 ,192.217 ,195.078 ,196.96655 ,200.59 ,
1012 204.3833 ,207.2 ,208.98038,208.982415 ,209.987131,
1013 222.017570 ,223.019731,226.025402,227.027747 ,232.0381 ,
1014 231.03588 238.0289};
1017 Error("GetA","z must be 0<z<93. z=%d",z);
1022 //______________________________________________________________________
1023 Float_t AliITSv11::GetStandardMaxStepSize(Int_t istd){
1024 // Returns one of a set of standard Maximum Step Size values.
1026 // Int_t istd Index to indecate which standard.
1030 // The appropreate standard Maximum Step Size value [cm].
1031 Float_t t[]={1.0, // default
1032 0.0075, // Silicon detectors...
1033 1.0, // Air in central detectors region
1034 1.0 // Material in non-centeral region
1038 //______________________________________________________________________
1039 Float_t AliITSv11::GetStandardThetaMax(Int_t istd){
1040 // Returns one of a set of standard Theata Max values.
1042 // Int_t istd Index to indecate which standard.
1046 // The appropreate standard Theta max value [degrees].
1047 Float_t t[]={0.1, // default
1048 0.1, // Silicon detectors...
1049 0.1, // Air in central detectors region
1050 1.0 // Material in non-centeral region
1054 //______________________________________________________________________
1055 Float_t AliITSv11::GetStandardEfraction(Int_t istd){
1056 // Returns one of a set of standard E fraction values.
1058 // Int_t istd Index to indecate which standard.
1062 // The appropreate standard E fraction value [#].
1063 Float_t t[]={0.1, // default
1064 0.1, // Silicon detectors...
1065 0.1, // Air in central detectors region
1066 1.0 // Material in non-centeral region
1070 //______________________________________________________________________
1071 void AliITSv11::Element(Int_t imat,const char* name,Int_t z,Double_t dens,
1073 // Defines a Geant single element material and sets its Geant medium
1074 // proporties. The average atomic A is assumed to be given by their
1075 // natural abundances. Things like the radiation length are calculated
1078 // Int_t imat Material number.
1079 // const char* name Material name. No need to add a $ at the end.
1080 // Int_t z The elemental number.
1081 // Double_t dens The density of the material [g/cm^3].
1082 // Int_t istd Defines which standard set of transport parameters
1083 // which should be used.
1088 Float_t rad,Z,A=GetA(z),tmax,stemax,deemax,epsilon;
1092 len = strlng(name)+1;
1093 name2 = new char[len];
1094 strncpy(name2,name,len-1);
1095 name2[len-1] = '\0';
1098 rad = GetRadLength(z)/dens;
1099 AliMaterial(imat,name2,A,Z,dens,rad,0.0,0,0);
1100 tmax = GetStandardTheataMax(istd); // degree
1101 stemax = GetStandardMaxStepSize(istd); // cm
1102 deemax = GetStandardEfraction(istd); // #
1103 epsilon = GetStandardEpsilon(istd);
1104 AliMedium(imat,name2,imat,0,gAlice->Field()->Integ(),
1105 gAlice->Field()->Max(),tmax,stemax,deemax,epsilon,0.0);
1108 //______________________________________________________________________
1109 void AliITSv11::MixtureByWeight(Int_t imat,const char* name,Int_t *z,
1110 Double_t *w,Double_t dens,Int_t n,Int_t istd){
1111 // Defines a Geant material by a set of elements and weights, and sets
1112 // its Geant medium proporties. The average atomic A is assumed to be
1113 // given by their natural abundances. Things like the radiation length
1114 // are calculated for you.
1116 // Int_t imat Material number.
1117 // const char* name Material name. No need to add a $ at the end.
1118 // Int_t *z Array of The elemental numbers.
1119 // Double_t *w Array of relative weights.
1120 // Double_t dens The density of the material [g/cm^3].
1121 // Int_t n the number of elements making up the mixture.
1122 // Int_t istd Defines which standard set of transport parameters
1123 // which should be used.
1128 Float_t rad,*Z,*A,tmax,stemax,deemax,epsilon;
1134 len = strlng(name)+1;
1135 name2 = new char[len];
1136 strncpy(name2,name,len-1);
1137 name2[len-1] = '\0';
1139 for(i=0;i<n;i++){Z[i] = (Float_t)z[i];A[i] = (Float_t)GetA(z[i]);
1140 W[i] = (Float_t)w[i]}
1141 rad = GetRadLength(z)/dens;
1142 AliMixture(imat,name2,A,Z,dens,n,W);
1143 tmax = GetStandardTheataMax(istd); // degree
1144 stemax = GetStandardMaxStepSize(istd); // cm
1145 deemax = GetStandardEfraction(istd); // #
1146 epsilon = GetStandardEpsilon(istd);
1147 AliMedium(imat,name2,imat,0,gAlice->Field()->Integ(),
1148 gAlice->Field()->Max(),tmax,stemax,deemax,epsilon,0.0);
1151 //______________________________________________________________________
1152 void AliITSv11::MixtureByNumber(Int_t imat,const char* name,Int_t *z,
1153 Int_t *w,Double_t dens,Int_t n,Int_t istd){
1154 // Defines a Geant material by a set of elements and number, and sets
1155 // its Geant medium proporties. The average atomic A is assumed to be
1156 // given by their natural abundances. Things like the radiation length
1157 // are calculated for you.
1159 // Int_t imat Material number.
1160 // const char* name Material name. No need to add a $ at the end.
1161 // Int_t *z Array of The elemental numbers.
1162 // Int_t_t *w Array of relative number.
1163 // Double_t dens The density of the material [g/cm^3].
1164 // Int_t n the number of elements making up the mixture.
1165 // Int_t istd Defines which standard set of transport parameters
1166 // which should be used.
1171 Float_t rad,*Z,*A,tmax,stemax,deemax,epsilon;
1177 len = strlng(name)+1;
1178 name2 = new char[len];
1179 strncpy(name2,name,len-1);
1180 name2[len-1] = '\0';
1182 for(i=0;i<n;i++){Z[i] = (Float_t)z[i];A[i] = (Float_t)GetA(z[i]);
1183 W[i] = (Float_t)w[i]}
1184 rad = GetRadLength(z)/dens;
1185 AliMixture(imat,name2,A,Z,dens,-n,W);
1186 tmax = GetStandardTheataMax(istd); // degree
1187 stemax = GetStandardMaxStepSize(istd); // cm
1188 deemax = GetStandardEfraction(istd); // #
1189 epsilon = GetStandardEpsilon(istd);
1190 AliMedium(imat,name2,imat,0,gAlice->Field()->Integ(),
1191 gAlice->Field()->Max(),tmax,stemax,deemax,epsilon,0.0);
1193 //______________________________________________________________________
1194 void AliITSv11::SSDConeDetail(TVector3 &tran,const char moth[3],Int_t mat0){
1195 // Defines the volumes and materials for the ITS SSD Support cone.
1196 // Based on drawings ALR-0767 and ALR-0767/3. Units are in mm.
1198 // Double_t zShift The z shift to be applied to the final volume.
1203 Double_t th = 13.0; //mm, Thickness of Rohacell+carbon fiber
1204 Double_t ct=1.5; //mm, Carbon finber thickness
1205 Double_t r=15.0; // mm, Radius of curvature.
1206 Double_t tc=51.0; // angle of SSD cone [degrees].
1207 Double_t sintc=Sind(tc),costc=Cosd(tc),tantc=Tand(tc);
1208 Double_t z0=0.0,Routmax=0.5*985.,Routmin=0.5*945.,Rholemax=0.5*890.;
1209 Double_t Rholemin=0.5*740.,Rin=0.5*560.;
1210 Int_t nspoaks=12,ninscrews=40,npost=4;
1211 Int_t SSDcf=man0+1; // SSD support cone Carbon Fiber materal number.
1212 Int_t SSDfs=mat0+2; // SSD support cone inserto stesalite 4411w.
1213 Int_t SSDfo=mat0+3; // SSD support cone foam, Rohacell 50A.
1214 Int_t SSDsw=mat0+4; // SSD support cone screw material,Stainless steal
1215 Double_t t; // some general angle [degrees].
1216 Double_t phi0=0.0,dphi=360.0;
1217 Int_t i,j,n,nz,nrad=0;
1220 // Lets start with the upper left outer carbon fiber surface.
1221 // Between za[2],rmaxa[2] and za[4],rmaxa[4] there is a curved section
1222 // given by rmaxa = rmaxa[2]-r*Sind(t) for 0<=t<=tc and
1223 // za = za[2] + r*Cosd(t) for 0<=t<=tc. Simularly between za[1],rmina[1
1224 // and za[3],rmina[3] there is a curve section given by
1225 // rmina = rmina[1]-r*Sind(t) for 0<=t<=tc and za = za[1]+r&Sind(t)
1226 // for t<=0<=tc. These curves have been replaced by straight lines
1227 // between the equivelent points for simplicity.
1228 Double_t dza = th/sintc-(Routmax-Routmin)/tantc;
1229 if(dza<=0){ // The number or order of the points are in error for a proper
1231 Error("SSDcone","The definition of the points for a call to PCONS is"
1232 " in error. abort.");
1236 Double_t *za = new Double_t[nz];
1237 Double_t *rmina = new Double_t[nz];
1238 Double_t *rmaxa = new Double_t[nz];
1242 za[1] = za[0]+13.5-5.0 - dza; // za[2] - dza.
1243 rmina[1] = rmina[0];
1245 za[2] = za[0]+13.5-5.0; // From Drawing ALR-0767 and ALR-0767/3
1246 rmaxa[2] = rmaxa[0];
1247 za[3] = za[1]+rc*sintc;
1248 rmina[3] = rmina[1]-rc*sintc;
1249 rmina[2] = rmina[1]+(rmina[3]-rmina[1])*(za[2]-za[1])/(za[3]-za[1]);
1250 za[4] = za[2]+rc*sintc;
1251 rmaxa[4] = rmaxa[2]-rc*sintc;
1252 rmaxa[3] = rmaxa[2]+(rmaxa[4]-rmaxa[2])*(za[3]-za[2])/(za[4]-za[2]);
1253 rmina[5] = Rholemax;
1254 za[5] = za[3]+(za[4]-za[3])*(rmina[5]-rmina[3])/(rmina[4]-rmina[3]);
1255 rmina[4] = rmina[3]+(rmina[5]-rmina[3])*(za[4]-za[3])/(za[5]-za[3]);
1256 za[6] = th/sinth+za[5];
1257 rmina[6] = Rholemax;
1258 rmaxa[6] = rmina[6];
1259 rmaxa[5] = rmaxa[4]+(rmaxa[6]-rmaxa[4])*(za[5]-za[4])/(za[6]-za[4]);
1261 PolyCone("SCA","SSD Suport cone Carbon Fiber Surface outer left",
1262 phi0,dphi,nz,*z,*rmin,*rmax,SSDcf);
1263 Pos("SCA",1,moth,trans.x(),trans.y(),trans.z(),0);
1265 Pos("SCA",2,moth,trans.x(),trans.y(),-trans.z(),1);
1266 Za[0] = 1.; Wa[0] = ; // Hydrogen Content
1267 Za[1] = 6.; Wa[1] = ; // Carbon Content
1268 MixtureByWeight(SSDcf,"Carbon Fiber for SSD support cone",Z,W,dens,2);
1270 // Now lets define the Inserto Stesalite 4411w material volume.
1272 Double_t *zb = new Double_t[nz];
1273 Double_t *rminb = new Double_t[nz];
1274 Double_t *rmaxb = new Double_t[nz];
1276 rminb[0] = rmina[0]+ct;
1277 rmaxb[0] = rmaxa[0]-ct;
1279 rminb[1] = rminb[0];
1280 rmaxb[1] = rmaxb[0];
1282 rmaxb[2] = rmaxb[1];
1283 zb[3] = za[4] - ct/sintc;
1284 rmaxb[3] = rmaxb[2] - (rc-ct)*sintc;
1285 zb[4] = za[3]+ct/sintc;
1286 rminb[4] = rminb[1]-(rc-ct)*sintc;
1287 rminb[2] = rminb[1]+(rminb[4]-rminb[1])*(zb[2]-zb[1])/(zb[4]-zb[1]);
1288 rminb[3] = rminb[1]+(rminb[4]-rminb[1])*(zb[3]-zb[1])/(zb[4]-zb[1]);
1289 zb[5] = zb[4]+(ct-2.*ct)/sintc;
1290 rminb[5] = rminb[4]+(ct-2.*ct)*tantc;
1291 rmaxb[5] = rminb[5];
1292 rmaxb[4] = rmaxb[3]+(rmaxb[5]-rmaxb[3])*(zb[4]-zb[3])/(zb[5]-zb[3]);
1293 PolyCone("SCB","SSD Suport cone Inserto Stesalite left edge",
1294 phi0,dphi,nz,*zb,*rminb,*rmaxb,SSDfs);
1295 Pos("SCB",1,"SCA",0.0,.0,0.0,0);
1296 Za[0] = 1.; Wa[0] = ; // Hydrogen Content
1297 Za[1] = 6.; Wa[1] = ; // Carbon Content
1298 MixtureByWeight(SSDfs,"Inserto stealite 4411w for SSD support cone",
1301 // Now lets define the Rohacell foam material volume.
1303 Double_t *zc = new Double_t[nz];
1304 Double_t *rminc = new Double_t[nz];
1305 Double_t *rmaxc = new Double_t[nz];
1307 rminc[0] = rminb[4];
1308 rmaxc[0] = rmminc[0];
1310 rmaxc[1] = rminb[5];
1311 zc[2] = za[5] + ct/sintc;
1312 rminc[2] = rmina[5];
1313 rminc[1] = rminc[0] +(rminc[2]-rminc[0]*(zc[1]-zc[0])/(zc[2]-zc[0]);
1314 zc[3] = za[6] - ct/sintc;
1315 rminc[3] = rmina[6];
1316 rmaxc[3] = rminc[3];
1317 rmaxc[2] = rmaxc[1]+(rmaxc[3]-rmaxc[1])*(zc[2]-zc[1])/(zc[3]-zc[1]);
1318 PolyCone("SCC","SSD Suport cone Rohacell foam left edge",
1319 phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDfs);
1320 Pos("SCC",1,"SCA",0.0,.0,0.0,0);
1321 Za[0] = 1.; Wa[0] = ; // Hydrogen Content
1322 Za[1] = 6.; Wa[1] = ; // Carbon Content
1323 MixtureByWeight(SSDfo,"Foam core (Rohacell 50A) for SSD support cone",
1326 //______________________________________________________________________
1327 void AliITSv11::SSDConeDetail(TVector3 &tran,const char moth[3]){
1328 // Defines the volumes and materials for the ITS SSD Support cone.
1329 // Based on drawings ALR-0767 and ALR-0767/3. Units are in mm.
1331 // Double_t zShift The z shift to be applied to the final volume.
1336 Double_t *za,*rmina,*rmaxa,phi0=0.0,dphi=360.0;
1337 Int_t i,j,n,nz,nrad=0;
1338 Double_t ct = 13.0; //mm, Thickness of Rohacell+carbon fiber
1339 Double_t cthick=1.5; //mm, Carbon finber thickness
1340 Double_t r=15.0; // mm, Radius of curvature.
1341 Double_t tc=51.0; // angle of SSD cone [degrees].
1342 Double_t t; // some general angle [degrees].
1343 Int_t SSDcf=; // SSD support cone Carbon Fiber materal number.
1344 Int_t SSDfs=; // SSD support cone inserto stesalite 4411w.
1345 Int_t SSDfo=; // SSD support cone foam, Rohacell 50A.
1348 // Lets start with the upper left outer carbon fiber surface.
1350 za = new Double_t[nz];
1351 rmina = new Double_t[nz];
1352 rmaxa = new Double_t[nz];
1356 rmina[0] = rmaxa[0] - cthick;
1358 za[1] = 13.5 - 5.0; // The original size of 13.5 (ALR-0767) is milled down
1359 rmaxa[1] = rmaxa[0]; // by 5mm to give a well defined reference surface
1360 rmina[1] = rmina[0]; // (ALR-0767/3).
1361 // The curved section is given by the following fomula
1362 // rmax = -r*Sind(t)+rmaxa[1] for 0<=t<=tc. Outer curve.
1363 // rmin = -(r-cthick)*Sind(t)+rmina[1] for 0<=t<=tc. Inner curve.
1364 // zout = r*Cosd(t)+za[1] for 0<=t<=tc. Outer curve.
1365 // zin = (r-cthick)*Sind(t)+za[1] for 0<=t<=tx. Inner curve.
1366 // We will only use a straight line between the beggining and ending points
1367 // of the arch (for now at least).
1368 za[2] = (r-cthick)*Sind(tc)+za[1];
1369 rmina[2] = -(r-cthick)*Sind(tc)+rmina[1];
1370 rmaxa[2] = za[1]+(r-cthick)*Sind(tc);
1372 za[3] = r*Sind(tc)+za[1];
1373 rmaxa[3] = -r*Sind(tc)+rmaxa[1];
1374 // angled section. surface is given by the following equations
1375 // Rout = -Tand(tc)*(z-za[3]) + rmaxa[3], outer surface.
1376 // Rin = -Tand(tx)*(z-za[2]) + rmina2], inner surface.
1377 rmina[3] = -Tand(tc)*(za[3]-za[2]) + rmina[2];
1378 // Point of whole. Whole surface has fixed radius = 890.0/2 +cthick mm
1379 // exclude carbon fiber covering whole.
1380 rmina[4] = 890.0/2.+cthick ; // Inner whole surface radius (ALR-0767)
1381 za[4] = (rmina[4] - rmina[2])/(-Tand(tc)) + za[2];
1382 rmaxa[4] = -Tand(tc)*(za[4]-za[3])+rmaxa[3];
1384 rmaxa[5] = rmina[4];
1385 rmina[5] = rmina[4];
1386 za[5] = (rmaxa[5] - rmaxa[3])/(-Tand(tc)) +za[3];
1388 PolyCone("SCA","SSD Suport cone Carbon Fiber Surface outer left",
1389 phi0,dphi,nz,*z,*rmin,*rmax,SSDcf);
1390 Pos("SCA",1,moth,trans.x(),trans.y(),trans.z(),0);
1392 Pos("SCA",2,moth,trans.x(),trans.y(),-trans.z(),1);
1393 Za[0] = 1.; Wa[0] = ; // Hydrogen Content
1394 Za[1] = 6.; Wa[1] = ; // Carbon Content
1395 MixtureByWeight(SSDcf,"Carbon Fiber for SSD support cone",Z,W,dens,2);
1396 //====================================================================
1397 // Now for the upper left inner carbon fiber suface.
1398 // Start by working backwards
1400 zd = new Double_t[nz];
1401 rmind = new Double_t[nz];
1402 rmaxd = new Double_t[nz];
1403 // The two surfaces of this carbon fiber inner layer are given by
1404 // Rout = -Tand(tc)*(z-za[3])+rmaxa[3]-ct/cosd(tc)
1405 // Rin = -Tand(tc)*(z-za[3])+rmaxa[3]-(ct-cthick)/Cosd(tc)
1406 rmind[4] = rmina[4]; // Stop at the same radii as part a.
1407 zd[4] = (rmind[4]-rmaxa[3]+ct/Cosd(tc))/(-Tand(tc)) + za[3];
1408 rmaxd[4] = -Tand(tc)*(zd[4]-za[3])+rmaxa[3]-(ct-cthick)/Cosd(tc);
1410 rmind[5] = rmina[4]; // Stop at the same radii as part a.
1411 rmaxd[5] = rmind[5];
1412 zd[5] = (rmind[5]-rmaxa[3]+(ct-cthick)/Cosd(tc))/(-Tand(tc)) + za[3];
1413 // The other easy point is the very beginning.
1414 zd[0] = za[0]; // same staring z as with the outer suface.
1416 rmaxd[0] = rmind[0]+cthick;
1417 // The rest of this volume is defined by the lines || z axis starting
1418 // at zd[0] and rmind[0]/rmaxd[0], and the lines representing the
1419 // slopped surfaces defined above plus the curved sections connecting
1420 // the two (covering tc degrees of arc and having a radius of r mm).
1421 // The coordinate zd[1] is defined as the z coordinate of the point
1422 // of intersection between the line R=rmind[0]-r and the line
1423 // R=-Tand(tc)*(z-za[3])+rmaxa[3]-(ct+r)/Cosd(ct).
1424 zd[1] = (rmaxa[3]+r-rmind[0])/Tand(tc)-(ct+r)/Sind(tc)+za[3];
1425 rmind[1] = rmind[0];
1426 rmaxd[1] = rmaxd[0];
1428 zd[2] = zd[1] + r*Sind(tc);
1429 rmind[2] = rmind[1] - r*Sind(rc);
1431 zd[3] = zd[1] + (r+cthick)*Sind(tc);
1432 rmax[3] = rmax[1] - (r+cthick)*Sind(tc);
1433 // Get rmax[2] and rmin[3] from the line segments replacing the arc.
1434 rmax[2] = rmaxd[1]+(rmaxd[3]-rmaxd[1])*(zd[2]-zd[1])/(zd[3]-zd[1]);
1435 rmin[3] = rmind[2]+(rmind[4]-rmind[2])*(zd[3]-zd[2])/(zd[4]-dz[2]);
1437 PolyCone("SCD","SSD Suport cone Carbon Fiber Surface inner left",
1438 phi0,dphi,nz,*zd,*rmind,*rmaxd,SSDcf);
1439 Pos("SCD",1,moth,trans.x(),trans.y(),trans.z(),0);
1440 Pos("SCD",2,moth,trans.x(),trans.y(),-trans.z(),1);
1441 //================================================================
1442 // Now for the fill between these two volumes. There are two different
1443 // materials. The line separating them goes through the points
1444 // zd[2],rmind[2] and zd[3],rmaxd[3]. Starting with the Inserto Stesalite
1447 zb = new Double_t[nz];
1448 rminb = new Double_t[nz];
1449 rmaxb = new Double_t[nz];
1452 rminb[0] = rmaxd[0];
1453 rmaxb[0] = rmina[0];
1456 rminb[1] = rmaxd[1];
1457 rmaxb[1] = rmina[1];
1460 rmaxb[2] = rmina[1];
1461 rminb[2] = rmaxd[2]+(rmaxd[3]-rmaxd[2])*(zb[2]-zd[2])/(zd[3]-zd[2]);
1464 rmaxb[3] = rmina[2];
1465 rminb[3] = rmaxd[2]+(rmaxd[3]-rmaxd[2])*(zb[3]-zd[2])/(zd[3]-zd[2]);
1468 rminb[4] = rmind[2];
1469 rmaxb[4] = rmina[2]+(rmina[3]-rmina[2])*(zb[4]-za[2])/(za[3]-za[2]);
1471 zb[5] = zb[4]+(ct-2.*cthick)*Sind(tc);
1472 rminb[5] = rmina[2]-(rmina[3]-rmina[2])*(zb[5]-za[2])/(za[3]-za[2]);
1473 rmaxb[5] = rminb[5];
1475 PolyCone("SCB","SSD Suport cone Inserto Stesalite left edge",
1476 phi0,dphi,nz,*zb,*rminb,*rmaxb,SSDfs);
1477 Pos("SCB",1,moth,trans.x(),trans.y(),trans.z(),0);
1478 Pos("SCB",2,moth,trans.x(),trans.y(),-trans.z(),1);
1479 Za[0] = 1.; Wa[0] = ; // Hydrogen Content
1480 Za[1] = 6.; Wa[1] = ; // Carbon Content
1481 MixtureByWeight(SSDfs,"Inserto stealite 4411w for SSD support cone",
1483 //================================================================
1484 // Now for the section filled with Roacell foam.
1486 zc = new Double_t[nz];
1487 rminc = new Double_t[nz];
1488 rmaxc = new Double_t[nz];
1490 rminc[0] = rminb[4];
1491 rmaxc[0] = rminc[0];
1494 rminc[1] = rmaxd[2]+(rmaxd[3]-rmaxd[2])*(zc[1]-zd[2])/(zd[3]-zd[2]);;
1495 rmaxc[1] = rminb[5];
1498 rminc[2] = rmaxd[5];
1499 rmaxc[2] = rmina[2]+(rmina[3]-rmina[2])*(zc[2]-za[2])/(za[3]-za[2]);
1502 rminc[3] = rmina[4];
1503 rmaxc[3] = rmina[4];
1505 PolyCone("SCC","SSD Suport cone Inserto foam left edge",
1506 phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDfo);
1507 Pos("SCC",1,moth,trans.x(),trans.y(),trans.z(),0);
1508 Pos("SCC",2,moth,trans.x(),trans.y(),-trans.z(),1);
1509 Za[0] = 1.; Wa[0] = ; // Hydrogen Content
1510 Za[1] = 6.; Wa[1] = ; // Carbon Content
1511 MixtureByWeight(SSDfo,"Foam core (Rohacell 50A) for SSD support cone",
1513 //=================================================================
1514 // now for the part of the SSD cone which has the wholes in it.
1515 // We now define the spoaks. Start with outer carbon fiber surface
1516 // Follows the same surface as the sloped part of SCA.
1517 // The Spoaks have a radius matching them to the holes. This radius (in
1518 // phi) can not be reproduce.
1519 Double_t sdr = 0.5*(890.-740.)+2*cthick; // length of spoak section
1520 // including the carbon finber thickness covering the opening (ALR-0767).
1521 phi0 = 12.5; // starting phi of spoak (centered about phi0=0).
1522 dphi = 5.0; // From (ALR-0767).
1523 ze = new Double_t[nz];
1524 rmine = new Double_t[nz];
1525 rmaxe = new Double_t[nz];
1528 rmine[0] = rmina[4];
1529 rmaxe[0] = rmine[0];
1532 rmaxe[1] = rmina[5];
1533 rmine[1] = rmina[2]-(rmina[4]-rmina[2])*(ze[1]-za[2])/(za[4]-za[2]);
1535 rmine[2] = rmine[0] - sdr;
1536 ze[2] = za[2]+(rmina[2]-rmine[2])*(za[4]-za[2])/(rmina[4]-rmina[2]);
1537 rmaxe[2] = rmaxa[3]-(rmaxa[5]-rmaxa[3])*(ze[2]-za[3])/(za[5]-za[3]);
1539 rmine[3] = rmine[2];
1540 ze[3] = za[3]+(rmaxa[3]-rmine[3])*(za[5]-za[3])/(rmaxa[5]-rmaxa[3]);
1541 rmaxe[3] = rmine[2];
1543 PolyCone("SCE","SSD Suport cone carbon fiber outer surface of spoak face",
1544 phi0,dphi,nz,*ze,*rmine,*rmaxe,SSDcf);
1545 Pos("SCE",1,moth,trans.x(),trans.y(),trans.z(),0); // place first copy
1546 for(i=1;i<12;i++){ // There are 12 spoaks around.
1547 ZMatrix(1+i,((Double_t)i)*360./12.);
1548 Pos("SCE",i+1,moth,trans.x(),trans.y(),trans.z(),1+i);
1551 Pos("SCE",1,moth,trans.x(),trans.y(),-trans.z(),1); // place first copy
1552 for(i=1;i<12;i++){ // There are 12 spoaks around.
1553 Matrix(13+i,180.0,0.0,((Double_t)i)*360./12.); // ??????????
1554 Pos("SCE",i+1,moth,trans.x(),trans.y(),-trans.z(),13+i);
1557 //Now for the inner carbon fiber surface.
1558 zf = new Double_t[nz];
1559 rminf = new Double_t[nz];
1560 rmaxf = new Double_t[nz];
1563 rminf[0] = rmind[5];
1564 rmaxf[0] = rmine[0];
1567 rmaxf[1] = rmind[5];
1568 rminf[1] = rmind[2]-(rmind[4]-rmind[2])*(zf[1]-zd[2])/(zd[4]-zd[2]);
1570 rminf[2] = rmine[0] - sdr;
1571 zf[2] = zd[2]+(rmind[2]-rminf[2])*(zd[4]-zd[2])/(rmind[4]-rmind[2]);
1572 rmaxf[2] = rmaxd[3]-(rmaxd[5]-rmaxd[3])*(zf[2]-zd[3])/(zd[5]-zd[3]);
1574 rminf[3] = rmine[2];
1575 zf[3] = zd[3]+(rmaxd[3]-rminf[3])*(zd[5]-zd[3])/(rmaxd[5]-rmaxd[3]);
1576 rmaxf[3] = rmine[2];
1578 PolyCone("SCF","SSD Suport cone carbon fiber inner surface of spoak face",
1579 phi0,dphi,nz,*zf,*rminf,*rmaxf,SSDcf);
1580 Pos("SCF",1,moth,trans.x(),trans.y(),trans.z(),0); // place first copy
1581 for(i=1;i<12;i++){ // There are 12 spoaks around.
1582 Pos("SCF",i+1,moth,trans.x(),trans.y(),trans.z(),1+i);
1585 Pos("SCF",1,moth,trans.x(),trans.y(),-trans.z(),1); // place first copy
1586 for(i=1;i<12;i++){ // There are 12 spoaks around.
1587 Pos("SCF",i+1,moth,trans.x(),trans.y(),-trans.z(),13+i);
1590 // Now for the foam filling of this spoak
1591 zg = new Double_t[nz];
1592 rming = new Double_t[nz];
1593 rmaxg = new Double_t[nz];
1595 phi0 = phi0+cthick/(0.25*(890.+740.));// Make space for Carbon fiber
1596 dphi = dphi-cthick/(0.25*(890.+740.));// covering hole on both sides.
1597 // thickness of this covering ic cthick. As given above it varies allong
1598 // the length of the spoak. No other solusion
1601 rming[0] = rmaxf[1];
1602 rmaxg[0] = rming[0];
1605 rmaxg[1] = rmine[0];
1606 rming[1] = rmind[2]-(rmind[4]-rmind[2])*(zg[1]-zd[2])/(zd[4]-zd[2]);
1608 rming[2] = rminf[3];
1609 zg[2] = zd[2]+(rmind[2]-rming[2])*(zd[4]-zd[2])/(rmind[4]-rmind[2]);
1610 rmaxg[2] = rmaxd[3]-(rmaxd[5]-rmaxd[3])*(zg[2]-zd[3])/(zd[5]-zd[3]);
1612 rming[3] = rmine[2];
1613 zg[3] = zd[3]+(rmaxd[3]-rming[3])*(zd[5]-zd[3])/(rmaxd[5]-rmaxd[3]);
1614 rmaxg[3] = rming[3];
1616 PolyCone("SCG","SSD Suport cone spoak foam filling",
1617 phi0,dphi,nz,*zg,*rming,*rmaxg,SSDfo);
1618 Pos("SCG",1,moth,trans.x(),trans.y(),trans.z(),0); // place first copy
1619 for(i=1;i<12;i++){ // There are 12 spoaks around.
1620 Pos("SCG",i+1,moth,trans.x(),trans.y(),trans.z(),1+i);
1623 Pos("SCG",1,moth,trans.x(),trans.y(),-trans.z(),1); // place first copy
1624 for(i=1;i<12;i++){ // There are 12 spoaks around.
1625 Pos("SCG",i+1,moth,trans.x(),trans.y(),-trans.z(),13+i);
1627 //============================================================
1628 // now for the carbon fiber covering the top of this hole.
1630 zh = new Double_t[nz];
1631 rminh = new Double_t[nz];
1632 rmaxh = new Double_t[nz];
1638 rminh[0]=rmaxh[0]-cthick;
1645 PolyCone("SCI","SSD Suport cone carbon fiber inner top surface of hole",
1646 phi0,dphi,nz,*zi,*rmini,*rmaxi,SSDcf);
1647 //Pos("SCI",1,moth,trans.x(),trans.y(),trans.z(),0);
1648 //Pos("SCI",2,moth,trans.x(),trans.y(),-trans.z(),1);
1650 // now for the carbon fiber covering the bottom of this hole.
1652 zj = new Double_t[nz];
1653 rminj = new Double_t[nz];
1654 rmaxj = new Double_t[nz];
1657 rminj[0]=rmaxj[0]-cthick;
1664 PolyCone("SCJ","SSD Suport cone carbon fiber inner bottom surface of hole",
1665 phi0,dphi,nz,*zi,*rmini,*rmaxi,SSDcf);
1666 //Pos("SCJ",1,moth,trans.x(),trans.y(),trans.z(),0);
1667 //Pos("SCJ",2,moth,trans.x(),trans.y(),-trans.z(),1);
1669 //Now for the carbon fiber on the sides of the spoakes.
1670 //==============================================================
1671 delete[] za;delete[] rmina;delete[] rmaxa;
1672 delete[] zb;delete[] rminb;delete[] rmaxb;
1673 delete[] zc;delete[] rminc;delete[] rmaxc;
1674 delete[] zd;delete[] rmind;delete[] rmaxd;
1675 delete[] ze;delete[] rmine;delete[] rmaxe;
1676 delete[] zf;delete[] rminf;delete[] rmaxf;
1677 delete[] zg;delete[] rming;delete[] rmaxg;
1678 delete[] zh;delete[] rminh;delete[] rmaxh;
1679 delete[] zi;delete[] rmini;delete[] rmaxi;
1680 delete[] zj;delete[] rminj;delete[] rmaxj;
1681 // Set back to cm default scale before exiting.
1685 //______________________________________________________________________
1686 void AliITSv11::CreateGeometry(){
1687 ////////////////////////////////////////////////////////////////////////
1688 // This routine defines and Creates the geometry for version 11 of the ITS.
1689 ////////////////////////////////////////////////////////////////////////
1691 //______________________________________________________________________
1692 void AliITSv11::CreateMaterials(){
1693 ////////////////////////////////////////////////////////////////////////
1695 // Create ITS materials
1696 // This function defines the default materials used in the Geant
1697 // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
1699 // In general it is automatically replaced by
1700 // the CreatMaterials routine defined in AliITSv?. Should the function
1701 // CreateMaterials not exist for the geometry version you are using this
1702 // one is used. See the definition found in AliITSv5 or the other routine
1703 // for a complete definition.
1706 //______________________________________________________________________
1707 void AliITSv11::InitAliITSgeom(){
1708 // Based on the geometry tree defined in Geant 3.21, this
1709 // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
1713 //______________________________________________________________________
1714 void AliITSv11::Init(){
1715 ////////////////////////////////////////////////////////////////////////
1716 // Initialise the ITS after it has been created.
1717 ////////////////////////////////////////////////////////////////////////
1719 //______________________________________________________________________
1720 void AliITSv11::SetDefaults(){
1721 // sets the default segmentation, response, digit and raw cluster classes
1723 //______________________________________________________________________
1724 void AliITSv11::DrawModule(){
1725 ////////////////////////////////////////////////////////////////////////
1726 // Draw a shaded view of the FMD version 11.
1727 ////////////////////////////////////////////////////////////////////////
1729 //______________________________________________________________________
1730 void AliITSv11::StepManager(){
1731 ////////////////////////////////////////////////////////////////////////
1732 // Called for every step in the ITS, then calles the AliITShit class
1733 // creator with the information to be recoreded about that hit.
1734 // The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
1735 // printing of information to a file which can be used to create a .det
1736 // file read in by the routine CreateGeometry(). If set to 0 or any other
1737 // value except 1, the default behavior, then no such file is created nor
1738 // it the extra variables and the like used in the printing allocated.
1739 ////////////////////////////////////////////////////////////////////////