BOSS 8.0.0
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 26 of file EvtAmpIndex.cc.

27 : _ind( ind ), _size( ind.size() ), _state( ind.size() ), _nstate( ind.size() ) {
28 int i;
29
30 for ( i = 0; i < _size; i++ )
31 {
32 _state[i] = 0;
33 if ( i == 0 ) { _nstate[i] = 1; }
34 else { _nstate[i] = _nstate[i - 1] * _ind[i]; }
35 }
36}

◆ ~EvtAmpIndex()

virtual EvtAmpIndex::~EvtAmpIndex ( )
inlinevirtual

Definition at line 32 of file EvtAmpIndex.hh.

32{}

Member Function Documentation

◆ index()

int EvtAmpIndex::index ( )

Definition at line 54 of file EvtAmpIndex.cc.

54 {
55
56 int i;
57 int ind = 0;
58
59 for ( i = 0; i < _size; i++ ) { ind += _state[i] * _nstate[i]; }
60
61 return ind;
62}

◆ next()

bool EvtAmpIndex::next ( )

Definition at line 43 of file EvtAmpIndex.cc.

43 {
44 int i;
45 for ( i = 0; i < _size; i++ )
46 {
47 _state[i]++;
48 if ( _state[i] < _ind[i] ) { return true; }
49 else { _state[i] = 0; }
50 }
51 return false;
52}

◆ reset()

void EvtAmpIndex::reset ( )

Definition at line 38 of file EvtAmpIndex.cc.

38 {
39 int i;
40 for ( i = 0; i < _size; i++ ) { _state[i] = 0; }
41}

◆ EvtAmpSubIndex

friend class EvtAmpSubIndex
friend

Definition at line 28 of file EvtAmpIndex.hh.

Referenced by EvtAmpSubIndex.


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