59 vX += ((int( - vX / fDistances[0]) + 1.0 ) * fDistances[0]);
61 else if( vX > fDistances[0] ){
62 vX -= ( int( vX / fDistances[0]) * fDistances[0] );
65 return fVectorEC->
Value(vX);
70 vY += ((int( - vY / fDistances[1]) + 1.0 ) * fDistances[1]);
72 else if( vY > fDistances[1] ){
73 vY -= ( int( vY / fDistances[1]) * fDistances[1] );
75 return fVectorEC2D->
Value((vX),(vY));
83 std::ifstream vFileIn;
84 vFileIn.open(filename);
86 vFileIn >> fPoints[0] >> fPoints[1] >> fPoints[2];
87 vFileIn >> fDistances[0] >> fDistances[1] >> fDistances[2];
89 fDistances[0] *= CLHEP::meter;
90 fDistances[1] *= CLHEP::meter;
91 fDistances[2] *= CLHEP::meter;
97 ed <<
"No Points not found !" <<
G4endl;
98 G4Exception(
"G4ChannelingECHARM::ReadFromECHARM(...)",
104 else if(fPoints[1]==1){
110 G4double stepX = fDistances[0]/fPoints[0];
111 G4double stepY = fDistances[1]/fPoints[1];
112 for(
G4int i1=0;i1<fPoints[1]; i1++){
114 fVectorEC2D->
PutY(i1,i1*stepY);
116 for(
G4int i0=0;i0<fPoints[0]; i0++){
120 vTempX *= vConversion;
121 if(vTempX > fMaximum) {fMaximum = vTempX;}
122 if(vTempX < fMinimum) {fMinimum = vTempX;}
127 fVectorEC2D->
PutValue(i0,i1,vTempX);
128 fVectorEC2D->
PutX(i0,i0*stepX);
132 G4cout <<
"G4ChannelingECHARM::ReadFromECHARM() - " << vConversion <<
" " << fPoints[0] <<
" " << fDistances[0] <<
" " << fPoints[1] <<
" " << fDistances[1] <<
" " << fMinimum <<
" " << fMaximum <<
G4endl;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
G4ChannelingECHARM(const G4String &, G4double)
G4double GetEC(G4ThreeVector &)
virtual void ReadFromECHARM(const G4String &, G4double)
void PutY(std::size_t idy, G4double value)
G4double Value(G4double x, G4double y, std::size_t &lastidx, std::size_t &lastidy) const
void PutValue(std::size_t idx, std::size_t idy, G4double value)
void PutX(std::size_t idx, G4double value)
void PutValue(const std::size_t index, const G4double value)
G4double Value(const G4double energy, std::size_t &lastidx) const