~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to src/legacy/Interface/MiceMaterials.cc

  • 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:
15
15
 
16
16
#include "Geant4/G4Material.hh"
17
17
#include "Interface/MiceMaterials.hh"
18
 
#include "Interface/Squeal.hh"
 
18
#include "Utils/Exception.hh"
19
19
#include "CLHEP/Units/SystemOfUnits.h"
20
20
using CLHEP::mm;
21
21
using CLHEP::cm2;
34
34
{
35
35
  if( noG4 )
36
36
  {
37
 
    if(getenv( "MICEFILES" ) == NULL) throw(Squeal(Squeal::recoverable, "Error - MICEFILES environment variable was not defined", "MiceMaterials::MiceMaterials"));
38
 
    if(getenv( "COMPILER" )  == NULL) throw(Squeal(Squeal::recoverable, "Error - COMPILER environment variable was not defined",  "MiceMaterials::MiceMaterials"));
39
 
    if(getenv( "G4VERS" )    == NULL) throw(Squeal(Squeal::recoverable, "Error - G4VERS environment variable was not defined",    "MiceMaterials::MiceMaterials"));
 
37
    if(getenv( "MICEFILES" ) == NULL) throw(MAUS::Exception(MAUS::Exception::recoverable, "Error - MICEFILES environment variable was not defined", "MiceMaterials::MiceMaterials"));
 
38
    if(getenv( "COMPILER" )  == NULL) throw(MAUS::Exception(MAUS::Exception::recoverable, "Error - COMPILER environment variable was not defined",  "MiceMaterials::MiceMaterials"));
 
39
    if(getenv( "G4VERS" )    == NULL) throw(MAUS::Exception(MAUS::Exception::recoverable, "Error - G4VERS environment variable was not defined",    "MiceMaterials::MiceMaterials"));
40
40
    std::string fname = std::string( getenv( "MICEFILES" ) ) + "/Models/Materials/micematerials_" 
41
41
                      + std::string( getenv( "COMPILER" ) ) + "_"
42
42
                      + std::string( getenv( "G4VERS" ) ) + ".txt";
145
145
G4Material* MiceMaterials::materialByName( std::string mat ) const
146
146
{
147
147
  if ( _materials.find( mat ) == _materials.end() ) {
148
 
    throw(Squeal(Squeal::recoverable, "Unable to find material "+mat, "MiceMaterials::materialByName") );
 
148
    throw(MAUS::Exception(MAUS::Exception::recoverable, "Unable to find material "+mat, "MiceMaterials::materialByName") );
149
149
  }
150
150
  G4Material* matter = _materials.find( mat )->second;
151
151
 
152
152
  if( ! matter ) // can't find this material!
153
153
  {
154
 
    throw(Squeal(Squeal::recoverable, "Unable to find material "+mat, "MiceMaterials::materialByName") );
 
154
    throw(MAUS::Exception(MAUS::Exception::recoverable, "Unable to find material "+mat, "MiceMaterials::materialByName") );
155
155
    matter = _materials.find( "Galactic" )->second;
156
156
  }
157
157