Jpp 21.0.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JHitR0.hh
Go to the documentation of this file.
1#ifndef __JTRIGGER__JHITR0__
2#define __JTRIGGER__JHITR0__
3
5
6#include "JTrigger/JHit.hh"
7#include "JTrigger/JHitL0.hh"
8
9
10/**
11 * \file
12 *
13 * Basic data structure for L0 hit.
14 * \author mdejong
15 */
16namespace JTRIGGER {}
17namespace JPP { using namespace JTRIGGER; }
18
19namespace JTRIGGER {
20
22
23
24 /**
25 * Reduced data structure for L0 hit.
26 */
27 class JHitR0 :
28 public JHit
29 {
30 public:
31
32 typedef JDAQHit::JPMT_t JPMT_t; //!< PMT channel in FPGA
33
34
35 /**
36 * Default constructor.
37 */
39 JHit(),
40 pmt (0)
41 {}
42
43
44 /**
45 * Constructor.
46 *
47 * \param id PMT identifier
48 * \param hit hit
49 */
50 JHitR0(const JPMT_t& id,
51 const JHit& hit) :
52 JHit(hit),
53 pmt (id)
54 {}
55
56
57 /**
58 * Constructor.
59 *
60 * \param hit hit
61 */
62 JHitR0(const JHitL0& hit) :
63 JHit(hit.getHit()),
64 pmt (hit.getPMTAddress())
65 {}
66
67
68 /**
69 * Get PMT.
70 *
71 * \return PMT
72 */
73 inline JPMT_t getPMT() const
74 {
75 return pmt;
76 }
77
78
79 /**
80 * Get count.
81 *
82 * \return count
83 */
84 inline int getN() const
85 {
86 return 1;
87 }
88
89
90 /**
91 * Get weight.\n
92 * The returned weight is set to one.
93 *
94 * \return 1
95 */
96 inline double getW() const
97 {
98 return 1.0;
99 }
100
101
102 /**
103 * Auxiliary data structure for sorting of hits.
104 */
105 static const struct compare {
106 /**
107 * Compare hits by PMT and time.
108 *
109 * \param first first hit
110 * \param second second hit
111 * \return true if first before second; else false
112 */
113 bool operator()(const JHitR0& first, const JHitR0& second) const
114 {
115 if (first.getPMT() == second.getPMT())
116 return first.getT() < second.getT();
117 else
118 return first.getPMT() < second.getPMT();
119 }
121
122
123 protected:
124 JPMT_t pmt; //!< PMT readout channel in FPGA
125 };
126}
127
128#endif
Basic data structure for L0 hit.
Basic data structure for time and time over threshold information of hit.
Data structure for L0 hit.
Definition JHitL0.hh:31
Reduced data structure for L0 hit.
Definition JHitR0.hh:29
JPMT_t pmt
PMT readout channel in FPGA.
Definition JHitR0.hh:124
double getW() const
Get weight.
Definition JHitR0.hh:96
JDAQHit::JPMT_t JPMT_t
PMT channel in FPGA.
Definition JHitR0.hh:32
JPMT_t getPMT() const
Get PMT.
Definition JHitR0.hh:73
static const struct JTRIGGER::JHitR0::compare compare
JHitR0(const JPMT_t &id, const JHit &hit)
Constructor.
Definition JHitR0.hh:50
JHitR0()
Default constructor.
Definition JHitR0.hh:38
int getN() const
Get count.
Definition JHitR0.hh:84
JHitR0(const JHitL0 &hit)
Constructor.
Definition JHitR0.hh:62
Hit data structure.
const JHit & getHit() const
Get hit.
double getT() const
Get calibrated time of hit.
Hit data structure.
Definition JDAQHit.hh:35
unsigned char JPMT_t
PMT channel in FPGA.
Definition JDAQHit.hh:38
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
Auxiliary data structure for sorting of hits.
Definition JHitR0.hh:105
bool operator()(const JHitR0 &first, const JHitR0 &second) const
Compare hits by PMT and time.
Definition JHitR0.hh:113