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 */
6 ///////////////////////////////////////////////////////////////////////////////////////////
8 // Generic Histogram container with support for groups and filling of groups by passing //
12 // Jens Wiechula <Jens.Wiechula@cern.ch> //
14 ///////////////////////////////////////////////////////////////////////////////////////////
18 // #include <TCollection.h>
19 #include <THashList.h>
20 #include <TVectorDfwd.h>
21 #include "AliDielectronVarManager.h"
28 class AliDielectronVarManager;
29 // class TVectorT<double>;
31 class AliDielectronHistosTaku : public TNamed {
33 AliDielectronHistosTaku();
34 AliDielectronHistosTaku(const char* name, const char* title);
35 virtual ~AliDielectronHistosTaku();
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);
53 void UserHistogram(const char* histClass,const char *name, const char* title,
55 UInt_t valTypeX=kNoAutoFill);
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);
67 void UserHistogram(const char* histClass, TH1* hist, UInt_t valTypes=kNoAutoFill);
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);
74 // void FillClass(const char* histClass, const TVectorD &vals);
75 void FillClass(const char* histClass, Int_t nValues, const Double_t *values);
79 TH1* GetHistogram(const char* histClass, const char* name) const;
80 TH1* GetHistogram(const char* cutClass, const char* histClass, const char* name) const;
82 void SetHistogramList(THashList &list, Bool_t setOwner=kTRUE);
83 void ResetHistogramList(){fHistoList.Clear();}
84 const THashList* GetHistogramList() const {return &fHistoList;}
86 void SetList(TList * const list) { fList=list; }
87 TList *GetList() const { return fList; }
89 void AddClass(const char* histClass);
91 void DumpToFile(const char* file="histos.root");
92 void ReadFromFile(const char* file="histos.root");
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");
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; }
106 Bool_t SetCutClass(const char* cutClass);
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;}
116 Double_t fgData[AliDielectronVarManager::kNMaxValues];
119 THashList fHistoList; //-> list of histograms
120 THashList fTreeList; //-> list of histograms
121 TList *fList; //! List of list of histograms
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);
128 void PrintPDF(Option_t* opt);
129 void PrintStructure() const;
131 Bool_t IsHistogramOk(const char* classTable, const char* name);
133 enum {kNoAutoFill=1000000000};
138 AliDielectronHistosTaku(const AliDielectronHistosTaku &hist);
139 AliDielectronHistosTaku& operator = (const AliDielectronHistosTaku &hist);
141 ClassDef(AliDielectronHistosTaku,2)