Jpp  master_rocky-40-g5f0272dcd
the software that should make you happy
JHitL0.hh
Go to the documentation of this file.
1 #ifndef __JTRIGGER__JHITL0__
2 #define __JTRIGGER__JHITL0__
3 
5 #include "JGeometry3D/JAxis3D.hh"
6 #include "JTrigger/JHit.hh"
7 
8 
9 /**
10  * \file
11  *
12  * Basic data structure for L0 hit.
13  * \author mdejong
14  */
15 namespace JTRIGGER {}
16 namespace JPP { using namespace JTRIGGER; }
17 
18 namespace JTRIGGER {
19 
22 
23 
24  /**
25  * Data structure for L0 hit.
26  */
27  class JHitL0 :
28  public JDAQPMTIdentifier,
29  public JAxis3D,
30  public JHit
31  {
32  public:
33  /**
34  * Default constructor.
35  */
36  JHitL0() :
38  JAxis3D (),
39  JHit ()
40  {}
41 
42 
43  /**
44  * Constructor.
45  *
46  * \param pmt PMT identifier
47  * \param axis PMT axis
48  * \param hit hit
49  */
51  const JAxis3D& axis,
52  const JHit& hit) :
53  JDAQPMTIdentifier(pmt),
54  JAxis3D (axis),
55  JHit (hit)
56  {}
57 
58 
59  /**
60  * Get count.
61  *
62  * \return count
63  */
64  inline int getN() const
65  {
66  return 1;
67  }
68 
69 
70  /**
71  * Get weight.\n
72  * The returned weight is set to one.
73  *
74  * \return 1
75  */
76  inline double getW() const
77  {
78  return 1.0;
79  }
80 
81 
82  /**
83  * Auxiliary data structure for sorting of hits.
84  */
85  static const struct compare {
86  /**
87  * Compare hits by PMT identifier and time.
88  *
89  * \param first first hit
90  * \param second second hit
91  * \return true if first before second; else false
92  */
93  bool operator()(const JHitL0& first, const JHitL0& second) const
94  {
95  if (first.getPMTIdentifier() == second.getPMTIdentifier())
96  return first.getT() < second.getT();
97  else
98  return first.getPMTIdentifier() < second.getPMTIdentifier();
99  }
101  };
102 }
103 
104 #endif
Basic data structure for time and time over threshold information of hit.
Axis object.
Definition: JAxis3D.hh:41
Data structure for L0 hit.
Definition: JHitL0.hh:31
JHitL0()
Default constructor.
Definition: JHitL0.hh:36
int getN() const
Get count.
Definition: JHitL0.hh:64
static const struct JTRIGGER::JHitL0::compare compare
JHitL0(const JDAQPMTIdentifier &pmt, const JAxis3D &axis, const JHit &hit)
Constructor.
Definition: JHitL0.hh:50
double getW() const
Get weight.
Definition: JHitL0.hh:76
Hit data structure.
double getT() const
Get calibrated time of hit.
const JDAQPMTIdentifier & getPMTIdentifier() const
Get PMT identifier.
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: JHitL0.hh:85
bool operator()(const JHitL0 &first, const JHitL0 &second) const
Compare hits by PMT identifier and time.
Definition: JHitL0.hh:93