]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSv11GeometrySPD.h
New methods added: GetSectorMountingPoints and Make2DcrossSections. (B. Nilsen)
[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
10
11 /*
12  * $Id$
13  */
14
15 //
16 // Implementation of the SPD v11 central geometry.
17 // Contains also:
18 //  - the materials/media used for its volumes;
19 //  - settings for the related transport parameters (GEANT3 types for the moment).
20 //
21 #include <TGeoManager.h>
22 #include <TVirtualMC.h>
23 #include <TString.h>
24 #include <TArrayI.h>
25 #include <AliITSv11Geometry.h>
26
27 class TGeoVolume;
28 class TPolyLine;
29 class TPolyMarker;
30
31
32 class AliITSv11GeometrySPD : public AliITSv11Geometry
33 {
34 public:
35         // Default Constructor, should not be used by default
36         AliITSv11GeometrySPD() : AliITSv11Geometry(),fSPDsectorShapeName(),
37                                  fSPDsectorPoints0(),fSPDsectorPoints1() {};
38         // Standard Constructor, set explicitly debug level
39         AliITSv11GeometrySPD(Int_t debug) : AliITSv11Geometry(debug),
40               fSPDsectorShapeName("ITS SPD Carbon fiber support Sector A0"),
41               fSPDsectorPoints0(6),fSPDsectorPoints1() {}; 
42         virtual ~AliITSv11GeometrySPD() {}; // Destructor
43
44         /* Settings */
45
46         // define/create materials
47         virtual Int_t CreateSPDCentralMaterials(Int_t &medOffset,
48                                                 Int_t &matOffset) const;
49         // set SPD Central, GEANT3 type, tracking parameters
50         virtual void InitSPDCentral(Int_t offset,TVirtualMC *mc=gMC) const;
51         
52         /* Monitoring */
53         
54         // creates standard figures for the documentation of this class
55         virtual void CreateFigure0(const Char_t *filepath = "",
56                                    const Char_t *type = "gif",
57                                    TGeoManager *mgr=gGeoManager);
58         
59         /* Member functions which create pieces of the geometry */
60         
61         // a single ladder (= 1 detector + 5 chips)
62         TGeoVolume* CreateLadder(Int_t layer, Double_t &width,
63                                  Double_t &height, Double_t &thickness,
64                                  TGeoManager *mgr = gGeoManager);
65         // the grounding foil (splitted in two components)
66         TGeoVolume* CreateGroundingFoilSingle(Bool_t kapLayer,Double_t &len, 
67                                               Double_t &wid, Double_t &thick,
68                                               TGeoManager *mgr = gGeoManager);
69         TGeoVolume* CreateGroundingFoil(Double_t &thickness,
70                                         TGeoManager *mgr = gGeoManager);
71         // the MCM (incomplete: missing the internal chips)
72         TGeoVolume* CreateMCMBase(TGeoManager *mgr = gGeoManager) const;
73         TGeoVolume* CreateMCMCoverBorder(TGeoManager *mgr = gGeoManager);
74         TGeoVolume* CreateMCMCoverTop(TGeoManager *mgr = gGeoManager);
75         // the Pixel Bus & extenders
76         TGeoVolumeAssembly* CreatePixelBusAndExtensions(Bool_t zpos = kTRUE,
77                                               TGeoManager *mgr = gGeoManager);
78         // the thin part of a stave (grounding + ladders)
79         TGeoVolume *CreateStaveBase(Int_t layer, Double_t &width,
80                                     Double_t &height, Double_t &thickness,
81                                     TGeoManager *mgr=gGeoManager);
82         // the whole stave, including the thick parts (MCM cover, 
83         // pixel bus & extensions)
84         TGeoVolumeAssembly* CreateStave(Int_t layer, Double_t &thickness,
85                                         TGeoManager *mgr);
86         // displacement of staves on the carbon fiber sector
87         virtual void StavesInSector(TGeoVolume *moth,
88                                     TGeoManager *mgr=gGeoManager);
89         // the complete Carbon Fiber sector (support + staves)
90         virtual void CarbonFiberSector(TGeoVolume *moth,
91                                        Double_t &xAAtubeCenter0,
92                                        Double_t &yAAtubeCenter0,
93                                        TGeoManager *mgr=gGeoManager);
94         // the whole SPD barrel
95         virtual void SPDSector(TGeoVolume *moth, TGeoManager *mgr=gGeoManager);
96         // Returns the mounting location and rotation needed to mount
97         // and SPD ladder.
98         virtual Bool_t AliITSv11GeometrySPD::GetSectorMountingPoints(
99                              Int_t index,Double_t &x0,Double_t &y0,
100                              Double_t &x1,Double_t &y1,
101                              TGeoManager *mgr=gGeoManager)const;
102         // Functions to test aspects of this geometry.
103         // Fill TPolylines with crossections of the SPD Carbon
104         // fiber sectors.
105         Bool_t Make2DcrossSections(TPolyLine &a0,TPolyLine &a1,
106                                    TPolyLine &b0,TPolyLine &b1,
107                                    TPolyMarker &p)const;
108
109 private:
110         
111         // NOTE:
112         // all of the member functions which define a component of the 
113         // final SPD will need to be defined as private once the design 
114         // is fixed and does not
115         // need any longer to be checked and debugged.
116         
117         // Computes shape of the SPD Sector given specific inputs 
118         // (internal use only)
119         void SPDsectorShape(Int_t n, const Double_t *xc, const Double_t *yc,
120                             const Double_t *r,
121                             const Double_t *ths, const Double_t *the, Int_t npr,
122                             Int_t &m, Double_t **xp, Double_t **yp);
123         
124         // computes a point to a line parallel to a given direction
125         // and with a fixed distance from it (internal use only)
126         void ParallelPosition(Double_t dist1, Double_t dist2,
127                               Double_t phi, Double_t &x, Double_t &y);
128
129         // Some internal data
130         TString fSPDsectorShapeName; // SPD Sector Shape name
131         TArrayI fSPDsectorPoints0;    // Array of sector points index
132                                      // used to mount SPD ladder to.
133         TArrayI fSPDsectorPoints1;    // Array of sector points index
134                                      // used to mount SPD ladder to.
135         
136         ClassDef(AliITSv11GeometrySPD,1) // ITS v11 Centeral SPD geometry
137 };
138
139 #endif
140