e084cae398daa85bc626ad357fd7e79953bb50ff
[u/mrichter/AliRoot.git] / STEER / AliQADataMakerSteer.h
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" 
25  
26 class AliQADataMaker ;
27 class AliRawReader ;  
28 class AliRunLoader ; 
29 class AliESDEvent ; 
30
31 class AliQADataMakerSteer: public TNamed {
32 public:
33         AliQADataMakerSteer(const char* gAliceFilename = "galice.root", 
34                                                 const char * name = "AliQADataMakerSteer", 
35                                                 const char * title = "QA makers") ; 
36         AliQADataMakerSteer(const AliQADataMakerSteer & qas) ; 
37         AliQADataMakerSteer & operator = (const AliQADataMakerSteer & qas) ; 
38         virtual ~AliQADataMakerSteer() ; 
39         Bool_t Merge() ;  
40     void   Reset() ;  
41         Bool_t Run(const char * detectors, const AliQA::TASKINDEX taskIndex, const char * fileName = NULL) ; 
42         Bool_t Run(const char * detectors, AliRawReader * rawReader) ; 
43         void   SetCycleLength(const AliQA::DETECTORINDEX det, const Int_t cycle) { fQACycles[det] = cycle ; }
44     void   SetRunLoader(AliRunLoader * rl) { fRunLoader = rl ; }
45 private: 
46         Bool_t                   DoIt(const AliQA::TASKINDEX taskIndex) ;
47         AliLoader      * GetLoader(Int_t iDet) ; 
48         const Int_t      GetQACycles(const Int_t iDet) { return fQACycles[iDet] ; }
49         AliQADataMaker * GetQADataMaker(Int_t iDet) ; 
50         Bool_t                   Init(const AliQA::TASKINDEX taskIndex, const  char * fileName = NULL) ;
51         Bool_t           InitRunLoader() ; 
52         Bool_t           IsSelected(const char * detName)  ;
53         Bool_t           Finish(const AliQA::TASKINDEX taskIndex) ;
54
55  
56         Bool_t                     fCycleSame ;                    //! true if 2 consecutive data making for a same detector   
57     TString            fDetectors ;                    //! list of active detectors 
58         AliESDEvent *      fESD ;                          //! current ESD
59         TTree *            fESDTree ;                      //! current ESD Tree
60         Bool_t             fFirst ;                        //! to search the detector QA data maker only once
61         TString            fGAliceFileName ;               //! name of the galice file
62         UInt_t             fRunNumber ;                    //! current run number
63         Long64_t           fNumberOfEvents ;               //! number of events in the run 
64         AliRawReader     * fRawReader ;                    //! current raw reader object 
65         Bool_t             fRawReaderDelete ;              //! tells if the rawReader has been created by this
66         AliRunLoader *     fRunLoader ;                    //! current run loader object
67         static const UInt_t fgkNDetectors = AliQA::kNDET ; //! number of detectors    
68         AliLoader      *   fLoader[fgkNDetectors];         //! array of detectors loader
69         AliQADataMaker *   fQADataMaker[fgkNDetectors];    //! array of QA data maker objects
70         Int_t              fQACycles[fgkNDetectors];       //! array of QA cycle length
71         
72   ClassDef(AliQADataMakerSteer, 0)      // class for running the QA makers
73 };
74
75 #endif