~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to src/legacy/EngModel/Polycone.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:
4
4
//
5
5
 
6
6
#include "EngModel/Polycone.hh"
7
 
#include "Interface/Squeal.hh"
 
7
#include "Utils/Exception.hh"
8
8
#include "Interface/Squeak.hh"
9
9
 
10
10
const double Polycone::_phiStart = 0*degree;
21
21
        std::ifstream fin(fullFileName.c_str());
22
22
        if(!fin)
23
23
        {
24
 
                throw(Squeal(Squeal::nonRecoverable, "Could not find polycone file "+fileName, "Polycone::Polycone(MiceModule)"));
 
24
                throw(MAUS::Exception(MAUS::Exception::nonRecoverable, "Could not find polycone file "+fileName, "Polycone::Polycone(MiceModule)"));
25
25
                return;
26
26
        }
27
27
        Squeak::mout(Squeak::debug) << "LOADING POLYCONE " << fileName << std::endl;
60
60
      for( int vpos = pos; vpos < end; ++vpos )
61
61
        variable += fileName[vpos];
62
62
      if(getenv( variable.c_str() ) == NULL) 
63
 
          throw(Squeal(Squeal::recoverable, "Error - "+variable+" environment variable was not defined", "Polycone::replaceVariables"));
 
63
          throw(MAUS::Exception(MAUS::Exception::recoverable, "Error - "+variable+" environment variable was not defined", "Polycone::replaceVariables"));
64
64
      fullName += std::string( getenv( variable.c_str() ) );
65
65
      pos = end + 1;
66
66
    }
101
101
        fin >> _numberOfCoordinates;
102
102
        //skip rest of line
103
103
        std::getline(fin, key);
104
 
        if(!fin) throw(Squeal(Squeal::nonRecoverable, "Error in polycone input", "Polcone.cc::GetNumberOfCoordinates()"));
 
104
        if(!fin) throw(MAUS::Exception(MAUS::Exception::nonRecoverable, "Error in polycone input", "Polcone.cc::GetNumberOfCoordinates()"));
105
105
}
106
106
 
107
107
void Polycone::GetUnits(std::istream & fin)
114
114
        _units = theUnits.evaluate(unitsString);
115
115
        //skip rest of line
116
116
        std::getline(fin, key);
117
 
        if(!fin) throw(Squeal(Squeal::nonRecoverable, "Error in polycone input", "Polcone.cc::GetUnits()"));
 
117
        if(!fin) throw(MAUS::Exception(MAUS::Exception::nonRecoverable, "Error in polycone input", "Polcone.cc::GetUnits()"));
118
118
}
119
119
 
120
120
void Polycone::GetShellCoordinates(std::istream & fin)
134
134
                _rInner[i]       *= _units;
135
135
                _rOuter[i]       *= _units;
136
136
        }
137
 
        if(!fin) throw(Squeal(Squeal::nonRecoverable, "Error in polycone input", "Polcone.cc::GetShellCoordinates()"));
 
137
        if(!fin) throw(MAUS::Exception(MAUS::Exception::nonRecoverable, "Error in polycone input", "Polcone.cc::GetShellCoordinates()"));
138
138
 
139
139
}
140
140
 
154
154
                _zCoordinates[i] *= _units;
155
155
                _rInner[i]      *= _units;
156
156
        }
157
 
        if(!fin) throw(Squeal(Squeal::nonRecoverable, "Error in polycone input", "Polcone.cc::GetFillCoordinates()"));
 
157
        if(!fin) throw(MAUS::Exception(MAUS::Exception::nonRecoverable, "Error in polycone input", "Polcone.cc::GetFillCoordinates()"));
158
158
}
159
159
 
160
160
G4Polycone * Polycone::GetShell()