#include <TSK_DBI_Context.hxx>
Public Types | |
typedef unsigned int | Time |
Public Member Functions | |
TSK_DBI_Context () | |
Construct an empty context. | |
TSK_DBI_Context (int run, int subRun, int event, int timestamp, int spill, int dataMC=1) | |
Construct a context. | |
virtual | ~TSK_DBI_Context () |
int | GetDataMC () const |
bool | IsMC () const |
Add a convenient check to see if this is MC data. | |
void | SetDataMC (int dm) |
int | GetRun () const |
Return the run number for this context. | |
void | SetRun (int r) |
Set the run number for this context. | |
int | GetSubRun () const |
Return the sub-run number for this context. | |
void | SetSubRun (int s) |
Set the sub-run number for this context. | |
int | GetEvent () const |
Return the event number for this context. | |
void | SetEvent (int e) |
Set the event number for this context. | |
int | GetSpill () const |
Return the spill number for this context. | |
void | SetSpill (int s) |
Set the spill number for this context. | |
int | GetTimeStamp () const |
Return the time stamp for this event (only valid to 1 sec). | |
std::string | GetTimeStampString () const |
Return the time stamp for this event as a MYSQL compatible time string. | |
void | SetTimeStamp (int t) |
Set the time stamp for this event. | |
bool | Valid () const |
Static Public Attributes | |
static const int | Invalid = 0xDEADBEEF |
A special field value that specifies that the field is invalid. | |
Private Member Functions | |
ClassDef (TSK_DBI_Context, 1) | |
Private Attributes | |
int | fRun |
The run number associated with this context. | |
int | fSubRun |
The sub-run number associated with this context. | |
int | fEvent |
The event number associated with this context. | |
int | fSpill |
The spill number associated with this context. | |
Time | fTimeStamp |
The unix time stamp associated with this context. | |
int | fDataMC |
data/MC flag. data = 1, MC = 4 |
Define the context of an event. The event context uniquely identifies an event within SK_DBI. Due to the way events are formed, not all event (or slow control data) will have all fields of the context information defined. Fields that do not contain valid data should be marked using the value TSK_DBI_Context::Invalid.
Definition at line 14 of file TSK_DBI_Context.hxx.
typedef unsigned int TSK_DBI_Context::Time |
Definition at line 16 of file TSK_DBI_Context.hxx.
TSK_DBI_Context::TSK_DBI_Context | ( | ) |
TSK_DBI_Context::TSK_DBI_Context | ( | int | run, | |
int | subRun, | |||
int | event, | |||
int | timestamp, | |||
int | spill, | |||
int | dataMC = 1 | |||
) |
Construct a context.
Definition at line 14 of file TSK_DBI_Context.cxx.
virtual TSK_DBI_Context::~TSK_DBI_Context | ( | ) | [virtual] |
TSK_DBI_Context::ClassDef | ( | TSK_DBI_Context | , | |
1 | ||||
) | [private] |
int TSK_DBI_Context::GetDataMC | ( | ) | const [inline] |
Get dataMC variable data = 1, MC = 4
Definition at line 31 of file TSK_DBI_Context.hxx.
References fDataMC.
00031 { return fDataMC;}
int TSK_DBI_Context::GetEvent | ( | ) | const |
Return the event number for this context.
Definition at line 21 of file TSK_DBI_Context.cxx.
References fEvent.
Referenced by operator<<(), and Valid().
00021 {return fEvent;}
int TSK_DBI_Context::GetRun | ( | ) | const |
Return the run number for this context.
Definition at line 19 of file TSK_DBI_Context.cxx.
References fRun.
Referenced by operator<<(), and Valid().
00019 {return fRun;}
int TSK_DBI_Context::GetSpill | ( | ) | const |
Return the spill number for this context.
Definition at line 22 of file TSK_DBI_Context.cxx.
References fSpill.
Referenced by operator<<(), and Valid().
00022 {return fSpill;}
int TSK_DBI_Context::GetSubRun | ( | ) | const |
Return the sub-run number for this context.
Definition at line 20 of file TSK_DBI_Context.cxx.
References fSubRun.
Referenced by operator<<(), and Valid().
00020 {return fSubRun;}
int TSK_DBI_Context::GetTimeStamp | ( | ) | const |
Return the time stamp for this event (only valid to 1 sec).
Definition at line 29 of file TSK_DBI_Context.cxx.
References fTimeStamp.
Referenced by GetTimeStampString(), operator<<(), and Valid().
00029 {return fTimeStamp;}
std::string TSK_DBI_Context::GetTimeStampString | ( | ) | const |
Return the time stamp for this event as a MYSQL compatible time string.
Definition at line 31 of file TSK_DBI_Context.cxx.
References GetTimeStamp().
00031 { 00032 std::time_t t = GetTimeStamp(); 00033 char buf[256]; 00034 std::strftime(buf,sizeof(buf),"'%Y-%m-%d %H:%M:%S'",std::gmtime(&t)); 00035 return std::string(buf); 00036 }
bool TSK_DBI_Context::IsMC | ( | ) | const |
Add a convenient check to see if this is MC data.
Definition at line 23 of file TSK_DBI_Context.cxx.
References fDataMC.
Referenced by operator<<(), and TVldContext::TVldContext().
00023 { 00024 if(fDataMC == 4) 00025 return true; 00026 return false; 00027 }
void TSK_DBI_Context::SetDataMC | ( | int | dm | ) |
Set dataMC variable data = 1, MC = 4
Definition at line 43 of file TSK_DBI_Context.cxx.
References fDataMC.
00043 {fDataMC = dataMC;}
void TSK_DBI_Context::SetEvent | ( | int | e | ) |
Set the event number for this context.
Definition at line 40 of file TSK_DBI_Context.cxx.
References fEvent.
00040 {fEvent = v;}
void TSK_DBI_Context::SetRun | ( | int | r | ) |
Set the run number for this context.
Definition at line 38 of file TSK_DBI_Context.cxx.
References fRun.
00038 {fRun = v;}
void TSK_DBI_Context::SetSpill | ( | int | s | ) |
Set the spill number for this context.
Definition at line 41 of file TSK_DBI_Context.cxx.
References fSpill.
00041 {fSpill = v;}
void TSK_DBI_Context::SetSubRun | ( | int | s | ) |
Set the sub-run number for this context.
Definition at line 39 of file TSK_DBI_Context.cxx.
References fSubRun.
00039 {fSubRun = v;}
void TSK_DBI_Context::SetTimeStamp | ( | int | t | ) |
Set the time stamp for this event.
Definition at line 42 of file TSK_DBI_Context.cxx.
References fTimeStamp.
Referenced by main().
00042 {fTimeStamp = v;}
bool TSK_DBI_Context::Valid | ( | ) | const |
Return true if the context is valid. A valid context is defined as a context where one or more fields is valid.
Definition at line 45 of file TSK_DBI_Context.cxx.
References fDataMC, GetEvent(), GetRun(), GetSpill(), GetSubRun(), GetTimeStamp(), and Invalid.
00045 { 00046 if (GetRun()!=TSK_DBI_Context::Invalid) return true; 00047 if (GetSubRun()!=TSK_DBI_Context::Invalid) return true; 00048 if (GetEvent()!=TSK_DBI_Context::Invalid) return true; 00049 if (GetSpill()!=TSK_DBI_Context::Invalid) return true; 00050 if (GetTimeStamp()!=TSK_DBI_Context::Invalid) return true; 00051 if (fDataMC!=TSK_DBI_Context::Invalid) return true; 00052 return false; 00053 }
int TSK_DBI_Context::fDataMC [private] |
data/MC flag. data = 1, MC = 4
Definition at line 95 of file TSK_DBI_Context.hxx.
Referenced by GetDataMC(), IsMC(), SetDataMC(), and Valid().
int TSK_DBI_Context::fEvent [private] |
The event number associated with this context.
Definition at line 86 of file TSK_DBI_Context.hxx.
Referenced by GetEvent(), and SetEvent().
int TSK_DBI_Context::fRun [private] |
The run number associated with this context.
Definition at line 80 of file TSK_DBI_Context.hxx.
int TSK_DBI_Context::fSpill [private] |
The spill number associated with this context.
Definition at line 89 of file TSK_DBI_Context.hxx.
Referenced by GetSpill(), and SetSpill().
int TSK_DBI_Context::fSubRun [private] |
The sub-run number associated with this context.
Definition at line 83 of file TSK_DBI_Context.hxx.
Referenced by GetSubRun(), and SetSubRun().
Time TSK_DBI_Context::fTimeStamp [private] |
The unix time stamp associated with this context.
Definition at line 92 of file TSK_DBI_Context.hxx.
Referenced by GetTimeStamp(), and SetTimeStamp().
const int TSK_DBI_Context::Invalid = 0xDEADBEEF [static] |
A special field value that specifies that the field is invalid.
Definition at line 19 of file TSK_DBI_Context.hxx.
Referenced by operator<<(), and Valid().