00001 //-------------------------------------------------------------------------- 00002 // 00003 // Environment: 00004 // This software is part of the EvtGen package developed jointly 00005 // for the BaBar and CLEO collaborations. If you use all or part 00006 // of it, please give an appropriate acknowledgement. 00007 // 00008 // Copyright Information: See EvtGen/COPYRIGHT 00009 // Copyright (C) 2002 Caltech 00010 // 00011 // Module: EvtAmpSubIndex.cc 00012 // 00013 // Description: Class to manipulate the amplitudes in the decays. 00014 // 00015 // Modification history: 00016 // 00017 // RYD Nov 22, 2002 Module created 00018 // 00019 //------------------------------------------------------------------------ 00020 // 00021 #include "EvtGenBase/EvtPatches.hh" 00022 #include "EvtGenBase/EvtAmpIndex.hh" 00023 #include "EvtGenBase/EvtAmpSubIndex.hh" 00024 #include <vector> 00025 using std::vector; 00026 00027 00028 EvtAmpSubIndex::EvtAmpSubIndex(EvtAmpIndex* ind,std::vector<int> sub): 00029 _ind(ind), 00030 _sub(sub), 00031 _size(sub.size()), 00032 _nstate(sub.size()) 00033 { 00034 int i; 00035 00036 for(i=0;i<_size;i++) { 00037 if (i==0){ 00038 _nstate[i]=1; 00039 } 00040 else{ 00041 _nstate[i]=_nstate[i-1]*_ind->_ind[sub[i-1]]; 00042 } 00043 } 00044 } 00045 00046 00047 int EvtAmpSubIndex::index(){ 00048 00049 int i; 00050 int ind=0; 00051 00052 for(i=0;i<_size;i++) { 00053 ind+=_ind->_state[_ind->_ind[i]]*_nstate[i]; 00054 } 00055 00056 return ind; 00057 00058 } 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069