19#include "BDSException.hh"
20#include "BDSModulatorSinT.hh"
22#include "CLHEP/Units/PhysicalConstants.h"
23#include "CLHEP/Units/SystemOfUnits.h"
28BDSModulatorSinT::BDSModulatorSinT(G4double frequencyIn,
30 G4double synchronousTIn,
31 G4double amplitudeOffsetIn,
32 G4double amplitudeScaleIn):
33 angularFrequency(CLHEP::twopi * frequencyIn),
35 synchronousT(synchronousTIn),
36 offset(amplitudeOffsetIn),
37 scale(amplitudeScaleIn)
40 {
throw BDSException(__METHOD_NAME__,
"\frequency\" must be >= 0");}
46 G4double factor = offset + scale*std::sin(angularFrequency*(T-synchronousT) + phase);
52 if (angularFrequency == 0)
53 {
return std::numeric_limits<double>::max();}
56 G4double wavelength = CLHEP::twopi * CLHEP::c_light / angularFrequency;
57 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.