/* * Chain.cpp * * Created on: Jan 16, 2012 * Author: Anastasia Karavdina */ #include "Chain.h" Chain::Chain(list ls, Particle ip, list lf) { _lstates = ls; _ip = ip; _lfp = lf; _Jc = _ip.Spin(); list::iterator it = _lstates.begin(); vector lya1 = (*it).Lya1(); vector lya2 = (*it).Lya2(); for(int i=0;i::iterator it = _lfp.begin(); it != _lfp.end(); it++){ Particle cur = (*it); cout< change initial particle //-> change list of final particles void Chain::AddState(TwoParticleState add2st){ //_lstates.push_front(add2st); _lstates.push_back(add2st); Particle newinp = add2st.GetIP(); pair newfpp = add2st.GetFP(); int codepreinit = _ip.Code(); int codenewfin1 = newfpp.first.Code(); int codenewfin2 = newfpp.second.Code(); if(codepreinit==codenewfin1){ _lfp.push_back(newfpp.second);//new and previous state connect by particle #1 -> add particle#2 in list of f.p cout<<"Add Particle with code="< add particle#1 in list of f.p cout<<"Add Particle with code="<::iterator it1 = _lstates.begin(); it1 != _lstates.end(); it1++){ TwoParticleState curst=(*it1); if(curst.J()>_Jc) _Jc = curst.J(); } list::iterator it = _lstates.begin(); // TwoParticleState* lastchain = &(*it); vector lya1 = (*it).Lya1(); vector lya2 = (*it).Lya2(); _lyafp.erase(_lyafp.begin(),_lyafp.end()); for(int i=0;i