Cat
Plot.cpp
Go to the documentation of this file.
1 // $Id: Plot.cpp,v 1.2 2005/02/23 14:13:02 machefer Exp $
2 // Include files
3 
4 // ROOT include file
5 #include "TH1D.h"
6 
7 // CAT include files
8 #include "Tools.h"
9 #include "Histo1D.h"
10 
11 // local
12 #include "Plot.h"
13 
14 //-----------------------------------------------------------------------------
15 // Implementation file for class : Plot
16 //
17 // 2005-01-04 : Frederic Machefert
18 //-----------------------------------------------------------------------------
19 
20 //=============================================================================
21 // Standard constructor, initializes variables
22 //=============================================================================
24  m_region.first = 1;
25  m_region.second = 1;
26  m_draw=std::string("");
27 }
28 //=============================================================================
29 // Constructor
30 //=============================================================================
31 Plot::Plot( unsigned int x,
32  unsigned int y) {
33  setRegion ( x , y );
34 }
35 
36 //=============================================================================
37 // Destructor
38 //=============================================================================
40 }
41 
42 //=========================================================================
43 //
44 //=========================================================================
45 void Plot::setRegion ( unsigned int x ,
46  unsigned int y ) {
47  m_region.first = x;
48  m_region.second = y;
49 }
50 
51 
52 //=========================================================================
53 //
54 //=========================================================================
55 void Plot::add ( TH1D *histo ,
56  unsigned int region ) {
57 
58  if ( region > m_region.first * m_region.second ){
59  warning("Try plot histogram outside allowed regions.","Processus::plot");
60  return;
61  }
62 
63  std::pair < int , Histo1D* > graph;
64  graph.first = region;
65  graph.second = new Histo1D(histo);
66 
67  m_histos.push_back ( graph );
68 }
69 
70 //=============================================================================
std::pair< unsigned int, unsigned int > m_region
Definition: Plot.h:109
void setRegion(unsigned int, unsigned int)
Definition: Plot.cpp:45
void add(TH1D *, unsigned int region=0)
Definition: Plot.cpp:55
std::string m_draw
Definition: Plot.h:111
std::vector< std::pair< unsigned int, Histo1D *> > m_histos
Definition: Plot.h:110
virtual ~Plot()
Destructor.
Definition: Plot.cpp:39
Plot()
Standard constructor.
Definition: Plot.cpp:23
void warning(std::string mymsg)
Definition: Object.h:39
std::pair< unsigned int, unsigned int > region()
Definition: Plot.h:75