1 #ifndef ALIFMDCALIBFAKER_H
2 #define ALIFMDCALIBFAKER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
6 * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
8 * See cxx source for full Copyright notice
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
15 //____________________________________________________________________
17 // Class to make fake calibration parameters
22 #include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
24 /** @class AliFMDCalibFaker
25 @brief Class to make fake calibration parameters.
27 AliFMDCalibFaker f(0);
28 f.AddCalib(kPedestal);
34 class AliFMDCalibFaker : public TTask
39 /** Zero suppressio threshold */
56 kAll = (1<<kZeroSuppression|1<<kSampleRate|1<<kPedestal|
57 1<<kPulseGain|1<<kDeadMap|1<<kAltroMap|1<<kStripRange)
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");
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
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)
89 fPedestalMax = (max < min ? min : max);
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)
97 fRunMax = (max < min ? min : max);
99 /** Set the likelyness that a strip is dead.
100 @param chance Chance of dead channel. */
101 void SetDeadChance(Float_t chance) { fDeadChance = chance; }
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)
114 fStripMax = (max < min ? min : max);
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="");
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();
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
159 ClassDef(AliFMDCalibFaker,0)
163 //____________________________________________________________________