Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
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
19namespace JSIRENE {}
20namespace JPP { using namespace JSIRENE; }
21
22namespace 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 */
42 JObjectID(),
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) :
68 {
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
Definition of hit and track types and auxiliary methods for handling Monte Carlo data.
Auxiliary class for object identification.
Definition JObjectID.hh:25
int getID() const
Get identifier.
Definition JObjectID.hh:50
Auxiliary class for a time-over-threshold pulse from a PMT.
Definition JPulse.hh:36
JPulse(const Hit &hit)
Constructor.
Definition JPulse.hh:52
JPulse()
Default constructor.
Definition JPulse.hh:41
JPulse(const JPulse &first, const JPulse &second)
Constructor.
Definition JPulse.hh:64
T getLowerLimit() const
Get lower limit.
Definition JRange.hh:202
range_type & combine(const range_type &range)
Definition JRange.hh:432
double getTime(const Hit &hit)
Get true time of hit.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Detector simulations.
bool operator<(const JPulse &first, const JPulse &second)
Compare Monte Carlo hit times.
Definition JPulse.hh:81
Definition Hit.hh:10