Skip to content

Commit

Permalink
make sure z component is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
cipriangal committed Jul 28, 2017
1 parent c773326 commit 1c1962f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/MollerGlobalMagnetField.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void MollerGlobalMagnetField::InterpolateFieldValue(const G4double Point[4], G4d
myLocalPointInMainMagnet[2] = Point[2]-69.91*cm; // z-pos
myLocalPointInMainMagnet[3] = Point[3]; // time

double beamEscale=1;
G4double beamEscale=1;
if(configuration=="prex2")
beamEscale=2;
// within the radius of the beampipe through the septum, r = 4.128 cm.
Expand All @@ -266,13 +266,15 @@ void MollerGlobalMagnetField::InterpolateFieldValue(const G4double Point[4], G4d
dBydx = interpolate(myLocalPointInMainMagnet[2]/cm)*gauss/cm /beamEscale;
}
}

if((configuration=="prex2" || configuration=="crex") && addQ1fringe){
Bfield[0] += -myLocalPointInMainMagnet[1]*dBydx;
Bfield[1] += -myLocalPointInMainMagnet[0]*dBydx;
}else{
Bfield[0] = -myLocalPointInMainMagnet[1]*dBydx;
Bfield[1] = -myLocalPointInMainMagnet[0]*dBydx;
}
Bfield[2] = 0;
}

G4double MollerGlobalMagnetField::interpolate(G4double val) const
Expand Down

0 comments on commit 1c1962f

Please sign in to comment.