16 success &= associateFinalStates(pat);
17 if(! success)
return false;
18 success &= associateResonances();
28 if(dbThis) cout <<
"associateFinalStates was called " << endl;
29 if(pat.
empty())
return false;
32 if(dbThis) cout <<
"got pattern of size " << pat.
size() << endl;
33 if(fs_pat.empty())
return false;
34 if(dbThis) cout <<
"pattern not empty" << endl;
35 std::vector<AssociatedDecayTreeItem*> sorted
36 = _theDecay.finalStateInThisOrder(fs_pat);
37 if(dbThis) cout <<
"sorted" << endl;
38 if(sorted.size() != fs_pat.size()){
39 cout <<
"Sizes: " << sorted.size() <<
" " << fs_pat.size() << endl;
41 std::cout <<
"ERROR in AssociatingDecayTree::associate!" 43 for(
unsigned int i=0; i<fs_pat.size(); i++){
44 std::cout <<
"(" << i <<
") " << fs_pat[i] <<
", ";
46 std::cout << std::endl;
48 for(
unsigned int i=0; i<sorted.size(); i++){
49 std::cout <<
"(" << i <<
") " << *(sorted[i]) <<
", ";
51 std::cout << std::endl;
56 for(
unsigned int i=0; i<sorted.size(); i++){
57 sorted[i]->_asi.clear();
58 sorted[i]->_asi.push_back(i+1);
61 std::cout <<
"the new sorted thing" << std::endl;
62 for(
unsigned int i=0; i<sorted.size(); i++){
63 std::cout <<
"(" << i <<
") " << *(sorted[i]) <<
", ";
72 return ! (addAssociations(&_theDecay).empty());
75 return addAssociations(ctree.
get());
82 std::vector<int> allAsis;
84 for(
int i=0; i< tree->
nDgtr(); i++){
85 std::vector<int> thisAsi = addAssociations(tree->
getDgtrTreePtr(i));
86 for(
unsigned int j=0; j<thisAsi.size(); j++){ allAsis.push_back(thisAsi[j]);}
88 stable_sort(allAsis.begin(), allAsis.end());
100 if(pat.
empty())
return false;
101 if(_prevPattern.size() != pat.
size()){
103 std::cout <<
"prev pattern size != new pattern size: " 104 << _prevPattern.size() <<
" != " << pat.
size() << endl;
105 std::cout <<
" returning pattern has changed = true " << std::endl;
112 for(
unsigned int i=1; i< _prevPattern.size(); i++){
113 if (_prevPattern[i] != pat[i]){
115 std::cout <<
" returning pattern has changed = true " << std::endl;
123 if(patternHasChanged(evt)) associate(evt);
127 if(patternHasChanged(pat)) associate(pat);
132 if(patternHasChanged(evt)) associate(evt);
136 if(patternHasChanged(pat)) associate(pat);
141 return _theTreesPattern;
const AssociatedDecayTree * getTreePtr(const DalitzEventPattern &pat) const
std::vector< int > finalStates() const
const DalitzEventPattern & getTreePattern() const
const ValueType & getVal() const
bool isFinalState() const
MINT::const_counted_ptr< DDTree< ValueType > > getDgtrTreePtr(int i) const
bool patternHasChanged(const DalitzEventPattern &pat) const
const AssociatedDecayTree & getTree(const DalitzEventPattern &pat) const
virtual const DalitzEventPattern & eventPattern() const =0
bool associateResonances() const
unsigned int size() const
bool associate(const DalitzEventPattern &pat) const
std::vector< int > addAssociations(MINT::counted_ptr< AssociatedDecayTree > ctree) const
bool associateFinalStates(const DalitzEventPattern &pat) const