]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDFMD.h
Make it find libraries independently of location
[u/mrichter/AliRoot.git] / STEER / AliESDFMD.h
1 #ifndef ALIESDFMD_H
2 #define ALIESDFMD_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved. 
5  *
6  * See cxx source for full Copyright notice                               
7  */
8 //___________________________________________________________________
9 //
10 // AliESDFMD is the Event Summary Data entry for the FMD.  It contains
11 // a rough estimate of the charged particle multiplicity in each strip
12 // of the FMD.    It also contains the psuedo-rapidity of each strip.
13 // This is important, as it varies from event to event, due to a
14 // finite interaction point probability distribution. 
15 //
16 #ifndef ROOT_TObject
17 # include <TObject.h>
18 #endif
19 #ifndef ALIFMDFLOATMAP_H
20 # include "AliFMDFloatMap.h"
21 #endif
22
23 //___________________________________________________________________
24 /** @class AliESDFMD 
25     @brief Event Summary Data for the Forward Multiplicity Detector. 
26     @ingroup FMD_data
27     This stores the psuedo-multiplicity and -rapidiy for each strip of
28     the FMD. 
29  */
30 class AliESDFMD : public TObject
31 {
32 public:
33   /** 
34    * Base class of looping over the FMD ESD object 
35    *
36    * A simple example could be 
37    * 
38    * @code 
39    * struct ESDFMDPrinter : AliESDFMD::ForOne
40    * { 
41    *   Bool_t operator()(UShort_t d, Char_t r, UShort_t s, UShort_t t,
42    *                     Float_t m, Float_t e) 
43    *   { 
44    *     Printf("FMD%d%c[%2d,%3d]=%7.4f @ %7.4f", d, r, s, t, m, e);
45    *     return kTRUE;
46    *   }
47    * };
48    * @endcode
49    */
50   class ForOne 
51   {
52   public:
53     /** 
54      * Destructor
55      */    
56     virtual ~ForOne() {}
57     /** 
58      * Functional operator called for each entry 
59      * 
60      * @param d Detector number
61      * @param r Ring identifier 
62      * @param s Sector number
63      * @param t Strip number
64      * @param m 'Bare' multiplicity of this strip
65      * @param e Pseudo-rapidity of this strip
66      * 
67      * @return @c kTRUE in case of success, @c kFALSE in case of failure.
68      *         If the method returns @c kFALSE, the loop stops. 
69      */    
70     virtual bool operator()(UShort_t d, Char_t r, UShort_t s, UShort_t t, 
71                               Float_t m, Float_t e) = 0;
72   };
73   /** 
74    * Default constructor 
75    */
76   AliESDFMD();
77   /** 
78    * Copy constructor 
79    * 
80    * @param other Object to construct from 
81    */
82   AliESDFMD(const AliESDFMD& other);
83   /** 
84    * Assignment operator 
85    * 
86    * @param other Object to assign from
87    *
88    * @return  reference to this object 
89    */
90   AliESDFMD& operator=(const AliESDFMD& other);
91   /** 
92    * Destructor - does nothing 
93    */
94   virtual ~AliESDFMD() {}
95   /** 
96    * Copy the content of this object to @a obj which must have been 
97    * preallocated
98    *
99    * @param obj Object to copy to
100    */
101   virtual void Copy(TObject &obj) const;
102
103   /**
104    * Reset the object 
105    */
106   void Clear(Option_t *option="");
107   /** 
108    * Get the pseudo-multiplicity of 
109    * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
110    * sector\rangle\langle strip\rangle}@f$ 
111    * 
112    * @param detector Detector number (1-3)
113    * @param ring     Ring identifier ('I' or 'O')
114    * @param sector   Sector number (0-511, or 0-255)
115    * @param strip    Strip number (0-19, or 0-39)
116    *
117    * @return Psuedo multiplicity 
118    */
119   Float_t Multiplicity(UShort_t detector, Char_t ring, 
120                        UShort_t sector, UShort_t strip) const;
121   /** 
122    * Get the pseudo-rapidity of 
123    * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
124    * sector\rangle\langle strip\rangle}@f$ 
125    *
126    * @param detector Detector number (1-3)
127    * @param ring     Ring identifier ('I' or 'O')
128    * @param sector   Sector number (0-511, or 0-255)
129    * @param strip    Strip number (0-19, or 0-39)
130    *
131    * @return Psuedo rapidity 
132    */
133   Float_t Eta(UShort_t detector, Char_t ring, 
134               UShort_t sector, UShort_t strip) const;
135   /** 
136    * Get the azimuthal angle of 
137    * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
138    * sector\rangle\langle strip\rangle}@f$ 
139    *
140    * @param detector Detector number (1-3)
141    * @param ring     Ring identifier ('I' or 'O')
142    * @param sector   Sector number (0-511, or 0-255)
143    * @param strip    Strip number (0-19, or 0-39)
144    *
145    * @return Azimuthal angle 
146    */
147   Float_t Phi(UShort_t detector, Char_t ring, 
148               UShort_t sector, UShort_t strip) const;
149   /** 
150    * Get the polar angle (in degrees) from beam line of 
151    * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
152    * sector\rangle\langle strip\rangle}@f$ 
153    *
154    * @param detector Detector number (1-3)
155    * @param ring     Ring identifier ('I' or 'O')
156    * @param sector   Sector number (0-511, or 0-255)
157    * @param strip    Strip number (0-19, or 0-39)
158    *
159    * @return Polar angle
160    */
161   Float_t Theta(UShort_t detector, Char_t ring, 
162                 UShort_t sector, UShort_t strip) const;
163   /** 
164    * Get the radial distance (in cm) from beam line of 
165    * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
166    * sector\rangle\langle strip\rangle}@f$ 
167    *
168    * @param detector Detector number (1-3)
169    * @param ring     Ring identifier ('I' or 'O')
170    * @param sector   Sector number (0-511, or 0-255)
171    * @param strip    Strip number (0-19, or 0-39)
172    *
173    * @return Radial distance
174    */
175   Float_t R(UShort_t detector, Char_t ring, 
176             UShort_t sector, UShort_t strip) const;
177   /** 
178    * Set the pseudo-multiplicity of 
179    * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
180    * sector\rangle\langle strip\rangle}@f$ 
181    * 
182    * @param detector Detector number (1-3)
183    * @param ring     Ring identifier ('I' or 'O')
184    * @param sector   Sector number (0-511, or 0-255)
185    * @param strip    Strip number (0-19, or 0-39)
186    * @param mult     Psuedo multiplicity 
187    */
188   void SetMultiplicity(UShort_t detector, Char_t ring, 
189                        UShort_t sector, UShort_t strip, 
190                        Float_t mult);
191   /** 
192    * Set the pseudo-rapidity of 
193    * @f$ \text{FMD}\langle detector\rangle\lange ring\rangle_{\langle
194    * sector\rangle\langle strip\rangle}@f$ 
195    * 
196    * @param detector Detector number (1-3)
197    * @param ring     Ring identifier ('I' or 'O')
198    * @param sector   Sector number (0-511, or 0-255)
199    * @param strip    Strip number (0-19, or 0-39)
200    * @param eta      Psuedo rapidity 
201    */
202   void SetEta(UShort_t detector, Char_t ring, 
203               UShort_t sector, UShort_t strip, 
204               Float_t eta);
205   /** 
206    * @param f the factor for noise suppression 
207    */
208   void SetNoiseFactor(Float_t f) { fNoiseFactor = f; }
209   /** 
210    * @param done Whether we've done angle correction or not 
211    */
212   void SetAngleCorrected(Bool_t done) { fAngleCorrected = done; }
213   /** 
214    * @return Whether we've done angle correction or not 
215    */
216   Bool_t IsAngleCorrected() const { return fAngleCorrected; }
217   /** 
218    * @return the  factor for noise suppression 
219    */
220   Float_t GetNoiseFactor() const { return fNoiseFactor; }
221   /** 
222    * @return maximum number of detectors 
223    */
224   UShort_t MaxDetectors() const { return fMultiplicity.MaxDetectors(); }
225   /** 
226    * @return maximum number of rings 
227    */
228   UShort_t MaxRings()     const { return fMultiplicity.MaxRings(); }
229   /** 
230    * @return maximum number of sectors 
231    */
232   UShort_t MaxSectors()   const { return fMultiplicity.MaxSectors(); }
233   /** 
234    * @return Maximum number of strips 
235    */
236   UShort_t MaxStrips()    const { return fMultiplicity.MaxStrips(); }
237   /** 
238    * Print this object to standard out. 
239    * 
240    * @param option Options 
241    */
242   void Print(Option_t* option="") const;
243   /** 
244    * Check if we need the @c UShort_t fix 
245    * 
246    * @param file File this object was read from 
247    */
248   void CheckNeedUShort(TFile* file);
249   /** 
250    * Call the function operator of the passed object @a algo for each
251    * entry in this object
252    * 
253    * @param algo Algorithm
254    * 
255    * @return @c kTRUE on success, @c kFALSE if the passed object
256    * failed at any entry.  It will return immediately on error. 
257    */
258   Bool_t ForEach(ForOne& algo) const;
259   enum {
260     /** Value used for undefined multiplicity */
261     kInvalidMult = 1024
262   };
263   enum {
264     /** Value used for undefined pseudo rapidity */
265     kInvalidEta = 1024
266   };
267   /** 
268    * @return constant reference to multiplicity map 
269    */
270   const AliFMDFloatMap& MultiplicityMap() const { return fMultiplicity; }
271   /** 
272    * @return constant reference to pseudo-rapidity map 
273    */
274   const AliFMDFloatMap& EtaMap() const { return fEta; }
275 protected:
276   AliFMDFloatMap fMultiplicity;   // Psuedo multplicity per strip
277   AliFMDFloatMap fEta;            // Psuedo-rapidity per strip
278   Float_t        fNoiseFactor;    // Factor used for noise suppresion
279   Bool_t         fAngleCorrected; // Whether we've done angle correction
280   ClassDef(AliESDFMD,3)           // ESD info from FMD
281 };
282 #endif
283 //____________________________________________________________________
284 //
285 // Local Variables:
286 //   mode: C++
287 // End:
288 //
289 // EOF
290 //