BayesianAnalysisToolkit  0.9.3
BCH2D.h
Go to the documentation of this file.
1 #ifndef __BCH2D__H
2 #define __BCH2D__H
3 
15 /*
16  * Copyright (C) 2007-2013, the BAT core developer team
17  * All rights reserved.
18  *
19  * For the licensing terms see doc/COPYING.
20  * For documentation see http://mpp.mpg.de/bat
21  */
22 
23 // ---------------------------------------------------------
24 
25 #include <vector>
26 #include <string>
27 
28 // ROOT classes
29 
30 class TH1D;
31 class TH2D;
32 class TGraph;
33 class TObject;
34 
35 // ---------------------------------------------------------
36 
37 class BCH2D
38 {
39 
40 public:
41 
47  BCH2D(TH2D* h = 0);
48 
51  ~BCH2D();
52 
60  TH2D* GetHistogram()
61  { return fHistogram; };
62 
67  int GetColor(int index)
68  { return fColors.at(index); };
69 
83  void SetColorScheme(int scheme);
84 
87  void SetHistogram(TH2D* hist);
88 
92  void SetGlobalMode(double mode[2])
93  { fMode[0] = mode[0];
94  fMode[1] = mode[1];
95  fModeFlag =1; };
96 
111  void Print(const char* filename, std::string options="BTfB3CS1meangmode", std::vector<double> intervals=std::vector<double>(0), int ww=0, int wh=0);
112 
122  void Print(const char* filename, std::string options, double interval, int ww=0, int wh=0);
123 
124 
149  void Draw(std::string options="BTfB3CS1meangmodelmode", std::vector<double> intervals=std::vector<double>(0));
150 
157  void Draw(std::string options, double interval);
158 
163 
167  void PrintIntegratedHistogram(const char* filename);
168 
173  double GetLevel(double p);
174 
178  double GetArea(double p);
179 
185  std::vector<int> GetNIntervalsY(TH2D* h, int &nfoundmax);
186 
198  TGraph* CalculateProfileGraph(int axis, std::string options="mode");
199 
211  TGraph* DrawProfile(int axis, std::string options, std::string drawoptions="blacksolid");
212 
218  TGraph* DrawProfileX(std::string options, std::string drawoptions)
219  { return DrawProfile(0, options, drawoptions); };
220 
226  TGraph* DrawProfileY(std::string options, std::string drawoptions)
227  { return DrawProfile(1, options, drawoptions); };
228 
231 private:
232 
235  TH2D* fHistogram;
236 
240 
243  double fMode[2];
244 
248 
251  std::vector<int> fColors;
252 
255  std::vector<TObject*> fROOTObjects;
256 
258  static unsigned int getNextIndex()
259  { return ++fHCounter; }
260 
262  static unsigned int fHCounter;
263 };
264 
265 // ---------------------------------------------------------
266 
267 #endif