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