added merging for QA
[u/mrichter/AliRoot.git] / STEER / AliQADataMakerSteer.h
CommitLineData
312e6f8d 1#ifndef ALIQADATAMAKERSTEER_H
2#define ALIQADATAMAKERSTEER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8///////////////////////////////////////////////////////////////////////////////
9// //
10// class for running the QA makers //
11// //
12// AliQADataMakerSteer 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"
940d8e5f 25#include "AliRecoParam.h"
312e6f8d 26
940d8e5f 27class AliESDEvent ;
28class AliDetectorRecoParam ;
29class AliESDEvent ;
312e6f8d 30class AliQADataMaker ;
4ecde5fc 31class AliRawReader ;
312e6f8d 32class AliRunLoader ;
33
34class AliQADataMakerSteer: public TNamed {
35public:
30bbd491 36 AliQADataMakerSteer(char * mode, const char* gAliceFilename = "galice.root",
312e6f8d 37 const char * name = "AliQADataMakerSteer",
38 const char * title = "QA makers") ;
39 AliQADataMakerSteer(const AliQADataMakerSteer & qas) ;
40 AliQADataMakerSteer & operator = (const AliQADataMakerSteer & qas) ;
41 virtual ~AliQADataMakerSteer() ;
940d8e5f 42 void EndOfCycle(TObjArray * detArray=0x0) ;
7ce961eb 43 UInt_t GetCurrentEvent() const { return fCurrentEvent ; }
44 TObjArray * GetFromOCDB(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, const char * year) const ;
30bbd491 45 AliQADataMaker * GetQADataMaker(const Int_t iDet) ;
940d8e5f 46 void InitQADataMaker(UInt_t run, const AliRecoParam & par, Bool_t sameCycle, Bool_t startOption=kTRUE, TObjArray * detArray=0x0) ;
0acdb2bb 47 Bool_t Merge(const Int_t runNumber = -1 ) const ;
7ce961eb 48 void Reset(const Bool_t sameCycle = kFALSE) ;
940d8e5f 49 TString Run(const char * detectors, const AliQA::TASKINDEX_t taskIndex=AliQA::kNULLTASKINDEX, Bool_t const sameCycle = kFALSE, const char * fileName = NULL) ;
7ce961eb 50 TString Run(const char * detectors, AliRawReader * rawReader, Bool_t const sameCycle = kFALSE) ;
51 TString Run(const char * detectors, const char * filename, Bool_t const sameCycle = kFALSE) ;
940d8e5f 52 void RunOneEvent(AliRawReader * rawReader) ;
0acdb2bb 53 void RunOneEventInOneDetector(Int_t det, TTree * tree) ;
54 void RunOneEvent(AliESDEvent *& esd) ;
7ce961eb 55 Bool_t Save2OCDB(const Int_t runNumber, const char * year = "08", const Int_t cycleNumber=0, const char * detectors = "ALL") const ;
940d8e5f 56 void SetActiveDetectors(TString aDet) { fDetectors = aDet ; }
7ce961eb 57 void SetCycleLength(const AliQA::DETECTORINDEX_t det, const Int_t cycle) { fQACycles[det] = cycle ; }
58 void SetEventRange(UInt_t first, UInt_t last) { fFirstEvent = first ; fMaxEvents = last - first + 1 ; }
59 void SetFirsEvent(UInt_t first) { fFirstEvent = first ; }
60 void SetMaxEvents(UInt_t max) { fMaxEvents = max ; }
61 void SetNewCycle() { fCycleSame = kTRUE ; }
940d8e5f 62 void SetRecoParam(const char* detector, AliDetectorRecoParam *par) ;
7ce961eb 63 void SetRunLoader(AliRunLoader * rl) { fRunLoader = rl ; }
940d8e5f 64 void SetTasks(TString tasks) { fTasks = tasks ; }
4edbc5bc 65
312e6f8d 66private:
30bbd491 67 Bool_t DoIt(const AliQA::TASKINDEX_t taskIndex) ;
0acdb2bb 68 AliLoader * GetLoader(Int_t iDet) ;
69 const Int_t GetQACycles(const Int_t iDet) { return fQACycles[iDet] ; }
30bbd491 70 Bool_t Init(const AliQA::TASKINDEX_t taskIndex, const char * fileName = NULL) ;
0acdb2bb 71 Bool_t InitRunLoader() ;
72 Bool_t IsSelected(const char * detName) ;
73 Bool_t Finish(const AliQA::TASKINDEX_t taskIndex) ;
74 Bool_t MergeData(const Int_t runNumber) const ;
75 Bool_t MergeResults(const Int_t runNumber) const ;
76 Bool_t SaveIt2OCDB(const Int_t runNumber, TFile * inputFile, const char * year) const ;
312e6f8d 77
78
018c2b09 79 UInt_t fCurrentEvent ; //! event counter
0acdb2bb 80 Bool_t fCycleSame ; //! true if 2 consecutive data making for a same detector
7ce961eb 81 TString fDetectors ; //! list of active detectors
82 TString fDetectorsW ; //! list of active detectors with QA implemented
312e6f8d 83 AliESDEvent * fESD ; //! current ESD
84 TTree * fESDTree ; //! current ESD Tree
312e6f8d 85 TString fGAliceFileName ; //! name of the galice file
e30aef00 86 UInt_t fFirstEvent ; //! first event to process
95932286 87 Int_t fMaxEvents ; //! number of events to process
30bbd491 88 char * fMode ; //! sim or rec
312e6f8d 89 Long64_t fNumberOfEvents ; //! number of events in the run
940d8e5f 90 AliRecoParam fRecoParam; //! container for the reco-param objects for detectors
f0c6fb4b 91 UInt_t fRunNumber ; //! current run number
4ecde5fc 92 AliRawReader * fRawReader ; //! current raw reader object
6441b07a 93 Bool_t fRawReaderDelete ; //! tells if the rawReader has been created by this
312e6f8d 94 AliRunLoader * fRunLoader ; //! current run loader object
940d8e5f 95 TString fTasks ; //! list of QA tasks to be performed
312e6f8d 96 static const UInt_t fgkNDetectors = AliQA::kNDET ; //! number of detectors
97 AliLoader * fLoader[fgkNDetectors]; //! array of detectors loader
98 AliQADataMaker * fQADataMaker[fgkNDetectors]; //! array of QA data maker objects
99 Int_t fQACycles[fgkNDetectors]; //! array of QA cycle length
100
101 ClassDef(AliQADataMakerSteer, 0) // class for running the QA makers
102};
103
104#endif