]>
Commit | Line | Data |
---|---|---|
04236e67 | 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 | // ------------------------------------------------------------- | |
8dc34e37 | 23 | // W. Ferrarese + P. Cerello Feb 2008 |
04236e67 | 24 | // INFN Torino |
25 | ||
26 | // --- ROOT system --- | |
04236e67 | 27 | #include <TTree.h> |
57acd2d2 | 28 | #include <TMath.h> |
04236e67 | 29 | // --- Standard library --- |
30 | ||
31 | // --- AliRoot header files --- | |
32 | #include "AliITSQADataMakerSim.h" | |
8dc34e37 | 33 | #include "AliITSQASPDDataMakerSim.h" |
34 | #include "AliITSQASDDDataMakerSim.h" | |
35 | #include "AliITSQASSDDataMakerSim.h" | |
04236e67 | 36 | #include "AliLog.h" |
4e25ac79 | 37 | #include "AliQAv1.h" |
04236e67 | 38 | #include "AliQAChecker.h" |
5dfa9b71 | 39 | #include "AliITSQAChecker.h" |
8dc34e37 | 40 | #include "AliRawReader.h" |
04236e67 | 41 | |
42 | ClassImp(AliITSQADataMakerSim) | |
43 | ||
44 | //____________________________________________________________________________ | |
8dc34e37 | 45 | AliITSQADataMakerSim::AliITSQADataMakerSim(Short_t subDet) : |
4e25ac79 | 46 | AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kITS), "ITS Quality Assurance Data Maker"), |
8dc34e37 | 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 | ||
80b9610c | 57 | // Initialization for each subdetector |
8dc34e37 | 58 | if(fSubDetector == 0 || fSubDetector == 1) { |
5379c4a3 | 59 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SPD DataMakerSim\n"); |
8dc34e37 | 60 | fSPDDataMaker = new AliITSQASPDDataMakerSim(this); |
61 | } | |
62 | if(fSubDetector == 0 || fSubDetector == 2) { | |
5379c4a3 | 63 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SDD DataMakerSim\n"); |
8dc34e37 | 64 | //printf("AliITSQADM::Create SDD DataMakerSim\n"); |
65 | fSDDDataMaker = new AliITSQASDDDataMakerSim(this); | |
66 | } | |
67 | if(fSubDetector == 0 || fSubDetector == 3) { | |
5379c4a3 | 68 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SSD DataMakerSim\n"); |
8dc34e37 | 69 | fSSDDataMaker = new AliITSQASSDDataMakerSim(this); |
70 | } | |
04236e67 | 71 | } |
72 | ||
73 | //____________________________________________________________________________ | |
8dc34e37 | 74 | AliITSQADataMakerSim::~AliITSQADataMakerSim(){ |
75 | // destructor | |
76 | if(fSPDDataMaker)delete fSPDDataMaker; | |
77 | if(fSDDDataMaker)delete fSDDDataMaker; | |
78 | if(fSSDDataMaker)delete fSSDDataMaker; | |
04236e67 | 79 | } |
80 | ||
81 | //____________________________________________________________________________ | |
82 | AliITSQADataMakerSim::AliITSQADataMakerSim(const AliITSQADataMakerSim& qadm) : | |
8dc34e37 | 83 | AliQADataMakerSim(), |
84 | fSubDetector(qadm.fSubDetector), | |
85 | fSPDDataMaker(NULL), | |
86 | fSDDDataMaker(NULL), | |
87 | fSSDDataMaker(NULL) | |
04236e67 | 88 | { |
89 | //copy ctor | |
90 | SetName((const char*)qadm.GetName()) ; | |
8dc34e37 | 91 | SetTitle((const char*)qadm.GetTitle()); |
04236e67 | 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 | //____________________________________________________________________________ | |
85f5e9c2 | 104 | void AliITSQADataMakerSim::StartOfDetectorCycle() |
04236e67 | 105 | { |
106 | //Detector specific actions at start of cycle | |
5379c4a3 | 107 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of ITS Cycle\n"); |
8dc34e37 | 108 | |
109 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->StartOfDetectorCycle(); | |
8dc34e37 | 110 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->StartOfDetectorCycle(); |
111 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->StartOfDetectorCycle(); | |
04236e67 | 112 | } |
113 | ||
114 | //____________________________________________________________________________ | |
4e25ac79 | 115 | void AliITSQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray** list) |
04236e67 | 116 | { |
80b9610c | 117 | |
118 | AliInfo(Form("End of Dedetctor Cycle called for %s\n",AliQAv1::GetTaskName(task).Data() )); | |
119 | ||
04236e67 | 120 | // launch the QA checking |
57acd2d2 | 121 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { |
80b9610c | 122 | if (! IsValidEventSpecie(specie, list) ){ |
6252ceeb | 123 | continue ; |
614c7e17 | 124 | } |
80b9610c | 125 | else{ |
126 | Int_t idnumber=list[specie]->GetUniqueID(); | |
127 | //printf("specie %s \t id number == %d\n",AliRecoParam::GetEventSpecieName(specie),idnumber); | |
128 | if(idnumber==0) | |
129 | { | |
130 | //AliInfo(Form("No check for %s\n",AliQAv1::GetTaskName(task).Data() )) | |
131 | continue; | |
132 | } //skip kDigitsR and not filled TobjArray specie | |
133 | else{ | |
134 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); | |
135 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list[specie]); | |
136 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list[specie]); | |
137 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list[specie]); | |
138 | ||
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 else event specie | |
159 | }//end for | |
04236e67 | 160 | } |
161 | ||
8dc34e37 | 162 | //____________________________________________________________________________ |
163 | void AliITSQADataMakerSim::InitDigits() | |
164 | { | |
80b9610c | 165 | |
166 | fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(60); | |
167 | // Initialization for Digits data | |
8dc34e37 | 168 | if(fSubDetector == 0 || fSubDetector == 1) { |
5379c4a3 | 169 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitDigits\n"); |
4a903927 | 170 | |
8dc34e37 | 171 | fSPDDataMaker->InitDigits(); |
172 | } | |
173 | if(fSubDetector == 0 || fSubDetector == 2) { | |
5379c4a3 | 174 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitDigits\n"); |
4a903927 | 175 | |
176 | fSDDDataMaker->SetOffset(AliQAv1::kDIGITS, fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
8dc34e37 | 177 | fSDDDataMaker->InitDigits(); |
178 | } | |
179 | if(fSubDetector == 0 || fSubDetector == 3) { | |
5379c4a3 | 180 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitDigits\n"); |
4a903927 | 181 | |
182 | fSSDDataMaker->SetOffset(AliQAv1::kDIGITS, fDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
8dc34e37 | 183 | fSSDDataMaker->InitDigits(); |
184 | } | |
185 | } | |
186 | ||
187 | //____________________________________________________________________________ | |
6252ceeb | 188 | void AliITSQADataMakerSim::MakeDigits() |
8dc34e37 | 189 | { |
eca4fa66 | 190 | // Fill QA for digits |
4a903927 | 191 | if(fSubDetector == 0 || fSubDetector == 1) |
192 | fSPDDataMaker->MakeDigits() ; | |
193 | ||
eca4fa66 | 194 | |
4a903927 | 195 | if(fSubDetector == 0 || fSubDetector == 2) |
196 | fSDDDataMaker->MakeDigits() ; | |
eca4fa66 | 197 | |
6252ceeb | 198 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(); |
8dc34e37 | 199 | } |
200 | ||
201 | //____________________________________________________________________________ | |
202 | void AliITSQADataMakerSim::MakeDigits(TTree * digits) | |
203 | { | |
eca4fa66 | 204 | // Fill QA for digits |
4a903927 | 205 | if(fSubDetector == 0 || fSubDetector == 1) |
206 | fSPDDataMaker->MakeDigits(digits) ; | |
207 | ||
208 | if(fSubDetector == 0 || fSubDetector == 2) | |
209 | fSDDDataMaker->MakeDigits(digits) ; | |
eca4fa66 | 210 | |
8dc34e37 | 211 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeDigits(digits); |
212 | } | |
213 | ||
214 | //____________________________________________________________________________ | |
215 | void AliITSQADataMakerSim::InitSDigits() | |
216 | { | |
80b9610c | 217 | fSDigitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(70); |
8dc34e37 | 218 | // Initialization for RECPOINTS |
219 | if(fSubDetector == 0 || fSubDetector == 1) { | |
5379c4a3 | 220 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitSDigits\n"); |
4a903927 | 221 | |
8dc34e37 | 222 | fSPDDataMaker->InitSDigits(); |
223 | } | |
4a903927 | 224 | if(fSubDetector == 0 || fSubDetector == 2){ |
5379c4a3 | 225 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitSDigits\n"); |
4a903927 | 226 | |
227 | fSDDDataMaker->SetOffset(AliQAv1::kSDIGITS, fSDigitsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
228 | fSDDDataMaker->InitSDigits(); | |
8dc34e37 | 229 | } |
230 | if(fSubDetector == 0 || fSubDetector == 3) { | |
5379c4a3 | 231 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitSDigits\n"); |
4a903927 | 232 | |
233 | fSSDDataMaker->SetOffset(AliQAv1::kSDIGITS, fSDigitsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
234 | fSSDDataMaker->InitSDigits(); | |
8dc34e37 | 235 | } |
236 | } | |
237 | ||
238 | //____________________________________________________________________________ | |
6252ceeb | 239 | void AliITSQADataMakerSim::MakeSDigits() |
8dc34e37 | 240 | { |
241 | // Fill QA for recpoints | |
4a903927 | 242 | if(fSubDetector == 0 || fSubDetector == 1) |
243 | fSPDDataMaker->MakeSDigits() ; | |
244 | ||
eca4fa66 | 245 | |
4a903927 | 246 | if(fSubDetector == 0 || fSubDetector == 2) |
247 | fSDDDataMaker->MakeSDigits() ; | |
248 | ||
eca4fa66 | 249 | |
6252ceeb | 250 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeSDigits(); |
8dc34e37 | 251 | } |
252 | ||
253 | //____________________________________________________________________________ | |
254 | void AliITSQADataMakerSim::MakeSDigits(TTree * sdigits) | |
255 | { | |
256 | // Fill QA for recpoints | |
eca4fa66 | 257 | if(fSubDetector == 0 || fSubDetector == 1){ |
4a903927 | 258 | fSPDDataMaker->MakeSDigits(sdigits) ; |
259 | } | |
eca4fa66 | 260 | |
261 | if(fSubDetector == 0 || fSubDetector == 2){ | |
4a903927 | 262 | fSDDDataMaker->MakeSDigits(sdigits) ; |
eca4fa66 | 263 | } |
264 | ||
8dc34e37 | 265 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeSDigits(sdigits); |
266 | } | |
267 | ||
268 | //____________________________________________________________________________ | |
269 | void AliITSQADataMakerSim::InitHits() | |
270 | { | |
80b9610c | 271 | fHitsQAList[AliRecoParam::AConvert(fEventSpecie)]->SetUniqueID(50); |
eca4fa66 | 272 | // Initialization for hits |
8dc34e37 | 273 | if(fSubDetector == 0 || fSubDetector == 1) { |
5379c4a3 | 274 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitHits\n"); |
8dc34e37 | 275 | fSPDDataMaker->InitHits(); |
276 | } | |
277 | if(fSubDetector == 0 || fSubDetector == 2) { | |
5379c4a3 | 278 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitHits\n"); |
4a903927 | 279 | |
280 | fSDDDataMaker->SetOffset(AliQAv1::kHITS, fHitsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
281 | fSDDDataMaker->InitHits(); | |
8dc34e37 | 282 | } |
283 | if(fSubDetector == 0 || fSubDetector == 3) { | |
5379c4a3 | 284 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitHits\n"); |
4a903927 | 285 | |
286 | fSSDDataMaker->SetOffset(AliQAv1::kHITS, fHitsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie)); | |
287 | fSSDDataMaker->InitHits(); | |
8dc34e37 | 288 | } |
289 | } | |
290 | ||
291 | //____________________________________________________________________________ | |
6252ceeb | 292 | void AliITSQADataMakerSim::MakeHits() |
8dc34e37 | 293 | { |
eca4fa66 | 294 | // Fill QA for hits |
295 | if(fSubDetector == 0 || fSubDetector == 1) { | |
4a903927 | 296 | fSPDDataMaker->MakeHits() ; |
297 | } | |
eca4fa66 | 298 | |
299 | if(fSubDetector == 0 || fSubDetector == 2) { | |
4a903927 | 300 | fSDDDataMaker->MakeHits() ; |
eca4fa66 | 301 | } |
302 | ||
6252ceeb | 303 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeHits(); |
8dc34e37 | 304 | } |
305 | ||
306 | //____________________________________________________________________________ | |
307 | void AliITSQADataMakerSim::MakeHits(TTree * hits) | |
308 | { | |
eca4fa66 | 309 | // Fill QA for hits |
310 | if(fSubDetector == 0 || fSubDetector == 1) { | |
4a903927 | 311 | fSPDDataMaker->MakeHits(hits) ; |
312 | } | |
eca4fa66 | 313 | if(fSubDetector == 0 || fSubDetector == 2) { |
4a903927 | 314 | fSDDDataMaker->MakeHits(hits) ; |
eca4fa66 | 315 | } |
316 | ||
8dc34e37 | 317 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeHits(hits); |
318 | } | |
614c7e17 | 319 | |
320 | //_________________________________________________________________ | |
4e25ac79 | 321 | Int_t AliITSQADataMakerSim::GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task) |
614c7e17 | 322 | { |
323 | switch(subdet) | |
324 | { | |
325 | ||
326 | Int_t offset; | |
327 | case 1: | |
328 | offset=fSPDDataMaker->GetOffset(task); | |
329 | return offset; | |
330 | break; | |
331 | case 2: | |
332 | offset=fSDDDataMaker->GetOffset(task); | |
333 | return offset; | |
334 | break; | |
335 | case 3: | |
336 | offset=fSSDDataMaker->GetOffset(task); | |
337 | return offset; | |
338 | break; | |
339 | default: | |
340 | AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n"); | |
341 | offset=0; | |
342 | return offset; | |
343 | break; | |
344 | } | |
345 | //return offset; | |
346 | } | |
80b9610c | 347 | |
348 | //_________________________________________________________________ | |
349 | Int_t AliITSQADataMakerSim::GetDetTaskHisto(Int_t subdet,AliQAv1::TASKINDEX_t task) | |
350 | { | |
351 | switch(subdet) | |
352 | { | |
353 | ||
354 | Int_t histo; | |
355 | case 1: | |
356 | histo=fSPDDataMaker->GetOffset(task); | |
357 | return histo; | |
358 | break; | |
359 | case 2: | |
360 | histo=fSDDDataMaker->GetOffset(task); | |
361 | return histo; | |
362 | break; | |
363 | case 3: | |
364 | histo=fSSDDataMaker->GetOffset(task); | |
365 | return histo; | |
366 | break; | |
367 | default: | |
368 | AliWarning("No specific subdetector (SPD, SDD, SSD) selected!! Offset set to zero \n"); | |
369 | histo=0; | |
370 | return histo; | |
371 | break; | |
372 | } | |
373 | //return offset; | |
374 | } |