1 #ifndef ALIITSV11GEOMETRYSPD_H
2 #define ALIITSV11GEOMETRYSPD_H
5 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved.
6 * See cxx source for full Copyright notice.
9 // Implementation of the SPD v11 central geometry.
11 // - the materials/media used for its volumes;
12 // - settings for the related transport parameters
13 // (GEANT3 types for the moment).
20 #include <TGeoManager.h>
21 #include <TVirtualMC.h>
24 #include <TPolyLine.h>
25 #include <TPolyMarker.h>
26 #include <AliITSv11Geometry.h>
29 class TGeoCompositeShape;
31 class AliITSv11GeometrySPD : public AliITSv11Geometry
35 // Default constructor
36 AliITSv11GeometrySPD(/*Double_t gap = 0.0075*/);
37 // Standard Constructor
38 AliITSv11GeometrySPD(Int_t debug/*, Double_t gap = 0.0075*/);
40 AliITSv11GeometrySPD(const AliITSv11GeometrySPD &s);
41 // Assignment operator
42 AliITSv11GeometrySPD& operator=(const AliITSv11GeometrySPD &s);
44 virtual ~AliITSv11GeometrySPD() {};
48 // define/create materials
49 virtual Int_t CreateSPDCentralMaterials(Int_t &medOffset,
50 Int_t &matOffset) const;
53 // creates standard figures for the documentation of this class
54 virtual void CreateFigure0(const Char_t *path = "",
55 const Char_t *type = "gif",
56 TGeoManager *mgr = gGeoManager) const;
57 // fill TPolylines with crossections of the SPD Carbon fiber sectors.
58 Bool_t Make2DCrossSections(TPolyLine &a0, TPolyLine &a1, TPolyLine &b0,
59 TPolyLine &b1, TPolyMarker &p) const;
64 virtual const char *GetSenstiveVolumeName1() const
65 {return "ITSSPDlay1-sensor";}
66 virtual const char *GetSenstiveVolumeName2() const
67 {return "ITSSPDlay2-sensor";}
68 virtual const char *GetSenstiveVolumeName(Int_t lay) const
69 {return (lay==1) ? GetSenstiveVolumeName1():GetSenstiveVolumeName2();}
71 virtual TGeoMedium* GetMedium(const char* mediumName,
72 TGeoManager *mgr = gGeoManager) const;
73 // retrieve the mounting location and rotation needed to mount an SPD stave
74 virtual Bool_t GetSectorMountingPoints(Int_t index, Double_t &x0,
75 Double_t &y0, Double_t &x1, Double_t &y1) const;
76 // displace the staves on the carbon fiber sector
77 virtual void StavesInSector(TGeoVolume *moth,TGeoManager *mgr=gGeoManager);
78 // (debug purposes) define which staves to put in the sector
79 virtual void SetAddStave(Bool_t *mask);
80 // print class in ascii form to stream
81 virtual void PrintAscii(ostream *os) const;
82 // read in class in ascii form from stream
83 virtual void ReadAscii(istream *is);
85 /* Parts of the geometry */
87 // a single ladder (= 1 detector + 5 chips)
88 virtual TGeoVolume* CreateLadder(Int_t layer, TArrayD &sizes,
89 TGeoManager *mgr = gGeoManager) const;
90 // a clip on the central ladders
91 virtual TGeoVolume* CreateClip(TArrayD &sizes,Bool_t isDummy,
92 TGeoManager *mgr = gGeoManager) const;
93 // the grounding foil (splitted in many components)
94 //virtual TGeoVolumeAssembly* CreateGroundingFoilSingle(Int_t type,
95 // TArrayD &sizes, TGeoManager *mgr = gGeoManager) const;
96 virtual TGeoCompositeShape* CreateGroundingFoilShape(Int_t itype,
97 Double_t &length,Double_t &width,Double_t thickness,TArrayD &sizes);
98 virtual TGeoVolumeAssembly* CreateGroundingFoil(Bool_t isRight, TArrayD &sizes,
99 TGeoManager *mgr = gGeoManager);
100 // the MCM (thin part + thick part with chips inside)
101 virtual TGeoVolumeAssembly* CreateMCM(Bool_t isRight, TArrayD &sizes,
102 TGeoManager *mgr = gGeoManager) const;
103 // the pixel bus (flat part + pt1000s + large capacitors/resistors)
104 virtual TGeoVolumeAssembly* CreatePixelBus(Bool_t isRight, Int_t layer, TArrayD &sizes,
105 TGeoManager *mgr = gGeoManager) const;
106 // the extender complicated geometry
107 virtual TGeoVolume* CreateExtender(const Double_t *params,
108 const TGeoMedium *medium, TArrayD &sizes) const;
109 // the Pixel Bus & extenders (old method which will be removed)
110 virtual TGeoVolumeAssembly* CreatePixelBusAndExtensions(Bool_t zpos=kTRUE,
111 TGeoManager *mgr = gGeoManager) const;
113 virtual TList* CreateConeModule(const Double_t angle,
114 TGeoManager *mgr = gGeoManager) const;
115 virtual void CreateCones(TGeoVolume *moth) const;
116 // a half-stave (put together ladders + MCM + bus, and add clips
118 virtual TGeoVolumeAssembly* CreateHalfStave(Bool_t isRight, Int_t layer,
119 Int_t idxCentral, Int_t idxSide,TArrayD &sizes/*,
120 Bool_t addClips = kFALSE*/, TGeoManager *mgr = gGeoManager);
121 // the whole stave (2 half-staves of different orientation)
122 virtual TGeoVolumeAssembly* CreateStave(Int_t layer, TArrayD &sizes,
123 /*Bool_t addClips = kFALSE,*/TGeoManager *mgr = gGeoManager);
124 // the complete Carbon Fiber sector (support + staves)
125 virtual void CarbonFiberSector(TGeoVolume *moth, Double_t &xAAtubeCenter0,
126 Double_t &yAAtubeCenter0, TGeoManager *mgr = gGeoManager);
127 // the whole SPD barrel (the 10 sectors at once)
128 virtual void SPDSector(TGeoVolume *moth, TGeoManager *mgr = gGeoManager);
129 // Returns the location of the SPD cooling tube ends. RB26 (muon absober
130 // side) and RB24 (open side). Staves number 0,1 inner Staves, 2-5 outer
131 // staves. Sectors numbers 0-9.
132 virtual void GetSPDCoolingTubeRB26(Int_t sector,Int_t stave,
133 Double_t &x,Double_t &y,Double_t &z)const{
134 x = fTubeEndSector[sector][1][stave][0];
135 y = fTubeEndSector[sector][1][stave][1];
136 z = fTubeEndSector[sector][1][stave][2];return;};
137 virtual void GetSPDCoolingTubeRB24(Int_t sector,Int_t stave,
138 Double_t &x,Double_t &y,Double_t &z)const{
139 x = fTubeEndSector[sector][0][stave][0];
140 y = fTubeEndSector[sector][0][stave][1];
141 z = fTubeEndSector[sector][0][stave][2];return;};
144 // all of the member functions which define a component of the final SPD
145 // will need to be defined as private once the design is fixed and
146 // does not need any longer to be checked and debugged.
148 /* Service methods for internal use only */
150 // compute shape of the SPD Sector given specific inputs
151 void SPDsectorShape(Int_t n,const Double_t *xc, const Double_t *yc,
152 const Double_t *r,const Double_t *ths,
153 const Double_t *the, Int_t npr,Int_t &m,
154 Double_t **xp, Double_t **yp) const;
155 // compute a point o a line parallel to a given direction
156 // and with a fixed distance from it
157 void ParallelPosition(Double_t dist1, Double_t dist2, Double_t phi,
158 Double_t &x, Double_t &y) const;
159 // comutes the radial translation of a sector to give the
160 // proper distance between SPD detectors and the beam pipe.
161 Double_t GetSPDSectorTranslation(Double_t x0,Double_t y0,Double_t x1,
162 Double_t y1,Double_t r)const;
163 Bool_t CFHolePoints(Double_t s,Double_t r1,Double_t r2,Double_t l,
164 Double_t &x,Double_t &y)const;
168 static const Double_t fgkGapLadder;// thicknes of the empty (air) gap left
169 // between the ladder and the grounding
170 // foil for alignment
171 static const Double_t fgkGapHalfStave;//thickness of the empty (air) gap
172 // left between HS and Carbon Suport
173 Bool_t fAddStave[6]; // [DEBUG] must be TRUE for all staves
174 // which will be mounted in the sector
175 // (used to check overlaps)
176 TArrayD fSPDsectorX0; // X of first edge of sector plane for stave
177 TArrayD fSPDsectorY0; // Y of first edge of sector plane for stave
178 TArrayD fSPDsectorX1; // X of second edge of sector plane for stave
179 TArrayD fSPDsectorY1; // Y of second edge of sector plane for stave
181 Double_t fTubeEndSector[10][2][6][3]; // Location of tube end in sector
182 /* ROOT dictionary */
184 ClassDef(AliITSv11GeometrySPD,2) // ITS v11 Central SPD geometry
187 // Input and output function for standard C++ input/output.
188 ostream &operator<<(ostream &os, const AliITSv11GeometrySPD &s);
189 istream &operator>>(istream &is, AliITSv11GeometrySPD &s);