Cat
Plot.h
Go to the documentation of this file.
1 // $Id: Plot.h,v 1.3 2006/03/16 17:08:21 fmachefe Exp $
2 #ifndef INC_PLOT_H
3 #define INC_PLOT_H 1
4 
5 // Include files
6 #include <vector>
7 #include <map>
8 
9 #include "Object.h"
10 
11 // CATProc include files
12 class Histo1D;
13 class TH1D;
14 
21 class Plot : public Object {
22  typedef std::pair < unsigned int, unsigned int > Pos;
23  typedef std::pair < unsigned int , Histo1D* > Pos1D;
24 
25 public:
27  Plot( );
28  Plot( unsigned int , unsigned int );
29 
30  virtual ~Plot( );
31 
36  std::vector < std::pair < unsigned int , Histo1D* > > histos(){
37  return m_histos;
38  }
39 
44  std::vector<Histo1D*> histo1d(){
45  std::vector<Histo1D*> h;
46  for (unsigned int i=0; i<m_histos.size(); ++i)
47  {
48  h.push_back((m_histos[i]).second);
49  }
50  return h;
51  }
52 
56  int pos( Histo1D* h)
57  {
58  for (unsigned int i=0; i<m_histos.size(); ++i)
59  {
60  if (h==(m_histos[i]).second)
61  return ((m_histos[i]).first);
62  }
63  return -1;
64  }
65 
70  void setRegion ( unsigned int, unsigned int );
71 
75  std::pair <unsigned int , unsigned int> region(){
76  return m_region;
77  }
78 
79 
80  int format()
81  {
82  return (m_region.first+m_region.second*100);
83 
84  }
85 
89  void add ( TH1D*,
90  unsigned int region = 0 );
91 
92 
96  void make(std::string script){
97  m_draw=script;
98  }
99 
103  std::string draw(){
104  return m_draw;
105  }
106 
107 
108 private:
109  std::pair < unsigned int, unsigned int > m_region;
110  std::vector < std::pair < unsigned int , Histo1D* > > m_histos;
111  std::string m_draw;
112 };
113 #endif // INC_PLOT_H
Definition: Object.h:21
std::vector< Histo1D * > histo1d()
Definition: Plot.h:44
std::pair< unsigned int, unsigned int > m_region
Definition: Plot.h:109
std::pair< unsigned int, Histo1D *> Pos1D
Definition: Plot.h:23
Definition: Plot.h:21
void make(std::string script)
Definition: Plot.h:96
std::vector< std::pair< unsigned int, Histo1D *> > histos()
Definition: Plot.h:36
void setRegion(unsigned int, unsigned int)
Definition: Plot.cpp:45
void add(TH1D *, unsigned int region=0)
Definition: Plot.cpp:55
std::string draw()
Definition: Plot.h:103
std::string m_draw
Definition: Plot.h:111
std::vector< std::pair< unsigned int, Histo1D *> > m_histos
Definition: Plot.h:110
int pos(Histo1D *h)
Definition: Plot.h:56
std::pair< unsigned int, unsigned int > Pos
Definition: Plot.h:22
virtual ~Plot()
Destructor.
Definition: Plot.cpp:39
Plot()
Standard constructor.
Definition: Plot.cpp:23
std::pair< unsigned int, unsigned int > region()
Definition: Plot.h:75
int format()
Definition: Plot.h:80