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