suggestion by Chiara to add TestPreprocessor macro to svn
[u/mrichter/AliRoot.git] / STEER / STEER / AliQAManager.h
CommitLineData
07426850 1#ifndef ALIQAMANAGER_H
2#define ALIQAMANAGER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id: AliQAManager.h 30796 2009-01-28 11:05:10Z schutz $ */
7
8///////////////////////////////////////////////////////////////////////////////
9// //
10// class for running the QA makers //
9ac91920 11// //1
07426850 12// AliQAManager qas; //
4e25ac79 13// qas.Run(AliQAv1::kRAWS, rawROOTFileName); //
14// qas.Run(AliQAv1::kHITS); //
15// qas.Run(AliQAv1::kSDIGITS); //
16// qas.Run(AliQAv1::kDIGITS); //
17// qas.Run(AliQAv1::kRECPOINTS); //
18// qas.Run(AliQAv1::kESDS); //
07426850 19// //
20///////////////////////////////////////////////////////////////////////////////
21
22#include <TNamed.h>
4e25ac79 23#include "AliQAv1.h"
07426850 24#include "AliLoader.h"
25#include "AliCDBManager.h"
26#include "AliRecoParam.h"
c3c10397 27#include "AliEventInfo.h"
07426850 28
fec0891b 29class TCanvas ;
07426850 30class AliESDEvent ;
31class AliDetectorRecoParam ;
32class AliESDEvent ;
33class AliQADataMaker ;
34class AliRawReader ;
35class AliRunLoader ;
36class AliCorrQADataMakerRec ;
37
38class AliQAManager : public AliCDBManager {
39private:
40 AliQAManager() ;
634696f5 41 AliQAManager(AliQAv1::MODE_t mode, const Char_t * gAliceFilename = "galice.root") ;
07426850 42 AliQAManager(const AliQAManager & qas) ;
43 AliQAManager & operator = (const AliQAManager & qas) ;
eca4fa66 44 ~AliQAManager() ;
07426850 45
46public:
bf76b847 47 static void Destroy() ;
48 void EndOfCycle(TObjArray * detArray=0x0) ;
fec0891b 49 void EndOfCycle(TString detectors) ;
50 UInt_t GetCurrentEvent() const { return fCurrentEvent ; }
51 TObjArray * GetFromOCDB(AliQAv1::DETECTORINDEX_t det, AliQAv1::TASKINDEX_t task, const Char_t * year) const ;
c3c10397 52 const AliEventInfo * GetEventInfo() const { return fEventInfo ; }
d34d00a9 53 AliRecoParam::EventSpecie_t GetEventSpecieFromESD() ;
fec0891b 54 TCanvas ** GetImage(Char_t * detName) ;
55 const Char_t * GetMode(){ return fMode.Data() ; }
56 AliQAv1 * GetQA(UInt_t run, UInt_t evt) ;
07426850 57 AliQADataMaker * GetQADataMaker(const Int_t iDet) ;
5e303886 58 void Increment(const AliQAv1::TASKINDEX_t taskIndex = AliQAv1::kNULLTASKINDEX) ;
fec0891b 59 void InitQADataMaker(UInt_t run, TObjArray * detArray=0x0) ;
50dee02c 60 Bool_t IsSaveData() { return fSaveData ; }
1b3c3bfc 61 Bool_t IsSelected(const Char_t * detName) ;
87da0921 62 Bool_t Merge(Int_t runNumber = -1, const char *fileName = NULL) const ;
fec0891b 63 void MergeCustom() const ;
64 Bool_t MergeXML(const Char_t * collection, const Char_t * subFile = 0, const Char_t * outFile = 0) ;
634696f5 65 static AliQAManager * QAManager(AliQAv1::MODE_t = AliQAv1::kNULLMODE, TMap *entryCache = NULL, Int_t run = -1) ;
5e303886 66 static AliQAManager * QAManager(AliQAv1::TASKINDEX_t task) ;
fec0891b 67 void Reset(const Bool_t sameCycle = kFALSE) ;
9ac91920 68 void ResetDetectors(AliQAv1::TASKINDEX_t task, AliQAv1::DETECTORINDEX_t det=AliQAv1::kNULLDET) ;
fec0891b 69 TString Run(const Char_t * detectors, const AliQAv1::TASKINDEX_t taskIndex=AliQAv1::kNULLTASKINDEX, Bool_t const sameCycle = kFALSE, const Char_t * fileName = NULL) ;
70 TString Run(const Char_t * detectors, AliRawReader * rawReader, Bool_t const sameCycle = kFALSE) ;
71 TString Run(const Char_t * detectors, const Char_t * filename, Bool_t const sameCycle = kFALSE) ;
72 void RunOneEvent(AliRawReader * rawReader) ;
73 void RunOneEventInOneDetector(Int_t det, TTree * tree) ;
aeb8fc30 74 void RunOneEvent(AliESDEvent *& esd, AliESDEvent *& hltesd) ;
fec0891b 75 Bool_t Save2OCDB(const Int_t runNumber, AliRecoParam::EventSpecie_t es, const Char_t * year = "08", const Char_t * detectors = "ALL") const ;
76 void SetActiveDetectors(TString aDet) { fDetectors = aDet ; }
7c9ff472 77 void SetCheckerExternParam(AliQAv1::DETECTORINDEX_t det, TList * parameterList) ;
fec0891b 78 void SetCycleLength(const AliQAv1::DETECTORINDEX_t det, const Int_t cycle) { fQACycles[det] = cycle ; }
79 void SetWriteExpert(const AliQAv1::DETECTORINDEX_t det) { fQAWriteExpert[det] = kTRUE ; }
c3c10397 80 void SetEventInfo(AliEventInfo *info) { fEventInfo = info ;}
fec0891b 81 void SetEventRange(UInt_t first, UInt_t last) { fFirstEvent = first ; fMaxEvents = last - first + 1 ; }
82 void SetEventSpecie(AliRecoParam::EventSpecie_t es) ;
83 void SetFirsEvent(UInt_t first) { fFirstEvent = first ; }
84 void SetMaxEvents(UInt_t max) { fMaxEvents = max ; }
85 void SetNewCycle() { fCycleSame = kTRUE ; }
86 void SetPrintImage(Bool_t opt = kTRUE) { fPrintImage = opt ; }
87 void SetRecoParam(const Int_t det, const AliDetectorRecoParam *par) ;
88 void SetRunLoader(AliRunLoader * rl) { fRunLoader = rl ; }
50dee02c 89 void SetSaveData(Bool_t opt = kTRUE ) { fSaveData = opt ; }
fec0891b 90 void SetTasks(TString tasks) { fTasks = tasks ; }
91 void SetWriteExpert() ;
bf76b847 92 void ShowQA() ;
93
07426850 94private:
fec0891b 95 Bool_t DoIt(const AliQAv1::TASKINDEX_t taskIndex) ;
96 AliLoader * GetLoader(Int_t iDet) ;
97 Int_t GetQACycles(const Int_t iDet) const { return fQACycles[iDet] ; }
98 Bool_t InitQA(const AliQAv1::TASKINDEX_t taskIndex, const Char_t * fileName = NULL) ;
99 Bool_t InitRunLoader() ;
fec0891b 100 Bool_t Finish(const AliQAv1::TASKINDEX_t taskIndex) ;
87da0921 101 Bool_t MergeData(const Int_t runNumber, const char *fileName = NULL) const ;
fec0891b 102 Bool_t MergeResults(const Int_t runNumber) const ;
103 Bool_t SaveIt2OCDB(const Int_t runNumber, TFile * inputFile, const Char_t * year, AliRecoParam::EventSpecie_t es) const ;
07426850 104
fec0891b 105 static AliQAManager* fgQAInstance; // AliQAManager instance
106 UInt_t fCurrentEvent ; //! event counter
107 Bool_t fCycleSame ; //! true if 2 consecutive data making for a same detector
108 TString fDetectors ; //! list of active detectors
109 TString fDetectorsW ; //! list of active detectors with QA implemented
110 AliESDEvent * fESD ; //! current ESD
111 TTree * fESDTree ; //! current ESD Tree
c3c10397 112 AliEventInfo * fEventInfo ; //! info on the current event
fec0891b 113 TString fGAliceFileName ; //! name of the galice file
114 UInt_t fFirstEvent ; //! first event to process
115 Long64_t fMaxEvents ; //! number of events to process
116 TString fMode ; //! sim or rec
117 Long64_t fNumberOfEvents ; //! number of events in the run
118 AliRecoParam fRecoParam; //! container for the reco-param objects for detectors
119 UInt_t fRunNumber ; //! current run number
120 AliRawReader * fRawReader ; //! current raw reader object
121 Bool_t fRawReaderDelete ; //! tells if the rawReader has been created by this
122 AliRunLoader * fRunLoader ; //! current run loader object
123 TString fTasks ; //! list of QA tasks to be performed
124 static const UInt_t fgkNDetectors = AliQAv1::kNDET ; //! number of detectors
125 AliLoader * fLoader[fgkNDetectors]; //! array of detectors loader
126 AliQADataMaker * fQADataMaker[fgkNDetectors]; //! array of QA data maker objects
127 Int_t fQACycles[fgkNDetectors]; //! array of QA cycle length
128 Bool_t fQAWriteExpert[fgkNDetectors]; //! array of QA cycle length
129 AliRecoParam::EventSpecie_t fEventSpecie ; //! type of event
50dee02c 130 Bool_t fPrintImage ; //! flag to print the images or not
131 Bool_t fSaveData ; //! flag to sve the QA data or not
bc8761a0 132
50dee02c 133 ClassDef(AliQAManager, 2) // class for running the QA makers
07426850 134};
135
f92b626a 136#endif