adding Mihaela's macros to be used for the analysis train...
[u/mrichter/AliRoot.git] / 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 //
11// //
12// AliQAManager qas; //
13// qas.Run(AliQA::kRAWS, rawROOTFileName); //
14// qas.Run(AliQA::kHITS); //
15// qas.Run(AliQA::kSDIGITS); //
16// qas.Run(AliQA::kDIGITS); //
17// qas.Run(AliQA::kRECPOINTS); //
18// qas.Run(AliQA::kESDS); //
19// //
20///////////////////////////////////////////////////////////////////////////////
21
22#include <TNamed.h>
23#include "AliQA.h"
24#include "AliLoader.h"
25#include "AliCDBManager.h"
26#include "AliRecoParam.h"
27
28class AliESDEvent ;
29class AliDetectorRecoParam ;
30class AliESDEvent ;
31class AliQADataMaker ;
32class AliRawReader ;
33class AliRunLoader ;
34class AliCorrQADataMakerRec ;
35
36class AliQAManager : public AliCDBManager {
37private:
38 AliQAManager() ;
39 AliQAManager(const Char_t * mode, const Char_t * gAliceFilename = "galice.root") ;
40 AliQAManager(const AliQAManager & qas) ;
41 AliQAManager & operator = (const AliQAManager & qas) ;
42
43public:
44 virtual ~AliQAManager() ;
45 void EndOfCycle(TObjArray * detArray=0x0) ;
46 void EndOfCycle(TString detectors) ;
47 UInt_t GetCurrentEvent() const { return fCurrentEvent ; }
48 TObjArray * GetFromOCDB(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, const char * year) const ;
49 AliQA * GetQA(UInt_t run, UInt_t evt) ;
50 AliQADataMaker * GetQADataMaker(const Int_t iDet) ;
51 void Increment() ;
52 void InitQADataMaker(UInt_t run, TObjArray * detArray=0x0) ;
bededc30 53 Bool_t Merge(Int_t runNumber = -1) const ;
69a898e3 54 void MergeCustom() const ;
149a2367 55 Bool_t MergeXML(const char * collection, const char * subFile = 0, const char * outFile = 0) ;
07426850 56 static AliQAManager * QAManager(const Char_t * mode="", TMap *entryCache = NULL, Int_t run = -1) ;
57 void Reset(const Bool_t sameCycle = kFALSE) ;
58 TString Run(const char * detectors, const AliQA::TASKINDEX_t taskIndex=AliQA::kNULLTASKINDEX, Bool_t const sameCycle = kFALSE, const char * fileName = NULL) ;
59 TString Run(const char * detectors, AliRawReader * rawReader, Bool_t const sameCycle = kFALSE) ;
60 TString Run(const char * detectors, const char * filename, Bool_t const sameCycle = kFALSE) ;
61 void RunOneEvent(AliRawReader * rawReader) ;
62 void RunOneEventInOneDetector(Int_t det, TTree * tree) ;
63 void RunOneEvent(AliESDEvent *& esd) ;
64 Bool_t Save2OCDB(const Int_t runNumber, AliRecoParam::EventSpecie_t es, const char * year = "08", const char * detectors = "ALL") const ;
65 void SetActiveDetectors(TString aDet) { fDetectors = aDet ; }
66 void SetCycleLength(const AliQA::DETECTORINDEX_t det, const Int_t cycle) { fQACycles[det] = cycle ; }
67 void SetWriteExpert(const AliQA::DETECTORINDEX_t det) { fQAWriteExpert[det] = kTRUE ; }
68 void SetEventRange(UInt_t first, UInt_t last) { fFirstEvent = first ; fMaxEvents = last - first + 1 ; }
69 void SetEventSpecie(AliRecoParam::EventSpecie_t es) ;
70 void SetFirsEvent(UInt_t first) { fFirstEvent = first ; }
71 void SetMaxEvents(UInt_t max) { fMaxEvents = max ; }
72 void SetNewCycle() { fCycleSame = kTRUE ; }
73 void SetRecoParam(const Int_t det, const AliDetectorRecoParam *par) ;
74 void SetRunLoader(AliRunLoader * rl) { fRunLoader = rl ; }
75 void SetTasks(TString tasks) { fTasks = tasks ; }
75373542 76 void SetWriteExpert() ;
07426850 77private:
78 Bool_t DoIt(const AliQA::TASKINDEX_t taskIndex) ;
79 AliLoader * GetLoader(Int_t iDet) ;
80 Int_t GetQACycles(const Int_t iDet) const { return fQACycles[iDet] ; }
81 Bool_t InitQA(const AliQA::TASKINDEX_t taskIndex, const char * fileName = NULL) ;
82 Bool_t InitRunLoader() ;
83 Bool_t IsSelected(const char * detName) ;
84 Bool_t Finish(const AliQA::TASKINDEX_t taskIndex) ;
85 Bool_t MergeData(const Int_t runNumber) const ;
86 Bool_t MergeResults(const Int_t runNumber) const ;
87 Bool_t SaveIt2OCDB(const Int_t runNumber, TFile * inputFile, const char * year, AliRecoParam::EventSpecie_t es) const ;
88
89 static AliQAManager* fgQAInstance; // AliQAManager instance
90 UInt_t fCurrentEvent ; //! event counter
91 Bool_t fCycleSame ; //! true if 2 consecutive data making for a same detector
92 TString fDetectors ; //! list of active detectors
93 TString fDetectorsW ; //! list of active detectors with QA implemented
94 AliESDEvent * fESD ; //! current ESD
95 TTree * fESDTree ; //! current ESD Tree
96 TString fGAliceFileName ; //! name of the galice file
97 UInt_t fFirstEvent ; //! first event to process
98 Long64_t fMaxEvents ; //! number of events to process
99 const Char_t * fMode ; //! sim or rec
100 Long64_t fNumberOfEvents ; //! number of events in the run
101 AliRecoParam fRecoParam; //! container for the reco-param objects for detectors
102 UInt_t fRunNumber ; //! current run number
103 AliRawReader * fRawReader ; //! current raw reader object
104 Bool_t fRawReaderDelete ; //! tells if the rawReader has been created by this
105 AliRunLoader * fRunLoader ; //! current run loader object
106 TString fTasks ; //! list of QA tasks to be performed
107 static const UInt_t fgkNDetectors = AliQA::kNDET ; //! number of detectors
108 AliLoader * fLoader[fgkNDetectors]; //! array of detectors loader
109 AliQADataMaker * fQADataMaker[fgkNDetectors]; //! array of QA data maker objects
110 Int_t fQACycles[fgkNDetectors]; //! array of QA cycle length
111 Bool_t fQAWriteExpert[fgkNDetectors]; //! array of QA cycle length
112 AliRecoParam::EventSpecie_t fEventSpecie ; //! event specie, see AliRecoParam::EventSpecie_t
113 ClassDef(AliQAManager, 0) // class for running the QA makers
114};
115
116#endif