]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDDetector.h
Added documentation of each file.
[u/mrichter/AliRoot.git] / FMD / AliFMDDetector.h
1 #ifndef ALIFMDDETECTOR_H
2 #define ALIFMDDETECTOR_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 /** @file    AliFMDDetector.h
11     @author  Christian Holm Christensen <cholm@nbi.dk>
12     @date    Mon Mar 27 12:36:27 2006
13     @brief   Sub-detector base class declaration
14 */
15 #ifndef ROOT_TNamed
16 # include <TNamed.h>
17 #endif
18 class AliFMDRing;
19 class TGeoMatrix;
20
21 /** @defgroup FMD_base Basic classes */
22 //__________________________________________________________________
23 /** @brief Base class for the geometry description and parameters of
24     the FMD sub detectors FMD1, FMD2, and FMD3.
25
26     This class hold common parameters of the specific FMD detectors.
27     @ingroup FMD_base
28 */
29 class AliFMDDetector : public TNamed 
30 {
31 public:
32   /** Constructor
33       @param id    Detector number
34       @param inner Pointer to inner ring geometry
35       @param outer Pointer to inner outer geometry
36       @return  */
37   AliFMDDetector(Int_t id, AliFMDRing* inner, AliFMDRing* outer);
38   /** Copy CTOR 
39       @param other Object to copy from. */
40   AliFMDDetector(const AliFMDDetector& other);
41   /** Assignment operator 
42       @param other Object to assign from
43       @return reference to this object  */
44   AliFMDDetector& operator=(const AliFMDDetector& other);
45   virtual ~AliFMDDetector() {}
46   /** Initialize the geometry */
47   virtual void Init();
48   /** Find the transformations that correspond to modules of this
49       detector, and store them in the arrays. */
50   virtual void InitTransformations();
51   
52   /** @param x Detector number */
53   void SetId(Int_t x) { fId = x; }
54   /** @param x Position of outer ring along z */
55   void SetInnerZ(Double_t x) { fInnerZ = x; }
56   /** @param x Position of outer ring along z */
57   void SetOuterZ(Double_t x) { fOuterZ = x; }
58   /** @param x Thickness of honeycomb plate */
59   void SetHoneycombThickness(Double_t x=1) { fHoneycombThickness = x; }
60   /** @param x Thickness of aluminium of honeycomb */
61   void SetAlThickness(Double_t x=.1) { fAlThickness = x; }
62   /** @param x Inner radius of inner honeycomb */
63   void SetInnerHoneyLowR(Double_t x) { fInnerHoneyLowR = x; }
64   /** @param x Outer radius of inner honeycomb */
65   void SetInnerHoneyHighR(Double_t x) { fInnerHoneyHighR = x; }
66   /** @param x Inner radius of outer honeycomb */
67   void SetOuterHoneyLowR(Double_t x) { fOuterHoneyLowR = x; }
68   /** @param x Outer radius of outer honeycomb */
69   void SetOuterHoneyHighR(Double_t x) { fOuterHoneyHighR = x; }
70     
71   /** @return Detector number */
72   Int_t GetId() const { return fId; }
73   /** @return Position of outer ring along z */
74   Double_t GetInnerZ() const { return fInnerZ; }
75   /** @return Position of outer ring along z */
76   Double_t GetOuterZ() const { return fOuterZ; }
77   /** @return Thickness of honeycomb plate */
78   Double_t GetHoneycombThickness() const { return fHoneycombThickness; }
79   /** @return Thickness of aluminium of honeycomb */
80   Double_t GetAlThickness() const { return fAlThickness; }
81   /** @return Inner radius of inner honeycomb */
82   Double_t GetInnerHoneyLowR() const { return fInnerHoneyLowR; }
83   /** @return Outer radius of inner honeycomb */
84   Double_t GetInnerHoneyHighR() const { return fInnerHoneyHighR; }
85   /** @return Inner radius of outer honeycomb */
86   Double_t GetOuterHoneyLowR() const { return fOuterHoneyLowR; }
87   /** @return Outer radius of outer honeycomb */
88   Double_t GetOuterHoneyHighR() const { return fOuterHoneyHighR; }
89     
90   /** @return Inner ring information */
91   AliFMDRing* GetInner() const { return fInner; }
92   /** @return Outer ring information */
93   AliFMDRing* GetOuter() const { return fOuter; }
94   /** @param id Id of ring to get 
95       @return Pointer to ring, 0 on failure */
96   AliFMDRing* GetRing(Char_t id) const;
97   /** @param id Id of ring to get 
98       @return Z position of ring or 0 on failure */
99   Double_t GetRingZ(Char_t id) const;
100   
101   /** Translate detector coordinates (detector, ring, sector, strip)
102       to spatial coordinates (x, y, z) in the master reference frame
103       of ALICE.  The member function uses the transformations
104       previously obtained from the TGeoManager.
105       @param ring   Ring id
106       @param sector Sector number
107       @param strip  Strip number
108       @param x      On return, X coordinate 
109       @param y      On return, Y coordinate 
110       @param z      On return, Z coordinate  */
111   void Detector2XYZ(Char_t ring, UShort_t sector, UShort_t strip, 
112                     Double_t& x, Double_t& y, Double_t& z) const;
113   /** Translate spatial coordinates (x,y,z) in the master reference
114       frame of ALICE to the detector coordinates (detector, ring,
115       sector, strip).  Note, that if this method is to be used in
116       reconstruction or the like, then the input z-coordinate should
117       be corrected for the events interactions points z-coordinate,
118       like  
119       @code 
120       geom->XYZ2Detector(x,y,z-ipz,d,r,s,t);
121       @endcode
122       @param x       X coordinate
123       @param y       Y coordinate
124       @param z       Z coordinate
125       @param ring    On return, Ring id            
126       @param sector  On return, Sector number      
127       @param strip   On return, Strip number       
128       @return @c  false of (@a x, @a y, @a z) is not within this
129       detector.  */
130   Bool_t XYZ2Detector(Double_t x, Double_t y, Double_t z, 
131                       Char_t& ring, UShort_t& sector, UShort_t& strip) const;
132 protected:
133   /** Check if we have all transformations for a ring 
134       @param ring Ring to check for 
135       @return @c true if we got all transforms  */
136   Bool_t        HasAllTransforms(Char_t ring) const;
137   /** Get transformation matrix for a sector in a ring 
138       @param ring   Ring id
139       @param sector Sector numberr 
140       @return Matrix on success, 0 otherwise */
141   TGeoMatrix*   FindTransform(Char_t ring, UShort_t sector) const;
142   Int_t         fId;                    // Detector number
143   Double_t      fInnerZ;                // Position of outer ring along z
144   Double_t      fOuterZ;                // Position of outer ring along z
145   Double_t      fHoneycombThickness;    // Thickness of honeycomb plate
146   Double_t      fAlThickness;           // Thickness of aluminium of honeycomb
147   Double_t      fInnerHoneyLowR;        // Inner radius of inner honeycomb
148   Double_t      fInnerHoneyHighR;       // Outer radius of inner honeycomb
149   Double_t      fOuterHoneyLowR;        // Inner radius of outer honeycomb
150   Double_t      fOuterHoneyHighR;       // Outer radius of outer honeycomb
151   AliFMDRing*   fInner;                 // Pointer to inner ring information
152   AliFMDRing*   fOuter;                 // Pointer to outer ring information
153   TObjArray*    fInnerTransforms;       // List of inner module global
154   TObjArray*    fOuterTransforms;       // List of outer module global
155
156   ClassDef(AliFMDDetector, 1); // 
157 };
158
159 #endif
160 //____________________________________________________________________
161 //
162 // Local Variables:
163 //   mode: C++
164 // End:
165 //
166 // EOF
167 //