MCPcopy Create free account
hub / github.com/Geant4/geant4 / ListSource

Method ListSource

source/event/src/G4GeneralParticleSource.cc:96–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void G4GeneralParticleSource::ListSource()
97{
98 G4cout << "The number of particle sources is: "
99 << GPSData->GetIntensityVectorSize() << G4endl;
100 G4cout << " Multiple Vertex sources: " << GPSData->GetMultipleVertex();
101 G4cout << " Flat Sampling flag: " << GPSData->GetFlatSampling() << G4endl;
102 const G4int currentIdx = GPSData->GetCurrentSourceIdx();
103 for(G4int i=0; i<GPSData->GetIntensityVectorSize(); ++i)
104 {
105 G4cout << "\tsource " << i << " with intensity: "
106 << GPSData->GetIntensity(i) << G4endl;
107 const G4SingleParticleSource* thisSrc = GPSData->GetCurrentSource(i);
108 G4cout << " \t\tNum Particles: "<<thisSrc->GetNumberOfParticles()
109 << "; Particle type: "
110 << thisSrc->GetParticleDefinition()->GetParticleName() << G4endl;
111 G4cout << " \t\tEnergy: "
112 << G4BestUnit(thisSrc->GetEneDist()->GetMonoEnergy(),"Energy") << G4endl;
113 G4cout << " \t\tDirection: "
114 << thisSrc->GetAngDist()->GetDirection() << "; Position: ";
115 G4cout << G4BestUnit(thisSrc->GetPosDist()->GetCentreCoords(),"Length")
116 << G4endl;
117 G4cout << " \t\tAngular Distribution: "
118 << thisSrc->GetAngDist()->GetDistType() << G4endl;
119 G4cout << " \t\tEnergy Distribution: "
120 << thisSrc->GetEneDist()->GetEnergyDisType() << G4endl;
121 G4cout << " \t\tPosition Distribution Type: "
122 << thisSrc->GetPosDist()->GetPosDisType();
123 G4cout << "; Position Shape: "
124 << thisSrc->GetPosDist()->GetPosDisShape() << G4endl;
125 }
126
127 // Set back previous source
128 GPSData->GetCurrentSource(currentIdx);
129}
130
131void G4GeneralParticleSource::SetCurrentSourceto(G4int aV)
132{

Callers 1

SetNewValueMethod · 0.80

Calls 15

G4BestUnitClass · 0.85
GetMultipleVertexMethod · 0.80
GetFlatSamplingMethod · 0.80
GetCurrentSourceIdxMethod · 0.80
GetIntensityMethod · 0.80
GetMonoEnergyMethod · 0.80
GetEneDistMethod · 0.80
GetAngDistMethod · 0.80
GetPosDistMethod · 0.80
GetDistTypeMethod · 0.80
GetCurrentSourceMethod · 0.45

Tested by

no test coverage detected