FairRoot/PandaRoot
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
pgenerators
EvtGen
Photos
Photos.3.52
src
photosCInterfaces
PhotosEvent.cxx
Go to the documentation of this file.
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
p
Double_t p
Definition:
anasim.C:58
Photospp::PhotosBranch::createBranches
static vector< PhotosBranch * > createBranches(vector< PhotosParticle * > particles)
Definition:
PhotosBranch.cxx:92
i
Int_t i
Definition:
run_full.C:25
Photospp::PhotosEvent::~PhotosEvent
virtual ~PhotosEvent()
Definition:
PhotosEvent.cxx:11
PhotosEvent.h
Photospp::PhotosEvent::m_branch_points
vector< PhotosBranch * > m_branch_points
Definition:
PhotosEvent.h:44
PhotosBranch.h
Photospp::PhotosParticle::getPdgID
virtual int getPdgID()=0
Photospp::PhotosEvent::filterParticles
vector< PhotosParticle * > filterParticles(vector< PhotosParticle * > particles)
Definition:
PhotosEvent.cxx:32
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:30
Photospp::PhotosParticle::getStatus
virtual int getStatus()=0
PhotosParticle.h
Photospp::PhotosEvent::process
void process()
Definition:
PhotosEvent.cxx:21
Photospp::PhotosEvent::getParticleList
virtual vector< PhotosParticle * > getParticleList()=0
Photospp::PhotosParticle
Definition:
PhotosParticle.h:25
Photospp::PhotosParticle::getDaughters
virtual std::vector< PhotosParticle * > getDaughters()=0
Photospp::PhotosBranch
Definition:
PhotosBranch.h:23
Generated on Wed Apr 3 2019 08:43:52 for FairRoot/PandaRoot by
1.8.5