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 ///////////////////////////////////////////////////////////////////////////////////////////
19 // #include <TCollection.h>
20 #include <THashList.h>
21 #include <TVectorDfwd.h>
26 // class TVectorT<double>;
28 class AliDielectronHistos : public TNamed {
31 AliDielectronHistos();
32 AliDielectronHistos(const char* name, const char* title);
33 virtual ~AliDielectronHistos();
36 void UserProfile(const char* histClass,const char *name, const char* title,
38 Int_t nbinsX, Double_t xmin, Double_t xmax,
39 UInt_t valTypeX=kNoAutoFill, Bool_t logBinX=kFALSE);
41 void UserProfile(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 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0,
46 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE);
48 void UserProfile(const char* histClass,const char *name, const char* title,
50 Int_t nbinsX, Double_t xmin, Double_t xmax,
51 Int_t nbinsY, Double_t ymin, Double_t ymax,
52 Int_t nbinsZ, Double_t zmin, Double_t zmax,
53 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0,
54 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE);
56 void UserProfile(const char* histClass,const char *name, const char* title,
58 const char* binning, UInt_t valTypeX=kNoAutoFill);
60 void UserProfile(const char* histClass,const char *name, const char* title,
62 const TVectorD * const binsX, UInt_t valTypeX=kNoAutoFill);
64 void UserProfile(const char* histClass,const char *name, const char* title,
66 const TVectorD * const binsX, const TVectorD * const binsY,
67 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0);
69 void UserProfile(const char* histClass,const char *name, const char* title,
71 const TVectorD * const binsX, const TVectorD * const binsY, const TVectorD * const binsZ,
72 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0);
75 void UserHistogram(const char* histClass,const char *name, const char* title,
76 Int_t nbinsX, Double_t xmin, Double_t xmax, UInt_t valTypeX=kNoAutoFill, Bool_t logBinX=kFALSE)
77 { UserProfile(histClass,name,title,999,nbinsX,xmin,xmax,valTypeX,logBinX); }
79 void UserHistogram(const char* histClass,const char *name, const char* title,
80 Int_t nbinsX, Double_t xmin, Double_t xmax, Int_t nbinsY, Double_t ymin, Double_t ymax,
81 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE)
82 { UserProfile(histClass,name,title,999,nbinsX,xmin,xmax,nbinsY,ymin,ymax,valTypeX,valTypeY,logBinX,logBinY); }
84 void UserHistogram(const char* histClass,const char *name, const char* title,
85 Int_t nbinsX, Double_t xmin, Double_t xmax, Int_t nbinsY, Double_t ymin, Double_t ymax,
86 Int_t nbinsZ, Double_t zmin, Double_t zmax, UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0,
87 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE)
88 { UserProfile(histClass,name,title,999,nbinsX,xmin,xmax,nbinsY,ymin,ymax,nbinsZ,zmin,zmax,valTypeX,valTypeY,valTypeZ,logBinX,logBinY,logBinZ); }
90 void UserHistogram(const char* histClass,const char *name, const char* title,
91 const char* binning, UInt_t valTypeX=kNoAutoFill)
92 { UserProfile(histClass,name,title,999,binning,valTypeX); }
94 void UserHistogram(const char* histClass,const char *name, const char* title,
95 const TVectorD * const binsX, UInt_t valTypeX=kNoAutoFill)
96 { UserProfile(histClass,name,title,999,binsX,valTypeX); }
98 void UserHistogram(const char* histClass,const char *name, const char* title,
99 const TVectorD * const binsX, const TVectorD * const binsY, UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0)
100 { UserProfile(histClass,name,title,999,binsX,binsY,valTypeX,valTypeY); }
102 void UserHistogram(const char* histClass,const char *name, const char* title,
103 const TVectorD * const binsX, const TVectorD * const binsY, const TVectorD * const binsZ,
104 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0)
105 { UserProfile(histClass,name,title,999,binsX,binsY,binsZ,valTypeX,valTypeY,valTypeZ); }
107 void UserHistogram(const char* histClass, TH1* hist, UInt_t valTypes=kNoAutoFill);
109 void Fill(const char* histClass, const char* name, Double_t xval);
110 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval);
111 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval, Double_t zval);
113 // void FillClass(const char* histClass, const TVectorD &vals);
114 void FillClass(const char* histClass, Int_t nValues, const Double_t *values);
117 TH1* GetHistogram(const char* histClass, const char* name) const;
118 TH1* GetHistogram(const char* cutClass, const char* histClass, const char* name) const;
120 void SetHistogramList(THashList &list, Bool_t setOwner=kTRUE);
121 void ResetHistogramList(){fHistoList.Clear();}
122 const THashList* GetHistogramList() const {return &fHistoList;}
124 void SetList(TList * const list) { fList=list; }
125 TList *GetList() const { return fList; }
127 void AddClass(const char* histClass);
129 void DumpToFile(const char* file="histos.root");
130 void ReadFromFile(const char* file="histos.root");
132 virtual void Print(const Option_t* option = "") const;
133 virtual void Draw(const Option_t* option = "");
134 virtual void DrawSame(const char* histName, const Option_t *opt="leg can");
136 void SetReservedWords(const char* words);
137 void StoreVarForProfile(TObject *obj, UInt_t valType);
138 // virtual void Add(TObject *obj) {};
139 // virtual void Clear(Option_t *option="") {};
140 // virtual void Delete(Option_t *option="") {};
141 // virtual TObject **GetObjectRef(const TObject *obj) const { return 0; }
142 // virtual TIterator *MakeIterator(Bool_t dir = kIterForward) const ;
143 // virtual TObject *Remove(TObject *obj) { return 0; }
145 Bool_t SetCutClass(const char* cutClass);
148 THashList fHistoList; //-> list of histograms
149 TList *fList; //! List of list of histograms
151 TString *fReservedWords; //! list of reserved words
152 void UserHistogramReservedWords(const char* histClass, const TH1 *hist, UInt_t valTypes);
153 void FillClass(THashTable *classTable, Int_t nValues, Double_t *values);
155 void PrintPDF(Option_t* opt);
156 void PrintStructure() const;
158 Bool_t IsHistogramOk(const char* classTable, const char* name);
160 enum {kNoAutoFill=1000000000};
162 AliDielectronHistos(const AliDielectronHistos &hist);
163 AliDielectronHistos& operator = (const AliDielectronHistos &hist);
165 ClassDef(AliDielectronHistos,2)