Files | Namespaces | Classes | Functions | Variables
IOVData

Files

file  ChannelStatus.h
 Class def header for a class ChannelStatus.
 
file  ChData.h
 Class def header for a class ChData.
 
file  DetPedestal.h
 Class def header for a class DetPedestal.
 
file  ElectronicsCalib.h
 Class def header for a class ElectronicsCalib.
 
file  IOVDataError.h
 Collection of exception classes for IOVData.
 
file  IOVTimeStamp.cxx
 Implementation for class IOVTimeStamp.
 
file  IOVTimeStamp.h
 Class def header for a class IOVTimeStamp.
 
file  PmtGain.h
 Class def header for a class PmtGain.
 

Namespaces

 lariov
 Filters for channels, events, etc.
 

Classes

class  lariov::IOVTimeStamp
 

Functions

 lariov::IOVTimeStamp::IOVTimeStamp (unsigned long stamp, unsigned int substamp=0)
 Constructor. More...
 
virtual lariov::IOVTimeStamp::~IOVTimeStamp ()
 Default destructor. More...
 
unsigned long lariov::IOVTimeStamp::Stamp () const
 
unsigned long lariov::IOVTimeStamp::SubStamp () const
 
const std::stringlariov::IOVTimeStamp::DBStamp () const
 
void lariov::IOVTimeStamp::SetStamp (unsigned long stamp, unsigned int substamp=0)
 
void lariov::IOVTimeStamp::CalcDBStamp ()
 
static IOVTimeStamp lariov::IOVTimeStamp::GetFromString (const std::string &ts)
 
static IOVTimeStamp lariov::IOVTimeStamp::MinTimeStamp ()
 
static IOVTimeStamp lariov::IOVTimeStamp::MaxTimeStamp ()
 
bool lariov::IOVTimeStamp::operator< (const IOVTimeStamp &ts) const
 comparison operators More...
 
bool lariov::IOVTimeStamp::operator<= (const IOVTimeStamp &ts) const
 
bool lariov::IOVTimeStamp::operator>= (const IOVTimeStamp &ts) const
 
bool lariov::IOVTimeStamp::operator> (const IOVTimeStamp &ts) const
 
bool lariov::IOVTimeStamp::operator== (const IOVTimeStamp &ts) const
 implementation of equality operator More...
 
bool lariov::IOVTimeStamp::operator!= (const IOVTimeStamp &ts) const
 remaining comparison operators implemented in terms of == and < More...
 
IOVTimeStamp & lariov::IOVTimeStamp::operator= (const IOVTimeStamp &ts)
 assignment operator More...
 

Variables

unsigned long lariov::IOVTimeStamp::fStamp
 
unsigned int lariov::IOVTimeStamp::fSubStamp
 
std::string lariov::IOVTimeStamp::fDBStamp
 

Detailed Description

Function Documentation

void lariov::IOVTimeStamp::CalcDBStamp ( )

This function combines the stamp and substamp into a unique string to be used as a database timestamp.

Create unique database timestamp of the form <fStamp>.<fSubStamp>, where fSubStamp is prepended with zeroes to ensure six digits

Definition at line 27 of file IOVTimeStamp.cxx.

27  {
29  throw IOVDataError("SubStamp of an IOVTimeStamp cannot have more than six digits!");
30  }
31  std::stringstream stream;
33  fDBStamp = stream.str();
34  }
const unsigned int kMAX_SUBSTAMP_VALUE
unsigned int fSubStamp
Definition: IOVTimeStamp.h:71
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
unsigned long fStamp
Definition: IOVTimeStamp.h:70
const unsigned short kMAX_SUBSTAMP_LENGTH
Q_EXPORT QTSManip setfill(int f)
Definition: qtextstream.h:337
std::string fDBStamp
Definition: IOVTimeStamp.h:73
const std::string& lariov::IOVTimeStamp::DBStamp ( ) const
inline

Definition at line 39 of file IOVTimeStamp.h.

39 { return fDBStamp; }
std::string fDBStamp
Definition: IOVTimeStamp.h:73
IOVTimeStamp lariov::IOVTimeStamp::GetFromString ( const std::string ts)
static

Definition at line 36 of file IOVTimeStamp.cxx.

36  {
37  unsigned long stamp;
38  std::string substamp_str;
39  if (ts.find_first_of(".") == std::string::npos) {
40  stamp = std::stoul(ts);
41  substamp_str = "0";
42  }
43  else {
44  stamp = std::stoul(ts.substr(0, ts.find_first_of(".")));
45  substamp_str = ts.substr(ts.find_first_of(".")+1);
46  }
47 
48  if (substamp_str.length() > kMAX_SUBSTAMP_LENGTH) {
49  throw IOVDataError("SubStamp of an IOVTimeStamp cannot have more than six digits!");
50  }
51  while (substamp_str.length() < kMAX_SUBSTAMP_LENGTH) substamp_str += "0";
52  unsigned int substamp = std::stoi(substamp_str);
53 
54  return IOVTimeStamp(stamp,substamp);
55  }
IOVTimeStamp(unsigned long stamp, unsigned int substamp=0)
Constructor.
Definition: IOVTimeStamp.h:29
std::string string
Definition: nybbler.cc:12
const unsigned short kMAX_SUBSTAMP_LENGTH
lariov::IOVTimeStamp::IOVTimeStamp ( unsigned long  stamp,
unsigned int  substamp = 0 
)
inline

Constructor.

Definition at line 29 of file IOVTimeStamp.h.

29  :
30  fStamp(stamp), fSubStamp(substamp) {
31  this->CalcDBStamp();
32  }
unsigned int fSubStamp
Definition: IOVTimeStamp.h:71
unsigned long fStamp
Definition: IOVTimeStamp.h:70
IOVTimeStamp lariov::IOVTimeStamp::MaxTimeStamp ( )
static

Definition at line 61 of file IOVTimeStamp.cxx.

61  {
63  }
IOVTimeStamp(unsigned long stamp, unsigned int substamp=0)
Constructor.
Definition: IOVTimeStamp.h:29
const unsigned int kMAX_SUBSTAMP_VALUE
static int max(int a, int b)
IOVTimeStamp lariov::IOVTimeStamp::MinTimeStamp ( )
static

Definition at line 57 of file IOVTimeStamp.cxx.

57  {
58  return IOVTimeStamp(0,0);
59  }
IOVTimeStamp(unsigned long stamp, unsigned int substamp=0)
Constructor.
Definition: IOVTimeStamp.h:29
bool lariov::IOVTimeStamp::operator!= ( const IOVTimeStamp ts) const

remaining comparison operators implemented in terms of == and <

Definition at line 88 of file IOVTimeStamp.cxx.

88  {
89  return !( *this == ts);
90  }
bool lariov::IOVTimeStamp::operator< ( const IOVTimeStamp ts) const

comparison operators

implementation of operator<

Definition at line 75 of file IOVTimeStamp.cxx.

75  {
76  if (this->Stamp() < ts.Stamp()) return true;
77  else if (this->Stamp() == ts.Stamp() && this->SubStamp() < ts.SubStamp()) return true;
78  else return false;
79  }
unsigned long SubStamp() const
Definition: IOVTimeStamp.h:38
unsigned long Stamp() const
Definition: IOVTimeStamp.h:37
bool lariov::IOVTimeStamp::operator<= ( const IOVTimeStamp ts) const

Definition at line 92 of file IOVTimeStamp.cxx.

92  {
93  if ( *this < ts || *this == ts) return true;
94  else return false;
95  }
IOVTimeStamp & lariov::IOVTimeStamp::operator= ( const IOVTimeStamp ts)

assignment operator

implementation of assignment operator

Definition at line 66 of file IOVTimeStamp.cxx.

66  {
67  if (this == &ts) return *this;
68  fStamp = ts.Stamp();
69  fSubStamp = ts.SubStamp();
70  fDBStamp = ts.DBStamp();
71  return *this;
72  }
unsigned int fSubStamp
Definition: IOVTimeStamp.h:71
unsigned long fStamp
Definition: IOVTimeStamp.h:70
std::string fDBStamp
Definition: IOVTimeStamp.h:73
bool lariov::IOVTimeStamp::operator== ( const IOVTimeStamp ts) const

implementation of equality operator

Definition at line 82 of file IOVTimeStamp.cxx.

82  {
83  if ( fStamp == ts.Stamp() && fSubStamp == ts.SubStamp() ) return true;
84  return false;
85  }
unsigned int fSubStamp
Definition: IOVTimeStamp.h:71
unsigned long fStamp
Definition: IOVTimeStamp.h:70
bool lariov::IOVTimeStamp::operator> ( const IOVTimeStamp ts) const

Definition at line 102 of file IOVTimeStamp.cxx.

102  {
103  if ( !( *this <= ts) ) return true;
104  else return false;
105  }
bool lariov::IOVTimeStamp::operator>= ( const IOVTimeStamp ts) const

Definition at line 97 of file IOVTimeStamp.cxx.

97  {
98  if ( !( *this < ts) ) return true;
99  else return false;
100  }
void lariov::IOVTimeStamp::SetStamp ( unsigned long  stamp,
unsigned int  substamp = 0 
)
inline

Definition at line 41 of file IOVTimeStamp.h.

41 {fStamp = stamp; fSubStamp = substamp; this->CalcDBStamp();}
unsigned int fSubStamp
Definition: IOVTimeStamp.h:71
unsigned long fStamp
Definition: IOVTimeStamp.h:70
unsigned long lariov::IOVTimeStamp::Stamp ( ) const
inline

Definition at line 37 of file IOVTimeStamp.h.

37 { return fStamp; }
unsigned long fStamp
Definition: IOVTimeStamp.h:70
unsigned long lariov::IOVTimeStamp::SubStamp ( ) const
inline

Definition at line 38 of file IOVTimeStamp.h.

38 { return fSubStamp; }
unsigned int fSubStamp
Definition: IOVTimeStamp.h:71
virtual lariov::IOVTimeStamp::~IOVTimeStamp ( )
inlinevirtual

Default destructor.

Definition at line 35 of file IOVTimeStamp.h.

35 {}

Variable Documentation

std::string lariov::IOVTimeStamp::fDBStamp
protected

Definition at line 73 of file IOVTimeStamp.h.

unsigned long lariov::IOVTimeStamp::fStamp
protected

Definition at line 70 of file IOVTimeStamp.h.

unsigned int lariov::IOVTimeStamp::fSubStamp
protected

Definition at line 71 of file IOVTimeStamp.h.