]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDQAChecker.h
Adding the proper nested loop
[u/mrichter/AliRoot.git] / FMD / AliFMDQAChecker.h
CommitLineData
c9dd1c4d 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 */
ffa78f64 8#include "AliQACheckerBase.h"
c9dd1c4d 9class TFile;
10class TH1F;
11class TH1I;
1306ba55 12class TFitResultPtr;
c9dd1c4d 13
1306ba55 14/**
15 * @class AliFMDQAChecker
16 * @brief Quality assurance checker for the FMD
17 */
c9dd1c4d 18class AliFMDQAChecker : public AliQACheckerBase
19{
20public:
ffa78f64 21 /** Constructor */
1306ba55 22 AliFMDQAChecker();
ffa78f64 23 /** Destructor */
c9dd1c4d 24 virtual ~AliFMDQAChecker() {}
f26f970e 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 */
1706c710 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);
1306ba55 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 */
9558fc76 54 void SetDoScale(Bool_t on=true) { fDoScale = on; }
05e5e0c1 55protected:
1306ba55 56 // Return values
57 enum {
58 kOK,
59 kProblem,
60 kBad,
61 kWhatTheFk
62 };
05e5e0c1 63 /**
64 * Check one histogram
65 *
1306ba55 66 * @param specie Event specie
67 * @param hist Histogram to check
05e5e0c1 68 *
1306ba55 69 * @return 0 if all is good, increasing severity for increasingly
70 * bad data
05e5e0c1 71 */
1306ba55 72 UShort_t CheckOne(AliQAv1::ALITASK_t what,
05e5e0c1 73 AliRecoParam::EventSpecie_t specie,
74 TH1* hist) const;
1306ba55 75 /**
76 * Check raw input. If the reconstructor is enabled, then we try to fit
77 *
78 * @f[
79 * f(\Delta;\Delta_p,\xi,\sigma) = \int_{-\infty}^{\infty}d\Delta_p'
80 * f_{L}(\Delta;\Delta_p',\xi) \times
81 * e^{\frac{(\Delta-\Delta_p')^2}{\sigma^2}}
82 * @f]
83 *
84 * where @f$f_L@f$ is the Landau distribution, to the data. The
85 * quality is set according to the value of @f$\chi^2/\nu@f$.
86 *
87 * If no reconstructor is set, then simply check that the histogram
88 * isn't empty
89 *
90 * @param specie Event specie
91 * @param hist Histogram to check
92 *
93 * @return 0 if all is good, increasing severity for increasingly
94 * bad data
95 */
96 UShort_t CheckRaw(AliRecoParam::EventSpecie_t specie,
05e5e0c1 97 TH1* hist) const;
1306ba55 98 /**
99 * Check simulation output. Does a simple test of whether the
100 * histogram is empty or not.
101 *
102 * @param specie Event specie
103 * @param hist Histogram to check
104 *
105 * @return 0 if all is good, increasing severity for increasingly
106 * bad data
107 */
108 UShort_t CheckSim(AliRecoParam::EventSpecie_t specie,
05e5e0c1 109 TH1* hist) const;
1306ba55 110 /**
111 * Check ESD. Does a simple test of whether the histogram is empty
112 * or not.
113 *
114 * @param specie Event specie
115 * @param hist Histogram to check
116 *
117 * @return 0 if all is good, increasing severity for increasingly
118 * bad data
119 */
120 UShort_t CheckESD(AliRecoParam::EventSpecie_t specie,
05e5e0c1 121 TH1* hist) const;
1306ba55 122 /**
123 * Check reconstruction points. Does a simple test of whether the
124 * histogram is empty or not.
125 *
126 * @param specie Event specie
127 * @param hist Histogram to check
128 *
129 * @return 0 if all is good, increasing severity for increasingly
130 * bad data
131 */
132 UShort_t CheckRec(AliRecoParam::EventSpecie_t specie,
05e5e0c1 133 TH1* hist) const;
1306ba55 134 /**
135 * Set the returned QA from this checker based on the values in the
136 * array @a values. Note, this by-passes the Low/High setting of
137 * the base class (which are very confusing)
138 *
139 * @param index Task index
140 * @param values Array of values
141 */
142 void SetQA(AliQAv1::ALITASK_t index, Double_t* values) const;
143 /**
144 * Process external parameters
145 *
146 */
147 void ProcessExternalParams();
148 /**
149 * Process a single external parameter
150 *
151 * @param name Name of parameter
152 * @param v On return, the value - as a double
153 */
154 void ProcessExternalParam(const char* name, Double_t& v);
155 /**
156 * Get the thresholds from OCDB
157 *
158 */
159 void GetThresholds();
160 /**
161 * The basic check on a histogram
162 *
163 * @param hist Histogram
164 *
165 * @return 1 empty - 0 otherwise
166 */
167 UShort_t BasicCheck(TH1* hist) const;
168 /**
169 * Translate our internal quality measure to QA framework bit
170 *
171 * @param qual Internal quality
172 *
173 * @return QA framework quality bit
174 */
175 AliQAv1::QABIT_t Quality2Bit(UShort_t qual) const;
176 /**
177 * Add fit results to to plot
178 *
179 * @param hist Histogram
180 * @param res Fit result
181 * @param color Color to use for the text - depends on quality
182 * @param low Lower bound on fit range
183 * @param high Upper bound on fit range
184 */
185 void AddFitResults(TH1* hist, const TFitResultPtr& res, Int_t color,
186 Double_t low, Double_t high) const;
187 UShort_t CheckFit(TH1* hist, const TFitResultPtr& res,
188 Double_t low, Double_t high, Int_t& color) const;
7adfb385 189 Bool_t fDoScale; // Whether to scale all histograms
190 Bool_t fDidExternal; // Whether we've processed the external params
191 Bool_t fShowFitResults; // Whether to put the fit result on the plots
192 Double_t fELossLowCut; // Low cut on ELoss fits
193 Double_t fELossNRMS; // Number of RMS to fit upward
194 Double_t fELossBadChi2Nu; // Cut on bad chi2/nu
195 Double_t fELossFkupChi2Nu; // Cut on F**ked up chi2/nu
196 Int_t fELossMinEntries; // Least number of entries before fitting
1306ba55 197 Double_t fELossGoodParError; // Least relative error
7adfb385 198 Double_t fROErrorsBad; // Cut on read-out errors
199 Double_t fROErrorsFkup; // Cut on read-out errors
f4f8d21b 200private:
1306ba55 201 /**
202 * Copy constructor - not implemented
203 *
204 * @param qac Object to copy from
205 */
206 AliFMDQAChecker(const AliFMDQAChecker& qac);
207 /**
208 * assignment operator - not implemented
209 *
210 * @param qac Object to assign from
211 *
212 * @return Reference to this object
213 */
214 AliFMDQAChecker& operator=(const AliFMDQAChecker& qac);
f4f8d21b 215
c9dd1c4d 216 ClassDef(AliFMDQAChecker,0) // Yves? what to do?
217};
218
219#endif // AliFMDQAChecker_H
220// Local Variables:
221// mode: c++
222// End: