]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/dielectron/AliDielectronHistos.h
Adding Id to PWG3 classes for better tracking of the coverity defect fixes (Ivana)
[u/mrichter/AliRoot.git] / PWG3 / dielectron / AliDielectronHistos.h
1 #ifndef ALIDIELECTRONHISTOS_H
2 #define ALIDIELECTRONHISTOS_H
3 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */ 
7
8 ///////////////////////////////////////////////////////////////////////////////////////////
9 //                                                                                       //
10 // Generic Histogram container with support for groups and filling of groups by passing  //
11 // a vector of data                                                                      //
12 //                                                                                       //
13 // Authors:                                                                              //
14 //   Jens Wiechula <Jens.Wiechula@cern.ch>                                               //
15 //                                                                                       //
16 ///////////////////////////////////////////////////////////////////////////////////////////
17
18
19 #include <TNamed.h>
20 // #include <TCollection.h>
21 #include <THashList.h>
22 #include <TVectorDfwd.h>
23
24 class TH1;
25 class TString;
26 class TList;
27 // class TVectorT<double>;
28
29 class AliDielectronHistos : public TNamed {
30 public:
31   AliDielectronHistos();
32   AliDielectronHistos(const char* name, const char* title);
33   virtual ~AliDielectronHistos();
34
35   
36   void UserHistogram(const char* histClass,const char *name, const char* title,
37                      Int_t nbinsX, Double_t xmin, Double_t xmax,
38                      UInt_t valTypeX=kNoAutoFill, Bool_t logBinX=kFALSE);
39   void UserHistogram(const char* histClass,const char *name, const char* title,
40                      Int_t nbinsX, Double_t xmin, Double_t xmax,
41                      Int_t nbinsY, Double_t ymin, Double_t ymax,
42                      UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0,
43                      Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE);
44   void UserHistogram(const char* histClass,const char *name, const char* title,
45                      Int_t nbinsX, Double_t xmin, Double_t xmax,
46                      Int_t nbinsY, Double_t ymin, Double_t ymax,
47                      Int_t nbinsZ, Double_t zmin, Double_t zmax,
48                      UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0,
49                      Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE);
50   
51   void UserHistogram(const char* histClass,const char *name, const char* title,
52                      const char* binning,
53                      UInt_t valTypeX=kNoAutoFill);
54
55   void UserHistogram(const char* histClass,const char *name, const char* title,
56                      const TVectorD * const binsX,
57                      UInt_t valTypeX=kNoAutoFill);
58   void UserHistogram(const char* histClass,const char *name, const char* title,
59                      const TVectorD * const binsX, const TVectorD * const binsY,
60                      UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0);
61   void UserHistogram(const char* histClass,const char *name, const char* title,
62                      const TVectorD * const binsX, const TVectorD * const binsY, const TVectorD * const binsZ,
63                      UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0);
64   
65   void UserHistogram(const char* histClass, TH1* hist, UInt_t valTypes=kNoAutoFill);
66
67
68   void Fill(const char* histClass, const char* name, Double_t xval);
69   void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval);
70   void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval, Double_t zval);
71   
72 //   void FillClass(const char* histClass, const TVectorD &vals);
73   void FillClass(const char* histClass, Int_t nValues, const Double_t *values);
74
75   
76   TH1* GetHistogram(const char* histClass, const char* name) const;
77   TH1* GetHistogram(const char* cutClass, const char* histClass, const char* name) const;
78   
79   void SetHistogramList(THashList &list, Bool_t setOwner=kTRUE);
80   void ResetHistogramList(){fHistoList.Clear();}
81   const THashList* GetHistogramList() const {return &fHistoList;}
82
83   void SetList(TList * const list) { fList=list; }
84   TList *GetList() const { return fList; }
85
86   void AddClass(const char* histClass);
87
88   void DumpToFile(const char* file="histos.root");
89   void ReadFromFile(const char* file="histos.root");
90   
91   virtual void Print(const Option_t* option = "") const;
92   virtual void Draw(const Option_t* option = "");
93   virtual void DrawSame(const char* histName, const Option_t *opt="leg can");
94
95   void SetReservedWords(const char* words);
96 //   virtual void       Add(TObject *obj) {};
97 //   virtual void       Clear(Option_t *option="") {};
98 //   virtual void       Delete(Option_t *option="") {};
99 //   virtual TObject  **GetObjectRef(const TObject *obj) const { return 0; }
100 //   virtual TIterator *MakeIterator(Bool_t dir = kIterForward) const ;
101 //   virtual TObject   *Remove(TObject *obj) { return 0; }
102
103   Bool_t SetCutClass(const char* cutClass);
104   
105 private:
106   THashList fHistoList;             //-> list of histograms
107   TList    *fList;                  //! List of list of histograms
108
109   TString *fReservedWords;          //! list of reserved words
110   void UserHistogramReservedWords(const char* histClass, const TH1 *hist, UInt_t valTypes);
111   void FillClass(THashTable *classTable, Int_t nValues, Double_t *values);
112   
113   void PrintPDF(Option_t* opt);
114   void PrintStructure() const;
115
116   Bool_t IsHistogramOk(const char* classTable, const char* name);
117   
118   enum {kNoAutoFill=1000000000};
119
120   AliDielectronHistos(const AliDielectronHistos &hist);
121   AliDielectronHistos& operator = (const AliDielectronHistos &hist);
122
123   ClassDef(AliDielectronHistos,2)
124 };
125
126 #endif
127