Warning, file /include/Geant4/G4GeneralParticleSourceData.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 #ifndef G4GPS_DATA_HH
0051 #define G4GPS_DATA_HH 1
0052
0053 #include "G4SingleParticleSource.hh"
0054 #include "G4Threading.hh"
0055
0056 class G4GeneralParticleSourceData
0057 {
0058 public:
0059
0060 static G4GeneralParticleSourceData* Instance();
0061
0062 void AddASource(G4double intensity);
0063 void DeleteASource(G4int idx);
0064 void ClearSources();
0065
0066 void IntensityNormalise();
0067
0068 inline G4bool Normalised() const
0069 { return normalised; }
0070
0071 G4SingleParticleSource* GetCurrentSource(G4int idx);
0072 inline G4SingleParticleSource* GetCurrentSource() const
0073 { return currentSource; }
0074
0075 inline G4int GetSourceVectorSize() const
0076 { return G4int(sourceVector.size()); }
0077 inline G4int GetIntensityVectorSize() const
0078 { return G4int(sourceIntensity.size()); }
0079 inline G4double GetIntensity(G4int idx) const
0080 { return sourceIntensity.at(idx); }
0081 inline G4double GetSourceProbability(G4int idx) const
0082 { return sourceProbability.at(idx); }
0083
0084 void SetCurrentSourceIntensity(G4double);
0085
0086 inline void SetFlatSampling(G4bool fSamp)
0087 { flat_sampling = fSamp; }
0088 inline G4bool GetFlatSampling() const
0089 { return flat_sampling; }
0090
0091 inline void SetMultipleVertex(G4bool flag)
0092 { multiple_vertex = flag; }
0093 inline G4bool GetMultipleVertex() const
0094 { return multiple_vertex; }
0095
0096 inline G4int GetCurrentSourceIdx() const
0097 { return currentSourceIdx; }
0098
0099 void SetVerbosityAllSources(G4int vl);
0100
0101 void Lock();
0102 void Unlock();
0103
0104
0105 private:
0106
0107 G4GeneralParticleSourceData();
0108 ~G4GeneralParticleSourceData();
0109
0110 private:
0111
0112 std::vector<G4SingleParticleSource*> sourceVector;
0113 std::vector <G4double> sourceIntensity;
0114 std::vector <G4double> sourceProbability;
0115
0116 G4bool multiple_vertex = false;
0117 G4bool flat_sampling = false;
0118 G4bool normalised = false;
0119
0120 G4int currentSourceIdx = 0;
0121 G4SingleParticleSource* currentSource = nullptr;
0122 G4Mutex mutex;
0123 };
0124
0125 #endif