Line data Source code
1 : #ifndef ALIFMDQACHECKER_H
2 : #define ALIFMDQACHECKER_H
3 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4 : * reserved.
5 : *
6 : * See cxx source for full Copyright notice
7 : */
8 : #include "AliQACheckerBase.h"
9 : class TFile;
10 : class TH1F;
11 : class TH1I;
12 : class TFitResultPtr;
13 :
14 : /**
15 : * @class AliFMDQAChecker
16 : * @brief Quality assurance checker for the FMD
17 : */
18 : class AliFMDQAChecker : public AliQACheckerBase
19 : {
20 : public:
21 : /** Constructor */
22 : AliFMDQAChecker();
23 : /** Destructor */
24 0 : virtual ~AliFMDQAChecker() {}
25 : /**
26 : * Member function called to do the actual checking
27 : *
28 : * @param rv Array of return values.
29 : * @param what What to check
30 : * @param list Array of arrays of histograms. There's one arrat for
31 : * each 'specie'
32 : * @param t Reconstruction parameters - not used.
33 : */
34 : void Check(Double_t* rv, AliQAv1::ALITASK_t what,
35 : TObjArray** list, const AliDetectorRecoParam* t);
36 : /**
37 : * Make output images. This is overridden relative to the base
38 : * class so that we can set the log(y) scale and put everything on
39 : * the same axis.
40 : *
41 : * @param list List of specie array of histograms
42 : * @param task What to show
43 : * @param mode Mode
44 : */
45 : void MakeImage(TObjArray** list,
46 : AliQAv1::TASKINDEX_t task,
47 : AliQAv1::MODE_t mode);
48 : /**
49 : * Set wether to scale the histograms to a common Y axis or not when
50 : * generating plots
51 : *
52 : * @param on If true, do scale
53 : */
54 0 : void SetDoScale(Bool_t on=true) { fDoScale = on; }
55 : protected:
56 : // Return values
57 : enum {
58 : kOK,
59 : kProblem,
60 : kBad,
61 : kWhatTheFk
62 : };
63 : /**
64 : * Add a status pave to the plot
65 : *
66 : * @param ll List to add to
67 : * @param qual Quality
68 : * @param xl X coordinate of lower-left corner (NDC)
69 : * @param yl Y coordinate of lower-left corner (NDC)
70 : * @param xh X coordinate of upper-right corner (NDC)
71 : * @param yh Y coordinate of upper-right corner (NDC)
72 : */
73 : void AddStatusPave(TH1* hist, Int_t qual,
74 : Double_t xl=-1, Double_t yl=-1,
75 : Double_t xh=-1, Double_t yh=-1) const;
76 : /**
77 : * Check one histogram
78 : *
79 : * @param specie Event specie
80 : * @param hist Histogram to check
81 : *
82 : * @return 0 if all is good, increasing severity for increasingly
83 : * bad data
84 : */
85 : UShort_t CheckOne(AliQAv1::ALITASK_t what,
86 : AliRecoParam::EventSpecie_t specie,
87 : TH1* hist) const;
88 : /**
89 : * Check raw input. If the reconstructor is enabled, then we try to fit
90 : *
91 : * @f[
92 : * f(\Delta;\Delta_p,\xi,\sigma) = \int_{-\infty}^{\infty}d\Delta_p'
93 : * f_{L}(\Delta;\Delta_p',\xi) \times
94 : * e^{\frac{(\Delta-\Delta_p')^2}{\sigma^2}}
95 : * @f]
96 : *
97 : * where @f$f_L@f$ is the Landau distribution, to the data. The
98 : * quality is set according to the value of @f$\chi^2/\nu@f$.
99 : *
100 : * If no reconstructor is set, then simply check that the histogram
101 : * isn't empty
102 : *
103 : * @param specie Event specie
104 : * @param hist Histogram to check
105 : *
106 : * @return 0 if all is good, increasing severity for increasingly
107 : * bad data
108 : */
109 : UShort_t CheckRaw(AliRecoParam::EventSpecie_t specie,
110 : TH1* hist) const;
111 : /**
112 : * Check simulation output. Does a simple test of whether the
113 : * histogram is empty or not.
114 : *
115 : * @param specie Event specie
116 : * @param hist Histogram to check
117 : *
118 : * @return 0 if all is good, increasing severity for increasingly
119 : * bad data
120 : */
121 : UShort_t CheckSim(AliRecoParam::EventSpecie_t specie,
122 : TH1* hist) const;
123 : /**
124 : * Check ESD. Does a simple test of whether the histogram is empty
125 : * or not.
126 : *
127 : * @param specie Event specie
128 : * @param hist Histogram to check
129 : *
130 : * @return 0 if all is good, increasing severity for increasingly
131 : * bad data
132 : */
133 : UShort_t CheckESD(AliRecoParam::EventSpecie_t specie,
134 : TH1* hist) const;
135 : /**
136 : * Check reconstruction points. Does a simple test of whether the
137 : * histogram is empty or not.
138 : *
139 : * @param specie Event specie
140 : * @param hist Histogram to check
141 : *
142 : * @return 0 if all is good, increasing severity for increasingly
143 : * bad data
144 : */
145 : UShort_t CheckRec(AliRecoParam::EventSpecie_t specie,
146 : TH1* hist) const;
147 : /**
148 : * Set the returned QA from this checker based on the values in the
149 : * array @a values. Note, this by-passes the Low/High setting of
150 : * the base class (which are very confusing)
151 : *
152 : * @param index Task index
153 : * @param values Array of values
154 : */
155 : void SetQA(AliQAv1::ALITASK_t index, Double_t* values) const;
156 : /**
157 : * Process external parameters
158 : *
159 : */
160 : void ProcessExternalParams();
161 : /**
162 : * Process a single external parameter
163 : *
164 : * @param name Name of parameter
165 : * @param v On return, the value - as a double
166 : */
167 : void ProcessExternalParam(const char* name, Double_t& v);
168 : /**
169 : * Get the thresholds from OCDB
170 : *
171 : */
172 : void GetThresholds();
173 : /**
174 : * The basic check on a histogram
175 : *
176 : * @param hist Histogram
177 : *
178 : * @return 1 empty - 0 otherwise
179 : */
180 : UShort_t BasicCheck(TH1* hist) const;
181 : /**
182 : * Translate our internal quality measure to QA framework bit
183 : *
184 : * @param qual Internal quality
185 : *
186 : * @return QA framework quality bit
187 : */
188 : AliQAv1::QABIT_t Quality2Bit(UShort_t qual) const;
189 : /**
190 : * Add fit results to to plot
191 : *
192 : * @param hist Histogram
193 : * @param res Fit result
194 : * @param color Color to use for the text - depends on quality
195 : * @param low Lower bound on fit range
196 : * @param high Upper bound on fit range
197 : */
198 : UShort_t CheckFit(TH1* hist, const TFitResultPtr& res,
199 : Double_t low, Double_t high, Int_t& color) const;
200 : Bool_t fDoScale; // Whether to scale all histograms
201 : Bool_t fDidExternal; // Whether we've processed the external params
202 : Bool_t fShowFitResults; // Whether to put the fit result on the plots
203 : Double_t fELossLowCut; // Low cut on ELoss fits
204 : Double_t fELossNRMS; // Number of RMS to fit upward
205 : Double_t fELossBadChi2Nu; // Cut on bad chi2/nu
206 : Double_t fELossFkupChi2Nu; // Cut on F**ked up chi2/nu
207 : Int_t fELossMinEntries; // Least number of entries before fitting
208 : Int_t fELossMaxEntries; // Maximum number of entries before clear
209 : Double_t fELossGoodParError; // Least relative error
210 : Double_t fELossMinSharing; // Least to consider for sharing fit
211 : Double_t fROErrorsBad; // Cut on read-out errors
212 : Double_t fROErrorsFkup; // Cut on read-out errors
213 : Int_t fMaxNProblem; // Maximum number of problematic fits
214 : Int_t fMaxNBad; // Maximum number of bad fits
215 : Double_t fMinMPV; // Least MPV
216 : Double_t fMaxXi; // Largest Landau width
217 : Double_t fMaxSigma; // Largest gaussian width
218 : Bool_t fNoFits; // If true, do not fit at all
219 : private:
220 : /**
221 : * Copy constructor - not implemented
222 : *
223 : * @param qac Object to copy from
224 : */
225 : AliFMDQAChecker(const AliFMDQAChecker& qac);
226 : /**
227 : * assignment operator - not implemented
228 : *
229 : * @param qac Object to assign from
230 : *
231 : * @return Reference to this object
232 : */
233 : AliFMDQAChecker& operator=(const AliFMDQAChecker& qac);
234 :
235 74 : ClassDef(AliFMDQAChecker,0) // Checker of FMD data quality
236 : };
237 :
238 : #endif // AliFMDQAChecker_H
239 : // Local Variables:
240 : // mode: c++
241 : // End:
|