eic-smear
1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
hadronic/EventMC.cxx
Go to the documentation of this file.
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
erhic::hadronic::EventMC::~EventMC
virtual ~EventMC()
Destructor.
Definition:
hadronic/EventMC.cxx:17
erhic
Definition:
EventDis.cxx:14
erhic::hadronic::EventMC::EventMC
EventMC()
Constructor.
Definition:
hadronic/EventMC.cxx:21
EventMC.h
erhic::hadronic::EventMC::GetTrack
virtual const ParticleMC * GetTrack(UInt_t) const
Returns the nth track from the event.
Definition:
hadronic/EventMC.cxx:29
erhic::hadronic::ParticleMC
A realisation of erhic::VirtualParticle for tracks from a hadron-hadron Monte Carlo event.
Definition:
hadronic/ParticleMC.h:30
erhic::hadronic::EventMC::mTracks
TClonesArray mTracks
Definition:
hadronic/EventMC.h:76
erhic::hadronic::EventMC::Add
virtual UInt_t Add(ParticleMC *particle)
Add a track to the list.
Definition:
hadronic/EventMC.cxx:41
erhic::hadronic::EventMC::GetCentreOfMassEnergy
virtual Double_t GetCentreOfMassEnergy() const
Returns the centre-of-mass energy of the event (GeV)
Definition:
hadronic/EventMC.cxx:46
erhic::hadronic::ParticleMC::Get4Vector
virtual TLorentzVector Get4Vector() const
Returns the momentum-energy four-vector (px, py, pz, E).
Definition:
hadronic/ParticleMC.h:196
erhic::hadronic::EventMC::GetNTracks
virtual UInt_t GetNTracks() const
Returns the number of tracks in the event.
Definition:
hadronic/EventMC.cxx:37
erhic::hadronic::EventMC::Clear
virtual void Clear(Option_t *="")
Clear the track list.
Definition:
hadronic/EventMC.cxx:25
src
hadronic
EventMC.cxx
Generated on Fri Jan 31 2020 15:11:33 for eic-smear by
1.8.17