]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/Tools/THistManager.h
Replace c-string by stl string in order to fix coverity defects
[u/mrichter/AliRoot.git] / PWG / Tools / THistManager.h
CommitLineData
c877a771 1#ifndef THISTMANAGER_H
2#define THISTMANAGER_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6// Author: Markus Fasel
7
c877a771 8#include <TNamed.h>
9
10class TArrayD;
11class TAxis;
12class TList;
13class THashList;
14
c877a771 15class THistManager : public TNamed {
16public:
17 THistManager();
18 THistManager(const char *name);
19 ~THistManager();
20 void ReleaseOwner() { fIsOwner = kFALSE; };
21
1f65e0e2 22 void CreateHistoGroup(const char *groupname, const char *parent = "/");
23
24 void CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax);
25 void CreateTH1(const char *name, const char *title, int nbins, const double *xbins);
26 void CreateTH1(const char *name, const char *title, const TArrayD &xbins);
27 void CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax);
28 void CreateTH2(const char *name, const char *title, int nbinsx, const double *xbins, int nbinsy, const double *ybins);
29 void CreateTH2(const char *name, const char *title, const TArrayD &xbins, const TArrayD &ybins);
30 void CreateTH3(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int nbinsz, double zmin, double zmax);
31 void CreateTH3(const char *name, const char *title, int nbinsx, const double *xbins, int nbinsy, const double *ybins, int nbinsz, const double *zbins);
32 void CreateTH3(const char *name, const char *title, const TArrayD &xbins, const TArrayD &ybins, const TArrayD &zbins);
33 void CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max);
34 void CreateTHnSparse(const char *name, const char *title, int ndim, const TAxis **axes);
35 void SetObject(TObject * const o, const char *group = "/");
36 void FillTH1(const char *hname, double x, double weight = 1.);
37 void FillTH2(const char *hname, double x, double y, double weight = 1.);
38 void FillTH2(const char *hname, double *point, double weight = 1.);
39 void FillTH3(const char *hname, double x, double y, double z, double weight = 1.);
40 void FillTH3(const char *hname, const double *point, double weight = 1.);
41 void FillTHnSparse(const char *name, const double *x, double weight = 1.);
c877a771 42
43 THashList *GetListOfHistograms() { return fHistos; }
44 TObject *FindObject(const char *name) const;
1f65e0e2 45 virtual TObject *FindObject(const TObject *obj) const;
c877a771 46
47private:
48 THistManager(const THistManager &);
49 THistManager &operator=(const THistManager &);
50 THashList *FindGroup(const char *dirname) const;
51 void TokenizeFilename(const char *name, const char *delim, std::vector<std::string> &listoftokens) const;
52 const char *basename(const char *path) const;
53 const char *histname(const char *path) const;
54
55 THashList *fHistos; // List of histograms
56 bool fIsOwner; // Set the ownership
57
58 ClassDef(THistManager, 1); // Container for histograms
59};
60
61#endif