MINT2
QuarkContent.h
Go to the documentation of this file.
1 #ifndef DALITZ_MINT_QUARK_CONTENT_HH
2 #define DALITZ_MINT_QUARK_CONTENT_HH
3 
4 //#include <vector>
5 #include <iostream>
6 #include <map>
7 #include "Mint/PolymorphVector.h"
8 
9 class QuarkContent : public MINT::PolymorphVector<int>{
10  static char _names[6];
11  static char _NAMES[6];
12  static std::map<char, int> _positions;
13  static bool initPositions();
14  public:
15  QuarkContent();
16  QuarkContent(const QuarkContent& other);
17  void antiThis();
18  bool initFromString(const std::string& str);
19 
20 
21  int content(int quarkNumber) const;
22  int content(long int quarkNumber) const;
23  int content(unsigned int quarkNumber) const;
24  // all this because otherwise C doesn't know
25  // wether to convert to int or char
26  //
27  int content(char quarkName) const;
28  int content(const std::string& quarkName) const;
29 
30  char nameFromPosition(int i) const;
31  int positionFromName(char c) const;
32 
33  void print(std::ostream& os = std::cout) const;
34 
37 
38  QuarkContent operator+(const QuarkContent& rhs) const;
39  QuarkContent operator-(const QuarkContent& rhs) const;
40 
41 };
42 
43 std::ostream& operator<<(std::ostream& st, const QuarkContent& qc);
44 #endif
45 //
QuarkContent & operator+=(const QuarkContent &rhs)
QuarkContent operator-(const QuarkContent &rhs) const
static char _NAMES[6]
Definition: QuarkContent.h:11
char nameFromPosition(int i) const
static char _names[6]
Definition: QuarkContent.h:10
static bool initPositions()
static std::map< char, int > _positions
Definition: QuarkContent.h:12
std::ostream & operator<<(std::ostream &st, const QuarkContent &qc)
QuarkContent & operator-=(const QuarkContent &rhs)
int content(int quarkNumber) const
QuarkContent operator+(const QuarkContent &rhs) const
bool initFromString(const std::string &str)
void print(std::ostream &os=std::cout) const
int positionFromName(char c) const