Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JHighRateVeto.hh
Go to the documentation of this file.
1#ifndef __JDAQ__JHIGHRATEVETO__
2#define __JDAQ__JHIGHRATEVETO__
3
5
6/**
7 * \author mdejong
8 */
9
10namespace KM3NETDAQ {
11
12 /**
13 * High-rate veto [kHz]
14 */
15 static double HIGH_RATE_VETO_HZ = 20.0e3;
16
17
18 /**
19 * Get maximal number of hits from one PMT within data frame.
20 *
21 * \return number of hits
22 */
23 inline size_t getMaximalNumberOfHits()
24 {
25 return (size_t) (getFrameTime() * (HIGH_RATE_VETO_HZ * 1.0e-9));
26 }
27
28
29 /**
30 * Get maximal time for given rate.
31 *
32 * \param R_Hz rate [Hz]
33 * \return time [ns]
34 */
35 inline double getMaximalTime(const double R_Hz)
36 {
37 double t1 = getFrameTime();
38
39 if (R_Hz > 0) {
40
41 t1 = (double) getMaximalNumberOfHits() / (R_Hz * 1.0e-9);
42
43 if (t1 > getFrameTime()) {
44 t1 = getFrameTime();
45 }
46 }
47
48 return t1;
49 }
50}
51
52#endif
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
size_t getMaximalNumberOfHits()
Get maximal number of hits from one PMT within data frame.
double getFrameTime()
Get frame time duration.
Definition JDAQClock.hh:162
double getMaximalTime(const double R_Hz)
Get maximal time for given rate.
static double HIGH_RATE_VETO_HZ
High-rate veto [kHz].