]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGDQ/dielectron/AliDielectronHistos.h
including switch to set on/off iso-track core removal, cleaning and bug fix
[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> //
d4619886 13// Julian Book <Julian.Book@cern.ch> //
b2a297fa 14// //
15///////////////////////////////////////////////////////////////////////////////////////////
16
5720c765 17#include <Rtypes.h>
b2a297fa 18
19#include <TNamed.h>
20// #include <TCollection.h>
21#include <THashList.h>
ffbede40 22#include <TVectorDfwd.h>
849a30fc 23#include <THnBase.h>
a94c2e7e 24#include <TBits.h>
b2a297fa 25
26class TH1;
27class TString;
164bfb53 28class TList;
b2a297fa 29// class TVectorT<double>;
30
31class AliDielectronHistos : public TNamed {
32public:
5720c765 33
b2a297fa 34 AliDielectronHistos();
35 AliDielectronHistos(const char* name, const char* title);
36 virtual ~AliDielectronHistos();
37
d4619886 38 enum {kNoAutoFill=1000000000, kNoProfile=999, kNoWeights=998};
35363fb9 39
5720c765 40 void UserProfile(const char* histClass,const char *name, const char* title,
41 UInt_t valTypeP,
42 Int_t nbinsX, Double_t xmin, Double_t xmax,
d4619886 43 UInt_t valTypeX, Bool_t logBinX=kFALSE, TString option="",
44 UInt_t valTypeW=kNoWeights);
5720c765 45
46 void UserProfile(const char* histClass,const char *name, const char* title,
47 UInt_t valTypeP,
48 Int_t nbinsX, Double_t xmin, Double_t xmax,
49 Int_t nbinsY, Double_t ymin, Double_t ymax,
d4619886 50 UInt_t valTypeX, UInt_t valTypeY,
51 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, TString option="",
52 UInt_t valTypeW=kNoWeights);
5720c765 53
54 void UserProfile(const char* histClass,const char *name, const char* title,
55 UInt_t valTypeP,
56 Int_t nbinsX, Double_t xmin, Double_t xmax,
57 Int_t nbinsY, Double_t ymin, Double_t ymax,
58 Int_t nbinsZ, Double_t zmin, Double_t zmax,
d4619886 59 UInt_t valTypeX, UInt_t valTypeY, UInt_t valTypeZ,
60 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE, TString option="",
61 UInt_t valTypeW=kNoWeights);
5720c765 62
63 void UserProfile(const char* histClass,const char *name, const char* title,
64 UInt_t valTypeP,
d4619886 65 const char* binning, UInt_t valTypeX, TString option="",
66 UInt_t valTypeW=kNoWeights);
5720c765 67
68 void UserProfile(const char* histClass,const char *name, const char* title,
69 UInt_t valTypeP,
d4619886 70 const TVectorD * const binsX, UInt_t valTypeX, TString option="",
71 UInt_t valTypeW=kNoWeights);
5720c765 72
73 void UserProfile(const char* histClass,const char *name, const char* title,
74 UInt_t valTypeP,
75 const TVectorD * const binsX, const TVectorD * const binsY,
d4619886 76 UInt_t valTypeX, UInt_t valTypeY, TString option="",
77 UInt_t valTypeW=kNoWeights);
5720c765 78
79 void UserProfile(const char* histClass,const char *name, const char* title,
80 UInt_t valTypeP,
81 const TVectorD * const binsX, const TVectorD * const binsY, const TVectorD * const binsZ,
d4619886 82 UInt_t valTypeX, UInt_t valTypeY, UInt_t valTypeZ, TString option="",
83 UInt_t valTypeW=kNoWeights);
5720c765 84
d4619886 85 void UserHistogram(const char* histClass, Int_t ndim, Int_t *bins, Double_t *mins, Double_t *maxs, UInt_t *vars, UInt_t valTypeW=kNoWeights);
86 void UserSparse( const char* histClass, Int_t ndim, Int_t *bins, Double_t *mins, Double_t *maxs, UInt_t *vars, UInt_t valTypeW=kNoWeights);
87 void UserHistogram(const char* histClass, Int_t ndim, TObjArray *limits, UInt_t *vars, UInt_t valTypeW=kNoWeights);
88 void UserSparse( const char* histClass, Int_t ndim, TObjArray *limits, UInt_t *vars, UInt_t valTypeW=kNoWeights);
5720c765 89
b2a297fa 90 void UserHistogram(const char* histClass,const char *name, const char* title,
a2ec5c0d 91 Int_t nbinsX, Double_t xmin, Double_t xmax, UInt_t valTypeX, Bool_t logBinX=kFALSE,
92 UInt_t valTypeW=kNoWeights)
93 { UserProfile(histClass,name,title,kNoProfile,nbinsX,xmin,xmax,valTypeX,logBinX,"",valTypeW); }
5720c765 94
b2a297fa 95 void UserHistogram(const char* histClass,const char *name, const char* title,
5720c765 96 Int_t nbinsX, Double_t xmin, Double_t xmax, Int_t nbinsY, Double_t ymin, Double_t ymax,
d4619886 97 UInt_t valTypeX, UInt_t valTypeY, Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE,
98 UInt_t valTypeW=kNoWeights)
99 { UserProfile(histClass,name,title,kNoProfile,nbinsX,xmin,xmax,nbinsY,ymin,ymax,valTypeX,valTypeY,logBinX,logBinY,valTypeW); }
5720c765 100
b2a297fa 101 void UserHistogram(const char* histClass,const char *name, const char* title,
5720c765 102 Int_t nbinsX, Double_t xmin, Double_t xmax, Int_t nbinsY, Double_t ymin, Double_t ymax,
d4619886 103 Int_t nbinsZ, Double_t zmin, Double_t zmax, UInt_t valTypeX, UInt_t valTypeY, UInt_t valTypeZ,
104 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE,
105 UInt_t valTypeW=kNoWeights)
106 { UserProfile(histClass,name,title,kNoProfile,nbinsX,xmin,xmax,nbinsY,ymin,ymax,nbinsZ,zmin,zmax,valTypeX,valTypeY,valTypeZ,logBinX,logBinY,logBinZ,valTypeW); }
5720c765 107
ffbede40 108 void UserHistogram(const char* histClass,const char *name, const char* title,
a2ec5c0d 109 const char* binning, UInt_t valTypeX, UInt_t valTypeW=kNoWeights)
110 { UserProfile(histClass,name,title,kNoProfile,binning,valTypeX,"",valTypeW); }
111 // void UserHistogram(const char* histClass,const char *name, const char* title,
112 // const TVectorD * const binsX, UInt_t valTypeX)
113 // { UserProfile(histClass,name,title,kNoProfile,binsX,valTypeX); }
5720c765 114
ffbede40 115 void UserHistogram(const char* histClass,const char *name, const char* title,
a2ec5c0d 116 const TVectorD * const binsX, UInt_t valTypeX, UInt_t valTypeW=kNoWeights)
28b47aed 117 { UserProfile(histClass,name,title,kNoProfile,binsX,valTypeX,"",valTypeW); }
d4619886 118
119 void UserHistogram(const char* histClass,const char *name, const char* title,
120 const TVectorD * const binsX, const TVectorD * const binsY, UInt_t valTypeX, UInt_t valTypeY,
121 UInt_t valTypeW=kNoWeights)
28b47aed 122 { UserProfile(histClass,name,title,kNoProfile,binsX,binsY,valTypeX,valTypeY,"",valTypeW); }
5720c765 123
ffbede40 124 void UserHistogram(const char* histClass,const char *name, const char* title,
125 const TVectorD * const binsX, const TVectorD * const binsY, const TVectorD * const binsZ,
d4619886 126 UInt_t valTypeX, UInt_t valTypeY, UInt_t valTypeZ,
127 UInt_t valTypeW=kNoWeights)
28b47aed 128 { UserProfile(histClass,name,title,kNoProfile,binsX,binsY,binsZ,valTypeX,valTypeY,valTypeZ,"",valTypeW); }
7a1ddc4b 129
80c1dcac 130 void UserHistogram(const char* histClass, TObject* hist, UInt_t valTypes=kNoAutoFill);
b2a297fa 131
d4619886 132 // some functions needed to garantuee backward compatibility
133 void UserHistogram(const char* histClass,const char *name, const char* title,
134 Int_t nbinsX, Double_t xmin, Double_t xmax)
135 { UserProfile(histClass,name,title,kNoProfile,nbinsX,xmin,xmax,kNoAutoFill); }
136 void UserHistogram(const char* histClass,const char *name, const char* title,
137 Int_t nbinsX, Double_t xmin, Double_t xmax,
138 Int_t nbinsY, Double_t ymin, Double_t ymax)
139 { UserProfile(histClass,name,title,kNoProfile,nbinsX,xmin,xmax,nbinsY,ymin,ymax,kNoAutoFill,kNoAutoFill); }
140
141
b2a297fa 142 void Fill(const char* histClass, const char* name, Double_t xval);
143 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval);
144 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval, Double_t zval);
145
146// void FillClass(const char* histClass, const TVectorD &vals);
147 void FillClass(const char* histClass, Int_t nValues, const Double_t *values);
b2a297fa 148
80c1dcac 149 TObject* GetHist(const char* histClass, const char* name) const;
b2a297fa 150 TH1* GetHistogram(const char* histClass, const char* name) const;
80c1dcac 151 TObject* GetHist(const char* cutClass, const char* histClass, const char* name) const;
164bfb53 152 TH1* GetHistogram(const char* cutClass, const char* histClass, const char* name) const;
849a30fc 153
164bfb53 154 void SetHistogramList(THashList &list, Bool_t setOwner=kTRUE);
572b0139 155 void ResetHistogramList(){fHistoList.Clear();}
b2a297fa 156 const THashList* GetHistogramList() const {return &fHistoList;}
164bfb53 157
158 void SetList(TList * const list) { fList=list; }
159 TList *GetList() const { return fList; }
a94c2e7e 160 TBits *GetUsedVars() const { return fUsedVars; }
164bfb53 161
b2a297fa 162 void AddClass(const char* histClass);
163
164 void DumpToFile(const char* file="histos.root");
165 void ReadFromFile(const char* file="histos.root");
166
167 virtual void Print(const Option_t* option = "") const;
168 virtual void Draw(const Option_t* option = "");
169 virtual void DrawSame(const char* histName, const Option_t *opt="leg can");
170
171 void SetReservedWords(const char* words);
2874f304 172
b2a297fa 173// virtual void Add(TObject *obj) {};
174// virtual void Clear(Option_t *option="") {};
175// virtual void Delete(Option_t *option="") {};
176// virtual TObject **GetObjectRef(const TObject *obj) const { return 0; }
177// virtual TIterator *MakeIterator(Bool_t dir = kIterForward) const ;
178// virtual TObject *Remove(TObject *obj) { return 0; }
572b0139 179
164bfb53 180 Bool_t SetCutClass(const char* cutClass);
35363fb9 181 static void StoreVariables(TObject *obj, UInt_t valType[20]);
182 static void StoreVariables(TH1 *obj, UInt_t valType[20]);
183 static void StoreVariables(THnBase *obj, UInt_t valType[20]);
184 static void AdaptNameTitle(TH1 *hist, const char* histClass);
185 static Int_t GetPrecision(Double_t value);
186 static void FillValues(TObject *obj, const Double_t *values);
187 static void FillValues(TH1 *obj, const Double_t *values);
188 static void FillValues(THnBase *obj, const Double_t *values);
189
b2a297fa 190private:
2874f304 191
2874f304 192 void FillVarArray(TObject *obj, UInt_t *valType);
2874f304 193
a94c2e7e 194
b2a297fa 195 THashList fHistoList; //-> list of histograms
164bfb53 196 TList *fList; //! List of list of histograms
a94c2e7e 197 TBits *fUsedVars; // list of used variables
b2a297fa 198
199 TString *fReservedWords; //! list of reserved words
80c1dcac 200 void UserHistogramReservedWords(const char* histClass, const TObject *hist, UInt_t valTypes);
b2a297fa 201 void FillClass(THashTable *classTable, Int_t nValues, Double_t *values);
202
203 void PrintPDF(Option_t* opt);
204 void PrintStructure() const;
205
206 Bool_t IsHistogramOk(const char* classTable, const char* name);
207
b2a297fa 208
209 AliDielectronHistos(const AliDielectronHistos &hist);
210 AliDielectronHistos& operator = (const AliDielectronHistos &hist);
211
a94c2e7e 212 ClassDef(AliDielectronHistos,3)
b2a297fa 213};
214
215#endif
216