ATLAS Offline Software
Loading...
Searching...
No Matches
event_selector.h
Go to the documentation of this file.
1/* emacs: this is -*- c++ -*- */
10
11
12#ifndef ANALYSIS_EVENT_SELECTOR_H
13#define ANALYSIS_EVENT_SELECTOR_H
14
15#include <iostream>
16#include <set>
17
18
19
20class event_selector : public std::set<int> {
21
22public:
23
24 template<class T>
25 event_selector(const std::vector<T>& e) {
26 for (unsigned int i=0 ; i<e.size() ; i++ ) insert(int(e[i]));
27 }
28
29 // event_selector(std::vector<double> e) {
30 // for (unsigned int i=0 ; i<e.size() ; i++ ) insert(int(e[i]));
31 // }
32
34
35 bool in(int event) {
36 if ( find(event)==end() ) return false;
37 std::cout << "event_selector::in() found " << event << std::endl;
38 return true;
39 }
40
41};
42
43
44inline std::ostream& operator<<( std::ostream& s, const event_selector& es ) {
45 return s << es.size();
46}
47
48
49#endif // ANALYSIS_EVENT_SELECTOR_H
50
51
52
53
54
55
56
57
58
59
event_selector(const std::vector< T > &e)
bool in(int event)
std::ostream & operator<<(std::ostream &s, const event_selector &es)
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138