GlobalEventTime.h
Go to the documentation of this file.
1 /*
2  * File: GlobalEventTime.h
3  * Author: denis
4  *
5  * This class keeps track of the global event time for a simulated event
6  * for the NOvA DAQ simulation
7  *
8  * Created on February 10, 2010, 11:31 AM
9  */
10 
11 #ifndef _GLOBALEVENTTIME_H
12 #define _GLOBALEVENTTIME_H
13 #include <stdint.h>
14 
15 
16 // forward declarations
17 namespace daqdataformats{
18  class RawNanoSlice;
19 }
20 
21 // using unsigned long long instead of uint64_t to ensure consistent behavior on OSX and LINUX
22 
23 namespace mcdatadaq {
24 
25  //static const uint32_t DEFAULT_TIME_DIFF = 3200000; //In clock ticks . Equals to 50 millisec between events
26  static const uint32_t DEFAULT_TIME_DIFF = 128000000; //In clock ticks . 2 seconds
27 
29  public:
30  static GlobalEventTime* getInstance(); //!< Method to obtain the class instance
31  ~GlobalEventTime();
32 
33  /// Increment the time of the next event time by fEventTimeDifference
34  void advanceEventTime();
35 
36  /// Print methods
37  void print() const;
38  void printEventTime() const;
39  void printNanoSliceTime(const daqdataformats::RawNanoSlice* Nanoslice) const;
40 
41  /// Get Global Time for the nanoslice
42  unsigned long long getNanoSliceGlobalTime(const daqdataformats::RawNanoSlice* Nanoslice) const;
43 
44  /// GetGlobal Time
45  unsigned long long getGlobalEventTime() const;
46 
47  /// GetGlobal Time
48  unsigned long long getNextEventGlobalTime() const;
49 
50 
51  private:
52  /// Constructors
54  GlobalEventTime(const unsigned long long time_difference, const unsigned long long global_event_time=0);
55 
56  private:
57  static GlobalEventTime* finstanceID; ///!< Instance pointer for singleton class
58 
59  unsigned long long fEventTimeDifference; ///! Time difference between events (in ticks)
60  unsigned long long fGlobalEventTime; ///! Global event time (in ticks)
61 
62 
63  };// end of GlobalEventTime
64 }// end of mcdatadaq namespace
65 
66 #endif /* _GLOBALEVENTTIME_H */
67 
unsigned long long fEventTimeDifference
!< Instance pointer for singleton class
static GlobalEventTime * finstanceID
Something conflicts with RandomNumberGenerator. Keep DAQSimulator.h include below Art Framework inclu...
bool print
static const uint32_t DEFAULT_TIME_DIFF
unsigned long long fGlobalEventTime
! Time difference between events (in ticks)
Class to hold the data from the FEBs in correct formats.