~mbogomilov/maus/devel3

« back to all changes in this revision

Viewing changes to src/legacy/Interface/MiceMaterials.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:
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