]>
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; | |
23 | // class TVectorT<double>; | |
24 | ||
25 | class AliDielectronHistos : public TNamed { | |
26 | public: | |
27 | AliDielectronHistos(); | |
28 | AliDielectronHistos(const char* name, const char* title); | |
29 | virtual ~AliDielectronHistos(); | |
30 | ||
31 | ||
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); | |
44 | ||
45 | void UserHistogram(const char* histClass, TH1* hist, UInt_t valTypes=kNoAutoFill); | |
46 | ||
47 | ||
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); | |
51 | ||
52 | // void FillClass(const char* histClass, const TVectorD &vals); | |
53 | void FillClass(const char* histClass, Int_t nValues, const Double_t *values); | |
54 | ||
55 | ||
56 | TH1* GetHistogram(const char* histClass, const char* name) const; | |
57 | ||
58 | void SetHistogramList(THashList &list); | |
59 | const THashList* GetHistogramList() const {return &fHistoList;} | |
60 | ||
61 | void AddClass(const char* histClass); | |
62 | ||
63 | void DumpToFile(const char* file="histos.root"); | |
64 | void ReadFromFile(const char* file="histos.root"); | |
65 | ||
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"); | |
69 | ||
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; } | |
77 | ||
78 | private: | |
79 | THashList fHistoList; //-> list of histograms | |
80 | ||
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); | |
84 | ||
85 | void PrintPDF(Option_t* opt); | |
86 | void PrintStructure() const; | |
87 | ||
88 | Bool_t IsHistogramOk(const char* classTable, const char* name); | |
89 | ||
90 | enum {kNoAutoFill=1000000000}; | |
91 | ||
92 | AliDielectronHistos(const AliDielectronHistos &hist); | |
93 | AliDielectronHistos& operator = (const AliDielectronHistos &hist); | |
94 | ||
95 | ClassDef(AliDielectronHistos,1) | |
96 | }; | |
97 | ||
98 | #endif | |
99 |