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