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
EventMC.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file EventMC.cxx
1
10
#include <
eicsmear/hadronic/EventMC.h
>
11
12
#include <TLorentzVector.h>
13
14
namespace
erhic {
15
namespace
hadronic {
16
17
EventMC::~EventMC
() {
18
Clear
(
""
);
19
}
20
21
EventMC::EventMC
()
22
: mTracks(
"erhic::hadronic::ParticleMC"
, 100) {
23
}
24
25
void
EventMC::Clear
(Option_t*
/* option */
) {
26
mTracks
.Clear();
27
}
28
29
const
ParticleMC
*
EventMC::GetTrack
(UInt_t i)
const
{
30
return
static_cast<
ParticleMC
*
>
(
mTracks
.At(i));
31
}
32
33
ParticleMC
*
EventMC::GetTrack
(UInt_t i) {
34
return
static_cast<
ParticleMC
*
>
(
mTracks
.At(i));
35
}
36
37
UInt_t
EventMC::GetNTracks
()
const
{
38
return
mTracks
.GetEntries();
39
}
40
41
UInt_t
EventMC::Add
(
ParticleMC
*
p
) {
42
new
(
mTracks
[
GetNTracks
()])
ParticleMC
(*p);
43
return
GetNTracks
();
44
}
45
46
Double_t
EventMC::GetCentreOfMassEnergy
()
const
{
47
double
energy(NAN);
48
if
(
GetTrack
(0) &&
GetTrack
(1)) {
49
energy = (
GetTrack
(0)->
Get4Vector
() +
GetTrack
(1)->
Get4Vector
()).
M
();
50
}
// if
51
return
energy;
52
}
53
54
}
// namespace hadronic
55
}
// namespace erhic
eic-smear
blob
master
src
hadronic
EventMC.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:32
using
1.8.2 with
EIC GitHub integration