1 /*******************************************************************************
2 * Project: BaBar detector at the SLAC PEP-II B-factory
4 * File: $Id: EvtCyclic3.hh,v 1.12 2009/02/15 18:09:01 ryd Exp $
5 * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
7 * Copyright (C) 2002 Caltech
8 *******************************************************************************/
10 // Cyclic permutations of three indices A,B,C and their parings
12 #ifndef EVT_CYCLIC3_HH
13 #define EVT_CYCLIC3_HH
17 namespace EvtCyclic3 {
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};
24 // Permutations (multiplication is not transitive)
26 Index permute(Index i, Perm p);
27 Perm permutation(Index i1,Index i2,Index i3);
28 Perm permute(Perm i, Perm p);
29 Pair permute(Pair i, Perm p);
37 Index other(Index i, Index j);
42 Pair combine(Index i, Index j);
45 // Pair-to-pair conversions
49 Pair other(Pair i, Pair j);
51 // Pair-to-index conversions
57 Index common(Pair i, Pair j);
59 // String to Index, Pair
61 Index strToIndex(const char* str);
62 Pair strToPair(const char* str);
64 // To string conversions
66 const char* c_str(Index i);
67 const char* c_str(Pair i);
68 const char* c_str(Perm i);
70 // Useful name strings
72 char* append(const char* str, EvtCyclic3::Index i);
73 char* append(const char* str, EvtCyclic3::Pair i);
77 //where should these go?
78 //ostream& operator<<(ostream&, EvtCyclic3::Index);
79 //ostream& operator<<(ostream&, EvtCyclic3::Pair);