~m-a-uchida/maus/RKdEdxDevel

« back to all changes in this revision

Viewing changes to src/map/MapCppTOFMCDigitizer/MapCppTOFMCDigitizer.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 <string>
20
20
#include "src/common_cpp/Utils/TOFChannelMap.hh"
21
21
#include "Config/MiceModule.hh"
22
 
#include "Interface/Squeal.hh"
 
22
#include "Utils/Exception.hh"
 
23
 
 
24
namespace MAUS {
23
25
 
24
26
//////////////////////////////////////////////////////////////////////
25
27
bool MapCppTOFMCDigitizer::birth(std::string argJsonConfigDocument) {
38
40
 
39
41
  // get the geometry
40
42
  if (!_configJSON.isMember("reconstruction_geometry_filename"))
41
 
      throw(Squeal(Squeal::recoverable,
 
43
      throw(Exception(Exception::recoverable,
42
44
                   "Could not find geometry file",
43
45
                   "MapCppTOFMCDigitizer::birth"));
44
46
  std::string filename;
135
137
 
136
138
      // make sure we can get the station/slab info
137
139
      if (!hit.isMember("channel_id"))
138
 
          throw(Squeal(Squeal::recoverable,
 
140
          throw(Exception(Exception::recoverable,
139
141
                       "No channel_id in hit",
140
142
                       "MapCppTOFMCDigitizer::make_tof_digits"));
141
143
      if (!hit.isMember("momentum"))
142
 
          throw(Squeal(Squeal::recoverable,
 
144
          throw(Exception(Exception::recoverable,
143
145
                       "No momentum in hit",
144
146
                       "MapCppTOFMCDigitizer::make_tof_digits"));
145
147
      if (!hit.isMember("time"))
146
 
          throw(Squeal(Squeal::recoverable,
 
148
          throw(Exception(Exception::recoverable,
147
149
                       "No time in hit",
148
150
                       "MapCppTOFMCDigitizer::make_tof_digits"));
149
151
      Json::Value channel_id = hit["channel_id"];
150
152
 
151
153
      if (!hit.isMember("energy_deposited"))
152
 
          throw(Squeal(Squeal::recoverable,
 
154
          throw(Exception(Exception::recoverable,
153
155
                       "No energy_deposited in hit",
154
156
                       "MapCppTOFMCDigitizer::make_tof_digits"));
155
157
      double edep = hit["energy_deposited"].asDouble();
191
193
 
192
194
      // make sure we actually found a tof module corresponding to this hit
193
195
      if (hit_module == NULL)
194
 
          throw(Squeal(Squeal::recoverable,
 
196
          throw(Exception(Exception::recoverable,
195
197
                       "No TOF module for hit",
196
198
                       "MapCppTOFMCDigitizer::make_tof_digits"));
197
199
 
344
346
      if (fDebug) std::cout << "get_npe::edep= " << edep << std::endl;
345
347
 
346
348
      if (!_configJSON.isMember("TOFattenuationLength"))
347
 
          throw(Squeal(Squeal::recoverable,
 
349
          throw(Exception(Exception::recoverable,
348
350
                "Could not find TOFattenauationLength in config",
349
351
                "MapCppTOFMCDigitizer::get_npe"));
350
352
      if (!_configJSON.isMember("reconstruction_geometry_filename"))
351
 
          throw(Squeal(Squeal::recoverable,
 
353
          throw(Exception(Exception::recoverable,
352
354
                "Could not find TOFpmtQuantumEfficiency in config",
353
355
                "MapCppTOFMCDigitizer::get_npe"));
354
356
      if (!_configJSON.isMember("TOFconversionFactor"))
355
 
          throw(Squeal(Squeal::recoverable,
 
357
          throw(Exception(Exception::recoverable,
356
358
                       "Could not find TOFconversionFactor in config",
357
359
                       "MapCppTOFMCDigitizer::birth"));
358
360
      if (fDebug)
525
527
  }
526
528
}
527
529
//=====================================================================
 
530
}