]>
Commit | Line | Data |
---|---|---|
b2a297fa | 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 */ | |
5 | ||
6 | /////////////////////////////////////////////////////////////////////////////////////////// | |
7 | // // | |
8 | // Generic Histogram container with support for groups and filling of groups by passing // | |
9 | // a vector of data // | |
10 | // // | |
11 | // Authors: // | |
12 | // Jens Wiechula <Jens.Wiechula@cern.ch> // | |
13 | // // | |
14 | /////////////////////////////////////////////////////////////////////////////////////////// | |
15 | ||
16 | ||
17 | #include <TNamed.h> | |
18 | // #include <TCollection.h> | |
19 | #include <THashList.h> | |
20 | ||
21 | class TH1; | |
22 | class TString; | |
164bfb53 | 23 | class TList; |
b2a297fa | 24 | // class TVectorT<double>; |
25 | ||
26 | class AliDielectronHistos : public TNamed { | |
27 | public: | |
28 | AliDielectronHistos(); | |
29 | AliDielectronHistos(const char* name, const char* title); | |
30 | virtual ~AliDielectronHistos(); | |
31 | ||
32 | ||
33 | void UserHistogram(const char* histClass,const char *name, const char* title, | |
34 | Int_t nbinsX, Double_t xmin, Double_t xmax, | |
572b0139 | 35 | UInt_t valTypeX=kNoAutoFill, Bool_t logBinX=kFALSE); |
b2a297fa | 36 | void UserHistogram(const char* histClass,const char *name, const char* title, |
37 | Int_t nbinsX, Double_t xmin, Double_t xmax, | |
38 | Int_t nbinsY, Double_t ymin, Double_t ymax, | |
572b0139 | 39 | UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, |
40 | Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE); | |
b2a297fa | 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 | Int_t nbinsZ, Double_t zmin, Double_t zmax, | |
572b0139 | 45 | UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0, |
46 | Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE); | |
b2a297fa | 47 | |
48 | void UserHistogram(const char* histClass, TH1* hist, UInt_t valTypes=kNoAutoFill); | |
49 | ||
50 | ||
51 | void Fill(const char* histClass, const char* name, Double_t xval); | |
52 | void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval); | |
53 | void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval, Double_t zval); | |
54 | ||
55 | // void FillClass(const char* histClass, const TVectorD &vals); | |
56 | void FillClass(const char* histClass, Int_t nValues, const Double_t *values); | |
57 | ||
58 | ||
59 | TH1* GetHistogram(const char* histClass, const char* name) const; | |
164bfb53 | 60 | TH1* GetHistogram(const char* cutClass, const char* histClass, const char* name) const; |
61 | ||
62 | void SetHistogramList(THashList &list, Bool_t setOwner=kTRUE); | |
572b0139 | 63 | void ResetHistogramList(){fHistoList.Clear();} |
b2a297fa | 64 | const THashList* GetHistogramList() const {return &fHistoList;} |
164bfb53 | 65 | |
66 | void SetList(TList * const list) { fList=list; } | |
67 | TList *GetList() const { return fList; } | |
68 | ||
b2a297fa | 69 | void AddClass(const char* histClass); |
70 | ||
71 | void DumpToFile(const char* file="histos.root"); | |
72 | void ReadFromFile(const char* file="histos.root"); | |
73 | ||
74 | virtual void Print(const Option_t* option = "") const; | |
75 | virtual void Draw(const Option_t* option = ""); | |
76 | virtual void DrawSame(const char* histName, const Option_t *opt="leg can"); | |
77 | ||
78 | void SetReservedWords(const char* words); | |
79 | // virtual void Add(TObject *obj) {}; | |
80 | // virtual void Clear(Option_t *option="") {}; | |
81 | // virtual void Delete(Option_t *option="") {}; | |
82 | // virtual TObject **GetObjectRef(const TObject *obj) const { return 0; } | |
83 | // virtual TIterator *MakeIterator(Bool_t dir = kIterForward) const ; | |
84 | // virtual TObject *Remove(TObject *obj) { return 0; } | |
572b0139 | 85 | |
164bfb53 | 86 | Bool_t SetCutClass(const char* cutClass); |
87 | ||
b2a297fa | 88 | private: |
89 | THashList fHistoList; //-> list of histograms | |
164bfb53 | 90 | TList *fList; //! List of list of histograms |
b2a297fa | 91 | |
92 | TString *fReservedWords; //! list of reserved words | |
93 | void UserHistogramReservedWords(const char* histClass, TH1 *hist, UInt_t valTypes); | |
94 | void FillClass(THashTable *classTable, Int_t nValues, Double_t *values); | |
95 | ||
96 | void PrintPDF(Option_t* opt); | |
97 | void PrintStructure() const; | |
98 | ||
99 | Bool_t IsHistogramOk(const char* classTable, const char* name); | |
100 | ||
572b0139 | 101 | Double_t* MakeLogBinning(Int_t nbinsX, Double_t xmin, Double_t xmax) const; |
102 | Double_t* MakeLinBinning(Int_t nbinsX, Double_t xmin, Double_t xmax) const; | |
103 | ||
b2a297fa | 104 | enum {kNoAutoFill=1000000000}; |
105 | ||
106 | AliDielectronHistos(const AliDielectronHistos &hist); | |
107 | AliDielectronHistos& operator = (const AliDielectronHistos &hist); | |
108 | ||
164bfb53 | 109 | ClassDef(AliDielectronHistos,2) |
b2a297fa | 110 | }; |
111 | ||
112 | #endif | |
113 |