BOSS 8.0.0
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, dvoretsk@slac.stanford.edu, 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 enum Index { A = 0, B = 1, C = 2 };
20 enum Pair { BC = 0, CB = BC, CA = 1, AC = CA, AB = 2, BA = AB };
21 enum Perm { ABC = 0, BCA = 1, CAB = 2, CBA = 3, BAC = 4, ACB = 5 };
22
23 // Permutations (multiplication is not transitive)
24
25 Index permute( Index i, Perm p );
26 Perm permutation( Index i1, Index i2, Index i3 );
27 Perm permute( Perm i, Perm p );
28 Pair permute( Pair i, Perm p );
29
30 Pair i2pair( int i );
31
32 // Index-to-index
33
34 Index prev( Index i );
35 Index next( Index i );
36 Index other( Index i, Index j );
37
38 // Index-to-pair
39
40 Pair other( Index i );
41 Pair combine( Index i, Index j );
42
43 // Pair-to-pair conversions
44
45 Pair prev( Pair i );
46 Pair next( Pair i );
47 Pair other( Pair i, Pair j );
48
49 // Pair-to-index conversions
50
51 Index first( Pair i );
52 Index second( Pair i );
53 Index other( Pair i );
54 Index common( Pair i, Pair j );
55
56 // String to Index, Pair
57
58 Index strToIndex( const char* str );
59 Pair strToPair( const char* str );
60
61 // To string conversions
62
63 char* c_str( Index i );
64 char* c_str( Pair i );
65 char* c_str( Perm i );
66
67 // Useful name strings
68
69 char* append( const char* str, EvtCyclic3::Index i );
70 char* append( const char* str, EvtCyclic3::Pair i );
71
72} // namespace EvtCyclic3
73
74// where should these go?
75// ostream& operator<<(ostream&, EvtCyclic3::Index);
76// ostream& operator<<(ostream&, EvtCyclic3::Pair);
77
78#endif
Pair
Definition EvtCyclic3.hh:20
Index
Definition EvtCyclic3.hh:19
Index permute(Index i, Perm p)
Definition EvtCyclic3.cc:19
Index next(Index i)
Index strToIndex(const char *str)
Perm permutation(Index i1, Index i2, Index i3)
Definition EvtCyclic3.cc:60
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:82
Index prev(Index i)
Definition EvtCyclic3.cc:94
char * c_str(Index i)
Index other(Index i, Index j)
Index first(Pair i)