Acoustic event.
More...
#include <JEvent.hh>
|
template<class T > |
static void | overlap (T p, T q, const double Tmax_s) |
| Empty overlapping events. More...
|
|
Acoustic event.
Definition at line 38 of file JAcoustics/JEvent.hh.
JACOUSTICS::JEvent::JEvent |
( |
| ) |
|
|
inline |
template<class T >
JACOUSTICS::JEvent::JEvent |
( |
const int |
detid, |
|
|
const int |
counter, |
|
|
const int |
id, |
|
|
T |
__begin, |
|
|
T |
__end |
|
) |
| |
|
inline |
Constructor.
The transmissions will be sorted to ensure proper functioning of method JEvent::merge and class JEventOverlap.
- Parameters
-
detid | detector identifier |
counter | counter |
id | identifier |
__begin | begin of data |
__end | end of data |
Definition at line 97 of file JAcoustics/JEvent.hh.
109 for (
T i = __begin;
i != __end; ++
i) {
113 sort(this->begin(), this->end());
JCounter()
Default constructor.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
virtual JACOUSTICS::JEvent::~JEvent |
( |
| ) |
|
|
inlinevirtual |
const int JACOUSTICS::JEvent::getDetectorID |
( |
| ) |
const |
|
inline |
int JACOUSTICS::JEvent::getOverlays |
( |
| ) |
const |
|
inline |
int JACOUSTICS::JEvent::getID |
( |
| ) |
const |
|
inline |
void JACOUSTICS::JEvent::merge |
( |
const JEvent & |
event | ) |
|
|
inline |
Merge event.
It is assumed that the transmissions in both events are ordered according the default less-than operator.
- Parameters
-
Definition at line 165 of file JAcoustics/JEvent.hh.
171 const_iterator __hit1 =
this ->begin();
172 const_iterator __end1 =
this ->end();
174 const_iterator __hit2 =
event.begin();
175 const_iterator __end2 =
event.end();
177 buffer.resize(this->size() + event.size());
181 while (__hit1 != __end1 && __hit2 != __end2) {
183 if (*__hit1 < *__hit2) {
188 }
else if (*__hit2 < *__hit1) {
206 out =
copy(__hit1, __end1, out);
207 out =
copy(__hit2, __end2, out);
209 buffer.resize(
distance(buffer.begin(), out));
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
friend void swap(JEvent &first, JEvent &second)
Swap events.
void copy(const Head &from, JHead &to)
Copy header from from to to.
template<class T >
static void JACOUSTICS::JEvent::overlap |
( |
T |
p, |
|
|
T |
q, |
|
|
const double |
Tmax_s |
|
) |
| |
|
inlinestatic |
Empty overlapping events.
The events should be time sorted on input.
The time window applies to the difference between the first transmission of an event and the last transmission of the previous event.
- Parameters
-
p | begin of events |
q | end of events |
Tmax_s | time window [s] |
Definition at line 247 of file JAcoustics/JEvent.hh.
249 for (
T __q = p, __p = __q++; __p != q && __q != q; __p = __q++) {
253 __q->begin()->getToE() < __p->rbegin()->getToE() + Tmax_s) {
257 for (__p = __q++; __p != q && __q != q; __p = __q++) {
259 if (__q->begin()->getToE() < __p->rbegin()->getToE() + Tmax_s)
do set_variable OUTPUT_DIRECTORY $WORKDIR T
Read from input.
- Parameters
-
- Returns
- reader
Implements JIO::JSerialisable.
Definition at line 326 of file JAcoustics/JEvent.hh.
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Write to output.
- Parameters
-
- Returns
- writer
Implements JIO::JSerialisable.
Definition at line 344 of file JAcoustics/JEvent.hh.
346 out << static_cast<const JCounter&>(*this);
350 out << static_cast<const std::vector<JTransmission>&>(*this);
JACOUSTICS::JEvent::ClassDefOverride |
( |
JEvent |
, |
|
|
4 |
|
|
) |
| |
int JACOUSTICS::JCounter::getCounter |
( |
| ) |
const |
|
inlineinherited |
JACOUSTICS::JCounter::ClassDefNV |
( |
JCounter |
, |
|
|
1 |
|
|
) |
| |
|
inherited |
Swap events.
- Parameters
-
first | first event |
second | second event |
Definition at line 223 of file JAcoustics/JEvent.hh.
228 std::swap(first.
id, second.
id);
friend void swap(JEvent &first, JEvent &second)
Swap events.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
bool operator< |
( |
const JEvent & |
first, |
|
|
const JEvent & |
second |
|
) |
| |
|
friend |
Less than operator for acoustics events.
The less than operator is applied to the first hit in the events.
If there are no hits in either event, the counter of the events is used.
- Parameters
-
first | first event |
second | second event |
- Returns
- true if first event earliear than second; else false
Definition at line 281 of file JAcoustics/JEvent.hh.
283 if (!first.empty() && !second.empty())
284 return first.begin()->getToE() < second.begin()->getToE();
int getCounter() const
Get counter.
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const JEvent & |
event |
|
) |
| |
|
friend |
Write event to output stream.
- Parameters
-
out | output stream |
event | event |
- Returns
- output stream
Definition at line 297 of file JAcoustics/JEvent.hh.
301 out <<
event.getDetectorID() << endl;
302 out << setw(8) <<
event.getCounter() << endl;
303 out << setw(2) <<
event.getOverlays() << endl;
304 out << setw(3) <<
event.getID() << endl;
306 for (const_iterator
i = event.begin();
i !=
event.end(); ++
i) {
308 out << setw(10) <<
i->getID() <<
' '
309 << setw(10) <<
i->getRunNumber() <<
' '
310 << fixed << setw(12) << setprecision(6) <<
i->getToA() <<
' '
311 << fixed << setw(12) << setprecision(6) <<
i->getToE() <<
' '
312 << fixed << setw(8) << setprecision(0) <<
i->getQ() <<
' '
313 << fixed << setw(8) << setprecision(0) <<
i->getW() << endl;
int JACOUSTICS::JEvent::detid |
|
protected |
int JACOUSTICS::JEvent::overlays |
|
protected |
int JACOUSTICS::JEvent::id |
|
protected |
int JACOUSTICS::JCounter::counter |
|
protectedinherited |
The documentation for this struct was generated from the following file: