~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

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

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
 
2
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 */
 
16
 
 
17
#include "DataStructure/EMRBar.hh"
 
18
 
 
19
namespace MAUS {
 
20
 
 
21
EMRBar::EMRBar()
 
22
    : _bar(0), _emrbarhitarray() {
 
23
}
 
24
 
 
25
EMRBar::EMRBar(const EMRBar& _emrbar)
 
26
    : _bar(0), _emrbarhitarray() {
 
27
    *this = _emrbar;
 
28
}
 
29
 
 
30
EMRBar& EMRBar::operator=(const EMRBar& _emrbar) {
 
31
    if (this == &_emrbar) {
 
32
        return *this;
 
33
    }
 
34
    SetBar(_emrbar._bar);
 
35
    SetEMRBarHitArray(_emrbar._emrbarhitarray);
 
36
    return *this;
 
37
}
 
38
 
 
39
EMRBar::~EMRBar() {
 
40
}
 
41
 
 
42
int EMRBar::GetBar() const {
 
43
    return _bar;
 
44
}
 
45
 
 
46
void EMRBar::SetBar(int bar) {
 
47
    _bar = bar;
 
48
}
 
49
 
 
50
int EMRBar::GetNHits() const {
 
51
    return _emrbarhitarray.size();
 
52
}
 
53
 
 
54
EMRBarHitArray EMRBar::GetEMRBarHitArray() const {
 
55
    return _emrbarhitarray;
 
56
}
 
57
 
 
58
void EMRBar::SetEMRBarHitArray(EMRBarHitArray emrbarhitarray) {
 
59
    _emrbarhitarray = emrbarhitarray;
 
60
}
 
61
 
 
62
void EMRBar::AddBarHit(EMRBarHit bHit) {
 
63
  _emrbarhitarray.push_back(bHit);
 
64
}
 
65
}
 
66