]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGDQ/dielectron/TakuAlberica/single/AliDielectronHistosTaku.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / TakuAlberica / single / AliDielectronHistosTaku.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 ///////////////////////////////////////////////////////////////////////////////////////////
7 //                                                                                       //
8 // Generic Histogram container with support for groups and filling of groups by passing  //
9 // a vector of data                                                                      //
10 //                                                                                       //
11 // Authors:                                                                              //
12 //   Jens Wiechula <Jens.Wiechula@cern.ch>                                               //
13 //                                                                                       //
14 ///////////////////////////////////////////////////////////////////////////////////////////
15
16
17 #include <TNamed.h>
18 // #include <TCollection.h>
19 #include <THashList.h>
20 #include <TVectorDfwd.h>
21 #include "AliDielectronVarManager.h"
22
23
24 class TH1;
25 class TTree;
26 class TString;
27 class TList;
28 class AliDielectronVarManager;
29 // class TVectorT<double>;
30
31 class AliDielectronHistosTaku : public TNamed {
32 public:
33   AliDielectronHistosTaku();
34   AliDielectronHistosTaku(const char* name, const char* title);
35   virtual ~AliDielectronHistosTaku();
36
37   
38   void UserHistogram(const char* histClass,const char *name, const char* title,
39                      Int_t nbinsX, Double_t xmin, Double_t xmax,
40                      UInt_t valTypeX=kNoAutoFill, Bool_t logBinX=kFALSE);
41   void UserHistogram(const char* histClass,const char *name, const char* title,
42                      Int_t nbinsX, Double_t xmin, Double_t xmax,
43                      Int_t nbinsY, Double_t ymin, Double_t ymax,
44                      UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0,
45                      Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE);
46   void UserHistogram(const char* histClass,const char *name, const char* title,
47                      Int_t nbinsX, Double_t xmin, Double_t xmax,
48                      Int_t nbinsY, Double_t ymin, Double_t ymax,
49                      Int_t nbinsZ, Double_t zmin, Double_t zmax,
50                      UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0,
51                      Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE);
52   
53   void UserHistogram(const char* histClass,const char *name, const char* title,
54                      const char* binning,
55                      UInt_t valTypeX=kNoAutoFill);
56
57   void UserHistogram(const char* histClass,const char *name, const char* title,
58                      const TVectorD * const binsX,
59                      UInt_t valTypeX=kNoAutoFill);
60   void UserHistogram(const char* histClass,const char *name, const char* title,
61                      const TVectorD * const binsX, const TVectorD * const binsY,
62                      UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0);
63   void UserHistogram(const char* histClass,const char *name, const char* title,
64                      const TVectorD * const binsX, const TVectorD * const binsY, const TVectorD * const binsZ,
65                      UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0);
66   
67   void UserHistogram(const char* histClass, TH1* hist, UInt_t valTypes=kNoAutoFill);
68
69
70   void Fill(const char* histClass, const char* name, Double_t xval);
71   void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval);
72   void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval, Double_t zval);
73   
74 //   void FillClass(const char* histClass, const TVectorD &vals);
75   void FillClass(const char* histClass, Int_t nValues, const Double_t *values);
76
77
78   
79   TH1* GetHistogram(const char* histClass, const char* name) const;
80   TH1* GetHistogram(const char* cutClass, const char* histClass, const char* name) const;
81   
82   void SetHistogramList(THashList &list, Bool_t setOwner=kTRUE);
83   void ResetHistogramList(){fHistoList.Clear();}
84   const THashList* GetHistogramList() const {return &fHistoList;}
85
86   void SetList(TList * const list) { fList=list; }
87   TList *GetList() const { return fList; }
88
89   void AddClass(const char* histClass);
90
91   void DumpToFile(const char* file="histos.root");
92   void ReadFromFile(const char* file="histos.root");
93   
94   virtual void Print(const Option_t* option = "") const;
95   virtual void Draw(const Option_t* option = "");
96   virtual void DrawSame(const char* histName, const Option_t *opt="leg can");
97
98   void SetReservedWords(const char* words);
99 //   virtual void       Add(TObject *obj) {};
100 //   virtual void       Clear(Option_t *option="") {};
101 //   virtual void       Delete(Option_t *option="") {};
102 //   virtual TObject  **GetObjectRef(const TObject *obj) const { return 0; }
103 //   virtual TIterator *MakeIterator(Bool_t dir = kIterForward) const ;
104 //   virtual TObject   *Remove(TObject *obj) { return 0; }
105
106   Bool_t SetCutClass(const char* cutClass);
107
108   void UserTree(const char *name, const char* title);
109   void SetReserveVariableInTree(UInt_t valTypes=kNoAutoFill);
110   void FillTree(Int_t nValues, const Double_t *values);
111   const THashList* GetTreeList() const {return &fTreeList;}  
112   void SetTreeList(THashList &list, Bool_t setOwner=kTRUE);
113   void ResetTreeList(){fTreeList.Clear();}
114   TTree * GetSingleTree() const {return fTree;}
115
116   Double_t fgData[AliDielectronVarManager::kNMaxValues];
117
118 private:
119   THashList fHistoList;             //-> list of histograms
120   THashList fTreeList;             //-> list of histograms
121   TList    *fList;                  //! List of list of histograms
122   TTree    *fTree;
123
124   TString *fReservedWords;          //! list of reserved words
125   void UserHistogramReservedWords(const char* histClass, const TH1 *hist, UInt_t valTypes);
126   void FillClass(THashTable *classTable, Int_t nValues, Double_t *values);
127   
128   void PrintPDF(Option_t* opt);
129   void PrintStructure() const;
130
131   Bool_t IsHistogramOk(const char* classTable, const char* name);
132   
133   enum {kNoAutoFill=1000000000};
134
135
136   
137
138   AliDielectronHistosTaku(const AliDielectronHistosTaku &hist);
139   AliDielectronHistosTaku& operator = (const AliDielectronHistosTaku &hist);
140
141   ClassDef(AliDielectronHistosTaku,2)
142 };
143
144 #endif
145