Jpp  15.0.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JHitR0.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JHITR0__
2 #define __JTRIGGER__JHITR0__
3 
4 #include "JTrigger/JHit.hh"
6 
7 
8 /**
9  * \file
10  *
11  * Basic data structure for L0 hit.
12  * \author mdejong
13  */
14 namespace JTRIGGER {}
15 namespace JPP { using namespace JTRIGGER; }
16 
17 namespace JTRIGGER {
18 
19  using KM3NETDAQ::JDAQHit;
20 
21 
22  /**
23  * Reduced data structure for L0 hit.
24  */
25  class JHitR0 :
26  public JHit
27  {
28  public:
29 
30  typedef JDAQHit::JPMT_t JPMT_t; //!< PMT channel in FPGA
31 
32 
33  /**
34  * Default constructor.
35  */
36  JHitR0() :
37  JHit(),
38  pmt (0)
39  {}
40 
41 
42  /**
43  * Constructor.
44  *
45  * \param id PMT identifier
46  * \param hit hit
47  */
48  JHitR0(const JPMT_t& id,
49  const JHit& hit) :
50  JHit(hit),
51  pmt (id)
52  {}
53 
54 
55  /**
56  * Get PMT.
57  *
58  * \return PMT
59  */
60  inline JPMT_t getPMT() const
61  {
62  return pmt;
63  }
64 
65 
66  /**
67  * Get count.
68  *
69  * \return count
70  */
71  inline int getN() const
72  {
73  return 1;
74  }
75 
76 
77  /**
78  * Get weight.\n
79  * The returned weight is set to one.
80  *
81  * \return 1
82  */
83  inline double getW() const
84  {
85  return 1.0;
86  }
87 
88 
89  /**
90  * Auxiliary data structure for sorting of hits.
91  */
92  static const struct {
93  /**
94  * Compare hits by PMT and time.
95  *
96  * \param first first hit
97  * \param second second hit
98  * \return true if first before second; else false
99  */
100  bool operator()(const JHitR0& first, const JHitR0& second) const
101  {
102  if (first.getPMT() == second.getPMT())
103  return first.getT() < second.getT();
104  else
105  return first.getPMT() < second.getPMT();
106  }
107  } compare;
108 
109 
110  protected:
111  JPMT_t pmt; //!< PMT readout channel in FPGA
112  };
113 }
114 
115 #endif
double getW() const
Get weight.
Definition: JHitR0.hh:83
double getT() const
Get calibrated time of hit.
JHitR0()
Default constructor.
Definition: JHitR0.hh:36
Hit data structure.
Basic data structure for time and time over threshold information of hit.
JPMT_t pmt
PMT readout channel in FPGA.
Definition: JHitR0.hh:111
JPMT_t getPMT() const
Get PMT.
Definition: JHitR0.hh:60
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Reduced data structure for L0 hit.
Definition: JHitR0.hh:25
Hit data structure.
Definition: JDAQHit.hh:34
JHitR0(const JPMT_t &id, const JHit &hit)
Constructor.
Definition: JHitR0.hh:48
int getN() const
Get count.
Definition: JHitR0.hh:71
JDAQHit::JPMT_t JPMT_t
PMT channel in FPGA.
Definition: JHitR0.hh:30
static struct JTRIGGER::JHitR0::@79 compare
Auxiliary data structure for sorting of hits.
unsigned char JPMT_t
PMT channel in FPGA.
Definition: JDAQHit.hh:38