AliRoot Core  3dc7879 (3dc7879)
AliQAManager.cxx
Go to the documentation of this file.
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 $ */
18 // //
19 // class for running the QA makers //
20 // //
21 // AliQAManager qas; //
22 // qas.Run(AliQAv1::kRAWS, rawROOTFileName); //
23 // qas.Run(AliQAv1::kHITS); //
24 // qas.Run(AliQAv1::kSDIGITS); //
25 // qas.Run(AliQAv1::kDIGITS); //
26 // qas.Run(AliQAv1::kRECPOINTS); //
27 // qas.Run(AliQAv1::kESDS); //
28 // //
30 
31 #include <TCanvas.h>
32 #include <TKey.h>
33 #include <TFile.h>
34 #include <TFileMerger.h>
35 #include <TGrid.h>
36 #include <TGridCollection.h>
37 #include <TGridResult.h>
38 #include <TPluginManager.h>
39 #include <TROOT.h>
40 #include <TString.h>
41 #include <TSystem.h>
42 #include <TStopwatch.h>
43 
44 #include "AliCDBManager.h"
45 #include "AliCDBEntry.h"
46 #include "AliCDBId.h"
47 #include "AliCDBMetaData.h"
48 #include "AliCodeTimer.h"
49 #include "AliCorrQADataMakerRec.h"
50 #include "AliDetectorRecoParam.h"
51 #include "AliESDEvent.h"
52 #include "AliGeomManager.h"
53 #include "AliGlobalQADataMaker.h"
54 #include "AliHeader.h"
55 #include "AliLog.h"
56 #include "AliModule.h"
57 #include "AliQAv1.h"
58 #include "AliQAChecker.h"
59 #include "AliQACheckerBase.h"
60 #include "AliQADataMakerRec.h"
61 #include "AliQADataMakerSim.h"
62 #include "AliQAManager.h"
63 #include "AliRawReaderDate.h"
64 #include "AliRawReaderFile.h"
65 #include "AliRawReaderRoot.h"
66 #include "AliRun.h"
67 #include "AliRunLoader.h"
68 #include "AliRunTag.h"
69 #include <fstream>
70 
71 using std::ifstream;
72 ClassImp(AliQAManager)
73 AliQAManager* AliQAManager::fgQAInstance = 0x0;
74 
75 //_____________________________________________________________________________
77  AliCDBManager(),
78  fCurrentEvent(0),
79  fCycleSame(kFALSE),
80  fDetectors("ALL"),
81  fDetectorsW("ALL"),
82  fESD(NULL),
83  fESDTree(NULL),
84  fEventInfo(NULL),
85  fGAliceFileName(""),
86  fFirstEvent(0),
87  fMaxEvents(0),
88  fMode(""),
89  fNumberOfEvents(999999),
90  fRecoParam(),
91  fRunNumber(0),
92  fRawReader(NULL),
93  fRawReaderDelete(kTRUE),
94  fRunLoader(NULL),
95  fTasks(""),
96  fEventSpecie(AliRecoParam::kDefault),
97  fPrintImage(kTRUE),
98  fSaveData(kTRUE) ,
99  fActiveOnlineDetectors()
100 {
101  // default ctor
102  fMaxEvents = fNumberOfEvents ;
103  for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
104  if (IsSelected(AliQAv1::GetDetName(iDet))) {
105  fLoader[iDet] = NULL ;
106  fQADataMaker[iDet] = NULL ;
107  fQACycles[iDet] = 999999 ;
108  }
109  }
110  SetWriteExpert() ;
111 }
112 
113 //_____________________________________________________________________________
114 AliQAManager::AliQAManager(AliQAv1::MODE_t mode, const Char_t* gAliceFilename) :
115  AliCDBManager(),
116  fCurrentEvent(0),
117  fCycleSame(kFALSE),
118  fDetectors("ALL"),
119  fDetectorsW("ALL"),
120  fESD(NULL),
121  fESDTree(NULL),
122  fEventInfo(NULL),
123  fGAliceFileName(gAliceFilename),
124  fFirstEvent(0),
125  fMaxEvents(0),
126  fMode(AliQAv1::GetModeName(mode)),
127  fNumberOfEvents(999999),
128  fRecoParam(),
129  fRunNumber(0),
130  fRawReader(NULL),
131  fRawReaderDelete(kTRUE),
132  fRunLoader(NULL),
133  fTasks(""),
134  fEventSpecie(AliRecoParam::kDefault),
135  fPrintImage(kTRUE),
136  fSaveData(kTRUE),
137  fActiveOnlineDetectors()
138 {
139  // default ctor
141  for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
142  if (IsSelected(AliQAv1::GetDetName(iDet))) {
143  fLoader[iDet] = NULL ;
144  fQADataMaker[iDet] = NULL ;
145  fQACycles[iDet] = 999999 ;
146  }
147  }
148  SetWriteExpert() ;
149 }
150 
151 //_____________________________________________________________________________
153  AliCDBManager(),
155  fCycleSame(kFALSE),
156  fDetectors(qas.fDetectors),
157  fDetectorsW(qas.fDetectorsW),
158  fESD(NULL),
159  fESDTree(NULL),
160  fEventInfo(NULL),
162  fFirstEvent(qas.fFirstEvent),
163  fMaxEvents(qas.fMaxEvents),
164  fMode(qas.fMode),
166  fRecoParam(),
167  fRunNumber(qas.fRunNumber),
168  fRawReader(NULL),
169  fRawReaderDelete(kTRUE),
170  fRunLoader(NULL),
171  fTasks(qas.fTasks),
173  fPrintImage(qas.fPrintImage),
174  fSaveData(qas.fSaveData),
176 
177 {
178  // cpy ctor
179  for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
180  fLoader[iDet] = qas.fLoader[iDet] ;
181  fQADataMaker[iDet] = qas.fQADataMaker[iDet] ;
182  fQACycles[iDet] = qas.fQACycles[iDet] ;
183  fQAWriteExpert[iDet] = qas.fQAWriteExpert[iDet] ;
184  }
185 }
186 
187 //_____________________________________________________________________________
189 {
190  // assignment operator
191  this->~AliQAManager() ;
192  new(this) AliQAManager(qas) ;
193  return *this ;
194 }
195 
196 //_____________________________________________________________________________
198 {
199  // dtor
200  for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
201  if (IsSelected(AliQAv1::GetDetName(iDet))) {
202  fLoader[iDet] = NULL;
203  if (fQADataMaker[iDet]) {
204  (fQADataMaker[iDet])->Finish() ;
205  delete fQADataMaker[iDet] ;
206  }
207  }
208  }
209  if (fRawReaderDelete) {
210  fRunLoader = NULL ;
211  delete fRawReader ;
212  fRawReader = NULL ;
213  }
214 }
215 //_____________________________________________________________________________
217 {
218  // Runs all the QA data Maker for every detector
219 
220  Bool_t rv = kFALSE ;
221  // Fill QA data in event loop
222  for (UInt_t iEvent = fFirstEvent ; iEvent < (UInt_t)fMaxEvents ; iEvent++) {
223  fCurrentEvent++ ;
224  // Get the event
225  if ( iEvent%10 == 0 )
226  AliDebug(AliQAv1::GetQADebugLevel(), Form("processing event %d", iEvent));
227  if ( taskIndex == AliQAv1::kRAWS ) {
228  if ( !fRawReader->NextEvent() )
229  break ;
230  } else if ( taskIndex == AliQAv1::kESDS ) {
231  if ( fESDTree->GetEntry(iEvent) == 0 )
232  break ;
233  } else {
234  if ( fRunLoader->GetEvent(iEvent) != 0 )
235  break ;
236  }
237  // loop over active loaders
238  TString detList ;
239  if ( GetEventInfo())
240  detList = GetEventInfo()->GetTriggerCluster() ;
241  for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
242  if (!detList.IsNull() && !detList.Contains(AliQAv1::GetDetName(iDet)))
243  continue ;
244  if (IsSelected(AliQAv1::GetDetName(iDet)) ){
245  AliQADataMaker * qadm = GetQADataMaker(iDet) ;
246  if (!qadm) continue; // This detector doesn't have any QA (for example, HLT)
247  if ( qadm->IsCycleDone() ) {
248  qadm->EndOfCycle(taskIndex) ;
249  }
250  TTree * data = NULL ;
251  AliLoader* loader = GetLoader(qadm->GetUniqueID());
252  switch (taskIndex) {
254  break ;
255  case AliQAv1::kRAWS :
256  qadm->Exec(taskIndex, fRawReader) ;
257  break ;
258  case AliQAv1::kHITS :
259  if( loader ) {
260  loader->LoadHits() ;
261  data = loader->TreeH() ;
262  if ( ! data ) {
263  AliWarning(Form(" Hit Tree not found for %s", AliQAv1::GetDetName(iDet))) ;
264  break ;
265  }
266  qadm->Exec(taskIndex, data) ;
267  }
268  break ;
269  case AliQAv1::kSDIGITS :
270  {
271 
272  TString fileName(Form("%s.SDigits.root", AliQAv1::GetDetName(iDet))) ;
273  if (gSystem->FindFile("./", fileName)) {
274  if( loader ) {
275  loader->LoadSDigits() ;
276  data = loader->TreeS() ;
277  if ( ! data ) {
278  AliWarning(Form(" SDigit Tree not found for %s", AliQAv1::GetDetName(iDet))) ;
279  break ;
280  }
281  qadm->Exec(taskIndex, data) ;
282  }
283  }
284  }
285  break;
286  case AliQAv1::kDIGITS :
287  if( loader ) {
288  loader->LoadDigits() ;
289  data = loader->TreeD() ;
290  if ( ! data ) {
291  AliWarning(Form(" Digit Tree not found for %s", AliQAv1::GetDetName(iDet))) ;
292  break ;
293  }
294  qadm->Exec(taskIndex, data) ;
295  }
296  break;
297  case AliQAv1::kDIGITSR :
298  if( loader ) {
299  loader->LoadDigits() ;
300  data = loader->TreeD() ;
301  if ( ! data ) {
302  AliWarning(Form(" Digit Tree not found for %s", AliQAv1::GetDetName(iDet))) ;
303  break ;
304  }
305  qadm->Exec(taskIndex, data) ;
306  }
307  break;
308  case AliQAv1::kRECPOINTS :
309  if( loader ) {
310  loader->LoadRecPoints() ;
311  data = loader->TreeR() ;
312  if (!data) {
313  AliWarning(Form("RecPoints not found for %s", AliQAv1::GetDetName(iDet))) ;
314  break ;
315  }
316  qadm->Exec(taskIndex, data) ;
317  }
318  break;
320  break;
322  break;
323  case AliQAv1::kESDS :
324  qadm->Exec(taskIndex, fESD) ;
325  break;
326  case AliQAv1::kNTASKINDEX :
327  break;
328  } //task switch
329  }
330  } // detector loop
331  Increment(taskIndex) ;
332  } // event loop
333  // Save QA data for all detectors
334 
335  EndOfCycle() ;
336 
337  if ( taskIndex == AliQAv1::kRAWS )
338  fRawReader->RewindEvents() ;
339 
340  return rv ;
341 }
342 
343 //_____________________________________________________________________________
345 {
346  // write output to file for all detectors
347 
349 
350  for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
351  if (IsSelected(AliQAv1::GetDetName(iDet))) {
352  AliQADataMaker * qadm = GetQADataMaker(iDet) ;
353  if (qadm)
354  qadm->EndOfCycle(taskIndex) ;
355  }
356  }
357  return kTRUE ;
358 }
359 
360 //_____________________________________________________________________________
362 {
363  // Retrieve the list of QA data for a given detector and a given task
364  TObjArray * rv = NULL ;
365  if ( !strlen(AliQAv1::GetQARefStorage()) ) {
366  AliError("No storage defined, use AliQAv1::SetQARefStorage") ;
367  return NULL ;
368  }
369  if ( ! IsDefaultStorageSet() ) {
370  TString tmp(AliQAv1::GetQARefDefaultStorage()) ;
371  tmp.Append(year) ;
372  tmp.Append("/") ;
373  Instance()->SetDefaultStorage(tmp.Data()) ;
375  }
376  TString detOCDBDir(Form("%s/%s/%s", AliQAv1::GetQAName(), AliQAv1::GetDetName((Int_t)det), AliQAv1::GetRefOCDBDirName())) ;
377  AliDebug(AliQAv1::GetQADebugLevel(), Form("Retrieving reference data from %s/%s for %s", AliQAv1::GetQARefStorage(), detOCDBDir.Data(), AliQAv1::GetTaskName(task).Data())) ;
378  AliCDBEntry* entry = QAManager()->Get(detOCDBDir.Data(), 0) ; //FIXME 0 --> Run Number
379  TList * listDetQAD = static_cast<TList *>(entry->GetObject()) ;
380  if ( listDetQAD )
381  rv = static_cast<TObjArray *>(listDetQAD->FindObject(AliQAv1::GetTaskName(task))) ;
382  return rv ;
383 }
384 
385 //_____________________________________________________________________________
386 TCanvas ** AliQAManager::GetImage(Char_t * detName)
387 {
388  // retrieves QA Image for the given detector
389  TCanvas ** rv = NULL ;
390  Int_t detIndex = AliQAv1::GetDetIndex(detName) ;
391  if ( detIndex != AliQAv1::kNULLDET) {
393  rv = qac->GetImage() ;
394  }
395  return rv ;
396 }
397 
398 //_____________________________________________________________________________
400 {
401  // get the loader for a detector
402 
403  if ( !fRunLoader || iDet == AliQAv1::kCORR || iDet == AliQAv1::kGLOBAL )
404  return NULL ;
405 
406  TString detName = AliQAv1::GetDetName(iDet) ;
407  fLoader[iDet] = fRunLoader->GetLoader(detName + "Loader");
408  if (fLoader[iDet])
409  return fLoader[iDet] ;
410 
411  // load the QA data maker object
412  TPluginManager* pluginManager = gROOT->GetPluginManager() ;
413  TString loaderName = "Ali" + detName + "Loader" ;
414 
415  AliLoader * loader = NULL ;
416  // first check if a plugin is defined for the quality assurance data maker
417  TPluginHandler* pluginHandler = pluginManager->FindHandler("AliLoader", detName) ;
418  // if not, add a plugin for it
419  if (!pluginHandler) {
420  AliDebug(AliQAv1::GetQADebugLevel(), Form("defining plugin for %s", loaderName.Data())) ;
421  TString libs = gSystem->GetLibraries() ;
422  if (libs.Contains("lib" + detName + "base") || (gSystem->Load("lib" + detName + "base") >= 0)) {
423  pluginManager->AddHandler("AliQADataMaker", detName, loaderName, detName + "loader", loaderName + "()") ;
424  } else {
425  pluginManager->AddHandler("AliLoader", detName, loaderName, detName, loaderName + "()") ;
426  }
427  pluginHandler = pluginManager->FindHandler("AliLoader", detName) ;
428  }
429  if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
430  loader = (AliLoader *) pluginHandler->ExecPlugin(0) ;
431  }
432  if (loader)
433  fLoader[iDet] = loader ;
434  return loader ;
435 }
436 
437 //_____________________________________________________________________________
438 AliQAv1 * AliQAManager::GetQA(UInt_t run, UInt_t evt)
439 {
440  // retrieves the QA object stored in a file named "Run{run}.Event{evt}_1.ESD.tag.root"
441  Char_t * fileName = Form("Run%d.Event%d_1.ESD.tag.root", run, evt) ;
442  TFile * tagFile = TFile::Open(fileName) ;
443  if ( !tagFile ) {
444  AliError(Form("File %s not found", fileName)) ;
445  return NULL ;
446  }
447  TTree * tagTree = static_cast<TTree *>(tagFile->Get("T")) ;
448  if ( !tagTree ) {
449  AliError(Form("Tree T not found in %s", fileName)) ;
450  tagFile->Close() ;
451  return NULL ;
452  }
453  AliRunTag * tag = new AliRunTag ;
454  tagTree->SetBranchAddress("AliTAG", &tag) ;
455  tagTree->GetEntry(evt) ;
456  AliQAv1 * qa = AliQAv1::Instance(tag->GetQALength(), tag->GetQAArray(), tag->GetESLength(), tag->GetEventSpecies()) ;
457  tagFile->Close() ;
458  return qa ;
459 }
460 
461 //_____________________________________________________________________________
463 {
464  // get the quality assurance data maker for a detector
465 
466  AliQADataMaker * qadm = fQADataMaker[iDet] ;
467 
468  if (qadm) {
469 
470  qadm->SetEventSpecie(fEventSpecie) ;
471  if ( qadm->GetRecoParam() )
473  qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ;
474 
475  } else if (iDet == AliQAv1::kGLOBAL && strcmp(GetMode(), AliQAv1::GetModeName(AliQAv1::kRECMODE)) == 0) { //Global QA
476 
477  qadm = new AliGlobalQADataMaker();
478  qadm->SetName(AliQAv1::GetDetName(iDet));
479  qadm->SetUniqueID(iDet);
480  fQADataMaker[iDet] = qadm;
481  qadm->SetEventSpecie(fEventSpecie) ;
482  if ( qadm->GetRecoParam() )
484  qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ;
485 
486  } else if (iDet == AliQAv1::kCORR && strcmp(GetMode(), AliQAv1::GetModeName(AliQAv1::kRECMODE)) == 0 ) { //the data maker for correlations among detectors
487  qadm = new AliCorrQADataMakerRec(fQADataMaker) ;
488  qadm->SetName(AliQAv1::GetDetName(iDet));
489  qadm->SetUniqueID(iDet);
490  fQADataMaker[iDet] = qadm;
491  qadm->SetEventSpecie(fEventSpecie) ;
492  if ( qadm->GetRecoParam() )
494  qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ;
495 
496  } else if ( iDet < AliQAv1::kGLOBAL ) {
497  TString smode(GetMode()) ;
498  if (smode.Contains(AliQAv1::GetModeName(AliQAv1::kQAMODE)))
500  // load the QA data maker object
501  TPluginManager* pluginManager = gROOT->GetPluginManager() ;
502  TString detName = AliQAv1::GetDetName(iDet) ;
503  TString qadmName = "Ali" + detName + "QADataMaker" + smode ;
504 
505  // first check if a plugin is defined for the quality assurance data maker
506  TPluginHandler* pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName) ;
507  // if not, add a plugin for it
508  if (!pluginHandler) {
509  AliDebug(AliQAv1::GetQADebugLevel(), Form("defining plugin for %s", qadmName.Data())) ;
510  TString libs = gSystem->GetLibraries() ;
511  TString temp(smode) ;
512  temp.ToLower() ;
513  if (libs.Contains("lib" + detName + smode + ".so") || (gSystem->Load("lib" + detName + temp.Data()) >= 0)) {
514  if ( iDet == AliQAv1::kMUON ) {
515  pluginManager->AddHandler("AliQADataMaker", detName, qadmName, detName + "qadm", qadmName + "(Bool_t,Bool_t)");
516  } else {
517  pluginManager->AddHandler("AliQADataMaker", detName, qadmName, detName + "qadm", qadmName + "()");
518  }
519  } else {
520  pluginManager->AddHandler("AliQADataMaker", detName, qadmName, detName, qadmName + "()");
521  }
522  pluginHandler = pluginManager->FindHandler("AliQADataMaker", detName) ;
523  }
524  if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) {
525  if ( iDet == AliQAv1::kMUON ) {
526  Bool_t mch = fActiveOnlineDetectors.Contains("MUONTRK");
527  Bool_t mtr = fActiveOnlineDetectors.Contains("MUONTRG");
528  qadm = (AliQADataMaker *) pluginHandler->ExecPlugin(2,mch,mtr);
529  }
530  else {
531  qadm = (AliQADataMaker *) pluginHandler->ExecPlugin(0);
532  }
533  }
534  if (qadm) {
535  qadm->SetName(AliQAv1::GetDetName(iDet));
536  qadm->SetUniqueID(iDet);
537  fQADataMaker[iDet] = qadm ;
538  qadm->SetEventSpecie(fEventSpecie) ;
539  if ( qadm->GetRecoParam() )
541  qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ;
542  }
543  }
544  return qadm ;
545 }
546 
547 //_____________________________________________________________________________
549 {
550  // End of cycle QADataMakers
551 
553  TCanvas fakeCanvas ;
554 
555  fakeCanvas.Print(Form("%s%s%d.%s[", AliQAv1::GetImageFileName(), GetMode(), fRunNumber, AliQAv1::GetImageFileFormat()), "ps") ;
556  for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
557  if (IsSelected(AliQAv1::GetDetName(iDet))) {
558  AliQADataMaker * qadm = GetQADataMaker(iDet) ;
559  if (!qadm)
560  continue ;
561  // skip non active detectors
562  if (detArray) {
563  AliModule* det = static_cast<AliModule*>(detArray->FindObject(AliQAv1::GetDetName(iDet))) ;
564  if (!det || !det->IsActive())
565  continue ;
566  }
568  if (qac)
569  qac->SetPrintImage(fPrintImage) ;
570  for (UInt_t taskIndex = 0; taskIndex < AliQAv1::kNTASKINDEX; taskIndex++) {
571  if ( fTasks.Contains(Form("%d", taskIndex)) )
573  }
574  qadm->Finish();
575  }
576  }
577  if (fPrintImage)
578  fakeCanvas.Print(Form("%s%s%d.%s]", AliQAv1::GetImageFileName(), GetMode(), fRunNumber, AliQAv1::GetImageFileFormat()), "ps");
579 }
580 
581 //_____________________________________________________________________________
582 void AliQAManager::EndOfCycle(TString detectors)
583 {
584  // End of cycle QADataMakers
585 
587  TCanvas fakeCanvas ;
588  if (fPrintImage)
589  fakeCanvas.Print(Form("%s%s%d.%s[", AliQAv1::GetImageFileName(), GetMode(), fRunNumber, AliQAv1::GetImageFileFormat()), "ps") ;
590  for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
591  if (IsSelected(AliQAv1::GetDetName(iDet))) {
592  AliQADataMaker * qadm = GetQADataMaker(iDet) ;
593  if (!qadm)
594  continue ;
595  // skip non active detectors
596  if (!detectors.Contains(AliQAv1::GetDetName(iDet)))
597  continue ;
599  if (qac)
600  qac->SetPrintImage(fPrintImage) ;
601  for (UInt_t taskIndex = 0; taskIndex < AliQAv1::kNTASKINDEX; taskIndex++) {
602  if ( fTasks.Contains(Form("%d", taskIndex)) )
604  }
605  qadm->Finish();
606  }
607  }
608  if (fPrintImage)
609  fakeCanvas.Print(Form("%s%s%d.%s]", AliQAv1::GetImageFileName(), GetMode(), fRunNumber, AliQAv1::GetImageFileFormat()), "ps");
610 }
611 
612 //_____________________________________________________________________________
614 {
616  if (!gSystem->AccessPathName("AliESDs.root")) { // AliESDs.root exists
617  TFile * esdFile = TFile::Open("AliESDs.root") ;
618  TTree * esdTree = static_cast<TTree *> (esdFile->Get("esdTree")) ;
619  if ( !esdTree ) {
620  AliError("esdTree not found") ;
621  } else {
622  AliESDEvent * esd = new AliESDEvent() ;
623  esd->ReadFromTree(esdTree) ;
624  esdTree->GetEntry(0) ;
625  runtype = AliRecoParam::Convert(esd->GetEventType()) ;
626  }
627  } else {
628  AliError("AliESDs.root not found") ;
629  }
630  return runtype ;
631 }
632 
633 //_____________________________________________________________________________
635 {
636  // Increments the cycle counter for all QA Data Makers
637  static AliQAv1::TASKINDEX_t currentTask = AliQAv1::kNTASKINDEX ;
638  if ( (currentTask == taskIndex) && taskIndex != AliQAv1::kNULLTASKINDEX )
639  return ;
640  else
641  currentTask = taskIndex ;
642  for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
643  if (IsSelected(AliQAv1::GetDetName(iDet))) {
644  AliQADataMaker * qadm = GetQADataMaker(iDet) ;
645  if (qadm)
646  qadm->Increment() ;
647  }
648  }
649 }
650 
651 //_____________________________________________________________________________
652 Bool_t AliQAManager::InitQA(const AliQAv1::TASKINDEX_t taskIndex, const Char_t * input )
653 {
654  // Initialize the event source and QA data makers
655 
656  fTasks += Form("%d", taskIndex) ;
657 
658  if (taskIndex == AliQAv1::kRAWS) {
659  if (!fRawReader) {
660  fRawReader = AliRawReader::Create(input);
661  }
662  if ( ! fRawReader )
663  return kFALSE ;
664  fRawReaderDelete = kTRUE ;
665  fRawReader->NextEvent() ;
666  fRunNumber = fRawReader->GetRunNumber() ;
667  SetRun(fRunNumber) ;
668  fRawReader->RewindEvents();
669  fNumberOfEvents = 999999 ;
670  if ( fMaxEvents < 0 )
672  } else if (taskIndex == AliQAv1::kESDS) {
674  if (!gSystem->AccessPathName("AliESDs.root")) { // AliESDs.root exists
675  TFile * esdFile = TFile::Open("AliESDs.root") ;
676  fESDTree = static_cast<TTree *> (esdFile->Get("esdTree")) ;
677  if ( !fESDTree ) {
678  AliError("esdTree not found") ;
679  return kFALSE ;
680  } else {
681  fESD = new AliESDEvent() ;
683  fESDTree->GetEntry(0) ;
685  fNumberOfEvents = fESDTree->GetEntries() ;
686  if ( fMaxEvents < 0 )
688  }
689  } else {
690  AliError("AliESDs.root not found") ;
691  return kFALSE ;
692  }
693  } else {
694  if ( !InitRunLoader() ) {
695  AliWarning("No Run Loader not found") ;
696  } else {
698  if ( fMaxEvents < 0 )
700  }
701  }
702 
703  // Get Detectors
704  TObjArray* detArray = NULL ;
705  if (fRunLoader) // check if RunLoader exists
706  if ( fRunLoader->GetAliRun() ) { // check if AliRun exists in gAlice.root
707  detArray = fRunLoader->GetAliRun()->Detectors() ;
709  }
710 
711  // Initialize all QA data makers for all detectors
713  if ( ! AliGeomManager::GetGeometry() )
715 
716  InitQADataMaker(fRunNumber, detArray) ; //, fCycleSame, kTRUE, detArray) ;
717  if (fPrintImage) {
718  TCanvas fakeCanvas ;
719  TStopwatch timer ;
720  timer.Start() ;
721  while (timer.CpuTime()<5) {
722  timer.Continue();
723  gSystem->ProcessEvents();
724  }
725  fakeCanvas.Print(Form("%s%s%d.%s[", AliQAv1::GetImageFileName(), GetMode(), fRunNumber, AliQAv1::GetImageFileFormat()), "ps") ;
726  }
727  return kTRUE ;
728 }
729 
730 //_____________________________________________________________________________
731 void AliQAManager::InitQADataMaker(UInt_t run, TObjArray * detArray)
732 {
733  // Initializes The QADataMaker for all active detectors and for all active tasks
734  fRunNumber = run ;
735  for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
736  if (IsSelected(AliQAv1::GetDetName(iDet))) {
737  AliQADataMaker * qadm = GetQADataMaker(iDet) ;
738  if (!qadm) {
739  AliError(Form("AliQADataMaker not found for %s", AliQAv1::GetDetName(iDet))) ;
740  fDetectorsW.ReplaceAll(AliQAv1::GetDetName(iDet), "") ;
741  } else {
742  if (fQAWriteExpert[iDet])
743  qadm->SetWriteExpert() ;
744  AliDebug(AliQAv1::GetQADebugLevel(), Form("Data Maker found for %s %d", qadm->GetName(), qadm->WriteExpert())) ;
745  // skip non active detectors
746  if (detArray) {
747  AliModule* det = static_cast<AliModule*>(detArray->FindObject(AliQAv1::GetDetName(iDet))) ;
748  if (!det || !det->IsActive())
749  continue ;
750  }
751  // Set default reco params
752  Bool_t sameCycle = kFALSE ;
753  for (UInt_t taskIndex = 0; taskIndex < AliQAv1::kNTASKINDEX; taskIndex++) {
754  if ( fTasks.Contains(Form("%d", taskIndex)) ) {
755  qadm->Init(AliQAv1::GetTaskIndex(AliQAv1::GetTaskName(taskIndex)), GetQACycles(qadm->GetUniqueID())) ;
756  qadm->StartOfCycle(AliQAv1::GetTaskIndex(AliQAv1::GetTaskName(taskIndex)), run, sameCycle) ;
757  sameCycle = kTRUE ;
758  }
759  }
760  }
761  }
762  }
763 }
764 
765 
766 //_____________________________________________________________________________
768 {
769  // get or create the run loader
770  if (fRunLoader) {
771  fCycleSame = kTRUE ;
772  } else {
773  if (!gSystem->AccessPathName(fGAliceFileName.Data())) { // galice.root exists
774  // load all base libraries to get the loader classes
775  TString libs = gSystem->GetLibraries() ;
776  for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
777  if (!IsSelected(AliQAv1::GetDetName(iDet)))
778  continue ;
779  TString detName = AliQAv1::GetDetName(iDet) ;
780  if (detName == "HLT")
781  continue;
782  if (libs.Contains("lib" + detName + "base.so"))
783  continue;
784  gSystem->Load("lib" + detName + "base");
785  }
787  if (!fRunLoader) {
788  AliError(Form("no run loader found in file %s", fGAliceFileName.Data()));
789  return kFALSE;
790  }
791  fRunLoader->CdGAFile();
792  if (fRunLoader->LoadgAlice() == 0) {
794  }
795 
796  if (!gAlice) {
797  AliError(Form("no gAlice object found in file %s", fGAliceFileName.Data()));
798  return kFALSE;
799  }
800 
801  } else { // galice.root does not exist
802  AliError(Form("the file %s does not exist", fGAliceFileName.Data()));
803  return kFALSE;
804  }
805  }
806 
807  if (!fRunNumber) {
810  }
811  return kTRUE;
812 }
813 
814 //_____________________________________________________________________________
815 Bool_t AliQAManager::IsSelected(const Char_t * det)
816 {
817  // check whether detName is contained in detectors
818  // if yes, it is removed from detectors
819 
820  Bool_t rv = kFALSE;
821  const TString detName(det) ;
822  // always activates Correlation
823 // if ( detName.Contains(AliQAv1::GetDetName(AliQAv1::kCORR)) || detName.Contains(AliQAv1::GetDetName(AliQAv1::kGLOBAL))) {
824 // rv = kTRUE ;
825 // } else {
826  // check if all detectors are selected
827  if (fDetectors.Contains("ALL")) {
828  fDetectors = "ALL";
829  rv = kTRUE;
830  } else if ((fDetectors.CompareTo(detName) == 0) ||
831  fDetectors.BeginsWith(detName+" ") ||
832  fDetectors.EndsWith(" "+detName) ||
833  fDetectors.Contains(" "+detName+" ")) {
834  rv = kTRUE;
835  }
836 // }
837  return rv ;
838 }
839 
840 //_____________________________________________________________________________
841 Bool_t AliQAManager::Merge(Int_t runNumber, const char *fileName) const
842 {
843  // Merge data from all detectors from a given run in one single file
844  // Merge the QA results from all the data chunks in one run
845  // The 'fileName' is name of the output file with merged QA data
846  if ( runNumber == -1)
847  runNumber = fRunNumber ;
848  Bool_t rv = MergeData(runNumber,fileName) ;
849  //rv *= MergeResults(runNumber) ; // not needed for the time being
850  return rv ;
851 }
852 
853 //______________________________________________________________________
854 Bool_t AliQAManager::MergeXML(const Char_t * collectionFile, const Char_t * subFile, const Char_t * outFile)
855 {
856  // merges files listed in a xml collection
857  // usage Merge(collection, outputFile))
858  // collection: is a xml collection
859 
860  Bool_t rv = kFALSE ;
861 
862  if ( strstr(collectionFile, ".xml") == 0 ) {
863  AliError("Input collection file must be an \".xml\" file\n") ;
864  return kFALSE ;
865  }
866 
867  if ( !gGrid )
868  TGrid::Connect("alien://");
869  if ( !gGrid )
870  return kFALSE ;
871 
872  // Open the file collection
873  AliInfoClass(Form("*** Create Collection ***\n*** Wk-Dir = |%s| \n*** Coll = |%s| \n",gSystem->WorkingDirectory(), collectionFile));
874 
875  TGridCollection * collection = (TGridCollection*)gROOT->ProcessLine(Form("TAlienCollection::Open(\"%s\")",collectionFile));
876  TGridResult* result = collection->GetGridResult("", 0, 0);
877 
878  Int_t index = 0 ;
879  const Char_t * turl ;
880  TFileMerger merger(kFALSE) ;
881  if (!outFile) {
882  TString tempo(collectionFile) ;
883  if ( subFile)
884  tempo.ReplaceAll(".xml", subFile) ;
885  else
886  tempo.ReplaceAll(".xml", "_Merged.root") ;
887  outFile = tempo.Data() ;
888  }
889  merger.OutputFile(outFile) ;
890 
891  while ( (turl = result->GetKey(index, "turl")) ) {
892  Char_t * file ;
893  if ( subFile )
894  file = Form("%s#%s", turl, subFile) ;
895  else
896  file = Form("%s", turl) ;
897 
898  AliDebug(AliQAv1::GetQADebugLevel(), Form("%s\n", file)) ;
899  merger.AddFile(file) ;
900  index++ ;
901  }
902 
903  if (index)
904  merger.Merge() ;
905 
906  AliDebug(AliQAv1::GetQADebugLevel(), Form("Files merged into %s\n", outFile)) ;
907 
908  rv = kFALSE;
909  return rv ;
910 }
911 
912 //_____________________________________________________________________________
914 {
915  // Custom Merge of QA data from all detectors for all runs in one single file
916  // search all the run numbers
917  // search all the run numbers
918  gROOT->ProcessLine(".! ls *QA*.root > QAtempo.txt") ;
919  TString theQAfile ;
920  FILE * theQAfiles = fopen("QAtempo.txt", "r") ;
921  Int_t index = 0 ;
922  TList srunList ;
923  TIter nextRun(&srunList) ;
924  TObjString * srun = NULL ;
925  Int_t loRun = 999999999 ;
926  Int_t hiRun = 0 ;
927  while ( theQAfile.Gets(theQAfiles) ) {
928  Bool_t runExist = kFALSE ;
929  TString srunNew(theQAfile(theQAfile.Index("QA.")+3, theQAfile.Index(".root")-(theQAfile.Index("QA.")+3))) ;
930  Int_t cuRun = srunNew.Atoi() ;
931  if (cuRun < loRun)
932  loRun = cuRun ;
933  if (cuRun > hiRun)
934  hiRun = cuRun ;
935  while ( (srun = static_cast<TObjString *> (nextRun())) ) {
936  if ( cuRun == (srun->String()).Atoi() ) {
937  runExist = kTRUE ;
938  break ;
939  }
940  }
941  nextRun.Reset() ;
942  if ( ! runExist )
943  srunList.Add(new TObjString(srunNew.Data()));
944  }
945  nextRun.Reset() ;
946  Int_t runNumber = 0 ;
947  TFile mergedFile(Form("Merged.%s.Data.root", AliQAv1::GetQADataFileName()), "RECREATE") ;
948  TH1I * hisRun = new TH1I("hLMR", "List of merged runs", hiRun-loRun+10, loRun, hiRun+10) ;
949  // create the structure into the merged file
950  for (Int_t iDet = 0; iDet < AliQAv1::kNDET ; iDet++) {
951  TDirectory * detDir = mergedFile.mkdir(AliQAv1::GetDetName(iDet)) ;
952  for (Int_t taskIndex = 0; taskIndex < AliQAv1::kNTASKINDEX; taskIndex++) {
953  detDir->cd() ;
954  TDirectory * taskDir = gDirectory->mkdir(AliQAv1::GetTaskName(taskIndex)) ;
955  for (Int_t es = 0 ; es < AliRecoParam::kNSpecies ; es++) {
956  taskDir->cd() ;
957  TDirectory * esDir = gDirectory->mkdir(AliRecoParam::GetEventSpecieName(es)) ;
958  esDir->cd() ;
959  gDirectory->mkdir(AliQAv1::GetExpert()) ;
960  }
961  }
962  }
963  while ( (srun = static_cast<TObjString *> (nextRun())) ) {
964  runNumber = (srun->String()).Atoi() ;
965  hisRun->Fill(runNumber) ;
966  AliDebug(AliQAv1::GetQADebugLevel(), Form("Merging run number %d", runNumber)) ;
967  // search all QA files for runNumber in the current directory
968  Char_t * fileList[AliQAv1::kNDET] ;
969  index = 0 ;
970  for (Int_t iDet = 0; iDet < AliQAv1::kNDET ; iDet++) {
971  Char_t * file = gSystem->Which(gSystem->WorkingDirectory(), Form("%s.%s.%d.root", AliQAv1::GetDetName(iDet), AliQAv1::GetQADataFileName(), runNumber));
972  if (file)
973  fileList[index++] = file ;
974  }
975  if ( index == 0 ) {
976  AliError("No QA data file found\n") ;
977  return ;
978  }
979  for ( Int_t i = 0 ; i < index ; i++) {
980  TFile * inFile = TFile::Open(fileList[i]) ;
981  TList * listOfKeys =inFile->GetListOfKeys() ;
982  TIter nextkey(listOfKeys) ;
983  TObject * obj1 ;
984  TString dirName("") ;
985  while ( (obj1 = nextkey()) ) {
986  TDirectory * directoryDet = inFile->GetDirectory(obj1->GetName()) ;
987  if ( directoryDet ) {
988  AliDebug(AliQAv1::GetQADebugLevel(), Form("%s dir = %s", inFile->GetName(), directoryDet->GetName())) ;
989  dirName += Form("%s/", directoryDet->GetName() ) ;
990  directoryDet->cd() ;
991  TList * listOfTasks = directoryDet->GetListOfKeys() ;
992  TIter nextTask(listOfTasks) ;
993  TObject * obj2 ;
994  while ( (obj2 = nextTask()) ) {
995  TDirectory * directoryTask = directoryDet->GetDirectory(obj2->GetName()) ;
996  if ( directoryTask ) {
997  dirName += Form("%s", obj2->GetName()) ;
998  AliDebug(AliQAv1::GetQADebugLevel(), Form("%s", dirName.Data())) ;
999  directoryTask->cd() ;
1000  TList * listOfEventSpecie = directoryTask->GetListOfKeys() ;
1001  TIter nextEventSpecie(listOfEventSpecie) ;
1002  TObject * obj3 ;
1003  while ( (obj3 = nextEventSpecie()) ) {
1004  TDirectory * directoryEventSpecie = directoryTask->GetDirectory(obj3->GetName()) ;
1005  if ( directoryEventSpecie ) {
1006  dirName += Form("/%s/", obj3->GetName()) ;
1007  AliDebug(AliQAv1::GetQADebugLevel(), Form("%s\n", dirName.Data())) ;
1008  directoryEventSpecie->cd() ;
1009  // histograms are here
1010  TDirectory * mergedDirectory = mergedFile.GetDirectory(dirName.Data()) ;
1011  TList * listOfData = directoryEventSpecie->GetListOfKeys() ;
1012  TIter nextData(listOfData) ;
1013  TKey * key ;
1014  while ( (key = static_cast<TKey *>(nextData())) ) {
1015  TString className(key->GetClassName()) ;
1016  if ( className.Contains("TH") || className.Contains("TProfile") ) {
1017  TH1 * histIn = static_cast<TH1*> (key->ReadObj()) ;
1018  TH1 * histOu = static_cast<TH1*> (mergedDirectory->FindObjectAny(histIn->GetName())) ;
1019  AliDebug(AliQAv1::GetQADebugLevel(), Form("%s %p %p\n", key->GetName(), histIn, histOu)) ;
1020  mergedDirectory->cd() ;
1021  if ( ! histOu ) {
1022  histIn->Write() ;
1023  } else {
1024  histOu->Add(histIn) ;
1025  histOu->Write(histOu->GetName(), kOverwrite) ;
1026  }
1027  }
1028  else if ( className.Contains("TDirectoryFile") ) {
1029  TDirectory * dirExpert = directoryEventSpecie->GetDirectory(key->GetName()) ;
1030  dirExpert->cd() ;
1031  TDirectory * mergedDirectoryExpert = mergedDirectory->GetDirectory(dirExpert->GetName()) ;
1032  TList * listOfExpertData = dirExpert->GetListOfKeys() ;
1033  TIter nextExpertData(listOfExpertData) ;
1034  TKey * keykey ;
1035  while ( (keykey = static_cast<TKey *>(nextExpertData())) ) {
1036  TString classNameExpert(keykey->GetClassName()) ;
1037  if (classNameExpert.Contains("TH")) {
1038  TH1 * histInExpert = static_cast<TH1*> (keykey->ReadObj()) ;
1039  TH1 * histOuExpert = static_cast<TH1*> (mergedDirectory->FindObjectAny(histInExpert->GetName())) ;
1040  mergedDirectoryExpert->cd() ;
1041  if ( ! histOuExpert ) {
1042  histInExpert->Write() ;
1043  } else {
1044  histOuExpert->Add(histInExpert) ;
1045  histOuExpert->Write(histOuExpert->GetName(), kOverwrite) ;
1046  }
1047  }
1048  }
1049  } else {
1050  AliError(Form("No merge done for this object %s in %s", key->GetName(), dirName.Data())) ;
1051  }
1052  }
1053  dirName.ReplaceAll(Form("/%s/",obj3->GetName()), "") ;
1054  }
1055  }
1056  dirName.ReplaceAll(obj2->GetName(), "") ;
1057  }
1058  }
1059  }
1060  }
1061  inFile->Close() ;
1062  }
1063  }
1064  mergedFile.cd() ;
1065  hisRun->Write() ;
1066  mergedFile.Close() ;
1067  srunList.Delete() ;
1068 }
1069 
1070 //_____________________________________________________________________________
1071 Bool_t AliQAManager::MergeData(const Int_t runNumber, const char *fileName) const
1072 {
1073  // Merge QA data from all detectors for a given run in one single file
1074 
1075  TFileMerger merger(kFALSE) ;
1076  TString outFileName = fileName;
1077  if (outFileName.IsNull()) outFileName.Form("Merged.%s.Data.root",AliQAv1::GetQADataFileName());
1078  merger.OutputFile(outFileName.Data()) ;
1079  for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
1080  Char_t * file = gSystem->Which(gSystem->WorkingDirectory(), Form("%s.%s.%d.root", AliQAv1::GetDetName(iDet), AliQAv1::GetQADataFileName(), runNumber));
1081  if (file)
1082  merger.AddFile(file);
1083  delete[] file;
1084  }
1085  merger.Merge() ;
1086  return kTRUE ;
1087 }
1088 
1089 //_____________________________________________________________________________
1090 Bool_t AliQAManager::MergeResults(const Int_t runNumber) const
1091 {
1092  // Merge the QA result from all the data chunks in a run
1093  // to be revised whwn it will be used (see MergeData)
1094  TString cmd ;
1095  cmd = Form(".! ls %s*.root > tempo.txt", AliQAv1::GetQADataFileName()) ;
1096  gROOT->ProcessLine(cmd.Data()) ;
1097  ifstream in("tempo.txt") ;
1098  const Int_t chunkMax = 100 ;
1099  TString fileList[chunkMax] ;
1100 
1101  Int_t index = 0 ;
1102  while ( 1 ) {
1103  TString file ;
1104  in >> fileList[index] ;
1105  if ( !in.good() )
1106  break ;
1107  AliDebug(AliQAv1::GetQADebugLevel(), Form("index = %d file = %s", index, (fileList[index].Data()))) ;
1108  index++ ;
1109  }
1110 
1111  if ( index == 0 ) {
1112  AliError("No QA Result File found") ;
1113  return kFALSE ;
1114  }
1115 
1116  TFileMerger merger ;
1117  TString outFileName ;
1118  if (runNumber != -1)
1119  outFileName = Form("Merged.%s.Result.%d.root",AliQAv1::GetQADataFileName(),runNumber);
1120  else
1121  outFileName = Form("Merged.%s.Result.root",AliQAv1::GetQADataFileName());
1122  merger.OutputFile(outFileName.Data()) ;
1123  for (Int_t ifile = 0 ; ifile < index ; ifile++) {
1124  TString file = fileList[ifile] ;
1125  merger.AddFile(file) ;
1126  }
1127  merger.Merge() ;
1128 
1129  return kTRUE ;
1130 }
1131 
1132 //_____________________________________________________________________________
1133 void AliQAManager::Reset(const Bool_t sameCycle)
1134 {
1135  // Reset the default data members
1136 
1137  for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
1138  if (IsSelected(AliQAv1::GetDetName(iDet))) {
1139  AliQADataMaker * qadm = GetQADataMaker(iDet);
1140  if (qadm)
1141  qadm->Reset();
1142  }
1143  }
1144  if (fRawReaderDelete) {
1145  delete fRawReader ;
1146  fRawReader = NULL ;
1147  }
1148 
1149  fCycleSame = sameCycle ;
1150  fESD = NULL ;
1151  fESDTree = NULL ;
1152  //fFirst = kTRUE ;
1153  fNumberOfEvents = 999999 ;
1154 }
1155 
1156 //_____________________________________________________________________________
1158 {
1159  //calls ResetDetector of specified or all detectors
1160  UInt_t iDet = 0 ;
1161  UInt_t iDetMax = fgkNDetectors ;
1162  if ( det != AliQAv1::kNULLDET ) {
1163  iDet = det ;
1164  iDetMax = det+1 ;
1165  }
1166 
1167  for (iDet = 0; iDet < iDetMax ; iDet++) {
1168  if (IsSelected(AliQAv1::GetDetName(iDet))) {
1169  AliQADataMaker * qadm = GetQADataMaker(iDet);
1170  qadm->ResetDetector(task);
1171  }
1172  }
1173 }
1174 
1175 //_____________________________________________________________________________
1176 AliQAManager * AliQAManager::QAManager(AliQAv1::MODE_t mode, TMap *entryCache, Int_t run)
1177 {
1178  // returns AliQAManager instance (singleton)
1179 
1180  if (!fgQAInstance) {
1181  if ( (mode != AliQAv1::kSIMMODE) && (mode != AliQAv1::kRECMODE) && (mode != AliQAv1::kQAMODE) ) {
1182  AliWarningClass("You must specify kSIMMODE or kRECMODE or kQAMODE") ;
1183  return NULL ;
1184  }
1185  fgQAInstance = new AliQAManager(mode) ;
1186  if (!entryCache)
1187  fgQAInstance->Init();
1188  else
1189  fgQAInstance->InitFromCache(entryCache,run);
1190  }
1191  return fgQAInstance;
1192 }
1193 
1194 //_____________________________________________________________________________
1196 {
1197  // returns AliQAManager instance (singleton)
1198  return QAManager(AliQAv1::Mode(task)) ;
1199 }
1200 
1201 //_____________________________________________________________________________
1202 TString AliQAManager::Run(const Char_t * detectors, AliRawReader * rawReader, const Bool_t sameCycle)
1203 {
1204  //Runs all the QA data Maker for Raws only
1205 
1206  fCycleSame = sameCycle ;
1207  fRawReader = rawReader ;
1208  fDetectors = detectors ;
1209  fDetectorsW = detectors ;
1210 
1212 
1213  if ( man->GetRun() == -1 ) {// check if run number not set previously and set it from raw data
1214  rawReader->NextEvent() ;
1215  man->SetRun(fRawReader->GetRunNumber()) ;
1216  rawReader->RewindEvents() ;
1217  }
1218 
1219  if (!fCycleSame)
1220  if ( !InitQA(AliQAv1::kRAWS) )
1221  return "" ;
1222  fRawReaderDelete = kFALSE ;
1223 
1224  DoIt(AliQAv1::kRAWS) ;
1225  return fDetectorsW ;
1226 }
1227 
1228 //_____________________________________________________________________________
1229 TString AliQAManager::Run(const Char_t * detectors, const Char_t * fileName, const Bool_t sameCycle)
1230 {
1231  //Runs all the QA data Maker for Raws only
1232 
1233  fCycleSame = sameCycle ;
1234  fDetectors = detectors ;
1235  fDetectorsW = detectors ;
1236 
1238  if ( man->GetRun() == -1 ) { // check if run number not set previously and set it from AliRun
1239  AliRunLoader * rl = AliRunLoader::Open("galice.root") ;
1240  if ( ! rl ) {
1241  AliFatal("galice.root file not found in current directory") ;
1242  } else {
1243  rl->CdGAFile() ;
1244  rl->LoadgAlice() ;
1245  if ( ! rl->GetAliRun() ) {
1246  AliFatal("AliRun not found in galice.root") ;
1247  } else {
1248  rl->LoadHeader() ;
1249  man->SetRun(rl->GetHeader()->GetRun());
1250  }
1251  }
1252  }
1253 
1254  if (!fCycleSame)
1255  if ( !InitQA(AliQAv1::kRAWS, fileName) )
1256  return "" ;
1257 
1258  DoIt(AliQAv1::kRAWS) ;
1259  return fDetectorsW ;
1260 }
1261 
1262 //_____________________________________________________________________________
1263 TString AliQAManager::Run(const Char_t * detectors, const AliQAv1::TASKINDEX_t taskIndex, Bool_t const sameCycle, const Char_t * fileName )
1264 {
1265  // Runs all the QA data Maker for every detector
1266 
1267  fCycleSame = sameCycle ;
1268  fDetectors = detectors ;
1269  fDetectorsW = detectors ;
1270 
1272  if ( man->GetRun() == -1 ) { // check if run number not set previously and set it from AliRun
1273  AliRunLoader * rl = AliRunLoader::Open("galice.root") ;
1274  if ( ! rl ) {
1275  AliFatal("galice.root file not found in current directory") ;
1276  } else {
1277  rl->CdGAFile() ;
1278  rl->LoadgAlice() ;
1279  if ( ! rl->GetAliRun() ) {
1280  AliDebug(AliQAv1::GetQADebugLevel(), "AliRun not found in galice.root") ;
1281  } else {
1282  rl->LoadHeader() ;
1283  man->SetRun(rl->GetHeader()->GetRun()) ;
1284  }
1285  }
1286  }
1287  if ( taskIndex == AliQAv1::kNULLTASKINDEX) {
1288  for (UInt_t task = 0; task < AliQAv1::kNTASKINDEX; task++) {
1289  if ( fTasks.Contains(Form("%d", task)) ) {
1290  if (!fCycleSame)
1291  if ( !InitQA(AliQAv1::GetTaskIndex(AliQAv1::GetTaskName(task)), fileName) )
1292  return "" ;
1294  }
1295  }
1296  } else {
1297  if (! fCycleSame )
1298  if ( !InitQA(taskIndex, fileName) )
1299  return "" ;
1300  DoIt(taskIndex) ;
1301  }
1302  return fDetectorsW ;
1303 }
1304 
1305 //_____________________________________________________________________________
1306 void AliQAManager::RunOneEvent(AliRawReader * rawReader)
1307 {
1308  //Runs all the QA data Maker for Raws only and on one event only (event loop done by calling method)
1309 
1310  if ( ! rawReader )
1311  return ;
1312  if (fTasks.Contains(Form("%d", AliQAv1::kRAWS))){
1313  TString detList ;
1314  if ( GetEventInfo())
1315  detList = GetEventInfo()->GetTriggerCluster() ;
1316  for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
1317  if (!IsSelected(AliQAv1::GetDetName(iDet)) || (!detList.IsNull() && !detList.Contains(AliQAv1::GetDetName(iDet))))
1318  continue;
1319  AliQADataMaker *qadm = GetQADataMaker(iDet);
1320  if (!qadm)
1321  continue;
1322  if ( qadm->IsCycleDone() ) {
1323  qadm->EndOfCycle() ;
1324  }
1325  qadm->SetEventSpecie(fEventSpecie) ;
1326  if ( qadm->GetRecoParam() )
1328  qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ;
1329  qadm->Exec(AliQAv1::kRAWS, rawReader) ;
1330  }
1331  }
1332 }
1333 
1334 //_____________________________________________________________________________
1336 {
1337  //Runs all the QA data Maker for ESDs only and on one event only (event loop done by calling method)
1338 
1339  if (fTasks.Contains(Form("%d", AliQAv1::kESDS))) {
1340  TString detList ;
1341  if ( GetEventInfo())
1342  detList = GetEventInfo()->GetTriggerCluster() ;
1343  for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
1344  if (!IsSelected(AliQAv1::GetDetName(iDet)) || (!detList.IsNull() && !detList.Contains(AliQAv1::GetDetName(iDet))))
1345  continue;
1346  AliQADataMaker *qadm = GetQADataMaker(iDet);
1347  if (!qadm)
1348  continue;
1349  qadm->SetEventSpecie(fEventSpecie) ;
1350  if ( qadm->GetRecoParam() )
1352  qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ;
1353  if ( qadm->IsCycleDone() ) {
1354  qadm->EndOfCycle() ;
1355  }
1356  if (iDet == AliQAv1::kHLT) {
1357  TObjArray esdarray;
1358  esdarray.Add(esd);
1359  if (hltesd) esdarray.Add(hltesd);
1360  qadm->Exec(AliQAv1::kESDS, &esdarray);
1361  } else {
1362  qadm->Exec(AliQAv1::kESDS, esd) ;
1363  }
1364  }
1365  }
1366 }
1367 
1368 //_____________________________________________________________________________
1370 {
1371  // Runs all the QA data Maker for ESDs only and on one event only (event loop done by calling method)
1372 
1373  TString detList ;
1374  if ( GetEventInfo())
1375  detList = GetEventInfo()->GetTriggerCluster() ;
1376  if (!detList.IsNull() && !detList.Contains(AliQAv1::GetDetName(det)))
1377  return ;
1378 
1379  TString test(tree->GetName()) ;
1380  if (fTasks.Contains(Form("%d", AliQAv1::kRECPOINTS))) {
1381  if (IsSelected(AliQAv1::GetDetName(det))) {
1382  AliQADataMaker *qadm = GetQADataMaker(det);
1383  if (qadm) {
1384  qadm->SetEventSpecie(fEventSpecie) ;
1385  if ( qadm->GetRecoParam() ) {
1387  qadm->SetEventSpecie(qadm->GetRecoParam()->GetEventSpecie()) ;
1388  else
1389  AliError(Form("%d defined by %s is not an event specie", qadm->GetRecoParam()->GetEventSpecie(), qadm->GetName())) ;
1390  }
1391  if ( qadm->IsCycleDone() ) {
1392  qadm->EndOfCycle() ;
1393  }
1394  if (test.Contains("TreeD")) {
1395  qadm->Exec(AliQAv1::kDIGITSR, tree) ;
1396  } else if (test.Contains("TreeR")) {
1397  qadm->Exec(AliQAv1::kRECPOINTS, tree) ;
1398  }
1399  }
1400  }
1401  }
1402 }
1403 
1404 //_____________________________________________________________________________
1405 Bool_t AliQAManager::Save2OCDB(const Int_t runNumber, AliRecoParam::EventSpecie_t es, const Char_t * year, const Char_t * detectors) const
1406 {
1407  // take the locasl QA data merge into a single file and save in OCDB
1408  Bool_t rv = kTRUE ;
1409  TString tmp(AliQAv1::GetQARefStorage()) ;
1410  if ( tmp.IsNull() ) {
1411  AliError("No storage defined, use AliQAv1::SetQARefStorage") ;
1412  return kFALSE ;
1413  }
1414  if ( !(tmp.Contains(AliQAv1::GetLabLocalOCDB()) || tmp.Contains(AliQAv1::GetLabAliEnOCDB())) ) {
1415  AliError(Form("%s is a wrong storage, use %s or %s", AliQAv1::GetQARefStorage(), AliQAv1::GetLabLocalOCDB().Data(), AliQAv1::GetLabAliEnOCDB().Data())) ;
1416  return kFALSE ;
1417  }
1418  TString sdet(detectors) ;
1419  sdet.ToUpper() ;
1420  TFile * inputFile ;
1421  if ( sdet.Contains("ALL") ) {
1422  rv = Merge(runNumber) ;
1423  if ( ! rv )
1424  return kFALSE ;
1425  TString inputFileName(Form("Merged.%s.Data.%d.root", AliQAv1::GetQADataFileName(), runNumber)) ;
1426  inputFile = TFile::Open(inputFileName.Data()) ;
1427  rv = SaveIt2OCDB(runNumber, inputFile, year, es) ;
1428  } else {
1429  for (Int_t index = 0; index < AliQAv1::kNDET; index++) {
1430  if (sdet.Contains(AliQAv1::GetDetName(index))) {
1431  TString inputFileName(Form("%s.%s.%d.root", AliQAv1::GetDetName(index), AliQAv1::GetQADataFileName(), runNumber)) ;
1432  inputFile = TFile::Open(inputFileName.Data()) ;
1433  rv *= SaveIt2OCDB(runNumber, inputFile, year, es) ;
1434  }
1435  }
1436  }
1437  return rv ;
1438 }
1439 
1440 //_____________________________________________________________________________
1441 Bool_t AliQAManager::SaveIt2OCDB(const Int_t runNumber, TFile * inputFile, const Char_t * year, AliRecoParam::EventSpecie_t es) const
1442 {
1443  // reads the TH1 from file and adds it to appropriate list before saving to OCDB
1444  Bool_t rv = kTRUE ;
1445  AliDebug(AliQAv1::GetQADebugLevel(), Form("Saving TH1s in %s to %s", inputFile->GetName(), AliQAv1::GetQARefStorage())) ;
1446  if ( ! IsDefaultStorageSet() ) {
1447  TString tmp( AliQAv1::GetQARefStorage() ) ;
1448  if ( tmp.Contains(AliQAv1::GetLabLocalOCDB()) )
1450  else {
1451  TString tmp1(AliQAv1::GetQARefDefaultStorage()) ;
1452  tmp1.Append(year) ;
1453  tmp1.Append("?user=alidaq") ;
1454  Instance()->SetDefaultStorage(tmp1.Data()) ;
1455  }
1456  }
1458  if(GetRun() < 0)
1459  Instance()->SetRun(runNumber);
1460 
1461  AliCDBMetaData mdr ;
1462  mdr.SetResponsible("yves schutz");
1463 
1464  for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++) {
1465  TDirectory * detDir = inputFile->GetDirectory(AliQAv1::GetDetName(detIndex)) ;
1466  if ( detDir ) {
1467  AliDebug(AliQAv1::GetQADebugLevel(), Form("Entering %s", detDir->GetName())) ;
1469  TString detOCDBDir(Form("%s/%s/%s", AliQAv1::GetDetName(detIndex), AliQAv1::GetRefOCDBDirName(), AliQAv1::GetRefDataDirName())) ;
1470  AliCDBId idr(detOCDBDir.Data(), runNumber, AliCDBRunRange::Infinity()) ;
1471  TList * listDetQAD = new TList() ;
1472  TString listName(Form("%s QA data Reference", AliQAv1::GetDetName(detIndex))) ;
1473  mdr.SetComment(Form("%s QA stuff", AliQAv1::GetDetName(detIndex)));
1474  listDetQAD->SetName(listName) ;
1475  TList * taskList = detDir->GetListOfKeys() ;
1476  TIter nextTask(taskList) ;
1477  TKey * taskKey ;
1478  while ( (taskKey = static_cast<TKey*>(nextTask())) ) {
1479  TDirectory * taskDir = detDir->GetDirectory(taskKey->GetName()) ;
1480  TDirectory * esDir = taskDir->GetDirectory(AliRecoParam::GetEventSpecieName(es)) ;
1481  AliDebug(AliQAv1::GetQADebugLevel(), Form("Saving %s", esDir->GetName())) ;
1482  TObjArray * listTaskQAD = new TObjArray(100) ;
1483  listTaskQAD->SetName(Form("%s/%s", taskKey->GetName(), AliRecoParam::GetEventSpecieName(es))) ;
1484  listDetQAD->Add(listTaskQAD) ;
1485  TList * histList = esDir->GetListOfKeys() ;
1486  TIter nextHist(histList) ;
1487  TKey * histKey ;
1488  while ( (histKey = static_cast<TKey*>(nextHist())) ) {
1489  TObject * odata = esDir->Get(histKey->GetName()) ;
1490  if ( !odata ) {
1491  AliError(Form("%s in %s/%s returns a NULL pointer !!", histKey->GetName(), detDir->GetName(), taskDir->GetName())) ;
1492  } else {
1493  if ( AliQAv1::GetExpert() == histKey->GetName() ) {
1494  TDirectory * expertDir = esDir->GetDirectory(histKey->GetName()) ;
1495  TList * expertHistList = expertDir->GetListOfKeys() ;
1496  TIter nextExpertHist(expertHistList) ;
1497  TKey * expertHistKey ;
1498  while ( (expertHistKey = static_cast<TKey*>(nextExpertHist())) ) {
1499  TObject * expertOdata = expertDir->Get(expertHistKey->GetName()) ;
1500  if ( !expertOdata ) {
1501  AliError(Form("%s in %s/%s/Expert returns a NULL pointer !!", expertHistKey->GetName(), detDir->GetName(), taskDir->GetName())) ;
1502  } else {
1503  AliDebug(AliQAv1::GetQADebugLevel(), Form("Adding %s", expertHistKey->GetName())) ;
1504  if ( expertOdata->IsA()->InheritsFrom("TH1") ) {
1505  AliDebug(AliQAv1::GetQADebugLevel(), Form("Adding %s", expertHistKey->GetName())) ;
1506  TH1 * hExpertdata = static_cast<TH1*>(expertOdata) ;
1507  listTaskQAD->Add(hExpertdata) ;
1508  }
1509  }
1510  }
1511  }
1512  AliDebug(AliQAv1::GetQADebugLevel(), Form("Adding %s", histKey->GetName())) ;
1513  if ( odata->IsA()->InheritsFrom("TH1") ) {
1514  AliDebug(AliQAv1::GetQADebugLevel(), Form("Adding %s", histKey->GetName())) ;
1515  TH1 * hdata = static_cast<TH1*>(odata) ;
1516  listTaskQAD->Add(hdata) ;
1517  }
1518  }
1519  }
1520  }
1521  Instance()->Put(listDetQAD, idr, &mdr) ;
1522  }
1523  }
1524  return rv ;
1525 }
1526 
1527 //_____________________________________________________________________________
1528 
1530 {
1531  // set the external parameters list for the detector checkers
1533  qac->SetExternParamlist(parameterList) ;
1534  qac->PrintExternParam() ;
1535 }
1536 
1537 //_____________________________________________________________________________
1539 {
1540  // set the current event specie and inform AliQAv1 that this event specie has been encountered
1541  fEventSpecie = es ;
1543 }
1544 
1545 //_____________________________________________________________________________
1546 void AliQAManager::SetRecoParam(const Int_t det, const AliDetectorRecoParam *par)
1547 {
1548  // Set custom reconstruction parameters for a given detector
1549  // Single set of parameters for all the events
1550  GetQADataMaker(det)->SetRecoParam(par) ;
1551 }
1552 
1553 //_____________________________________________________________________________
1555 {
1556  // enable the writing of QA expert data
1557  for (UInt_t iDet = 0; iDet < fgkNDetectors; iDet++) {
1558  if (IsSelected(AliQAv1::GetDetName(iDet)))
1559  fQAWriteExpert[iDet] = kTRUE ;
1560  }
1561 }
1562 
1563 //_____________________________________________________________________________
1565  // delete AliQAManager instance and
1566  // all associated objects
1567 
1568  if (fgQAInstance) {
1569  delete fgQAInstance ;
1570  fgQAInstance = NULL ;
1571  }
1572 }
1573 
1574 //_____________________________________________________________________________
1576  // Show the result of the QA checking
1577  // for all detectors
1578  for ( Int_t detIndex = 0 ; detIndex < AliQAv1::kNDET ; detIndex++)
1579  if ( IsSelected(AliQAv1::GetDetName(detIndex)) )
1581 }
static const char * GetEventSpecieName(EventSpecie_t es)
static AliQAManager * fgQAInstance
Definition: AliQAManager.h:105
AliQAv1 * GetQA(UInt_t run, UInt_t evt)
Int_t LoadgAlice()
TString fDetectorsW
list of active detectors
Definition: AliQAManager.h:109
Bool_t fRawReaderDelete
current raw reader object
Definition: AliQAManager.h:121
TFile * Open(const char *filename, Long64_t &nevents)
AliQAManager & operator=(const AliQAManager &qas)
TString fGAliceFileName
info on the current event
Definition: AliQAManager.h:113
static AliQAManager * QAManager(AliQAv1::MODE_t=AliQAv1::kNULLMODE, TMap *entryCache=NULL, Int_t run=-1)
const Char_t * GetMode()
Definition: AliQAManager.h:48
Int_t fQACycles[fgkNDetectors]
array of QA data maker objects
Definition: AliQAManager.h:127
Int_t GetRun() const
void Finish() const
virtual Int_t GetRun() const
Definition: AliHeader.h:35
void Increment(const AliQAv1::TASKINDEX_t taskIndex=AliQAv1::kNULLTASKINDEX)
Long64_t fMaxEvents
first event to process
Definition: AliQAManager.h:115
Int_t year
year for detector configuration
Definition: Config.C:96
Long64_t fNumberOfEvents
sim or rec
Definition: AliQAManager.h:117
#define TObjArray
Int_t GetQALength() const
Definition: AliRunTag.h:117
void SetCheckerExternParam(AliQAv1::DETECTORINDEX_t det, TList *parameterList)
Bool_t Save2OCDB(const Int_t runNumber, AliRecoParam::EventSpecie_t es, const Char_t *year="08", const Char_t *detectors="ALL") const
Bool_t MergeData(const Int_t runNumber, const char *fileName=NULL) const
TStopwatch timer
Definition: kNNSpeed.C:15
virtual const AliDetectorRecoParam * GetRecoParam()
void SetEventSpecie(AliRecoParam::EventSpecie_t es)
UInt_t fRunNumber
container for the reco-param objects for detectors
Definition: AliQAManager.h:119
Bool_t WriteExpert()
void SetExternParamlist(TList *list)
Int_t GetESLength() const
Definition: AliRunTag.h:119
void InitQADataMaker(UInt_t run, TObjArray *detArray=0x0)
Bool_t MergeResults(const Int_t runNumber) const
void SetEventSpecie(AliRecoParam::EventSpecie_t es)
Definition: AliQAv1.h:103
void RunOneEventInOneDetector(Int_t det, TTree *tree)
void MergeCustom() const
TCanvas ** GetImage(Char_t *detName)
AliLoader * GetLoader(Int_t iDet)
TROOT * gROOT
TTree * TreeD() const
Definition: AliLoader.h:87
Bool_t IsCycleDone() const
static const char * GetRefOCDBDirName()
Definition: AliQAv1.h:82
AliLoader * GetLoader(const char *detname) const
void SetComment(const char *comment)
static const char * GetImageFileFormat()
Definition: AliQAv1.h:57
MODE_t
Definition: AliQAv1.h:32
static void Destroy()
static const char * GetImageFileName()
Definition: AliQAv1.h:56
void SetResponsible(const char *yourName)
AliQADataMaker * GetQADataMaker(const Int_t iDet)
Bool_t Merge(Int_t runNumber=-1, const char *fileName=NULL) const
static const char * GetQARefStorage()
Definition: AliQAv1.h:80
TTree * TreeS() const
Definition: AliLoader.h:85
Bool_t DoIt(const AliQAv1::TASKINDEX_t taskIndex)
Int_t LoadRecPoints(Option_t *opt="")
Definition: AliLoader.h:113
void InitFromCache(TMap *entryCache, Int_t run)
Bool_t fSaveData
flag to print the images or not
Definition: AliQAManager.h:131
Bool_t fCycleSame
event counter
Definition: AliQAManager.h:107
AliRawReader * fRawReader
current run number
Definition: AliQAManager.h:120
TCanvas ** GetImage()
#define AliInfoClass(message)
Definition: AliLog.h:489
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
virtual void Exec(AliQAv1::TASKINDEX_t, TObject *data)=0
#define AliWarning(message)
Definition: AliLog.h:541
ULong_t * GetQAArray() const
Definition: AliRunTag.h:116
Bool_t InitRunLoader()
AliCDBEntry * Get(const AliCDBId &query, Bool_t forceCaching=kFALSE)
static AliRunLoader * Open(const char *filename="galice.root", const char *eventfoldername=AliConfig::GetDefaultEventFolderName(), Option_t *option="READ")
Bool_t SaveIt2OCDB(const Int_t runNumber, TFile *inputFile, const Char_t *year, AliRecoParam::EventSpecie_t es) const
virtual void ResetDetector(AliQAv1::TASKINDEX_t task)=0
TTree * TreeR() const
Definition: AliLoader.h:89
Bool_t MergeXML(const Char_t *collection, const Char_t *subFile=0, const Char_t *outFile=0)
Int_t LoadSDigits(Option_t *opt="")
Definition: AliLoader.h:101
Bool_t * GetEventSpecies() const
Definition: AliRunTag.h:118
TObject * GetObject()
Definition: AliCDBEntry.h:56
static void Close()
Definition: AliQAv1.cxx:207
static DETECTORINDEX_t GetDetIndex(const char *name)
Definition: AliQAv1.cxx:348
TTree * tree
void Reset(const Bool_t sameCycle=kFALSE)
Bool_t InitQA(const AliQAv1::TASKINDEX_t taskIndex, const Char_t *fileName=NULL)
void SetSpecificStorage(const char *calibType, const char *dbString, Int_t version=-1, Int_t subVersion=-1)
UInt_t GetEventType() const
Definition: AliESDEvent.h:222
void SetRunNumber(Int_t run)
Definition: AliQAChecker.h:43
void Show(DETECTORINDEX_t det=kNULLDET) const
Definition: AliQAv1.cxx:824
AliHeader * GetHeader() const
Int_t GetRunNumber() const
Definition: AliESDEvent.h:141
static const TString GetExpert()
Definition: AliQAv1.h:53
void SetPrintImage(Bool_t opt=kTRUE)
#define AliWarningClass(message)
Definition: AliLog.h:546
Bool_t IsSelected(const Char_t *detName)
UInt_t fCurrentEvent
Definition: AliQAManager.h:106
Int_t LoadHeader()
Bool_t Put(TObject *object, const AliCDBId &id, AliCDBMetaData *metaData, const char *mirrors="", DataType type=kPrivate)
AliRunLoader * fRunLoader
tells if the rawReader has been created by this
Definition: AliQAManager.h:122
AliRun * gAlice
Definition: AliRun.cxx:62
Int_t GetNumberOfEvents()
TString Run(const Char_t *detectors, const AliQAv1::TASKINDEX_t taskIndex=AliQAv1::kNULLTASKINDEX, Bool_t const sameCycle=kFALSE, const Char_t *fileName=NULL)
TString fActiveOnlineDetectors
flag to sve the QA data or not
Definition: AliQAManager.h:132
void SetRun(Int_t run)
AliLoader * fLoader[fgkNDetectors]
number of detectors
Definition: AliQAManager.h:125
static const TString GetDetName(DETECTORINDEX_t det)
Definition: AliQAv1.h:62
TTree * fESDTree
current ESD
Definition: AliQAManager.h:111
Definition: AliCDBEntry.h:18
#define AliFatal(message)
Definition: AliLog.h:640
Bool_t fQAWriteExpert[fgkNDetectors]
array of QA cycle length
Definition: AliQAManager.h:128
Int_t LoadHits(Option_t *opt="")
Definition: AliLoader.h:96
void SetDefaultStorage(const char *dbString)
AliESDEvent * fESD
list of active detectors with QA implemented
Definition: AliQAManager.h:110
const char * GetTriggerCluster() const
Definition: AliEventInfo.h:47
virtual TObjArray ** Init(AliQAv1::TASKINDEX_t, Int_t cycles=-1)=0
AliRecoParam::EventSpecie_t fEventSpecie
array of QA cycle length
Definition: AliQAManager.h:129
Int_t GetEvent(Int_t evno)
virtual void StartOfCycle(Int_t run=-1)=0
void test()
Definition: interpolTest.C:100
TString fTasks
current run loader object
Definition: AliQAManager.h:123
static const char * GetRefDataDirName()
Definition: AliQAv1.h:83
#define AliDebug(logLevel, message)
Definition: AliLog.h:300
AliRecoParam::EventSpecie_t GetEventSpecieFromESD()
Int_t GetQACycles(const Int_t iDet) const
Definition: AliQAManager.h:97
static void SetQARefDataDirName(AliRecoParam::EventSpecie_t es)
Definition: AliQAv1.h:110
static const char * GetModeName(MODE_t mode)
Definition: AliQAv1.h:91
void ReadFromTree(TTree *tree, Option_t *opt="")
void SetEventSpecie(AliRecoParam::EventSpecie_t es)
virtual void EndOfCycle()=0
static MODE_t Mode(TASKINDEX_t task)
Definition: AliQAv1.cxx:401
static const TString GetLabLocalOCDB()
Definition: AliQAv1.h:59
TString fMode
number of events to process
Definition: AliQAManager.h:116
TTree * TreeH() const
Definition: AliLoader.h:83
UInt_t fFirstEvent
name of the galice file
Definition: AliQAManager.h:114
Bool_t Finish(const AliQAv1::TASKINDEX_t taskIndex)
DETECTORINDEX_t
Definition: AliQAv1.h:23
void SetRecoParam(const Int_t det, const AliDetectorRecoParam *par)
TASKINDEX_t
Definition: AliQAv1.h:30
static const UInt_t fgkNDetectors
list of QA tasks to be performed
Definition: AliQAManager.h:124
AliQACheckerBase * GetDetQAChecker(Int_t det)
static Int_t runNumber
Definition: pdc06_config.C:126
Bool_t fPrintImage
type of event
Definition: AliQAManager.h:130
TObjArray * GetFromOCDB(AliQAv1::DETECTORINDEX_t det, AliQAv1::TASKINDEX_t task, const Char_t *year) const
static EventSpecie_t Convert(Int_t ies)
void RunOneEvent(AliRawReader *rawReader)
AliEventInfo * fEventInfo
current ESD Tree
Definition: AliQAManager.h:112
TString fDetectors
true if 2 consecutive data making for a same detector
Definition: AliQAManager.h:108
void ResetDetectors(AliQAv1::TASKINDEX_t task, AliQAv1::DETECTORINDEX_t det=AliQAv1::kNULLDET)
static PprRun_t srun
Definition: ConfigCosmic.C:124
virtual void SetRecoParam(const AliDetectorRecoParam *)
#define AliError(message)
Definition: AliLog.h:591
AliRecoParam fRecoParam
number of events in the run
Definition: AliQAManager.h:118
static const TString GetLabAliEnOCDB()
Definition: AliQAv1.h:60
static const char * GetQAName()
Definition: AliQAv1.h:73
Int_t LoadDigits(Option_t *opt="")
Definition: AliLoader.h:106
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
const AliEventInfo * GetEventInfo() const
Definition: AliQAManager.h:45
virtual Bool_t IsActive() const
Definition: AliModule.h:53
static Int_t GetQADebugLevel()
Definition: AliQAv1.h:72
Bool_t IsDefaultStorageSet() const
Definition: AliCDBManager.h:60
void SetWriteExpert()
static const char * GetQADataFileName()
Definition: AliQAv1.h:71
static const char * GetQARefDefaultStorage()
Definition: AliQAv1.h:78
static TGeoManager * GetGeometry()
void EndOfCycle(TObjArray *detArray=0x0)
static AliQAChecker * Instance()
static void LoadGeometry(const char *geomFileName=NULL)
static TString GetTaskName(UInt_t tsk)
Definition: AliQAv1.h:90
static Int_t Infinity()
AliQADataMaker * fQADataMaker[fgkNDetectors]
array of detectors loader
Definition: AliQAManager.h:126
static AliQAv1 * Instance()
Definition: AliQAv1.cxx:585
AliRun * GetAliRun() const
static TASKINDEX_t GetTaskIndex(const char *name)
Definition: AliQAv1.cxx:499
Int_t GetEventSpecie() const
TObjArray * Detectors() const
Definition: AliRun.h:35