1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
3
* MAUS is free software: you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation, either version 3 of the License, or
6
* (at your option) any later version.
8
* MAUS is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with MAUS. If not, see <http://www.gnu.org/licenses/>.
17
#include "src/common_cpp/DataStructure/Hit.hh"
21
Hit::Hit() : _track_id(0), _particle_id(0), _energy(0), _charge(0), _time(0),
22
_energy_deposited(0), _position(0, 0, 0), _momentum(0, 0, 0),
26
Hit::Hit(const Hit& md)
27
: _track_id(0), _particle_id(0), _energy(0), _charge(0), _time(0),
28
_energy_deposited(0), _position(0, 0, 0), _momentum(0, 0, 0),
33
Hit& Hit::operator=(const Hit& md) {
37
_track_id = md._track_id;
38
_particle_id = md._particle_id;
42
_energy_deposited = md._energy_deposited;
43
_position = md._position;
44
_momentum = md._momentum;
45
if (_channel_id != NULL) {
48
if (md._channel_id == NULL) {
51
_channel_id = md._channel_id->Clone();
57
if (_channel_id != NULL) {
64
int Hit::GetTrackId() const {
68
void Hit::SetTrackId(int id) {
72
int Hit::GetParticleId() const {
76
void Hit::SetParticleId(int pid) {
80
double Hit::GetEnergy() const {
84
void Hit::SetEnergy(double energy) {
88
double Hit::GetCharge() const {
92
void Hit::SetCharge(double charge) {
96
double Hit::GetTime() const {
100
void Hit::SetTime(double time) {
104
double Hit::GetEnergyDeposited() const {
105
return _energy_deposited;
108
void Hit::SetEnergyDeposited(double edep) {
109
_energy_deposited = edep;
112
ThreeVector Hit::GetPosition() const {
116
void Hit::SetPosition(ThreeVector pos) {
120
ThreeVector Hit::GetMomentum() const {
124
void Hit::SetMomentum(ThreeVector mom) {
128
ChannelId* Hit::GetChannelId() const {
132
void Hit::SetChannelId(ChannelId* id) {
133
if (_channel_id != NULL) {