3 #include "HEPEVT_struct.h"
4 #include "PhotosParticle.h"
5 #include "PhotosBranch.h"
20 if(daughters.size()==0)
28 else if(daughters.at(0)->getMothers().size()==1)
40 mothers = daughters.at(0)->getMothers();
49 forcing = checkForcingLevel();
50 if(!forcing) suppression = checkSuppressionLevel();
58 if(suppression) Log::Warning()<<
"Branching ignored due to 4-momentum non conservation"<<endl;
61 if(!particle && daughters.size()==1) suppression=-1;
64 if(suppression) forcing=0;
70 Log::Debug(703)<<
" Processing barcode: "<<( (particle) ? particle->
getBarcode() : ( (mothers.size()) ? mothers.at(0)->getBarcode() : -1) )<<endl;
86 vector<PhotosParticle *> ret = mothers;
87 if(particle) ret.push_back(particle);
88 ret.insert(ret.end(),daughters.begin(),daughters.end());
95 if(mothers.size()>0)
return mothers.at(0)->checkMomentumConservation();
101 Log::Debug(700)<<
"PhotosBranch::createBranches - filtering started"<<endl;
102 list<PhotosParticle *> list(particles.begin(),particles.end());
103 vector<PhotosBranch *> branches;
108 std::list<PhotosParticle *>::iterator it;
109 for(it=list.begin();it!=list.end();it++)
115 Log::Debug(701)<<
" Forced: "<<(*it)->getPdgID()<<
" (barcode: "<<(*it)->getBarcode()<<
") with forcing status= "<<forcing<<endl;
116 branches.push_back(branch);
130 std::list<PhotosParticle *>::iterator it2;
131 for(it2=list.begin();it2!=list.end();it2++)
133 for(
int i=0;i<(int)tree.size();i++)
135 if(tree.at(i)->getBarcode()==(*it2)->getBarcode())
138 branches.push_back(b);
141 it2 = list.erase(it2);
159 if(!particle)
continue;
163 if(!suppression) branches.push_back(branch);
166 Log::Debug(702)<<
" Suppressed: "<<particle->
getPdgID()<<
" (barcode: "<<particle->
getBarcode()<<
") with suppression status= "<<suppression<<endl;
178 std::list<PhotosParticle *>::iterator it;
179 for(it=list.begin();it!=list.end();it++)
181 for(
int i=0;i<(int)tree.size();i++)
183 if(tree.at(i)->getBarcode()==(*it)->getBarcode())
199 vector<PhotosParticle *> mothers = branch->
getMothers();
200 for(
int i=0;i<(int)mothers.size();i++)
204 std::list<PhotosParticle *>::iterator it;
205 for(it=list.begin();it!=list.end();it++)
217 int PhotosBranch::checkList(
bool forceOrSuppress)
224 if(particle) motherID = particle->
getPdgID();
227 if(mothers.size()==0)
return 0;
228 motherID = mothers.at(0)->getPdgID();
233 for(
int j=0;j<(int)daughters.size();j++) dID.push_back(daughters[j]->getPdgID());
235 vector< vector<int> *> &patternList = *list;
238 for(
int j=0; j<(int)patternList.size();j++)
241 if(motherID!=(*patternList[j])[0])
continue;
244 vector<int> &pattern = *patternList[j];
246 for(
int k = 1; k<(int)pattern.size()-1; k++)
249 for(
int l=0;l<(int)dID.size(); l++)
250 if(pattern[k]==dID[l]) { oneMatch=
true;
break; }
251 if(!oneMatch) { fullMatch=
false;
break; }
261 if(pattern.size()<=2 || fullMatch)
262 return (pattern.back()==1) ? 2 : 1;
static vector< PhotosBranch * > createBranches(vector< PhotosParticle * > particles)
bool checkMomentumConservation()
int getSuppressionStatus()
vector< PhotosParticle * > getMothers()
static vector< vector< int > * > * forceBremList
PhotosParticle * getDecayingParticle()
static vector< vector< int > * > * supBremList
std::vector< PhotosParticle * > findProductionMothers()
virtual int getBarcode()=0
static ostream & Debug(unsigned short int code=0, bool count=true)
std::vector< PhotosParticle * > getDecayTree()
static int set(PhotosBranch *branch)
vector< PhotosParticle * > getParticles()
PhotosBranch(PhotosParticle *p)
virtual bool checkMomentumConservation()=0
virtual std::vector< PhotosParticle * > getDaughters()=0