Key.h
Go to the documentation of this file.
1 #ifndef _EVTLIB_KEY_H_
2 #define _EVTLIB_KEY_H_
3 
4 #include <ostream>
5 
6 namespace genie{
7 namespace evtlib{
8 
9 struct Key
10 {
11  Key(int _nucl_pdg, int _nu_pdg, bool _iscc)
12  : nucl_pdg(_nucl_pdg), nu_pdg(_nu_pdg), iscc(_iscc) {}
13 
14  bool operator<(const Key& k) const
15  {
16  return (std::make_tuple( nucl_pdg, nu_pdg, iscc) <
17  std::make_tuple(k.nucl_pdg, k.nu_pdg, k.iscc));
18  }
19 
20  friend std::ostream& operator<<(std::ostream& os, const Key& k)
21  {
22  os << k.nu_pdg << " on " << k.nucl_pdg << " " << " via " << (k.iscc ? "CC" : "NC");
23  return os;
24  }
25 
26  int nucl_pdg;
27  int nu_pdg;
28  bool iscc;
29 };
30 
31 }} // namespaces
32 
33 #endif
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
Key(int _nucl_pdg, int _nu_pdg, bool _iscc)
Definition: Key.h:11
bool operator<(const Key &k) const
Definition: Key.h:14
friend std::ostream & operator<<(std::ostream &os, const Key &k)
Definition: Key.h:20
int nucl_pdg
Definition: Key.h:26