]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliQAManager.cxx
Added AddTrackParams() method for convenience + some comments
[u/mrichter/AliRoot.git] / STEER / AliQAManager.cxx
CommitLineData
2e331c8b 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: AliQAManager.cxx 30894 2009-02-05 13:46:48Z schutz $ */
17///////////////////////////////////////////////////////////////////////////////
18// //
19// class for running the QA makers //
20// //
21// AliQAManager qas; //
22// qas.Run(AliQA::kRAWS, rawROOTFileName); //
23// qas.Run(AliQA::kHITS); //
24// qas.Run(AliQA::kSDIGITS); //
25// qas.Run(AliQA::kDIGITS); //
26// qas.Run(AliQA::kRECPOINTS); //
27// qas.Run(AliQA::kESDS); //
28// //
29///////////////////////////////////////////////////////////////////////////////
30
31#include <TKey.h>
32#include <TFile.h>
33#include <TFileMerger.h>
149a2367 34#include <TGrid.h>
35#include <TGridCollection.h>
36#include <TGridResult.h>
2e331c8b 37#include <TPluginManager.h>
38#include <TROOT.h>
39#include <TString.h>
40#include <TSystem.h>
41
42#include "AliCDBManager.h"
43#include "AliCDBEntry.h"
44#include "AliCDBId.h"
45#include "AliCDBMetaData.h"
46#include "AliCodeTimer.h"
47#include "AliCorrQADataMakerRec.h"
48#include "AliDetectorRecoParam.h"
49#include "AliESDEvent.h"
50#include "AliGeomManager.h"
51#include "AliGlobalQADataMaker.h"
52#include "AliHeader.h"
53#include "AliLog.h"
54#include "AliModule.h"
55#include "AliQA.h"
56#include "AliQADataMakerRec.h"
57#include "AliQADataMakerSim.h"
58#include "AliQAManager.h"
59#include "AliRawReaderDate.h"
60#include "AliRawReaderFile.h"
61#include "AliRawReaderRoot.h"
62#include "AliRun.h"
63#include "AliRunLoader.h"
64#include "AliRunTag.h"
65
66ClassImp(AliQAManager)
67AliQAManager* AliQAManager::fgQAInstance = 0x0;
68
69//_____________________________________________________________________________
70AliQAManager::AliQAManager() :
71 AliCDBManager(),
72 fCurrentEvent(0),
73 fCycleSame(kFALSE),
74 fDetectors("ALL"),
75 fDetectorsW("ALL"),
76 fESD(NULL),
77 fESDTree(NULL),
78 fGAliceFileName(""),
79 fFirstEvent(0),
80 fMaxEvents(0),
81 fMode(""),
82 fNumberOfEvents(999999),
83 fRecoParam(),
84 fRunNumber(0),
85 fRawReader(NULL),
86 fRawReaderDelete(kTRUE),
87 fRunLoader(NULL),
88 fTasks(""),
89 fEventSpecie(AliRecoParam::kDefault)
90{
91 // default ctor
92 fMaxEvents = fNumberOfEvents ;
93 for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
94 if (IsSelected(AliQA::GetDetName(iDet))) {
95 fLoader[iDet] = NULL ;
96 fQADataMaker[iDet] = NULL ;
97 fQACycles[iDet] = 999999 ;
98 fQAWriteExpert[iDet] = kTRUE ;
99 }
100 }
101}
102
103//_____________________________________________________________________________
104AliQAManager::AliQAManager(const Char_t * mode, const Char_t* gAliceFilename) :
105 AliCDBManager(),
106 fCurrentEvent(0),
107 fCycleSame(kFALSE),
108 fDetectors("ALL"),
109 fDetectorsW("ALL"),
110 fESD(NULL),
111 fESDTree(NULL),
112 fGAliceFileName(gAliceFilename),
113 fFirstEvent(0),
114 fMaxEvents(0),
115 fMode(mode),
116 fNumberOfEvents(999999),
117 fRecoParam(),
118 fRunNumber(0),
119 fRawReader(NULL),
120 fRawReaderDelete(kTRUE),
121 fRunLoader(NULL),
122 fTasks(""),
123 fEventSpecie(AliRecoParam::kDefault)
124{
125 // default ctor
126 fMaxEvents = fNumberOfEvents ;
127 for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
128 if (IsSelected(AliQA::GetDetName(iDet))) {
129 fLoader[iDet] = NULL ;
130 fQADataMaker[iDet] = NULL ;
131 fQACycles[iDet] = 999999 ;
132 fQAWriteExpert[iDet] = kTRUE ;
65660bf3 133 }
134 }
2e331c8b 135}
136
137//_____________________________________________________________________________
138AliQAManager::AliQAManager(const AliQAManager & qas) :
139 AliCDBManager(),
140 fCurrentEvent(qas.fCurrentEvent),
141 fCycleSame(kFALSE),
142 fDetectors(qas.fDetectors),
143 fDetectorsW(qas.fDetectorsW),
144 fESD(NULL),
145 fESDTree(NULL),
146 fGAliceFileName(qas.fGAliceFileName),
147 fFirstEvent(qas.fFirstEvent),
148 fMaxEvents(qas.fMaxEvents),
149 fMode(qas.fMode),
150 fNumberOfEvents(qas.fNumberOfEvents),
151 fRecoParam(),
152 fRunNumber(qas.fRunNumber),
153 fRawReader(NULL),
154 fRawReaderDelete(kTRUE),
155 fRunLoader(NULL),
156 fTasks(qas.fTasks),
157 fEventSpecie(qas.fEventSpecie)
158{
159 // cpy ctor
160 for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
161 fLoader[iDet] = qas.fLoader[iDet] ;
162 fQADataMaker[iDet] = qas.fQADataMaker[iDet] ;
163 fQACycles[iDet] = qas.fQACycles[iDet] ;
164 fQAWriteExpert[iDet] = qas.fQAWriteExpert[iDet] ;
165 }
166}
167
168//_____________________________________________________________________________
169AliQAManager & AliQAManager::operator = (const AliQAManager & qas)
170{
171 // assignment operator
172 this->~AliQAManager() ;
173 new(this) AliQAManager(qas) ;
174 return *this ;
175}
176
177//_____________________________________________________________________________
178AliQAManager::~AliQAManager()
179{
180 // dtor
181 for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
182 if (IsSelected(AliQA::GetDetName(iDet))) {
183 fLoader[iDet] = NULL;
184 if (fQADataMaker[iDet]) {
185 (fQADataMaker[iDet])->Finish() ;
186 delete fQADataMaker[iDet] ;
187 }
188 }
189 }
190 if (fRawReaderDelete) {
191 fRunLoader = NULL ;
192 delete fRawReader ;
193 fRawReader = NULL ;
194 }
195}
196
197//_____________________________________________________________________________
198Bool_t AliQAManager::DoIt(const AliQA::TASKINDEX_t taskIndex)
199{
200 // Runs all the QA data Maker for every detector
201
202 Bool_t rv = kFALSE ;
203 // Fill QA data in event loop
204 for (UInt_t iEvent = fFirstEvent ; iEvent < (UInt_t)fMaxEvents ; iEvent++) {
205 fCurrentEvent++ ;
206 // Get the event
207 if ( iEvent%10 == 0 )
208 AliInfo(Form("processing event %d", iEvent));
209 if ( taskIndex == AliQA::kRAWS ) {
210 if ( !fRawReader->NextEvent() )
211 break ;
212 } else if ( taskIndex == AliQA::kESDS ) {
213 if ( fESDTree->GetEntry(iEvent) == 0 )
214 break ;
215 } else {
216 if ( fRunLoader->GetEvent(iEvent) != 0 )
217 break ;
218 }
219 // loop over active loaders
220 for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
221 if (IsSelected(AliQA::GetDetName(iDet))) {
222 AliQADataMaker * qadm = GetQADataMaker(iDet) ;
223 if (!qadm) continue; // This detector doesn't have any QA (for example, HLT)
224 if ( qadm->IsCycleDone() ) {
225 qadm->EndOfCycle(taskIndex) ;
226 }
227 TTree * data = NULL ;
228 AliLoader* loader = GetLoader(qadm->GetUniqueID());
229 switch (taskIndex) {
230 case AliQA::kNULLTASKINDEX :
231 break ;
232 case AliQA::kRAWS :
233 qadm->Exec(taskIndex, fRawReader) ;
234 break ;
235 case AliQA::kHITS :
236 if( loader ) {
237 loader->LoadHits() ;
238 data = loader->TreeH() ;
239 if ( ! data ) {
240 AliWarning(Form(" Hit Tree not found for %s", AliQA::GetDetName(iDet))) ;
241 break ;
242 }
243 }
244 qadm->Exec(taskIndex, data) ;
245 break ;
246 case AliQA::kSDIGITS :
247 if( loader ) {
248 loader->LoadSDigits() ;
249 data = loader->TreeS() ;
250 if ( ! data ) {
251 AliWarning(Form(" SDigit Tree not found for %s", AliQA::GetDetName(iDet))) ;
252 break ;
253 }
254 }
255 qadm->Exec(taskIndex, data) ;
256 break;
257 case AliQA::kDIGITS :
258 if( loader ) {
259 loader->LoadDigits() ;
260 data = loader->TreeD() ;
261 if ( ! data ) {
262 AliWarning(Form(" Digit Tree not found for %s", AliQA::GetDetName(iDet))) ;
263 break ;
264 }
265 }
266 qadm->Exec(taskIndex, data) ;
267 break;
268 case AliQA::kRECPOINTS :
269 if( loader ) {
270 loader->LoadRecPoints() ;
271 data = loader->TreeR() ;
272 if (!data) {
273 AliWarning(Form("RecPoints not found for %s", AliQA::GetDetName(iDet))) ;
274 break ;
275 }
276 }
277 qadm->Exec(taskIndex, data) ;
278 break;
279 case AliQA::kTRACKSEGMENTS :
280 break;
281 case AliQA::kRECPARTICLES :
282 break;
283 case AliQA::kESDS :
284 qadm->Exec(taskIndex, fESD) ;
285 break;
286 case AliQA::kNTASKINDEX :
287 break;
288 } //task switch
289 }
290 } // detector loop
291 Increment() ;
292 } // event loop
293 // Save QA data for all detectors
294 rv = Finish(taskIndex) ;
295
296 if ( taskIndex == AliQA::kRAWS )
297 fRawReader->RewindEvents() ;
298
299 return rv ;
300}
301
302//_____________________________________________________________________________
303Bool_t AliQAManager::Finish(const AliQA::TASKINDEX_t taskIndex)
304{
305 // write output to file for all detectors
306 for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
307 if (IsSelected(AliQA::GetDetName(iDet))) {
308 AliQADataMaker * qadm = GetQADataMaker(iDet) ;
309 if (qadm)
310 qadm->EndOfCycle(taskIndex) ;
311 }
312 }
313 return kTRUE ;
314}
315
316//_____________________________________________________________________________
317TObjArray * AliQAManager::GetFromOCDB(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, const char * year) const
318{
319 // Retrieve the list of QA data for a given detector and a given task
320 TObjArray * rv = NULL ;
321 if ( !strlen(AliQA::GetQARefStorage()) ) {
322 AliError("No storage defined, use AliQA::SetQARefStorage") ;
323 return NULL ;
324 }
325 if ( ! IsDefaultStorageSet() ) {
326 TString tmp(AliQA::GetQARefDefaultStorage()) ;
327 tmp.Append(year) ;
328 tmp.Append("/") ;
329 Instance()->SetDefaultStorage(tmp.Data()) ;
330 Instance()->SetSpecificStorage(Form("%s/*", AliQA::GetQAName()), AliQA::GetQARefStorage()) ;
331 }
332 TString detOCDBDir(Form("%s/%s/%s", AliQA::GetQAName(), AliQA::GetDetName((Int_t)det), AliQA::GetRefOCDBDirName())) ;
333 AliInfo(Form("Retrieving reference data from %s/%s for %s", AliQA::GetQARefStorage(), detOCDBDir.Data(), AliQA::GetTaskName(task).Data())) ;
334 AliCDBEntry* entry = QAManager()->Get(detOCDBDir.Data(), 0) ; //FIXME 0 --> Run Number
335 TList * listDetQAD = dynamic_cast<TList *>(entry->GetObject()) ;
336 if ( listDetQAD )
337 rv = dynamic_cast<TObjArray *>(listDetQAD->FindObject(AliQA::GetTaskName(task))) ;
338 return rv ;
339}
340
341//_____________________________________________________________________________
342AliLoader * AliQAManager::GetLoader(Int_t iDet)
343{
344 // get the loader for a detector
345
346 if ( !fRunLoader || iDet == AliQA::kCORR)
347 return NULL ;
348
349 TString detName = AliQA::GetDetName(iDet) ;
350 fLoader[iDet] = fRunLoader->GetLoader(detName + "Loader");
351 if (fLoader[iDet])
352 return fLoader[iDet] ;
353
354 // load the QA data maker object
355 TPluginManager* pluginManager = gROOT->GetPluginManager() ;
356 TString loaderName = "Ali" + detName + "Loader" ;
357
358 AliLoader * loader = NULL ;
359 // first check if a plugin is defined for the quality assurance data maker
360 TPluginHandler* pluginHandler = pluginManager->FindHandler("AliLoader", detName) ;
361 // if not, add a plugin for it
362 if (!pluginHandler) {
363 AliDebug(1, Form("defining plugin for %s", loaderName.Data())) ;
364 TString libs = gSystem->GetLibraries() ;
365 if (libs.Contains("lib" + detName + "base.so") || (gSystem->Load("lib" + detName + "base.so") >= 0)) {
366 pluginManager->AddHandler("AliQADataMaker", detName, loaderName, detName + "loader", loaderName + "()") ;
367 } else {
368 pluginManager->AddHandler("AliLoader", detName, loaderName, detName, loaderName + "()") ;
369 }
370 pluginHandler = pluginManager->FindHandler("AliLoader", detName) ;
371 }
372 if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
373 loader = (AliLoader *) pluginHandler->ExecPlugin(0) ;
374 }
375 if (loader)
376 fLoader[iDet] = loader ;
377 return loader ;
378}
379
380//_____________________________________________________________________________
381AliQA * AliQAManager::GetQA(UInt_t run, UInt_t evt)
382{
383// retrieves the QA object stored in a file named "Run{run}.Event{evt}_1.ESD.tag.root"
384 char * fileName = Form("Run%d.Event%d_1.ESD.tag.root", run, evt) ;
385 TFile * tagFile = TFile::Open(fileName) ;
386 if ( !tagFile ) {
387 AliError(Form("File %s not found", fileName)) ;
388 return NULL ;
389 }
390 TTree * tagTree = dynamic_cast<TTree *>(tagFile->Get("T")) ;
391 if ( !tagTree ) {
392 AliError(Form("Tree T not found in %s", fileName)) ;
393 tagFile->Close() ;
394 return NULL ;
395 }
396 AliRunTag * tag = new AliRunTag ;
397 tagTree->SetBranchAddress("AliTAG", &tag) ;
398 tagTree->GetEntry(evt) ;
399 AliQA * qa = AliQA::Instance(tag->GetQALength(), tag->GetQA(), tag->GetESLength(), tag->GetEventSpecies()) ;
400 tagFile->Close() ;
401 return qa ;
402}
403
404//_____________________________________________________________________________
405AliQADataMaker * AliQAManager::GetQADataMaker(const Int_t iDet)
406{
407 // get the quality assurance data maker for a detector
408
409 if (fQADataMaker[iDet]) {
410 fQADataMaker[iDet]->SetEventSpecie(fEventSpecie) ;
411 return fQADataMaker[iDet] ;
412 }
413
414 AliQADataMaker * qadm = NULL ;
415
416 if (iDet == AliQA::kGLOBAL) { //Global QA
417 qadm = new AliGlobalQADataMaker();
418 qadm->SetName(AliQA::GetDetName(iDet));
419 qadm->SetUniqueID(iDet);
420 fQADataMaker[iDet] = qadm;
421 qadm->SetEventSpecie(fEventSpecie) ;
422 return qadm;
423 }
424
425 if (iDet == AliQA::kCORR) { //the data maker for correlations among detectors
426 qadm = new AliCorrQADataMakerRec(fQADataMaker) ;
427 qadm->SetName(AliQA::GetDetName(iDet));
428 qadm->SetUniqueID(iDet);
429 fQADataMaker[iDet] = qadm;
430 qadm->SetEventSpecie(fEventSpecie) ;
431 return qadm;
432 }
433
434 // load the QA data maker object
435 TPluginManager* pluginManager = gROOT->GetPluginManager() ;
436 TString detName = AliQA::GetDetName(iDet) ;
437 TString tmp(fMode) ;
438 if (tmp.Contains("sim"))
439 tmp.ReplaceAll("s", "S") ;
440 else if (tmp.Contains("rec"))
441 tmp.ReplaceAll("r", "R") ;
442
443 TString qadmName = "Ali" + detName + "QADataMaker" + tmp ;
444
445 // first check if a plugin is defined for the quality assurance data maker
446 TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName) ;
447 // if not, add a plugin for it
448 if (!pluginHandler) {
449 AliDebug(1, Form("defining plugin for %s", qadmName.Data())) ;
450 TString libs = gSystem->GetLibraries() ;
451 if (libs.Contains("lib" + detName + fMode + ".so") || (gSystem->Load("lib" + detName + fMode + ".so") >= 0)) {
452 pluginManager->AddHandler("AliQADataMaker", detName, qadmName, detName + "qadm", qadmName + "()") ;
453 } else {
454 pluginManager->AddHandler("AliQADataMaker", detName, qadmName, detName, qadmName + "()") ;
455 }
456 pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName) ;
457 }
458 if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
459 qadm = (AliQADataMaker *) pluginHandler->ExecPlugin(0) ;
460 }
461 if (qadm) {
462 qadm->SetName(AliQA::GetDetName(iDet));
463 qadm->SetUniqueID(iDet);
464 fQADataMaker[iDet] = qadm ;
465 qadm->SetEventSpecie(fEventSpecie) ;
466 }
467
468 return qadm ;
469}
470
471//_____________________________________________________________________________
472void AliQAManager::EndOfCycle(TObjArray * detArray)
473{
474 // End of cycle QADataMakers
475
476 for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
477 if (IsSelected(AliQA::GetDetName(iDet))) {
478 AliQADataMaker * qadm = GetQADataMaker(iDet) ;
479 if (!qadm)
480 continue ;
481 // skip non active detectors
482 if (detArray) {
483 AliModule* det = static_cast<AliModule*>(detArray->FindObject(AliQA::GetDetName(iDet))) ;
484 if (!det || !det->IsActive())
485 continue ;
486 }
487 for (UInt_t taskIndex = 0; taskIndex < AliQA::kNTASKINDEX; taskIndex++) {
488 if ( fTasks.Contains(Form("%d", taskIndex)) )
489 qadm->EndOfCycle(AliQA::GetTaskIndex(AliQA::GetTaskName(taskIndex))) ;
490 }
491 qadm->Finish();
492 }
493 }
494}
495
496//_____________________________________________________________________________
497void AliQAManager::EndOfCycle(TString detectors)
498{
499 // End of cycle QADataMakers
500
501 for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
502 if (IsSelected(AliQA::GetDetName(iDet))) {
503 AliQADataMaker * qadm = GetQADataMaker(iDet) ;
504 if (!qadm)
505 continue ;
506 // skip non active detectors
507 if (!detectors.Contains(AliQA::GetDetName(iDet)))
508 continue ;
509 for (UInt_t taskIndex = 0; taskIndex < AliQA::kNTASKINDEX; taskIndex++) {
510 if ( fTasks.Contains(Form("%d", taskIndex)) )
511 qadm->EndOfCycle(AliQA::GetTaskIndex(AliQA::GetTaskName(taskIndex))) ;
512 }
513 qadm->Finish();
514 }
515 }
516}
517
518//_____________________________________________________________________________
519void AliQAManager::Increment()
520{
521 // Increments the cycle counter for all QA Data Makers
522 for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
523 if (IsSelected(AliQA::GetDetName(iDet))) {
524 AliQADataMaker * qadm = GetQADataMaker(iDet) ;
525 if (qadm)
526 qadm->Increment() ;
527 }
528 }
529}
530
531//_____________________________________________________________________________
532Bool_t AliQAManager::InitQA(const AliQA::TASKINDEX_t taskIndex, const char * input )
533{
534 // Initialize the event source and QA data makers
535
536 fTasks += Form("%d", taskIndex) ;
537
538 if (taskIndex == AliQA::kRAWS) {
539 if (!fRawReader) {
540 fRawReader = AliRawReader::Create(input);
541 }
542 if ( ! fRawReader )
543 return kFALSE ;
544 fRawReaderDelete = kTRUE ;
545 fRawReader->NextEvent() ;
546 fRunNumber = fRawReader->GetRunNumber() ;
547 SetRun(fRunNumber) ;
548 fRawReader->RewindEvents();
549 fNumberOfEvents = 999999 ;
550 if ( fMaxEvents < 0 )
551 fMaxEvents = fNumberOfEvents ;
552 } else if (taskIndex == AliQA::kESDS) {
553 fTasks = AliQA::GetTaskName(AliQA::kESDS) ;
554 if (!gSystem->AccessPathName("AliESDs.root")) { // AliESDs.root exists
555 TFile * esdFile = TFile::Open("AliESDs.root") ;
556 fESDTree = dynamic_cast<TTree *> (esdFile->Get("esdTree")) ;
557 if ( !fESDTree ) {
558 AliError("esdTree not found") ;
559 return kFALSE ;
560 } else {
561 fESD = new AliESDEvent() ;
562 fESD->ReadFromTree(fESDTree) ;
563 fESDTree->GetEntry(0) ;
564 fRunNumber = fESD->GetRunNumber() ;
565 fNumberOfEvents = fESDTree->GetEntries() ;
566 if ( fMaxEvents < 0 )
567 fMaxEvents = fNumberOfEvents ;
568 }
569 } else {
570 AliError("AliESDs.root not found") ;
571 return kFALSE ;
572 }
573 } else {
574 if ( !InitRunLoader() ) {
575 AliWarning("No Run Loader not found") ;
576 } else {
577 fNumberOfEvents = fRunLoader->GetNumberOfEvents() ;
578 if ( fMaxEvents < 0 )
579 fMaxEvents = fNumberOfEvents ;
580 }
581 }
582
583 // Get Detectors
584 TObjArray* detArray = NULL ;
585 if (fRunLoader) // check if RunLoader exists
586 if ( fRunLoader->GetAliRun() ) { // check if AliRun exists in gAlice.root
587 detArray = fRunLoader->GetAliRun()->Detectors() ;
588 fRunNumber = fRunLoader->GetHeader()->GetRun() ;
589 }
590
591 // Initialize all QA data makers for all detectors
592 fRunNumber = AliCDBManager::Instance()->GetRun() ;
593 if ( ! AliGeomManager::GetGeometry() )
594 AliGeomManager::LoadGeometry() ;
595
596 InitQADataMaker(fRunNumber, detArray) ; //, fCycleSame, kTRUE, detArray) ;
597 return kTRUE ;
598}
599
600//_____________________________________________________________________________
601void AliQAManager::InitQADataMaker(UInt_t run, TObjArray * detArray)
602{
603 // Initializes The QADataMaker for all active detectors and for all active tasks
604 for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
605 if (IsSelected(AliQA::GetDetName(iDet))) {
606 AliQADataMaker * qadm = GetQADataMaker(iDet) ;
607 if (!qadm) {
608 AliError(Form("AliQADataMaker not found for %s", AliQA::GetDetName(iDet))) ;
609 fDetectorsW.ReplaceAll(AliQA::GetDetName(iDet), "") ;
610 } else {
611 if (fQAWriteExpert[iDet])
612 qadm->SetWriteExpert() ;
613 AliDebug(1, Form("Data Maker found for %s", qadm->GetName())) ;
614 // skip non active detectors
615 if (detArray) {
616 AliModule* det = static_cast<AliModule*>(detArray->FindObject(AliQA::GetDetName(iDet))) ;
617 if (!det || !det->IsActive())
618 continue ;
619 }
620 if (fQAWriteExpert[iDet]) qadm->SetWriteExpert() ;
621 // Set default reco params
622 Bool_t sameCycle = kFALSE ;
623 for (UInt_t taskIndex = 0; taskIndex < AliQA::kNTASKINDEX; taskIndex++) {
624 if ( fTasks.Contains(Form("%d", taskIndex)) ) {
625 qadm->Init(AliQA::GetTaskIndex(AliQA::GetTaskName(taskIndex)), GetQACycles(qadm->GetUniqueID())) ;
626 qadm->StartOfCycle(AliQA::GetTaskIndex(AliQA::GetTaskName(taskIndex)), run, sameCycle) ;
627 sameCycle = kTRUE ;
628 }
629 }
630 }
631 }
632 }
633}
634
635
636//_____________________________________________________________________________
637Bool_t AliQAManager::InitRunLoader()
638{
639 // get or create the run loader
640 if (fRunLoader) {
641 fCycleSame = kTRUE ;
642 } else {
643 if (!gSystem->AccessPathName(fGAliceFileName.Data())) { // galice.root exists
644 // load all base libraries to get the loader classes
645 TString libs = gSystem->GetLibraries() ;
646 for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
647 if (!IsSelected(AliQA::GetDetName(iDet)))
648 continue ;
649 TString detName = AliQA::GetDetName(iDet) ;
650 if (detName == "HLT")
651 continue;
652 if (libs.Contains("lib" + detName + "base.so"))
653 continue;
654 gSystem->Load("lib" + detName + "base.so");
655 }
656 fRunLoader = AliRunLoader::Open(fGAliceFileName.Data());
657 if (!fRunLoader) {
658 AliError(Form("no run loader found in file %s", fGAliceFileName.Data()));
659 return kFALSE;
660 }
661 fRunLoader->CdGAFile();
662 if (fRunLoader->LoadgAlice() == 0) {
663 gAlice = fRunLoader->GetAliRun();
664 }
665
666 if (!gAlice) {
667 AliError(Form("no gAlice object found in file %s", fGAliceFileName.Data()));
668 return kFALSE;
669 }
670
671 } else { // galice.root does not exist
672 AliError(Form("the file %s does not exist", fGAliceFileName.Data()));
673 return kFALSE;
674 }
675 }
676
677 if (!fRunNumber) {
678 fRunLoader->LoadHeader();
679 fRunNumber = fRunLoader->GetHeader()->GetRun() ;
680 }
681 return kTRUE;
682}
683
684//_____________________________________________________________________________
685Bool_t AliQAManager::IsSelected(const char * det)
686{
687 // check whether detName is contained in detectors
688 // if yes, it is removed from detectors
689
690 Bool_t rv = kFALSE;
691 const TString detName(det) ;
692 // always activates Correlation
693 if ( detName.Contains(AliQA::GetDetName(AliQA::kCORR))) {
694 rv = kTRUE ;
695 } else {
696 // check if all detectors are selected
697 if (fDetectors.Contains("ALL")) {
698 fDetectors = "ALL";
699 rv = kTRUE;
700 } else if ((fDetectors.CompareTo(detName) == 0) ||
701 fDetectors.BeginsWith(detName+" ") ||
702 fDetectors.EndsWith(" "+detName) ||
703 fDetectors.Contains(" "+detName+" ")) {
704 rv = kTRUE;
705 }
706 }
707 return rv ;
708}
709
710//_____________________________________________________________________________
bededc30 711Bool_t AliQAManager::Merge(Int_t runNumber) const
2e331c8b 712{
bededc30 713 // Merge data from all detectors from a given run in one single file
2e331c8b 714 // Merge the QA results from all the data chunks in one run
bededc30 715 if ( runNumber == -1)
716 runNumber = fRunNumber ;
2e331c8b 717 Bool_t rv = MergeData(runNumber) ;
bededc30 718 //rv *= MergeResults(runNumber) ; // not needed for the time being
2e331c8b 719 return rv ;
720}
721
149a2367 722//______________________________________________________________________
723Bool_t AliQAManager::MergeXML(const char * collectionFile, const char * subFile, const char * outFile)
724{
725 // merges files listed in a xml collection
726 // usage Merge(collection, outputFile))
727 // collection: is a xml collection
728
729 Bool_t rv = kFALSE ;
730
731 if ( strstr(collectionFile, ".xml") == 0 ) {
732 AliError("Input collection file must be an \".xml\" file\n") ;
733 return kFALSE ;
734 }
735
736 if ( !gGrid )
737 TGrid::Connect("alien://");
738 if ( !gGrid )
739 return kFALSE ;
740
741 // Open the file collection
742 printf("*** Create Collection ***\n");
743 printf("*** Wk-Dir = |%s| \n",gSystem->WorkingDirectory());
744 printf("*** Coll = |%s| \n",collectionFile);
745
bededc30 746 TGridCollection * collection = (TGridCollection*)gROOT->ProcessLine(Form("TAlienCollection::Open(\"%s\")",collectionFile));
149a2367 747 TGridResult* result = collection->GetGridResult("", 0, 0);
748
749 Int_t index = 0 ;
750 const char * turl ;
adae62c9 751 TFileMerger merger(kFALSE) ;
149a2367 752 if (!outFile) {
753 TString tempo(collectionFile) ;
754 if ( subFile)
755 tempo.ReplaceAll(".xml", subFile) ;
756 else
757 tempo.ReplaceAll(".xml", "_Merged.root") ;
758 outFile = tempo.Data() ;
759 }
760 merger.OutputFile(outFile) ;
761
762 while ( (turl = result->GetKey(index, "turl")) ) {
763 char * file ;
764 if ( subFile )
765 file = Form("%s#%s", turl, subFile) ;
766 else
767 file = Form("%s", turl) ;
768
769 AliInfo(Form("%s\n", file)) ;
770 merger.AddFile(file) ;
771 index++ ;
772 }
773
774 if (index)
775 merger.Merge() ;
776
777 AliInfo(Form("Files merged into %s\n", outFile)) ;
778
779 rv = kFALSE;
780 return rv ;
781}
782
2e331c8b 783//_____________________________________________________________________________
784Bool_t AliQAManager::MergeData(const Int_t runNumber) const
785{
bededc30 786 // Merge QA data from all detectors for a given run in one single file
787
2e331c8b 788 TFileMerger merger ;
bededc30 789 TString outFileName = Form("Merged.%s.Data.root",AliQA::GetQADataFileName()) ;
2e331c8b 790 merger.OutputFile(outFileName.Data()) ;
bededc30 791 for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
792 char * file = gSystem->Which(gSystem->WorkingDirectory(), Form("%s.%s.%d.root", AliQA::GetDetName(iDet), AliQA::GetQADataFileName(), runNumber));
793 if (file)
794 merger.AddFile(file) ;
795 }
2e331c8b 796 merger.Merge() ;
797 return kTRUE ;
798}
799
800//_____________________________________________________________________________
801Bool_t AliQAManager::MergeResults(const Int_t runNumber) const
802{
803 // Merge the QA result from all the data chunks in a run
bededc30 804 // to be revised whwn it will be used (see MergeData)
2e331c8b 805 TString cmd ;
806 cmd = Form(".! ls %s*.root > tempo.txt", AliQA::GetQADataFileName()) ;
807 gROOT->ProcessLine(cmd.Data()) ;
808 ifstream in("tempo.txt") ;
809 const Int_t chunkMax = 100 ;
810 TString fileList[chunkMax] ;
811
812 Int_t index = 0 ;
813 while ( 1 ) {
814 TString file ;
815 in >> fileList[index] ;
816 if ( !in.good() )
817 break ;
818 AliInfo(Form("index = %d file = %s", index, (fileList[index].Data()))) ;
819 index++ ;
820 }
821
822 if ( index == 0 ) {
823 AliError("No QA Result File found") ;
824 return kFALSE ;
825 }
826
827 TFileMerger merger ;
fc07289e 828 TString outFileName ;
829 if (runNumber != -1)
830 outFileName = Form("Merged.%s.Result.%d.root",AliQA::GetQADataFileName(),runNumber);
831 else
832 outFileName = Form("Merged.%s.Result.root",AliQA::GetQADataFileName());
2e331c8b 833 merger.OutputFile(outFileName.Data()) ;
834 for (Int_t ifile = 0 ; ifile < index ; ifile++) {
835 TString file = fileList[ifile] ;
836 merger.AddFile(file) ;
837 }
838 merger.Merge() ;
839
840 return kTRUE ;
841}
842
843//_____________________________________________________________________________
844void AliQAManager::Reset(const Bool_t sameCycle)
845{
846 // Reset the default data members
847
848 for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
849 if (IsSelected(AliQA::GetDetName(iDet))) {
850 AliQADataMaker * qadm = GetQADataMaker(iDet);
851 qadm->Reset();
852 }
853 }
854 if (fRawReaderDelete) {
855 delete fRawReader ;
856 fRawReader = NULL ;
857 }
858
859 fCycleSame = sameCycle ;
860 fESD = NULL ;
861 fESDTree = NULL ;
862 //fFirst = kTRUE ;
863 fNumberOfEvents = 999999 ;
864}
865
866//_____________________________________________________________________________
867AliQAManager * AliQAManager::QAManager(const Char_t * mode, TMap *entryCache, Int_t run)
868{
869 // returns AliQAManager instance (singleton)
870
871 if (!fgQAInstance) {
872 fgQAInstance = new AliQAManager(mode) ;
873 if (!entryCache)
874 fgQAInstance->Init();
875 else
876 fgQAInstance->InitFromCache(entryCache,run);
877 }
878 return fgQAInstance;
879}
880
881//_____________________________________________________________________________
882TString AliQAManager::Run(const char * detectors, AliRawReader * rawReader, const Bool_t sameCycle)
883{
884 //Runs all the QA data Maker for Raws only
885
886 fCycleSame = sameCycle ;
887 fRawReader = rawReader ;
888 fDetectors = detectors ;
889 fDetectorsW = detectors ;
890
891 AliCDBManager* man = AliCDBManager::Instance() ;
892
893 if ( man->GetRun() == -1 ) {// check if run number not set previously and set it from raw data
894 rawReader->NextEvent() ;
895 man->SetRun(fRawReader->GetRunNumber()) ;
896 rawReader->RewindEvents() ;
897 }
898
899 if (!fCycleSame)
900 if ( !InitQA(AliQA::kRAWS) )
901 return kFALSE ;
902 fRawReaderDelete = kFALSE ;
903
904 DoIt(AliQA::kRAWS) ;
905 return fDetectorsW ;
906}
907
908//_____________________________________________________________________________
909TString AliQAManager::Run(const char * detectors, const char * fileName, const Bool_t sameCycle)
910{
911 //Runs all the QA data Maker for Raws only
912
913 fCycleSame = sameCycle ;
914 fDetectors = detectors ;
915 fDetectorsW = detectors ;
916
917 AliCDBManager* man = AliCDBManager::Instance() ;
918 if ( man->GetRun() == -1 ) { // check if run number not set previously and set it from AliRun
919 AliRunLoader * rl = AliRunLoader::Open("galice.root") ;
920 if ( ! rl ) {
921 AliFatal("galice.root file not found in current directory") ;
922 } else {
923 rl->CdGAFile() ;
924 rl->LoadgAlice() ;
925 if ( ! rl->GetAliRun() ) {
926 AliFatal("AliRun not found in galice.root") ;
927 } else {
928 rl->LoadHeader() ;
929 man->SetRun(rl->GetHeader()->GetRun());
930 }
931 }
932 }
933
934 if (!fCycleSame)
935 if ( !InitQA(AliQA::kRAWS, fileName) )
936 return kFALSE ;
937
938 DoIt(AliQA::kRAWS) ;
939 return fDetectorsW ;
940}
941
942//_____________________________________________________________________________
943TString AliQAManager::Run(const char * detectors, const AliQA::TASKINDEX_t taskIndex, Bool_t const sameCycle, const char * fileName )
944{
945 // Runs all the QA data Maker for every detector
946
947 fCycleSame = sameCycle ;
948 fDetectors = detectors ;
949 fDetectorsW = detectors ;
950
951 AliCDBManager* man = AliCDBManager::Instance() ;
952 if ( man->GetRun() == -1 ) { // check if run number not set previously and set it from AliRun
953 AliRunLoader * rl = AliRunLoader::Open("galice.root") ;
954 if ( ! rl ) {
955 AliFatal("galice.root file not found in current directory") ;
956 } else {
957 rl->CdGAFile() ;
958 rl->LoadgAlice() ;
959 if ( ! rl->GetAliRun() ) {
960 AliInfo("AliRun not found in galice.root") ;
961 } else {
962 rl->LoadHeader() ;
963 man->SetRun(rl->GetHeader()->GetRun()) ;
964 }
965 }
966 }
967
968
969 if ( taskIndex == AliQA::kNULLTASKINDEX) {
970 for (UInt_t task = 0; task < AliQA::kNTASKINDEX; task++) {
971 if ( fTasks.Contains(Form("%d", task)) ) {
972 if (!fCycleSame)
973 if ( !InitQA(AliQA::GetTaskIndex(AliQA::GetTaskName(task)), fileName) )
974 return kFALSE ;
975 DoIt(AliQA::GetTaskIndex(AliQA::GetTaskName(task))) ;
976 }
977 }
978 } else {
979 if (! fCycleSame )
980 if ( !InitQA(taskIndex, fileName) )
981 return kFALSE ;
982 DoIt(taskIndex) ;
983 }
984
985 return fDetectorsW ;
986
987}
988
989//_____________________________________________________________________________
990void AliQAManager::RunOneEvent(AliRawReader * rawReader)
991{
992 //Runs all the QA data Maker for Raws only and on one event only (event loop done by calling method)
993 if ( ! rawReader )
994 return ;
995 AliCodeTimerAuto("") ;
996 if (fTasks.Contains(Form("%d", AliQA::kRAWS))){
997 for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
998 if (!IsSelected(AliQA::GetDetName(iDet)))
999 continue;
1000 AliQADataMaker *qadm = GetQADataMaker(iDet);
1001 if (!qadm)
1002 continue;
1003 if ( qadm->IsCycleDone() ) {
1004 qadm->EndOfCycle() ;
1005 }
1006 AliCodeTimerStart(Form("running RAW quality assurance data maker for %s", AliQA::GetDetName(iDet)));
1007 qadm->SetEventSpecie(fEventSpecie) ;
1008 qadm->Exec(AliQA::kRAWS, rawReader) ;
1009 AliCodeTimerStop(Form("running RAW quality assurance data maker for %s", AliQA::GetDetName(iDet)));
1010 }
1011 }
1012}
1013
1014//_____________________________________________________________________________
1015void AliQAManager::RunOneEvent(AliESDEvent *& esd)
1016{
1017 //Runs all the QA data Maker for ESDs only and on one event only (event loop done by calling method)
1018
1019 AliCodeTimerAuto("") ;
1020 if (fTasks.Contains(Form("%d", AliQA::kESDS))) {
1021 for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
1022 if (!IsSelected(AliQA::GetDetName(iDet)))
1023 continue;
1024 AliQADataMaker *qadm = GetQADataMaker(iDet);
1025 if (!qadm)
1026 continue;
1027 if ( qadm->IsCycleDone() ) {
1028 qadm->EndOfCycle() ;
1029 }
1030 AliCodeTimerStart(Form("running ESD quality assurance data maker for %s", AliQA::GetDetName(iDet)));
1031 qadm->Exec(AliQA::kESDS, esd) ;
1032 AliCodeTimerStop(Form("running ESD quality assurance data maker for %s", AliQA::GetDetName(iDet)));
1033 }
1034 }
1035}
1036
1037//_____________________________________________________________________________
1038void AliQAManager::RunOneEventInOneDetector(Int_t det, TTree * tree)
1039{
1040 // Runs all the QA data Maker for ESDs only and on one event only (event loop done by calling method)
1041 AliCodeTimerAuto("") ;
1042 if (fTasks.Contains(Form("%d", AliQA::kRECPOINTS))) {
1043 if (IsSelected(AliQA::GetDetName(det))) {
1044 AliQADataMaker *qadm = GetQADataMaker(det);
1045 if (qadm) {
1046 if ( qadm->IsCycleDone() ) {
1047 qadm->EndOfCycle() ;
1048 }
1049 AliCodeTimerStart(Form("running RecPoints quality assurance data maker for %s", AliQA::GetDetName(det)));
1050 qadm->Exec(AliQA::kRECPOINTS, tree) ;
1051 AliCodeTimerStop(Form("running RecPoints quality assurance data maker for %s", AliQA::GetDetName(det)));
1052 }
1053 }
1054 }
1055}
1056
1057//_____________________________________________________________________________
1058Bool_t AliQAManager::Save2OCDB(const Int_t runNumber, AliRecoParam::EventSpecie_t es, const char * year, const char * detectors) const
1059{
1060 // take the locasl QA data merge into a single file and save in OCDB
1061 Bool_t rv = kTRUE ;
1062 TString tmp(AliQA::GetQARefStorage()) ;
1063 if ( tmp.IsNull() ) {
1064 AliError("No storage defined, use AliQA::SetQARefStorage") ;
1065 return kFALSE ;
1066 }
1067 if ( !(tmp.Contains(AliQA::GetLabLocalOCDB()) || tmp.Contains(AliQA::GetLabAliEnOCDB())) ) {
1068 AliError(Form("%s is a wrong storage, use %s or %s", AliQA::GetQARefStorage(), AliQA::GetLabLocalOCDB().Data(), AliQA::GetLabAliEnOCDB().Data())) ;
1069 return kFALSE ;
1070 }
1071 TString sdet(detectors) ;
1072 sdet.ToUpper() ;
1073 TFile * inputFile ;
1074 if ( sdet.Contains("ALL") ) {
1075 rv = Merge(runNumber) ;
1076 if ( ! rv )
1077 return kFALSE ;
1078 TString inputFileName(Form("Merged.%s.Data.%d.root", AliQA::GetQADataFileName(), runNumber)) ;
1079 inputFile = TFile::Open(inputFileName.Data()) ;
1080 rv = SaveIt2OCDB(runNumber, inputFile, year, es) ;
1081 } else {
1082 for (Int_t index = 0; index < AliQA::kNDET; index++) {
1083 if (sdet.Contains(AliQA::GetDetName(index))) {
1084 TString inputFileName(Form("%s.%s.%d.root", AliQA::GetDetName(index), AliQA::GetQADataFileName(), runNumber)) ;
1085 inputFile = TFile::Open(inputFileName.Data()) ;
1086 rv *= SaveIt2OCDB(runNumber, inputFile, year, es) ;
1087 }
1088 }
1089 }
1090 return rv ;
1091}
1092
1093//_____________________________________________________________________________
1094Bool_t AliQAManager::SaveIt2OCDB(const Int_t runNumber, TFile * inputFile, const char * year, AliRecoParam::EventSpecie_t es) const
1095{
1096 // reads the TH1 from file and adds it to appropriate list before saving to OCDB
1097 Bool_t rv = kTRUE ;
1098 AliInfo(Form("Saving TH1s in %s to %s", inputFile->GetName(), AliQA::GetQARefStorage())) ;
1099 if ( ! IsDefaultStorageSet() ) {
1100 TString tmp( AliQA::GetQARefStorage() ) ;
1101 if ( tmp.Contains(AliQA::GetLabLocalOCDB()) )
1102 Instance()->SetDefaultStorage(AliQA::GetQARefStorage()) ;
1103 else {
1104 TString tmp1(AliQA::GetQARefDefaultStorage()) ;
1105 tmp1.Append(year) ;
1106 tmp1.Append("?user=alidaq") ;
1107 Instance()->SetDefaultStorage(tmp1.Data()) ;
1108 }
1109 }
1110 Instance()->SetSpecificStorage("*", AliQA::GetQARefStorage()) ;
1111 if(GetRun() < 0)
1112 Instance()->SetRun(runNumber);
1113
1114 AliCDBMetaData mdr ;
1115 mdr.SetResponsible("yves schutz");
1116
1117 for ( Int_t detIndex = 0 ; detIndex < AliQA::kNDET ; detIndex++) {
1118 TDirectory * detDir = inputFile->GetDirectory(AliQA::GetDetName(detIndex)) ;
1119 if ( detDir ) {
1120 AliInfo(Form("Entering %s", detDir->GetName())) ;
1121 AliQA::SetQARefDataDirName(es) ;
1122 TString detOCDBDir(Form("%s/%s/%s", AliQA::GetDetName(detIndex), AliQA::GetRefOCDBDirName(), AliQA::GetRefDataDirName())) ;
1123 AliCDBId idr(detOCDBDir.Data(), runNumber, AliCDBRunRange::Infinity()) ;
1124 TList * listDetQAD = new TList() ;
1125 TString listName(Form("%s QA data Reference", AliQA::GetDetName(detIndex))) ;
1126 mdr.SetComment(Form("%s QA stuff", AliQA::GetDetName(detIndex)));
1127 listDetQAD->SetName(listName) ;
1128 TList * taskList = detDir->GetListOfKeys() ;
1129 TIter nextTask(taskList) ;
1130 TKey * taskKey ;
1131 while ( (taskKey = dynamic_cast<TKey*>(nextTask())) ) {
1132 TDirectory * taskDir = detDir->GetDirectory(taskKey->GetName()) ;
1133 TDirectory * esDir = taskDir->GetDirectory(AliRecoParam::GetEventSpecieName(es)) ;
1134 AliInfo(Form("Saving %s", esDir->GetName())) ;
1135 TObjArray * listTaskQAD = new TObjArray(100) ;
1136 listTaskQAD->SetName(Form("%s/%s", taskKey->GetName(), AliRecoParam::GetEventSpecieName(es))) ;
1137 listDetQAD->Add(listTaskQAD) ;
1138 TList * histList = esDir->GetListOfKeys() ;
1139 TIter nextHist(histList) ;
1140 TKey * histKey ;
1141 while ( (histKey = dynamic_cast<TKey*>(nextHist())) ) {
1142 TObject * odata = esDir->Get(histKey->GetName()) ;
1143 if ( !odata ) {
1144 AliError(Form("%s in %s/%s returns a NULL pointer !!", histKey->GetName(), detDir->GetName(), taskDir->GetName())) ;
1145 } else {
1146 if ( AliQA::GetExpert() == histKey->GetName() ) {
1147 TDirectory * expertDir = esDir->GetDirectory(histKey->GetName()) ;
1148 TList * expertHistList = expertDir->GetListOfKeys() ;
1149 TIter nextExpertHist(expertHistList) ;
1150 TKey * expertHistKey ;
1151 while ( (expertHistKey = dynamic_cast<TKey*>(nextExpertHist())) ) {
1152 TObject * expertOdata = expertDir->Get(expertHistKey->GetName()) ;
1153 if ( !expertOdata ) {
1154 AliError(Form("%s in %s/%s/Expert returns a NULL pointer !!", expertHistKey->GetName(), detDir->GetName(), taskDir->GetName())) ;
1155 } else {
1156 AliInfo(Form("Adding %s", expertHistKey->GetName())) ;
1157 if ( expertOdata->IsA()->InheritsFrom("TH1") ) {
1158 AliInfo(Form("Adding %s", expertHistKey->GetName())) ;
1159 TH1 * hExpertdata = static_cast<TH1*>(expertOdata) ;
1160 listTaskQAD->Add(hExpertdata) ;
1161 }
1162 }
1163 }
1164 }
1165 AliInfo(Form("Adding %s", histKey->GetName())) ;
1166 if ( odata->IsA()->InheritsFrom("TH1") ) {
1167 AliInfo(Form("Adding %s", histKey->GetName())) ;
1168 TH1 * hdata = static_cast<TH1*>(odata) ;
1169 listTaskQAD->Add(hdata) ;
1170 }
1171 }
1172 }
1173 }
1174 Instance()->Put(listDetQAD, idr, &mdr) ;
1175 }
1176 }
1177 return rv ;
1178}
1179
1180//_____________________________________________________________________________
1181void AliQAManager::SetEventSpecie(AliRecoParam::EventSpecie_t es)
1182{
1183 // set the current event specie and inform AliQA that this event specie has been encountered
1184 fEventSpecie = es ;
1185 AliQA::Instance()->SetEventSpecie(es) ;
1186}
1187
1188//_____________________________________________________________________________
1189void AliQAManager::SetRecoParam(const Int_t det, const AliDetectorRecoParam *par)
1190{
1191 // Set custom reconstruction parameters for a given detector
1192 // Single set of parameters for all the events
1193 GetQADataMaker(det)->SetRecoParam(par) ;
1194}
1195
1196