Cat
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
TestSuite Class Reference

#include <include/TestSuite.h>

Inheritance diagram for TestSuite:
Processus Object Attrib

Classes

class  TestSuite
 

Public Member Functions

 TestSuite ()
 Standard constructor. More...
 
virtual ~TestSuite ()
 
virtual StatusCode initialize ()
 Destructor. More...
 
virtual StatusCode execute ()
 
virtual StatusCode finalize ()
 
StatusCode setSigma (double m1, double m2, double m3, double m4)
 
double sigma (int i)
 
- Public Member Functions inherited from Processus
 Processus ()
 Standard constructor. More...
 
virtual ~Processus ()
 Destructor. More...
 
StatusCode startProcessing ()
 
StatusCode endProcessing ()
 
void clean ()
 
void setStorage (std::string storage)
 
Datadata ()
 
std::vector< double > data (unsigned int row)
 
std::vector< double > data (std::string name)
 
Histo1Dhist1d (unsigned int row)
 
Histo2Dhist2d (unsigned int row)
 
void addDataStream (std::string name, std::string title)
 
void addHisto1d (TH1D *h)
 
void addHisto2d (TH2D *h)
 
StatusCode dataFill (int i, double val)
 
StatusCode dataFill (std::string name, double val)
 
std::string storage ()
 
void setElement (Element *element)
 
Elementelement ()
 
void incNErrors ()
 
void setNErrors (unsigned int)
 
unsigned int nErrors ()
 
TFile * rootFile ()
 
void openRootFile ()
 
void closeRootFile ()
 
void startChrono ()
 
void setLogMsg (std::string logMsg)
 
std::string logMsg ()
 
void setState (int state)
 
double elapsedTime ()
 
double elapsedTime (time_t start)
 
- 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 ()
 

Public Attributes

 p7 = fig.add_subplot(2,3,6)
 

plot examples

p6=fig.add_subplot(4,3,6) p6.set_title('axes title') p6.set_xlabel('xlabel') p6.set_ylabel('ylabel') p6.text(3, 8, 'boxed italics text in data coords', style='italic', bbox={'facecolor':'red', 'alpha':0.5, 'pad':10}) p6.text(2, 6, r'an equation: $E=mc^2$', fontsize=15) p6.text(3, 2, unicode('unicode: Institut f\374r Festk\366rperphysik', 'latin-1')) p6.text(0.95, 0.01, 'colored text in axes coords', verticalalignment='bottom', horizontalalignment='right', transform=p6.transAxes, color='green', fontsize=15) p6.plot([2], [1], 'o') p6.annotate('annotate', xy=(2, 1), xytext=(3, 4), arrowprops=dict(facecolor='black', shrink=0.05)) p6.axis([0, 10, 0, 10]) More...
 
 h7 = obj.hist1d(0)
 
 color
 

Protected Member Functions

TestSuiteclone ()
 

Private Attributes

TRandom * m_rnd
 
TH1D * m_h1
 
TH1D * m_h2
 
TH1D * m_h3
 
TH1D * m_h4
 
TH2D * m_h5
 
double m_m1
 
double m_m2
 
double m_m3
 
double m_m4
 
std::vector< double > m_val
 

Additional Inherited Members

- Public Types inherited from Processus
enum  states { ERR =-1, NOT_OK, OK }
 
- Public Types inherited from Attrib
enum  Attribut {
  UNDEFINED, PASSIVE, ACTIVE, INTERFACE,
  IO, IODATA, ELEMENT, HARDWARE,
  PROCESSUS, SOFTWARE
}
 
- Protected Attributes inherited from Processus
Elementm_element
 
- Protected Attributes inherited from Attrib
std::string m_attribString [10]
 

Detailed Description

Author
Frederic Machefert
Date
2010-01-07

Definition at line 18 of file TestSuite.h.

Constructor & Destructor Documentation

◆ TestSuite()

Standard constructor.

Definition at line 23 of file TestSuite.cpp.

References Object::setName(), Object::setTitle(), and Object::setType().

Referenced by clone().

23  :
24  m_m1(2.),
25  m_m2(2.),
26  m_m3(2.),
27  m_m4(2.),
28  m_h1(0),
29  m_h2(0),
30  m_h3(0),
31  m_h4(0)
32 {
33  setName ( "TestSuite" );
34  setType ( "Computer" );
35  setTitle( "CAT processing test suite" );
36 }
TH1D * m_h1
Definition: TestSuite.h:65
double m_m1
Definition: TestSuite.h:67
double m_m3
Definition: TestSuite.h:67
void setName(std::string name)
Definition: Object.h:51
double m_m2
Definition: TestSuite.h:67
TH1D * m_h2
Definition: TestSuite.h:65
TH1D * m_h3
Definition: TestSuite.h:65
void setType(std::string type)
Definition: Object.h:52
void setTitle(std::string title)
Definition: Object.h:54
TH1D * m_h4
Definition: TestSuite.h:65
double m_m4
Definition: TestSuite.h:67

◆ ~TestSuite()

virtual TestSuite::~TestSuite ( )
inlinevirtual

Definition at line 23 of file TestSuite.h.

References execute(), finalize(), and initialize().

23 {};

Member Function Documentation

◆ clone()

TestSuite* TestSuite::clone ( )
inlineprotectedvirtual

processus termination virtual function

Implements Processus.

Definition at line 59 of file TestSuite.h.

References TestSuite().

59  {
60  return new TestSuite (*this);
61  };
TestSuite()
Standard constructor.
Definition: TestSuite.cpp:23

◆ execute()

StatusCode TestSuite::execute ( )
virtual

processus execution virtual function

Implements Processus.

Definition at line 61 of file TestSuite.cpp.

References Processus::dataFill(), m_h1, m_h2, m_h3, m_h4, m_h5, m_m1, m_m2, m_m3, m_m4, m_rnd, and StatusCode::SUCCESS.

Referenced by ~TestSuite().

61  {
62 
63  double g1=(m_rnd->Gaus( 5., m_m1));
64  double g2=(m_rnd->Gaus( 10.,m_m2));
65 
66  dataFill(0,g1);
67  dataFill(1,g2);
68 
69  double a1=m_rnd->Gaus(15.,m_m3);
70  double a2=m_rnd->Gaus(20.,m_m4);
71 
72  m_h1->Fill(g1);
73  m_h2->Fill(g2);
74  m_h3->Fill(a1);
75  m_h4->Fill(a2);
76  m_h5->Fill(a1,a2);
77 
78  // wait(100);
79  return StatusCode::SUCCESS;
80 }
TH1D * m_h1
Definition: TestSuite.h:65
double m_m1
Definition: TestSuite.h:67
double m_m3
Definition: TestSuite.h:67
double m_m2
Definition: TestSuite.h:67
TRandom * m_rnd
Definition: TestSuite.h:61
TH1D * m_h2
Definition: TestSuite.h:65
TH2D * m_h5
Definition: TestSuite.h:66
TH1D * m_h3
Definition: TestSuite.h:65
TH1D * m_h4
Definition: TestSuite.h:65
StatusCode dataFill(int i, double val)
Definition: Processus.h:175
double m_m4
Definition: TestSuite.h:67

◆ finalize()

StatusCode TestSuite::finalize ( )
virtual

processus termination virtual function

Implements Processus.

Definition at line 85 of file TestSuite.cpp.

References StatusCode::SUCCESS.

Referenced by ~TestSuite().

85  {
86  return StatusCode::SUCCESS;
87 }

◆ initialize()

StatusCode TestSuite::initialize ( )
virtual

Destructor.

Implements Processus.

Definition at line 41 of file TestSuite.cpp.

References Processus::addDataStream(), Processus::addHisto1d(), Processus::addHisto2d(), m_h1, m_h2, m_h3, m_h4, m_h5, m_rnd, and StatusCode::SUCCESS.

Referenced by ~TestSuite().

41  {
42  m_h1=new TH1D( "Error1" , "Data values with sigma 1" , 25 , 0. , 25. );
43  m_h2=new TH1D( "Error2" , "Data values with sigma 2" , 25 , 0. , 25. );
44  m_h3=new TH1D( "Error3" , "Data values with sigma 3" , 25 , 0. , 25. );
45  m_h4=new TH1D( "Error4" , "Data values with sigma 4" , 25 , 0. , 25. );
46  m_h5=new TH2D( "Error34", "Data values with sigma 3/4" , 25 , 0. , 25. , 25, 0., 25.);
47  addDataStream("g1","First Gaussian");
48  addDataStream("g2","Second Gaussian");
49  addHisto1d( m_h1 );
50  addHisto1d( m_h2 );
51  addHisto1d( m_h3 );
52  addHisto1d( m_h4 );
53  addHisto2d( m_h5 );
54  m_rnd =new TRandom();
55  return StatusCode::SUCCESS;
56 }
TH1D * m_h1
Definition: TestSuite.h:65
void addDataStream(std::string name, std::string title)
Definition: Processus.h:153
TRandom * m_rnd
Definition: TestSuite.h:61
TH1D * m_h2
Definition: TestSuite.h:65
TH2D * m_h5
Definition: TestSuite.h:66
TH1D * m_h3
Definition: TestSuite.h:65
void addHisto2d(TH2D *h)
Definition: Processus.h:167
TH1D * m_h4
Definition: TestSuite.h:65
void addHisto1d(TH1D *h)
Definition: Processus.h:160

◆ setSigma()

StatusCode TestSuite::setSigma ( double  m1,
double  m2,
double  m3,
double  m4 
)
inline

Definition at line 29 of file TestSuite.h.

References m_m1, m_m2, m_m3, m_m4, and StatusCode::SUCCESS.

Referenced by export_proc(), and TestSuite.TestSuite::onApply().

29  {
30  m_m1 = m1;
31  m_m2 = m2;
32  m_m3 = m3;
33  m_m4 = m4;
34  return StatusCode::SUCCESS;
35  };
double m_m1
Definition: TestSuite.h:67
double m_m3
Definition: TestSuite.h:67
double m_m2
Definition: TestSuite.h:67
double m_m4
Definition: TestSuite.h:67

◆ sigma()

double TestSuite::sigma ( int  i)
inline

Definition at line 37 of file TestSuite.h.

References itos(), m_m1, m_m2, m_m3, m_m4, and Object::warning().

Referenced by export_proc(), and TestSuite.TestSuite::update().

37  {
38  switch (i)
39  {
40  case 0 :
41  return m_m1;
42  break;
43  case 1 :
44  return m_m2;
45  break;
46  case 2 :
47  return m_m3;
48  break;
49  case 3 :
50  return m_m4;
51  break;
52  default:
53  warning("Wrong index for sigma ["+itos(i)+"]. Expected in [0,3] range.","TestSuite");
54  };
55  return -1.;
56  };
std::string itos(int)
Definition: Tools.cpp:46
double m_m1
Definition: TestSuite.h:67
double m_m3
Definition: TestSuite.h:67
double m_m2
Definition: TestSuite.h:67
double m_m4
Definition: TestSuite.h:67
void warning(std::string mymsg)
Definition: Object.h:39

Member Data Documentation

◆ color

TestSuite.color

Definition at line 143 of file TestSuite.py.

◆ h7

TestSuite.h7 = obj.hist1d(0)

Definition at line 141 of file TestSuite.py.

◆ m_h1

TH1D* TestSuite::m_h1
private

Definition at line 65 of file TestSuite.h.

Referenced by execute(), and initialize().

◆ m_h2

TH1D * TestSuite::m_h2
private

Definition at line 65 of file TestSuite.h.

Referenced by execute(), and initialize().

◆ m_h3

TH1D * TestSuite::m_h3
private

Definition at line 65 of file TestSuite.h.

Referenced by execute(), and initialize().

◆ m_h4

TH1D * TestSuite::m_h4
private

Definition at line 65 of file TestSuite.h.

Referenced by execute(), and initialize().

◆ m_h5

TH2D* TestSuite::m_h5
private

Definition at line 66 of file TestSuite.h.

Referenced by execute(), and initialize().

◆ m_m1

double TestSuite::m_m1
private

Definition at line 67 of file TestSuite.h.

Referenced by execute(), setSigma(), and sigma().

◆ m_m2

double TestSuite::m_m2
private

Definition at line 67 of file TestSuite.h.

Referenced by execute(), setSigma(), and sigma().

◆ m_m3

double TestSuite::m_m3
private

Definition at line 67 of file TestSuite.h.

Referenced by execute(), setSigma(), and sigma().

◆ m_m4

double TestSuite::m_m4
private

Definition at line 67 of file TestSuite.h.

Referenced by execute(), setSigma(), and sigma().

◆ m_rnd

TRandom* TestSuite::m_rnd
private

Definition at line 61 of file TestSuite.h.

Referenced by execute(), and initialize().

◆ m_val

std::vector< double > TestSuite::m_val
private

Definition at line 68 of file TestSuite.h.

◆ p7

TestSuite.p7 = fig.add_subplot(2,3,6)

plot examples

p6=fig.add_subplot(4,3,6) p6.set_title('axes title') p6.set_xlabel('xlabel') p6.set_ylabel('ylabel') p6.text(3, 8, 'boxed italics text in data coords', style='italic', bbox={'facecolor':'red', 'alpha':0.5, 'pad':10}) p6.text(2, 6, r'an equation: $E=mc^2$', fontsize=15) p6.text(3, 2, unicode('unicode: Institut f\374r Festk\366rperphysik', 'latin-1')) p6.text(0.95, 0.01, 'colored text in axes coords', verticalalignment='bottom', horizontalalignment='right', transform=p6.transAxes, color='green', fontsize=15) p6.plot([2], [1], 'o') p6.annotate('annotate', xy=(2, 1), xytext=(3, 4), arrowprops=dict(facecolor='black', shrink=0.05)) p6.axis([0, 10, 0, 10])

Definition at line 140 of file TestSuite.py.


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