1 #ifndef __JACOUSTICS__JEVENT__
2 #define __JACOUSTICS__JEVENT__
26 namespace JACOUSTICS {}
27 namespace JPP {
using namespace JACOUSTICS; }
29 namespace JACOUSTICS {
70 return event.begin()->getToE();
109 for (
T i = __begin;
i != __end; ++
i) {
113 sort(this->begin(), this->end());
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));
228 std::swap(first.
id, second.
id);
247 static inline void overlap(
T p,
T q,
const double Tmax_s)
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)
283 if (!first.empty() && !second.empty())
284 return first.begin()->getToE() < second.begin()->getToE();
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;
328 in >>
static_cast<JCounter&
>(*this);
346 out << static_cast<const JCounter&>(*this);
350 out << static_cast<const std::vector<JTransmission>&>(*this);
int getOverlays() const
Get number of overlayed events.
Interface for binary output.
const int getDetectorID() const
Get detector identifier.
ClassDefOverride(JEvent, 4)
void merge(const JEvent &event)
Merge event.
JEvaluator()
Default constructor.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
int getCounter() const
Get counter.
JEvent()
Default constructor.
friend std::ostream & operator<<(std::ostream &out, const JEvent &event)
Write event to output stream.
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
Forward declaration of binary output.
value_type operator()(const JEvent &event) const
Get value of object.
double value_type
Type definition of time value.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
virtual JWriter & write(JWriter &out) const override
Write to output.
Interface for binary input.
virtual ~JEvent()
Virtual destructor.
static void overlap(T p, T q, const double Tmax_s)
Empty overlapping events.
JEvent(const int detid, const int counter, const int id, T __begin, T __end)
Constructor.
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
void copy(const Head &from, JHead &to)
Copy header from from to to.
virtual JReader & read(JReader &in) override
Read from input.
int getID() const
Get emitter identifier.
friend bool operator<(const JEvent &first, const JEvent &second)
Less than operator for acoustics events.
Auxiliary class to determine value of acoustic events.
STD extensions for binary I/O.