Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
mcdatadaq::GlobalEventTime Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-05-05/MockDataDAQ/include/GlobalEventTime.h"

Public Member Functions

 ~GlobalEventTime ()
 
void advanceEventTime ()
 Increment the time of the next event time by fEventTimeDifference. More...
 
void print () const
 Print methods. More...
 
void printEventTime () const
 
void printNanoSliceTime (const daqdataformats::RawNanoSlice *Nanoslice) const
 
unsigned long long getNanoSliceGlobalTime (const daqdataformats::RawNanoSlice *Nanoslice) const
 Get Global Time for the nanoslice. More...
 
unsigned long long getGlobalEventTime () const
 GetGlobal Time. More...
 
unsigned long long getNextEventGlobalTime () const
 GetGlobal Time. More...
 

Static Public Member Functions

static GlobalEventTimegetInstance ()
 Method to obtain the class instance. More...
 

Private Member Functions

 GlobalEventTime ()
 Constructors. More...
 
 GlobalEventTime (const unsigned long long time_difference, const unsigned long long global_event_time=0)
 

Private Attributes

unsigned long long fEventTimeDifference
 !< Instance pointer for singleton class More...
 
unsigned long long fGlobalEventTime
 ! Time difference between events (in ticks) More...
 

Static Private Attributes

static GlobalEventTimefinstanceID = NULL
 

Detailed Description

Definition at line 28 of file GlobalEventTime.h.

Constructor & Destructor Documentation

mcdatadaq::GlobalEventTime::~GlobalEventTime ( )

Definition at line 54 of file GlobalEventTime.cpp.

54 {}
mcdatadaq::GlobalEventTime::GlobalEventTime ( )
private

Constructors.

Definition at line 36 of file GlobalEventTime.cpp.

References print().

Referenced by getInstance().

36  :
38  , fGlobalEventTime(0)
39 {
40  print();
41 }
unsigned long long fEventTimeDifference
!< Instance pointer for singleton class
void print() const
Print methods.
static const uint32_t DEFAULT_TIME_DIFF
unsigned long long fGlobalEventTime
! Time difference between events (in ticks)
mcdatadaq::GlobalEventTime::GlobalEventTime ( const unsigned long long  time_difference,
const unsigned long long  global_event_time = 0 
)
private

Definition at line 44 of file GlobalEventTime.cpp.

References print().

45  :
46  fEventTimeDifference(time_difference)
47  , fGlobalEventTime(global_event_time)
48 {
49  print();
50 }
unsigned long long fEventTimeDifference
!< Instance pointer for singleton class
void print() const
Print methods.
unsigned long long fGlobalEventTime
! Time difference between events (in ticks)

Member Function Documentation

void mcdatadaq::GlobalEventTime::advanceEventTime ( )

Increment the time of the next event time by fEventTimeDifference.

Definition at line 58 of file GlobalEventTime.cpp.

References fEventTimeDifference, and fGlobalEventTime.

Referenced by mcdatadaq::DAQSimulator::nextEvent().

unsigned long long fEventTimeDifference
!< Instance pointer for singleton class
unsigned long long fGlobalEventTime
! Time difference between events (in ticks)
unsigned long long mcdatadaq::GlobalEventTime::getGlobalEventTime ( ) const
GlobalEventTime * mcdatadaq::GlobalEventTime::getInstance ( )
static

Method to obtain the class instance.

Check if there is an instance active If there is not, make a new one

Definition at line 24 of file GlobalEventTime.cpp.

References finstanceID, mcdatadaq::Configuration::getEventTimeDifference(), mcdatadaq::Configuration::getInstance(), and GlobalEventTime().

Referenced by mcdatadaq::DCMSimulator::createMicroSlice(), mcdatadaq::DCMSimulator::fillMilliSlice(), mcdatadaq::DCMSimulator::generateNanoSlice(), mcdatadaq::GlobalTriggerSimulator::getNewTrigger(), and mcdatadaq::DAQSimulator::nextEvent().

24  {
25 
26  /// Check if there is an instance active
27  /// If there is not, make a new one
28  if(finstanceID == NULL){
30  finstanceID = new GlobalEventTime(config->getEventTimeDifference());
31  }
32  return finstanceID;
33 }
Definition: config.py:1
static GlobalEventTime * finstanceID
static Configuration * getInstance()
Method to obtain the class instance.
unsigned long long mcdatadaq::GlobalEventTime::getNanoSliceGlobalTime ( const daqdataformats::RawNanoSlice Nanoslice) const

Get Global Time for the nanoslice.

Definition at line 89 of file GlobalEventTime.cpp.

References fGlobalEventTime.

89  {
90  const unsigned long long Nanoslice_Time = fGlobalEventTime + Nanoslice->getTimeStamp();
91  return Nanoslice_Time;
92 }
unsigned long long fGlobalEventTime
! Time difference between events (in ticks)
unsigned long long mcdatadaq::GlobalEventTime::getNextEventGlobalTime ( ) const

GetGlobal Time.

Definition at line 98 of file GlobalEventTime.cpp.

References fEventTimeDifference, and fGlobalEventTime.

unsigned long long fEventTimeDifference
!< Instance pointer for singleton class
unsigned long long fGlobalEventTime
! Time difference between events (in ticks)
void mcdatadaq::GlobalEventTime::print ( ) const

Print methods.

Definition at line 62 of file GlobalEventTime.cpp.

References om::cout, allTimeWatchdog::endl, fEventTimeDifference, and fGlobalEventTime.

Referenced by GlobalEventTime().

62  {
63 
64  std::cout<<"GlobalEventTime::print :"<<std::endl;
65  std::cout<<" First Event Time="<<fGlobalEventTime<<std::endl;
66  std::cout<<" Event Time Difference="<<fEventTimeDifference<<std::endl;
67 }
unsigned long long fEventTimeDifference
!< Instance pointer for singleton class
OStream cout
Definition: OStream.cxx:6
unsigned long long fGlobalEventTime
! Time difference between events (in ticks)
void mcdatadaq::GlobalEventTime::printEventTime ( ) const

Definition at line 71 of file GlobalEventTime.cpp.

References fGlobalEventTime, and printf().

71  {
72  printf("------------------------------\n");
73  printf("Event time = %llu\n", (unsigned long long)fGlobalEventTime);
74  printf("------------------------------\n");
75 }
printf("%d Experimental points found\n", nlines)
unsigned long long fGlobalEventTime
! Time difference between events (in ticks)
void mcdatadaq::GlobalEventTime::printNanoSliceTime ( const daqdataformats::RawNanoSlice Nanoslice) const

Definition at line 78 of file GlobalEventTime.cpp.

References fGlobalEventTime, and printf().

78  {
79 
80  const unsigned long long Nanoslice_Time = fGlobalEventTime + Nanoslice->getTimeStamp();
81 
82  printf("------------------------------\n");
83  printf("Raw NanoSlice time = %d\n", Nanoslice->getTimeStamp());
84  printf("Global Nanoslice time = %llu\n", (unsigned long long)Nanoslice_Time);
85  printf("------------------------------\n");
86 }
printf("%d Experimental points found\n", nlines)
unsigned long long fGlobalEventTime
! Time difference between events (in ticks)

Member Data Documentation

unsigned long long mcdatadaq::GlobalEventTime::fEventTimeDifference
private

!< Instance pointer for singleton class

Definition at line 59 of file GlobalEventTime.h.

Referenced by advanceEventTime(), getNextEventGlobalTime(), and print().

unsigned long long mcdatadaq::GlobalEventTime::fGlobalEventTime
private

! Time difference between events (in ticks)

Definition at line 60 of file GlobalEventTime.h.

Referenced by advanceEventTime(), getGlobalEventTime(), getNanoSliceGlobalTime(), getNextEventGlobalTime(), print(), printEventTime(), and printNanoSliceTime().

GlobalEventTime * mcdatadaq::GlobalEventTime::finstanceID = NULL
staticprivate

Definition at line 57 of file GlobalEventTime.h.

Referenced by getInstance().


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