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 */
8 ///////////////////////////////////////////////////////////////////////////////////////////
10 // Generic Histogram container with support for groups and filling of groups by passing //
11 // a vector of data //
14 // Jens Wiechula <Jens.Wiechula@cern.ch> //
16 ///////////////////////////////////////////////////////////////////////////////////////////
20 // #include <TCollection.h>
21 #include <THashList.h>
22 #include <TVectorDfwd.h>
27 // class TVectorT<double>;
29 class AliDielectronHistos : public TNamed {
31 AliDielectronHistos();
32 AliDielectronHistos(const char* name, const char* title);
33 virtual ~AliDielectronHistos();
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);
51 void UserHistogram(const char* histClass,const char *name, const char* title,
53 UInt_t valTypeX=kNoAutoFill);
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);
65 void UserHistogram(const char* histClass, TH1* hist, UInt_t valTypes=kNoAutoFill);
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);
72 // void FillClass(const char* histClass, const TVectorD &vals);
73 void FillClass(const char* histClass, Int_t nValues, const Double_t *values);
76 TH1* GetHistogram(const char* histClass, const char* name) const;
77 TH1* GetHistogram(const char* cutClass, const char* histClass, const char* name) const;
79 void SetHistogramList(THashList &list, Bool_t setOwner=kTRUE);
80 void ResetHistogramList(){fHistoList.Clear();}
81 const THashList* GetHistogramList() const {return &fHistoList;}
83 void SetList(TList * const list) { fList=list; }
84 TList *GetList() const { return fList; }
86 void AddClass(const char* histClass);
88 void DumpToFile(const char* file="histos.root");
89 void ReadFromFile(const char* file="histos.root");
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");
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; }
103 Bool_t SetCutClass(const char* cutClass);
106 THashList fHistoList; //-> list of histograms
107 TList *fList; //! List of list of histograms
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);
113 void PrintPDF(Option_t* opt);
114 void PrintStructure() const;
116 Bool_t IsHistogramOk(const char* classTable, const char* name);
118 enum {kNoAutoFill=1000000000};
120 AliDielectronHistos(const AliDielectronHistos &hist);
121 AliDielectronHistos& operator = (const AliDielectronHistos &hist);
123 ClassDef(AliDielectronHistos,2)