BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtCyclic3 Namespace Reference

Enumerations

enum  Index { A = 0 , B = 1 , C = 2 }
enum  Pair {
  BC = 0 , CB = BC , CA = 1 , AC = CA ,
  AB = 2 , BA = AB
}
enum  Perm {
  ABC = 0 , BCA = 1 , CAB = 2 , CBA = 3 ,
  BAC = 4 , ACB = 5
}

Functions

Index permute (Index i, Perm p)
Perm permutation (Index i1, Index i2, Index i3)
Perm permute (Perm i, Perm p)
Pair permute (Pair i, Perm p)
Pair i2pair (int i)
Index prev (Index i)
Index next (Index i)
Index other (Index i, Index j)
Pair other (Index i)
Pair combine (Index i, Index j)
Pair prev (Pair i)
Pair next (Pair i)
Pair other (Pair i, Pair j)
Index first (Pair i)
Index second (Pair i)
Index other (Pair i)
Index common (Pair i, Pair j)
Index strToIndex (const char *str)
Pair strToPair (const char *str)
char * c_str (Index i)
char * c_str (Pair i)
char * c_str (Perm i)
char * append (const char *str, EvtCyclic3::Index i)
char * append (const char *str, EvtCyclic3::Pair i)

Enumeration Type Documentation

◆ Index

Enumerator

Definition at line 19 of file EvtCyclic3.hh.

19{ A = 0, B = 1, C = 2 };

◆ Pair

Enumerator
BC 
CB 
CA 
AC 
AB 
BA 

Definition at line 20 of file EvtCyclic3.hh.

20{ BC = 0, CB = BC, CA = 1, AC = CA, AB = 2, BA = AB };

◆ Perm

Enumerator
ABC 
BCA 
CAB 
CBA 
BAC 
ACB 

Definition at line 21 of file EvtCyclic3.hh.

21{ ABC = 0, BCA = 1, CAB = 2, CBA = 3, BAC = 4, ACB = 5 };

Function Documentation

◆ append() [1/2]

char * EvtCyclic3::append ( const char * str,
EvtCyclic3::Index i )

Definition at line 272 of file EvtCyclic3.cc.

272 {
273 // str + null + 1 character
274 char* s = new char[strlen( str ) + 2];
275 strcpy( s, str );
276 strcat( s, c_str( i ) );
277
278 return s;
279}
XmlRpcServer s
char * c_str(Index i)

◆ append() [2/2]

char * EvtCyclic3::append ( const char * str,
EvtCyclic3::Pair i )

Definition at line 281 of file EvtCyclic3.cc.

281 {
282 // str + null + 2 characters
283 char* s = new char[strlen( str ) + 3];
284 strcpy( s, str );
285 strcat( s, c_str( i ) );
286
287 return s;
288}

◆ c_str() [1/3]

char * EvtCyclic3::c_str ( Index i)

Definition at line 240 of file EvtCyclic3.cc.

240 {
241 switch ( i )
242 {
243 case A: return "A";
244 case B: return "B";
245 case C: return "C";
246 }
247 assert( 0 );
248 return 0; // sngh
249}

Referenced by append(), append(), and EvtPto3PAmpFactory::processAmp().

◆ c_str() [2/3]

char * EvtCyclic3::c_str ( Pair i)

Definition at line 251 of file EvtCyclic3.cc.

251 {
252 switch ( i )
253 {
254 case BC: return "BC";
255 case CA: return "CA";
256 case AB: return "AB";
257 }
258 assert( 0 );
259 return 0; // sngh
260}

◆ c_str() [3/3]

char * EvtCyclic3::c_str ( Perm i)

Definition at line 262 of file EvtCyclic3.cc.

262 {
263 if ( p == ABC ) return "ABC";
264 if ( p == BCA ) return "BCA";
265 if ( p == CAB ) return "CAB";
266 if ( p == CBA ) return "CBA";
267 if ( p == BAC ) return "BAC";
268 if ( p == ACB ) return "ACB";
269 return "???";
270}

◆ combine()

Pair EvtCyclic3::combine ( Index i,
Index j )

Definition at line 159 of file EvtCyclic3.cc.

159{ return other( other( i, j ) ); }
Index other(Index i, Index j)

Referenced by other(), permute(), and EvtDalitzPoint::pp().

◆ common()

Index EvtCyclic3::common ( Pair i,
Pair j )

Definition at line 216 of file EvtCyclic3.cc.

216{ return other( other( i, j ) ); }

Referenced by EvtDalitzPlot::qMax(), and EvtDalitzPlot::qMin().

◆ first()

Index EvtCyclic3::first ( Pair i)

Definition at line 183 of file EvtCyclic3.cc.

183 {
184 switch ( i )
185 {
186 case BC: return B;
187 case CA: return C;
188 case AB: return A;
189 }
190 assert( 0 );
191 return A; // should never get here
192}

Referenced by EvtPto3PAmp::amplitude(), EvtPto3PAmp::numerator(), and permute().

◆ i2pair()

Pair EvtCyclic3::i2pair ( int i)

Definition at line 82 of file EvtCyclic3.cc.

82 {
83 assert( 0 <= i && i <= 2 );
84 switch ( i )
85 {
86 case 0: return BC;
87 case 1: return CA;
88 case 2: return AB;
89 }
90 assert( 0 );
91 return AB; // should never get here
92}

◆ next() [1/2]

Index EvtCyclic3::next ( Index i)

Definition at line 105 of file EvtCyclic3.cc.

105 {
106 switch ( i )
107 {
108 case A: return B;
109 case B: return C;
110 case C: return A;
111 }
112 assert( 0 );
113 return A; // should never get here
114}

Referenced by EvtDalitzResPdf::compute_integral(), EvtDalitzPoint::qres(), and EvtDalitzResPdf::randomPoint().

◆ next() [2/2]

Pair EvtCyclic3::next ( Pair i)

Definition at line 171 of file EvtCyclic3.cc.

171 {
172 Pair ret = BC;
173 if ( i == BC ) ret = CA;
174 else if ( i == CA ) ret = AB;
175
176 return ret;
177}

◆ other() [1/4]

Pair EvtCyclic3::other ( Index i)

Definition at line 148 of file EvtCyclic3.cc.

148 {
149 switch ( i )
150 {
151 case A: return BC;
152 case B: return CA;
153 case C: return AB;
154 }
155 assert( 0 );
156 return AB; // should never get here
157}

◆ other() [2/4]

Index EvtCyclic3::other ( Index i,
Index j )

Definition at line 116 of file EvtCyclic3.cc.

116 {
117 assert( i != j );
118 switch ( i )
119 {
120 case A:
121 switch ( j )
122 {
123 case B: return C;
124 case C: return B;
125 default: assert( 0 );
126 }
127 case B:
128 switch ( j )
129 {
130 case C: return A;
131 case A: return C;
132 default: assert( 0 );
133 }
134 case C:
135 switch ( j )
136 {
137 case A: return B;
138 case B: return A;
139 default: assert( 0 );
140 }
141 }
142 assert( 0 );
143 return A; // should never get here
144}

Referenced by EvtPto3PAmp::amplitude(), combine(), common(), EvtDalitzPlot::e(), EvtDalitzReso::evaluate(), EvtDalitzPlot::EvtDalitzPlot(), EvtDalitzPoint::EvtDalitzPoint(), EvtDalitzReso::EvtDalitzReso(), EvtDalitzReso::EvtDalitzReso(), EvtDalitzReso::EvtDalitzReso(), EvtDalitzResPdf::EvtDalitzResPdf(), EvtDalitzPlot::jacobian(), EvtPto3PAmp::numerator(), EvtDalitzPlot::operator==(), other(), EvtDalitzPlot::qAbsMax(), EvtDalitzPlot::qMax(), EvtDalitzPlot::qMin(), and EvtDalitzPlot::vB().

◆ other() [3/4]

Index EvtCyclic3::other ( Pair i)

Definition at line 205 of file EvtCyclic3.cc.

205 {
206 switch ( i )
207 {
208 case BC: return A;
209 case CA: return B;
210 case AB: return C;
211 }
212 assert( 0 );
213 return A; // should never get here
214}

◆ other() [4/4]

Pair EvtCyclic3::other ( Pair i,
Pair j )

Definition at line 179 of file EvtCyclic3.cc.

179{ return combine( other( i ), other( j ) ); }
Pair combine(Index i, Index j)

◆ permutation()

Perm EvtCyclic3::permutation ( Index i1,
Index i2,
Index i3 )

Definition at line 60 of file EvtCyclic3.cc.

60 {
61 assert( i1 != i2 && i2 != i3 && i3 != i1 );
62 if ( i1 == A ) return ( i2 == B ) ? ABC : ACB;
63 if ( i1 == B ) return ( i2 == C ) ? BCA : BAC;
64 if ( i1 == C ) return ( i2 == A ) ? CAB : CBA;
65 return ABC;
66}

Referenced by permute().

◆ permute() [1/3]

Index EvtCyclic3::permute ( Index i,
Perm p )

Definition at line 19 of file EvtCyclic3.cc.

19 {
20 if ( p == ABC ) return i;
21 else if ( p == BCA )
22 {
23 if ( i == A ) return C;
24 else if ( i == B ) return A;
25 else if ( i == C ) return B;
26 }
27 else if ( p == BCA )
28 {
29 if ( i == A ) return C;
30 else if ( i == B ) return A;
31 else if ( i == C ) return B;
32 }
33 else if ( p == CAB )
34 {
35 if ( i == A ) return B;
36 else if ( i == B ) return C;
37 else if ( i == C ) return A;
38 }
39 else if ( p == CBA )
40 {
41 if ( i == A ) return C;
42 else if ( i == B ) return B;
43 else if ( i == C ) return A;
44 }
45 else if ( p == BAC )
46 {
47 if ( i == A ) return B;
48 else if ( i == B ) return A;
49 else if ( i == C ) return C;
50 }
51 else if ( p == ACB )
52 {
53 if ( i == A ) return A;
54 else if ( i == B ) return C;
55 else if ( i == C ) return B;
56 }
57 return A;
58}

Referenced by permute(), and permute().

◆ permute() [2/3]

Pair EvtCyclic3::permute ( Pair i,
Perm p )

Definition at line 76 of file EvtCyclic3.cc.

76 {
77 Index i1 = permute( first( i ), p );
78 Index i2 = permute( second( i ), p );
79 return combine( i1, i2 );
80}
Index permute(Index i, Perm p)
Definition EvtCyclic3.cc:19
Index second(Pair i)
Index first(Pair i)

◆ permute() [3/3]

Perm EvtCyclic3::permute ( Perm i,
Perm p )

Definition at line 68 of file EvtCyclic3.cc.

68 {
69 Index i1 = permute( permute( A, i ), p );
70 Index i2 = permute( permute( B, i ), p );
71 Index i3 = permute( permute( C, i ), p );
72
73 return permutation( i1, i2, i3 );
74}
Perm permutation(Index i1, Index i2, Index i3)
Definition EvtCyclic3.cc:60

◆ prev() [1/2]

Index EvtCyclic3::prev ( Index i)

Definition at line 94 of file EvtCyclic3.cc.

94 {
95 switch ( i )
96 {
97 case A: return C;
98 case B: return A;
99 case C: return B;
100 }
101 assert( 0 );
102 return A; // should never get here
103}

Referenced by EvtDalitzPoint::qhel(), EvtDalitzPlot::qHelAbsMax(), EvtDalitzPlot::qHelAbsMin(), and EvtDalitzPoint::qres().

◆ prev() [2/2]

Pair EvtCyclic3::prev ( Pair i)

Definition at line 163 of file EvtCyclic3.cc.

163 {
164 Pair ret = CA;
165 if ( i == BC ) ret = AB;
166 else if ( i == CA ) ret = BC;
167
168 return ret;
169}

◆ second()

Index EvtCyclic3::second ( Pair i)

Definition at line 194 of file EvtCyclic3.cc.

194 {
195 switch ( i )
196 {
197 case BC: return C;
198 case CA: return A;
199 case AB: return B;
200 }
201 assert( 0 );
202 return A; // should never get here
203}

Referenced by EvtPto3PAmp::amplitude(), EvtDalitzPlot::e(), EvtPto3PAmp::numerator(), permute(), EvtDalitzPlot::q(), EvtDalitzPlot::qAbsMin(), and EvtDalitzPlot::vD().

◆ strToIndex()

Index EvtCyclic3::strToIndex ( const char * str)

Definition at line 218 of file EvtCyclic3.cc.

218 {
219 if ( strcmp( str, "A" ) ) return A;
220 else if ( strcmp( str, "B" ) ) return B;
221 else if ( strcmp( str, "C" ) ) return C;
222 else
223 {
224 std::cerr << __FILE__ << ":" << __LINE__ << "Should not reach here!" << std::endl;
225 abort();
226 }
227}

◆ strToPair()

Pair EvtCyclic3::strToPair ( const char * str)

Definition at line 229 of file EvtCyclic3.cc.

229 {
230 if ( !strcmp( str, "AB" ) || !strcmp( str, "BA" ) ) return AB;
231 else if ( !strcmp( str, "BC" ) || !strcmp( str, "CB" ) ) return BC;
232 else if ( !strcmp( str, "CA" ) || !strcmp( str, "AC" ) ) return CA;
233 else
234 {
235 std::cerr << __FILE__ << ":" << __LINE__ << "Should not reach here!" << std::endl;
236 abort();
237 }
238}

Referenced by EvtPto3PAmpFactory::processAmp().