]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliFMDCorrNoiseGain.h
Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliFMDCorrNoiseGain.h
1 #ifndef ALIFMDCORRNOISEGAIN_H
2 #define ALIFMDCORRNOISEGAIN_H
3 #include <AliFMDFloatMap.h>
4
5 /**
6  * Get the noise calibration.  That is, the ratio 
7  *
8  * @f[ 
9  *   \frac{\sigma_{i}}{g_{i}k}
10  * @f] 
11  *
12  * where @f$ k@f$ is a constant determined by the electronics of
13  * units DAC/MIP, and @f$ \sigma_i, g_i@f$ are the noise and gain of
14  * the @f$ i @f$ strip respectively.
15  *
16  * This correction is needed because some of the reconstructed data
17  * (what which have an AliESDFMD class version less than or equal to
18  * 3) used the wrong zero-suppression factor.  The zero suppression
19  * factor used by the on-line electronics was 4, but due to a coding
20  * error in the AliFMDRawReader a zero suppression factor of 1 was
21  * assumed during the reconstruction.  This shifts the zero of the
22  * energy loss distribution artificially towards the left (lover
23  * valued signals).
24  *
25  * So let's assume the real zero-suppression factor is @f$ f@f$ while
26  * the zero suppression factor @f$ f'@f$ assumed in the reconstruction
27  * was (wrongly) lower.  The number of ADC counts @f$ c_i'@f$ used in
28  * the reconstruction can be calculated from the reconstructed signal
29  * @f$ m_i'@f$ by
30  *
31  * @f[
32  *    c_i' = m_i \times g_i \times k / \cos\theta_i
33  * @f] 
34  *
35  * where @f$\theta_i@f$ is the incident angle of the @f$ i@f$ strip. 
36  * 
37  * This number of counts used the wrong noise factor @f$ f'@f$ so to
38  * correct to the on-line value, we need to do
39  *
40  * @f[ 
41  *   c_i = c_i' - \floor{f'\times n_i} + \floor{f\times n_i}
42  * @f] 
43  * 
44  * which gives the correct number of ADC counts over the pedestal. To
45  * convert back to the scaled energy loss signal we then need to
46  * calculate (noting that @f$ f,f'@f$ are integers)
47  *
48  * @f{eqnarray}
49  *    m_i &=& \frac{c_i \times \cos\theta_i}{g_i \times k}\\ 
50  *    &=& \left(c_i' - \lfloor f'\times n_i\rfloor + 
51  *           \lfloor f\times n_i\rfloor\right)\frac{\cos\theta}{g_i \times k}\\
52  *    &=& \left(\frac{m_i'\times g_i\times k}{\cos\theta} -
53  *            \lfloor f'\times n_i\rfloor + \lfloor f\times n_i\rfloor\right)
54  *         \frac{\cos\theta}{g_i \times k}\\
55  *    &=& m_i' + \frac{1}{g_i \times k}
56  *         \left(\lfloor f\times n_i}\rfloor-
57  *             \lfloor f'\times n_i\rfloor\right)\cos\theta\\
58  *    &=& m_i' + \frac{\lfloor n_i\rfloor}{g_i \times k}
59  *        \left(f-f'\right)\cos\theta
60  * @f{eqnarray}
61  * 
62  */
63 class AliFMDCorrNoiseGain : public TObject 
64 {
65 public:
66   /**
67    * Default constructor 
68    */
69   AliFMDCorrNoiseGain() : fValues(0) { fValues.Reset(-1); }
70   /** 
71    * Constructor from a float map 
72    * 
73    * @param map Construct from this map 
74    */
75   AliFMDCorrNoiseGain(const AliFMDFloatMap& map) : fValues(map) {}
76   /** 
77    * Get the noise value for a particular strip 
78    * 
79    * @param d  Detector
80    * @param r  Ring 
81    * @param s  Sector 
82    * @param t  Strip 
83    * 
84    * @return Noise value for strip 
85    */
86   Float_t Get(UShort_t d, Char_t r, UShort_t s, UShort_t t) const 
87   { 
88     return fValues(d, r, s, t);
89   }
90   /** 
91    * Set the value for a strip. 
92    * 
93    * @param d Detector 
94    * @param r Ring 
95    * @param s Sector
96    * @param t Strip
97    * @param x Value 
98    */
99   void Set(UShort_t d, Char_t r, UShort_t s, UShort_t t, Float_t x) 
100   { 
101     fValues(d, r, s, t) = x;
102   }
103   /** 
104    * Get a reference to the noise map 
105    * 
106    * @return Noise map 
107    */
108   const AliFMDFloatMap& Values() { return fValues; }
109 protected: 
110   AliFMDFloatMap fValues; // The noise-gain map 
111   ClassDef(AliFMDCorrNoiseGain,1); // Clone of AliFMDCalibPedestal
112 };
113
114 #endif
115 // Local Variables:
116 //   mode: C++
117 // End:
118
119