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