]>
Commit | Line | Data |
---|---|---|
c03351ac | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | ||
17 | ||
18 | ||
19 | //... | |
20 | // Checks the quality assurance. | |
21 | // By comparing with reference data | |
22 | // Skeleton for T0 | |
f6c2d5e2 | 23 | //--------------------------------------------- |
24 | //checkig without reference data: | |
25 | //for RAW QA all histograms should have approximatly the same | |
26 | //number of entries as RefPoint | |
27 | //for Rec Points checks | |
28 | // - amplitude measured by 2 methos | |
29 | // - online and offline T0 measurements | |
30 | // for ESD quality of reconstruction ( and measurements): | |
31 | // RMS of vertex and T0 less than 75ps | |
32 | // | |
33 | // Alla.Maevskaya@cern.ch | |
c03351ac | 34 | //... |
35 | ||
36 | // --- ROOT system --- | |
b09247a2 | 37 | #include <Riostream.h> |
c03351ac | 38 | #include <TClass.h> |
39 | #include <TH1F.h> | |
40 | #include <TH1I.h> | |
41 | #include <TIterator.h> | |
42 | #include <TKey.h> | |
43 | #include <TFile.h> | |
446d6ec4 | 44 | #include <TMath.h> |
c03351ac | 45 | |
46 | // --- Standard library --- | |
47 | ||
48 | // --- AliRoot header files --- | |
49 | #include "AliLog.h" | |
50 | #include "AliQA.h" | |
51 | #include "AliQAChecker.h" | |
52 | #include "AliT0QAChecker.h" | |
53 | ||
54 | ClassImp(AliT0QAChecker) | |
55 | ||
3685c21c | 56 | |
4e67e173 | 57 | //__________________________________________________________________ |
c724dd64 | 58 | const Double_t AliT0QAChecker::Check(AliQA::ALITASK_t index,TObjArray * list) |
3685c21c | 59 | { |
60 | ||
61 | // Super-basic check on the QA histograms on the input list: | |
62 | // look whether they are empty! | |
446d6ec4 | 63 | |
c724dd64 | 64 | |
5ed41460 | 65 | Double_t test = 10.0 ; |
f6c2d5e2 | 66 | |
3685c21c | 67 | Int_t count = 0 ; |
5ed41460 | 68 | Double_t nent[200], nentraw[200]; |
69 | TString hname[200]; | |
70 | const char *cname; | |
71 | memset(nent,0,200*sizeof(Double_t)); | |
72 | Double_t w[200]; | |
73 | memset(w,1,200*sizeof(Double_t)); | |
c724dd64 | 74 | TH1 *fhRecLEDAmp[24]; TH1 * fhRecQTC[24]; |
c2337900 | 75 | TH1 *fhOnlineMean = 0x0; |
76 | TH1 * fhRecMean = 0x0; | |
c33b02bf | 77 | TH1 *fhESDMean = 0x0; |
78 | TH1 *fhESDVertex = 0x0; | |
c724dd64 | 79 | TString dataType = AliQA::GetAliTaskName(index); |
c03351ac | 80 | |
3685c21c | 81 | if (list->GetEntries() == 0){ |
82 | test = 1. ; // nothing to check | |
3685c21c | 83 | } |
84 | else { | |
446d6ec4 | 85 | |
3685c21c | 86 | TIter next(list) ; |
87 | TH1 * hdata ; | |
c724dd64 | 88 | |
3685c21c | 89 | count = 0 ; |
90 | while ( (hdata = dynamic_cast<TH1 *>(next())) ) { | |
91 | if (hdata) { | |
446d6ec4 | 92 | nent[count] = hdata->GetEntries(); |
f6c2d5e2 | 93 | cname = hdata->GetName(); |
94 | hname[count] = cname; | |
5ed41460 | 95 | AliDebug(10,Form("count %i %s -> %f",count, hname[count].Data(),nent[count])) ; |
c724dd64 | 96 | if(index==2){ |
97 | if(count>23 && count<48)fhRecLEDAmp[count-24] = hdata; | |
98 | if(count>47 && count<72)fhRecQTC[count-48] = hdata; | |
c2337900 | 99 | if(count == 72) fhOnlineMean = hdata; |
100 | if(count == 73) fhRecMean = hdata; | |
c724dd64 | 101 | } |
5ed41460 | 102 | |
c33b02bf | 103 | |
104 | if(index==3){ | |
f5f6c888 | 105 | if(count==0) fhESDMean = hdata; |
106 | if(count==1) fhESDVertex = hdata; | |
0608f4dc | 107 | if(count>1){ |
108 | AliWarning("Unknowm ESD QA histograms"); | |
109 | return 0; | |
110 | } | |
c33b02bf | 111 | } |
c724dd64 | 112 | count++ ; |
5ed41460 | 113 | |
3685c21c | 114 | Double_t rv = 0.; |
115 | if(hdata->GetEntries()>0) rv = 1; | |
c724dd64 | 116 | // AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ; |
3685c21c | 117 | test += rv ; |
5ed41460 | 118 | |
c724dd64 | 119 | } |
3685c21c | 120 | else{ |
121 | AliError("Data type cannot be processed") ; | |
122 | } | |
123 | ||
124 | } | |
5ed41460 | 125 | |
3685c21c | 126 | if (count != 0) { |
127 | if (test==0) { | |
128 | AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING"); | |
129 | test = 0.5; //upper limit value to set kWARNING flag for a task | |
130 | } | |
131 | else { | |
c724dd64 | 132 | if(index == 2){ |
f6c2d5e2 | 133 | //rec points |
c724dd64 | 134 | if ( TMath::Abs(fhRecMean->GetMean() - fhOnlineMean->GetMean()) > 5) |
135 | AliWarning(Form("rec mean %f -> online mean %f",fhRecMean->GetMean(), fhOnlineMean->GetMean())) ; | |
136 | Double_t meanLED, meanQTC; | |
137 | for (Int_t idet=0; idet<24; idet++) { | |
138 | meanLED = fhRecLEDAmp[idet]->GetMean(); | |
139 | meanQTC = fhRecQTC[idet]->GetMean(); | |
140 | if (TMath::Abs(meanLED-meanQTC)> 1.) | |
5ed41460 | 141 | AliWarning(Form("Amplitude measurements are different in channel %i : Amp LED %f -> Amp QTC %f",idet,meanLED, meanQTC)) ; |
c724dd64 | 142 | } |
143 | } | |
5ed41460 | 144 | |
145 | ||
146 | if (index == 0) { | |
f6c2d5e2 | 147 | //raw data |
148 | Float_t realNumber = Float_t(nent[0]); | |
5ed41460 | 149 | for (Int_t i=77; i<count; i++) |
150 | { | |
151 | Double_t diff = TMath::Abs(nent[i]-realNumber); | |
152 | if (diff > 0.1*realNumber ) | |
f6c2d5e2 | 153 | AliWarning(Form("Problem in Number of entried in hist %s is %f number of RefPoints %f\n",hname[i].Data() , nent[i],realNumber )) ; |
5ed41460 | 154 | } |
446d6ec4 | 155 | } |
c33b02bf | 156 | if (index == 3) { |
f6c2d5e2 | 157 | //ESD |
c33b02bf | 158 | Double_t rmsMeanTime = fhESDMean->GetRMS(); |
159 | if (rmsMeanTime>3) | |
160 | AliWarning(Form("Mean time with bad resolution, RMS= %f",rmsMeanTime)) ; | |
161 | Double_t rmsVertex = fhESDVertex->GetRMS(); | |
162 | if (rmsVertex>3) | |
163 | AliWarning(Form("Vertex with bad resolution, RMS= %f",rmsVertex)) ; | |
164 | } | |
165 | ||
3685c21c | 166 | } |
5ed41460 | 167 | |
3685c21c | 168 | } |
5ed41460 | 169 | |
170 | ||
c724dd64 | 171 | } // if (list->GetEntries() != 0 |
5ed41460 | 172 | |
3685c21c | 173 | AliInfo(Form("Test Result = %f", test)) ; |
5ed41460 | 174 | |
3685c21c | 175 | return test ; |
176 | } | |
5ed41460 | 177 |