EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
EventSmear.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file EventSmear.cxx
1
10
#include "
eicsmear/smear/EventSmear.h
"
11
12
#include <iostream>
13
#include <vector>
14
15
namespace
Smear {
16
17
Event::Event
()
18
: nTracks(0)
19
, mScatteredIndex(-1) {
20
}
21
22
Event::~Event
() {
23
ClearParticles
();
24
}
25
26
void
Event::ClearParticles
() {
27
for
(
unsigned
i(0); i <
particles
.size(); ++i) {
28
if
(
GetTrack
(i)) {
29
delete
GetTrack
(i);
30
}
// if
31
}
// for
32
}
33
34
void
Event::Reset
() {
35
ClearParticles
();
36
*
this
=
Event
();
37
}
38
39
void
Event::AddLast
(
ParticleMCS
* track) {
40
particles
.push_back(track);
41
}
42
43
// The scattered lepton should be the first non-NULL entry in the track list
44
const
ParticleMCS
*
Event::ScatteredLepton
()
const
{
45
if
(
mScatteredIndex
> -1 &&
46
mScatteredIndex
< static_cast<int>(
GetNTracks
())) {
47
return
GetTrack
(
mScatteredIndex
);
48
}
// if
49
return
NULL;
50
}
51
52
// Get the particles that belong to the hadronic final state.
53
// (i.e. including leptons and bosons except for the scattered lepton).
54
// The stored Particle* are pointers to the original particles in the event
55
// so don't delete them!
56
void
Event::HadronicFinalState
(
ParticlePtrList
&
final
)
const
{
57
// Skip the first two entries, as these are the incident beams
58
for
(
unsigned
i(2); i <
GetNTracks
(); ++i) {
59
if
(!
GetTrack
(i)) {
60
continue
;
61
}
// if
62
if
(
GetTrack
(i) !=
ScatteredLepton
()) {
63
final
.push_back(
GetTrack
(i));
64
}
// if
65
}
// for
66
}
67
68
std::vector<const erhic::VirtualParticle*>
Event::GetTracks
()
const
{
69
std::vector<const erhic::VirtualParticle*> tracks;
70
for
(
unsigned
i(0); i <
GetNTracks
(); ++i) {
71
tracks.push_back(
GetTrack
(i));
72
}
// for
73
return
tracks;
74
}
75
76
void
Event::SetScattered
(
int
index) {
77
if
(index >= 0) {
78
mScatteredIndex
= index;
79
}
// if
80
}
81
void
Event::Print
(Option_t*
/* unused */
)
const
{
82
std::cout <<
83
"x: "
<<
GetX
() << std::endl <<
84
"Q2: "
<<
GetQ2
() << std::endl <<
85
"y: "
<<
GetY
() << std::endl;
86
for
(
unsigned
i(0); i <
GetNTracks
(); ++i) {
87
if
(
GetTrack
(i)) {
88
GetTrack
(i)->
Print
();
89
}
// if
90
}
// for
91
}
92
93
}
// namespace Smear
eic-smear
blob
master
src
smear
EventSmear.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:32
using
1.8.2 with
EIC GitHub integration