~mwinter4/maus/ckov-reco

« back to all changes in this revision

Viewing changes to src/map/MapCppTOFDigits/MapCppTOFDigits.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:
19
19
#include "Utils/JsonWrapper.hh"
20
20
#include "Utils/TOFChannelMap.hh"
21
21
#include "Utils/DAQChannelMap.hh"
22
 
#include "Interface/Squeal.hh"
 
22
#include "Utils/Exception.hh"
23
23
#include "Interface/dataCards.hh"
24
24
 
25
25
#include "src/map/MapCppTOFDigits/MapCppTOFDigits.hh"
26
26
 
 
27
namespace MAUS {
 
28
 
27
29
bool MapCppTOFDigits::birth(std::string argJsonConfigDocument) {
28
30
 
29
31
  _classname = "MapCppTOFDigits";
84
86
    }
85
87
 
86
88
  return true;
87
 
  } catch(Squeal squee) {
88
 
    MAUS::CppErrorHandler::getInstance()->HandleSquealNoJson(squee, _classname);
 
89
  } catch(Exception exc) {
 
90
    MAUS::CppErrorHandler::getInstance()->HandleExceptionNoJson(exc, _classname);
89
91
  } catch(std::exception exc) {
90
92
    MAUS::CppErrorHandler::getInstance()->HandleStdExcNoJson(exc, _classname);
91
93
  }
167
169
        }
168
170
      }
169
171
    }
170
 
  } catch(Squeal squee) {
 
172
  } catch(Exception exc) {
171
173
    root = MAUS::CppErrorHandler::getInstance()
172
 
                                       ->HandleSqueal(root, squee, _classname);
 
174
                                       ->HandleException(root, exc, _classname);
173
175
  } catch(std::exception exc) {
174
176
    root = MAUS::CppErrorHandler::getInstance()
175
177
                                         ->HandleStdExc(root, exc, _classname);
282
284
 
283
285
bool MapCppTOFDigits::getAdc(Json::Value xDocfAdc,
284
286
                             Json::Value xDocTdcHit,
285
 
                             Json::Value &xDocDigit) throw(Squeal) {
 
287
                             Json::Value &xDocDigit) throw(Exception) {
286
288
 
287
289
  int n_Adc_hits = xDocfAdc.size();
288
290
  std::string xTofKey_str = JsonWrapper::GetProperty(xDocDigit,
312
314
      if (!xDocfAdc[AdcHitCount].isMember("charge_pm"))
313
315
          xDocDigit["charge_pm"] = 0;
314
316
      if (xDocDigit["part_event_number"] != xDocfAdc[AdcHitCount]["part_event_number"]) {
315
 
        throw(Squeal(Squeal::recoverable,
 
317
        throw(Exception(Exception::recoverable,
316
318
              std::string("Wrong part_event_number!"),
317
319
              "MapCppTOFDigits::getAdc"));
318
320
      }
319
321
      if (xDocDigit["phys_event_number"] != xDocfAdc[AdcHitCount]["phys_event_number"]) {
320
 
        throw(Squeal(Squeal::recoverable,
 
322
        throw(Exception(Exception::recoverable,
321
323
              std::string("Wrong phys_event_number!"),
322
324
              "MapCppTOFDigits::getAdc"));
323
325
      }
331
333
 
332
334
bool MapCppTOFDigits::getTrig(Json::Value xDocTrig,
333
335
                              Json::Value xDocTdcHit,
334
 
                              Json::Value &xDocDigit ) throw(Squeal) {
 
336
                              Json::Value &xDocDigit ) throw(Exception) {
335
337
  Json::Value xDocT = JsonWrapper::GetProperty(xDocTrig, "V1290", JsonWrapper::arrayValue);
336
338
  int HitGeo = JsonWrapper::GetProperty(xDocTdcHit , "geo", JsonWrapper::intValue).asInt();
337
339
  int n_count = xDocT.size();
351
353
                                                                    JsonWrapper::intValue);
352
354
 
353
355
      if (xDocDigit["part_event_number"] != Trig["part_event_number"]) {
354
 
        throw(Squeal(Squeal::recoverable,
 
356
        throw(Exception(Exception::recoverable,
355
357
              std::string("Wrong part_event_number!"),
356
358
              "MapCppTOFDigits::getTrig"));
357
359
      }
358
360
      if (xDocDigit["phys_event_number"] != Trig["phys_event_number"]) {
359
 
        throw(Squeal(Squeal::recoverable,
 
361
        throw(Exception(Exception::recoverable,
360
362
              std::string("Wrong phys_event_number!"),
361
363
              "MapCppTOFDigits::getTrig"));
362
364
      }
370
372
 
371
373
bool MapCppTOFDigits::getTrigReq(Json::Value xDocTrigReq,
372
374
                                 Json::Value xDocTdcHit,
373
 
                                 Json::Value &xDocDigit ) throw(Squeal) {
 
375
                                 Json::Value &xDocDigit ) throw(Exception) {
374
376
  Json::Value xDocTR = JsonWrapper::GetProperty(xDocTrigReq, "V1290", JsonWrapper::arrayValue);
375
377
  int HitGeo = JsonWrapper::GetProperty(xDocTdcHit, "geo", JsonWrapper::intValue).asInt();
376
378
  int n_req_count = xDocTR.size();
392
394
                                                                            JsonWrapper::intValue);
393
395
 
394
396
      if (xDocDigit["part_event_number"] != TrigReq["part_event_number"]) {
395
 
        throw(Squeal(Squeal::recoverable,
 
397
        throw(Exception(Exception::recoverable,
396
398
              std::string("Wrong part_event_number!"),
397
399
              "MapCppTOFDigits::getTrigReq"));
398
400
      }
399
401
      if (xDocDigit["phys_event_number"] != TrigReq["phys_event_number"]) {
400
 
        throw(Squeal(Squeal::recoverable,
 
402
        throw(Exception(Exception::recoverable,
401
403
              std::string("Wrong phys_event_number!"),
402
404
              "MapCppTOFDigits::getTrigReq"));
403
405
      }
408
410
 
409
411
  return false;
410
412
}
 
413
}