KaliVeda
Toolkit for HIC analysis
KVHistogram.h
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 
20 class KVHistogram : public KVBase {
21 protected:
25 
26  Double_t GetMean(Int_t axis = 1) const;
27 
28 public:
29  KVHistogram(TH1* h = nullptr);
30  KVHistogram(TCutG* cut);
31  virtual ~KVHistogram();
32 
33  static void ParseHistoTitle(const Char_t* title, KVString& exp, KVString& sel, KVString& weight);
34  static void ParseExpressionString(const Char_t* exp, KVString& varX, KVString& varY,
35  KVString& varZ);
36 
37  TH1* GetHisto() const
38  {
39  return fHisto;
40  }
41  TCutG* GetCut() const
42  {
43  return fCut;
44  }
45  Bool_t IsProfile() const
46  {
47  return (fHisto && fHisto->InheritsFrom("TProfile"));
48  }
49  Bool_t IsTH2() const
50  {
51  return (fHisto && fHisto->InheritsFrom("TH2"));
52  }
53  Bool_t IsTH1() const
54  {
55  return (fHisto && !IsProfile() && !IsTH2());
56  }
57  const Char_t* GetExpression() const;
58  const Char_t* GetHistoTitle() const;
59  const Char_t* GetVarX() const;
60  const Char_t* GetVarY() const;
61  const Char_t* GetVarZ() const;
62  const Char_t* GetSelection() const;
63  const Char_t* GetWeight() const;
65  {
66  return GetMean();
67  }
69  {
70  return GetMean(2);
71  }
72  const Char_t* GetMeanRMSX() const;
73  const Char_t* GetMeanRMSY() const;
74 
75  void SetWeight(const Char_t*);
76 
77  void ls(Option_t* option = "") const;
78 
79  TObject* GetObject() const;
81 
82  ClassDef(KVHistogram, 1) //Wrapper for histograms used by KVTreeAnalyzer
83 };
84 
85 #endif
int Int_t
bool Bool_t
char Char_t
double Double_t
const char Option_t
#define ClassDef(name, id)
Base class for KaliVeda framework.
Definition: KVBase.h:142
Wrapper for histograms and graphical cuts used by KVTreeAnalyzer.
Definition: KVHistogram.h:20
const Char_t * GetHistoTitle() const
TCutG * GetCut() const
Definition: KVHistogram.h:41
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:45
Double_t GetMeanX() const
Definition: KVHistogram.h:64
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:22
void ls(Option_t *option="") const
const Char_t * GetSelection() const
TH1 * GetHisto() const
Definition: KVHistogram.h:37
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:68
const Char_t * GetVarX() const
Bool_t IsTH2() const
Definition: KVHistogram.h:49
virtual ~KVHistogram()
Destructor.
Definition: KVHistogram.cpp:89
Bool_t IsTH1() const
Definition: KVHistogram.h:53
KVNameValueList fParams
histogram parameters
Definition: KVHistogram.h:24
void ParseExpressionAndSelection()
Definition: KVHistogram.cpp:14
TCutG * fCut
pointer to cut
Definition: KVHistogram.h:23
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:73
virtual Bool_t InheritsFrom(const char *classname) const