Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
KM3NETDAQ::JDAQClock Class Reference

Auxiliary class to set DAQ system clock parameters. More...

#include <JDAQClock.hh>

Public Types

enum  JDAQClock_t { KM3NET = 1 , PPM_DU = 3 , ANTARES = 101 }
 Clock types. More...
 

Public Member Functions

 JDAQClock (const JDAQClock_t clock=KM3NET)
 Constructor.
 
JDAQClock_t get () const
 Get clock type.
 
void set (const JDAQClock_t clock)
 Set clock type.
 
void set ()
 Set DAQ clock parameters.
 

Protected Attributes

JDAQClock_t clock
 

Friends

std::istream & operator>> (std::istream &in, JDAQClock &clock)
 Read clock from input.
 
std::ostream & operator<< (std::ostream &out, const JDAQClock &clock)
 Write clock to output.
 

Detailed Description

Auxiliary class to set DAQ system clock parameters.

Definition at line 27 of file JDAQClock.hh.

Member Enumeration Documentation

◆ JDAQClock_t

Clock types.

Enumerator
KM3NET 
PPM_DU 
ANTARES 

Definition at line 32 of file JDAQClock.hh.

32{ KM3NET = 1, PPM_DU = 3, ANTARES = 101 };
Name space for Antares.
Definition Jpp.hh:21
Name space for KM3NeT.
Definition Jpp.hh:16

Constructor & Destructor Documentation

◆ JDAQClock()

KM3NETDAQ::JDAQClock::JDAQClock ( const JDAQClock_t clock = KM3NET)
inline

Constructor.

Parameters
clockclock type

Definition at line 40 of file JDAQClock.hh.

41 {
42 this->clock = clock;
43
44 set();
45 }
void set()
Set DAQ clock parameters.
Definition JDAQClock.hh:75

Member Function Documentation

◆ get()

JDAQClock_t KM3NETDAQ::JDAQClock::get ( ) const
inline

Get clock type.

Returns
clock type

Definition at line 53 of file JDAQClock.hh.

54 {
55 return clock;
56 }

◆ set() [1/2]

void KM3NETDAQ::JDAQClock::set ( const JDAQClock_t clock)
inline

Set clock type.

Parameters
clockclock type

Definition at line 64 of file JDAQClock.hh.

65 {
66 this->clock = clock;
67
68 set();
69 }

◆ set() [2/2]

void KM3NETDAQ::JDAQClock::set ( )
inline

Set DAQ clock parameters.

Definition at line 75 of file JDAQClock.hh.

76 {
77 switch (this->clock) {
78
79 case KM3NET:
80 FRAME_TIME_NS = 100000000.0;
81 RESET_TIME_NS = FRAME_TIME_NS;
82 break;
83
84 case PPM_DU:
85 FRAME_TIME_NS = (1<<27);
86 RESET_TIME_NS = FRAME_TIME_NS;
87 break;
88
89 case ANTARES:
90 FRAME_TIME_NS = 13107200.0 * 8;
91 RESET_TIME_NS = 419430400.0;
92 break;
93
94 default:
95 throw JDAQException("Undefined clock.");
96 }
97 }

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
JDAQClock & clock )
friend

Read clock from input.

Parameters
ininput stream
clockJClock
Returns
input stream

Definition at line 107 of file JDAQClock.hh.

108 {
109 using namespace std;
110
111 int clk;
112
113 in >> clk;
114
115 try {
116 clock.set((JDAQClock_t) clk);
117 }
118 catch(const std::exception& error) {
119 in.setstate(ios_base::badbit);
120 }
121
122 return in;
123 }
JDAQClock_t
Clock types.
Definition JDAQClock.hh:32

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JDAQClock & clock )
friend

Write clock to output.

Parameters
outoutput stream
clockJClock
Returns
output stream

Definition at line 133 of file JDAQClock.hh.

134 {
135 return out << clock.clock;
136 }

Member Data Documentation

◆ clock

JDAQClock_t KM3NETDAQ::JDAQClock::clock
protected

Definition at line 140 of file JDAQClock.hh.


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