]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDCalibFaker.h
Added script for runnings Yves QA stuff
[u/mrichter/AliRoot.git] / FMD / AliFMDCalibFaker.h
CommitLineData
20345ac5 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 */
c2fc1258 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
02a27b50 14 @ingroup FMD_util
c2fc1258 15*/
20345ac5 16//____________________________________________________________________
17//
18// Class to make fake calibration parameters
02a27b50 19// Used for populating inital data base
20// Utility class
20345ac5 21//
22#ifndef ROOT_TTask
23# include <TTask.h>
24#endif
25#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
26
9f662337 27/** @class AliFMDCalibFaker
28 @brief Class to make fake calibration parameters.
29 @code
30 AliFMDCalibFaker f(0);
31 f.AddCalib(kPedestal);
32 f.AddCalib(kGain);
33 f.Exec();
34 @endcode
35 @ingroup FMD_util
36 */
20345ac5 37class AliFMDCalibFaker : public TTask
38{
39public:
9f662337 40 /** What to make */
20345ac5 41 enum EWhat {
9f662337 42 /** Zero suppressio threshold */
20345ac5 43 kZeroSuppression = 1,
9f662337 44 /** Sample rate */
20345ac5 45 kSampleRate,
9f662337 46 /** Pedestals */
20345ac5 47 kPedestal,
9f662337 48 /** Gain */
20345ac5 49 kPulseGain,
9f662337 50 /** Dead map */
20345ac5 51 kDeadMap,
9f662337 52 /** Hardware map */
c2fc1258 53 kAltroMap,
54 /** Strip range */
55 kStripRange
20345ac5 56 };
57 enum {
9f662337 58 /** All parameters */
20345ac5 59 kAll = (1<<kZeroSuppression|1<<kSampleRate|1<<kPedestal|
c2fc1258 60 1<<kPulseGain|1<<kDeadMap|1<<kAltroMap|1<<kStripRange)
20345ac5 61 };
9f662337 62 /** Constructor
63 @param mask Bit mask of what to make
64 @param loc Where to store the results */
20345ac5 65 AliFMDCalibFaker(Int_t mask=kAll, const char* loc="local://cdb");
9f662337 66 /** Destructor */
20345ac5 67 virtual ~AliFMDCalibFaker() {}
9f662337 68 /** Add a parameter to output
69 @param w Bit of parameter */
20345ac5 70 void AddCalib(EWhat w) { SETBIT(fMask, w); }
9f662337 71 /** Remove a parameter from output
72 @param w Bit of parameter */
20345ac5 73 void RemoveCalib(EWhat w) { SETBIT(fMask, w); }
9f662337 74 /** Set the bit mask of what to make
75 @param mask bit mask */
20345ac5 76 void SetCalib(Int_t mask) { fMask = mask; }
9f662337 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 */
20345ac5 80 void SetGainSeed(Float_t g) { fGain = g; }
9f662337 81 /** Set the threshold factor. The actual threshold is the gain seed
82 times the factor
83 @param t Factor */
20345ac5 84 void SetThresholdFactor(Float_t t) { fThresholdFactor = t; }
9f662337 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 */
20345ac5 89 void SetPedestalRange(Float_t min, Float_t max)
90 {
91 fPedestalMin = min;
92 fPedestalMax = (max < min ? min : max);
93 }
9f662337 94 /** Set run validty range
95 @param min Minimum run number
96 @param max Maximum run number */
20345ac5 97 void SetRunRange(Int_t min, Int_t max)
98 {
99 fRunMin = min;
100 fRunMax = (max < min ? min : max);
101 }
9f662337 102 /** Set the likelyness that a strip is dead.
103 @param chance Chance of dead channel. */
20345ac5 104 void SetDeadChance(Float_t chance) { fDeadChance = chance; }
9f662337 105 /** Set Sample rate
106 @param rate Rate */
20345ac5 107 void SetRate(UShort_t rate) { fRate = rate; }
9f662337 108 /** Set the zero suppression threshold
109 @param t Threshold (in ADC counts) */
20345ac5 110 void SetZeroThreshold(UShort_t t) { fZeroThreshold = t; }
c2fc1258 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)
115 {
116 fStripMin = min;
117 fStripMax = (max < min ? min : max);
118 }
9f662337 119 /** Set the default output storage. It must be a CDB URL.
120 @param url CDB URL. */
20345ac5 121 void SetDefaultStorage(const char* url) { SetTitle(url); }
9f662337 122 /** Make the fake calibration parameters
123 @param option Not used */
20345ac5 124 void Exec(Option_t* option="");
125protected:
9f662337 126 /** Make zero suppression parameters
127 @return Map of zero suppression */
02a27b50 128 virtual AliFMDCalibZeroSuppression* MakeZeroSuppression() const;
9f662337 129 /** Make sample rate parameters
130 @return Map of sample rate */
02a27b50 131 virtual AliFMDCalibSampleRate* MakeSampleRate() const;
9f662337 132 /** Make pedestal parameters
133 @return Map of pedestal */
02a27b50 134 virtual AliFMDCalibPedestal* MakePedestal() const;
9f662337 135 /** Make gain parameters
136 @return Map of gain */
02a27b50 137 virtual AliFMDCalibGain* MakePulseGain() const;
9f662337 138 /** Make dead channel parameters
139 @return Map of dead channel */
02a27b50 140 virtual AliFMDCalibDeadMap* MakeDeadMap() const;
9f662337 141 /** Make a hardware map
142 @return hardware map */
02a27b50 143 virtual AliFMDAltroMapping* MakeAltroMap() const;
c2fc1258 144 /** Make a strip range
145 @return strip range map */
02a27b50 146 virtual AliFMDCalibStripRange* MakeStripRange() const;
a9579262 147 virtual Float_t MakeNoise(Char_t ring, UShort_t str) const;
148
20345ac5 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
02a27b50 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
20345ac5 162
163 ClassDef(AliFMDCalibFaker,0)
164};
165
166#endif
167//____________________________________________________________________
168//
169// Local Variables:
170// mode: C++
171// End:
172//
173// EOF
174//
175