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>
23 // class TVectorT<double>;
25 class AliDielectronHistos : public TNamed {
27 AliDielectronHistos();
28 AliDielectronHistos(const char* name, const char* title);
29 virtual ~AliDielectronHistos();
32 void UserHistogram(const char* histClass,const char *name, const char* title,
33 Int_t nbinsX, Double_t xmin, Double_t xmax,
34 UInt_t valTypeX=kNoAutoFill);
35 void UserHistogram(const char* histClass,const char *name, const char* title,
36 Int_t nbinsX, Double_t xmin, Double_t xmax,
37 Int_t nbinsY, Double_t ymin, Double_t ymax,
38 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0);
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 Int_t nbinsZ, Double_t zmin, Double_t zmax,
43 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0);
45 void UserHistogram(const char* histClass, TH1* hist, UInt_t valTypes=kNoAutoFill);
48 void Fill(const char* histClass, const char* name, Double_t xval);
49 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval);
50 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval, Double_t zval);
52 // void FillClass(const char* histClass, const TVectorD &vals);
53 void FillClass(const char* histClass, Int_t nValues, const Double_t *values);
56 TH1* GetHistogram(const char* histClass, const char* name) const;
58 void SetHistogramList(THashList &list);
59 const THashList* GetHistogramList() const {return &fHistoList;}
61 void AddClass(const char* histClass);
63 void DumpToFile(const char* file="histos.root");
64 void ReadFromFile(const char* file="histos.root");
66 virtual void Print(const Option_t* option = "") const;
67 virtual void Draw(const Option_t* option = "");
68 virtual void DrawSame(const char* histName, const Option_t *opt="leg can");
70 void SetReservedWords(const char* words);
71 // virtual void Add(TObject *obj) {};
72 // virtual void Clear(Option_t *option="") {};
73 // virtual void Delete(Option_t *option="") {};
74 // virtual TObject **GetObjectRef(const TObject *obj) const { return 0; }
75 // virtual TIterator *MakeIterator(Bool_t dir = kIterForward) const ;
76 // virtual TObject *Remove(TObject *obj) { return 0; }
79 THashList fHistoList; //-> list of histograms
81 TString *fReservedWords; //! list of reserved words
82 void UserHistogramReservedWords(const char* histClass, TH1 *hist, UInt_t valTypes);
83 void FillClass(THashTable *classTable, Int_t nValues, Double_t *values);
85 void PrintPDF(Option_t* opt);
86 void PrintStructure() const;
88 Bool_t IsHistogramOk(const char* classTable, const char* name);
90 enum {kNoAutoFill=1000000000};
92 AliDielectronHistos(const AliDielectronHistos &hist);
93 AliDielectronHistos& operator = (const AliDielectronHistos &hist);
95 ClassDef(AliDielectronHistos,1)