]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/EvtGenBase/EvtAmpSubIndex.cxx
New plots for trending injector efficiencies (Melinda)
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtAmpSubIndex.cxx
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: EvtAmpSubIndex.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 "EvtGenBase/EvtPatches.hh"
22 #include "EvtGenBase/EvtAmpIndex.hh"
23 #include "EvtGenBase/EvtAmpSubIndex.hh"
24 #include <vector>
25 using std::vector;
26
27
28 EvtAmpSubIndex::EvtAmpSubIndex(EvtAmpIndex* ind,std::vector<int> sub):
29   _ind(ind),
30   _sub(sub),
31   _size(sub.size()),
32   _nstate(sub.size())
33 {
34   int i;
35   
36   for(i=0;i<_size;i++) {
37     if (i==0){
38       _nstate[i]=1;
39     }
40     else{
41       _nstate[i]=_nstate[i-1]*_ind->_ind[sub[i-1]];
42     }
43   }
44 }
45
46
47 int EvtAmpSubIndex::index(){
48
49   int i;
50   int ind=0;
51
52   for(i=0;i<_size;i++) {
53     ind+=_ind->_state[_ind->_ind[i]]*_nstate[i];
54   }
55
56   return ind;
57
58 }
59
60
61
62
63
64
65
66
67
68
69