BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtAmpIndex.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 2002 Caltech
10//
11// Module: EvtAmp.cc
12//
13// Description: Class to manipulate the amplitudes in the decays.
14//
15// Modification history:
16//
17// RYD Nov 22, 2002 Module created
18//
19//------------------------------------------------------------------------
20//
23#include <vector>
24using std::vector;
25
26
27EvtAmpIndex::EvtAmpIndex(std::vector<int> ind):
28 _ind(ind),
29 _size(ind.size()),
30 _state(ind.size()),
31 _nstate(ind.size())
32{
33 int i;
34
35 for(i=0;i<_size;i++) {
36 _state[i]=0;
37 if (i==0){
38 _nstate[i]=1;
39 }
40 else{
41 _nstate[i]=_nstate[i-1]*_ind[i];
42 }
43 }
44}
45
46
48 int i;
49 for(i=0;i<_size;i++) {
50 _state[i]=0;
51 }
52}
53
55 int i;
56 for(i=0;i<_size;i++) {
57 _state[i]++;
58 if (_state[i]<_ind[i]){
59 return true;
60 }
61 else{
62 _state[i]=0;
63 }
64 }
65 return false;
66}
67
69
70 int i;
71 int ind=0;
72
73 for(i=0;i<_size;i++) {
74 ind+=_state[i]*_nstate[i];
75 }
76
77 return ind;
78
79}
80
81
82
83
84
85
86
87
88
89
90
void reset()
Definition: EvtAmpIndex.cc:47
bool next()
Definition: EvtAmpIndex.cc:54
EvtAmpIndex(std::vector< int > ind)
Definition: EvtAmpIndex.cc:27