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 "DataStructure/EMREventTrack.hh"
21
EMREventTrack::EMREventTrack()
22
: _emrplanehits(), _emrspacepoints(),
23
_track(), _type(""), _id(-1), _time(-1.),
24
_plane_density_ma(-1.), _plane_density_sa(-1.),
25
_total_charge_ma(-1.), _total_charge_sa(-1.),
26
_charge_ratio_ma(-1.), _charge_ratio_sa(-1.) {
29
EMREventTrack::EMREventTrack(const EMREventTrack& emret)
30
: _emrplanehits(), _emrspacepoints(),
31
_track(), _type(""), _id(-1), _time(-1.),
32
_plane_density_ma(-1.), _plane_density_sa(-1.),
33
_total_charge_ma(-1.), _total_charge_sa(-1.),
34
_charge_ratio_ma(-1.), _charge_ratio_sa(-1.) {
39
EMREventTrack& EMREventTrack::operator=(const EMREventTrack& emret) {
43
this->_emrplanehits = emret._emrplanehits;
44
for (size_t i = 0; i < this->_emrplanehits.size(); i++)
45
this->_emrplanehits[i] = new EMRPlaneHit(*(this->_emrplanehits[i]));
47
this->_emrspacepoints = emret._emrspacepoints;
48
for (size_t i = 0; i < this->_emrspacepoints.size(); i++)
49
this->_emrspacepoints[i] = new EMRSpacePoint(*(this->_emrspacepoints[i]));
51
this->SetEMRTrack(emret._track);
52
this->SetType(emret._type);
53
this->SetTrackId(emret._id);
54
this->SetTime(emret._time);
55
this->SetPlaneDensityMA(emret._plane_density_ma);
56
this->SetPlaneDensitySA(emret._plane_density_sa);
57
this->SetTotalChargeMA(emret._total_charge_ma);
58
this->SetTotalChargeSA(emret._total_charge_sa);
59
this->SetChargeRatioMA(emret._charge_ratio_ma);
60
this->SetChargeRatioSA(emret._charge_ratio_sa);
65
EMREventTrack::~EMREventTrack() {
67
for (size_t i = 0; i < _emrplanehits.size(); i++)
68
delete _emrplanehits[i];
70
_emrplanehits.resize(0);
72
for (size_t i = 0; i < _emrspacepoints.size(); i++)
73
delete _emrspacepoints[i];
75
_emrspacepoints.resize(0);
78
void EMREventTrack::SetEMRPlaneHitArray(EMRPlaneHitArray emrplanehits) {
80
for (size_t i = 0; i < _emrplanehits.size(); i++) {
81
if (_emrplanehits[i] != NULL)
82
delete _emrplanehits[i];
84
_emrplanehits = emrplanehits;
87
void EMREventTrack::SetEMRSpacePointArray(EMRSpacePointArray emrspacepoints) {
89
for (size_t i = 0; i < _emrspacepoints.size(); i++) {
90
if (_emrspacepoints[i] != NULL)
91
delete _emrspacepoints[i];
93
_emrspacepoints = emrspacepoints;