Jpp  17.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JPulse.hh
Go to the documentation of this file.
1 #ifndef __JSIRENE__JPULSE__
2 #define __JSIRENE__JPULSE__
3 
5 
6 #include "JLang/JObjectID.hh"
9 
10 
11 /**
12  * \file
13  *
14  * Time-over-threshold (ToT) pulse from a PMT.
15  * A ToT pulse is defined by a object identifier and a start and stop time.
16  * \author mdejong
17  */
18 
19 namespace JSIRENE {}
20 namespace JPP { using namespace JSIRENE; }
21 
22 namespace JSIRENE {
23 
24  using JLANG::JObjectID;
25  using JAANET::getTime;
27 
28 
29  /**
30  * Auxiliary class for a time-over-threshold pulse from a PMT.
31  * A ToT pulse is defined by a object identifier and a start and stop time.
32  */
33  class JPulse :
34  public JObjectID,
35  public JTimeRange
36  {
37  public:
38  /**
39  * Default constructor.
40  */
41  JPulse() :
42  JObjectID(),
43  JTimeRange()
44  {}
45 
46 
47  /**
48  * Constructor.
49  *
50  * \param hit hit
51  */
52  JPulse(const Hit& hit) :
53  JObjectID(hit.pmt_id),
54  JTimeRange(getTime(hit),getTime(hit))
55  {}
56 
57 
58  /**
59  * Constructor.
60  *
61  * \param first first hit
62  * \param second second hit
63  */
65  const JPulse& second) :
66  JObjectID(first.getID()),
67  JTimeRange(first)
68  {
69  combine(second);
70  }
71  };
72 
73 
74  /**
75  * Compare Monte Carlo hit times.
76  *
77  * \param first first hit
78  * \param second second hit
79  * \return true if first hit earlier than second; else false
80  */
81  inline bool operator<(const JPulse& first, const JPulse& second)
82  {
83  return first.getLowerLimit() < second.getLowerLimit();
84  }
85 
86 
87  /**
88  * Compare Monte Carlo hit times.
89  *
90  * \param hit hit
91  * \param t0 time [ns]
92  * \return true if hit earlier than given time; else false
93  */
94  inline bool operator<(const JPulse& hit, const double t0)
95  {
96  return hit.getLowerLimit() < t0;
97  }
98 }
99 
100 #endif
JPulse(const JPulse &first, const JPulse &second)
Constructor.
Definition: JPulse.hh:64
bool operator<(const Head &first, const Head &second)
Less than operator.
Definition: JHead.hh:1741
double getTime(const Hit &hit)
Get true time of hit.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
JPulse()
Default constructor.
Definition: JPulse.hh:41
int getID() const
Get identifier.
Definition: JObjectID.hh:50
Definition of hit and track types and auxiliary methods for handling Monte Carlo data.
JRange< T, JComparator_t > combine(const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
Combine ranges.
Definition: JRange.hh:685
JPulse(const Hit &hit)
Constructor.
Definition: JPulse.hh:52
Definition: Hit.hh:8
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
Auxiliary class for a time-over-threshold pulse from a PMT.
Definition: JPulse.hh:33
Auxiliary class for object identification.
Definition: JObjectID.hh:22
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [s]).