Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDAQHitToTSelector.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JDAQHITTOTSELECTOR__
2 #define __JTRIGGER__JDAQHITTOTSELECTOR__
3 
4 #include <limits>
5 
7 
9 
10 #include "JTools/JRange.hh"
11 
12 
13 /**
14  * \author mdejong
15  */
16 
17 namespace JTRIGGER {}
18 namespace JPP { using namespace JTRIGGER; }
19 
20 namespace JTRIGGER {
21 
22  /**
23  * Auxiliary class to select DAQ hits based on time-over-treshold value.
24  */
26  public JClonable<JDAQHitSelector, JDAQHitToTSelector>,
27  public JTOOLS::JRange<JDAQHit::JTOT_t>
28  {
31 
32 
33  /**
34  * Default constructor.
35  */
37  range_type(0, std::numeric_limits<JTOT_t>::max())
38  {}
39 
40 
41  /**
42  * Constructor.
43  *
44  * \param tot_min minimal time-over-threshold
45  * \param tot_max maximal time-over-threshold
46  */
47  JDAQHitToTSelector(const JTOT_t tot_min, const JTOT_t tot_max) :
48  range_type(tot_min, tot_max)
49  {}
50 
51 
52  /**
53  * DAQ hit selection.
54  *
55  * \param hit DAQ hit
56  * \return true to select; else false
57  */
58  virtual bool operator()(const JDAQHit& hit) const
59  {
60  return static_cast<const range_type&>(*this)(hit.getToT());
61  }
62  };
63 }
64 
65 #endif
JDAQHitToTSelector(const JTOT_t tot_min, const JTOT_t tot_max)
Constructor.
virtual bool operator()(const JDAQHit &hit) const
DAQ hit selection.
JDAQHitToTSelector()
Default constructor.
JTOT_t getToT() const
Get time-over-threshold.
Definition: JDAQHit.hh:97
unsigned char JTOT_t
time over threshold [ns]
Definition: JDAQHit.hh:40
Hit data structure.
Definition: JDAQHit.hh:34
Template class for object cloning.
Definition: JClonable.hh:20
JTOOLS::JRange< JTOT_t > range_type
Range of values.
Definition: JRange.hh:34
Auxiliary class to define a range between two values.
Auxiliary class to select DAQ hits based on time-over-treshold value.