]>
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 | |
23 | //... | |
24 | ||
25 | // --- ROOT system --- | |
b09247a2 | 26 | #include <Riostream.h> |
c03351ac | 27 | #include <TClass.h> |
28 | #include <TH1F.h> | |
29 | #include <TH1I.h> | |
30 | #include <TIterator.h> | |
31 | #include <TKey.h> | |
32 | #include <TFile.h> | |
446d6ec4 | 33 | #include <TMath.h> |
c03351ac | 34 | |
35 | // --- Standard library --- | |
36 | ||
37 | // --- AliRoot header files --- | |
38 | #include "AliLog.h" | |
39 | #include "AliQA.h" | |
40 | #include "AliQAChecker.h" | |
41 | #include "AliT0QAChecker.h" | |
42 | ||
43 | ClassImp(AliT0QAChecker) | |
44 | ||
3685c21c | 45 | |
4e67e173 | 46 | //__________________________________________________________________ |
c724dd64 | 47 | const Double_t AliT0QAChecker::Check(AliQA::ALITASK_t index,TObjArray * list) |
3685c21c | 48 | { |
49 | ||
50 | // Super-basic check on the QA histograms on the input list: | |
51 | // look whether they are empty! | |
446d6ec4 | 52 | |
c724dd64 | 53 | cout<<" GetAliTaskName "<<AliQA::GetAliTaskName(index)<<" index "<<index<<endl; |
54 | ||
55 | ||
5ed41460 | 56 | Double_t test = 10.0 ; |
57 | ||
3685c21c | 58 | Int_t count = 0 ; |
5ed41460 | 59 | Double_t nent[200], nentraw[200]; |
60 | TString hname[200]; | |
61 | const char *cname; | |
62 | memset(nent,0,200*sizeof(Double_t)); | |
63 | Double_t w[200]; | |
64 | memset(w,1,200*sizeof(Double_t)); | |
c724dd64 | 65 | TH1 *fhRecLEDAmp[24]; TH1 * fhRecQTC[24]; |
c2337900 | 66 | TH1 *fhOnlineMean = 0x0; |
67 | TH1 * fhRecMean = 0x0; | |
c33b02bf | 68 | TH1 *fhESDMean = 0x0; |
69 | TH1 *fhESDVertex = 0x0; | |
c724dd64 | 70 | TString dataType = AliQA::GetAliTaskName(index); |
c03351ac | 71 | |
3685c21c | 72 | if (list->GetEntries() == 0){ |
73 | test = 1. ; // nothing to check | |
3685c21c | 74 | } |
75 | else { | |
446d6ec4 | 76 | |
3685c21c | 77 | TIter next(list) ; |
78 | TH1 * hdata ; | |
c724dd64 | 79 | |
3685c21c | 80 | count = 0 ; |
81 | while ( (hdata = dynamic_cast<TH1 *>(next())) ) { | |
82 | if (hdata) { | |
446d6ec4 | 83 | nent[count] = hdata->GetEntries(); |
5ed41460 | 84 | cname = hdata->GetName(); |
85 | hname[count] = cname; | |
86 | AliDebug(10,Form("count %i %s -> %f",count, hname[count].Data(),nent[count])) ; | |
87 | ||
c724dd64 | 88 | if(index==2){ |
89 | if(count>23 && count<48)fhRecLEDAmp[count-24] = hdata; | |
90 | if(count>47 && count<72)fhRecQTC[count-48] = hdata; | |
c2337900 | 91 | if(count == 72) fhOnlineMean = hdata; |
92 | if(count == 73) fhRecMean = hdata; | |
c724dd64 | 93 | } |
5ed41460 | 94 | |
c33b02bf | 95 | |
96 | if(index==3){ | |
0608f4dc | 97 | printf(" check ESD count %i \n",count); |
f5f6c888 | 98 | if(count==0) fhESDMean = hdata; |
99 | if(count==1) fhESDVertex = hdata; | |
0608f4dc | 100 | if(count>1){ |
101 | AliWarning("Unknowm ESD QA histograms"); | |
102 | return 0; | |
103 | } | |
c33b02bf | 104 | } |
c724dd64 | 105 | count++ ; |
5ed41460 | 106 | |
3685c21c | 107 | Double_t rv = 0.; |
108 | if(hdata->GetEntries()>0) rv = 1; | |
c724dd64 | 109 | // AliInfo(Form("%s -> %f", hdata->GetName(), rv)) ; |
3685c21c | 110 | test += rv ; |
5ed41460 | 111 | |
c724dd64 | 112 | } |
3685c21c | 113 | else{ |
114 | AliError("Data type cannot be processed") ; | |
115 | } | |
116 | ||
117 | } | |
5ed41460 | 118 | |
3685c21c | 119 | if (count != 0) { |
120 | if (test==0) { | |
121 | AliWarning("Histograms are there, but they are all empty: setting flag to kWARNING"); | |
122 | test = 0.5; //upper limit value to set kWARNING flag for a task | |
123 | } | |
124 | else { | |
c724dd64 | 125 | |
126 | if(index == 2){ | |
127 | if ( TMath::Abs(fhRecMean->GetMean() - fhOnlineMean->GetMean()) > 5) | |
128 | AliWarning(Form("rec mean %f -> online mean %f",fhRecMean->GetMean(), fhOnlineMean->GetMean())) ; | |
129 | Double_t meanLED, meanQTC; | |
130 | for (Int_t idet=0; idet<24; idet++) { | |
131 | meanLED = fhRecLEDAmp[idet]->GetMean(); | |
132 | meanQTC = fhRecQTC[idet]->GetMean(); | |
133 | if (TMath::Abs(meanLED-meanQTC)> 1.) | |
5ed41460 | 134 | AliWarning(Form("Amplitude measurements are different in channel %i : Amp LED %f -> Amp QTC %f",idet,meanLED, meanQTC)) ; |
c724dd64 | 135 | } |
136 | } | |
5ed41460 | 137 | |
138 | ||
139 | if (index == 0) { | |
140 | Int_t realNumber = Int_t(nent[0]); | |
141 | for (Int_t i=77; i<count; i++) | |
142 | { | |
143 | Double_t diff = TMath::Abs(nent[i]-realNumber); | |
144 | if (diff > 0.1*realNumber ) | |
145 | AliWarning(Form("Problem in Number of entried in hist %s is %f\n",hname[i].Data() , nent[i])) ; | |
146 | } | |
446d6ec4 | 147 | } |
c33b02bf | 148 | if (index == 3) { |
149 | Double_t rmsMeanTime = fhESDMean->GetRMS(); | |
150 | if (rmsMeanTime>3) | |
151 | AliWarning(Form("Mean time with bad resolution, RMS= %f",rmsMeanTime)) ; | |
152 | Double_t rmsVertex = fhESDVertex->GetRMS(); | |
153 | if (rmsVertex>3) | |
154 | AliWarning(Form("Vertex with bad resolution, RMS= %f",rmsVertex)) ; | |
155 | } | |
156 | ||
3685c21c | 157 | } |
5ed41460 | 158 | |
3685c21c | 159 | } |
5ed41460 | 160 | |
161 | ||
c724dd64 | 162 | } // if (list->GetEntries() != 0 |
5ed41460 | 163 | |
3685c21c | 164 | AliInfo(Form("Test Result = %f", test)) ; |
5ed41460 | 165 | |
3685c21c | 166 | return test ; |
167 | } | |
5ed41460 | 168 |