6 #include <G4PhysicalConstants.hh> 7 #include <Randomize.hh> 10 G4String
name,
double spillTime,
double bunchSeparation,
11 double bunchLength,
const std::vector<double>& bunchPower)
13 fBunchSeparation(bunchSeparation), fBunchLength(bunchLength),
14 fBunchPower(bunchPower) {
24 EDepSimError(
"Spill created without any power in bunchs");
35 spill =
int(spills*G4UniformRand());
36 if (spill>=spills) spill=spills-1;
37 if (spill<0) spill = 0;
45 double truncTime = G4RandGauss::shoot(0.0, 1.0);
46 while (truncTime < -2.0 || truncTime > 2.0) {
47 truncTime = G4RandGauss::shoot(0.0, 1.0);
double fBunchSeparation
The time between bunch starts.
double fBunchLength
The length of a bunch. This is the gaussian width of the bunch.
SpillTimeGenerator(G4String name, double spillTime, double bunchSeparation, double bunchLength, const std::vector< double > &bunchPower)
Construct a module from components.
double fMaxPower
The maximum power in a bunch.
double fSpillTime
The time that the neutrinos are crossing (0,0,0).
#define EDepSimError(outStream)
double GetTime(const G4LorentzVector &vertex)
Return the time of the event to be generated.
virtual ~SpillTimeGenerator()
std::vector< double > fBunchPower
The power in each bunch.