2 #include "PhotosParticle.h"
3 #include "PhotosBranch.h"
4 #include "PhotosEvent.h"
11 PhotosEvent::~PhotosEvent()
13 while(m_branch_points.size()!=0)
15 PhotosBranch *temp = m_branch_points.back();
16 m_branch_points.pop_back();
21 void PhotosEvent::process()
24 vector<PhotosParticle*> particles = filterParticles( getParticleList() );
25 m_branch_points = PhotosBranch::createBranches(particles);
27 for(int i=0;i<(int)m_branch_points.size();i++)
28 m_branch_points.at(i)->process();
32 vector<PhotosParticle *> PhotosEvent::filterParticles(vector<PhotosParticle *> particles)
34 vector<PhotosParticle *> filtered;
35 for(int i=0;i<(int)particles.size();i++)
37 PhotosParticle *p = particles.at(i);
40 //check that the particle decays
41 if(p->getStatus()==PhotosParticle::STABLE) continue;
43 //check for self decays
44 vector<PhotosParticle *> daughters = p->getDaughters();
46 for(j=0;j<(int)daughters.size();j++)
47 if(daughters.at(j)->getPdgID()==p->getPdgID()) break;
48 if(j!=(int)daughters.size()) continue;
50 Log::Debug(2)<<"Passed particle filter"<<endl;
51 filtered.push_back(p);
56 } // namespace Photospp