Cat
Public Member Functions | Private Types | Private Attributes | List of all members
Plot Class Reference

#include <inc/Plot.h>

Inheritance diagram for Plot:
Object Attrib

Public Member Functions

 Plot ()
 Standard constructor. More...
 
 Plot (unsigned int, unsigned int)
 
virtual ~Plot ()
 Destructor. More...
 
std::vector< std::pair< unsigned int, Histo1D *> > histos ()
 
std::vector< Histo1D * > histo1d ()
 
int pos (Histo1D *h)
 
void setRegion (unsigned int, unsigned int)
 
std::pair< unsigned int, unsigned int > region ()
 
int format ()
 
void add (TH1D *, unsigned int region=0)
 
void make (std::string script)
 
std::string draw ()
 
- Public Member Functions inherited from Object
 Object ()
 Standard constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
std::string name () const
 
std::string type ()
 
unsigned char id ()
 
std::string title ()
 
void msgSvc (int level, std::string msg, std::string name)
 
void msg (std::string mymsg)
 
void verbose (std::string mymsg)
 
void debug (std::string mymsg)
 
void info (std::string mymsg)
 
void warning (std::string mymsg)
 
void error (std::string mymsg)
 
void fatal (std::string mymsg)
 
void msg (std::string mymsg, std::string name)
 
void verbose (std::string mymsg, std::string name)
 
void debug (std::string mymsg, std::string name)
 
void info (std::string mymsg, std::string name)
 
void warning (std::string mymsg, std::string name)
 
void error (std::string mymsg, std::string name)
 
void fatal (std::string mymsg, std::string name)
 
void setName (std::string name)
 
void setType (std::string type)
 
void setId (unsigned char id)
 
void setTitle (std::string title)
 
void setDllName (std::string dllName)
 
std::string dllName ()
 
- Public Member Functions inherited from Attrib
 Attrib ()
 Standard constructor. More...
 
virtual ~Attrib ()
 Destructor. More...
 
bool is (int attribut)
 
void add (int attribut)
 
void remove (int attribut)
 
std::string attributs ()
 

Private Types

typedef std::pair< unsigned int, unsigned int > Pos
 
typedef std::pair< unsigned int, Histo1D *> Pos1D
 

Private Attributes

std::pair< unsigned int, unsigned int > m_region
 
std::vector< std::pair< unsigned int, Histo1D *> > m_histos
 
std::string m_draw
 

Additional Inherited Members

- Public Types inherited from Attrib
enum  Attribut {
  UNDEFINED, PASSIVE, ACTIVE, INTERFACE,
  IO, IODATA, ELEMENT, HARDWARE,
  PROCESSUS, SOFTWARE
}
 
- Protected Attributes inherited from Attrib
std::string m_attribString [10]
 

Detailed Description

Author
Frederic Machefert
Date
2005-01-04

Definition at line 21 of file Plot.h.

Member Typedef Documentation

◆ Pos

typedef std::pair< unsigned int, unsigned int > Plot::Pos
private

Definition at line 22 of file Plot.h.

◆ Pos1D

typedef std::pair< unsigned int , Histo1D* > Plot::Pos1D
private

Definition at line 23 of file Plot.h.

Constructor & Destructor Documentation

◆ Plot() [1/2]

Plot::Plot ( )

Standard constructor.

Definition at line 23 of file Plot.cpp.

References m_draw, and m_region.

23  {
24  m_region.first = 1;
25  m_region.second = 1;
26  m_draw=std::string("");
27 }
std::pair< unsigned int, unsigned int > m_region
Definition: Plot.h:109
std::string m_draw
Definition: Plot.h:111

◆ Plot() [2/2]

Plot::Plot ( unsigned int  x,
unsigned int  y 
)

Definition at line 31 of file Plot.cpp.

References setRegion().

32  {
33  setRegion ( x , y );
34 }
void setRegion(unsigned int, unsigned int)
Definition: Plot.cpp:45

◆ ~Plot()

Plot::~Plot ( )
virtual

Destructor.

Definition at line 39 of file Plot.cpp.

39  {
40 }

Member Function Documentation

◆ add()

void Plot::add ( TH1D *  histo,
unsigned int  region = 0 
)

Definition at line 55 of file Plot.cpp.

References m_histos, m_region, region(), and Object::warning().

Referenced by format().

56  {
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 }
std::pair< unsigned int, unsigned int > m_region
Definition: Plot.h:109
std::vector< std::pair< unsigned int, Histo1D *> > m_histos
Definition: Plot.h:110
void warning(std::string mymsg)
Definition: Object.h:39
std::pair< unsigned int, unsigned int > region()
Definition: Plot.h:75

◆ draw()

std::string Plot::draw ( )
inline

Definition at line 103 of file Plot.h.

References m_draw.

103  {
104  return m_draw;
105  }
std::string m_draw
Definition: Plot.h:111

◆ format()

int Plot::format ( )
inline

Definition at line 80 of file Plot.h.

References add(), m_region, and region().

81  {
82  return (m_region.first+m_region.second*100);
83 
84  }
std::pair< unsigned int, unsigned int > m_region
Definition: Plot.h:109

◆ histo1d()

std::vector<Histo1D*> Plot::histo1d ( )
inline

Definition at line 44 of file Plot.h.

References m_histos.

44  {
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  }
std::vector< std::pair< unsigned int, Histo1D *> > m_histos
Definition: Plot.h:110

◆ histos()

std::vector< std::pair < unsigned int , Histo1D* > > Plot::histos ( )
inline

Definition at line 36 of file Plot.h.

References m_histos.

36  {
37  return m_histos;
38  }
std::vector< std::pair< unsigned int, Histo1D *> > m_histos
Definition: Plot.h:110

◆ make()

void Plot::make ( std::string  script)
inline

Definition at line 96 of file Plot.h.

References m_draw.

96  {
97  m_draw=script;
98  }
std::string m_draw
Definition: Plot.h:111

◆ pos()

int Plot::pos ( Histo1D h)
inline

Definition at line 56 of file Plot.h.

References m_histos, and setRegion().

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  }
std::vector< std::pair< unsigned int, Histo1D *> > m_histos
Definition: Plot.h:110

◆ region()

std::pair<unsigned int , unsigned int> Plot::region ( )
inline

Definition at line 75 of file Plot.h.

References m_region.

Referenced by add(), and format().

75  {
76  return m_region;
77  }
std::pair< unsigned int, unsigned int > m_region
Definition: Plot.h:109

◆ setRegion()

void Plot::setRegion ( unsigned int  x,
unsigned int  y 
)

Definition at line 45 of file Plot.cpp.

References m_region.

Referenced by Plot(), and pos().

46  {
47  m_region.first = x;
48  m_region.second = y;
49 }
std::pair< unsigned int, unsigned int > m_region
Definition: Plot.h:109

Member Data Documentation

◆ m_draw

std::string Plot::m_draw
private

Definition at line 111 of file Plot.h.

Referenced by draw(), make(), and Plot().

◆ m_histos

std::vector< std::pair < unsigned int , Histo1D* > > Plot::m_histos
private

Definition at line 110 of file Plot.h.

Referenced by add(), histo1d(), histos(), and pos().

◆ m_region

std::pair< unsigned int, unsigned int > Plot::m_region
private

Definition at line 109 of file Plot.h.

Referenced by add(), format(), Plot(), region(), and setRegion().


The documentation for this class was generated from the following files: