BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtAmp Class Reference

#include <EvtAmp.hh>

Public Member Functions

 EvtAmp ()
 
virtual ~EvtAmp ()
 
 EvtAmp (const EvtAmp &amp)
 
void init (EvtId p, int ndaug, EvtId *daug)
 
void setAmp (int *ind, const EvtComplex &amp)
 
const EvtComplexgetAmp (int *ind) const
 
EvtSpinDensity getSpinDensity ()
 
EvtSpinDensity contract (int i, const EvtAmp &a)
 
EvtAmp contract (int i, const EvtSpinDensity &rho)
 
EvtAmp contract (int i, const EvtAmp &a1, const EvtAmp &a2)
 
EvtSpinDensity getForwardSpinDensity (EvtSpinDensity *rho_list, int k)
 
EvtSpinDensity getBackwardSpinDensity (EvtSpinDensity *rho_list)
 
EvtAmpoperator= (const EvtAmp &amp)
 
void vertex (const EvtComplex &amp)
 
void vertex (int i1, const EvtComplex &amp)
 
void vertex (int i1, int i2, const EvtComplex &amp)
 
void vertex (int i1, int i2, int i3, const EvtComplex &amp)
 
void vertex (int *i1, const EvtComplex &amp)
 
void dump ()
 

Friends

class EvtDecayAmp
 
class EvtKstarstargamma
 

Detailed Description

Definition at line 30 of file EvtAmp.hh.

Constructor & Destructor Documentation

◆ EvtAmp() [1/2]

EvtAmp::EvtAmp ( )

Definition at line 36 of file EvtAmp.cc.

36 {
37 _ndaug=0;
38 _pstates=0;
39 _nontrivial=0;
40}

◆ ~EvtAmp()

virtual EvtAmp::~EvtAmp ( )
inlinevirtual

Definition at line 35 of file EvtAmp.hh.

35{}

◆ EvtAmp() [2/2]

EvtAmp::EvtAmp ( const EvtAmp amp)

Definition at line 43 of file EvtAmp.cc.

43 {
44
45 int i;
46
47 _ndaug=amp._ndaug;
48 _pstates=amp._pstates;
49 for(i=0;i<_ndaug;i++){
50 dstates[i]=amp.dstates[i];
51 _dnontrivial[i]=amp._dnontrivial[i];
52 }
53 _nontrivial=amp._nontrivial;
54
55 int namp=_pstates;
56
57 for(i=0;i<_nontrivial;i++){
58 _nstate[i]=amp._nstate[i];
59 namp*=_nstate[i];
60 }
61
62 for(i=0;i<namp;i++){
63 _amp[i]=amp._amp[i];
64 }
65
66}

Member Function Documentation

◆ contract() [1/3]

EvtSpinDensity EvtAmp::contract ( int  i,
const EvtAmp a 
)

Definition at line 349 of file EvtAmp.cc.

349 {
350
351 int i,j,l;
352
353 EvtComplex temp;
354 EvtSpinDensity rho;
355
356 rho.SetDim(_nstate[k]);
357
358 int allloop = 1;
359 int indflag,ii;
360 for (i=0;i<_nontrivial;i++) {
361 allloop *= _nstate[i];
362 }
363
364 int index[10];
365 int index1[10];
366 // int l;
367 for(i=0;i<_nstate[k];i++){
368
369 for(j=0;j<_nstate[k];j++){
370 if (_nontrivial==0) {
371 report(ERROR,"EvtGen")<<"Should not be here1 EvtAmp!"<<endl;
372 rho.Set(0,0,EvtComplex(1.0,0.0));
373 return rho;
374 }
375
376 for (ii=0;ii<10;ii++) {
377 index[ii] = 0;
378 index1[ii] = 0;
379 }
380 index[k] = i;
381 index1[k] = j;
382
383 temp = EvtComplex(0.0);
384
385 for ( l=0;l<int(allloop/_nstate[k]);l++) {
386
387 temp+=getAmp(index)*conj(amp2.getAmp(index1));
388 indflag = 0;
389 for ( ii=0;ii<_nontrivial;ii++) {
390 if ( ii!= k) {
391 if ( indflag == 0 ) {
392 if ( index[ii] == (_nstate[ii]-1) ) {
393 index[ii] = 0;
394 index1[ii] = 0;
395 }
396 else {
397 indflag = 1;
398 index[ii] += 1;
399 index1[ii] += 1;
400 }
401 }
402 }
403 }
404 }
405 rho.Set(i,j,temp);
406
407 }
408 }
409
410 return rho;
411}
Evt3Rank3C conj(const Evt3Rank3C &t2)
Definition: Evt3Rank3C.cc:175
ostream & report(Severity severity, const char *facility)
Definition: EvtReport.cc:36
@ ERROR
Definition: EvtReport.hh:49
const EvtComplex & getAmp(int *ind) const
Definition: EvtAmp.cc:135
void Set(int i, int j, const EvtComplex &rhoij)
void SetDim(int n)

Referenced by getBackwardSpinDensity(), getForwardSpinDensity(), and EvtDecayAmp::makeDecay().

◆ contract() [2/3]

EvtAmp EvtAmp::contract ( int  i,
const EvtAmp a1,
const EvtAmp a2 
)

Definition at line 414 of file EvtAmp.cc.

414 {
415
416 assert(a2._pstates>1&&a2._nontrivial==1);
417
418 EvtAmp tmp;
419 report(DEBUG,"EvtGen") << "EvtAmp::contract not written yet" << endl;
420 return tmp;
421
422}
@ DEBUG
Definition: EvtReport.hh:53
Definition: EvtAmp.hh:30

◆ contract() [3/3]

EvtAmp EvtAmp::contract ( int  i,
const EvtSpinDensity rho 
)

Definition at line 281 of file EvtAmp.cc.

281 {
282
283 EvtAmp temp;
284
285 int i,j;
286 temp._ndaug=_ndaug;
287 temp._pstates=_pstates;
288 temp._nontrivial=_nontrivial;
289
290 for(i=0;i<_ndaug;i++){
291 temp.dstates[i]=dstates[i];
292 temp._dnontrivial[i]=_dnontrivial[i];
293 }
294
295 if (_nontrivial==0) {
296 report(ERROR,"EvtGen")<<"Should not be here EvtAmp!"<<endl;
297 }
298
299
300 for(i=0;i<_nontrivial;i++){
301 temp._nstate[i]=_nstate[i];
302 }
303
304
305 EvtComplex c;
306
307 int index[10];
308 for (i=0;i<10;i++) {
309 index[i] = 0;
310 }
311
312 int allloop = 1;
313 int indflag,ii;
314 for (i=0;i<_nontrivial;i++) {
315 allloop *= _nstate[i];
316 }
317
318 for ( i=0;i<allloop;i++) {
319
320 c = EvtComplex(0.0);
321 int tempint = index[k];
322 for (j=0;j<_nstate[k];j++) {
323 index[k] = j;
324 c+=rho.Get(j,tempint)*getAmp(index);
325 }
326 index[k] = tempint;
327
328 temp.setAmp(index,c);
329
330 indflag = 0;
331 for ( ii=0;ii<_nontrivial;ii++) {
332 if ( indflag == 0 ) {
333 if ( index[ii] == (_nstate[ii]-1) ) {
334 index[ii] = 0;
335 }
336 else {
337 indflag = 1;
338 index[ii] += 1;
339 }
340 }
341 }
342
343 }
344 return temp;
345
346}
void setAmp(int *ind, const EvtComplex &amp)
Definition: EvtAmp.cc:122
const EvtComplex & Get(int i, int j) const

◆ dump()

void EvtAmp::dump ( )

Definition at line 425 of file EvtAmp.cc.

425 {
426
427 int i,list[10];
428
429 report(DEBUG,"EvtGen") << "Number of daugthers:"<<_ndaug<<endl;
430 report(DEBUG,"EvtGen") << "Number of states of the parent:"<<_pstates<<endl;
431 report(DEBUG,"EvtGen") << "Number of states on daughters:";
432 for (i=0;i<_ndaug;i++){
433 report(DEBUG,"EvtGen") <<dstates[i]<<" ";
434 }
435 report(DEBUG,"EvtGen") << endl;
436 report(DEBUG,"EvtGen") << "Nontrivial index of daughters:";
437 for (i=0;i<_ndaug;i++){
438 report(DEBUG,"EvtGen") <<_dnontrivial[i]<<" ";
439 }
440 report(DEBUG,"EvtGen") <<endl;
441 report(DEBUG,"EvtGen") <<"number of nontrivial states:"<<_nontrivial<<endl;
442 report(DEBUG,"EvtGen") << "Nontrivial particles number of states:";
443 for (i=0;i<_nontrivial;i++){
444 report(DEBUG,"EvtGen") <<_nstate[i]<<" ";
445 }
446 report(DEBUG,"EvtGen") <<endl;
447 report(DEBUG,"EvtGen") <<"Amplitudes:"<<endl;
448 if (_nontrivial==0){
449 list[0] = 0;
450 report(DEBUG,"EvtGen") << getAmp(list) << endl;
451 }
452
453 int allloop[10];
454 allloop[0]=1;
455 for (i=0;i<_nontrivial;i++) {
456 if (i==0){
457 allloop[i] *= _nstate[i];
458 }
459 else{
460 allloop[i] = allloop[i-1]*_nstate[i];
461 }
462 }
463 int index = 0;
464 for (i=0;i<allloop[_nontrivial-1];i++) {
465 report(DEBUG,"EvtGen") << getAmp(list) << " ";
466 if ( i==allloop[index]-1 ) {
467 index ++;
468 report(DEBUG,"EvtGen") << endl;
469 }
470 }
471
472 report(DEBUG,"EvtGen") << "-----------------------------------"<<endl;
473
474}

Referenced by EvtDecayAmp::makeDecay().

◆ getAmp()

const EvtComplex & EvtAmp::getAmp ( int *  ind) const

Definition at line 135 of file EvtAmp.cc.

135 {
136
137 int nstatepad = 1;
138 int position = ind[0];
139
140 for ( int i=1; i<_nontrivial; i++ ) {
141 nstatepad *= _nstate[i-1];
142 position += nstatepad*ind[i];
143 }
144
145 return _amp[position];
146}

Referenced by contract(), and dump().

◆ getBackwardSpinDensity()

EvtSpinDensity EvtAmp::getBackwardSpinDensity ( EvtSpinDensity rho_list)

Definition at line 216 of file EvtAmp.cc.

216 {
217
218 EvtSpinDensity rho;
219
220 rho.SetDim(_pstates);
221
222 if (_pstates==1){
223 rho.Set(0,0,EvtComplex(1.0,0.0));
224 return rho;
225 }
226
227 int k;
228
229 EvtAmp ampprime;
230
231 ampprime=(*this);
232
233 for(k=0;k<_ndaug;k++){
234
235 if (dstates[k]!=1){
236 ampprime=ampprime.contract(_dnontrivial[k],rho_list[k+1]);
237 }
238 }
239
240 return ampprime.contract(0,(*this));
241
242}
EvtSpinDensity contract(int i, const EvtAmp &a)
Definition: EvtAmp.cc:349

Referenced by EvtDecayAmp::makeDecay().

◆ getForwardSpinDensity()

EvtSpinDensity EvtAmp::getForwardSpinDensity ( EvtSpinDensity rho_list,
int  k 
)

Definition at line 245 of file EvtAmp.cc.

245 {
246
247 EvtSpinDensity rho;
248
249 rho.SetDim(dstates[i]);
250
251 int k;
252
253 if (dstates[i]==1) {
254
255 rho.Set(0,0,EvtComplex(1.0,0.0));
256
257 return rho;
258
259 }
260
261 EvtAmp ampprime;
262
263 ampprime=(*this);
264
265 if (_pstates!=1){
266 ampprime=ampprime.contract(0,rho_list[0]);
267 }
268
269 for(k=0;k<i;k++){
270
271 if (dstates[k]!=1){
272 ampprime=ampprime.contract(_dnontrivial[k],rho_list[k+1]);
273 }
274
275 }
276
277 return ampprime.contract(_dnontrivial[i],(*this));
278
279}

◆ getSpinDensity()

EvtSpinDensity EvtAmp::getSpinDensity ( )

Definition at line 149 of file EvtAmp.cc.

149 {
150
151 EvtSpinDensity rho;
152 rho.SetDim(_pstates);
153
154 EvtComplex temp;
155
156 int i,j,n;
157
158 if (_pstates==1) {
159
160 if (_nontrivial==0) {
161
162 rho.Set(0,0,_amp[0]*conj(_amp[0]));
163 return rho;
164
165 }
166
167 n=1;
168
169 temp = EvtComplex(0.0);
170
171 for(i=0;i<_nontrivial;i++){
172 n*=_nstate[i];
173 }
174
175 for(i=0;i<n;i++){
176 temp+=_amp[i]*conj(_amp[i]);
177 }
178
179 rho.Set(0,0,temp);;
180
181 return rho;
182
183 }
184
185 else{
186
187 for(i=0;i<_pstates;i++){
188 for(j=0;j<_pstates;j++){
189
190 temp = EvtComplex(0.0);
191
192 int kk;
193
194 int allloop = 1;
195 for (kk=0;kk<(_nontrivial-1); kk++ ) {
196 allloop *= dstates[kk];
197 }
198
199 for (kk=0; kk<allloop; kk++) {
200 temp += _amp[_pstates*kk+i]*conj(_amp[_pstates*kk+j]);}
201
202 // if (_nontrivial>3){
203 //report(ERROR,"EvtGen") << "Can't handle so many states in EvtAmp!"<<endl;
204 //}
205
206 rho.Set(i,j,temp);
207
208 }
209 }
210 return rho;
211 }
212
213}
const Int_t n

Referenced by EvtbTosllAmp::CalcMaxProb(), EvtSemiLeptonicAmp::CalcMaxProb(), and EvtDecayAmp::makeDecay().

◆ init()

void EvtAmp::init ( EvtId  p,
int  ndaug,
EvtId daug 
)

Definition at line 70 of file EvtAmp.cc.

70 {
71 setNDaug(ndaugs);
72 int ichild;
73 int daug_states[100],parstates;
74 for(ichild=0;ichild<ndaugs;ichild++){
75
76 daug_states[ichild]=
78
79 }
80
82
83 setNState(parstates,daug_states);
84
85}
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.hh:61
static int getSpinStates(spintype stype)
Definition: EvtSpinType.hh:64

Referenced by EvtbTosllAmp::CalcMaxProb(), EvtSemiLeptonicAmp::CalcMaxProb(), and EvtDecayAmp::makeDecay().

◆ operator=()

EvtAmp & EvtAmp::operator= ( const EvtAmp amp)

Definition at line 510 of file EvtAmp.cc.

510 {
511
512 int i;
513
514 _ndaug=amp._ndaug;
515 _pstates=amp._pstates;
516 for(i=0;i<_ndaug;i++){
517 dstates[i]=amp.dstates[i];
518 _dnontrivial[i]=amp._dnontrivial[i];
519 }
520 _nontrivial=amp._nontrivial;
521
522 int namp=_pstates;
523
524 for(i=0;i<_nontrivial;i++){
525 _nstate[i]=amp._nstate[i];
526 namp*=_nstate[i];
527 }
528
529 for(i=0;i<namp;i++){
530 _amp[i]=amp._amp[i];
531 }
532
533 return *this;
534}

◆ setAmp()

void EvtAmp::setAmp ( int *  ind,
const EvtComplex amp 
)

Definition at line 122 of file EvtAmp.cc.

122 {
123
124 int nstatepad = 1;
125 int position = ind[0];
126
127 for ( int i=1; i<_nontrivial; i++ ) {
128 nstatepad *= _nstate[i-1];
129 position += nstatepad*ind[i];
130 }
131 _amp[position] = a;
132
133}

Referenced by contract(), and vertex().

◆ vertex() [1/5]

void EvtAmp::vertex ( const EvtComplex amp)

◆ vertex() [2/5]

void EvtAmp::vertex ( int *  i1,
const EvtComplex amp 
)

sets the amplitudes calculated in the decay objects

Definition at line 504 of file EvtAmp.cc.

504 {
505
506 setAmp(i1,c);
507}

◆ vertex() [3/5]

void EvtAmp::vertex ( int  i1,
const EvtComplex amp 
)

sets the amplitudes calculated in the decay objects

Definition at line 483 of file EvtAmp.cc.

483 {
484 int list[1];
485 list[0] = i;
486 setAmp(list,c);
487}

◆ vertex() [4/5]

void EvtAmp::vertex ( int  i1,
int  i2,
const EvtComplex amp 
)

sets the amplitudes calculated in the decay objects

Definition at line 489 of file EvtAmp.cc.

489 {
490 int list[2];
491 list[0] = i;
492 list[1] = j;
493 setAmp(list,c);
494}

◆ vertex() [5/5]

void EvtAmp::vertex ( int  i1,
int  i2,
int  i3,
const EvtComplex amp 
)

sets the amplitudes calculated in the decay objects

Definition at line 496 of file EvtAmp.cc.

496 {
497 int list[3];
498 list[0] = i;
499 list[1] = j;
500 list[2] = k;
501 setAmp(list,c);
502}

Friends And Related Function Documentation

◆ EvtDecayAmp

friend class EvtDecayAmp
friend

Definition at line 90 of file EvtAmp.hh.

◆ EvtKstarstargamma

friend class EvtKstarstargamma
friend

Definition at line 91 of file EvtAmp.hh.


The documentation for this class was generated from the following files: