20#include "BDSException.hh"
21#include "BDSModulatorSinT.hh"
23#include "CLHEP/Units/PhysicalConstants.h"
24#include "CLHEP/Units/SystemOfUnits.h"
29BDSModulatorSinT::BDSModulatorSinT(G4double frequencyIn,
31 G4double amplitudeOffsetIn,
32 G4double amplitudeScaleIn):
33 angularFrequency(CLHEP::twopi * frequencyIn),
35 offset(amplitudeOffsetIn),
36 scale(amplitudeScaleIn)
39 {
throw BDSException(__METHOD_NAME__,
"\frequency\" must be >= 0");}
45 G4double factor = offset + scale*std::sin(angularFrequency*T + phase);
51 if (angularFrequency == 0)
52 {
return std::numeric_limits<double>::max();}
55 G4double wavelength = CLHEP::twopi * CLHEP::c_light / angularFrequency;
56 return wavelength / 20;
General exception with possible name of object and message.
virtual G4double Factor(const G4ThreeVector &xyz, G4double T) const
Returns value of equation in brief at the top of this file.
virtual G4double RecommendedMaxStepLength() const
Return the wavlength / 20 of the oscillator.