Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JTriggeredHit.hh
Go to the documentation of this file.
1#ifndef __JTRIGGEREDHIT__
2#define __JTRIGGEREDHIT__
3
4#include <functional>
5
8#include "JTrigger/JHit.hh"
9
10
11/**
12 * \author mdejong
13 */
14
15namespace JTRIGGER {}
16namespace JPP { using namespace JTRIGGER; }
17
18namespace JTRIGGER {
19
22
23
24 /**
25 * Data structure for triggered hit.
26 */
28 public JDAQPMTIdentifier,
29 public JHit,
30 public JDAQTriggerMask
31 {
32 public:
33 /**
34 * Default constructor.
35 */
41
42
43 /**
44 * Constructor.
45 *
46 * \param pmt PMT identifier
47 * \param hit hit
48 * \param mask trigger mask
49 */
51 const JHit& hit,
52 const JDAQTriggerMask& mask) :
54 JHit (hit),
55 JDAQTriggerMask (mask)
56 {}
57
58
59 /**
60 * Constructor.
61 *
62 * \param hit hit
63 * \param mask trigger mask
64 */
65 template<class JHit_t>
67 const JDAQTriggerMask& mask) :
69 JHit (hit.getHit()),
70 JDAQTriggerMask (mask)
71 {}
72 };
73
74
75 /**
76 * Less than operator for triggered hits.
77 *
78 * The less than operator is applied first to JTRIGGER::JHit and then to the KM3NETDAQ::JDAQPMTIdentifier.
79 * Hence, the ordering by JTRIGGER::JHit is maintained.
80 * This allows for the use of STL sort() and set_union() algorithms.
81 *
82 * \param first first hit
83 * \param second second hit
84 * \result true if first hit earlier or lower PMT identifier if equal; else false
85 */
86 inline bool operator<(const JTriggeredHit& first, const JTriggeredHit& second)
87 {
88 if (std::equal_to<JHit>()(first,second))
89 return std::less<JDAQPMTIdentifier>()(first,second);
90 else
91 return std::less<JHit> ()(first,second);
92 }
93
94
95 /**
96 * Equal operator for triggered hits.
97 *
98 * The equal operator is applied to JTRIGGER::JHit and to the KM3NETDAQ::JDAQPMTIdentifier.
99 *
100 * \param first first hit
101 * \param second second hit
102 * \result true if first hit equal second hit; else false
103 */
104 inline bool operator==(const JTriggeredHit& first, const JTriggeredHit& second)
105 {
106 return (std::equal_to<JDAQPMTIdentifier>()(first,second) &&
107 std::equal_to<JHit> ()(first,second));
108 }
109}
110
111#endif
Basic data structure for time and time over threshold information of hit.
Hit data structure.
const JHit & getHit() const
Get hit.
Data structure for triggered hit.
JTriggeredHit(const JHit_t &hit, const JDAQTriggerMask &mask)
Constructor.
JTriggeredHit(const JDAQPMTIdentifier &pmt, const JHit &hit, const JDAQTriggerMask &mask)
Constructor.
JTriggeredHit()
Default constructor.
const JDAQPMTIdentifier & getPMTIdentifier() const
Get PMT identifier.
Auxiliary class for trigger mask.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
bool operator<(const JEvent &first, const JEvent &second)
Less than operator for events.
bool operator==(const JHit &first, const JHit &second)
Equal operator for hits.
Auxiliary class to set-up Hit.
Definition JSirene.hh:58