Main Page
Data Structures
Files
File List
src
photosCInterfaces
PhotosEvent.cxx
1
#include <vector>
2
#include "PhotosParticle.h"
3
#include "PhotosBranch.h"
4
#include "PhotosEvent.h"
5
#include "Log.h"
6
using
std::vector;
7
8
namespace
Photospp
9
{
10
11
PhotosEvent::~PhotosEvent()
12
{
13
while
(
m_branch_points
.size()!=0)
14
{
15
PhotosBranch
*temp =
m_branch_points
.back();
16
m_branch_points
.pop_back();
17
delete
temp;
18
}
19
}
20
21
void
PhotosEvent::process
()
22
{
23
//print();
24
vector<PhotosParticle*> particles =
filterParticles
(
getParticleList
() );
25
m_branch_points
=
PhotosBranch::createBranches
(particles);
26
27
for
(
int
i=0;i<(int)
m_branch_points
.size();i++)
28
m_branch_points
.at(i)->process();
29
//print();
30
}
31
32
vector<PhotosParticle *>
PhotosEvent::filterParticles
(vector<PhotosParticle *> particles)
33
{
34
vector<PhotosParticle *> filtered;
35
for
(
int
i=0;i<(int)particles.size();i++)
36
{
37
PhotosParticle
*p = particles.at(i);
38
if
(!p)
continue
;
39
40
//check that the particle decays
41
if
(p->
getStatus
()==
PhotosParticle::STABLE
)
continue
;
42
43
//check for self decays
44
vector<PhotosParticle *> daughters = p->
getDaughters
();
45
int
j=0;
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
;
49
50
Log::Debug
(2)<<
"Passed particle filter"
<<endl;
51
filtered.push_back(p);
52
}
53
return
filtered;
54
}
55
56
}
// namespace Photospp
Photospp::PhotosParticle::getDaughters
virtual std::vector< PhotosParticle * > getDaughters()=0
Photospp::PhotosParticle::getPdgID
virtual int getPdgID()=0
Photospp::PhotosEvent::getParticleList
virtual vector< PhotosParticle * > getParticleList()=0
Photospp::PhotosParticle::getStatus
virtual int getStatus()=0
Photospp::PhotosParticle::STABLE
static const int STABLE
Definition:
PhotosParticle.h:29
Photospp::Log::Debug
static ostream & Debug(unsigned short int code=0, bool count=true)
Definition:
Log.cxx:33
Photospp::PhotosEvent::process
void process()
Definition:
PhotosEvent.cxx:21
Photospp::PhotosEvent::filterParticles
vector< PhotosParticle * > filterParticles(vector< PhotosParticle * > particles)
Definition:
PhotosEvent.cxx:32
Photospp::PhotosEvent::m_branch_points
vector< PhotosBranch * > m_branch_points
Definition:
PhotosEvent.h:44
Photospp::PhotosParticle
Definition:
PhotosParticle.h:25
PhotosBranch
Single branching point.
Photospp::PhotosBranch::createBranches
static vector< PhotosBranch * > createBranches(vector< PhotosParticle * > particles)
Definition:
PhotosBranch.cxx:99
Generated on Tue Mar 12 2024 23:11:40 for C++InterfacetoPHOTOS by
1.8.7