]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGDQ/dielectron/AliDielectronHistos.h
added a default ctor for root io
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliDielectronHistos.h
CommitLineData
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
5720c765 16#include <Rtypes.h>
b2a297fa 17
18#include <TNamed.h>
19// #include <TCollection.h>
20#include <THashList.h>
ffbede40 21#include <TVectorDfwd.h>
849a30fc 22#include <THnBase.h>
b2a297fa 23
24class TH1;
25class TString;
164bfb53 26class TList;
b2a297fa 27// class TVectorT<double>;
28
29class AliDielectronHistos : public TNamed {
30public:
5720c765 31
b2a297fa 32 AliDielectronHistos();
33 AliDielectronHistos(const char* name, const char* title);
34 virtual ~AliDielectronHistos();
35
36
5720c765 37 void UserProfile(const char* histClass,const char *name, const char* title,
38 UInt_t valTypeP,
39 Int_t nbinsX, Double_t xmin, Double_t xmax,
e4339752 40 UInt_t valTypeX=kNoAutoFill, Bool_t logBinX=kFALSE, TString option="");
5720c765 41
42 void UserProfile(const char* histClass,const char *name, const char* title,
43 UInt_t valTypeP,
44 Int_t nbinsX, Double_t xmin, Double_t xmax,
45 Int_t nbinsY, Double_t ymin, Double_t ymax,
46 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0,
e4339752 47 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, TString option="");
5720c765 48
49 void UserProfile(const char* histClass,const char *name, const char* title,
50 UInt_t valTypeP,
51 Int_t nbinsX, Double_t xmin, Double_t xmax,
52 Int_t nbinsY, Double_t ymin, Double_t ymax,
53 Int_t nbinsZ, Double_t zmin, Double_t zmax,
54 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0,
e4339752 55 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE, TString option="");
5720c765 56
57 void UserProfile(const char* histClass,const char *name, const char* title,
58 UInt_t valTypeP,
e4339752 59 const char* binning, UInt_t valTypeX=kNoAutoFill, TString option="");
5720c765 60
61 void UserProfile(const char* histClass,const char *name, const char* title,
62 UInt_t valTypeP,
e4339752 63 const TVectorD * const binsX, UInt_t valTypeX=kNoAutoFill, TString option="");
5720c765 64
65 void UserProfile(const char* histClass,const char *name, const char* title,
66 UInt_t valTypeP,
67 const TVectorD * const binsX, const TVectorD * const binsY,
e4339752 68 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, TString option="");
5720c765 69
70 void UserProfile(const char* histClass,const char *name, const char* title,
71 UInt_t valTypeP,
72 const TVectorD * const binsX, const TVectorD * const binsY, const TVectorD * const binsZ,
e4339752 73 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0, TString option="");
5720c765 74
80c1dcac 75 void UserHistogram(const char* histClass, Int_t ndim, Int_t *bins, Double_t *mins, Double_t *maxs, UInt_t *vars);
76 void UserSparse(const char* histClass, Int_t ndim, Int_t *bins, Double_t *mins, Double_t *maxs, UInt_t *vars);
5720c765 77
b2a297fa 78 void UserHistogram(const char* histClass,const char *name, const char* title,
80c1dcac 79 Int_t nbinsX, Double_t xmin, Double_t xmax, UInt_t valTypeX=kNoAutoFill, Bool_t logBinX=kFALSE)
5720c765 80 { UserProfile(histClass,name,title,999,nbinsX,xmin,xmax,valTypeX,logBinX); }
81
b2a297fa 82 void UserHistogram(const char* histClass,const char *name, const char* title,
5720c765 83 Int_t nbinsX, Double_t xmin, Double_t xmax, Int_t nbinsY, Double_t ymin, Double_t ymax,
80c1dcac 84 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE)
5720c765 85 { UserProfile(histClass,name,title,999,nbinsX,xmin,xmax,nbinsY,ymin,ymax,valTypeX,valTypeY,logBinX,logBinY); }
86
b2a297fa 87 void UserHistogram(const char* histClass,const char *name, const char* title,
5720c765 88 Int_t nbinsX, Double_t xmin, Double_t xmax, Int_t nbinsY, Double_t ymin, Double_t ymax,
89 Int_t nbinsZ, Double_t zmin, Double_t zmax, UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0,
90 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE)
91 { UserProfile(histClass,name,title,999,nbinsX,xmin,xmax,nbinsY,ymin,ymax,nbinsZ,zmin,zmax,valTypeX,valTypeY,valTypeZ,logBinX,logBinY,logBinZ); }
92
ffbede40 93 void UserHistogram(const char* histClass,const char *name, const char* title,
5720c765 94 const char* binning, UInt_t valTypeX=kNoAutoFill)
95 { UserProfile(histClass,name,title,999,binning,valTypeX); }
ffbede40 96
97 void UserHistogram(const char* histClass,const char *name, const char* title,
5720c765 98 const TVectorD * const binsX, UInt_t valTypeX=kNoAutoFill)
99 { UserProfile(histClass,name,title,999,binsX,valTypeX); }
100
ffbede40 101 void UserHistogram(const char* histClass,const char *name, const char* title,
5720c765 102 const TVectorD * const binsX, const TVectorD * const binsY, UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0)
103 { UserProfile(histClass,name,title,999,binsX,binsY,valTypeX,valTypeY); }
104
ffbede40 105 void UserHistogram(const char* histClass,const char *name, const char* title,
106 const TVectorD * const binsX, const TVectorD * const binsY, const TVectorD * const binsZ,
5720c765 107 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0)
108 { UserProfile(histClass,name,title,999,binsX,binsY,binsZ,valTypeX,valTypeY,valTypeZ); }
ffbede40 109
80c1dcac 110 void UserHistogram(const char* histClass, TObject* hist, UInt_t valTypes=kNoAutoFill);
b2a297fa 111
b2a297fa 112 void Fill(const char* histClass, const char* name, Double_t xval);
113 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval);
114 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval, Double_t zval);
115
116// void FillClass(const char* histClass, const TVectorD &vals);
117 void FillClass(const char* histClass, Int_t nValues, const Double_t *values);
b2a297fa 118
80c1dcac 119 void StoreVariables(TObject *obj, UInt_t valType[20]);
120 void StoreVariables(TH1 *obj, UInt_t valType[20]);
849a30fc 121 void StoreVariables(THnBase *obj, UInt_t valType[20]);
80c1dcac 122 void AdaptNameTitle(TH1 *hist, const char* histClass);
849a30fc 123 Int_t GetPrecision(Double_t value);
80c1dcac 124 void FillVarArray(TObject *obj, UInt_t *valType);
125 void FillValues(TObject *obj, const Double_t *values);
126 void FillValues(TH1 *obj, const Double_t *values);
849a30fc 127 void FillValues(THnBase *obj, const Double_t *values);
80c1dcac 128
129 TObject* GetHist(const char* histClass, const char* name) const;
b2a297fa 130 TH1* GetHistogram(const char* histClass, const char* name) const;
80c1dcac 131 TObject* GetHist(const char* cutClass, const char* histClass, const char* name) const;
164bfb53 132 TH1* GetHistogram(const char* cutClass, const char* histClass, const char* name) const;
849a30fc 133
164bfb53 134 void SetHistogramList(THashList &list, Bool_t setOwner=kTRUE);
572b0139 135 void ResetHistogramList(){fHistoList.Clear();}
b2a297fa 136 const THashList* GetHistogramList() const {return &fHistoList;}
164bfb53 137
138 void SetList(TList * const list) { fList=list; }
139 TList *GetList() const { return fList; }
140
b2a297fa 141 void AddClass(const char* histClass);
142
143 void DumpToFile(const char* file="histos.root");
144 void ReadFromFile(const char* file="histos.root");
145
146 virtual void Print(const Option_t* option = "") const;
147 virtual void Draw(const Option_t* option = "");
148 virtual void DrawSame(const char* histName, const Option_t *opt="leg can");
149
150 void SetReservedWords(const char* words);
80c1dcac 151 // void StoreVarForProfile(TObject *obj, UInt_t valType);
b2a297fa 152// virtual void Add(TObject *obj) {};
153// virtual void Clear(Option_t *option="") {};
154// virtual void Delete(Option_t *option="") {};
155// virtual TObject **GetObjectRef(const TObject *obj) const { return 0; }
156// virtual TIterator *MakeIterator(Bool_t dir = kIterForward) const ;
157// virtual TObject *Remove(TObject *obj) { return 0; }
572b0139 158
164bfb53 159 Bool_t SetCutClass(const char* cutClass);
160
b2a297fa 161private:
162 THashList fHistoList; //-> list of histograms
164bfb53 163 TList *fList; //! List of list of histograms
b2a297fa 164
165 TString *fReservedWords; //! list of reserved words
80c1dcac 166 void UserHistogramReservedWords(const char* histClass, const TObject *hist, UInt_t valTypes);
b2a297fa 167 void FillClass(THashTable *classTable, Int_t nValues, Double_t *values);
168
169 void PrintPDF(Option_t* opt);
170 void PrintStructure() const;
171
172 Bool_t IsHistogramOk(const char* classTable, const char* name);
173
174 enum {kNoAutoFill=1000000000};
175
176 AliDielectronHistos(const AliDielectronHistos &hist);
177 AliDielectronHistos& operator = (const AliDielectronHistos &hist);
178
164bfb53 179 ClassDef(AliDielectronHistos,2)
b2a297fa 180};
181
182#endif
183