]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDCalibFaker.h
Added documentation of each file.
[u/mrichter/AliRoot.git] / FMD / AliFMDCalibFaker.h
1 #ifndef ALIFMDCALIBFAKER_H
2 #define ALIFMDCALIBFAKER_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    AliFMDCalibFaker.h
11     @author  Christian Holm Christensen <cholm@nbi.dk>
12     @date    Sun Mar 26 18:29:36 2006
13     @brief   Make fake calibration data 
14 */
15 //____________________________________________________________________
16 //
17 //  Class to make fake calibration parameters 
18 //
19 #ifndef ROOT_TTask
20 # include <TTask.h>
21 #endif
22 #include "AliFMDParameters.h"      // ALIFMDPARAMETERS_H
23
24 /** @class AliFMDCalibFaker
25     @brief Class to make fake calibration parameters. 
26     @code 
27     AliFMDCalibFaker f(0);
28     f.AddCalib(kPedestal);
29     f.AddCalib(kGain);
30     f.Exec();
31     @endcode 
32     @ingroup FMD_util
33  */
34 class AliFMDCalibFaker : public TTask
35 {
36 public:
37   /** What to make */
38   enum EWhat {
39     /** Zero suppressio threshold */
40     kZeroSuppression =  1, 
41     /** Sample rate */
42     kSampleRate,
43     /** Pedestals */
44     kPedestal,
45     /** Gain */
46     kPulseGain,
47     /** Dead map */
48     kDeadMap,
49     /** Hardware map */
50     kAltroMap, 
51     /** Strip range */
52     kStripRange
53   };
54   enum {
55     /** All parameters */
56     kAll             = (1<<kZeroSuppression|1<<kSampleRate|1<<kPedestal|
57                         1<<kPulseGain|1<<kDeadMap|1<<kAltroMap|1<<kStripRange)
58   };
59   /** Constructor 
60       @param mask Bit mask of what to make 
61       @param loc  Where to store the results */
62   AliFMDCalibFaker(Int_t mask=kAll, const char* loc="local://cdb");
63   /** Destructor */
64   virtual ~AliFMDCalibFaker() {}
65   /** Add a parameter to output 
66       @param w Bit of parameter */
67   void AddCalib(EWhat w) { SETBIT(fMask, w); }
68   /** Remove a parameter from output 
69       @param w Bit of parameter */
70   void RemoveCalib(EWhat w) { SETBIT(fMask, w); }
71   /** Set the bit mask of what to make 
72       @param mask bit mask */
73   void SetCalib(Int_t mask) { fMask = mask; }
74   /** Set seed for random gain.  The gain is distributed flatly from
75       90 to 110 percent of the seed. 
76       @param g Seed for gain */
77   void SetGainSeed(Float_t g) { fGain = g; }
78   /** Set the threshold factor.  The actual threshold is the gain seed
79       times the factor 
80       @param t Factor */
81   void SetThresholdFactor(Float_t t) { fThresholdFactor = t; }
82   /** Set the limits for the random pedestal.  The pedestal values are
83       randomly distributed in the range 
84       @param min Minimum of range 
85       @param max Maximum of range */
86   void SetPedestalRange(Float_t min, Float_t max) 
87   {
88     fPedestalMin = min;
89     fPedestalMax = (max < min ? min : max);
90   }
91   /** Set run validty range 
92       @param min Minimum run number
93       @param max Maximum run number */
94   void SetRunRange(Int_t min, Int_t max) 
95   {
96     fRunMin = min;
97     fRunMax = (max < min ? min : max);
98   }
99   /** Set the likelyness that a strip is dead. 
100       @param chance Chance of dead channel. */
101   void SetDeadChance(Float_t chance) { fDeadChance = chance; }
102   /** Set Sample rate 
103       @param rate Rate */
104   void SetRate(UShort_t rate) { fRate = rate; }
105   /** Set the zero suppression threshold 
106       @param t Threshold (in ADC counts) */
107   void SetZeroThreshold(UShort_t t) { fZeroThreshold = t; }
108   /** Set strip validty range 
109       @param min Minimum strip number
110       @param max Maximum strip number */
111   void SetStripRange(UShort_t min, UShort_t max) 
112   {
113     fStripMin = min;
114     fStripMax = (max < min ? min : max);
115   }
116   /** Set the default output storage.  It must be a CDB URL. 
117       @param url CDB URL. */
118   void SetDefaultStorage(const char* url) { SetTitle(url); }
119   /** Make the fake calibration parameters 
120       @param option Not used */
121   void Exec(Option_t* option="");
122 protected:
123   /** Make zero suppression parameters 
124       @return Map of zero suppression */
125   virtual AliFMDCalibZeroSuppression* MakeZeroSuppression();
126   /** Make sample rate parameters 
127       @return Map of sample rate */
128   virtual AliFMDCalibSampleRate*      MakeSampleRate();
129   /** Make pedestal parameters 
130       @return Map of pedestal */
131   virtual AliFMDCalibPedestal*        MakePedestal();
132   /** Make gain parameters 
133       @return Map of gain */
134   virtual AliFMDCalibGain*            MakePulseGain();
135   /** Make dead channel parameters 
136       @return Map of dead channel */
137   virtual AliFMDCalibDeadMap*         MakeDeadMap();
138   /** Make a hardware map
139       @return hardware map */
140   virtual AliFMDAltroMapping*         MakeAltroMap();
141   /** Make a strip range
142       @return strip range map */
143   virtual AliFMDCalibStripRange*      MakeStripRange();
144
145   Long_t   fMask;            // What to write 
146   Float_t  fGain;            // Gain
147   Float_t  fThresholdFactor; // Threshold factor
148   Float_t  fThreshold;       // Threshold
149   Float_t  fPedestalMin;     // Min pedestal
150   Float_t  fPedestalMax;     // Max pedestal
151   Float_t  fDeadChance;      // Chance of dead channel
152   UShort_t fRate;            // Sample rate 
153   UShort_t fZeroThreshold;   // Zero suppression threshold
154   Int_t    fRunMin;
155   Int_t    fRunMax;
156   UShort_t fStripMin;
157   UShort_t fStripMax;
158   
159   ClassDef(AliFMDCalibFaker,0)
160 };
161
162 #endif
163 //____________________________________________________________________
164 //
165 // Local Variables:
166 //   mode: C++
167 // End:
168 //
169 // EOF
170 //
171