]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDGeometryBuilder.h
Fleshed out geometry of FMD2 and 3. All should be in now. Still missing
[u/mrichter/AliRoot.git] / FMD / AliFMDGeometryBuilder.h
1 #ifndef ALIFMDGEOMETRYBUILDER_H
2 #define ALIFMDGEOMETRYBUILDER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved. 
5  *
6  * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
7  *
8  * See cxx source for full Copyright notice                               
9  */
10 // Builder of FMD geometry. 
11 // This class takes care of actually building the geometry using the 
12 // TGeo classes.  Various parameters are fecthed from the
13 // AliFMDGeometry manager.  
14 /** @file    AliFMDGeometryBuilder.h
15     @author  Christian Holm Christensen <cholm@nbi.dk>
16     @date    Mon Mar 27 12:41:17 2006
17     @brief   Class to build the FMD geometry 
18 */
19 #ifndef ROOT_TTask
20 # include <TTask.h>
21 #endif
22 #ifndef ROOT_TArrayI
23 # include <TArrayI.h>
24 #endif
25 class TGeoVolume;
26 class TGeoMedium;
27 class TGeoShape;
28 class AliFMD;
29 class AliFMDRing;
30 class AliFMDDetector;
31 class AliFMD1;
32 class AliFMD2;
33 class AliFMD3;
34
35 //____________________________________________________________________
36 /** @class AliFMDGeometryBuilder 
37     @brief Builder of FMD geometry. 
38     This class takes care of actually building the geometry using the
39     @b TGeo classes.  Various parameters are fecthed from the
40     AliFMDGeometry manager. 
41     @ingroup FMD_sim
42  */
43 class AliFMDGeometryBuilder : public TTask
44 {
45 public:
46   /** CTOR */
47   AliFMDGeometryBuilder();
48   /** CTOR 
49       @param detailed Whether to make a detailed geometry. */
50   AliFMDGeometryBuilder(Bool_t detailed);
51   virtual ~AliFMDGeometryBuilder() {}
52   /** Register */
53   virtual void Exec(Option_t* option="");
54   /** @param use Wheher to assemblies in the geometry definition */
55   virtual void UseAssembly(Bool_t use=kTRUE) { fUseAssembly = use; }
56   /** Whether to make a detailed geometry or not. 
57       @param use If true, make a detailed geometry */
58   virtual void SetDetailed(Bool_t use) { fDetailed = use; }
59   /** @return Sector offset in volume tree  */
60   Int_t GetSectorOff() const { return fSectorOff; }
61     /** @return Module offset in volume tree */
62   Int_t GetModuleOff() const { return fModuleOff; }
63     /** @return Ring offset in the volume tree  */
64   Int_t GetRingOff() const { return fRingOff; }
65     /** @return Detector offfset in the volume tree  */
66   Int_t GetDetectorOff() const { return fDetectorOff; }
67 protected:
68   /** Copy CTOR */
69   AliFMDGeometryBuilder(const AliFMDGeometryBuilder& o) 
70     : TTask(o),
71       fActiveId(o.fActiveId),
72       fDetailed(o.fDetailed),
73       fUseAssembly(o.fUseAssembly),
74       fSectorOff(o.fSectorOff),
75       fModuleOff(o.fModuleOff),
76       fRingOff(o.fRingOff),
77       fDetectorOff(o.fDetectorOff),
78       fSi(o.fSi),
79       fC(o.fC),
80       fAl(o.fAl),
81       fPCB(o.fPCB),
82       fChip(o.fChip),
83       fAir(o.fAir),
84       fPlastic(o.fPlastic),
85       fCopper(o.fCopper), 
86       fSteel(o.fSteel)
87   {}
88   /** Assignment operator */
89   AliFMDGeometryBuilder& operator=(const AliFMDGeometryBuilder&){return *this;}
90   /** Make a ring volume 
91       @param r Ring geometry 
92       @return  Ring volume */
93   virtual TGeoVolume* RingGeometry(AliFMDRing* r);
94
95   /** Make a honey comb shape from passed parameters.
96       @param id       Detector identifier (1,2, or 3)
97       @param ring     Ring identifier ('I' or 'O')
98       @param r1       Inner radius
99       @param r2       Outer radius
100       @param w        width 
101       @param t        Thickness of material 
102       @param c        Clearing from horizontal. 
103       @return Pointer to newly allocated composite shape. */ 
104   virtual TGeoShape* HoneycombShape(Int_t id, Char_t ring,
105                                     double r1, double r2, 
106                                     double w, double t, double c=0.3);
107   /** 
108    * Get the tension box volume
109    * 
110    * 
111    * @return 
112    */
113   virtual TGeoVolume* TensionBox();
114   /** Make a detector volume 
115       @param d Detector geometry 
116       @param motherTop Mother volume (detector volume)
117       @param motherBot Mother volume (detector volume)
118       @param zmother Z position of mother 
119       @param innerTop Inner ring volume 
120       @param innerBot Inner ring volume 
121       @param outerTop Outer ring volume 
122       @param outerBot Outer ring volume 
123       @return  Detector volume */
124   virtual TGeoVolume* DetectorGeometry(AliFMDDetector* d, 
125                                        TGeoVolume* motherTop, 
126                                        TGeoVolume* motherBot, 
127                                        Double_t    zmother, 
128                                        TGeoVolume* innerTop, 
129                                        TGeoVolume* innerBot, 
130                                        TGeoVolume* outerTop=0,
131                                        TGeoVolume* outerBot=0);
132   /** Make FMD1 volume 
133       @param d Detector geometry 
134       @param innerTop Inner ring volume 
135       @param innerBot Inner ring volume 
136       @return FMD1 volume  */
137   virtual TGeoVolume* FMD1Geometry(AliFMD1* d, 
138                                    TGeoVolume* innerTop,
139                                    TGeoVolume* innerBot);
140   /** Make FMD2 volume 
141       @param d Detector geometry 
142       @param innerTop Inner ring volume 
143       @param innerBot Inner ring volume 
144       @param outerTop Outer ring volume 
145       @param outerBot Outer ring volume 
146       @return FMD2 volume  */
147   virtual TGeoVolume* FMD2Geometry(AliFMD2* d, 
148                                    TGeoVolume* innerTop, 
149                                    TGeoVolume* innerBot, 
150                                    TGeoVolume* outerTop,
151                                    TGeoVolume* outerBot);
152   /** Make FMD3 volume 
153       @param d Detector geometry 
154       @param innerTop Inner ring volume 
155       @param innerBot Inner ring volume 
156       @param outerTop Outer ring volume 
157       @param outerBot Outer ring volume 
158       @return FMD3 volume  */
159   virtual TGeoVolume* FMD3Geometry(AliFMD3* d, 
160                                    TGeoVolume* innerTop, 
161                                    TGeoVolume* innerBot, 
162                                    TGeoVolume* outerTop,
163                                    TGeoVolume* outerBot);
164
165
166   TArrayI     fActiveId;      //! Active volume ID's
167   Bool_t      fDetailed;      // Whether to make a detailed simulation 
168   Bool_t      fUseAssembly;   // Assembly volumes
169   Int_t       fSectorOff;     // Sector offset in volume tree 
170   Int_t       fModuleOff;     // Module offset in volume tree
171   Int_t       fRingOff;       // Ring offset in the volume tree 
172   Int_t       fDetectorOff;   // Detector offfset in the volume tree 
173
174   TGeoMedium* fSi;       //! Si Medium
175   TGeoMedium* fC;        //! C Medium
176   TGeoMedium* fAl;       //! Al Medium
177   TGeoMedium* fPCB;      //! PCB Medium
178   TGeoMedium* fChip;     //! Chip Medium
179   TGeoMedium* fAir;      //! Air Medium
180   TGeoMedium* fPlastic;  //! Plastic Medium
181   TGeoMedium* fCopper;   //! Copper Medium
182   TGeoMedium* fSteel;    //! Steel Medium
183
184   static const Char_t* fgkActiveName;   // Name of Active volumes
185   static const Char_t* fgkSectorName;   // Name of Sector volumes
186   static const Char_t* fgkStripName;    // Name of Strip volumes
187   static const Char_t* fgkSensorName;   // Name of Sensor volumes
188   static const Char_t* fgkPCBName;      // Name of PCB volumes
189   static const Char_t* fgkCuName;       // Name of copper volumes
190   static const Char_t* fgkChipName;     // Name of chip volumes
191   static const Char_t* fgkLongLegName;  // Name of LongLeg volumes
192   static const Char_t* fgkShortLegName; // Name of ShortLeg volumes
193   static const Char_t* fgkFrontVName;   // Name of Front volumes
194   static const Char_t* fgkBackVName;    // Name of Back volumes
195   static const Char_t* fgkRingTopName;  // Name of Top ring volumes
196   static const Char_t* fgkRingBotName;  // Name of Bottom ring volumes
197   static const Char_t* fgkHCName;       // Name of Honeycomb volumes
198   static const Char_t* fgkIHCName;      // Name of Inner honeycomb volumes
199   static const Char_t* fgkNoseName;     // Name of Nose volumes
200   static const Char_t* fgkBackName;     // Name of Back volumes
201   static const Char_t* fgkTopName;      // Name of Back volumes
202   static const Char_t* fgkBeamName;     // Name of Beam volumes
203   static const Char_t* fgkFlangeName;   // Name of Flange volumes
204   static const Char_t* fgkFMDDCuName;   // Name of FMDD copper volumes
205   static const Char_t* fgkFMDDPCBName;  // Name of FMDD PCB volumes 
206   static const Char_t* fgkFMDDChipName; // Name of FMDD chip volumes
207   static const Char_t* fgkFMDDName;     // Name of FMDD volumes
208   static const Char_t* fgkFMDName;      // Name of Half FMD volumes
209
210   ClassDef(AliFMDGeometryBuilder,1)
211 };
212
213 #endif
214 //____________________________________________________________________
215 //
216 // Local Variables:
217 //   mode: C++
218 // End:
219 //
220 // EOF
221 //
222