]>
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 | **************************************************************************/ | |
c03351ac | 15 | //... |
16 | // Checks the quality assurance. | |
17 | // By comparing with reference data | |
18 | // Skeleton for T0 | |
f6c2d5e2 | 19 | //--------------------------------------------- |
20 | //checkig without reference data: | |
21 | //for RAW QA all histograms should have approximatly the same | |
22 | //number of entries as RefPoint | |
23 | //for Rec Points checks | |
24 | // - amplitude measured by 2 methos | |
25 | // - online and offline T0 measurements | |
26 | // for ESD quality of reconstruction ( and measurements): | |
27 | // RMS of vertex and T0 less than 75ps | |
28 | // | |
29 | // Alla.Maevskaya@cern.ch | |
c03351ac | 30 | //... |
31 | ||
32 | // --- ROOT system --- | |
b09247a2 | 33 | #include <Riostream.h> |
c03351ac | 34 | #include <TClass.h> |
35 | #include <TH1F.h> | |
0d849919 | 36 | #include <TH2.h> |
c03351ac | 37 | #include <TIterator.h> |
38 | #include <TKey.h> | |
39 | #include <TFile.h> | |
446d6ec4 | 40 | #include <TMath.h> |
0d849919 | 41 | #include <TString.h> |
c03351ac | 42 | |
43 | // --- Standard library --- | |
44 | ||
45 | // --- AliRoot header files --- | |
46 | #include "AliLog.h" | |
4e25ac79 | 47 | #include "AliQAv1.h" |
c03351ac | 48 | #include "AliQAChecker.h" |
394c1a6d | 49 | #include "AliCDBEntry.h" |
50 | #include "AliQAManager.h" | |
c03351ac | 51 | #include "AliT0QAChecker.h" |
52 | ||
53 | ClassImp(AliT0QAChecker) | |
54 | ||
3685c21c | 55 | |
57acd2d2 | 56 | //____________________________________________________________________________ |
4e25ac79 | 57 | Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t /*index*/) |
57acd2d2 | 58 | { |
59 | Double_t * rv = new Double_t[AliRecoParam::kNSpecies] ; | |
60 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) | |
61 | rv[specie] = 0.0 ; | |
62 | return rv ; | |
63 | } | |
64 | ||
4e67e173 | 65 | //__________________________________________________________________ |
4e25ac79 | 66 | Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list) |
3685c21c | 67 | { |
68 | ||
69 | // Super-basic check on the QA histograms on the input list: | |
70 | // look whether they are empty! | |
394c1a6d | 71 | |
57acd2d2 | 72 | Double_t * test = new Double_t[AliRecoParam::kNSpecies] ; |
394c1a6d | 73 | /* |
74 | char * detOCDBDir = Form("T0/%s/%s", AliQAv1::GetRefOCDBDirName(), AliQAv1::GetRefDataDirName()) ; | |
75 | AliCDBEntry *QARefRec = AliQAManager::QAManager()->Get(detOCDBDir); | |
76 | // QARefRec->Dump(); | |
77 | if( !QARefRec){ | |
78 | AliInfo("QA reference data NOT retrieved for Reconstruction check. No T0 reference distribution"); | |
79 | } | |
80 | */ | |
81 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) | |
57acd2d2 | 82 | test[specie] = 10.0 ; |
c724dd64 | 83 | |
332b9234 | 84 | Double_t nent[500]; |
85 | TString hname[500]; | |
5ed41460 | 86 | const char *cname; |
332b9234 | 87 | memset(nent,0,500*sizeof(Double_t)); |
88 | Double_t w[500]; | |
89 | memset(w,1,500*sizeof(Double_t)); | |
0d849919 | 90 | TH2 *fhRecDiff[3]; |
332b9234 | 91 | TH1 *fhRawEff[500]; |
57acd2d2 | 92 | TH1 *fhESD[2]; |
93 | ||
94 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { | |
4e25ac79 | 95 | // TString dataType = AliQAv1::GetAliTaskName(index); |
57acd2d2 | 96 | if (list[specie]->GetEntries() == 0){ |
97 | test[specie] = 1. ; // nothing to check | |
98 | } | |
99 | else { | |
100 | TIter next(list[specie]) ; | |
3685c21c | 101 | TH1 * hdata ; |
0d849919 | 102 | TH2 * h ; |
5379c4a3 | 103 | // AliDebug(AliQAv1::GetQADebugLevel(), Form(" data type %i %s nentries %i\n", |
57acd2d2 | 104 | // index,dataType.Data(),list->GetEntries())); |
105 | for (Int_t ir=0; ir<list[specie]->GetEntries(); ir++) { | |
106 | //raw | |
107 | if(index==0 ){ | |
332b9234 | 108 | if(ir > 204 && ir<208 ) { |
57acd2d2 | 109 | // else{ |
332b9234 | 110 | hdata = (TH1*) list[specie]->UncheckedAt(ir); |
5379c4a3 | 111 | AliDebug(AliQAv1::GetQADebugLevel(), Form(" index %i ir %i \n", index,ir)); |
332b9234 | 112 | if(hdata) { |
113 | cname = hdata->GetName(); | |
57acd2d2 | 114 | hname[ir] = cname; |
5379c4a3 | 115 | AliDebug(AliQAv1::GetQADebugLevel(),Form("count %i %s \n",ir, hname[ir].Data())) ; |
332b9234 | 116 | fhRawEff[ir] = hdata; |
57acd2d2 | 117 | } |
118 | } | |
394c1a6d | 119 | } |
120 | ||
57acd2d2 | 121 | //rec |
122 | if(index==2){ | |
123 | h = (TH2*) list[specie]->UncheckedAt(ir); | |
124 | if(h) { | |
125 | cname = h->GetName(); | |
126 | hname[ir] = cname; | |
394c1a6d | 127 | // AliDebug(AliQAv1::GetQADebugLevel(), Form("count %i %s \n",ir, hname[ir].Data())) ; |
128 | fhRecDiff[ir] = h; | |
57acd2d2 | 129 | } |
130 | } | |
131 | //esd | |
132 | if(index==3){ | |
57acd2d2 | 133 | hdata = (TH1*) list[specie]->UncheckedAt(ir); |
134 | if(hdata){ | |
135 | fhESD[ir] = hdata; | |
5379c4a3 | 136 | AliDebug(AliQAv1::GetQADebugLevel(), Form("count %i %s ",ir, hname[ir].Data()) ); |
57acd2d2 | 137 | } |
0d849919 | 138 | } |
57acd2d2 | 139 | } |
394c1a6d | 140 | //raw data |
141 | if (index == 0) test[specie] = CheckRaw(list[specie]/*,(TObjArray *)QARefRec->GetObject()*/); | |
142 | ||
143 | ||
144 | ||
57acd2d2 | 145 | if(index == 2){ |
146 | //rec points | |
147 | for (Int_t icase=0; icase<2; icase++) { | |
148 | for (Int_t idet=0; idet<24; idet++) { | |
149 | Double_t mean = fhRecDiff[icase]-> | |
150 | ProjectionY(Form("%s_py", fhRecDiff[icase]->GetName()), | |
151 | idet,idet+1)->GetMean(); | |
152 | Double_t rms= fhRecDiff[icase]-> | |
153 | ProjectionY(Form("%s_py", fhRecDiff[icase]->GetName()), | |
154 | idet,idet+1)->GetRMS(); | |
5379c4a3 | 155 | AliDebug(AliQAv1::GetQADebugLevel(), Form("name %s icase %i idet %i mean %f, rms %f\n", |
57acd2d2 | 156 | fhRecDiff[icase]->GetName(), icase, idet, mean,rms)); |
0d849919 | 157 | |
57acd2d2 | 158 | if(TMath::Abs(mean) >1.5 || rms >1){ |
5379c4a3 | 159 | AliDebug(AliQAv1::GetQADebugLevel(), Form(" calibration is nor perfect; test=%f", test)) ; |
57acd2d2 | 160 | test[specie]=0.25; |
161 | } | |
162 | if(mean>3 || rms >5) { | |
163 | test[specie] = 0.1; | |
5379c4a3 | 164 | AliDebug(AliQAv1::GetQADebugLevel(), Form(" wrong calibration test=%f", test[specie])) ; |
57acd2d2 | 165 | } |
166 | } | |
167 | } | |
3685c21c | 168 | } |
57acd2d2 | 169 | if (index == 3) { |
170 | //ESD | |
171 | for (Int_t icase=0; icase<2; icase++) { | |
172 | Double_t rmsVertex = fhESD[icase]->GetRMS(); | |
173 | Double_t meanVertex = fhESD[icase]->GetMean(); | |
174 | test[specie]=1; | |
5379c4a3 | 175 | AliDebug(AliQAv1::GetQADebugLevel(), Form("numentries %d meanVertex %f rmsVertex %f", fhESD[icase]->GetEntries(), meanVertex, rmsVertex)); |
57acd2d2 | 176 | if (TMath::Abs(rmsVertex)>3) { |
177 | test[specie]=0.25; | |
5379c4a3 | 178 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Vertex position resolution not good , rms= %f test=%f", |
57acd2d2 | 179 | rmsVertex, test[specie])) ; |
180 | } | |
181 | if (TMath::Abs(meanVertex)>3) { | |
182 | test[specie]=0.25; | |
5379c4a3 | 183 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Vertex position bad calibrated , Mean= %f test=%f", |
57acd2d2 | 184 | meanVertex, test[specie])) ; |
185 | } | |
186 | } | |
187 | } | |
188 | } // if (list->GetEntries() != 0 | |
5379c4a3 | 189 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Test Result = %f", test[specie])) ; |
57acd2d2 | 190 | } |
394c1a6d | 191 | |
3685c21c | 192 | return test ; |
193 | } | |
5ed41460 | 194 | |
394c1a6d | 195 | //-------------------------------------------------------------------------- |
196 | Double_t AliT0QAChecker::CheckRaw(TObjArray *listrec /*, TObjArray *listref*/) const | |
197 | { | |
198 | ||
332b9234 | 199 | TH1 *fhRawEff; |
394c1a6d | 200 | // TH2 *fhRawRef; |
201 | // TIter next(listref) ; | |
202 | // Int_t counter=0; | |
203 | // Float_t refmean[50]; | |
204 | // Float_t refrms[50]; | |
205 | Float_t checkr = 0; | |
206 | /* | |
207 | // Int_t nref = listref->GetEntries(); | |
208 | // Int_t nrec = listrec->GetEntries(); | |
209 | ||
210 | cout<<" entries in ref "<<nref<<" in rec "<<nrec<<endl; | |
211 | // for (Int_t iref=0; iref<nref; iref++){ | |
212 | while (fhRawRef = dynamic_cast<TH2 *>(next())) { | |
213 | // fhRawRef->Dump(); | |
214 | // fhRawRef =(TH2*) listref->At(iref); | |
215 | cout<<counter<<" hist "<<fhRawRef<<endl; | |
216 | fhRawRef->Print(); | |
217 | fhRawRef->Dump(); | |
218 | refmean[counter] = fhRawRef->GetMean(2); | |
219 | cout<<counter<<" mean "<<refmean[counter]<<endl; | |
220 | refrms[counter] = fhRawRef->GetRMS(2); | |
221 | cout<<counter<<" rms "<<refrms[counter]<<endl; | |
222 | counter++; | |
223 | cout<<" !!!!! reference "<<counter<<" "<<refmean[counter]<<" "<<refrms[counter]<<endl; | |
224 | } | |
225 | */ | |
332b9234 | 226 | |
227 | for (Int_t icase=205; icase<208; icase++) { | |
228 | fhRawEff = (TH1*) listrec->At(icase); | |
394c1a6d | 229 | for (Int_t idet=0; idet<24; idet++) { |
332b9234 | 230 | Double_t mean = fhRawEff->GetBinContent(idet); |
231 | AliDebug(AliQAv1::GetQADebugLevel(), | |
232 | Form("name %s icase %i idet %i mean %f \n", | |
233 | fhRawEff->GetName(), icase, idet, mean)); | |
234 | ||
394c1a6d | 235 | if (mean<1.2 && mean> 0.8 ) { |
236 | checkr = 1; | |
332b9234 | 237 | AliDebug(AliQAv1::GetQADebugLevel(), Form("All channels works meane efficieny %f with test %f", mean, checkr)) ; |
394c1a6d | 238 | } |
239 | if (mean<=0.8 && mean>= 0.5 ){ | |
240 | checkr = 0.5; | |
241 | AliDebug(AliQAv1::GetQADebugLevel(), | |
242 | Form("%s problem in channel %i efficieny %f test %f", | |
243 | fhRawEff->GetName(), idet, mean,checkr )) ; | |
244 | } | |
245 | if (mean<0.5 ) { | |
246 | checkr = 0.25; | |
247 | AliDebug(AliQAv1::GetQADebugLevel(), | |
248 | Form("%s big problem in channel %i efficieny %f test %f", | |
249 | fhRawEff->GetName(), idet, mean,checkr )) ; | |
250 | } | |
251 | } | |
252 | } | |
332b9234 | 253 | /* |
394c1a6d | 254 | for (Int_t icase=208; icase<210; icase++) { |
255 | fhRawEff = (TH2*) listrec->At(icase); | |
256 | ||
257 | for (Int_t idet=0; idet<24; idet++) { | |
258 | Double_t mean = fhRawEff-> | |
259 | ProjectionY(Form("%s_py_%i_%i", fhRawEff ->GetName(), idet,icase), | |
260 | idet,idet+1)->GetMean(); | |
261 | Double_t rms= fhRawEff -> | |
262 | ProjectionY(Form("%s_py%i_%i", | |
263 | fhRawEff ->GetName(), idet,icase), | |
264 | idet,idet+1)->GetRMS(); | |
265 | ||
266 | ||
267 | ||
268 | AliDebug(AliQAv1::GetQADebugLevel(), | |
269 | Form("name %s icase %i idet %i mean %f, rms %f\n", | |
270 | fhRawEff->GetName(), icase, idet, mean,rms)); | |
332b9234 | 271 | |
394c1a6d | 272 | } |
273 | ||
274 | } | |
332b9234 | 275 | */ |
394c1a6d | 276 | return checkr; |
277 | } | |
278 |