BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtAmpIndex Class Reference

#include <EvtAmpIndex.hh>

Public Member Functions

 EvtAmpIndex (std::vector< int > ind)
 
virtual ~EvtAmpIndex ()
 
void reset ()
 
bool next ()
 
int index ()
 

Friends

class EvtAmpSubIndex
 

Detailed Description

Definition at line 26 of file EvtAmpIndex.hh.

Constructor & Destructor Documentation

◆ EvtAmpIndex()

EvtAmpIndex::EvtAmpIndex ( std::vector< int >  ind)

Definition at line 27 of file EvtAmpIndex.cc.

27 :
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}

◆ ~EvtAmpIndex()

virtual EvtAmpIndex::~EvtAmpIndex ( )
inlinevirtual

Definition at line 33 of file EvtAmpIndex.hh.

33{}

Member Function Documentation

◆ index()

int EvtAmpIndex::index ( )

Definition at line 68 of file EvtAmpIndex.cc.

68 {
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}

◆ next()

bool EvtAmpIndex::next ( )

Definition at line 54 of file EvtAmpIndex.cc.

54 {
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}

◆ reset()

void EvtAmpIndex::reset ( )

Definition at line 47 of file EvtAmpIndex.cc.

47 {
48 int i;
49 for(i=0;i<_size;i++) {
50 _state[i]=0;
51 }
52}

Friends And Related Function Documentation

◆ EvtAmpSubIndex

friend class EvtAmpSubIndex
friend

Definition at line 28 of file EvtAmpIndex.hh.


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