Jpp  16.0.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 {
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  }
100  } compare;
101  };
102 }
103 
104 #endif
double getT() const
Get calibrated time of hit.
const JDAQPMTIdentifier & getPMTIdentifier() const
Get PMT identifier.
double getW() const
Get weight.
Definition: JHitL0.hh:76
Hit data structure.
Basic data structure for time and time over threshold information of hit.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Axis object.
Definition: JAxis3D.hh:38
static struct JTRIGGER::JHitL0::@83 compare
Auxiliary data structure for sorting of hits.
JHitL0(const JDAQPMTIdentifier &pmt, const JAxis3D &axis, const JHit &hit)
Constructor.
Definition: JHitL0.hh:50
int getN() const
Get count.
Definition: JHitL0.hh:64
Data structure for L0 hit.
Definition: JHitL0.hh:27
JHitL0()
Default constructor.
Definition: JHitL0.hh:36