FairRoot/PandaRoot
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
pgenerators
EvtGen
Photos
Photos.3.52
src
eventRecordInterfaces
PhotosHEPEVTEvent.cxx
Go to the documentation of this file.
1
#include "
PhotosHEPEVTEvent.h
"
2
#include "Log.h"
3
4
namespace
Photospp
5
{
6
7
PhotosHEPEVTEvent::~PhotosHEPEVTEvent
()
8
{
9
for
(
unsigned
int
i
=0;
i
<
particle_list
.size();
i
++)
delete
particle_list
[
i
];
10
}
11
12
PhotosHEPEVTEvent::PhotosHEPEVTEvent
() {}
13
14
void
PhotosHEPEVTEvent::addParticle
(
PhotosHEPEVTParticle
*
p
)
15
{
16
p->
setEvent
(
this
);
17
18
p->
setBarcode
(
particle_list
.size());
19
particle_list
.push_back(p);
20
}
21
22
PhotosHEPEVTParticle
*
PhotosHEPEVTEvent::getParticle
(
int
i
)
23
{
24
if
( i<0 || i>=(
int
)
particle_list
.size() )
return
NULL;
25
return
particle_list
[
i
];
26
}
27
28
void
PhotosHEPEVTEvent::setParticle
(
int
i
,
PhotosHEPEVTParticle
*
p
)
29
{
30
if
( i<0 || i>=(
int
)
particle_list
.size() )
return
;
31
particle_list
[
i
] =
p
;
32
}
33
34
int
PhotosHEPEVTEvent::getParticleCount
()
35
{
36
return
particle_list
.size();
37
}
38
39
std::vector<PhotosParticle*>
PhotosHEPEVTEvent::getParticleList
()
40
{
41
std::vector<PhotosParticle*> ret;
42
43
for
(
unsigned
int
i
=0;
i
<
particle_list
.size();
i
++) ret.push_back( (
PhotosParticle
*)
particle_list
[
i
] );
44
45
return
ret;
46
}
47
48
void
PhotosHEPEVTEvent::print
()
49
{
50
Log::Info
()<<
"PhotosHEPEVTEvent"
<<endl<<
"-----------------"
<<endl;
51
for
(
unsigned
int
i
=0;
i
<
particle_list
.size();
i
++)
particle_list
[
i
]->
print
();
52
}
53
54
void
PhotosHEPEVTEvent::clear
()
55
{
56
for
(
unsigned
int
i
=0;
i
<
particle_list
.size();
i
++)
delete
particle_list
[
i
];
57
particle_list
.clear();
58
}
59
60
#ifdef USE_HEPEVT_INTERFACE
61
62
void
PhotosHEPEVTEvent::read_event_from_HEPEVT(
PhotosHEPEVTEvent
*
evt
)
63
{
64
if
(evt==NULL)
return
;
65
66
for
(
int
i
=0;
i
<hepevt_.nhep;
i
++)
67
{
68
PhotosHEPEVTParticle
*
p
=
new
PhotosHEPEVTParticle
69
(
70
hepevt_.idhep [
i
],
71
hepevt_.isthep[
i
],
72
hepevt_.phep [
i
][0],
73
hepevt_.phep [
i
][1],
74
hepevt_.phep [
i
][2],
75
hepevt_.phep [
i
][3],
76
hepevt_.phep [
i
][4],
77
hepevt_.jmohep[
i
][0]-1,
78
hepevt_.jmohep[
i
][1]-1,
79
hepevt_.jdahep[
i
][0]-1,
80
hepevt_.jdahep[
i
][1]-1
81
);
82
evt->
addParticle
(p);
83
}
84
}
85
86
void
PhotosHEPEVTEvent::write_event_to_HEPEVT(PhotosHEPEVTEvent *evt)
87
{
88
if
(evt==NULL)
return
;
89
90
hepevt_.nhep = evt->getParticleCount();
91
92
for
(
int
i
=0;
i
<hepevt_.nhep;
i
++)
93
{
94
PhotosHEPEVTParticle
*
p
= evt->getParticle(
i
);
95
96
hepevt_.idhep [
i
] =p->getPdgID();
97
hepevt_.isthep[
i
] =p->getStatus();
98
hepevt_.phep [
i
][0]=p->getPx();
99
hepevt_.phep [
i
][1]=p->getPy();
100
hepevt_.phep [
i
][2]=p->getPz();
101
hepevt_.phep [
i
][3]=p->getE();
102
hepevt_.phep [
i
][4]=p->getMass();
103
hepevt_.jmohep[
i
][0]=p->getFirstMotherIndex() +1;
104
hepevt_.jmohep[
i
][1]=p->getSecondMotherIndex() +1;
105
hepevt_.jdahep[
i
][0]=p->getDaughterRangeStart()+1;
106
hepevt_.jdahep[
i
][1]=p->getDaughterRangeEnd() +1;
107
hepevt_.vhep [
i
][0]=0.0;
108
hepevt_.vhep [
i
][1]=0.0;
109
hepevt_.vhep [
i
][2]=0.0;
110
hepevt_.vhep [
i
][3]=0.0;
111
}
112
}
113
114
#endif
115
116
}
// namespace Photospp
p
Double_t p
Definition:
anasim.C:58
Photospp::PhotosHEPEVTEvent::getParticleList
std::vector< PhotosParticle * > getParticleList()
Definition:
PhotosHEPEVTEvent.cxx:39
Photospp::PhotosHEPEVTEvent
Definition:
PhotosHEPEVTEvent.h:51
i
Int_t i
Definition:
run_full.C:25
Photospp::PhotosHEPEVTParticle::setEvent
void setEvent(PhotosHEPEVTEvent *event)
Definition:
PhotosHEPEVTParticle.cxx:396
Photospp::PhotosHEPEVTEvent::getParticle
PhotosHEPEVTParticle * getParticle(int i)
Definition:
PhotosHEPEVTEvent.cxx:22
evt
int evt
Definition:
checkhelixhit.C:36
Photospp::PhotosHEPEVTEvent::PhotosHEPEVTEvent
PhotosHEPEVTEvent()
Definition:
PhotosHEPEVTEvent.cxx:12
Photospp::Log::Info
static ostream & Info(bool count=true)
Definition:
Log.cxx:38
Photospp::PhotosHEPEVTEvent::getParticleCount
int getParticleCount()
Definition:
PhotosHEPEVTEvent.cxx:34
Photospp::PhotosHEPEVTEvent::particle_list
std::vector< PhotosHEPEVTParticle * > particle_list
Definition:
PhotosHEPEVTEvent.h:93
Photospp::PhotosHEPEVTEvent::print
void print()
Definition:
PhotosHEPEVTEvent.cxx:48
Photospp::PhotosHEPEVTEvent::~PhotosHEPEVTEvent
~PhotosHEPEVTEvent()
Definition:
PhotosHEPEVTEvent.cxx:7
Photospp::PhotosHEPEVTParticle::setBarcode
void setBarcode(int barcode)
Definition:
PhotosHEPEVTParticle.cxx:392
Photospp::PhotosHEPEVTEvent::clear
void clear()
Definition:
PhotosHEPEVTEvent.cxx:54
Photospp::PhotosParticle
Definition:
PhotosParticle.h:25
Photospp::PhotosHEPEVTEvent::setParticle
void setParticle(int i, PhotosHEPEVTParticle *p)
Definition:
PhotosHEPEVTEvent.cxx:28
Photospp::PhotosHEPEVTEvent::addParticle
void addParticle(PhotosHEPEVTParticle *p)
Definition:
PhotosHEPEVTEvent.cxx:14
Photospp::PhotosHEPEVTParticle
Definition:
PhotosHEPEVTParticle.h:32
PhotosHEPEVTEvent.h
PhotosHEPEVTParticle
Single particle of HEPEVT event record.
Generated on Wed Apr 3 2019 08:43:52 for FairRoot/PandaRoot by
1.8.5