BOSS
8.0.0
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
//
21
#include "
EvtAmpIndex.hh
"
22
#include "
EvtPatches.hh
"
23
#include <vector>
24
using
std::vector;
25
26
EvtAmpIndex::EvtAmpIndex
( std::vector<int> ind )
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
}
37
38
void
EvtAmpIndex::reset
() {
39
int
i;
40
for
( i = 0; i < _size; i++ ) { _state[i] = 0; }
41
}
42
43
bool
EvtAmpIndex::next
() {
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
}
53
54
int
EvtAmpIndex::index
() {
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
}
EvtAmpIndex.hh
EvtPatches.hh
EvtAmpIndex::reset
void reset()
Definition
EvtAmpIndex.cc:38
EvtAmpIndex::next
bool next()
Definition
EvtAmpIndex.cc:43
EvtAmpIndex::EvtAmpIndex
EvtAmpIndex(std::vector< int > ind)
Definition
EvtAmpIndex.cc:26
EvtAmpIndex::index
int index()
Definition
EvtAmpIndex.cc:54
8.0.0
BOSS_Gen
BesEvtGen
src
EvtGen
EvtGenBase
EvtAmpIndex.cc
Generated by
1.16.1