]>
Commit | Line | Data |
---|---|---|
421ab0fb | 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 | /* $Id: */ | |
17 | ||
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
20 | // class for running the Quality Assurance Checker | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
4edbc5bc | 24 | #include "AliCDBEntry.h" |
b03591ab | 25 | #include "AliQAManager.h" |
96d67a8d | 26 | #include "AliCDBStorage.h" |
1aaf4118 | 27 | #include "AliRunInfo.h" |
421ab0fb | 28 | #include "AliLog.h" |
29 | #include "AliModule.h" | |
4e25ac79 | 30 | #include "AliQAv1.h" |
2e42b4d4 | 31 | #include "AliQAChecker.h" |
32 | #include "AliQACheckerBase.h" | |
a2b64fbd | 33 | #include "AliCorrQAChecker.h" |
401b84d6 | 34 | #include "AliGlobalQAChecker.h" |
44e45fac | 35 | #include "AliGRPObject.h" |
421ab0fb | 36 | |
a5fa6165 | 37 | #include <TKey.h> |
421ab0fb | 38 | #include <TObjArray.h> |
cbae8032 | 39 | #include <TObjString.h> |
a5fa6165 | 40 | #include <TPluginManager.h> |
41 | #include <TROOT.h> | |
421ab0fb | 42 | #include <TStopwatch.h> |
43 | #include <TString.h> | |
a5fa6165 | 44 | #include <TSystem.h> |
a4976ef3 | 45 | #include <TList.h> |
a2b64fbd | 46 | #include <TNtupleD.h> |
421ab0fb | 47 | |
2e42b4d4 | 48 | ClassImp(AliQAChecker) |
49 | AliQAChecker * AliQAChecker::fgQAChecker = 0x0 ; | |
421ab0fb | 50 | |
51 | //_____________________________________________________________________________ | |
2e42b4d4 | 52 | AliQAChecker::AliQAChecker(const char* name, const char* title) : |
421ab0fb | 53 | TNamed(name, title), |
a5fa6165 | 54 | fDataFile(0x0), |
7e88424f | 55 | fRunInfo(0x0), |
56 | fRunInfoOwner(kFALSE), | |
4edbc5bc | 57 | fRefFile(0x0), |
57acd2d2 | 58 | fFoundDetectors("."), |
634696f5 | 59 | fEventSpecie(AliRecoParam::kDefault), |
60 | fRun(0) | |
421ab0fb | 61 | { |
a5fa6165 | 62 | // ctor: initialise checkers and open the data file |
4e25ac79 | 63 | for (Int_t det = 0 ; det < AliQAv1::kNDET ; det++) |
a5fa6165 | 64 | fCheckers[det] = NULL ; |
421ab0fb | 65 | } |
66 | ||
67 | //_____________________________________________________________________________ | |
2e42b4d4 | 68 | AliQAChecker::AliQAChecker(const AliQAChecker& qac) : |
421ab0fb | 69 | TNamed(qac), |
a5fa6165 | 70 | fDataFile(qac.fDataFile), |
7e88424f | 71 | fRunInfo(qac.fRunInfo), |
72 | fRunInfoOwner(kFALSE), | |
4edbc5bc | 73 | fRefFile(qac.fRefFile), |
57acd2d2 | 74 | fFoundDetectors(qac.fFoundDetectors), |
634696f5 | 75 | fEventSpecie(qac.fEventSpecie), |
76 | fRun(qac.fRun) | |
421ab0fb | 77 | { |
a5fa6165 | 78 | // copy constructor |
79 | ||
4e25ac79 | 80 | for (Int_t det = 0 ; det < AliQAv1::kNDET ; det++) |
a5fa6165 | 81 | fCheckers[det] = NULL ; |
421ab0fb | 82 | } |
83 | ||
84 | //_____________________________________________________________________________ | |
2e42b4d4 | 85 | AliQAChecker& AliQAChecker::operator = (const AliQAChecker& qac) |
421ab0fb | 86 | { |
87 | // assignment operator | |
88 | ||
2e42b4d4 | 89 | this->~AliQAChecker(); |
90 | new(this) AliQAChecker(qac); | |
421ab0fb | 91 | return *this; |
92 | } | |
93 | ||
94 | //_____________________________________________________________________________ | |
2e42b4d4 | 95 | AliQAChecker::~AliQAChecker() |
421ab0fb | 96 | { |
97 | // clean up | |
7e88424f | 98 | if (fRunInfo) |
99 | delete fRunInfo ; | |
a4976ef3 | 100 | delete [] fCheckers ; |
4e25ac79 | 101 | AliQAv1::Close() ; |
421ab0fb | 102 | } |
103 | ||
104 | //_____________________________________________________________________________ | |
2e42b4d4 | 105 | AliQACheckerBase * AliQAChecker::GetDetQAChecker(Int_t det) |
421ab0fb | 106 | { |
7ce961eb | 107 | // Gets the Quality Assurance checker for the detector specified by its name |
108 | ||
109 | if (fCheckers[det]) | |
a5fa6165 | 110 | return fCheckers[det]; |
111 | ||
401b84d6 | 112 | AliQACheckerBase * qac = NULL ; |
a5fa6165 | 113 | |
4e25ac79 | 114 | TString detName(AliQAv1::GetDetName(det)) ; |
401b84d6 | 115 | |
4e25ac79 | 116 | if (det == AliQAv1::kGLOBAL) { |
401b84d6 | 117 | qac = new AliGlobalQAChecker() ; |
4e25ac79 | 118 | } else if (det == AliQAv1::kCORR) { |
a2b64fbd | 119 | qac = new AliCorrQAChecker() ; |
401b84d6 | 120 | } else { |
634696f5 | 121 | AliDebugClass(AliQAv1::GetQADebugLevel(), Form("Retrieving QA checker for %s", detName.Data())) ; |
401b84d6 | 122 | TPluginManager* pluginManager = gROOT->GetPluginManager() ; |
123 | TString qacName = "Ali" + detName + "QAChecker" ; | |
124 | ||
125 | // first check if a plugin is defined for the quality assurance checker | |
126 | TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQAChecker", detName.Data()); | |
127 | // if not, add a plugin for it | |
128 | if (!pluginHandler) { | |
5379c4a3 | 129 | //AliDebug(AliQAv1::GetQADebugLevel(), Form("defining plugin for %s", qacName.Data())); |
401b84d6 | 130 | TString libs = gSystem->GetLibraries(); |
7ce961eb | 131 | |
401b84d6 | 132 | if (libs.Contains("lib" + detName + "base.so") || (gSystem->Load("lib" + detName + "base.so") >= 0)) |
133 | pluginManager->AddHandler("AliQAChecker", detName, qacName, detName + "qac", qacName + "()"); | |
134 | else | |
135 | pluginManager->AddHandler("AliQAChecker", detName, qacName, detName, qacName + "()"); | |
a5fa6165 | 136 | |
401b84d6 | 137 | pluginHandler = pluginManager->FindHandler("AliQAChecker", detName); |
a5fa6165 | 138 | |
401b84d6 | 139 | if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) |
140 | qac = (AliQACheckerBase *) pluginHandler->ExecPlugin(0); | |
a5fa6165 | 141 | |
401b84d6 | 142 | } |
7ce961eb | 143 | } |
401b84d6 | 144 | if (qac) |
145 | fCheckers[det] = qac ; | |
146 | ||
147 | return qac ; | |
a5fa6165 | 148 | } |
cbae8032 | 149 | |
a5fa6165 | 150 | //_____________________________________________________________________________ |
57acd2d2 | 151 | void AliQAChecker::GetRefSubDir(const char * det, const char * task, TDirectory *& dirFile, TObjArray **& dirOCDB) |
a5fa6165 | 152 | { |
153 | // Opens and returns the file with the reference data | |
cbae8032 | 154 | dirFile = NULL ; |
4e25ac79 | 155 | TString refStorage(AliQAv1::GetQARefStorage()) ; |
156 | // if (refStorage.Contains(AliQAv1::GetLabLocalFile())) { | |
157 | // refStorage.ReplaceAll(AliQAv1::GetLabLocalFile(), "") ; | |
158 | // refStorage += AliQAv1::GetQARefFileName() ; | |
cf13d879 | 159 | // if ( fRefFile ) |
160 | // if ( fRefFile->IsOpen() ) | |
161 | // fRefFile->Close() ; | |
162 | // fRefFile = TFile::Open(refStorage.Data()) ; | |
163 | // if (!fRefFile) { | |
164 | // AliError(Form("Cannot find reference file %s", refStorage.Data())) ; | |
165 | // dirFile = NULL ; | |
166 | // } | |
167 | // dirFile = fRefFile->GetDirectory(det) ; | |
168 | // if (!dirFile) { | |
169 | // AliWarning(Form("Directory %s not found in %d", det, refStorage.Data())) ; | |
170 | // } else { | |
171 | // dirFile = dirFile->GetDirectory(task) ; | |
172 | // if (!dirFile) | |
173 | // AliWarning(Form("Directory %s/%s not found in %s", det, task, refStorage.Data())) ; | |
174 | // } | |
175 | // } else | |
4e25ac79 | 176 | if (!refStorage.Contains(AliQAv1::GetLabLocalOCDB()) && !refStorage.Contains(AliQAv1::GetLabAliEnOCDB())) { |
cf13d879 | 177 | AliError(Form("%s is not a valid location for reference data", refStorage.Data())) ; |
178 | return ; | |
179 | } else { | |
634696f5 | 180 | AliQAManager* manQA = AliQAManager::QAManager(AliQAv1::GetTaskIndex(task)) ; |
958ed851 | 181 | dirOCDB = new TObjArray*[AliRecoParam::kNSpecies] ; |
57acd2d2 | 182 | for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { |
958ed851 | 183 | dirOCDB[specie] = NULL ; |
4e25ac79 | 184 | if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) |
57acd2d2 | 185 | continue ; |
4e25ac79 | 186 | //if ( strcmp(AliQAv1::GetRefDataDirName(), "") == 0 ) { // the name of the last level of the directory is not set (EventSpecie) |
57acd2d2 | 187 | // Get it from RunInfo |
188 | //if (!fRunInfo) // not yet set, get the info from GRP | |
189 | // LoadRunInfoFromGRP() ; | |
4e25ac79 | 190 | AliQAv1::SetQARefDataDirName(specie) ; |
57acd2d2 | 191 | //} |
b03591ab | 192 | if ( ! manQA->GetLock() ) { |
4e25ac79 | 193 | manQA->SetDefaultStorage(AliQAv1::GetQARefStorage()) ; |
194 | manQA->SetSpecificStorage("*", AliQAv1::GetQARefStorage()) ; | |
b03591ab | 195 | manQA->SetRun(AliCDBManager::Instance()->GetRun()) ; |
196 | manQA->SetLock() ; | |
57acd2d2 | 197 | } |
4e25ac79 | 198 | char * detOCDBDir = Form("%s/%s/%s", det, AliQAv1::GetRefOCDBDirName(), AliQAv1::GetRefDataDirName()) ; |
b03591ab | 199 | AliCDBEntry * entry = manQA->Get(detOCDBDir, manQA->GetRun()) ; |
57acd2d2 | 200 | if (entry) { |
eca4fa66 | 201 | TList * listDetQAD =static_cast<TList *>(entry->GetObject()) ; |
202 | if ( strcmp(listDetQAD->ClassName(), "TList") != 0 ) { | |
203 | AliError(Form("Expected a Tlist and found a %s for detector %s", listDetQAD->ClassName(), det)) ; | |
204 | continue ; | |
205 | } | |
57acd2d2 | 206 | TIter next(listDetQAD) ; |
207 | TObjArray * ar ; | |
958ed851 | 208 | while ( (ar = (TObjArray*)next()) ) |
57acd2d2 | 209 | if ( listDetQAD ) |
958ed851 | 210 | dirOCDB[specie] = static_cast<TObjArray *>(listDetQAD->FindObject(Form("%s/%s", task, AliRecoParam::GetEventSpecieName(specie)))) ; |
57acd2d2 | 211 | } |
cbae8032 | 212 | } |
213 | } | |
421ab0fb | 214 | } |
215 | ||
a4976ef3 | 216 | //_____________________________________________________________________________ |
2e42b4d4 | 217 | AliQAChecker * AliQAChecker::Instance() |
a4976ef3 | 218 | { |
219 | // returns unique instance of the checker | |
220 | if ( ! fgQAChecker ) | |
2e42b4d4 | 221 | fgQAChecker = new AliQAChecker() ; |
a4976ef3 | 222 | return fgQAChecker ; |
223 | } | |
224 | ||
cbae8032 | 225 | //_____________________________________________________________________________ |
7e88424f | 226 | void AliQAChecker::LoadRunInfoFromGRP() |
cbae8032 | 227 | { |
228 | AliCDBManager* man = AliCDBManager::Instance() ; | |
4e25ac79 | 229 | AliCDBEntry* entry = man->Get(AliQAv1::GetGRPPath().Data()); |
44e45fac | 230 | AliGRPObject* grpObject = 0x0; |
231 | if (entry) { | |
232 | ||
eca4fa66 | 233 | TMap* m = static_cast<TMap*>(entry->GetObject()); // old GRP entry |
44e45fac | 234 | |
235 | if (m) { | |
5379c4a3 | 236 | AliDebug(AliQAv1::GetQADebugLevel(), "It is a map"); |
44e45fac | 237 | //m->Print(); |
238 | grpObject = new AliGRPObject(); | |
239 | grpObject->ReadValuesFromMap(m); | |
240 | } | |
241 | ||
242 | else { | |
5379c4a3 | 243 | AliDebug(AliQAv1::GetQADebugLevel(), "It is a new GRP object"); |
eca4fa66 | 244 | grpObject = static_cast<AliGRPObject*>(entry->GetObject()); // new GRP entry |
44e45fac | 245 | } |
246 | ||
247 | entry->SetOwner(0); | |
248 | AliCDBManager::Instance()->UnloadFromCache("GRP/GRP/Data"); | |
249 | } | |
250 | ||
251 | if (!grpObject) { | |
252 | AliFatal("No GRP entry found in OCDB!"); | |
cbae8032 | 253 | } |
44e45fac | 254 | |
255 | TString lhcState = grpObject->GetLHCState(); | |
256 | if (lhcState==AliGRPObject::GetInvalidString()) { | |
257 | AliError("GRP/GRP/Data entry: missing value for the LHC state ! Using UNKNOWN"); | |
258 | lhcState = "UNKNOWN"; | |
259 | } | |
260 | ||
261 | TString beamType = grpObject->GetBeamType(); | |
262 | if (beamType==AliGRPObject::GetInvalidString()) { | |
263 | AliError("GRP/GRP/Data entry: missing value for the beam type ! Using UNKNOWN"); | |
264 | beamType = "UNKNOWN"; | |
cbae8032 | 265 | } |
44e45fac | 266 | |
267 | Float_t beamEnergy = grpObject->GetBeamEnergy(); | |
268 | if (beamEnergy==AliGRPObject::GetInvalidFloat()) { | |
269 | AliError("GRP/GRP/Data entry: missing value for the beam energy ! Using 0"); | |
270 | beamEnergy = 0; | |
cbae8032 | 271 | } |
44e45fac | 272 | |
273 | TString runType = grpObject->GetRunType(); | |
274 | if (runType==AliGRPObject::GetInvalidString()) { | |
275 | AliError("GRP/GRP/Data entry: missing value for the run type ! Using UNKNOWN"); | |
276 | runType = "UNKNOWN"; | |
7e88424f | 277 | } |
44e45fac | 278 | |
279 | Int_t activeDetectors = grpObject->GetDetectorMask(); | |
280 | if (activeDetectors==AliGRPObject::GetInvalidInt()) { | |
281 | AliError("GRP/GRP/Data entry: missing value for the detector mask ! Using 1074790399"); | |
282 | activeDetectors = 1074790399; | |
cbae8032 | 283 | } |
44e45fac | 284 | |
285 | fRunInfo = new AliRunInfo(lhcState, beamType, beamEnergy, runType, activeDetectors); | |
286 | ||
7e88424f | 287 | fRunInfoOwner = kTRUE ; |
57acd2d2 | 288 | |
289 | // set the event specie | |
290 | fEventSpecie = AliRecoParam::kDefault ; | |
291 | if (strcmp(runType,"PHYSICS")) { | |
292 | // Not a physics run, the event specie is set to kCalib | |
293 | fEventSpecie = AliRecoParam::kCalib ; | |
294 | return; | |
295 | } | |
296 | if (strcmp(lhcState,"STABLE_BEAMS") == 0) { | |
297 | // Heavy ion run (any beam tha is not pp, the event specie is set to kHighMult | |
298 | fEventSpecie = AliRecoParam::kHighMult ; | |
299 | if ((strcmp(beamType,"p-p") == 0) || | |
300 | (strcmp(beamType,"p-") == 0) || | |
301 | (strcmp(beamType,"-p") == 0) || | |
302 | (strcmp(beamType,"P-P") == 0) || | |
303 | (strcmp(beamType,"P-") == 0) || | |
304 | (strcmp(beamType,"-P") == 0)) { | |
305 | // Proton run, the event specie is set to kLowMult | |
306 | fEventSpecie = AliRecoParam::kLowMult ; | |
307 | } | |
308 | else if (strcmp(beamType,"-") == 0) { | |
309 | // No beams, we assume cosmic data | |
310 | fEventSpecie = AliRecoParam::kCosmic ; | |
311 | } | |
312 | else if (strcmp(beamType,"UNKNOWN") == 0) { | |
313 | // No LHC beam information is available, we use the default event specie | |
314 | fEventSpecie = AliRecoParam::kDefault ; | |
315 | } | |
316 | } | |
cbae8032 | 317 | } |
318 | ||
421ab0fb | 319 | //_____________________________________________________________________________ |
808b7099 | 320 | Bool_t AliQAChecker::Run(const char * fileName) |
421ab0fb | 321 | { |
44ed7a66 | 322 | // run the Quality Assurance Checker for all tasks Hits, SDigits, Digits, DigitsR, RecPoints, TrackSegments, RecParticles and ESDs |
57acd2d2 | 323 | // starting from data in file |
421ab0fb | 324 | TStopwatch stopwatch; |
325 | stopwatch.Start(); | |
326 | ||
a5fa6165 | 327 | //search for all detectors QA directories |
4e25ac79 | 328 | TList * detKeyList = AliQAv1::GetQADataFile(fileName)->GetListOfKeys() ; |
a5fa6165 | 329 | TIter nextd(detKeyList) ; |
330 | TKey * detKey ; | |
eca4fa66 | 331 | while ( (detKey = static_cast<TKey *>(nextd()) ) ) { |
5379c4a3 | 332 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Found %s", detKey->GetName())) ; |
a5fa6165 | 333 | //Check which detector |
334 | TString detName ; | |
335 | TString detNameQA(detKey->GetName()) ; | |
336 | Int_t det ; | |
4e25ac79 | 337 | for ( det = 0; det < AliQAv1::kNDET ; det++) { |
338 | detName = AliQAv1::GetDetName(det) ; | |
a5fa6165 | 339 | if (detNameQA.Contains(detName)) { |
57acd2d2 | 340 | fFoundDetectors+=detName ; |
341 | fFoundDetectors+="." ; | |
342 | break ; | |
a5fa6165 | 343 | } |
344 | } | |
4e25ac79 | 345 | TDirectory * detDir = AliQAv1::GetQADataFile(fileName)->GetDirectory(detKey->GetName()) ; |
a5fa6165 | 346 | TList * taskKeyList = detDir->GetListOfKeys() ; |
347 | TIter nextt(taskKeyList) ; | |
348 | TKey * taskKey ; | |
349 | // now search for the tasks dir | |
350 | while ( (taskKey = static_cast<TKey *>(nextt()) ) ) { | |
351 | TString taskName( taskKey->GetName() ) ; | |
5379c4a3 | 352 | AliDebug(AliQAv1::GetQADebugLevel(), Form("Found %s", taskName.Data())) ; |
a5fa6165 | 353 | TDirectory * taskDir = detDir->GetDirectory(taskName.Data()) ; |
354 | taskDir->cd() ; | |
2e42b4d4 | 355 | AliQACheckerBase * qac = GetDetQAChecker(det) ; |
a5fa6165 | 356 | if (qac) |
5379c4a3 | 357 | AliDebug(AliQAv1::GetQADebugLevel(), Form("QA checker found for %s", detName.Data())) ; |
a5fa6165 | 358 | if (!qac) |
57acd2d2 | 359 | AliFatal(Form("QA checker not found for %s", detName.Data())) ; |
4e25ac79 | 360 | AliQAv1::ALITASK_t index = AliQAv1::kNULLTASK ; |
361 | if ( taskName == AliQAv1::GetTaskName(AliQAv1::kHITS) ) | |
362 | index = AliQAv1::kSIM ; | |
363 | if ( taskName == AliQAv1::GetTaskName(AliQAv1::kSDIGITS) ) | |
364 | index = AliQAv1::kSIM ; | |
365 | if ( taskName == AliQAv1::GetTaskName(AliQAv1::kDIGITS) ) | |
366 | index = AliQAv1::kSIM ; | |
44ed7a66 | 367 | if ( taskName == AliQAv1::GetTaskName(AliQAv1::kDIGITSR) ) |
368 | index = AliQAv1::kREC ; | |
4e25ac79 | 369 | if ( taskName == AliQAv1::GetTaskName(AliQAv1::kRECPOINTS) ) |
370 | index = AliQAv1::kREC ; | |
371 | if ( taskName == AliQAv1::GetTaskName(AliQAv1::kTRACKSEGMENTS) ) | |
372 | index = AliQAv1::kREC ; | |
373 | if ( taskName == AliQAv1::GetTaskName(AliQAv1::kRECPARTICLES) ) | |
374 | index = AliQAv1::kREC ; | |
375 | if ( taskName == AliQAv1::GetTaskName(AliQAv1::kESDS) ) | |
376 | index = AliQAv1::kESD ; | |
377 | qac->Init(AliQAv1::DETECTORINDEX_t(det)) ; | |
57acd2d2 | 378 | |
379 | TDirectory * refDir = NULL ; | |
380 | TObjArray ** refOCDBDir = NULL ; | |
381 | GetRefSubDir(detNameQA.Data(), taskName.Data(), refDir, refOCDBDir) ; | |
4edbc5bc | 382 | qac->SetRefandData(refDir, refOCDBDir, taskDir) ; |
383 | qac->Run(index) ; | |
57acd2d2 | 384 | } |
4edbc5bc | 385 | } |
a5fa6165 | 386 | AliInfo("QA performed for following detectors:") ; |
4e25ac79 | 387 | for ( Int_t det = 0; det < AliQAv1::kNDET; det++) { |
388 | if (fFoundDetectors.Contains(AliQAv1::GetDetName(det))) { | |
5e232cd6 | 389 | AliInfoClass(Form("%s, ",AliQAv1::GetDetName(det))) ; |
4e25ac79 | 390 | fFoundDetectors.ReplaceAll(AliQAv1::GetDetName(det), "") ; |
a5fa6165 | 391 | } |
421ab0fb | 392 | } |
a5fa6165 | 393 | printf("\n") ; |
57acd2d2 | 394 | return kTRUE ; |
421ab0fb | 395 | } |
396 | ||
a4976ef3 | 397 | //_____________________________________________________________________________ |
4e25ac79 | 398 | Bool_t AliQAChecker::Run(AliQAv1::DETECTORINDEX_t det, AliQAv1::TASKINDEX_t task, TObjArray ** list) |
a4976ef3 | 399 | { |
d6372ce8 | 400 | // run the Quality Assurance Checker for detector det, for task task starting from data in list |
a4976ef3 | 401 | |
d6372ce8 | 402 | AliQACheckerBase * qac = GetDetQAChecker(det) ; |
403 | if (qac) | |
5379c4a3 | 404 | AliDebug(AliQAv1::GetQADebugLevel(), Form("QA checker found for %s", AliQAv1::GetDetName(det).Data())) ; |
d6372ce8 | 405 | if (!qac) |
4e25ac79 | 406 | AliError(Form("QA checker not found for %s", AliQAv1::GetDetName(det).Data())) ; |
a4976ef3 | 407 | |
4e25ac79 | 408 | AliQAv1::ALITASK_t index = AliQAv1::kNULLTASK ; |
409 | if ( task == AliQAv1::kRAWS ) | |
410 | index = AliQAv1::kRAW ; | |
411 | else if ( task == AliQAv1::kHITS ) | |
412 | index = AliQAv1::kSIM ; | |
413 | else if ( task == AliQAv1::kSDIGITS ) | |
414 | index = AliQAv1::kSIM ; | |
415 | else if ( task == AliQAv1::kDIGITS ) | |
416 | index = AliQAv1::kSIM ; | |
44ed7a66 | 417 | else if ( task == AliQAv1::kDIGITSR ) |
418 | index = AliQAv1::kREC ; | |
4e25ac79 | 419 | else if ( task == AliQAv1::kRECPOINTS ) |
420 | index = AliQAv1::kREC ; | |
421 | else if ( task == AliQAv1::kTRACKSEGMENTS ) | |
422 | index = AliQAv1::kREC ; | |
423 | else if ( task == AliQAv1::kRECPARTICLES ) | |
424 | index = AliQAv1::kREC ; | |
425 | else if ( task == AliQAv1::kESDS ) | |
426 | index = AliQAv1::kESD ; | |
4edbc5bc | 427 | |
57acd2d2 | 428 | TDirectory * refDir = NULL ; |
429 | TObjArray ** refOCDBDir = NULL ; | |
430 | qac->Init(det) ; | |
4e25ac79 | 431 | GetRefSubDir(AliQAv1::GetDetName(det), AliQAv1::GetTaskName(task), refDir, refOCDBDir) ; |
57acd2d2 | 432 | qac->SetRefandData(refDir, refOCDBDir) ; |
433 | qac->Run(index, list) ; | |
634696f5 | 434 | |
435 | // make the image | |
436 | qac->MakeImage(list, task, AliQAv1::Mode(task)) ; | |
437 | ||
d6372ce8 | 438 | return kTRUE ; |
31316597 | 439 | } |
57acd2d2 | 440 | |
441 | //_____________________________________________________________________________ | |
4e25ac79 | 442 | Bool_t AliQAChecker::Run(AliQAv1::DETECTORINDEX_t det, AliQAv1::TASKINDEX_t task, TNtupleD ** list) |
57acd2d2 | 443 | { |
444 | // run the Quality Assurance Checker for detector det, for task task starting from data in list | |
445 | ||
446 | AliQACheckerBase * qac = GetDetQAChecker(det) ; | |
447 | if (qac) | |
5379c4a3 | 448 | AliDebug(AliQAv1::GetQADebugLevel(), Form("QA checker found for %s", AliQAv1::GetDetName(det).Data())) ; |
57acd2d2 | 449 | if (!qac) |
4e25ac79 | 450 | AliError(Form("QA checker not found for %s", AliQAv1::GetDetName(det).Data())) ; |
57acd2d2 | 451 | |
4e25ac79 | 452 | AliQAv1::ALITASK_t index = AliQAv1::kNULLTASK ; |
453 | if ( task == AliQAv1::kRAWS ) | |
454 | index = AliQAv1::kRAW ; | |
455 | else if ( task == AliQAv1::kHITS ) | |
456 | index = AliQAv1::kSIM ; | |
457 | else if ( task == AliQAv1::kSDIGITS ) | |
458 | index = AliQAv1::kSIM ; | |
459 | else if ( task == AliQAv1::kDIGITS ) | |
460 | index = AliQAv1::kSIM ; | |
44ed7a66 | 461 | else if ( task == AliQAv1::kDIGITSR ) |
462 | index = AliQAv1::kREC ; | |
4e25ac79 | 463 | else if ( task == AliQAv1::kRECPOINTS ) |
464 | index = AliQAv1::kREC ; | |
465 | else if ( task == AliQAv1::kTRACKSEGMENTS ) | |
466 | index = AliQAv1::kREC ; | |
467 | else if ( task == AliQAv1::kRECPARTICLES ) | |
468 | index = AliQAv1::kREC ; | |
469 | else if ( task == AliQAv1::kESDS ) | |
470 | index = AliQAv1::kESD ; | |
57acd2d2 | 471 | |
472 | TDirectory * refDir = NULL ; | |
473 | TObjArray ** refOCDBDir = NULL ; | |
474 | qac->Init(det) ; | |
4e25ac79 | 475 | GetRefSubDir(AliQAv1::GetDetName(det), AliQAv1::GetTaskName(task), refDir, refOCDBDir) ; |
57acd2d2 | 476 | qac->SetRefandData(refDir, refOCDBDir) ; |
477 | qac->Run(index, list) ; | |
634696f5 | 478 | |
57acd2d2 | 479 | return kTRUE ; |
480 | } |