Import Geant4 11.1.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2022-07-01 10:44:02 +02:00
parent b3bf75a2a1
commit c07cea1fe0
2172 changed files with 183300 additions and 123938 deletions
@@ -1,17 +1,23 @@
-------------------------------------------------------------------
# Category phys-ctor-limiters History
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
See `CONTRIBUTING.rst` for details of **required** info/format for each entry,
which **must** added in reverse chronological order (newest at the top). It must **not**
be used as a substitute for writing good git commit messages!
Hadronic physics-list/constructors/limiters History
---------------------------------------------------
This file should be used to briefly summarize all major modifications
introduced in the code and keeptrack of all tags.
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
## 2022-04-25, Vladimir Ivanchenko (phys-ctor-limiters-V11-00-02)
- G4UserSpecialCuts class is moved from process/transportation
## 2022-02-21, Ivana Hrivnacova (phys-ctor-limiters-V11-00-01)
- G4SpecialCuts: added setting of process type (fGeneral) and sub type (USER_SPECIAL_CUTS)
G4MinEkineCuts: removed setting of process type fUserDefined
## 2021-12-10 Ben Morgan (phys-ctor-limiters-V11-00-00)
- Change to new Markdown History format
---
# History entries prior to 11.0
13-Apr-2021, A. Ribon (phys-ctor-limiters-V10-07-00)
- GNUmakefile, sources.cmake : removed dependency on hadronic/model/util
@@ -0,0 +1,107 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// class description
//
// A "process" to be registered to the process manager of each particle,
// in the UserPhysicsList, in order to take into account the user limits
// defined in the G4UserLimits object attached to a logical volume.
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef G4UserSpecialCuts_h
#define G4UserSpecialCuts_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4VProcess.hh"
class G4LossTableManager;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4UserSpecialCuts : public G4VProcess
{
public: // with description
G4UserSpecialCuts(const G4String& processName ="UserSpecialCut" );
virtual ~G4UserSpecialCuts();
virtual G4double PostStepGetPhysicalInteractionLength(
const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition
);
virtual G4VParticleChange* PostStepDoIt(
const G4Track& ,
const G4Step&
);
public: // without description
// no operation in AtRestGPIL
virtual G4double AtRestGetPhysicalInteractionLength(
const G4Track& ,
G4ForceCondition*
){ return -1.0; };
// no operation in AtRestDoIt
virtual G4VParticleChange* AtRestDoIt(
const G4Track& ,
const G4Step&
){return 0;};
// no operation in AlongStepGPIL
virtual G4double AlongStepGetPhysicalInteractionLength(
const G4Track&,
G4double ,
G4double ,
G4double& ,
G4GPILSelection*
){ return -1.0; };
// no operation in AlongStepDoIt
virtual G4VParticleChange* AlongStepDoIt(
const G4Track& ,
const G4Step&
) {return 0;};
private:
// hide assignment operator as private
G4UserSpecialCuts(G4UserSpecialCuts&);
G4UserSpecialCuts& operator=(const G4UserSpecialCuts& right);
G4LossTableManager* theLossTableManager;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -13,6 +13,7 @@ geant4_add_module(G4phys_ctor_limiters
G4SpecialCuts.hh
G4StepLimiterPhysics.hh
G4ParallelWorldPhysics.hh
G4UserSpecialCuts.hh
SOURCES
G4ImportanceBiasing.cc
G4WeightWindowBiasing.cc
@@ -23,7 +24,8 @@ geant4_add_module(G4phys_ctor_limiters
G4NeutronTrackingCut.cc
G4SpecialCuts.cc
G4StepLimiterPhysics.cc
G4ParallelWorldPhysics.cc)
G4ParallelWorldPhysics.cc
G4UserSpecialCuts.cc)
geant4_module_link_libraries(G4phys_ctor_limiters
PUBLIC
@@ -45,7 +45,6 @@ G4MinEkineCuts::G4MinEkineCuts(const G4String& aName)
if (verboseLevel>1) {
G4cout << GetProcessName() << " is created "<< G4endl;
}
SetProcessType(fUserDefined);
}
G4MinEkineCuts::~G4MinEkineCuts()
@@ -42,10 +42,14 @@
#include "G4VParticleChange.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4TransportationProcessType.hh"
G4SpecialCuts::G4SpecialCuts(const G4String& aName)
: G4VProcess(aName)
: G4VProcess(aName, fGeneral)
{
// set Process Sub Type
SetProcessSubType(USER_SPECIAL_CUTS);
if (verboseLevel>1) {
G4cout << GetProcessName() << " is created "<< G4endl;
}
@@ -0,0 +1,164 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
// --------------------------------------------------------------
// History
//
// 15-04-98 first implementation, mma
// 07-04-03 migrade to cut per region (V.Ivanchenko)
// 18-09-03 substitute manager for the loss tables (V.Ivanchenko)
// 23-01-04 add protection for charged geantino in range cut (H.Kurashige)
// 09-09-04 tracking cut applied only if Rmin or Emin > DBL_MIN
// 21-01-11 changed order of checks: 1st energy tracking cut, 2nd track
// length, 3d time cut, 4th range for charged particles
// with non-zero mass; removed string comparisons (V.Ivanchenko)
// --------------------------------------------------------------
#include "G4UserSpecialCuts.hh"
#include "G4TransportationProcessType.hh"
#include "G4PhysicalConstants.hh"
#include "G4Step.hh"
#include "G4UserLimits.hh"
#include "G4VParticleChange.hh"
#include "G4LossTableManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4UserSpecialCuts::G4UserSpecialCuts(const G4String& aName)
: G4VProcess(aName, fGeneral )
{
// set Process Sub Type
SetProcessSubType(static_cast<int>(USER_SPECIAL_CUTS));
if (verboseLevel>0)
{
G4cout << GetProcessName() << " is created "<< G4endl;
}
theLossTableManager = G4LossTableManager::Instance();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4UserSpecialCuts::~G4UserSpecialCuts()
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4UserSpecialCuts::G4UserSpecialCuts(G4UserSpecialCuts& right)
: G4VProcess(right)
{
theLossTableManager = G4LossTableManager::Instance();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4UserSpecialCuts::
PostStepGetPhysicalInteractionLength( const G4Track& aTrack,
G4double, // previousStepSize
G4ForceCondition* condition )
{
// condition is set to "Not Forced"
*condition = NotForced;
G4double ProposedStep = DBL_MAX;
G4UserLimits* pUserLimits =
aTrack.GetVolume()->GetLogicalVolume()->GetUserLimits();
if (pUserLimits)
{
// check max kinetic energy first
//
G4double Ekine = aTrack.GetKineticEnergy();
if(Ekine <= pUserLimits->GetUserMinEkine(aTrack)) { return 0.; }
// max track length
//
ProposedStep = (pUserLimits->GetUserMaxTrackLength(aTrack)
- aTrack.GetTrackLength());
if (ProposedStep < 0.) { return 0.; }
// max time limit
//
G4double tlimit = pUserLimits->GetUserMaxTime(aTrack);
if(tlimit < DBL_MAX) {
G4double beta = (aTrack.GetDynamicParticle()->GetTotalMomentum())
/(aTrack.GetTotalEnergy());
G4double dTime = (tlimit - aTrack.GetGlobalTime());
G4double temp = beta*c_light*dTime;
if (temp < 0.) { return 0.; }
if (ProposedStep > temp) { ProposedStep = temp; }
}
// min remaining range
// (only for charged particle except for chargedGeantino)
//
G4double Rmin = pUserLimits->GetUserMinRange(aTrack);
if (Rmin > DBL_MIN) {
G4ParticleDefinition* Particle = aTrack.GetDefinition();
if ( (Particle->GetPDGCharge() != 0.) && (Particle->GetPDGMass() > 0.0))
{
const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple();
G4double RangeNow = theLossTableManager->GetRange(Particle,Ekine,couple);
G4double temp = RangeNow - Rmin;
if (temp < 0.) { return 0.; }
if (ProposedStep > temp) { ProposedStep = temp; }
}
}
}
return ProposedStep;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VParticleChange*
G4UserSpecialCuts::PostStepDoIt( const G4Track& aTrack,
const G4Step& )
//
// Kill the current particle, if requested by G4UserLimits
//
{
aParticleChange.Initialize(aTrack);
aParticleChange.ProposeEnergy(0.) ;
aParticleChange.ProposeLocalEnergyDeposit(aTrack.GetKineticEnergy()) ;
aParticleChange.ProposeTrackStatus(fStopAndKill);
return &aParticleChange;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......