]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliQADataMaker.h
Made QA images persistent objects
[u/mrichter/AliRoot.git] / STEER / AliQADataMaker.h
1 #ifndef ALIQADATAMAKER_H
2 #define ALIQADATAMAKER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7 /* $Id$ */
8
9 //
10 //  Base Class:
11 //  Produces the data needed to calculate the quality assurance. 
12 //  All data must be mergeable objects.
13 //  Y. Schutz CERN July 2007
14 //
15
16
17 // --- ROOT system ---
18 #include <TH1.h>
19 #include <TObjArray.h>
20 #include <TNamed.h>  
21 class TCanvas ; 
22 class TClonesArray;
23 class TDirectory;
24 class TFile;  
25 class TObject; 
26 class TTree; 
27 class AliESDEvent;
28 class AliRawReader;
29 class AliDetectorRecoParam;
30
31 // --- Standard library ---
32
33 // --- AliRoot header files ---
34 #include "AliQAv1.h"
35 #include "AliRecoParam.h" 
36
37 class AliQADataMaker: public TNamed {
38   
39 public:
40         
41         AliQADataMaker(const char * name="", const char * title="") ;          // ctor
42         AliQADataMaker(const AliQADataMaker& qadm) ;   
43         virtual ~AliQADataMaker() ; // dtor
44   
45         virtual Int_t Add2DigitsList(TH1 * hist, const Int_t index, const Bool_t expert = kFALSE, const Bool_t image = kFALSE)          = 0 ; 
46         virtual Int_t Add2ESDsList(TH1 * hist, const Int_t index, const Bool_t expert = kFALSE, const Bool_t image = kFALSE)            = 0 ; 
47         virtual Int_t Add2HitsList(TH1 * hist, const Int_t index, const Bool_t expert = kFALSE, const Bool_t image = kFALSE)            = 0 ; 
48         virtual Int_t Add2RecPointsList(TH1 * hist, const Int_t index, const Bool_t expert = kFALSE, const Bool_t image = kFALSE)       = 0 ; 
49         virtual Int_t Add2RawsList(TH1 * hist, const Int_t index, const Bool_t expert = kFALSE, const Bool_t image = kFALSE, const Bool_t saveForCorr = kFALSE)            = 0 ; 
50         virtual Int_t Add2SDigitsList(TH1 * hist, const Int_t index, const Bool_t expert = kFALSE, const Bool_t image = kFALSE)         = 0 ; 
51         virtual void        Exec(AliQAv1::TASKINDEX_t, TObject * data)             = 0 ;
52         virtual void        EndOfCycle()                                           = 0 ;
53         virtual void        EndOfCycle(AliQAv1::TASKINDEX_t )                      = 0 ;
54         void                Finish() const ; 
55         virtual TH1 *       GetDigitsData(const Int_t index)                       = 0 ; 
56         virtual TH1 *       GetESDsData(const Int_t index)                         = 0 ; 
57         virtual TH1 *       GetHitsData(const Int_t index)                         = 0 ; 
58   TCanvas **          GetImage() { return fImage ; }
59   TCanvas *           GetImage(AliRecoParam::EventSpecie_t es) { return fImage[AliRecoParam::AConvert(es)] ; }
60         virtual TH1 *       GetRecPointsData(const Int_t index)                    = 0 ; 
61         virtual TH1 *       GetRawsData(const Int_t index)                         = 0 ; 
62         virtual TH1 *       GetSDigitsData(const Int_t index)                      = 0 ; 
63         const char *        GetDetectorDirName() const { return fDetectorDirName.Data() ; }
64   TList *             GetParameterList() const { return fParameterList[AliRecoParam::AConvert(fEventSpecie)] ; }
65   virtual const AliDetectorRecoParam * GetRecoParam() { return NULL ; }
66         Int_t               Increment() { return ++fCycleCounter ; } 
67         virtual TObjArray** Init(AliQAv1::TASKINDEX_t, Int_t cycles = -1)                               = 0 ;
68         virtual void        Init(AliQAv1::TASKINDEX_t, TObjArray ** list, Int_t run, Int_t cycles = -1) = 0 ;
69         Bool_t              IsCycleDone() const { return fCycleCounter > fCycle ? kTRUE : kFALSE ; }
70   virtual void        MakeImage(AliQAv1::TASKINDEX_t task) = 0 ; 
71         void                Reset() { fCycleCounter = 0 ; }
72         void                SetCycle(Int_t nevts) { fCycle = nevts ; } 
73   void                SetWriteExpert() { fWriteExpert = kTRUE ; }
74         virtual void        StartOfCycle(Int_t run = -1)                                                 = 0 ;
75         virtual void        StartOfCycle(AliQAv1::TASKINDEX_t, Int_t run, const Bool_t sameCycle = kFALSE) = 0 ;
76   void                UnSetWriteExpert() { fWriteExpert = kFALSE ; }
77   Bool_t              WriteExpert() { return fWriteExpert ; }
78   void                SetEventSpecie(AliRecoParam::EventSpecie_t es) { fEventSpecie = es ; }
79   void                SetEventSpecie(Int_t es) { fEventSpecie = AliRecoParam::Convert(es) ; }
80   void                SetPrintImage(Bool_t opt = kTRUE) { fPrintImage = opt ; }
81   virtual void        SetRecoParam(const AliDetectorRecoParam *) {;}
82
83           
84 protected: 
85
86         Int_t          Add2List(TH1 * hist, const Int_t index, TObjArray ** list, const Bool_t expert = kFALSE, const Bool_t image = kFALSE, const Bool_t saveForCorr = kFALSE) ;
87   TH1 *          CloneMe(TH1 * hist, Int_t specie) const ; 
88         virtual void   DefaultEndOfDetectorCycle(AliQAv1::TASKINDEX_t task ) ; 
89         virtual void   EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list ) = 0 ; 
90         TObject *      GetData(TObjArray ** list, const Int_t index) ;
91         virtual void   InitDigits()        = 0 ; 
92         virtual void   InitESDs()          = 0 ; 
93         virtual void   InitHits()          = 0 ; 
94   //virtual void   InitRecParticles()  = 0 ; 
95         virtual void   InitRecPoints()     = 0 ; 
96         virtual void   InitRaws()          = 0 ; 
97         virtual void   InitSDigits()       = 0 ; 
98   //virtual void   InitTrackSegments()  = 0 ; 
99         virtual void   MakeESDs(AliESDEvent * )          = 0 ; 
100         virtual void   MakeHits(TClonesArray * )         = 0 ; 
101         virtual void   MakeHits(TTree * )                = 0 ;  
102         virtual void   MakeDigits(TClonesArray * )       = 0 ;  
103         virtual void   MakeDigits(TTree * )              = 0 ; 
104   //virtual void   MakeRecParticles(TClonesArray * ) = 0 ; 
105         virtual void   MakeRaws(AliRawReader *)          = 0 ; 
106         virtual void   MakeRecPoints(TTree * )           = 0 ; 
107         virtual void   MakeSDigits(TClonesArray * )      = 0 ;  
108         virtual void   MakeSDigits(TTree * )             = 0 ;  
109   //virtual void   MakeTrackSegments(TTree * )           = 0 ;  
110         void           ResetCycle() { fCurrentCycle++ ; fCycleCounter = 0 ; } 
111         virtual void   StartOfDetectorCycle()            = 0 ;
112         
113         TFile *        fOutput ;          //! output root file
114         TDirectory *   fDetectorDir ;     //! directory for the given detector in the file
115         TString        fDetectorDirName ; //! detector directory name in the quality assurance data file
116         Int_t          fCurrentCycle ;    //! current cycle number
117         Int_t          fCycle ;           //! length (# events) of the QA data acquisition cycle  
118         Int_t          fCycleCounter ;    //! cycle counter
119   Bool_t         fWriteExpert ;     //! flag to write or not the expert QA data
120   TList **       fParameterList ;   //! list of QA data parameters
121         Int_t          fRun ;             //! run number
122   AliRecoParam::EventSpecie_t fEventSpecie ; //! event specie, see AliRecoParam
123   TCanvas **     fImage ;           //[AliRecoParam::kNSpecies] 
124   Bool_t         fPrintImage ;      //! flag to print the images or not
125 private:
126         AliQADataMaker& operator = (const AliQADataMaker& /*qadm*/); // Not implemented
127
128   
129  ClassDef(AliQADataMaker,2)  // description 
130
131 };
132
133 #endif // AliQADataMaker_H