EDepSimSpillTimeFactory.hh
Go to the documentation of this file.
1 #ifndef EDepSim_SpillTimeFactory_hh_seen
2 #define EDepSim_SpillTimeFactory_hh_seen
3 
5 
6 /// A factory to create a time generator to distribute events according to the
7 /// spill structure. The spill parameters should be set before the generator
8 /// is created. The spill times are actually generated by an
9 /// EDepSim::SpillTimeGenerator object.
10 namespace EDepSim {class SpillTimeFactory;}
12 public:
14  virtual ~SpillTimeFactory();
15 
16  /// Return the spill time generator. The spill parameters must be set
17  /// before this is called.
19 
20  /// Set the spill time. The spill time is the offset of start of the
21  /// first bunch with respect to zero. This is the time that the bunch
22  /// will cross the center of the EDepSim:: hall.
23  void SetSpillTime(double spillTime) {fSpillTime=spillTime;}
24 
25  /// Set the number of bunchs (and reset the bunch power) in a spill.
26  void SetBunchCount(int bunchs);
27 
28  /// Set the bunch separation. This is the time between the start of
29  /// successive bunches.
30  void SetBunchSeparation(double sep) {fBunchSeparation=sep;}
31 
32  /// Set the bunch length. This is the length of a bunch, and determines
33  /// the end of the bunch with respect to the start. The start of the
34  /// bunch is determined by the spill time, and the bunch separation. The
35  /// bunch is modeled as a Gaussian with a sigma set to the Bunch Length.
36  void SetBunchLength(double length) {fBunchLength=length;}
37 
38  /// Set the power for a bunch. The bunchs are numbered from ONE, and the
39  /// nominal (default) power in a bunch is 1.0.
40  void SetBunchPower(int bunch, double power);
41 
42  /// Handle messages from the UI processor.
43  void SetNewValue(G4UIcommand*, G4String);
44 
45 private:
46  /// The start time of the spill.
47  double fSpillTime;
48 
49  /// The bunch separation.
51 
52  /// The bunch length.
53  double fBunchLength;
54 
55  /// The power in each bunch.
56  std::vector<double> fBunchPower;
57 
58  G4UIcmdWithADoubleAndUnit* fSpillTimeCMD;
59  G4UIcmdWithADoubleAndUnit* fBunchSepCMD;
60  G4UIcmdWithADoubleAndUnit* fBunchLengthCMD;
61  G4UIcmdWithAnInteger* fBunchCountCMD;
62  G4UIcommand* fBunchPowerCMD;
63 
64 };
65 
66 #endif
SpillTimeFactory(EDepSim::UserPrimaryGeneratorMessenger *parent)
EDepSim::VTimeGenerator * GetGenerator()
G4UIcmdWithAnInteger * fBunchCountCMD
double fBunchSeparation
The bunch separation.
G4UIcmdWithADoubleAndUnit * fBunchSepCMD
void SetNewValue(G4UIcommand *, G4String)
Handle messages from the UI processor.
void SetSpillTime(double spillTime)
Construct a module from components.
Definition: TG4HitSegment.h:10
G4UIcmdWithADoubleAndUnit * fSpillTimeCMD
G4UIcmdWithADoubleAndUnit * fBunchLengthCMD
void SetBunchCount(int bunchs)
Set the number of bunchs (and reset the bunch power) in a spill.
void SetBunchPower(int bunch, double power)
double fSpillTime
The start time of the spill.
std::vector< double > fBunchPower
The power in each bunch.
def parent(G, child, parent_type)
Definition: graph.py:67
double fBunchLength
The bunch length.