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
16 //____________________________________________________________________
18 // Class to make fake calibration parameters
19 // Used for populating inital data base
25 #include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
27 /** @class AliFMDCalibFaker
28 @brief Class to make fake calibration parameters.
30 AliFMDCalibFaker f(0);
31 f.AddCalib(kPedestal);
37 class AliFMDCalibFaker : public TTask
42 /** Zero suppressio threshold */
59 kAll = (1<<kZeroSuppression|1<<kSampleRate|1<<kPedestal|
60 1<<kPulseGain|1<<kDeadMap|1<<kAltroMap|1<<kStripRange)
63 @param mask Bit mask of what to make
64 @param loc Where to store the results */
65 AliFMDCalibFaker(Int_t mask=kAll, const char* loc="local://cdb");
67 virtual ~AliFMDCalibFaker() {}
68 /** Add a parameter to output
69 @param w Bit of parameter */
70 void AddCalib(EWhat w) { SETBIT(fMask, w); }
71 /** Remove a parameter from output
72 @param w Bit of parameter */
73 void RemoveCalib(EWhat w) { SETBIT(fMask, w); }
74 /** Set the bit mask of what to make
75 @param mask bit mask */
76 void SetCalib(Int_t mask) { fMask = mask; }
77 /** Set seed for random gain. The gain is distributed flatly from
78 90 to 110 percent of the seed.
79 @param g Seed for gain */
80 void SetGainSeed(Float_t g) { fGain = g; }
81 /** Set the threshold factor. The actual threshold is the gain seed
84 void SetThresholdFactor(Float_t t) { fThresholdFactor = t; }
85 /** Set the limits for the random pedestal. The pedestal values are
86 randomly distributed in the range
87 @param min Minimum of range
88 @param max Maximum of range */
89 void SetPedestalRange(Float_t min, Float_t max)
92 fPedestalMax = (max < min ? min : max);
94 /** Set run validty range
95 @param min Minimum run number
96 @param max Maximum run number */
97 void SetRunRange(Int_t min, Int_t max)
100 fRunMax = (max < min ? min : max);
102 /** Set the likelyness that a strip is dead.
103 @param chance Chance of dead channel. */
104 void SetDeadChance(Float_t chance) { fDeadChance = chance; }
107 void SetRate(UShort_t rate) { fRate = rate; }
108 /** Set the zero suppression threshold
109 @param t Threshold (in ADC counts) */
110 void SetZeroThreshold(UShort_t t) { fZeroThreshold = t; }
111 /** Set strip validty range
112 @param min Minimum strip number
113 @param max Maximum strip number */
114 void SetStripRange(UShort_t min, UShort_t max)
117 fStripMax = (max < min ? min : max);
119 /** Set the default output storage. It must be a CDB URL.
120 @param url CDB URL. */
121 void SetDefaultStorage(const char* url) { SetTitle(url); }
122 /** Make the fake calibration parameters
123 @param option Not used */
124 void Exec(Option_t* option="");
126 /** Make zero suppression parameters
127 @return Map of zero suppression */
128 virtual AliFMDCalibZeroSuppression* MakeZeroSuppression() const;
129 /** Make sample rate parameters
130 @return Map of sample rate */
131 virtual AliFMDCalibSampleRate* MakeSampleRate() const;
132 /** Make pedestal parameters
133 @return Map of pedestal */
134 virtual AliFMDCalibPedestal* MakePedestal() const;
135 /** Make gain parameters
136 @return Map of gain */
137 virtual AliFMDCalibGain* MakePulseGain() const;
138 /** Make dead channel parameters
139 @return Map of dead channel */
140 virtual AliFMDCalibDeadMap* MakeDeadMap() const;
141 /** Make a hardware map
142 @return hardware map */
143 virtual AliFMDAltroMapping* MakeAltroMap() const;
144 /** Make a strip range
145 @return strip range map */
146 virtual AliFMDCalibStripRange* MakeStripRange() const;
147 virtual Float_t MakeNoise(Char_t ring, UShort_t str) const;
149 Long_t fMask; // What to write
150 Float_t fGain; // Gain
151 Float_t fThresholdFactor; // Threshold factor
152 Float_t fThreshold; // Threshold
153 Float_t fPedestalMin; // Min pedestal
154 Float_t fPedestalMax; // Max pedestal
155 Float_t fDeadChance; // Chance of dead channel
156 UShort_t fRate; // Sample rate
157 UShort_t fZeroThreshold; // Zero suppression threshold
158 Int_t fRunMin; // Min run number
159 Int_t fRunMax; // Max run number
160 UShort_t fStripMin; // Min strip read out
161 UShort_t fStripMax; // Max strip read out
163 ClassDef(AliFMDCalibFaker,0)
167 //____________________________________________________________________