]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSv11GeometrySPD.h
- Protection added for null or empty input chains
[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
29 class TGeoVolume;
30 class TGeoCompositeShape;
31
32 class AliITSv11GeometrySPD : public AliITSv11Geometry
33 {
34 public:
35
36         // Default constructor
37         AliITSv11GeometrySPD();
38         // Standard Constructor
39         AliITSv11GeometrySPD(Int_t debug);
40         // Copy constructor (temporarily disabled)
41         // AliITSv11GeometrySPD(const AliITSv11GeometrySPD &s);
42         // Assignment operator (temporarily disabled)
43         // operator=(const AliITSv11GeometrySPD &s);
44         // Destructor
45         virtual ~AliITSv11GeometrySPD() {};
46         
47         /* Settings */
48         
49         // define/create materials
50         virtual Int_t CreateSPDCentralMaterials(Int_t &medOffset, Int_t &matOffset) const;
51         // set SPD Central, GEANT3 type, tracking parameters
52         virtual void InitSPDCentral(Int_t offset, TVirtualMC *mc = gMC) const;
53         
54         /* Monitoring */
55         
56         // creates standard figures for the documentation of this class
57         virtual void CreateFigure0
58                 (const Char_t *path = "", const Char_t *type = "gif", TGeoManager *mgr = gGeoManager) const;
59         // fill TPolylines with crossections of the SPD Carbon fiber sectors.
60         Bool_t Make2DCrossSections
61                 (TPolyLine &a0, TPolyLine &a1, TPolyLine &b0, TPolyLine &b1, TPolyMarker &p) const;
62         
63         /* Services */
64         
65         // get names
66         virtual const char *GetSenstiveVolumeName1() const {return "LAY1_SENSOR";}
67         virtual const char *GetSenstiveVolumeName2() const {return "LAY2_SENSOR";}
68         virtual const char *GetSenstiveVolumeName(Int_t lay) const
69                 {return (lay==1) ? GetSenstiveVolumeName1() : GetSenstiveVolumeName2();}
70         // get medium
71         virtual TGeoMedium* GetMedium(const char* mediumName, TGeoManager *mgr = gGeoManager) const;
72         // retrieve the mounting location and rotation needed to mount an SPD stave
73         virtual Bool_t GetSectorMountingPoints
74                 (Int_t index, Double_t &x0, Double_t &y0, Double_t &x1, Double_t &y1) const;
75         // displace the staves on the carbon fiber sector
76         virtual void StavesInSector(TGeoVolume *moth, TGeoManager *mgr = gGeoManager);
77         // (debug purposes) define which staves to put in the sector
78         virtual void SetAddStave(Bool_t *mask);
79         // print class in ascii form to stream
80         virtual void PrintAscii(ostream *os) const;
81         // read in class in ascii form from stream
82         virtual void ReadAscii(istream *is);
83                  
84         /* Parts of the geometry */
85         
86         // a single ladder (= 1 detector + 5 chips)
87         virtual TGeoVolume* CreateLadder
88                 (Int_t layer, TArrayD &sizes, TGeoManager *mgr = gGeoManager) const;
89         // a clip on the central ladders
90         virtual TGeoVolume* CreateClip
91                 (TArrayD &sizes, Bool_t isDummy, TGeoManager *mgr = gGeoManager) const;
92         // the grounding foil (splitted in many components)
93         virtual TGeoCompositeShape* CreateGroundingFoilShape
94                 (Int_t itype, Double_t &length, Double_t &width, Double_t thickness, TArrayD &sizes);
95         virtual TGeoVolume* CreateGroundingFoil
96                 (Bool_t isRight, TArrayD &sizes, TGeoManager *mgr = gGeoManager);
97         // the MCM (thin part + thick part with chips inside)
98         virtual TGeoVolumeAssembly* CreateMCM
99                 (Bool_t isRight, TArrayD &sizes, TGeoManager *mgr = gGeoManager) const;
100         // the pixel bus (flat part + pt1000s + large capacitors/resistors)
101         virtual TGeoVolumeAssembly* CreatePixelBus
102                 (Bool_t isRight, TArrayD &sizes, TGeoManager *mgr = gGeoManager) const;
103         // the extender complicated geometry
104         virtual TGeoVolume* CreateExtender
105                 (const Double_t *params, const TGeoMedium *medium, TArrayD &sizes) const;
106         // the Pixel Bus & extenders (old method which will be removed)
107         virtual TGeoVolumeAssembly* CreatePixelBusAndExtensions
108                 (Bool_t zpos = kTRUE, TGeoManager *mgr = gGeoManager) const;
109         // a half-stave (put together ladders + MCM + bus, and add clips if requested)
110         virtual TGeoVolumeAssembly* CreateHalfStave
111                 (Bool_t isRight, Int_t layer, Int_t idxCentral, Int_t idxSide,
112                  TArrayD &sizes, TGeoManager *mgr = gGeoManager);
113         // the whole stave (2 half-staves of different orientation)
114         virtual TGeoVolumeAssembly* CreateStave
115                 (Int_t layer, TArrayD &sizes, TGeoManager *mgr = gGeoManager);
116         // the complete Carbon Fiber sector (support + staves)
117         virtual void CarbonFiberSector
118                 (TGeoVolume *moth, Double_t &xAAtubeCenter0, Double_t &yAAtubeCenter0, TGeoManager *mgr = gGeoManager);
119         // the whole SPD barrel (the 10 sectors at once)
120         virtual void SPDSector(TGeoVolume *moth, TGeoManager *mgr = gGeoManager);
121
122 private:
123  
124         // NOTE:
125         // all of the member functions which define a component of the final SPD
126         // will need to be defined as private once the design is fixed and 
127         // does not need any longer to be checked and debugged.
128         
129         /* Service methods for internal use only */
130         
131         // compute shape of the SPD Sector given specific inputs 
132         void SPDsectorShape
133                 (Int_t n, 
134                  const Double_t *xc, const Double_t *yc, const Double_t *r,
135                  const Double_t *ths, const Double_t *the, Int_t npr,
136                  Int_t &m, Double_t **xp, Double_t **yp) const;
137         
138         // compute a point o a line parallel to a given direction
139         // and with a fixed distance from it
140         void ParallelPosition
141                 (Double_t dist1, Double_t dist2, Double_t phi, Double_t &x, Double_t &y) const;
142         
143         /* Data members */
144         
145         static const Double_t fgkGapLadder;     // thickness of the empty (air) gap left around the ladder
146         static const Double_t fgkGapHalfStave;  // thickness of the empty (air) gap left between HS and carbon support
147         
148         Bool_t  fAddStave[6];      // [DEBUG] must be TRUE for all staves
149                                    // which will be mounted in the sector (used to check overlaps)
150                 
151         TArrayD fSPDsectorX0;      // X of first edge of sector plane for stave
152         TArrayD fSPDsectorY0;      // Y of first edge of sector plane for stave
153         TArrayD fSPDsectorX1;      // X of second edge of sector plane for stave
154         TArrayD fSPDsectorY1;      // Y of second edge of sector plane for stave
155         
156         /* ROOT dictionary */
157
158         ClassDef(AliITSv11GeometrySPD,1) // ITS v11 Central SPD geometry
159 };
160
161 // Input and output function for standard C++ input/output.
162 ostream &operator<<(ostream &os, const AliITSv11GeometrySPD &s);
163 istream &operator>>(istream &is, AliITSv11GeometrySPD &s);
164
165 #endif