Class Reference for E1039 Core & Analysis Software
RunHeader.cc
Go to the documentation of this file.
1 #include "RunHeader.h"
2 #include <phool/phool.h>
3 #include <iostream>
4 
5 using namespace std;
6 
7 static int nowarning = 0;
8 
11 {
12  cout << "RunHeader::clone() is not implemented in daugther class" << endl;
13  return NULL;
14 }
15 
16 void
18 {
19  cout << PHWHERE << "ERROR Reset() not implemented by daughter class" << endl;
20  return ;
21 }
22 
23 void
24 RunHeader::identify(ostream& os) const
25 {
26  os << "identify yourself: virtual RunHeader Object" << endl;
27  return ;
28 }
29 
30 int
32 {
33  cout << PHWHERE << "isValid not implemented by daughter class" << endl;
34  return 0;
35 }
36 
37 int
39 {
40  warning("get_RunNumber()");
41  return -9999;
42 }
43 
44 void
45 RunHeader::set_RunNumber(const int /*run*/)
46 {
47  warning("set_RunNumber(const int run)");
48  return ;
49 }
50 
51 double
53 {
54  warning("get_Bfield()");
55  return -9999.9;
56 }
57 
58 void
59 RunHeader::set_Bfield(const double /*rval*/)
60 {
61  warning("set_Bfield(const double rval)");
62  return;
63 }
64 
65 time_t
67 {
68  warning("get_TimeStart()");
69  return 0;
70 }
71 
72 void
73 RunHeader::set_TimeStart(const time_t /*ival*/)
74 {
75  warning("set_TimeStart(const time_t ival)");
76  return;
77 }
78 
79 time_t
81 {
82  warning("get_TimeStop()");
83  return 0;
84 }
85 
86 void
87 RunHeader::set_TimeStop(const time_t /*ival*/)
88 {
89  warning("set_TimeStop(const time_t ival)");
90  return;
91 }
92 
93 //
94 void
96 {
97  if (i > 0)
98  {
99  cout << "RunHeader: switching virtual warnings OFF" << endl;
100  nowarning = i;
101  }
102  else
103  {
104  cout << "RunHeader: switching virtual warnings ON" << endl;
105  nowarning = 0;
106  }
107  return ;
108 }
109 
110 void
111 RunHeader::warning(const char *funcname) const
112 {
113  if (! nowarning)
114  {
115  cout << "Using virtual function RunHeader::" << funcname << endl;
116  }
117  return ;
118 }
#define NULL
Definition: Pdb.h:9
static int nowarning
Definition: RunHeader.cc:7
virtual double get_Bfield() const
get BField (deprecated in v2)
Definition: RunHeader.cc:52
virtual void Reset()
Clear Event.
Definition: RunHeader.cc:17
virtual int get_RunNumber() const
get Run Number
Definition: RunHeader.cc:38
virtual int isValid() const
isValid returns non zero if object contains valid data
Definition: RunHeader.cc:31
virtual void identify(std::ostream &os=std::cout) const
Definition: RunHeader.cc:24
virtual RunHeader * clone() const
Virtual copy constructor.
Definition: RunHeader.cc:10
virtual void set_RunNumber(const int run)
set Run Number
Definition: RunHeader.cc:45
virtual void set_TimeStart(const time_t ival)
set Start Time
Definition: RunHeader.cc:73
void warning(const char *func) const
Definition: RunHeader.cc:111
virtual void NoWarning(const int i=1)
switches off the pesky virtual warning messages
Definition: RunHeader.cc:95
virtual void set_TimeStop(const time_t ival)
set Time of End Run
Definition: RunHeader.cc:87
virtual time_t get_TimeStop() const
get Time of End Run (in unix ticks)
Definition: RunHeader.cc:80
virtual void set_Bfield(const double rval)
set Bfield (deprecated in v2)
Definition: RunHeader.cc:59
virtual time_t get_TimeStart() const
get Start Time of run (in unix ticks, use ctime to convert to date string)
Definition: RunHeader.cc:66
#define PHWHERE
Definition: phool.h:23