~chris-rogers/maus/1312

« back to all changes in this revision

Viewing changes to src/common_cpp/DataStructure/MCEvent.cc

candidate 0.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
MCEvent::MCEvent()
26
26
       : _primary(NULL), _virtuals(NULL), _sci_fi_hits(NULL), _sci_fi_noise_hits(NULL),
27
 
         _tof_hits(NULL), _special_virtual_hits(NULL), _tracks(NULL) {
 
27
         _tof_hits(NULL), _kl_hits(NULL), _special_virtual_hits(NULL), _tracks(NULL) {
28
28
}
29
29
 
30
30
MCEvent::MCEvent(const MCEvent& md)
31
31
       : _primary(NULL), _virtuals(NULL), _sci_fi_hits(NULL), _sci_fi_noise_hits(NULL),
32
 
         _tof_hits(NULL), _special_virtual_hits(NULL), _tracks(NULL) {
 
32
         _tof_hits(NULL), _kl_hits(NULL), _special_virtual_hits(NULL), _tracks(NULL) {
33
33
  *this = md;
34
34
}
35
35
 
82
82
        _tof_hits = new TOFHitArray(*md._tof_hits);
83
83
    }
84
84
 
 
85
    if (_kl_hits != NULL) {
 
86
        delete _kl_hits;
 
87
    }
 
88
    if (md._kl_hits == NULL) {
 
89
        _kl_hits = NULL;
 
90
    } else {
 
91
        _kl_hits = new KLHitArray(*md._kl_hits);
 
92
    }
 
93
 
85
94
    if (_special_virtual_hits != NULL) {
86
95
        delete _special_virtual_hits;
87
96
    }
125
134
        delete _tof_hits;
126
135
        _tof_hits = NULL;
127
136
    }
 
137
    if (_kl_hits != NULL) {
 
138
        delete _kl_hits;
 
139
        _kl_hits = NULL;
 
140
    }
128
141
    if (_special_virtual_hits != NULL) {
129
142
        delete _special_virtual_hits;
130
143
        _special_virtual_hits = NULL;
198
211
    _tof_hits = hits;
199
212
}
200
213
 
 
214
KLHitArray* MCEvent::GetKLHits() const {
 
215
    return _kl_hits;
 
216
}
 
217
 
 
218
void MCEvent::SetKLHits(KLHitArray* hits) {
 
219
    if (_kl_hits != NULL) {
 
220
        delete _kl_hits;
 
221
    }
 
222
    _kl_hits = hits;
 
223
}
 
224
 
201
225
SpecialVirtualHitArray* MCEvent::GetSpecialVirtualHits() const {
202
226
    return _special_virtual_hits;
203
227
}