]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDQAChecker.h
Fixed igmore
[u/mrichter/AliRoot.git] / FMD / AliFMDQAChecker.h
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   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   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    * Check one histogram 
65    * 
66    * @param specie Event specie 
67    * @param hist   Histogram to check 
68    * 
69    * @return 0 if all is good, increasing severity for increasingly
70    * bad data
71    */
72   UShort_t CheckOne(AliQAv1::ALITASK_t          what,
73                     AliRecoParam::EventSpecie_t specie, 
74                     TH1*                        hist) const;
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, 
97                     TH1*                        hist) const;
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, 
109                     TH1*                        hist) const;
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, 
121                     TH1*                        hist) const;
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, 
133                     TH1*                        hist) const;
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;
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
197   Int_t    fELossMaxEntries;   // Maximum number of entries before clear
198   Double_t fELossGoodParError; // Least relative error
199   Double_t fROErrorsBad;       // Cut on read-out errors 
200   Double_t fROErrorsFkup;      // Cut on read-out errors 
201 private:
202   /** 
203    * Copy constructor - not implemented 
204    * 
205    * @param qac Object to copy from
206    */
207   AliFMDQAChecker(const AliFMDQAChecker& qac); 
208   /** 
209    * assignment operator - not implemented 
210    * 
211    * @param qac Object to assign from 
212    * 
213    * @return Reference to this object 
214    */
215   AliFMDQAChecker& operator=(const AliFMDQAChecker& qac); 
216
217   ClassDef(AliFMDQAChecker,0)  // Yves? what to do? 
218 };
219
220 #endif // AliFMDQAChecker_H
221 // Local Variables:
222 //  mode: c++
223 // End: