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;}
124 fVectorEC->PutValue(i0,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;