~christopher-hunt08/maus/maus_integrated_kalman

« back to all changes in this revision

Viewing changes to src/input/InputCppDAQData/InputCppDAQData.hh

  • Committer: Christopher Hunt
  • Date: 2015-06-18 14:48:59 UTC
  • mfrom: (697.69.1 merge)
  • mto: (697.69.2 merge_hunt)
  • mto: This revision was merged to the branch mainline in revision 708.
  • Revision ID: christopher.hunt08@imperial.ac.uk-20150618144859-rki5ma1lv8722w41
Merged in latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
* information is low-level.
55
55
*/
56
56
 
57
 
class InputCppDAQData : public InputBase<std::string> {
 
57
class InputCppDAQData : public InputBase<MAUS::Data> {
58
58
 
59
59
 public:
60
60
 
111
111
  *
112
112
  * \return An event string.
113
113
  */
114
 
  std::string _emit_cpp() {
115
 
     if (this->readNextEvent())
116
 
        return this->getCurEvent();
117
 
     else
118
 
        throw(MAUS::Exception(Exception::recoverable,
119
 
                              "Failed to read next event",
120
 
                              "InputCppDAQData::_emit_cpp()"));
 
114
  MAUS::Data _emit_cpp() {
 
115
     if (this->readNextEvent()) {
 
116
       MAUS::Data  *data_cpp  = new MAUS::Data;
 
117
       MAUS::Spill *spill_cpp = new MAUS::Spill;
 
118
       data_cpp->SetSpill(spill_cpp);
 
119
       this->getCurEvent(data_cpp);
 
120
       _eventsCount++;
 
121
       return *data_cpp;
 
122
     } else {
 
123
       throw(MAUS::Exception(Exception::recoverable,
 
124
                             "Failed to read next event",
 
125
                             "InputCppDAQData::_emit_cpp()"));
 
126
    }
121
127
  };
122
128
 
123
129
  /** Counter of the DAQ events. */