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>
25 // class TVectorT<double>;
27 class AliDielectronHistos : public TNamed {
29 AliDielectronHistos();
30 AliDielectronHistos(const char* name, const char* title);
31 virtual ~AliDielectronHistos();
34 void UserHistogram(const char* histClass,const char *name, const char* title,
35 Int_t nbinsX, Double_t xmin, Double_t xmax,
36 UInt_t valTypeX=kNoAutoFill, Bool_t logBinX=kFALSE);
37 void UserHistogram(const char* histClass,const char *name, const char* title,
38 Int_t nbinsX, Double_t xmin, Double_t xmax,
39 Int_t nbinsY, Double_t ymin, Double_t ymax,
40 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0,
41 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE);
42 void UserHistogram(const char* histClass,const char *name, const char* title,
43 Int_t nbinsX, Double_t xmin, Double_t xmax,
44 Int_t nbinsY, Double_t ymin, Double_t ymax,
45 Int_t nbinsZ, Double_t zmin, Double_t zmax,
46 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0,
47 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE);
49 void UserHistogram(const char* histClass,const char *name, const char* title,
51 UInt_t valTypeX=kNoAutoFill);
53 void UserHistogram(const char* histClass,const char *name, const char* title,
54 const TVectorD * const binsX,
55 UInt_t valTypeX=kNoAutoFill);
56 void UserHistogram(const char* histClass,const char *name, const char* title,
57 const TVectorD * const binsX, const TVectorD * const binsY,
58 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0);
59 void UserHistogram(const char* histClass,const char *name, const char* title,
60 const TVectorD * const binsX, const TVectorD * const binsY, const TVectorD * const binsZ,
61 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0);
63 void UserHistogram(const char* histClass, TH1* hist, UInt_t valTypes=kNoAutoFill);
66 void Fill(const char* histClass, const char* name, Double_t xval);
67 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval);
68 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval, Double_t zval);
70 // void FillClass(const char* histClass, const TVectorD &vals);
71 void FillClass(const char* histClass, Int_t nValues, const Double_t *values);
74 TH1* GetHistogram(const char* histClass, const char* name) const;
75 TH1* GetHistogram(const char* cutClass, const char* histClass, const char* name) const;
77 void SetHistogramList(THashList &list, Bool_t setOwner=kTRUE);
78 void ResetHistogramList(){fHistoList.Clear();}
79 const THashList* GetHistogramList() const {return &fHistoList;}
81 void SetList(TList * const list) { fList=list; }
82 TList *GetList() const { return fList; }
84 void AddClass(const char* histClass);
86 void DumpToFile(const char* file="histos.root");
87 void ReadFromFile(const char* file="histos.root");
89 virtual void Print(const Option_t* option = "") const;
90 virtual void Draw(const Option_t* option = "");
91 virtual void DrawSame(const char* histName, const Option_t *opt="leg can");
93 void SetReservedWords(const char* words);
94 // virtual void Add(TObject *obj) {};
95 // virtual void Clear(Option_t *option="") {};
96 // virtual void Delete(Option_t *option="") {};
97 // virtual TObject **GetObjectRef(const TObject *obj) const { return 0; }
98 // virtual TIterator *MakeIterator(Bool_t dir = kIterForward) const ;
99 // virtual TObject *Remove(TObject *obj) { return 0; }
101 Bool_t SetCutClass(const char* cutClass);
104 THashList fHistoList; //-> list of histograms
105 TList *fList; //! List of list of histograms
107 TString *fReservedWords; //! list of reserved words
108 void UserHistogramReservedWords(const char* histClass, const TH1 *hist, UInt_t valTypes);
109 void FillClass(THashTable *classTable, Int_t nValues, Double_t *values);
111 void PrintPDF(Option_t* opt);
112 void PrintStructure() const;
114 Bool_t IsHistogramOk(const char* classTable, const char* name);
116 enum {kNoAutoFill=1000000000};
118 AliDielectronHistos(const AliDielectronHistos &hist);
119 AliDielectronHistos& operator = (const AliDielectronHistos &hist);
121 ClassDef(AliDielectronHistos,2)