]>
Commit | Line | Data |
---|---|---|
1 | /************************************************************************** | |
2 | * Copyright(c) 2007-2009, 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 | /* $Id$ */ | |
17 | ||
18 | // ************************************************************* | |
19 | // Checks the quality assurance | |
20 | // by comparing with reference data | |
21 | // contained in a DB | |
22 | // ------------------------------------------------------------- | |
23 | // W. Ferrarese + P. Cerello Feb 2008 | |
24 | // INFN Torino | |
25 | ||
26 | // --- ROOT system --- | |
27 | #include <TTree.h> | |
28 | #include <TMath.h> | |
29 | // --- Standard library --- | |
30 | ||
31 | // --- AliRoot header files --- | |
32 | #include "AliITSQADataMakerSim.h" | |
33 | #include "AliITSQASPDDataMakerSim.h" | |
34 | #include "AliITSQASDDDataMakerSim.h" | |
35 | #include "AliITSQASSDDataMakerSim.h" | |
36 | #include "AliLog.h" | |
37 | #include "AliQAv1.h" | |
38 | #include "AliQAChecker.h" | |
39 | #include "AliITSQAChecker.h" | |
40 | #include "AliRawReader.h" | |
41 | ||
42 | ClassImp(AliITSQADataMakerSim) | |
43 | ||
44 | //____________________________________________________________________________ | |
45 | AliITSQADataMakerSim::AliITSQADataMakerSim(Short_t subDet) : | |
46 | AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kITS), "ITS Quality Assurance Data Maker"), | |
47 | fSubDetector(subDet), | |
48 | fSPDDataMaker(NULL), | |
49 | fSDDDataMaker(NULL), | |
50 | fSSDDataMaker(NULL) | |
51 | { | |
52 | //ctor used to discriminate OnLine-Offline analysis | |
53 | if(fSubDetector < 0 || fSubDetector > 3) { | |
54 | AliError("Error: fSubDetector number out of range; return\n"); | |
55 | } | |
56 | ||
57 | // Initialization for each subdetector | |
58 | if(fSubDetector == 0 || fSubDetector == 1) { | |
59 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SPD DataMakerSim\n"); | |
60 | fSPDDataMaker = new AliITSQASPDDataMakerSim(this); | |
61 | } | |
62 | if(fSubDetector == 0 || fSubDetector == 2) { | |
63 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SDD DataMakerSim\n"); | |
64 | //printf("AliITSQADM::Create SDD DataMakerSim\n"); | |
65 | fSDDDataMaker = new AliITSQASDDDataMakerSim(this); | |
66 | } | |
67 | if(fSubDetector == 0 || fSubDetector == 3) { | |
68 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SSD DataMakerSim\n"); | |
69 | fSSDDataMaker = new AliITSQASSDDataMakerSim(this); | |
70 | } | |
71 | } | |
72 | ||
73 | //____________________________________________________________________________ | |
74 | AliITSQADataMakerSim::~AliITSQADataMakerSim(){ | |
75 | // destructor | |
76 | if(fSPDDataMaker)delete fSPDDataMaker; | |
77 | if(fSDDDataMaker)delete fSDDDataMaker; | |
78 | if(fSSDDataMaker)delete fSSDDataMaker; | |
79 | } | |
80 | ||
81 | //____________________________________________________________________________ | |
82 | AliITSQADataMakerSim::AliITSQADataMakerSim(const AliITSQADataMakerSim& qadm) : | |
83 | AliQADataMakerSim(), | |
84 | fSubDetector(qadm.fSubDetector), | |
85 | fSPDDataMaker(NULL), | |
86 | fSDDDataMaker(NULL), | |
87 | fSSDDataMaker(NULL) | |
88 | { | |
89 | //copy ctor | |
90 | SetName((const char*)qadm.GetName()) ; | |
91 | SetTitle((const char*)qadm.GetTitle()); | |
92 | } | |
93 | ||
94 | //__________________________________________________________________ | |
95 | AliITSQADataMakerSim& AliITSQADataMakerSim::operator = (const AliITSQADataMakerSim& qac ) | |
96 | { | |
97 | // Equal operator. | |
98 | this->~AliITSQADataMakerSim(); | |
99 | new(this) AliITSQADataMakerSim(qac); | |
100 | return *this; | |
101 | } | |
102 | ||
103 | //____________________________________________________________________________ | |
104 | void AliITSQADataMakerSim::StartOfDetectorCycle() | |
105 | { | |
106 | //Detector specific actions at start of cycle | |
107 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of ITS Cycle\n"); | |
108 | ResetEventTrigClasses(); // reset triggers list to select all histos | |
109 | ResetEvCountCycle(); | |
110 | // | |
111 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->StartOfDetectorCycle(); | |
112 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->StartOfDetectorCycle(); | |
113 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->StartOfDetectorCycle(); | |
114 | } | |
115 | ||
116 | //____________________________________________________________________________ | |
117 | void AliITSQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list) | |
118 | { | |
119 | // | |
120 | AliInfo(Form("End of Dedetctor Cycle called for %s\n",AliQAv1::GetTaskName(task).Data() )); | |
121 | ResetEventTrigClasses(); // reset triggers list to select all histos | |
122 | // | |
123 | // launch the QA checking | |
124 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { | |
125 | if (! IsValidEventSpecie(specie, list) ) continue; | |
126 | SetEventSpecie(AliRecoParam::ConvertIndex(specie)); | |
127 | // | |
128 | Int_t idnumber=list[specie]->GetUniqueID(); | |
129 | //printf("specie %s \t id number == %d\n",AliRecoParam::GetEventSpecieName(specie),idnumber); | |
130 | if(idnumber==0) { | |
131 | //AliInfo(Form("No check for %s\n",AliQAv1::GetTaskName(task).Data() )) | |
132 | continue; | |
133 | } //skip kDigitsR and not filled TobjArray specie | |
134 | else{ | |
135 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); | |
136 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list); //[specie]); | |
137 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list); //[specie]); | |
138 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list); //[specie]); | |
139 | // | |
140 | AliQAChecker *qac = AliQAChecker::Instance(); | |
141 | AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0); | |
142 | Int_t subdet=GetSubDet(); | |
143 | qacb->SetSubDet(subdet); | |
144 | ||
145 | if(subdet== 0 ){ | |
146 | qacb->SetTaskOffset(fSPDDataMaker->GetOffset(task,specie),fSDDDataMaker->GetOffset(task,specie),fSSDDataMaker->GetOffset(task,specie)); //Setting the offset for the QAChecker list | |
147 | qacb->SetHisto(fSPDDataMaker->GetTaskHisto(task), fSDDDataMaker->GetTaskHisto(task), fSSDDataMaker->GetTaskHisto(task)); | |
148 | } | |
149 | else | |
150 | if(subdet!=0){ | |
151 | Int_t offset=GetDetTaskOffset(subdet, task); | |
152 | qacb->SetDetTaskOffset(subdet,offset); | |
153 | Int_t histo=GetDetTaskHisto(subdet, task); | |
154 | qacb->SetDetHisto(subdet,histo); | |
155 | } | |
156 | qac->Run( AliQAv1::kITS , task, list); | |
157 | }//end else unique id | |
158 | }//end for | |
159 | } | |
160 | ||
161 | //____________________________________________________________________________ | |
162 | void AliITSQADataMakerSim::InitDigits() | |
163 | { | |
164 | ||
165 | // Initialization for Digits data | |
166 | fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(60); | |
167 | if(fSubDetector == 0 || fSubDetector == 1) { | |
168 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitDigits\n"); | |
169 | ||
170 | fSPDDataMaker->InitDigits(); | |
171 | } | |
172 | if(fSubDetector == 0 || fSubDetector == 2) { | |
173 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitDigits\n"); | |
174 | ||
175 | fSDDDataMaker->SetOffset(AliQAv1::kDIGITS, fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
176 | fSDDDataMaker->InitDigits(); | |
177 | } | |
178 | if(fSubDetector == 0 || fSubDetector == 3) { | |
179 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitDigits\n"); | |
180 | ||
181 | fSSDDataMaker->SetOffset(AliQAv1::kDIGITS, fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
182 | fSSDDataMaker->InitDigits(); | |
183 | } | |
184 | // | |
185 | ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line | |
186 | } | |
187 | ||
188 | //____________________________________________________________________________ | |
189 | void AliITSQADataMakerSim::MakeDigits() | |
190 | { | |
191 | // Fill QA for digits | |
192 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeDigits(); | |
193 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeDigits(); | |
194 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(); | |
195 | // | |
196 | IncEvCountCycleDigits(); | |
197 | IncEvCountTotalDigits(); | |
198 | // | |
199 | } | |
200 | ||
201 | //____________________________________________________________________________ | |
202 | void AliITSQADataMakerSim::MakeDigits(TTree * digits) | |
203 | { | |
204 | // Fill QA for digits | |
205 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeDigits(digits); | |
206 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeDigits(digits); | |
207 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(digits); | |
208 | // | |
209 | IncEvCountCycleDigits(); | |
210 | IncEvCountTotalDigits(); | |
211 | // | |
212 | } | |
213 | ||
214 | //____________________________________________________________________________ | |
215 | void AliITSQADataMakerSim::InitSDigits() | |
216 | { | |
217 | // Initialization for SDigits | |
218 | fSDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(70); | |
219 | if(fSubDetector == 0 || fSubDetector == 1) { | |
220 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitSDigits\n"); | |
221 | ||
222 | fSPDDataMaker->InitSDigits(); | |
223 | } | |
224 | if(fSubDetector == 0 || fSubDetector == 2){ | |
225 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitSDigits\n"); | |
226 | ||
227 | fSDDDataMaker->SetOffset(AliQAv1::kSDIGITS, fSDigitsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
228 | fSDDDataMaker->InitSDigits(); | |
229 | } | |
230 | if(fSubDetector == 0 || fSubDetector == 3) { | |
231 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitSDigits\n"); | |
232 | ||
233 | fSSDDataMaker->SetOffset(AliQAv1::kSDIGITS, fSDigitsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
234 | fSSDDataMaker->InitSDigits(); | |
235 | } | |
236 | // | |
237 | ClonePerTrigClass(AliQAv1::kSDIGITS); // this should be the last line | |
238 | } | |
239 | ||
240 | //____________________________________________________________________________ | |
241 | void AliITSQADataMakerSim::MakeSDigits() | |
242 | { | |
243 | // Fill QA for sdigits | |
244 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeSDigits(); | |
245 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeSDigits(); | |
246 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeSDigits(); | |
247 | // | |
248 | IncEvCountCycleSDigits(); | |
249 | IncEvCountTotalSDigits(); | |
250 | // | |
251 | } | |
252 | ||
253 | //____________________________________________________________________________ | |
254 | void AliITSQADataMakerSim::MakeSDigits(TTree * sdigits) | |
255 | { | |
256 | // Fill QA for recpoints | |
257 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeSDigits(sdigits); | |
258 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeSDigits(sdigits); | |
259 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeSDigits(sdigits); | |
260 | // | |
261 | IncEvCountCycleSDigits(); | |
262 | IncEvCountTotalSDigits(); | |
263 | // | |
264 | } | |
265 | ||
266 | //____________________________________________________________________________ | |
267 | void AliITSQADataMakerSim::InitHits() | |
268 | { | |
269 | // Initialization for hits | |
270 | fHitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(50); | |
271 | if(fSubDetector == 0 || fSubDetector == 1) { | |
272 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitHits\n"); | |
273 | fSPDDataMaker->InitHits(); | |
274 | } | |
275 | if(fSubDetector == 0 || fSubDetector == 2) { | |
276 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitHits\n"); | |
277 | ||
278 | fSDDDataMaker->SetOffset(AliQAv1::kHITS, fHitsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
279 | fSDDDataMaker->InitHits(); | |
280 | } | |
281 | if(fSubDetector == 0 || fSubDetector == 3) { | |
282 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitHits\n"); | |
283 | ||
284 | fSSDDataMaker->SetOffset(AliQAv1::kHITS, fHitsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
285 | fSSDDataMaker->InitHits(); | |
286 | } | |
287 | // | |
288 | ClonePerTrigClass(AliQAv1::kHITS); // this should be the last line | |
289 | } | |
290 | ||
291 | //____________________________________________________________________________ | |
292 | void AliITSQADataMakerSim::MakeHits() | |
293 | { | |
294 | // Fill QA for hits | |
295 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeHits(); | |
296 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeHits(); | |
297 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeHits(); | |
298 | // | |
299 | IncEvCountCycleHits(); | |
300 | IncEvCountTotalHits(); | |
301 | // | |
302 | } | |
303 | ||
304 | //____________________________________________________________________________ | |
305 | void AliITSQADataMakerSim::MakeHits(TTree * hits) | |
306 | { | |
307 | // Fill QA for hits | |
308 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeHits(hits); | |
309 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeHits(hits); | |
310 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeHits(hits); | |
311 | // | |
312 | IncEvCountCycleHits(); | |
313 | IncEvCountTotalHits(); | |
314 | // | |
315 | } | |
316 | ||
317 | //_________________________________________________________________ | |
318 | Int_t AliITSQADataMakerSim::GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task) | |
319 | { | |
320 | ||
321 | //return the offset for each subdetector | |
322 | switch(subdet) | |
323 | { | |
324 | Int_t offset; | |
325 | case 1: | |
326 | offset=fSPDDataMaker->GetOffset(task); | |
327 | return offset; | |
328 | break; | |
329 | case 2: | |
330 | offset=fSDDDataMaker->GetOffset(task); | |
331 | return offset; | |
332 | break; | |
333 | case 3: | |
334 | offset=fSSDDataMaker->GetOffset(task); | |
335 | return offset; | |
336 | break; | |
337 | default: | |
338 | AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n"); | |
339 | offset=0; | |
340 | return offset; | |
341 | break; | |
342 | } | |
343 | //return offset; | |
344 | } | |
345 | ||
346 | //_________________________________________________________________ | |
347 | Int_t AliITSQADataMakerSim::GetDetTaskHisto(Int_t subdet,AliQAv1::TASKINDEX_t task) | |
348 | { | |
349 | //return of the number of histograms for each task and for each sub detector | |
350 | switch(subdet) | |
351 | { | |
352 | ||
353 | Int_t histo; | |
354 | case 1: | |
355 | histo=fSPDDataMaker->GetOffset(task); | |
356 | return histo; | |
357 | break; | |
358 | case 2: | |
359 | histo=fSDDDataMaker->GetOffset(task); | |
360 | return histo; | |
361 | break; | |
362 | case 3: | |
363 | histo=fSSDDataMaker->GetOffset(task); | |
364 | return histo; | |
365 | break; | |
366 | default: | |
367 | AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n"); | |
368 | histo=0; | |
369 | return histo; | |
370 | break; | |
371 | } | |
372 | //return offset; | |
373 | } |