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 synchronousTIn,
32 G4double amplitudeOffsetIn,
33 G4double amplitudeScaleIn):
34 angularFrequency(CLHEP::twopi * frequencyIn),
36 synchronousT(synchronousTIn),
37 offset(amplitudeOffsetIn),
38 scale(amplitudeScaleIn)
41 {
throw BDSException(__METHOD_NAME__,
"\frequency\" must be >= 0");}
47 G4double factor = offset + scale*std::sin(angularFrequency*(T-synchronousT) + phase);
53 if (angularFrequency == 0)
54 {
return std::numeric_limits<double>::max();}
57 G4double wavelength = CLHEP::twopi * CLHEP::c_light / angularFrequency;
58 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 wavelength / 20 of the oscillator.