EDepSimVCountGenerator.hh
Go to the documentation of this file.
1 #ifndef EDepSim_VCountGenerator_hh_seen
2 #define EDepSim_VCountGenerator_hh_seen
3 
4 #include <G4String.hh>
5 
6 /// A base class used by ND20PrimaryGenerator to select the number of primary
7 /// vertices to be generated for a G4Event. Classes derived from
8 /// EDepSim::VCountGenerator are responsible for returning the number of
9 /// successful calls to be made to the EDepSim::VKinematicsGenerator by the
10 /// EDepSim::PrimaryGenerator object. Each call to EDepSim::VKinematicsGenerator will
11 /// create a new "unique" primary vertex; however, it may result in multiple
12 /// G4PrimaryVertex objects being added to the G4Event. The derived classes
13 /// must override the (pure virtual) EDepSim::VCountGenerator::GetCount() object.
14 /// This method must return an integer for the number of verticies to be
15 /// generated. This count can be zero (or negative), in which case no
16 /// verticies will be generated.
17 namespace EDepSim {class VCountGenerator;}
19 public:
20  VCountGenerator(const G4String& name, double intensity)
21  : fName(name), fIntensity(intensity) {}
22  virtual ~VCountGenerator() {}
23 
24  /// Return the number of events that should be generated. If the return
25  /// value is less than or equal to zero, then no events are generated.
26  virtual int GetCount() = 0;
27 
28  /// Return the name of the generator.
29  G4String GetName() const {return fName;}
30 
31  /// Return the intensity for this generator. For a beam MC, this will be
32  /// the number of protons per pulse.
33  double GetIntensity() const {return fIntensity;}
34 
35 private:
36  /// The name of the generator.
37  G4String fName;
38 
39  /// The intensity for the generator.
40  double fIntensity;
41 
42 };
43 #endif
static QCString name
Definition: declinfo.cpp:673
G4String fName
The name of the generator.
virtual int GetCount()=0
double fIntensity
The intensity for the generator.
Construct a module from components.
Definition: TG4HitSegment.h:10
G4String GetName() const
Return the name of the generator.
VCountGenerator(const G4String &name, double intensity)