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