~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to src/common_cpp/DataStructure/DBBSpillData.hh

  • 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
#ifndef _SRC_COMMON_CPP_DATASTRUCTURE_DBBSPILLDATA_
 
18
#define _SRC_COMMON_CPP_DATASTRUCTURE_DBBSPILLDATA_
 
19
 
 
20
#include <vector>
 
21
#include <string>
 
22
 
 
23
#include "Utils/VersionNumber.hh"
 
24
#include "DataStructure/DBBHit.hh"
 
25
 
 
26
namespace MAUS {
 
27
 
 
28
typedef std::vector<DBBHit> DBBHitsArray;
 
29
 
 
30
class DBBSpillData {
 
31
  public:
 
32
    DBBSpillData();
 
33
 
 
34
    DBBSpillData(const DBBSpillData& dbbspill);
 
35
 
 
36
    DBBSpillData& operator=(const DBBSpillData& dbbspill);
 
37
 
 
38
    virtual ~DBBSpillData();
 
39
 
 
40
    /** Returns Ldc Id */
 
41
    int GetLdcId() const;
 
42
 
 
43
    /** Sets Ldc Id */
 
44
    void SetLdcId(int id);
 
45
 
 
46
    /** Returns DB BId */
 
47
    int GetDBBId() const;
 
48
 
 
49
    /** Sets DBB Id */
 
50
    void SetDBBId(int id);
 
51
 
 
52
    /** Returns Spill Number */
 
53
    int GetSpillNumber() const;
 
54
 
 
55
    /** Sets Spill Number */
 
56
    void SetSpillNumber(int n);
 
57
 
 
58
    /** Returns Spill Width */
 
59
    int GetSpillWidth() const;
 
60
 
 
61
    /** Sets Spill Width */
 
62
    void SetSpillWidth(int w);
 
63
 
 
64
    /** Returns Trigger Count */
 
65
    int GetTriggerCount() const;
 
66
 
 
67
    /** Sets Trigger Count */
 
68
    void SetTriggerCount(int tc);
 
69
 
 
70
    /** Returns Hit Count */
 
71
    int GetHitCount() const;
 
72
 
 
73
    /** Sets Hit Count */
 
74
    void SetHitCount(int hc);
 
75
 
 
76
    /** Returns TimeStamp */
 
77
    int GetTimeStamp() const;
 
78
 
 
79
    /** Sets TimeStamp */
 
80
    void SetTimeStamp(int time_stamp);
 
81
 
 
82
    /** Returns Detector */
 
83
    std::string GetDetector() const;
 
84
 
 
85
    /** Sets Detector */
 
86
    void SetDetector(std::string detector);
 
87
 
 
88
    /** Returns DBB Hit Array */
 
89
    DBBHitsArray GetDBBHitsArray() const;
 
90
 
 
91
    /** Get an element from DBB Hit Array (needed for PyROOT) */
 
92
    DBBHit GetDBBHitsArrayElement(size_t index) const;
 
93
 
 
94
    /** Get size of EMRHitsArray (needed for PyROOT) */
 
95
    size_t GetDBBHitsArraySize() const;
 
96
 
 
97
    /** Sets DBB Hit Array */
 
98
    void SetDBBHitsArray(DBBHitsArray ha);
 
99
 
 
100
 
 
101
 
 
102
    /** Returns DBB Trigger Array */
 
103
    DBBHitsArray GetDBBTriggersArray() const;
 
104
 
 
105
    /** Get an element from DBB Hit Array (needed for PyROOT) */
 
106
    DBBHit GetDBBTriggersArrayElement(size_t index) const;
 
107
 
 
108
    /** Get size of EMRDaqArray (needed for PyROOT) */
 
109
    size_t GetDBBTriggersArraySize() const;
 
110
 
 
111
    /** Sets DBB Hit Array */
 
112
    void SetDBBTriggersArray(DBBHitsArray ta);
 
113
 
 
114
    void print() {
 
115
      std::cout << "*** Spill DBB" << _dbbId << " ***\n  sn: " << _spill_number
 
116
                << "\n  sw: " << _spill_width
 
117
                << "\n  tc: " << _trigger_count << "\n  hc: "
 
118
                <<  _hit_count << "\n   hits: " << _dbb_hits.size()
 
119
                << "\n   triggers: " << _dbb_triggers.size() << std::endl;
 
120
    }
 
121
 
 
122
  private:
 
123
 
 
124
    int _ldcId;
 
125
    int _dbbId;
 
126
    int _spill_number;
 
127
    int _spill_width;
 
128
    int _trigger_count;
 
129
    int _hit_count;
 
130
    int _time_stamp;
 
131
    std::string _detector;
 
132
 
 
133
    DBBHitsArray _dbb_hits;
 
134
    DBBHitsArray _dbb_triggers;
 
135
 
 
136
    MAUS_VERSIONED_CLASS_DEF(DBBSpillData)
 
137
};
 
138
}
 
139
 
 
140
#endif