GridImpl Class Reference

Inheritance diagram for GridImpl:

FieldMapImpl

List of all members.


Detailed Description

class GridImpl -- class for a Grid FieldMap implementation

Public Member Functions

 GridImpl (BLArgumentVector &argv, BLArgumentMap &namedArgs)
 ~GridImpl ()
void getFieldValue (const G4double local[4], G4double field[6]) const
bool handleCommand (InputFile &in, BLArgumentVector &argv, BLArgumentMap &namedArgs)
virtual void getBoundingPoint (int i, G4double point[4])
virtual bool hasB ()
virtual bool hasE ()
int bits (G4String s)
const char * bits2str (int v)
bool setField (G4double X, G4double Y, G4double Z, G4double Bx, G4double By, G4double Bz, G4double Ex, G4double Ey, G4double Ez, int linenumber)
virtual bool writeFile (FILE *f)

Private Attributes

G4int nX
G4int nY
G4int nZ
G4double dX
G4double dY
G4double dZ
G4double X0
G4double Y0
G4double Z0
G4double tolerance
float * mapBx
float * mapBy
float * mapBz
float * mapEx
float * mapEy
float * mapEz
bool extendX
bool extendY
bool extendZ
int extendXbits
int extendYbits
int extendZbits

Constructor & Destructor Documentation

GridImpl::GridImpl ( BLArgumentVector argv,
BLArgumentMap namedArgs 
)

References argDouble(), argInt(), dX, dY, dZ, extendX, extendXbits, extendY, extendYbits, extendZ, extendZbits, mapBx, mapBy, mapBz, mapEx, mapEy, mapEz, nX, nY, nZ, tolerance, X0, Y0, and Z0.

00568                                                         : FieldMapImpl()
00569 {
00570         nX = 2;
00571         nY = 2;
00572         nZ = 2;
00573         dX = 10.0*mm;
00574         dY = 10.0*mm;
00575         dZ = 10.0*mm;
00576         X0 = 0.0;
00577         Y0 = 0.0;
00578         Z0 = 0.0;
00579         tolerance = 0.01*mm;
00580         mapBx = 0;
00581         mapBy = 0;
00582         mapBz = 0;
00583         mapEx = 0;
00584         mapEy = 0;
00585         mapEz = 0;
00586         extendX = false;
00587         extendY = false;
00588         extendZ = false;
00589         extendXbits = 0;
00590         extendYbits = 0;
00591         extendZbits = 0;
00592         argInt(nX,"nX",namedArgs);
00593         argInt(nY,"nY",namedArgs);
00594         argInt(nZ,"nZ",namedArgs);
00595         argDouble(dX,"dX",namedArgs);
00596         argDouble(dY,"dY",namedArgs);
00597         argDouble(dZ,"dZ",namedArgs);
00598         argDouble(X0,"X0",namedArgs);
00599         argDouble(Y0,"Y0",namedArgs);
00600         argDouble(Z0,"Z0",namedArgs);
00601         argDouble(tolerance,"tolerance",namedArgs);
00602 }

GridImpl::~GridImpl (  ) 

References mapBx, mapBy, mapBz, mapEx, mapEy, and mapEz.

00605 {
00606         if(mapBx) delete mapBx;
00607         if(mapBy) delete mapBy;
00608         if(mapBz) delete mapBz;
00609         if(mapEx) delete mapEx;
00610         if(mapEy) delete mapEy;
00611         if(mapEz) delete mapEz;
00612 }


Member Function Documentation

void GridImpl::getFieldValue ( const G4double  local[4],
G4double  field[6] 
) const [virtual]

Implements FieldMapImpl.

References BLAssert, COMPONENT, dX, dY, dZ, extendX, extendXbits, extendY, extendYbits, extendZ, extendZbits, mapBx, mapBy, mapBz, mapEx, mapEy, mapEz, nX, nY, nZ, X0, Y0, and Z0.

00616 {
00617         G4double x = local[0];
00618         G4double y = local[1];
00619         G4double z = local[2];
00620 
00621         x -= X0;
00622         y -= Y0;
00623         z -= Z0;
00624 
00625         G4double factor[6];
00626         factor[0]=factor[1]=factor[2]=factor[3]=factor[4]=factor[5]=1.0;
00627         if(extendX && x < 0.0) {
00628                 x = -x;
00629                 for(int i=0; i<6; ++i) {
00630                         if(extendXbits & (1<<i)) factor[i] = -factor[i];
00631                 }
00632         }
00633         if(extendY && y < 0.0) {
00634                 y = -y;
00635                 for(int i=0; i<6; ++i) {
00636                         if(extendYbits & (1<<i)) factor[i] = -factor[i];
00637                 }
00638         }
00639         if(extendZ && z < 0.0) {
00640                 z = -z;
00641                 for(int i=0; i<6; ++i) {
00642                         if(extendZbits & (1<<i)) factor[i] = -factor[i];
00643                 }
00644         }
00645 
00646         // We compute a 3D linear average of the 8 surrounding points in the map
00647         // First, get the X,Y,Z indices into i,j,k
00648         int i = (int)floor(x/dX);
00649         int j = (int)floor(y/dY);
00650         int k = (int)floor(z/dZ);
00651         if(i < 0 || i >= nX-1 || j < 0 || j >= nY-1 || k < 0 || k >= nZ-1) {
00652                 field[0] = field[1] = field[2] = field[3] = field[4] = 
00653                                                                 field[5] = 0.0;
00654                 return;
00655         }
00656         // m is the initial index (corner of the cube with minimum X, Y, and Z)
00657         int m = k*nY*nX + j*nX + i;
00658         BLAssert(m+nY*nX+nX+1 < nX*nY*nZ);
00659 
00660         // now compute the fractional weighting factors for X, Y, and Z
00661         float fx = 1.0 - (x - i*dX) / dX;
00662         BLAssert(fx >= 0.0 && fx <= 1.0);
00663         float fy = 1.0 - (y - j*dY) / dY;
00664         BLAssert(fy >= 0.0 && fy <= 1.0);
00665         float fz = 1.0 - (z - k*dZ) / dZ;
00666         BLAssert(fz >= 0.0 && fz <= 1.0);
00667 
00668         // now compute the fractional weighting factors for the 8 corners
00669         float f0 = fx*fy*fz;
00670         float f1 = (1.0-fx)*fy*fz;
00671         float f2 = fx*(1.0-fy)*fz;
00672         float f3 = (1.0-fx)*(1.0-fy)*fz;
00673         float f4 = fx*fy*(1.0-fz);
00674         float f5 = (1.0-fx)*fy*(1.0-fz);
00675         float f6 = fx*(1.0-fy)*(1.0-fz);
00676         float f7 = (1.0-fx)*(1.0-fy)*(1.0-fz);
00677 
00678         // Finally, compute the components of the field
00679 #define COMPONENT(C)                                            \
00680         G4double C = 0.0;                                       \
00681         if(map##C) C =  map##C[m]*f0 + map##C[m+1]*f1 +         \
00682                 map##C[m+nX]*f2 + map##C[m+nX+1]*f3 +           \
00683                 map##C[m+nY*nX]*f4 + map##C[m+nY*nX+1]*f5 +     \
00684                 map##C[m+nY*nX+nX]*f6 + map##C[m+nY*nX+nX+1]*f7;
00685         COMPONENT(Bx);
00686         COMPONENT(By);
00687         COMPONENT(Bz);
00688         COMPONENT(Ex);
00689         COMPONENT(Ey);
00690         COMPONENT(Ez);
00691 
00692 #ifdef STUB
00693         G4double Bx = 0.0;
00694         if(mapBx) Bx =
00695                 mapBx[m]*fx*fy*fz +
00696                 mapBx[m+1]*(1.0-fx)*fy*fz +
00697                 mapBx[m+nX]*fx*(1.0-fy)*fz +
00698                 mapBx[m+nX+1]*(1.0-fx)*(1.0-fy)*fz +
00699                 mapBx[m+nY*nX]*fx*fy*(1.0-fz) +
00700                 mapBx[m+nY*nX+1]*(1.0-fx)*fy*(1.0-fz) +
00701                 mapBx[m+nY*nX+nX]*fx*(1.0-fy)*(1.0-fz) +
00702                 mapBx[m+nY*nX+nX+1]*(1.0-fx)*(1.0-fy)*(1.0-fz);
00703         G4double By = 0.0;
00704         if(mapBy) By =
00705                 mapBy[m]*fx*fy*fz +
00706                 mapBy[m+1]*(1.0-fx)*fy*fz +
00707                 mapBy[m+nX]*fx*(1.0-fy)*fz +
00708                 mapBy[m+nX+1]*(1.0-fx)*(1.0-fy)*fz +
00709                 mapBy[m+nY*nX]*fx*fy*(1.0-fz) +
00710                 mapBy[m+nY*nX+1]*(1.0-fx)*fy*(1.0-fz) +
00711                 mapBy[m+nY*nX+nX]*fx*(1.0-fy)*(1.0-fz) +
00712                 mapBy[m+nY*nX+nX+1]*(1.0-fx)*(1.0-fy)*(1.0-fz);
00713         G4double Bz = 0.0;
00714         if(mapBz) Bz =
00715                 mapBz[m]*fx*fy*fz +
00716                 mapBz[m+1]*(1.0-fx)*fy*fz +
00717                 mapBz[m+nX]*fx*(1.0-fy)*fz +
00718                 mapBz[m+nX+1]*(1.0-fx)*(1.0-fy)*fz +
00719                 mapBz[m+nY*nX]*fx*fy*(1.0-fz) +
00720                 mapBz[m+nY*nX+1]*(1.0-fx)*fy*(1.0-fz) +
00721                 mapBz[m+nY*nX+nX]*fx*(1.0-fy)*(1.0-fz) +
00722                 mapBz[m+nY*nX+nX+1]*(1.0-fx)*(1.0-fy)*(1.0-fz);
00723 
00724         G4double Ex = 0.0;
00725         if(mapEx) Ex =
00726                 mapEx[m]*fx*fy*fz +
00727                 mapEx[m+1]*(1.0-fx)*fy*fz +
00728                 mapEx[m+nX]*fx*(1.0-fy)*fz +
00729                 mapEx[m+nX+1]*(1.0-fx)*(1.0-fy)*fz +
00730                 mapEx[m+nY*nX]*fx*fy*(1.0-fz) +
00731                 mapEx[m+nY*nX+1]*(1.0-fx)*fy*(1.0-fz) +
00732                 mapEx[m+nY*nX+nX]*fx*(1.0-fy)*(1.0-fz) +
00733                 mapEx[m+nY*nX+nX+1]*(1.0-fx)*(1.0-fy)*(1.0-fz);
00734         G4double Ey = 0.0;
00735         if(mapEy) Ey =
00736                 mapEy[m]*fx*fy*fz +
00737                 mapEy[m+1]*(1.0-fx)*fy*fz +
00738                 mapEy[m+nX]*fx*(1.0-fy)*fz +
00739                 mapEy[m+nX+1]*(1.0-fx)*(1.0-fy)*fz +
00740                 mapEy[m+nY*nX]*fx*fy*(1.0-fz) +
00741                 mapEy[m+nY*nX+1]*(1.0-fx)*fy*(1.0-fz) +
00742                 mapEy[m+nY*nX+nX]*fx*(1.0-fy)*(1.0-fz) +
00743                 mapEy[m+nY*nX+nX+1]*(1.0-fx)*(1.0-fy)*(1.0-fz);
00744         G4double Ez = 0.0;
00745         if(mapEz) Ez =
00746                 mapEz[m]*fx*fy*fz +
00747                 mapEz[m+1]*(1.0-fx)*fy*fz +
00748                 mapEz[m+nX]*fx*(1.0-fy)*fz +
00749                 mapEz[m+nX+1]*(1.0-fx)*(1.0-fy)*fz +
00750                 mapEz[m+nY*nX]*fx*fy*(1.0-fz) +
00751                 mapEz[m+nY*nX+1]*(1.0-fx)*fy*(1.0-fz) +
00752                 mapEz[m+nY*nX+nX]*fx*(1.0-fy)*(1.0-fz) +
00753                 mapEz[m+nY*nX+nX+1]*(1.0-fx)*(1.0-fy)*(1.0-fz);
00754 #endif //STUB
00755 
00756         field[0] = Bx * factor[0];
00757         field[1] = By * factor[1];
00758         field[2] = Bz * factor[2];
00759         field[3] = Ex * factor[3];
00760         field[4] = Ey * factor[4];
00761         field[5] = Ez * factor[5];
00762 }

bool GridImpl::handleCommand ( InputFile in,
BLArgumentVector argv,
BLArgumentMap namedArgs 
) [virtual]

Implements FieldMapImpl.

References bits(), extendX, extendXbits, extendY, extendYbits, extendZ, extendZbits, InputFile::getline(), InputFile::linenumber(), BLCommand::printError(), InputFile::repeatLine(), and setField().

00766 {
00767         if(argv[0] == "extendX") {
00768                 extendX = true;
00769                 extendXbits = bits(namedArgs["flip"]);
00770                 return true;
00771         } else if(argv[0] == "extendY") {
00772                 extendY = true;
00773                 extendYbits = bits(namedArgs["flip"]);
00774                 return true;
00775         } else if(argv[0] == "extendZ") {
00776                 extendZ = true;
00777                 extendZbits = bits(namedArgs["flip"]);
00778                 return true;
00779         } else if(argv[0] == "Bx") {
00780                 BLCommand::printError("BLFieldMap: Bx not implemented");
00781                 return true;
00782         } else if(argv[0] == "By") {
00783                 BLCommand::printError("BLFieldMap: By not implemented");
00784                 return true;
00785         } else if(argv[0] == "Bz") {
00786                 BLCommand::printError("BLFieldMap: Bz not implemented");
00787                 return true;
00788         } else if(argv[0] == "Ex") {
00789                 BLCommand::printError("BLFieldMap: Ex not implemented");
00790                 return true;
00791         } else if(argv[0] == "Ey") {
00792                 BLCommand::printError("BLFieldMap: Ey not implemented");
00793                 return true;
00794         } else if(argv[0] == "Ez") {
00795                 BLCommand::printError("BLFieldMap: Ez not implemented");
00796                 return true;
00797         } else if(argv[0] == "data") {
00798                 for(char *line=0; (line=in.getline())!=0; ) {
00799                         if(isalpha(line[0])) {
00800                                 in.repeatLine();
00801                                 break;
00802                         }
00803                         int n;
00804                         float X=0.0,Y=0.0,Z=0.0,Bx=0.0,By=0.0,Bz=0.0,
00805                                                         Ex=0.0,Ey=0.0,Ez=0.0;
00806                         for(char *p=line; (p=strchr(p,','))!=0;) *p = ' ';
00807                         n = sscanf(line,"%f%f%f%f%f%f%f%f%f",&X,&Y,&Z,
00808                                                 &Bx,&By,&Bz,&Ex,&Ey,&Ez);
00809                         if(n <= 3) {
00810                                 BLCommand::printError("BLFieldMap: invalid line %d\n",in.linenumber());
00811                                 continue;
00812                         }
00813                         setField(X,Y,Z,Bx*tesla,By*tesla,Bz*tesla,
00814                                 Ex*megavolt/meter,Ey*megavolt/meter,
00815                                 Ez*megavolt/meter,in.linenumber());
00816                 }
00817                 return true;
00818         } else {
00819                 return false;
00820         }
00821 }

void GridImpl::getBoundingPoint ( int  i,
G4double  point[4] 
) [virtual]

Implements FieldMapImpl.

References dX, dY, dZ, extendX, extendY, extendZ, nX, nY, nZ, X0, Y0, and Z0.

00824 {
00825         if(extendX)
00826                 point[0] = (i&1 ? -(nX-1)*dX : (nX-1)*dX) + X0;
00827         else
00828                 point[0] = (i&1 ? 0.0 : (nX-1)*dX) + X0;
00829         if(extendY)
00830                 point[1] = (i&2 ? -(nY-1)*dY : (nY-1)*dY) + Y0;
00831         else
00832                 point[1] = (i&2 ? 0.0 : (nY-1)*dY) + Y0;
00833         if(extendZ)
00834                 point[2] = (i&4 ? -(nZ-1)*dZ : (nZ-1)*dZ) + Z0;
00835         else
00836                 point[2] = (i&4 ? 0.0 : (nZ-1)*dZ) + Z0;
00837 }

virtual bool GridImpl::hasB (  )  [inline, virtual]

Implements FieldMapImpl.

References mapBx, mapBy, and mapBz.

00132 { return mapBx!=0 || mapBy!=0 || mapBz!=0; }

virtual bool GridImpl::hasE (  )  [inline, virtual]

Implements FieldMapImpl.

References mapEx, mapEy, and mapEz.

Referenced by writeFile().

00133 { return mapEx!=0 || mapEy!=0 || mapEz!=0; }

int GridImpl::bits ( G4String  s  ) 

Referenced by handleCommand().

00840 {
00841         int v=0;
00842         if(s.find("Bx") < s.size()) v |= 1;
00843         if(s.find("By") < s.size()) v |= 2;
00844         if(s.find("Bz") < s.size()) v |= 4;
00845         if(s.find("Ex") < s.size()) v |= 8;
00846         if(s.find("Ey") < s.size()) v |= 16;
00847         if(s.find("Ez") < s.size()) v |= 32;
00848         return v;
00849 }

const char * GridImpl::bits2str ( int  v  ) 

Referenced by writeFile().

00852 {
00853         static char retval[32];
00854         retval[0] = '\0';
00855         if(v & 1) strcat(retval,"Bx,");
00856         if(v & 2) strcat(retval,"By,");
00857         if(v & 4) strcat(retval,"Bz,");
00858         if(v & 8) strcat(retval,"Ex,");
00859         if(v & 16) strcat(retval,"Ey,");
00860         if(v & 32) strcat(retval,"Ez,");
00861         return retval;
00862 }

bool GridImpl::setField ( G4double  X,
G4double  Y,
G4double  Z,
G4double  Bx,
G4double  By,
G4double  Bz,
G4double  Ex,
G4double  Ey,
G4double  Ez,
int  linenumber 
)

References BLAssert, dX, dY, dZ, mapBx, mapBy, mapBz, mapEx, mapEy, mapEz, nX, nY, nZ, BLCommand::printError(), tolerance, X0, Y0, and Z0.

Referenced by BLFieldMap::createGridMap(), and handleCommand().

00867 {
00868         if(!mapBx && Bx != 0.0) {
00869                 mapBx = new float[nX*nY*nZ];
00870                 BLAssert(mapBx != 0);
00871                 for(int i=0; i<nX*nY*nZ; ++i) 
00872                         mapBx[i] = 0.0;
00873         }
00874         if(!mapBy && By != 0.0) {
00875                 mapBy = new float[nX*nY*nZ];
00876                 BLAssert(mapBy != 0);
00877                 for(int i=0; i<nX*nY*nZ; ++i) 
00878                         mapBy[i] = 0.0;
00879         }
00880         if(!mapBz && Bz != 0.0) {
00881                 mapBz = new float[nX*nY*nZ];
00882                 BLAssert(mapBz != 0);
00883                 for(int i=0; i<nX*nY*nZ; ++i) 
00884                         mapBz[i] = 0.0;
00885         }
00886         if(!mapEx && Ex != 0.0) {
00887                 mapEx = new float[nX*nY*nZ];
00888                 BLAssert(mapEx != 0);
00889                 for(int i=0; i<nX*nY*nZ; ++i) 
00890                         mapEx[i] = 0.0;
00891         }
00892         if(!mapEy && Ey != 0.0) {
00893                 mapEy = new float[nX*nY*nZ];
00894                 BLAssert(mapEy != 0);
00895                 for(int i=0; i<nX*nY*nZ; ++i) 
00896                         mapEy[i] = 0.0;
00897         }
00898         if(!mapEz && Ez != 0.0) {
00899                 mapEz = new float[nX*nY*nZ];
00900                 BLAssert(mapEz != 0);
00901                 for(int i=0; i<nX*nY*nZ; ++i) 
00902                         mapEz[i] = 0.0;
00903         }
00904         X -= X0;
00905         Y -= Y0;
00906         Z -= Z0;
00907         int i = (int)floor((X/dX) + 0.5);
00908         if(i<0 || fabs(i*dX-X)>tolerance || i >= nX) {
00909                 BLCommand::printError("BLFieldMap: ERROR point off"
00910                         " grid  X=%.2f line=%d\n",X, linenumber);
00911                 return false;
00912         }
00913         int j = (int)floor((Y/dY) + 0.5);
00914         if(j<0 || fabs(j*dY-Y)>tolerance || j >= nY) {
00915                 BLCommand::printError("BLFieldMap: ERROR point off"
00916                         " grid Y=%.2f line=%d\n",Y, linenumber);
00917                 return false;
00918         }
00919         int k = (int)floor((Z/dZ) + 0.5);
00920         if(k<0 || fabs(k*dZ-Z)>tolerance || k >= nZ) {
00921                 BLCommand::printError("BLFieldMap: ERROR point off"
00922                         " grid X=%.2f line=%d\n",Z, linenumber);
00923                 return false;
00924         }
00925         int m = k*nY*nX + j*nX + i;
00926         BLAssert(m >= 0 && m < nX*nY*nZ);
00927         if(mapBx) mapBx[m] = Bx;
00928         if(mapBy) mapBy[m] = By;
00929         if(mapBz) mapBz[m] = Bz;
00930         if(mapEx) mapEx[m] = Ex;
00931         if(mapEy) mapEy[m] = Ey;
00932         if(mapEz) mapEz[m] = Ez;
00933 
00934         return true;
00935 }

bool GridImpl::writeFile ( FILE *  f  )  [virtual]

Implements FieldMapImpl.

References bits2str(), BLAssert, dX, dY, dZ, extendX, extendXbits, extendY, extendYbits, extendZ, extendZbits, hasE(), mapBx, mapBy, mapBz, mapEx, mapEy, mapEz, nX, nY, nZ, X0, Y0, and Z0.

00938 {
00939         fprintf(f,"grid X0=%g Y0=%g Z0=%g nX=%d nY=%d nZ=%d dX=%g dY=%g dZ=%g\n",
00940                 X0,Y0,Z0,nX,nY,nZ,dX,dY,dZ);
00941         if(extendX) fprintf(f,"extendX flip=%s\n",bits2str(extendXbits));
00942         if(extendY) fprintf(f,"extendY flip=%s\n",bits2str(extendYbits));
00943         if(extendZ) fprintf(f,"extendZ flip=%s\n",bits2str(extendZbits));
00944         fprintf(f,"data\n");
00945 
00946         for(int i=0; i<nX; ++i) {
00947                 G4double X = X0 + i*dX;
00948                 for(int j=0; j<nY; ++j) {
00949                         G4double Y = Y0 + j*dY;
00950                         for(int k=0; k<nZ; ++k) {
00951                                 G4double Z = Z0 + k*dZ;
00952                                 int m = k*nY*nX + j*nX + i;
00953                                 BLAssert(m >= 0 && m < nX*nY*nZ);
00954                                 G4double Bx = (mapBx ? mapBx[m] : 0.0);
00955                                 G4double By = (mapBy ? mapBy[m] : 0.0);
00956                                 G4double Bz = (mapBz ? mapBz[m] : 0.0);
00957                                 fprintf(f,"%.1f %.1f %.1f %g %g %g",
00958                                         X,Y,Z,Bx/tesla,By/tesla,Bz/tesla);
00959                                 if(hasE()) {
00960                                         G4double Ex = (mapEx ? mapEx[m] : 0.0);
00961                                         G4double Ey = (mapEy ? mapEy[m] : 0.0);
00962                                         G4double Ez = (mapEz ? mapEz[m] : 0.0);
00963                                         fprintf(f," %g %g %g",
00964                                                 Ex/(megavolt/meter),
00965                                                 Ey/(megavolt/meter),
00966                                                 Ez/(megavolt/meter));
00967                                 }
00968                                 fprintf(f,"\n");
00969                         }
00970                 }
00971         }
00972         return true;
00973 }


Member Data Documentation

G4int GridImpl::nX [private]

G4int GridImpl::nY [private]

G4int GridImpl::nZ [private]

G4double GridImpl::dX [private]

G4double GridImpl::dY [private]

G4double GridImpl::dZ [private]

G4double GridImpl::X0 [private]

G4double GridImpl::Y0 [private]

G4double GridImpl::Z0 [private]

G4double GridImpl::tolerance [private]

Referenced by GridImpl(), and setField().

float* GridImpl::mapBx [private]

float* GridImpl::mapBy [private]

float* GridImpl::mapBz [private]

float* GridImpl::mapEx [private]

float* GridImpl::mapEy [private]

float* GridImpl::mapEz [private]

bool GridImpl::extendX [private]

bool GridImpl::extendY [private]

bool GridImpl::extendZ [private]

int GridImpl::extendXbits [private]

int GridImpl::extendYbits [private]

int GridImpl::extendZbits [private]


The documentation for this class was generated from the following file:
g4beamline