KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVHistogram.h
Go to the documentation of this file.
1 
4 #ifndef __KVHISTOGRAM_H
5 #define __KVHISTOGRAM_H
6 
7 #include "KVBase.h"
8 #include "TH1.h"
9 #include "TCutG.h"
10 #include "KVNameValueList.h"
11 
19 class KVHistogram : public KVBase {
20 protected:
24 
25  Double_t GetMean(Int_t axis = 1) const;
26 
27 public:
28  KVHistogram(TH1* h = nullptr);
29  KVHistogram(TCutG* cut);
30  virtual ~KVHistogram();
31 
32  static void ParseHistoTitle(const Char_t* title, KVString& exp, KVString& sel, KVString& weight);
33  static void ParseExpressionString(const Char_t* exp, KVString& varX, KVString& varY,
34  KVString& varZ);
35 
36  TH1* GetHisto() const
37  {
38  return fHisto;
39  }
40  TCutG* GetCut() const
41  {
42  return fCut;
43  }
44  Bool_t IsProfile() const
45  {
46  return (fHisto && fHisto->InheritsFrom("TProfile"));
47  }
48  Bool_t IsTH2() const
49  {
50  return (fHisto && fHisto->InheritsFrom("TH2"));
51  }
52  Bool_t IsTH1() const
53  {
54  return (fHisto && !IsProfile() && !IsTH2());
55  }
56  const Char_t* GetExpression() const;
57  const Char_t* GetHistoTitle() const;
58  const Char_t* GetVarX() const;
59  const Char_t* GetVarY() const;
60  const Char_t* GetVarZ() const;
61  const Char_t* GetSelection() const;
62  const Char_t* GetWeight() const;
64  {
65  return GetMean();
66  }
68  {
69  return GetMean(2);
70  }
71  const Char_t* GetMeanRMSX() const;
72  const Char_t* GetMeanRMSY() const;
73 
74  void SetWeight(const Char_t*);
75 
76  void ls(Option_t* option = "") const;
77 
78  TObject* GetObject() const;
80 
81  ClassDef(KVHistogram, 1) //Wrapper for histograms used by KVTreeAnalyzer
82 };
83 
84 #endif
int Int_t
char Char_t
bool Bool_t
double Double_t
const char Option_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:135
Wrapper for histograms and graphical cuts used by KVTreeAnalyzer.
Definition: KVHistogram.h:19
const Char_t * GetHistoTitle() const
TCutG * GetCut() const
Definition: KVHistogram.h:40
const Char_t * GetVarZ() const
static void ParseExpressionString(const Char_t *exp, KVString &varX, KVString &varY, KVString &varZ)
Parse expression strings "VARZ:VARY:VARX" or "VARY:VARX" or "VARX".
static void ParseHistoTitle(const Char_t *title, KVString &exp, KVString &sel, KVString &weight)
void SetWeight(const Char_t *)
Set weighting factor used to fill histogram.
const Char_t * GetVarY() const
const Char_t * GetMeanRMSY() const
const Char_t * GetExpression() const
Bool_t IsProfile() const
Definition: KVHistogram.h:44
Double_t GetMeanX() const
Definition: KVHistogram.h:63
KVHistogram(TH1 *h=nullptr)
Default constructor.
Definition: KVHistogram.cpp:47
Double_t GetMean(Int_t axis=1) const
Definition: KVHistogram.cpp:36
TH1 * fHisto
pointer to histogram
Definition: KVHistogram.h:21
void ls(Option_t *option="") const
const Char_t * GetSelection() const
TH1 * GetHisto() const
Definition: KVHistogram.h:36
TObject * GetObject() const
In order to have context menu access to the contained histogram or cut.
const Char_t * GetWeight() const
Return weighting used for filling histogram.
const Char_t * GetMeanRMSX() const
Double_t GetMeanY() const
Definition: KVHistogram.h:67
const Char_t * GetVarX() const
Bool_t IsTH2() const
Definition: KVHistogram.h:48
virtual ~KVHistogram()
Destructor.
Definition: KVHistogram.cpp:89
Bool_t IsTH1() const
Definition: KVHistogram.h:52
KVNameValueList fParams
histogram parameters
Definition: KVHistogram.h:23
void ParseExpressionAndSelection()
Definition: KVHistogram.cpp:14
TCutG * fCut
pointer to cut
Definition: KVHistogram.h:22
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
virtual Bool_t InheritsFrom(const char *classname) const