CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtCyclic3.hh
Go to the documentation of this file.
1/*******************************************************************************
2 * Project: BaBar detector at the SLAC PEP-II B-factory
3 * Package: EvtGenBase
4 * File: $Id: EvtCyclic3.hh,v 1.2 2007/11/20 08:36:27 pingrg Exp $
5 * Author: Alexei Dvoretskii, [email protected], 2001-2002
6 *
7 * Copyright (C) 2002 Caltech
8 *******************************************************************************/
9
10// Cyclic permutations of three indices A,B,C and their parings
11
12#ifndef EVT_CYCLIC3_HH
13#define EVT_CYCLIC3_HH
14
15#include <iosfwd>
16
17namespace EvtCyclic3 {
18
19
20 enum Index {A=0,B=1,C=2};
21 enum Pair {BC=0,CB=BC,CA=1,AC=CA,AB=2,BA=AB};
22 enum Perm {ABC=0,BCA=1,CAB=2,CBA=3,BAC=4,ACB=5};
23
24 // Permutations (multiplication is not transitive)
25
26 Index permute(Index i, Perm p);
28 Perm permute(Perm i, Perm p);
29 Pair permute(Pair i, Perm p);
30
31 Pair i2pair(int i);
32
33 // Index-to-index
34
35 Index prev(Index i);
36 Index next(Index i) ;
37 Index other(Index i, Index j);
38
39 // Index-to-pair
40
41 Pair other(Index i);
42 Pair combine(Index i, Index j);
43
44
45 // Pair-to-pair conversions
46
47 Pair prev(Pair i);
48 Pair next(Pair i);
49 Pair other(Pair i, Pair j);
50
51 // Pair-to-index conversions
52
53
54 Index first(Pair i);
55 Index second(Pair i);
56 Index other(Pair i) ;
57 Index common(Pair i, Pair j);
58
59 // String to Index, Pair
60
61 Index strToIndex(const char* str);
62 Pair strToPair(const char* str);
63
64 // To string conversions
65
66 char* c_str(Index i);
67 char* c_str(Pair i);
68 char* c_str(Perm i);
69
70 // Useful name strings
71
72 char* append(const char* str, EvtCyclic3::Index i);
73 char* append(const char* str, EvtCyclic3::Pair i);
74
75}
76
77//where should these go?
78//ostream& operator<<(ostream&, EvtCyclic3::Index);
79//ostream& operator<<(ostream&, EvtCyclic3::Pair);
80
81#endif
Index permute(Index i, Perm p)
Definition EvtCyclic3.cc:20
Index strToIndex(const char *str)
Perm permutation(Index i1, Index i2, Index i3)
Definition EvtCyclic3.cc:56
char * append(const char *str, EvtCyclic3::Index i)
Index common(Pair i, Pair j)
Pair strToPair(const char *str)
Pair combine(Index i, Index j)
Index second(Pair i)
Pair i2pair(int i)
Definition EvtCyclic3.cc:83
Index prev(Index i)
Definition EvtCyclic3.cc:96
char * c_str(Index i)
Index other(Index i, Index j)