correct coverity reports on FORWARD_NULL, usage of sprintf and UNINIT variables in...
[u/mrichter/AliRoot.git] / PWG3 / 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
16
17#include <TNamed.h>
18// #include <TCollection.h>
19#include <THashList.h>
20
21class TH1;
22class TString;
23// class TVectorT<double>;
24
25class AliDielectronHistos : public TNamed {
26public:
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,
572b0139 34 UInt_t valTypeX=kNoAutoFill, Bool_t logBinX=kFALSE);
b2a297fa 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,
572b0139 38 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0,
39 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE);
b2a297fa 40 void UserHistogram(const char* histClass,const char *name, const char* title,
41 Int_t nbinsX, Double_t xmin, Double_t xmax,
42 Int_t nbinsY, Double_t ymin, Double_t ymax,
43 Int_t nbinsZ, Double_t zmin, Double_t zmax,
572b0139 44 UInt_t valTypeX=kNoAutoFill, UInt_t valTypeY=0, UInt_t valTypeZ=0,
45 Bool_t logBinX=kFALSE, Bool_t logBinY=kFALSE, Bool_t logBinZ=kFALSE);
b2a297fa 46
47 void UserHistogram(const char* histClass, TH1* hist, UInt_t valTypes=kNoAutoFill);
48
49
50 void Fill(const char* histClass, const char* name, Double_t xval);
51 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval);
52 void Fill(const char* histClass, const char* name, Double_t xval, Double_t yval, Double_t zval);
53
54// void FillClass(const char* histClass, const TVectorD &vals);
55 void FillClass(const char* histClass, Int_t nValues, const Double_t *values);
56
57
58 TH1* GetHistogram(const char* histClass, const char* name) const;
59
60 void SetHistogramList(THashList &list);
572b0139 61 void ResetHistogramList(){fHistoList.Clear();}
b2a297fa 62 const THashList* GetHistogramList() const {return &fHistoList;}
63
64 void AddClass(const char* histClass);
65
66 void DumpToFile(const char* file="histos.root");
67 void ReadFromFile(const char* file="histos.root");
68
69 virtual void Print(const Option_t* option = "") const;
70 virtual void Draw(const Option_t* option = "");
71 virtual void DrawSame(const char* histName, const Option_t *opt="leg can");
72
73 void SetReservedWords(const char* words);
74// virtual void Add(TObject *obj) {};
75// virtual void Clear(Option_t *option="") {};
76// virtual void Delete(Option_t *option="") {};
77// virtual TObject **GetObjectRef(const TObject *obj) const { return 0; }
78// virtual TIterator *MakeIterator(Bool_t dir = kIterForward) const ;
79// virtual TObject *Remove(TObject *obj) { return 0; }
572b0139 80
b2a297fa 81private:
82 THashList fHistoList; //-> list of histograms
83
84 TString *fReservedWords; //! list of reserved words
85 void UserHistogramReservedWords(const char* histClass, TH1 *hist, UInt_t valTypes);
86 void FillClass(THashTable *classTable, Int_t nValues, Double_t *values);
87
88 void PrintPDF(Option_t* opt);
89 void PrintStructure() const;
90
91 Bool_t IsHistogramOk(const char* classTable, const char* name);
92
572b0139 93 Double_t* MakeLogBinning(Int_t nbinsX, Double_t xmin, Double_t xmax) const;
94 Double_t* MakeLinBinning(Int_t nbinsX, Double_t xmin, Double_t xmax) const;
95
b2a297fa 96 enum {kNoAutoFill=1000000000};
97
98 AliDielectronHistos(const AliDielectronHistos &hist);
99 AliDielectronHistos& operator = (const AliDielectronHistos &hist);
100
101 ClassDef(AliDielectronHistos,1)
102};
103
104#endif
105