Import Geant4 10.7.0 source tree

This commit is contained in:
Gabriele Cosmo
2020-12-04 12:30:43 +01:00
parent 67ba86d073
commit dab42d2018
3770 changed files with 226369 additions and 286486 deletions
@@ -61,28 +61,35 @@ void TrackingAction::PreUserTrackingAction(const G4Track* track)
Run* run = static_cast<Run*>(
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
run->ParticleCount(name,energy);
// histograms: energy at creation
//
G4AnalysisManager* analysis = G4AnalysisManager::Instance();
// histograms: energy at creation
//
G4AnalysisManager* analysis = G4AnalysisManager::Instance();
G4int ih = 0;
const G4ParticleDefinition* particle = track->GetParticleDefinition();
G4String type = particle->GetParticleType();
G4double charge = particle->GetPDGCharge();
if (charge > 3.) ih = 10;
else if (particle == G4Gamma::Gamma()) ih = 4;
else if (particle == G4Electron::Electron()) ih = 5;
else if (particle == G4Positron::Positron()) ih = 5;
else if (particle == G4Neutron::Neutron()) ih = 6;
else if (particle == G4Proton::Proton()) ih = 7;
else if (particle == G4Deuteron::Deuteron()) ih = 8;
else if (particle == G4Alpha::Alpha()) ih = 9;
else if (type == "nucleus") ih = 10;
else if (type == "baryon") ih = 11;
else if (type == "meson") ih = 12;
else if (type == "lepton") ih = 13;
if (ih > 0) analysis->FillH1(ih,energy);
G4int ih = 0;
const G4ParticleDefinition* particle = track->GetParticleDefinition();
G4String type = particle->GetParticleType();
G4double charge = particle->GetPDGCharge();
if (charge > 3.) ih = 10;
else if (particle == G4Gamma::Gamma()) ih = 4;
else if (particle == G4Electron::Electron()) ih = 5;
else if (particle == G4Positron::Positron()) ih = 5;
else if (particle == G4Neutron::Neutron()) ih = 6;
else if (particle == G4Proton::Proton()) ih = 7;
else if (particle == G4Deuteron::Deuteron()) ih = 8;
else if (particle == G4Alpha::Alpha()) ih = 9;
else if (type == "nucleus") ih = 10;
else if (type == "baryon") ih = 11;
else if (type == "meson") ih = 12;
else if (type == "lepton") ih = 13;
if (ih > 0) analysis->FillH1(ih,energy);
//to force only 1 fission : kill secondary neutrons
///if (particle == G4Neutron::Neutron()) {
/// fEventAction->AddEdep(energy);
/// G4Track* aTrack = (G4Track*)track;
/// aTrack->SetTrackStatus(fStopAndKill);
///}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......