Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JTrigger/JTriggerOutput.hh
Go to the documentation of this file.
1#ifndef __JTRIGGEROUTPUT__
2#define __JTRIGGEROUTPUT__
3
4#include <vector>
5#include <algorithm>
6
7#include "JTrigger/JEvent.hh"
8
9
10/**
11 * \author mdejong
12 */
13
14namespace JTRIGGER {}
15namespace JPP { using namespace JTRIGGER; }
16
17namespace JTRIGGER {
18
19
20 /**
21 * Set of triggered events.
22 */
24 public std::vector<JEvent>
25 {
26 public:
27 /**
28 * Default constructor.
29 */
31 std::vector<JEvent>()
32 {}
33
34
35 /**
36 * Merge events.
37 *
38 * \param match match criterion
39 */
40 template<class JMatch_t>
41 inline void merge(const JMatch_t& match)
42 {
43 std::sort(this->begin(), this->end());
44
45 iterator out = this->begin();
46
47 for (iterator i = this->begin(); i != this->end(); ++out) {
48
49 if (out != i) {
50 *out = *i; // copy event
51 }
52
53 while (++i != this->end() && match(*out,*i)) {
54 out->merge(*i); // merge event
55 }
56 }
57
58 this->erase(out, this->end());
59 }
60 };
61}
62
63#endif
Triggered event.
JTriggerOutput()
Default constructor.
void merge(const JMatch_t &match)
Merge events.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.