evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtCyclic3.hh
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
21 #ifndef EVT_CYCLIC3_HH
22 #define EVT_CYCLIC3_HH
23 
24 #include <iosfwd>
25 
26 // Cyclic permutations of three indices A,B,C and their parings
27 
28 namespace EvtCyclic3 {
29 
30  enum Index
31  {
32  A = 0,
33  B = 1,
34  C = 2
35  };
36  enum Pair
37  {
38  BC = 0,
39  CB = BC,
40  CA = 1,
41  AC = CA,
42  AB = 2,
43  BA = AB
44  };
45  enum Perm
46  {
47  ABC = 0,
48  BCA = 1,
49  CAB = 2,
50  CBA = 3,
51  BAC = 4,
52  ACB = 5
53  };
54 
55  // Permutations (multiplication is not transitive)
56 
57  Index permute( Index i, Perm p );
58  Perm permutation( Index i1, Index i2, Index i3 );
59  Perm permute( Perm i, Perm p );
60  Pair permute( Pair i, Perm p );
61 
62  Pair i2pair( int i );
63 
64  // Index-to-index
65 
66  Index prev( Index i );
67  Index next( Index i );
68  Index other( Index i, Index j );
69 
70  // Index-to-pair
71 
72  Pair other( Index i );
73  Pair combine( Index i, Index j );
74 
75  // Pair-to-pair conversions
76 
77  Pair prev( Pair i );
78  Pair next( Pair i );
79  Pair other( Pair i, Pair j );
80 
81  // Pair-to-index conversions
82 
83  Index first( Pair i );
84  Index second( Pair i );
85  Index other( Pair i );
86  Index common( Pair i, Pair j );
87 
88  // String to Index, Pair
89 
90  Index strToIndex( const char* str );
91  Pair strToPair( const char* str );
92 
93  // To string conversions
94 
95  const char* c_str( Index i );
96  const char* c_str( Pair i );
97  const char* c_str( Perm i );
98 
99  // Useful name strings
100 
101  char* append( const char* str, EvtCyclic3::Index i );
102  char* append( const char* str, EvtCyclic3::Pair i );
103 
104 } // namespace EvtCyclic3
105 
106 //where should these go?
107 //ostream& operator<<(ostream&, EvtCyclic3::Index);
108 //ostream& operator<<(ostream&, EvtCyclic3::Pair);
109 
110 #endif
Index prev(Index i)
Definition: EvtCyclic3.cpp:128
const char * c_str(Index i)
Definition: EvtCyclic3.cpp:323
Perm permutation(Index i1, Index i2, Index i3)
Definition: EvtCyclic3.cpp:83
Index permute(Index i, Perm p)
Definition: EvtCyclic3.cpp:32
Pair combine(Index i, Index j)
Definition: EvtCyclic3.cpp:208
Index strToIndex(const char *str)
Definition: EvtCyclic3.cpp:297
Index common(Pair i, Pair j)
Definition: EvtCyclic3.cpp:292
Index next(Index i)
Definition: EvtCyclic3.cpp:142
Index second(Pair i)
Definition: EvtCyclic3.cpp:264
Index first(Pair i)
Definition: EvtCyclic3.cpp:250
Pair strToPair(const char *str)
Definition: EvtCyclic3.cpp:310
char * append(const char *str, EvtCyclic3::Index i)
Definition: EvtCyclic3.cpp:369
Pair i2pair(int i)
Definition: EvtCyclic3.cpp:113
Index other(Index i, Index j)
Definition: EvtCyclic3.cpp:156