~mwinter4/maus/ckov-reco

« back to all changes in this revision

Viewing changes to src/common_cpp/Utils/TOFChannelMap.cc

  • Committer: Durga Rajaram
  • Date: 2014-01-14 07:07:02 UTC
  • mfrom: (659.1.80 relcand)
  • Revision ID: durga@fnal.gov-20140114070702-2l1fuj1w6rraw7xe
Tags: MAUS-v0.7.6
MAUS-v0.7.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
#include "Utils/TOFChannelMap.hh"
20
20
 
 
21
namespace MAUS {
 
22
 
21
23
TOFChannelMap::~TOFChannelMap() {
22
24
  for (unsigned int i = 0;i < _tofKey.size();i++) {
23
25
    delete _tofKey[i];
81
83
      _tdcKey.push_back(tdckey);
82
84
      _fadcKey.push_back(fadckey);
83
85
    }
84
 
  } catch(Squeal e) {
 
86
  } catch(Exception e) {
85
87
    Squeak::mout(Squeak::error)
86
88
    << "Error in TOFChannelMap::InitFromFile : Error during loading." << std::endl
87
89
    << e.GetMessage() << std::endl;
112
114
      _tdcKey.push_back(tdckey);
113
115
      _fadcKey.push_back(fadckey);
114
116
    }
115
 
  } catch(Squeal e) {
 
117
  } catch(Exception e) {
116
118
    Squeak::mout(Squeak::error)
117
119
    << "Error in TOFChannelMap::InitFromCDB : Error during loading." << std::endl
118
120
    << e.GetMessage() << std::endl;
155
157
  try {
156
158
    xConv << daqKeyStr;
157
159
    xConv >> xDaqKey;
158
 
  }catch(Squeal e) {
159
 
    throw(Squeal(Squeal::recoverable,
 
160
  }catch(Exception e) {
 
161
    throw(Exception(Exception::recoverable,
160
162
                 std::string("corrupted DAQ Channel Key"),
161
163
                 "TOFChannelMap::find(std::string)"));
162
164
  }
170
172
  try {
171
173
    xConv << tdcKeyStr;
172
174
    xConv >> xDaqKey;
173
 
  }catch(Squeal e) {
174
 
    throw(Squeal(Squeal::recoverable,
 
175
  }catch(Exception e) {
 
176
    throw(Exception(Exception::recoverable,
175
177
                 std::string("corrupted DAQ Channel Key"),
176
178
                 "TOFChannelMap::findfAdcKey(std::string)"));
177
179
  }
192
194
  try {
193
195
    xConv << adcKeyStr;
194
196
    xConv >> xDaqKey;
195
 
  }catch(Squeal e) {
196
 
    throw(Squeal(Squeal::recoverable,
 
197
  }catch(Exception e) {
 
198
    throw(Exception(Exception::recoverable,
197
199
                 std::string("corrupted DAQ Channel Key"),
198
200
                 "TOFChannelMap::findTdcKey(std::string)"));
199
201
  }
210
212
 
211
213
//////////////////////////////////////////////////////////////////////////
212
214
 
213
 
TOFChannelKey::TOFChannelKey(string keyStr) throw(Squeal) {
 
215
TOFChannelKey::TOFChannelKey(string keyStr) throw(Exception) {
214
216
  std::stringstream xConv;
215
217
  try {
216
218
    xConv << keyStr;
217
219
    xConv >> (*this);
218
 
  }catch(Squeal e) {
219
 
    throw(Squeal(Squeal::recoverable,
 
220
  }catch(Exception e) {
 
221
    throw(Exception(Exception::recoverable,
220
222
                 std::string("corrupted TOF Channel Key"),
221
223
                 "TOFChannelKey::TOFChannelKey(std::string)"));
222
224
  }
288
290
  return stream;
289
291
}
290
292
 
291
 
istream& operator>>( istream& stream, TOFChannelKey &key ) throw(Squeal) {
 
293
istream& operator>>( istream& stream, TOFChannelKey &key ) throw(Exception) {
292
294
  string xLabel;
293
295
  stream >> xLabel >> key._station >> key._plane >> key._slab >> key._pmt >> key._detector;
294
296
 
295
297
  if (xLabel != "TOFChannelKey") {
296
 
    throw(Squeal(Squeal::recoverable,
 
298
    throw(Exception(Exception::recoverable,
297
299
                 std::string("corrupted TOF Channel Key"),
298
300
                 "istream& operator>>(istream& stream, TOFChannelKey)"));
299
301
  }
354
356
  std::cout << "Building" << std::endl;
355
357
  if (py_arg == NULL) {
356
358
    PyErr_Clear();
357
 
    throw(Squeal(Squeal::recoverable,
 
359
    throw(Exception(Exception::recoverable,
358
360
              "Failed to resolve arguments to get_cabling",
359
361
              "MAUSEvaluator::evaluate"));
360
362
    }
367
369
    if (py_value == NULL) {
368
370
        PyErr_Clear();
369
371
        Py_XDECREF(py_arg);
370
 
        throw(Squeal(Squeal::recoverable,
 
372
        throw(Exception(Exception::recoverable,
371
373
                     "Failed to parse argument "+devname,
372
374
                     "GetCabling::get_cabling"));
373
375
    }
375
377
    Py_XDECREF(py_value);
376
378
    Py_XDECREF(py_arg);
377
379
}
378
 
 
 
380
}