Import Geant4 11.0.2 source tree

This commit is contained in:
Gabriele Cosmo
2022-05-25 15:50:57 +02:00
parent de4f28d823
commit b3bf75a2a1
341 changed files with 93127 additions and 39343 deletions
+1 -1
View File
@@ -167,7 +167,7 @@ endif
banner:
@$(ECHO) "*************************************************************"
@$(ECHO) " Installation Geant4 version geant4-11-00-patch-01 "
@$(ECHO) " Installation Geant4 version geant4-11-00-patch-02 "
@$(ECHO) " Copyright (C) 1994-2022 Geant4 Collaboration "
@$(ECHO) "*************************************************************"
+3
View File
@@ -15,6 +15,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
October 17th, 2022 M. Asai (detutil-V10-07-07)
- G4VScoringMesh.hh : Fixing virtual keyword.
October 7th, 2021 I. Hrivnacova (detutil-V10-07-06)
- Updated G4TScoreNtupleWriter for changes in the analysis category:
added fDefaultFileType (with default value "root") and its setter
@@ -72,12 +72,11 @@ class G4VScoringMesh
virtual ~G4VScoringMesh();
public: // with description
// a pure virtual function to construct this mesh geometry
void Construct(G4VPhysicalVolume* fWorldPhys);
void WorkerConstruct(G4VPhysicalVolume* fWorldPhys);
virtual void Construct(G4VPhysicalVolume* fWorldPhys);
virtual void WorkerConstruct(G4VPhysicalVolume* fWorldPhys);
protected:
// a pure virtual function to construct this mesh geometry
virtual void SetupGeometry(G4VPhysicalVolume* fWorldPhys) = 0;
public: // with description
+6
View File
@@ -16,6 +16,12 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
10 March 2022 - E.Tcherniaev (clhep-V10-07-00)
- Fixed compilation warnings in LorentzRotation.h when c++20 is enabled.
08 February 2022 - G.Cosmo
- Fixed compilation warnings for shadowing data member in RandPoisson.
01 September 2021 - G.Cosmo
- Synchronised with CLHEP-2.4.5.1.
* Random (J.Hahnfeld)
@@ -346,9 +346,9 @@ inline std::ostream & operator<<
{return lt.print(os);}
inline bool operator==(const HepRotation &r, const HepLorentzRotation & lt)
{ return lt==r; }
{ return lt==HepLorentzRotation(r); }
inline bool operator!=(const HepRotation &r, const HepLorentzRotation & lt)
{ return lt!=r; }
{ return lt!=HepLorentzRotation(r); }
inline bool operator<=(const HepRotation &r, const HepLorentzRotation & lt)
{ return lt<=r; }
inline bool operator>=(const HepRotation &r, const HepLorentzRotation & lt)
@@ -359,9 +359,9 @@ inline bool operator>(const HepRotation &r, const HepLorentzRotation & lt)
{ return lt>r; }
inline bool operator==(const HepBoost &b, const HepLorentzRotation & lt)
{ return lt==b; }
{ return lt==HepLorentzRotation(b); }
inline bool operator!=(const HepBoost &b, const HepLorentzRotation & lt)
{ return lt!=b; }
{ return lt!=HepLorentzRotation(b); }
inline bool operator<=(const HepBoost &b, const HepLorentzRotation & lt)
{ return lt<=b; }
inline bool operator>=(const HepBoost &b, const HepLorentzRotation & lt)
+8 -8
View File
@@ -102,10 +102,10 @@ long RandPoisson::shoot(double xm) {
double om = getOldMean();
HepRandomEngine* anEngine = HepRandom::getTheEngine();
double* status = getPStatus();
sq = status[0];
alxm = status[1];
g1 = status[2];
double* pstatus = getPStatus();
sq = pstatus[0];
alxm = pstatus[1];
g1 = pstatus[2];
if( xm == -1 ) return 0;
if( xm < 12.0 ) {
@@ -162,10 +162,10 @@ long RandPoisson::shoot(HepRandomEngine* anEngine, double xm) {
double sq, alxm, g1;
double om = getOldMean();
double* status = getPStatus();
sq = status[0];
alxm = status[1];
g1 = status[2];
double* pstatus = getPStatus();
sq = pstatus[0];
alxm = pstatus[1];
g1 = pstatus[2];
if( xm == -1 ) return 0;
if( xm < 12.0 ) {
+40
View File
@@ -0,0 +1,40 @@
---
Checks: "-*,\
google-readability-casting,\
misc-*,\
-misc-incorrect-roundings,\
-misc-macro-parentheses,\
-misc-misplaced-widening-cast,\
-misc-static-assert,\
modernize-*,\
-modernize-deprecated-headers,\
-modernize-pass-by-value,\
-modernize-raw-string-literal,\
-modernize-return-braced-init-list,\
-modernize-use-auto,\
-modernize-use-default-member-init,\
-modernize-use-emplace,\
-modernize-use-equals-default,\
-modernize-use-equals-delete,\
-modernize-use-noexcept,\
-modernize-use-transparent-functors,\
-modernize-use-using,\
performance-*,\
-performance-inefficient-string-concatenation,\
readability-*,\
-readability-function-size,\
-readability-identifier-naming,\
-readability-implicit-bool-cast,\
-readability-inconsistent-declaration-parameter-name,\
-readability-named-parameter,\
-readability-redundant-declaration,\
-readability-redundant-member-init,\
-readability-simplify-boolean-expr,\
"
HeaderFilterRegex: 'source/[^/]*\.(hh|cc)$'
CheckOptions:
- key: readability-braces-around-statements.ShortStatementLines
value: '2'
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: '1'
...
+4
View File
@@ -16,6 +16,10 @@ commit in the repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
March 5 2022 M.Asai (geommng-V10-07-08)
- G4SolidStore, G4LogicalVolumeStore, G4PhysicalVolumeStore:
extend getter methods to optionally return the last-found object.
September 28, 2021 G.Cosmo (geommng-V10-07-07)
- Use G4Allocator to dynamically allocate nodes and proxies for the
voxels optimisation structure. Should help reducing memory fragmentation.
@@ -67,8 +67,9 @@ class G4LogicalVolumeStore : public std::vector<G4LogicalVolume*>
static void Clean();
// Delete all volumes from the store.
G4LogicalVolume* GetVolume(const G4String& name, G4bool verbose=true) const;
// Return the pointer of the first volume in the collection having
G4LogicalVolume* GetVolume(const G4String& name, G4bool verbose=true,
G4bool reverseSearch=false) const;
// Return the pointer of the first or last volume in the collection having
// that name. Uses the internal map for fast search and warns if
// a volume in the collection is not unique or not found.
@@ -68,8 +68,9 @@ class G4PhysicalVolumeStore : public std::vector<G4VPhysicalVolume*>
// are automatically notified and have their daughters de-registered.
G4VPhysicalVolume* GetVolume(const G4String& name,
G4bool verbose = true) const;
// Return the pointer of the first volume in the collection having
G4bool verbose = true,
G4bool reverseSearch = false) const;
// Return the pointer of the first or last volume in the collection having
// that name. Uses the internal map for fast search and warns if
// a volume in the collection is not unique or not found.
@@ -66,8 +66,9 @@ class G4SolidStore : public std::vector<G4VSolid*>
static void Clean();
// Delete all solids from the store.
G4VSolid* GetSolid(const G4String& name, G4bool verbose = true) const;
// Return the pointer of the first solid in the collection having
G4VSolid* GetSolid(const G4String& name, G4bool verbose = true,
G4bool reverseSearch = false) const;
// Return the pointer of the first or last solid in the collection having
// that name. Uses the internal map for fast search and warns if
// a solid in the collection is not unique or not found.
@@ -216,11 +216,12 @@ void G4LogicalVolumeStore::DeRegister(G4LogicalVolume* pVolume)
}
// ***************************************************************************
// Retrieve the first volume pointer in the container having that name
// Retrieve the first or last volume pointer in the container having that name
// ***************************************************************************
//
G4LogicalVolume*
G4LogicalVolumeStore::GetVolume(const G4String& name, G4bool verbose) const
G4LogicalVolumeStore::GetVolume(const G4String& name, G4bool verbose,
G4bool reverseSearch) const
{
G4LogicalVolumeStore* store = GetInstance();
if (!store->mvalid) { store->UpdateMap(); }
@@ -236,7 +237,14 @@ G4LogicalVolumeStore::GetVolume(const G4String& name, G4bool verbose) const
G4Exception("G4LogicalVolumeStore::GetVolume()",
"GeomMgt1001", JustWarning, message);
}
return pos->second[0];
if(reverseSearch)
{
return pos->second[pos->second.size()-1];
}
else
{
return pos->second[0];
}
}
if (verbose)
{
@@ -220,11 +220,12 @@ void G4PhysicalVolumeStore::DeRegister(G4VPhysicalVolume* pVolume)
}
// ***************************************************************************
// Retrieve the first volume pointer in the container having that name
// Retrieve the first or last volume pointer in the container having that name
// ***************************************************************************
//
G4VPhysicalVolume*
G4PhysicalVolumeStore::GetVolume(const G4String& name, G4bool verbose) const
G4PhysicalVolumeStore::GetVolume(const G4String& name, G4bool verbose,
G4bool reverseSearch) const
{
G4PhysicalVolumeStore* store = GetInstance();
if (!store->mvalid) { store->UpdateMap(); }
@@ -240,7 +241,14 @@ G4PhysicalVolumeStore::GetVolume(const G4String& name, G4bool verbose) const
G4Exception("G4PhysicalVolumeStore::GetVolume()",
"GeomMgt1001", JustWarning, message);
}
return pos->second[0];
if(reverseSearch)
{
return pos->second[pos->second.size()-1];
}
else
{
return pos->second[0];
}
}
if (verbose)
{
+11 -3
View File
@@ -215,10 +215,11 @@ void G4SolidStore::DeRegister(G4VSolid* pSolid)
}
// ***************************************************************************
// Retrieve the first solid pointer in the container having that name
// Retrieve the first or last solid pointer in the container having that name
// ***************************************************************************
//
G4VSolid* G4SolidStore::GetSolid(const G4String& name, G4bool verbose) const
G4VSolid* G4SolidStore::GetSolid(const G4String& name, G4bool verbose,
G4bool reverseSearch) const
{
G4SolidStore* store = GetInstance();
if (!store->mvalid) { store->UpdateMap(); }
@@ -234,7 +235,14 @@ G4VSolid* G4SolidStore::GetSolid(const G4String& name, G4bool verbose) const
G4Exception("G4SolidStore::GetSolid()",
"GeomMgt1001", JustWarning, message);
}
return pos->second[0];
if(reverseSearch)
{
return pos->second[pos->second.size()-1];
}
else
{
return pos->second[0];
}
}
if (verbose)
{
+11
View File
@@ -16,6 +16,17 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
March 3, 2022 - P.Arce (geomnav-V10-07-06)
-------------
- G4RegularNavigation: reset the zero step counter when a non-zero step was
performed, to avoid aborted events. Correct tabulation.
Fixes as proposed in [GitHub PR #38](https://github.com/Geant4/geant4/pull/38)
January 1, 2022 - G.Cosmo
-------------------------
- G4VIntersectionLocator: fixed compilation warning on Intel-icx compiler
for unused data.
September 25, 2021 - P.Arce (geomnav-V10-07-05)
----------------------------
- Reduce warning messages in GetReplicaNo: only when difference is > kCarTolerance
@@ -205,16 +205,16 @@ G4double G4RegularNavigation::ComputeStepSkippingEqualMaterials(
.InverseTransformPoint(localPoint);
std::ostringstream message;
message << "G4RegularNavigation::ComputeStepSkippingEqualMaterials()"
<< "Stuck Track: potential geometry or navigation problem."
<< G4endl
<< " Track stuck, moving for more than "
<< ii << " steps" << G4endl
<< "- at point " << pGlobalpoint << G4endl
<< " local direction: " << localDirection << G4endl;
<< "Stuck Track: potential geometry or navigation problem."
<< G4endl
<< " Track stuck, moving for more than "
<< ii << " steps" << G4endl
<< "- at point " << pGlobalpoint << G4endl
<< " local direction: " << localDirection << G4endl;
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1001",
EventMustBeAborted,
message);
"GeomRegNav1001",
EventMustBeAborted,
message);
}
newStep = voxelBox->DistanceToOut( localPoint, localDirection );
fLastStepWasZero = (newStep<fMinStep);
@@ -226,63 +226,67 @@ G4double G4RegularNavigation::ComputeStepSkippingEqualMaterials(
{
G4ThreeVector pGlobalpoint = history.GetTransform(ide)
.InverseTransformPoint(localPoint);
std::ostringstream message;
message.precision(16);
message << "G4RegularNavigation::ComputeStepSkippingEqualMaterials(): another 'zero' step, # "
<< fNumberZeroSteps
<< ", at " << pGlobalpoint
<< ", nav-comp-step calls # " << ii
<< ", Step= " << newStep;
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1002", JustWarning, message,
"Potential overlap in geometry!");
std::ostringstream message;
message.precision(16);
message << "G4RegularNavigation::ComputeStepSkippingEqualMaterials(): another 'zero' step, # "
<< fNumberZeroSteps
<< ", at " << pGlobalpoint
<< ", nav-comp-step calls # " << ii
<< ", Step= " << newStep;
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1002", JustWarning, message,
"Potential overlap in geometry!");
}
#endif
if( fNumberZeroSteps > fActionThreshold_NoZeroSteps-1 )
{
// Act to recover this stuck track. Pushing it along direction
//
newStep = std::min(101*kCarTolerance*std::pow(10,fNumberZeroSteps-2),0.1);
// Act to recover this stuck track. Pushing it along direction
//
newStep = std::min(101*kCarTolerance*std::pow(10,fNumberZeroSteps-2),0.1);
#ifdef G4DEBUG_NAVIGATION
G4ThreeVector pGlobalpoint = history.GetTransform(ide)
.InverseTransformPoint(localPoint);
std::ostringstream message;
message.precision(16);
message << "Track stuck or not moving." << G4endl
<< " Track stuck, not moving for "
<< fNumberZeroSteps << " steps" << G4endl
<< "- at point " << pGlobalpoint
<< " (local point " << localPoint << ")" << G4endl
<< " local direction: " << localDirection
<< " Potential geometry or navigation problem !"
<< G4endl
<< " Trying pushing it of " << newStep << " mm ...";
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1003", JustWarning, message,
"Potential overlap in geometry!");
std::ostringstream message;
message.precision(16);
message << "Track stuck or not moving." << G4endl
<< " Track stuck, not moving for "
<< fNumberZeroSteps << " steps" << G4endl
<< "- at point " << pGlobalpoint
<< " (local point " << localPoint << ")" << G4endl
<< " local direction: " << localDirection
<< " Potential geometry or navigation problem !"
<< G4endl
<< " Trying pushing it of " << newStep << " mm ...";
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1003", JustWarning, message,
"Potential overlap in geometry!");
#endif
}
if( fNumberZeroSteps > fAbandonThreshold_NoZeroSteps-1 )
{
// Must kill this stuck track
//
G4ThreeVector pGlobalpoint = history.GetTransform(ide)
.InverseTransformPoint(localPoint);
std::ostringstream message;
message << "G4RegularNavigation::ComputeStepSkippingEqualMaterials()"
<< "Stuck Track: potential geometry or navigation problem."
<< G4endl
<< " Track stuck, not moving for "
<< fNumberZeroSteps << " steps" << G4endl
<< "- at point " << pGlobalpoint << G4endl
<< " local direction: " << localDirection << G4endl;
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1004",
EventMustBeAborted,
message);
// Must kill this stuck track
//
G4ThreeVector pGlobalpoint = history.GetTransform(ide)
.InverseTransformPoint(localPoint);
std::ostringstream message;
message << "G4RegularNavigation::ComputeStepSkippingEqualMaterials()"
<< "Stuck Track: potential geometry or navigation problem."
<< G4endl
<< " Track stuck, not moving for "
<< fNumberZeroSteps << " steps" << G4endl
<< "- at point " << pGlobalpoint << G4endl
<< " local direction: " << localDirection << G4endl;
G4Exception("G4RegularNavigation::ComputeStepSkippingEqualMaterials()",
"GeomRegNav1004",
EventMustBeAborted,
message);
}
}
else
{
// reset the zero step counter when a non-zero step was performed
fNumberZeroSteps = 0;
}
if( (bFirstStep) && (newStep < currentProposedStepLength) )
{
exiting = true;
@@ -296,17 +296,19 @@ ReEstimateEndpoint( const G4FieldTrack& CurrentStateA,
G4Exception("G4VIntersectionLocator::ReEstimateEndpoint()",
"GeomNav1002", JustWarning, message);
}
/*
#else
// Statistics on the RMS value of the corrections
static G4ThreadLocal G4int noCorrections = 0;
static G4ThreadLocal G4double sumCorrectionsSq = 0;
static G4ThreadLocal G4int noCorrections = 0;
++noCorrections;
if( goodAdvance )
{
static G4ThreadLocal G4double sumCorrectionsSq;
sumCorrectionsSq += (EstimatedEndStateB.GetPosition() -
newEndPoint.GetPosition()).mag2();
}
*/
#endif
return retEndPoint;
+10
View File
@@ -19,6 +19,16 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 4, 2022, G.Cosmo (geom-bool-V10-07-05)
- Minor cleanup in G4UnionSolid constructors.
April 29, 2022, G.Cosmo
- G4UnionSolid: added missing data initialisation in copy-ctr and operator=().
April 5, 2022, G.Cosmo
- G4UnionSolid: add surface tolerance in Inside(p) for check on Z.
Minor optimisation in caching half-tolerance.
January 10, 2022, G.Cosmo geom-bool-V10-07-04
- Added alternative signature for AddNode() taking a pointer to solid.
Added 'const' qualification to transformation passed as argument.
@@ -44,7 +44,7 @@
class G4UnionSolid : public G4BooleanSolid
{
public: // with description
public:
G4UnionSolid( const G4String& pName,
G4VSolid* pSolidA ,
@@ -67,8 +67,6 @@ class G4UnionSolid : public G4BooleanSolid
G4VSolid* Clone() const;
public: // without description
G4UnionSolid(__void__&);
// Fake default constructor for usage restricted to direct object
// persistency for clients requiring preallocation of memory for
@@ -114,7 +112,10 @@ class G4UnionSolid : public G4BooleanSolid
private:
void Init();
G4ThreeVector fPMin, fPMax; // bounding box extended by half-tolerance
G4double halfCarTolerance;
};
#endif
@@ -55,11 +55,7 @@ G4UnionSolid:: G4UnionSolid( const G4String& pName,
G4VSolid* pSolidB )
: G4BooleanSolid(pName,pSolidA,pSolidB)
{
G4ThreeVector pdelta(0.5*kCarTolerance,0.5*kCarTolerance,0.5*kCarTolerance);
G4ThreeVector pmin, pmax;
BoundingLimits(pmin, pmax);
fPMin = pmin - pdelta;
fPMax = pmax + pdelta;
Init();
}
/////////////////////////////////////////////////////////////////////
@@ -74,11 +70,7 @@ G4UnionSolid::G4UnionSolid( const G4String& pName,
: G4BooleanSolid(pName,pSolidA,pSolidB,rotMatrix,transVector)
{
G4ThreeVector pdelta(0.5*kCarTolerance,0.5*kCarTolerance,0.5*kCarTolerance);
G4ThreeVector pmin, pmax;
BoundingLimits(pmin, pmax);
fPMin = pmin - pdelta;
fPMax = pmax + pdelta;
Init();
}
///////////////////////////////////////////////////////////
@@ -91,11 +83,7 @@ G4UnionSolid::G4UnionSolid( const G4String& pName,
const G4Transform3D& transform )
: G4BooleanSolid(pName,pSolidA,pSolidB,transform)
{
G4ThreeVector pdelta(0.5*kCarTolerance,0.5*kCarTolerance,0.5*kCarTolerance);
G4ThreeVector pmin, pmax;
BoundingLimits(pmin, pmax);
fPMin = pmin - pdelta;
fPMax = pmax + pdelta;
Init();
}
//////////////////////////////////////////////////////////////////
@@ -125,6 +113,7 @@ G4UnionSolid::G4UnionSolid(const G4UnionSolid& rhs)
{
fPMin = rhs.fPMin;
fPMax = rhs.fPMax;
halfCarTolerance=0.5*kCarTolerance;
}
///////////////////////////////////////////////////////////////
@@ -143,9 +132,25 @@ G4UnionSolid& G4UnionSolid::operator = (const G4UnionSolid& rhs)
fPMin = rhs.fPMin;
fPMax = rhs.fPMax;
halfCarTolerance = rhs.halfCarTolerance;
return *this;
}
///////////////////////////////////////////////////////////////
//
// Initialisation
void G4UnionSolid::Init()
{
G4ThreeVector pdelta(kCarTolerance,kCarTolerance,kCarTolerance);
G4ThreeVector pmin, pmax;
BoundingLimits(pmin, pmax);
fPMin = pmin - pdelta;
fPMax = pmax + pdelta;
halfCarTolerance=0.5*kCarTolerance;
}
//////////////////////////////////////////////////////////////////////////
//
// Get bounding box
@@ -221,7 +226,7 @@ G4UnionSolid::CalculateExtent( const EAxis pAxis,
EInside G4UnionSolid::Inside( const G4ThreeVector& p ) const
{
if (std::max(p.z()-fPMax.z(),fPMin.z()-p.z()) > 0) return kOutside;
if (std::max(p.z()-fPMax.z(), fPMin.z()-p.z()) > 0) { return kOutside; }
EInside positionA = fPtrSolidA->Inside(p);
if (positionA == kInside) { return positionA; } // inside A
@@ -286,7 +291,7 @@ G4UnionSolid::SurfaceNormal( const G4ThreeVector& p ) const
G4double
G4UnionSolid::DistanceToIn( const G4ThreeVector& p,
const G4ThreeVector& v ) const
const G4ThreeVector& v ) const
{
#ifdef G4BOOLDEBUG
if( Inside(p) == kInside )
@@ -305,7 +310,7 @@ G4UnionSolid::DistanceToIn( const G4ThreeVector& p,
#endif
return std::min(fPtrSolidA->DistanceToIn(p,v),
fPtrSolidB->DistanceToIn(p,v) ) ;
fPtrSolidB->DistanceToIn(p,v) ) ;
}
////////////////////////////////////////////////////////
@@ -394,7 +399,7 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p,
}
}
while( (fPtrSolidA->Inside(p+dist*v) != kOutside)
&& (disTmp > 0.5*kCarTolerance) );
&& (disTmp > halfCarTolerance) );
}
else // if( positionB != kOutside )
{
@@ -412,7 +417,7 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p,
}
}
while( (fPtrSolidB->Inside(p+dist*v) != kOutside)
&& (disTmp > 0.5*kCarTolerance) );
&& (disTmp > halfCarTolerance) );
}
}
if( calcNorm )
@@ -457,7 +462,7 @@ G4UnionSolid::DistanceToOut( const G4ThreeVector& p ) const
(positionA == kSurface && positionB == kInside ) )
{
distout= std::max(fPtrSolidA->DistanceToOut(p),
fPtrSolidB->DistanceToOut(p) ) ;
fPtrSolidB->DistanceToOut(p) ) ;
}
else
{
+9
View File
@@ -16,6 +16,15 @@ commit in the repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 23, 2022 Gabriele Cosmo (global-V10-07-39)
- Updated tag IDs for geant4-11-00-patch-02.
April 1, 2022 Jonas Hahnfeld
- Fix two typos in Bremsstrahlung.
March 18, 2022 Ben Morgan
- Replace use of deprecated std::result_of with std::invoke_result_t.
March 8, 2022 Gabriele Cosmo (global-V10-07-38)
- Updated tag IDs for geant4-11-00-patch-01.
+11 -11
View File
@@ -99,8 +99,8 @@
#include <csignal>
#include <type_traits>
template <typename FuncT>
using G4ResultOf_t = typename std::result_of<FuncT>::type;
template <typename FuncT, typename... ArgTypes>
using G4ResultOf_t = std::invoke_result_t<FuncT, ArgTypes...>;
// compatible OS and compiler
#if defined(G4UNIX) && \
@@ -302,14 +302,14 @@ class G4Backtrace
// to ignore initial frames (such as this function). A callback
// can be provided to inspect and/or tweak the frame string
template <size_t Depth, size_t Offset = 0, typename FuncT = frame_func_t>
static std::array<G4ResultOf_t<FuncT(const char*)>, Depth> GetMangled(
static std::array<G4ResultOf_t<FuncT, const char*>, Depth> GetMangled(
FuncT&& func = FrameFunctor());
// gets a demangled backtrace of "Depth" frames. The offset parameter is
// used to ignore initial frames (such as this function). A callback
// can be provided to inspect and/or tweak the frame string
template <size_t Depth, size_t Offset = 0, typename FuncT = frame_func_t>
static std::array<G4ResultOf_t<FuncT(const char*)>, Depth> GetDemangled(
static std::array<G4ResultOf_t<FuncT, const char*>, Depth> GetDemangled(
FuncT&& func = FrameFunctor());
private:
@@ -358,12 +358,12 @@ inline void G4Backtrace::ExitAction(int sig)
//----------------------------------------------------------------------------//
template <size_t Depth, size_t Offset, typename FuncT>
inline std::array<G4ResultOf_t<FuncT(const char*)>, Depth>
inline std::array<G4ResultOf_t<FuncT, const char*>, Depth>
G4Backtrace::GetMangled(FuncT&& func)
{
static_assert((Depth - Offset) >= 1, "Error Depth - Offset should be >= 1");
using type = G4ResultOf_t<FuncT(const char*)>;
using type = G4ResultOf_t<FuncT, const char*>;
// destination
std::array<type, Depth> btrace;
btrace.fill((std::is_pointer<type>::value) ? nullptr : type{});
@@ -393,7 +393,7 @@ G4Backtrace::GetMangled(FuncT&& func)
//----------------------------------------------------------------------------//
template <size_t Depth, size_t Offset, typename FuncT>
inline std::array<G4ResultOf_t<FuncT(const char*)>, Depth>
inline std::array<G4ResultOf_t<FuncT, const char*>, Depth>
G4Backtrace::GetDemangled(FuncT&& func)
{
auto demangle_bt = [&](const char* cstr) {
@@ -764,20 +764,20 @@ class G4Backtrace
{}
template <size_t Depth, size_t Offset = 0, typename FuncT = frame_func_t>
static std::array<G4ResultOf_t<FuncT(const char*)>, Depth> GetMangled(
static std::array<G4ResultOf_t<FuncT, const char*>, Depth> GetMangled(
FuncT&& func = FrameFunctor())
{
using type = G4ResultOf_t<FuncT(const char*)>;
using type = G4ResultOf_t<FuncT, const char*>;
auto ret = std::array<type, Depth>{};
ret.fill(func(""));
return ret;
}
template <size_t Depth, size_t Offset = 0, typename FuncT = frame_func_t>
static std::array<G4ResultOf_t<FuncT(const char*)>, Depth> GetDemangled(
static std::array<G4ResultOf_t<FuncT, const char*>, Depth> GetDemangled(
FuncT&& func = FrameFunctor())
{
using type = G4ResultOf_t<FuncT(const char*)>;
using type = G4ResultOf_t<FuncT, const char*>;
auto ret = std::array<type, Depth>{};
ret.fill(func(""));
return ret;
@@ -40,11 +40,11 @@
// |--> patch number
#ifndef G4VERSION_NUMBER
#define G4VERSION_NUMBER 1101
#define G4VERSION_NUMBER 1102
#endif
#ifndef G4VERSION_TAG
#define G4VERSION_TAG "$Name: geant4-11-00-patch-01 $"
#define G4VERSION_TAG "$Name: geant4-11-00-patch-02 $"
#endif
// as variables
@@ -53,10 +53,10 @@
#include "G4Types.hh"
#ifdef G4MULTITHREADED
static const G4String G4Version = "$Name: geant4-11-00-patch-01 [MT]$";
static const G4String G4Version = "$Name: geant4-11-00-patch-02 [MT]$";
#else
static const G4String G4Version = "$Name: geant4-11-00-patch-01 $";
static const G4String G4Version = "$Name: geant4-11-00-patch-02 $";
#endif
static const G4String G4Date = "(8-March-2022)";
static const G4String G4Date = "(25-May-2022)";
#endif
@@ -92,8 +92,8 @@ void G4PhysicsModelCatalog::Initialize() {
InsertModel( 10014, "model_TripletElectron" );
// gamma production
InsertModel( 10020, "model_Bremsstruhlung" );
InsertModel( 10021, "model_SplitBremssrahlung" );
InsertModel( 10020, "model_Bremsstrahlung" );
InsertModel( 10021, "model_SplitBremsstrahlung" );
InsertModel( 10022, "model_ComptonGamma" );
InsertModel( 10023, "model_Annihilation" );
InsertModel( 10024, "model_TripletGamma" );
+12
View File
@@ -16,6 +16,18 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
12-04-22 V.Ivanchenko (materials-V10-07-28)
- G4DensityEffectData, G4IonisParamMat - fixed density effect correction
for liquid hydrogen (problem #2346), code clean-up
- G4NistMaterialBuilder - fixed mean ionisation potentilal of carbon
to the current NIST value from 81 eV to 78 eV (problem #2474)
- G4Material - reorganized AddElement(..) and AddMaterial(..) methods,
temporary vector are used that allows addition of the same elements
during initialisation, when addition completed the vector of elements
and arrays of fractions are created, filled and temporary vectors
are deleted, as a result the code become more transparent and
fixing problem #2486
04-02-22 V.Ivanchenko (materials-V10-07-27)
- G4SandiaTable - fixed compilation warning on unused variable
@@ -61,7 +61,7 @@ public:
~G4DensityEffectData();
// return index by Z, -1 if material is not in the table
G4int GetElementIndex(G4int Z, G4State mState) const;
G4int GetElementIndex(G4int Z, G4State st = kStateUndefined) const;
// return index by material name, -1 if material is not in the table
G4int GetIndex(const G4String& matName) const;
+5
View File
@@ -351,6 +351,11 @@ private:
G4int fIdxComponent; // Index of a new component
G4bool fMassFraction; // Flag of the method to add components
// For composites built
std::vector<G4int>* fAtoms;
std::vector<G4double>* fElmFrac;
std::vector<const G4Element*>* fElm;
// For composites built via AddMaterial()
std::map<G4Material*, G4double> fMatComponents;
+2 -6
View File
@@ -1294,13 +1294,9 @@ void G4DensityEffectData::Initialize()
AddMaterial(M277,"G4_GRAPHITE_POROUS");
}
G4int G4DensityEffectData::GetElementIndex(G4int Z, G4State st) const
G4int G4DensityEffectData::GetElementIndex(G4int Z, G4State) const
{
G4int idx = -1;
if(Z > 0 && Z < NDENSELEM) {
if(st == state[Z] || st == kStateUndefined) { idx = indexZ[Z]; }
}
return idx;
return (Z >= 0 && Z < NDENSELEM) ? indexZ[Z] : -1;
}
G4int G4DensityEffectData::GetIndex(const G4String& matName) const
+3 -2
View File
@@ -212,11 +212,12 @@ void G4IonisParamMat::ComputeDensityEffectParameters()
G4double corr = 0.0;
if(idx < 0 && 1 == nelm) {
idx = fDensityData->GetElementIndex(Z0, fMaterial->GetState());
G4int z = (1 == Z0 && State == kStateLiquid) ? 0 : Z0;
idx = fDensityData->GetElementIndex(z);
// Correction for base material or for non-nominal density
// Except cases of very different density defined in user code
if(idx >= 0) {
if(idx >= 0 && 0 < z) {
G4double dens = nist->GetNominalDensity(Z0);
if(dens <= 0.0) { idx = -1; }
else {
+86 -121
View File
@@ -167,15 +167,6 @@ G4Material::G4Material(const G4String& name, G4double density,
fPressure = pressure;
fNbComponents = nComponents;
theElementVector = new G4ElementVector();
theElementVector->reserve(fNbComponents);
fAtomsVector = new G4int[fNbComponents];
fMassFractionVector = new G4double[fNbComponents];
for(G4int i=0; i<fNbComponents; ++i) {
fAtomsVector[i] = 0;
fMassFractionVector[i] = 0.0;
}
fMassFraction = true;
if (fState == kStateUndefined)
@@ -301,7 +292,7 @@ void G4Material::ComputeDerivedQuantities()
// Number of atoms per volume (per element), total nb of electrons per volume
G4double Zi, Ai;
fTotNbOfAtomsPerVolume = 0.;
if (fVecNbOfAtomsPerVolume) { delete [] fVecNbOfAtomsPerVolume; }
delete [] fVecNbOfAtomsPerVolume;
fVecNbOfAtomsPerVolume = new G4double[fNumberOfElements];
fTotNbOfElectPerVolume = 0.;
fFreeElecDensity = 0.;
@@ -369,7 +360,11 @@ void
G4Material::AddElementByNumberOfAtoms(const G4Element* elm, G4int nAtoms)
{
// perform checks consistency
if(0 == fIdxComponent) { fMassFraction = false; }
if(0 == fIdxComponent) {
fMassFraction = false;
fAtoms = new std::vector<G4int>;
fElm = new std::vector<const G4Element*>;
}
if(fIdxComponent >= fNbComponents) {
G4ExceptionDescription ed;
ed << "For material " << fName << " and added element "
@@ -381,51 +376,51 @@ G4Material::AddElementByNumberOfAtoms(const G4Element* elm, G4int nAtoms)
}
if(fMassFraction) {
G4ExceptionDescription ed;
G4cout << "For material " << fName << " and added element "
<< elm->GetName() << " with Natoms=" << nAtoms
<< " problem: cannot add by number of atoms after "
<< "addition of elements by mass fraction";
ed << "For material " << fName << " and added element "
<< elm->GetName() << " with Natoms=" << nAtoms
<< " problem: cannot add by number of atoms after "
<< "addition of elements by mass fraction";
G4Exception ("G4Material::AddElementByNumberOfAtoms()", "mat031",
FatalException, ed, "");
}
G4Element* element = const_cast<G4Element*>(elm);
// filling
if (fIdxComponent < fNbComponents) {
G4bool isAdded = false;
// filling
G4bool isAdded = false;
if(!fElm->empty()) {
for (G4int i=0; i<fNumberOfElements; ++i) {
if ( element == (*theElementVector)[i] ) {
G4ExceptionDescription ed;
ed << "For material " << fName << " and added element "
<< elm->GetName() << ", Natoms=" << nAtoms
<< ", fIdxComponent=" << fIdxComponent
<< " problem: attempt to add the same element, which already is at idx="
<< i << " with the Natoms=" << fAtomsVector[i];
G4Exception ("G4Material::AddElementByNumberOfAtoms()", "mat031",
JustWarning, ed, "");
fAtomsVector[i] += nAtoms;
if ( elm == (*fElm)[i] ) {
(*fAtoms)[i] += nAtoms;
isAdded = true;
break;
}
}
if(!isAdded) {
theElementVector->push_back(element);
fAtomsVector[fNumberOfElements] = nAtoms;
++fNumberOfElements;
}
}
if(!isAdded) {
fElm->push_back(elm);
fAtoms->push_back(nAtoms);
++fNumberOfElements;
}
++fIdxComponent;
// is filled
// is filled - complete composition of atoms
if (fIdxComponent == fNbComponents) {
// compute proportion by mass
theElementVector = new G4ElementVector();
theElementVector->reserve(fNumberOfElements);
fAtomsVector = new G4int[fNumberOfElements];
fMassFractionVector = new G4double[fNumberOfElements];
G4double Amol = 0.;
for (G4int i=0; i<fNumberOfElements; ++i) {
G4double w = fAtomsVector[i]*(*theElementVector)[i]->GetA();
theElementVector->push_back((*fElm)[i]);
fAtomsVector[i] = (*fAtoms)[i];
G4double w = fAtomsVector[i]*(*fElm)[i]->GetA();
Amol += w;
fMassFractionVector[i] = w;
}
for (G4int i=0; i<fNumberOfElements; ++i) {
fMassFractionVector[i] /= Amol;
}
delete fAtoms;
delete fElm;
fMassOfMolecule = Amol/Avogadro;
ComputeDerivedQuantities();
}
@@ -462,36 +457,31 @@ G4Material::AddElementByMassFraction(const G4Element* elm, G4double fraction)
ed << "For material " << fName << " and added element "
<< elm->GetName() << ", massFraction= " << fraction
<< ", fIdxComponent=" << fIdxComponent
<< " problem: attempt to add more than the declared number of elements "
<< "; attempt to add more than the declared number of components "
<< fIdxComponent << " >= " << fNbComponents;
G4Exception ("G4Material::AddElementByMassFraction()", "mat031",
FatalException, ed, "");
}
G4Element* element = const_cast<G4Element*>(elm);
if(0 == fIdxComponent) {
fElmFrac = new std::vector<G4double>;
fElm = new std::vector<const G4Element*>;
}
// filling
if (fIdxComponent < fNbComponents) {
G4bool isAdded = false;
G4bool isAdded = false;
if(!fElm->empty()) {
for (G4int i=0; i<fNumberOfElements; ++i) {
if ( element == (*theElementVector)[i] ) {
G4ExceptionDescription ed;
ed << "For material " << fName << " and added element "
<< elm->GetName() << ", massFraction= " << fraction
<< ", fIdxComponent=" << fIdxComponent
<< " problem: attempt to add the same element, which is already at idx="
<< i << " with the fraction " << fMassFractionVector[i];
G4Exception ("G4Material::AddElementByMassFraction()", "mat031",
JustWarning, ed, "");
fMassFractionVector[i] += fraction;
if ( elm == (*fElm)[i] ) {
(*fElmFrac)[i] += fraction;
isAdded = true;
break;
}
}
if(!isAdded) {
theElementVector->push_back(element);
fMassFractionVector[fNumberOfElements] = fraction;
++fNumberOfElements;
}
}
if(!isAdded) {
fElm->push_back(elm);
fElmFrac->push_back(fraction);
++fNumberOfElements;
}
++fIdxComponent;
@@ -527,15 +517,40 @@ void G4Material::AddMaterial(G4Material* material, G4double fraction)
G4ExceptionDescription ed;
ed << "For material " << fName << " and added material "
<< material->GetName() << ", massFraction= " << fraction
<< " attempt to add more than the declared number of elements "
<< "; attempt to add more than the declared number of components "
<< fIdxComponent << " >= " << fNbComponents;
G4Exception ("G4Material::AddMaterial()", "mat031", FatalException,
ed, "");
}
// filling
if (fIdxComponent < fNbComponents) {
fMatComponents[material] = fraction;
if(0 == fIdxComponent) {
fElmFrac = new std::vector<G4double>;
fElm = new std::vector<const G4Element*>;
}
// filling
G4int nelm = material->GetNumberOfElements();
for(G4int j=0; j<nelm; ++j) {
auto elm = material->GetElement(j);
auto frac = material->GetFractionVector();
G4bool isAdded = false;
if(!fElm->empty()) {
for (G4int i=0; i<fNumberOfElements; ++i) {
if ( elm == (*fElm)[i] ) {
(*fElmFrac)[i] += fraction*frac[j];
isAdded = true;
break;
}
}
}
if(!isAdded) {
fElm->push_back(elm);
fElmFrac->push_back(fraction*frac[j]);
++fNumberOfElements;
}
}
fMatComponents[material] = fraction;
++fIdxComponent;
// is filled
@@ -547,70 +562,20 @@ void G4Material::AddMaterial(G4Material* material, G4double fraction)
void G4Material::FillVectors()
{
// there are material components
if(!fMatComponents.empty()) {
G4int nel = fNumberOfElements;
// check list of materials
for(auto & x : fMatComponents) {
const G4Material* mat = x.first;
G4int nn = mat->GetNumberOfElements();
for(G4int j=0; j<nn; ++j) {
G4bool yes = true;
const G4Element* elm = mat->GetElement(j);
for(G4int k=0; k<fNumberOfElements; ++k) {
if(elm == (*theElementVector)[k]) {
yes = false;
break;
}
}
if(yes) { ++nel; }
}
}
// resize vectors
if(nel > fNbComponents) {
delete [] fAtomsVector;
fAtomsVector = new G4int[nel];
G4double* v = new G4double[nel];
for(G4int i=0; i<fNumberOfElements; ++i) {
fAtomsVector[i] = 0;
v[i] = fMassFractionVector[i];
}
delete [] fMassFractionVector;
fMassFractionVector = v;
for(G4int i=fNumberOfElements; i<nel; ++i) {
fAtomsVector[i] = 0;
fMassFractionVector[i] = 0.0;
}
}
// filling
for(auto & x : fMatComponents) {
const G4Material* mat = x.first;
G4double frac = x.second;
G4int nn = mat->GetNumberOfElements();
const G4double* elmFrac = mat->GetFractionVector();
for(G4int j=0; j<nn; ++j) {
G4bool yes = true;
const G4Element* elm = mat->GetElement(j);
for(G4int k=0; k<fNumberOfElements; ++k) {
if(elm == (*theElementVector)[k]) {
fMassFractionVector[k] += frac*elmFrac[j];
yes = false;
break;
}
}
if(yes) {
theElementVector->push_back(const_cast<G4Element*>(elm));
fMassFractionVector[fNumberOfElements] = frac*elmFrac[j];
++fNumberOfElements;
}
}
}
}
// check sum of weights -- OK?
theElementVector = new G4ElementVector();
theElementVector->reserve(fNumberOfElements);
fAtomsVector = new G4int[fNumberOfElements];
fMassFractionVector = new G4double[fNumberOfElements];
G4double wtSum(0.0);
for (G4int i=0; i<fNumberOfElements; ++i) {
theElementVector->push_back((*fElm)[i]);
fMassFractionVector[i] = (*fElmFrac)[i];
wtSum += fMassFractionVector[i];
}
delete fElmFrac;
delete fElm;
// check sum of weights -- OK?
if (std::abs(1.-wtSum) > perThousand) {
G4ExceptionDescription ed;
ed << "For material " << fName << " sum of fractional masses "
@@ -734,7 +734,7 @@ void G4NistMaterialBuilder::NistSimpleMaterials()
AddMaterial("G4_Li", 0.534 , 3, 40. );
AddMaterial("G4_Be", 1.848 , 4, 63.7);
AddMaterial("G4_B" , 2.37 , 5, 76. );
AddMaterial("G4_C" , 2. , 6, 81. );
AddMaterial("G4_C" , 2. , 6, 78. );
AddMaterial("G4_N" , 1.16520e-3, 7, 82. , 1, kStateGas);
AddMaterial("G4_O" , 1.33151e-3, 8, 95. , 1, kStateGas);
AddMaterial("G4_F" , 1.58029e-3, 9, 115. , 1, kStateGas);
+3
View File
@@ -16,6 +16,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
- 09 February 2022 Gabriele Cosmo (particles-V10-07-11)
- Fixed compilation warnings on Intel compiler for unused variables.
- 02 November 2021 Gabriele Cosmo (particles-V10-07-10)
- Fix for potential null pointer dereference in G4ParticleTable::FindParticle().
Based on GitHub PR#30 (https://github.com/Geant4/geant4/pull/30).
@@ -142,11 +142,11 @@ G4DecayProducts* G4MuonDecayChannel::DecayIt(G4double)
// daughters'mass
G4double daughtermass[N_DAUGHTER];
G4double sumofdaughtermass = 0.0;
//G4double sumofdaughtermass = 0.0;
for (G4int index=0; index<N_DAUGHTER; ++index)
{
daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
sumofdaughtermass += daughtermass[index];
//sumofdaughtermass += daughtermass[index];
}
// create parent G4DynamicParticle at rest
@@ -116,11 +116,11 @@ G4DecayProducts* G4MuonDecayChannelWithSpin::DecayIt(G4double)
//daughters'mass
G4double daughtermass[3];
G4double sumofdaughtermass = 0.0;
//G4double sumofdaughtermass = 0.0;
for (G4int index=0; index<3; ++index)
{
daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
sumofdaughtermass += daughtermass[index];
//sumofdaughtermass += daughtermass[index];
}
G4double EMASS = daughtermass[0];
@@ -148,11 +148,11 @@ G4DecayProducts* G4MuonRadiativeDecayChannelWithSpin::DecayIt(G4double)
// daughters'mass
G4double daughtermass[4];
G4double sumofdaughtermass = 0.0;
//G4double sumofdaughtermass = 0.0;
for (G4int index=0; index<4; ++index)
{
daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
sumofdaughtermass += daughtermass[index];
//sumofdaughtermass += daughtermass[index];
}
G4double EMASS = daughtermass[0];
@@ -173,11 +173,11 @@ G4DecayProducts* G4PionRadiativeDecayChannel::DecayIt(G4double)
// daughters'mass
const G4int N_DAUGHTER=3;
G4double daughtermass[N_DAUGHTER];
G4double sumofdaughtermass = 0.0;
//G4double sumofdaughtermass = 0.0;
for (G4int index=0; index<N_DAUGHTER; ++index)
{
daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
sumofdaughtermass += daughtermass[index];
//sumofdaughtermass += daughtermass[index];
}
G4double EMASS = daughtermass[0];
+16
View File
@@ -16,6 +16,22 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
04 April 2022 S. Losilla (gdml-V10-07-16)
- Changed default temperature to 20 °C (followup to commit ba61d0).
14 March 2022 W. Pokorski
- Removed a forgotten (used for debugging) cout in G4GDMLReadSolids::PropertyRead.
5 March 2022 M. Asai
- G4GDMLReadSolids, G4GDMLReadStructure:
Use original find methods in G4SolidStore, G4LogicalVolumeStore and
G4PhysicalVolumeStore to simplify the code.
16 February 2022 M. Asai
- G4GDMLParser, G4GDMLReadDefine, G4GDMLReadSolids, G4GDMLReadStructure:
Addressing to the case of solid/volune name duplication when reading
more than one gdml files.
05 November 2021 G. Cosmo (gdml-V10-07-15)
- G4GDMLParser: issue notification warning in ImportRegions() in case
more than one logical volume with same name is found, to be set a
@@ -124,6 +124,7 @@ class G4GDMLParser
inline void SetRegionExport(G4bool);
inline void SetEnergyCutsExport(G4bool);
inline void SetSDExport(G4bool);
inline void SetReverseSearch(G4bool);
inline G4int GetMaxExportLevel() const; // Manage max number of levels
inline void SetMaxExportLevel(G4int); // to export
@@ -229,6 +229,11 @@ inline void G4GDMLParser::SetSDExport(G4bool flag)
writer->SetSDExport(flag);
}
inline void G4GDMLParser::SetReverseSearch(G4bool flag)
{
reader->SetReverseSearch(flag);
}
inline G4int G4GDMLParser::GetMaxExportLevel() const
{
return writer->GetMaxExportLevel();
@@ -78,6 +78,9 @@ class G4GDMLReadDefine : public G4GDMLRead
virtual void DefineRead(const xercesc::DOMElement* const);
inline void SetReverseSearch(G4bool flag)
{ reverseSearch = flag; }
protected:
G4GDMLReadDefine();
@@ -97,7 +100,7 @@ class G4GDMLReadDefine : public G4GDMLRead
void ExpressionRead(const xercesc::DOMElement* const);
protected:
G4bool reverseSearch = false;
std::map<G4String, G4double> quantityMap;
std::map<G4String, G4ThreeVector> positionMap;
std::map<G4String, G4ThreeVector> rotationMap;
@@ -242,7 +242,7 @@ G4double G4GDMLReadMaterials::PRead(const xercesc::DOMElement* const PElement)
// --------------------------------------------------------------------
G4double G4GDMLReadMaterials::TRead(const xercesc::DOMElement* const TElement)
{
G4double value = STP_Temperature;
G4double value = NTP_Temperature;
G4double unit = kelvin;
const xercesc::DOMNamedNodeMap* const attributes = TElement->getAttributes();
@@ -552,7 +552,7 @@ void G4GDMLReadMaterials::MaterialRead(
G4double a = 0.0;
G4double D = 0.0;
G4State state = kStateUndefined;
G4double T = STP_Temperature;
G4double T = NTP_Temperature;
G4double P = STP_Pressure;
G4double MEE = -1.0;
@@ -3559,7 +3559,6 @@ void G4GDMLReadSolids::PropertyRead(
{
G4MaterialPropertyVector* propvect;
G4String temp = name + ref;
std::cout << temp << std::endl;
// first check if it was already built
if(mapOfMatPropVects.find(temp) == mapOfMatPropVects.end())
{
@@ -4057,7 +4056,8 @@ void G4GDMLReadSolids::SolidsRead(
// --------------------------------------------------------------------
G4VSolid* G4GDMLReadSolids::GetSolid(const G4String& ref) const
{
G4VSolid* solidPtr = G4SolidStore::GetInstance()->GetSolid(ref, false);
G4VSolid* solidPtr = G4SolidStore::GetInstance()
->GetSolid(ref,false,reverseSearch);
if(solidPtr == nullptr)
{
@@ -823,7 +823,15 @@ void G4GDMLReadStructure::AssemblyRead(
xercesc::XMLString::release(&name_attr);
G4AssemblyVolume* pAssembly = new G4AssemblyVolume();
assemblyMap.insert(std::make_pair(GenerateName(name), pAssembly));
auto aName = GenerateName(name);
if(reverseSearch)
{
assemblyMap.insert_or_assign(aName, pAssembly);
}
else
{
assemblyMap.insert(std::make_pair(aName, pAssembly));
}
for(xercesc::DOMNode* iter = assemblyElement->getFirstChild();
iter != nullptr; iter = iter->getNextSibling())
@@ -1067,8 +1075,8 @@ void G4GDMLReadStructure::StructureRead(
// --------------------------------------------------------------------
G4VPhysicalVolume* G4GDMLReadStructure::GetPhysvol(const G4String& ref) const
{
G4VPhysicalVolume* physvolPtr =
G4PhysicalVolumeStore::GetInstance()->GetVolume(ref, false);
G4VPhysicalVolume* physvolPtr
= G4PhysicalVolumeStore::GetInstance()->GetVolume(ref,false,reverseSearch);
if(physvolPtr == nullptr)
{
@@ -1083,8 +1091,8 @@ G4VPhysicalVolume* G4GDMLReadStructure::GetPhysvol(const G4String& ref) const
// --------------------------------------------------------------------
G4LogicalVolume* G4GDMLReadStructure::GetVolume(const G4String& ref) const
{
G4LogicalVolume* volumePtr =
G4LogicalVolumeStore::GetInstance()->GetVolume(ref, false);
G4LogicalVolume* volumePtr
= G4LogicalVolumeStore::GetInstance()->GetVolume(ref,false,reverseSearch);
if(volumePtr == nullptr)
{
@@ -13,6 +13,10 @@ introduced in the code and keeptrack of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
24 February 2022, V.Ivanchenko (phys-ctor-em-V10-07-25)
- G4EmStandardPhysics_option4 - use G4UrbanFluctuation model
for e+- to address problem #2466
11 December 2021, V.Ivanchenko (phys-ctor-em-V10-07-24)
- G4EmStandardPhysics_option3 - use options providing more accurate
simulation without loss of CPU performance: RangeFactor=0.03,
@@ -79,6 +79,7 @@
#include "G4LivermoreIonisationModel.hh"
#include "G4PenelopeIonisationModel.hh"
#include "G4UniversalFluctuation.hh"
#include "G4UrbanFluctuation.hh"
#include "G4eplusAnnihilation.hh"
@@ -244,6 +245,7 @@ void G4EmStandardPhysics_option4::ConstructProcess()
// ionisation
G4eIonisation* eioni = new G4eIonisation();
G4VEmModel* theIoniLiv = new G4LivermoreIonisationModel();
eioni->SetFluctModel(new G4UrbanFluctuation());
theIoniLiv->SetHighEnergyLimit(0.1*CLHEP::MeV);
eioni->AddEmModel(0, theIoniLiv, new G4UniversalFluctuation() );
@@ -289,6 +291,7 @@ void G4EmStandardPhysics_option4::ConstructProcess()
// ionisation
eioni = new G4eIonisation();
eioni->SetFluctModel(new G4UrbanFluctuation());
G4VEmModel* pen = new G4PenelopeIonisationModel();
pen->SetHighEnergyLimit(0.1*CLHEP::MeV);
eioni->AddEmModel(0, pen, new G4UniversalFluctuation());
+5 -1
View File
@@ -16,9 +16,13 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
March. 14th, 2022 - I. Hrivnacova (proccuts-V10-07-07)
- G4VRangeToEnergyConverter - fixed clearing of static data
in destructor
January. 19th, 2022 - V.Ivantchenko (proccuts-V10-07-06)
- G4VRangeToEnergyConverter - fixed construction/destruction of
static data (initial problem identified by I. Hrivnakova)
static data (initial problem identified by I. Hrivnacova)
October. 12th, 2021 - V.Ivanchenko (proccuts-V10-07-05)
- G4PhysicsTableHelper - fixed Coverity warning due to index type,
@@ -78,6 +78,8 @@ G4VRangeToEnergyConverter::~G4VRangeToEnergyConverter()
{
delete Energy;
Energy = nullptr;
Emin = 0.;
Emax = 0.;
}
}
@@ -14,6 +14,9 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------*
18-05-2022, G. Cosmo, emdna-V10-07-16
- G4ITTransportation: fixed misuse of bitwise '|' operator instead of logical.
8-11-2021, H. Tran, emdna-V10-07-15
- corrected Circular dependencies for mesoscopic model
- corrected the problem in IRT
@@ -943,7 +943,7 @@ G4VParticleChange* G4ITTransportation::PostStepDoIt(const G4Track& track,
// Update the Step flag which identifies the Last Step in a volume
isLastStep = fLinearNavigator->ExitedMotherVolume()
| fLinearNavigator->EnteredDaughterVolume();
|| fLinearNavigator->EnteredDaughterVolume();
#ifdef G4DEBUG_TRANSPORT
// Checking first implementation of flagging Last Step in Volume
@@ -16,6 +16,17 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
07 April 2022 V.Ivanchenko (emutils-V10-07-40)
- G4VMultipleScattering - fix #2480 responsible for energy deposition shift of
custom CMS Physics List FTFP_BERT_EMM
01 April 2022 J.Hahnfeld
- Fix typo in Bremsstrahlung.
24 March 2022: V.Ivanchenko
- G4VEnergyLossProcess - fix fluctuation model pointer if an extra
model is added on top of the default list of models
22 January 22: V.Ivanchenko (emutils-V10-07-39)
- G4EmParametersMessenger - added forgotten UI command to enable polarisation
@@ -50,6 +50,8 @@ enum G4EmSecondaryParticleType
_ComptonElectron = 10013,
_TripletElectron = 10014,
_Bremsstrahlung = 10020,
// Legacy name for compatibility with Geant4 11.0 and patch01.
_Bremsstruhlung = 10020,
_SplitBremsstrahlung = 10021,
_ComptonGamma = 10022,
@@ -218,8 +218,9 @@ void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* ptr,
const G4Region* region)
{
if(nullptr == ptr) { return; }
modelManager->AddEmModel(order, ptr, fluc, region);
ptr->SetParticleChange(pParticleChange, fluc);
G4VEmFluctuationModel* afluc = (nullptr == fluc) ? fluctModel : fluc;
modelManager->AddEmModel(order, ptr, afluc, region);
ptr->SetParticleChange(pParticleChange, afluc);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -408,7 +409,7 @@ G4VEnergyLossProcess::PreparePhysicsTable(const G4ParticleDefinition& part)
// defined ID of secondary particles
G4int stype = GetProcessSubType();
if(stype == fBremsstrahlung) {
secID = _Bremsstruhlung;
secID = _Bremsstrahlung;
biasID = _SplitBremsstrahlung;
} else if(stype == fPairProdByCharged) {
secID = _PairProduction;
@@ -300,9 +300,11 @@ void G4VMultipleScattering::StreamInfo(std::ostream& outFile,
void G4VMultipleScattering::StartTracking(G4Track* track)
{
G4VEnergyLossProcess* eloss = nullptr;
if(track->GetParticleDefinition() != currParticle) {
currParticle = track->GetParticleDefinition();
fIonisation = emManager->GetEnergyLossProcess(currParticle);
eloss = fIonisation;
}
/*
G4cout << "G4VMultipleScattering::StartTracking Nmod= " << numberOfModels
@@ -312,7 +314,8 @@ void G4VMultipleScattering::StartTracking(G4Track* track)
<< G4LossTableManager::Instance()->IsMaster()
<< G4endl;
*/
for(auto & msc : mscModels) {
for(G4int i=0; i<numberOfModels; ++i) {
G4VMscModel* msc = GetModelByIndex(i);
/*
G4cout << "Next model " << msc
<< " Emin= " << msc->LowEnergyLimit()
@@ -320,7 +323,9 @@ void G4VMultipleScattering::StartTracking(G4Track* track)
<< " Eact= " << msc->LowEnergyActivationLimit() << G4endl;
*/
msc->StartTracking(track);
msc->SetIonisation(fIonisation, currParticle);
if(nullptr != eloss) {
msc->SetIonisation(eloss, currParticle);
}
}
}
@@ -14,6 +14,9 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
04 February 2022 - Vladimir Ivanchenko (hadr-cross-V10-07-23)
- G4HadronNucleonXsc - fixed compilation warning on unused variable
03 January 2022 - Alberto Ribon (hadr-cross-V10-07-22)
- G4ComponentAntiNuclNuclearXS : extension, by Vladimir Uzhinsky, of
the class to compute the cross sections of light anti-nuclei on
@@ -1122,12 +1122,7 @@ G4double G4HadronNucleonXsc::HadronNucleonXscVU(
G4int PDGcode = theParticle->GetPDGEncoding();
G4int absPDGcode = std::abs(PDGcode);
G4double mass = theParticle->GetPDGMass();
G4double Elab = ekin + mass;
// (s - 2*0.88*GeV*GeV)/(2*0.939*GeV)/GeV;
G4double Plab = std::sqrt(ekin*(ekin + 2.*mass));
Elab *= invGeV;
Plab *= invGeV;
G4double Plab = std::sqrt(ekin*(ekin + 2.*mass))*invGeV;
G4double logPlab = G4Log( Plab );
G4double sqrLogPlab = logPlab * logPlab;
+10 -1
View File
@@ -15,8 +15,17 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
20 April 2022 - Alberto Ribon (hadr-abla-V10-07-06)
---------------------------------------------------
- G4Abla.cc : fixed compilation warnings for 'may be used uninitialized'
variables.
9 February 2022 - Gabriele Cosmo
--------------------------------
- Fixed compilation warnings on Intel compilers for unused variables.
8 November 2021 - Jose Luis Rodriguez Sanchez (hadr-abla-V10-07-05)
-----------------------------------------------------
-------------------------------------------------------------------
- Update of G4Abla for hypernuclei.
27 October 2021 - Alberto Ribon (hadr-abla-V10-07-04)
@@ -288,6 +288,7 @@ public:
void dump()
{
/*
G4double totA = 0.0, totZ = 0.0, totP = 0.0;
// G4cout <<"i \t ACV \t ZPCV \t PCV" << G4endl;
for(G4int i = 0; i <= iv; i++) {
@@ -301,6 +302,7 @@ public:
}
// G4cout <<"Particle count index (iv) = " << iv << G4endl;
// G4cout <<"ABLA Total: A = " << totA << " Z = " << totZ << " momentum = " << totP << G4endl;
*/
}
G4double acv[VOLANTSIZE],zpcv[VOLANTSIZE],pcv[VOLANTSIZE],xcv[VOLANTSIZE];
@@ -8162,7 +8162,7 @@ c Delta_u2_shell.
G4double re1,re2,re3;
G4double eps1,eps2;
G4double Z1UCD,Z2UCD;
G4double beta,beta1,beta2;
G4double beta=0.,beta1=0.,beta2=0.;
// double betacomplement;
G4double DN1_POL;
/* shift of most probable neutron number for given Z,
@@ -8184,9 +8184,9 @@ c Delta_u2_shell.
G4double E_eff1_saddle,E_eff2_saddle;
G4double Epot0_mode1_saddle,Epot0_mode2_saddle,Epot0_symm_saddle;
G4double Epot_mode1_saddle,Epot_mode2_saddle,Epot_symm_saddle;
G4double E_defo,E_defo1,E_defo2,E_scission_pre,E_scission_post;
G4double E_defo,E_defo1,E_defo2,E_scission_pre=0.,E_scission_post;
G4double E_asym;
G4double E1exc,E2exc;
G4double E1exc=0.,E2exc=0.;
G4double E1exc_sigma,E2exc_sigma;
G4double TKER;
G4double EkinR1,EkinR2;
@@ -8199,7 +8199,7 @@ c Delta_u2_shell.
G4double E_HELP;
G4double Z_scission,N_scission,A_scission;
G4double Z2_over_A_eff;
G4double beta1gs,beta2gs,betags;
G4double beta1gs=0.,beta2gs=0.,betags=0.;
G4double sigZmin; // 'Minimum neutron width for constant Z'
G4double DSN132,Delta_U1_shell,E_eff0_saddle;//,e_scission;
G4int NbLam0= (*NbLam0_par);
@@ -14,6 +14,11 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
9 February 2022 Gabriele Cosmo (hadr-casc-V11-00-01)
-----------------------------------------------------
- Fixed compilation warnings on Intel compilers for unused variables.
- Use const iterator in G4InuclEvaporation::BreakItUp(..).
4 August 2021 Alberto Ribon (hadr-casc-V10-07-04)
--------------------------------------------------
- G4CascadeInterface : set the creator model ID for the secondaries
@@ -134,23 +134,20 @@ G4FragmentVector* G4InuclEvaporation::BreakItUp(const G4Fragment &theNucleus) {
const std::vector<G4InuclNuclei>& outgoingNuclei = output.getOutgoingNuclei();
const std::vector<G4InuclElementaryParticle>& particles = output.getOutgoingParticles();
G4double eTot=0.0;
G4int i=1;
if (!particles.empty()) {
G4int outgoingType;
particleIterator ipart = particles.begin();
for (; ipart != particles.end(); ipart++) {
particleIterator ipart = particles.cbegin();
for (; ipart != particles.cend(); ++ipart) {
outgoingType = ipart->type();
if (verboseLevel > 2) {
G4cout << "Evaporated particle: " << i << " of type: "
<< outgoingType << G4endl;
i++;
++i;
}
eTot += ipart->getEnergy();
G4LorentzVector vlab = ipart->getMomentum().boost(boostToLab);
// TEMPORARY: Remove constness on PD until G4Fragment is fixed
@@ -159,14 +156,12 @@ G4FragmentVector* G4InuclEvaporation::BreakItUp(const G4Fragment &theNucleus) {
}
if (!outgoingNuclei.empty()) {
nucleiIterator ifrag = outgoingNuclei.begin();
for (i=1; ifrag != outgoingNuclei.end(); ifrag++) {
nucleiIterator ifrag = outgoingNuclei.cbegin();
for (i=1; ifrag != outgoingNuclei.cend(); ++ifrag) {
if (verboseLevel > 2) {
G4cout << " Nuclei fragment: " << i << G4endl; i++;
G4cout << " Nuclei fragment: " << i << G4endl; ++i;
}
eTot += ifrag->getEnergy();
G4LorentzVector vlab = ifrag->getMomentum().boost(boostToLab);
G4int fragA = ifrag->getA();
@@ -14,6 +14,12 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
04 February 2022 - V.Ivanchenko (hadr-cohe-V10-07-06)
-----------------------------------------------------
- G4ElasticHadrNucleusHE, G4NeutronElectronElModel, G4NeutrinoElectronNcModel
fixed compilation warnings on unused variables; removed commented lines;
use Energy(..) method of G4PhysicsVector instead of obsolete GetLowEdgeEnergy(...)
03 January 2022 - A.Ribon (hadr-cohe-V10-07-05)
--------------------------------------------------
- G4AntiNuclElastic : Vladimir Uzhinsky's correction in the SampleInvariantT
@@ -873,7 +873,7 @@ G4ElasticHadrNucleusHE::HadrNucDifferCrSec(G4int A, G4double aQ2)
G4double ImElasticAmpl0 = 0;
G4double ReElasticAmpl0 = 0;
G4double Tot1=0, exp1;
G4double exp1;
for(G4int i=1; i<=A; ++i) {
N *= (-Unucl*Rho2*(A-i+1)/(G4double)i);
@@ -892,14 +892,12 @@ G4ElasticHadrNucleusHE::HadrNucDifferCrSec(G4int A, G4double aQ2)
G4double dcos = N*std::cos(FiH*i);
ReElasticAmpl0 += Prod1*N*std::sin(FiH*i);
ImElasticAmpl0 += Prod1*dcos;
Tot1 += medTot*dcos;
if(std::abs(Prod1*N/ImElasticAmpl0) < 0.000001) break;
} // i
static const G4double pi25 = CLHEP::pi/2.568;
ImElasticAmpl0 *= pi25; // The amplitude in mB
ReElasticAmpl0 *= pi25; // The amplitude in mB
Tot1 *= 2*pi25;
G4double C1 = R13Ap*R13Ap*0.5*DDSec1p;
G4double C2 = 2*R23Ap*R13Ap*0.5*DDSec2p;
@@ -952,7 +950,6 @@ G4ElasticHadrNucleusHE::HadrNucDifferCrSec(G4int A, G4double aQ2)
(ImElasticAmpl0+Din1)*
(ImElasticAmpl0+Din1))/twopi;
Tot1 -= DTot1;
Dtot11 = DTot1;
aAIm = ImElasticAmpl0;
aDIm = Din1;
@@ -63,24 +63,21 @@ G4NeutrinoElectronNcModel::G4NeutrinoElectronNcModel(const G4String& name)
G4NeutrinoElectronNcModel::~G4NeutrinoElectronNcModel()
{}
void G4NeutrinoElectronNcModel::ModelDescription(std::ostream& outFile) const
{
outFile << "G4NeutrinoElectronNcModel is a neutrino-electron (neutral current) elastic scattering\n"
<< "model which uses the standard model \n"
<< "transfer parameterization. The model is fully relativistic\n";
outFile << "G4NeutrinoElectronNcModel is a neutrino-electron (neutral current) elastic scattering\n"
<< "model which uses the standard model \n"
<< "transfer parameterization. The model is fully relativistic\n";
}
/////////////////////////////////////////////////////////
G4bool G4NeutrinoElectronNcModel::IsApplicable(const G4HadProjectile & aTrack,
G4Nucleus & targetNucleus)
G4bool G4NeutrinoElectronNcModel::IsApplicable(const G4HadProjectile & aTrack, G4Nucleus&)
{
G4bool result = false;
G4String pName = aTrack.GetDefinition()->GetParticleName();
G4double minEnergy = 0., energy = aTrack.GetTotalEnergy();
G4double minEnergy = 0.;
G4double energy = aTrack.GetTotalEnergy();
if( fCutEnergy > 0. ) // min detected recoil electron energy
{
@@ -93,9 +90,6 @@ G4bool G4NeutrinoElectronNcModel::IsApplicable(const G4HadProjectile & aTrack,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -104,7 +98,7 @@ G4bool G4NeutrinoElectronNcModel::IsApplicable(const G4HadProjectile & aTrack,
//
G4HadFinalState* G4NeutrinoElectronNcModel::ApplyYourself(
const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
const G4HadProjectile& aTrack, G4Nucleus&)
{
theParticleChange.Clear();
@@ -166,9 +160,6 @@ G4HadFinalState* G4NeutrinoElectronNcModel::ApplyYourself(
theParticleChange.SetEnergyChange( nuTkin );
theParticleChange.SetMomentumChange( aTrack.Get4Momentum().vect().unit() );
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return &theParticleChange;
}
@@ -69,7 +69,7 @@ G4NeutronElectronElModel::G4NeutronElectronElModel(const G4String& name)
fEnergyBin = 200;
fMinEnergy = 1.*MeV;
fMaxEnergy = 10000.*GeV;
fEnergyVector = new G4PhysicsLogVector(fMinEnergy, fMaxEnergy, fEnergyBin);
fEnergyVector = new G4PhysicsLogVector(fMinEnergy, fMaxEnergy, fEnergyBin, false);
fAngleBin = 500;
fAngleTable = 0;
@@ -86,7 +86,7 @@ G4NeutronElectronElModel::~G4NeutronElectronElModel()
if( fEnergyVector )
{
delete fEnergyVector;
fEnergyVector = 0;
fEnergyVector = nullptr;
}
if( fAngleTable )
{
@@ -100,36 +100,19 @@ G4NeutronElectronElModel::~G4NeutronElectronElModel()
void G4NeutronElectronElModel::ModelDescription(std::ostream& outFile) const
{
outFile << "G4NeutronElectronElModel is a neutrino-electron (neutral current) elastic scattering\n"
<< "model which uses the standard model \n"
<< "transfer parameterization. The model is fully relativistic\n";
outFile << "G4NeutronElectronElModel is a neutrino-electron (neutral current) elastic scattering\n"
<< "model which uses the standard model \n"
<< "transfer parameterization. The model is fully relativistic\n";
}
/////////////////////////////////////////////////////////
G4bool G4NeutronElectronElModel::IsApplicable(const G4HadProjectile & aTrack,
G4Nucleus & targetNucleus)
G4bool G4NeutronElectronElModel::IsApplicable(const G4HadProjectile & aTrack, G4Nucleus&)
{
G4bool result = false;
G4String pName = aTrack.GetDefinition()->GetParticleName();
// G4double minEnergy = 0.;
G4double energy = aTrack.GetTotalEnergy();
if( fCutEnergy > 0. ) // min detected recoil electron energy
{
// minEnergy = 0.5*(fCutEnergy+sqrt(fCutEnergy*(fCutEnergy+2.*electron_mass_c2)));
}
if( pName == "neutron" &&
energy >= fMinEnergy && energy <= fMaxEnergy )
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
return (pName == "neutron" && energy >= fMinEnergy && energy <= fMaxEnergy);
}
////////////////////////////////////////////////////
@@ -180,7 +163,7 @@ G4double G4NeutronElectronElModel::SampleSin2HalfTheta(G4double Tkin)
for( iTkin = 0; iTkin < fEnergyBin; iTkin++)
{
if( Tkin < fEnergyVector->GetLowEdgeEnergy(iTkin) ) break;
if( Tkin < fEnergyVector->Energy(iTkin) ) break;
}
if ( iTkin >= fEnergyBin ) iTkin = fEnergyBin-1; // Tkin is more then theMaxEnergy
if ( iTkin < 0 ) iTkin = 0; // against negative index, Tkin < theMinEnergy
@@ -214,8 +197,7 @@ G4NeutronElectronElModel:: GetTransfer( G4int iTkin, G4int iTransfer, G4double p
if( iTransfer == 0 || iTransfer == fAngleBin-1 )
{
randTransfer = (*fAngleTable)(iTkin)->GetLowEdgeEnergy(iTransfer);
// iTransfer++;
randTransfer = (*fAngleTable)(iTkin)->Energy(iTransfer);
}
else
{
@@ -226,8 +208,8 @@ G4NeutronElectronElModel:: GetTransfer( G4int iTkin, G4int iTransfer, G4double p
y1 = (*(*fAngleTable)(iTkin))(iTransfer-1);
y2 = (*(*fAngleTable)(iTkin))(iTransfer);
x1 = (*fAngleTable)(iTkin)->GetLowEdgeEnergy(iTransfer-1);
x2 = (*fAngleTable)(iTkin)->GetLowEdgeEnergy(iTransfer);
x1 = (*fAngleTable)(iTkin)->Energy(iTransfer-1);
x2 = (*fAngleTable)(iTkin)->Energy(iTransfer);
delta = y2 - y1;
mean = y2 + y1;
@@ -235,8 +217,6 @@ G4NeutronElectronElModel:: GetTransfer( G4int iTkin, G4int iTransfer, G4double p
if ( x1 == x2 ) randTransfer = x2;
else
{
// if ( y1 == y2 )
if ( delta < epsilon*mean )
{
randTransfer = x1 + ( x2 - x1 )*G4UniformRand();
@@ -280,7 +260,7 @@ G4double G4NeutronElectronElModel::XscIntegrand(G4double x)
//
G4HadFinalState* G4NeutronElectronElModel::ApplyYourself(
const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
const G4HadProjectile& aTrack, G4Nucleus&)
{
theParticleChange.Clear();
@@ -363,9 +343,6 @@ G4HadFinalState* G4NeutronElectronElModel::ApplyYourself(
theParticleChange.SetEnergyChange( Tkin );
theParticleChange.SetMomentumChange( aTrack.Get4Momentum().vect().unit() );
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return &theParticleChange;
}
@@ -15,9 +15,13 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
18 May 2022 - Gabriele Cosmo (hadr-inclxx-V10-07-08)
----------------------------------------------------
- Fixed misuse of bitwise '|' operator instead of logical in INCL::postCascade()
and in INCL::makeCompoundNucleus().
03 March 2022 - Alberto Ribon (hadr-inclxx-V10-07-07)
-------------------------------------------------------
-----------------------------------------------------
- G4INCLXXInterface : fixed treatment of kaon0, anti_kaon0, kaon0L, and kaon0S.
In current reference physics lists, INCLXX is never used for handling kaons,
although it is capable of doing so, but at process-level or in custom
@@ -25,6 +29,11 @@ code and to keep track of all tags.
neutral kaon projectiles. The change (provided by Jean-Christophe David)
fixes this misbehavior.
09 February 2022 - Gabriele Cosmo
---------------------------------
- Fixed compilation warnings on Intel compilers for shadowing of variables
and not used variable.
09 November 2021 - Alberto Ribon (hadr-inclxx-V10-07-06)
-------------------------------------------------------
- G4INCLNuclearPotentialIsospin : improved nuclear potential for
@@ -255,11 +255,11 @@ namespace G4INCL {
// First compute the current CM position and total momentum
ThreeVector theCMPosition, theTotalMomentum;
G4double theTotalEnergy = 0.0;
// G4double theTotalEnergy = 0.0;
for(ParticleIter p=particles.begin(), e=particles.end(); p!=e; ++p) {
theCMPosition += (*p)->getPosition();
theTotalMomentum += (*p)->getMomentum();
theTotalEnergy += (*p)->getEnergy();
// theTotalEnergy += (*p)->getEnergy();
}
theCMPosition /= theA;
// assert((unsigned int)theA==particles.size());
@@ -148,8 +148,8 @@ namespace G4INCL {
**/
inline G4double getFermiMomentum(const Particle * const p) const {
if(p->isDelta()) {
const G4double Tf = getFermiEnergy(p), m = p->getMass();
return std::sqrt(Tf*(Tf+2.*m));
const G4double Tf = getFermiEnergy(p), mass = p->getMass();
return std::sqrt(Tf*(Tf+2.*mass));
} else {
std::map<ParticleType, G4double>::const_iterator i = fermiMomentum.find(p->getType());
// assert(i!=fermiMomentum.end());
@@ -345,9 +345,9 @@ namespace G4INCL {
std::string print();
Store* getStore() const {return theStore; };
void setStore(Store *s) {
void setStore(Store *str) {
delete theStore;
theStore = s;
theStore = str;
};
G4double getInitialInternalEnergy() const { return initialInternalEnergy; };
@@ -487,7 +487,7 @@ namespace G4INCL {
}
// Cluster decay
theEventInfo.clusterDecay = nucleus->decayOutgoingClusters() | nucleus->decayMe();
theEventInfo.clusterDecay = nucleus->decayOutgoingClusters() || nucleus->decayMe();
#ifndef INCLXX_IN_GEANT4_MODE
// Global checks of conservation laws
@@ -645,7 +645,7 @@ namespace G4INCL {
theEventInfo.emitKaon = nucleus->emitInsideKaon();
// Cluster decay
theEventInfo.clusterDecay = nucleus->decayOutgoingClusters() | nucleus->decayMe();
theEventInfo.clusterDecay = nucleus->decayOutgoingClusters() || nucleus->decayMe();
// Fill the EventInfo structure
nucleus->fillEventInfo(&theEventInfo);
@@ -115,7 +115,7 @@ namespace G4INCL {
ParticleSpecies getProjectileSpecies() const { return projectileSpecies; }
/// \brief Set the projectile species
void setProjectileSpecies(ParticleSpecies const &ps) { projectileSpecies=ps; }
void setProjectileSpecies(ParticleSpecies const &pars) { projectileSpecies=pars; }
/// \brief Get the projectile kinetic energy.
G4double getProjectileKineticEnergy() const { return projectileKineticEnergy; }
@@ -199,7 +199,7 @@ namespace G4INCL {
G4int getClusterMaxMass() const { return clusterMaxMass; }
/// \brief Set the maximum mass for production of clusters.
void setClusterMaxMass(const G4int m){ clusterMaxMass=m; }
void setClusterMaxMass(const G4int clm){ clusterMaxMass=clm; }
/// \brief Get back-to-spectator
G4bool getBackToSpectator() const { return backToSpectator; }
@@ -214,7 +214,7 @@ namespace G4INCL {
void setUseRealMasses(G4bool use) { useRealMasses = use; }
/// \brief Set the INCLXX datafile path
void setINCLXXDataFilePath(std::string const &s) { INCLXXDataFilePath=s; }
void setINCLXXDataFilePath(std::string const &path) { INCLXXDataFilePath=path; }
std::string const &getINCLXXDataFilePath() const {
return INCLXXDataFilePath;
@@ -528,22 +528,22 @@ namespace G4INCL {
return -10; // Unknown
}
std::string getShortName(const ParticleSpecies &s) {
if(s.theType==Composite && s.theS == 0)
return getShortName(s.theA,s.theZ);
else if(s.theType==Composite)
return getName(s.theA,s.theZ,s.theS);
std::string getShortName(const ParticleSpecies &sp) {
if(sp.theType==Composite && sp.theS == 0)
return getShortName(sp.theA,sp.theZ);
else if(sp.theType==Composite)
return getName(sp.theA,sp.theZ,sp.theS);
else
return getShortName(s.theType);
return getShortName(sp.theType);
}
std::string getName(const ParticleSpecies &s) {
if(s.theType==Composite && s.theS == 0)
return getName(s.theA,s.theZ);
else if(s.theType==Composite)
return getName(s.theA,s.theZ,s.theS);
std::string getName(const ParticleSpecies &sp) {
if(sp.theType==Composite && sp.theS == 0)
return getName(sp.theA,sp.theZ);
else if(sp.theType==Composite)
return getName(sp.theA,sp.theZ,sp.theS);
else
return getName(s.theType);
return getName(sp.theType);
}
std::string getName(const G4int A, const G4int Z) {
@@ -1140,11 +1140,11 @@ namespace G4INCL {
G4double getLambdaSeparationEnergy() { return lambdaSeparationEnergy; }
void setProtonSeparationEnergy(const G4double s) { protonSeparationEnergy = s; }
void setProtonSeparationEnergy(const G4double sen) { protonSeparationEnergy = sen; }
void setNeutronSeparationEnergy(const G4double s) { neutronSeparationEnergy = s; }
void setNeutronSeparationEnergy(const G4double sen) { neutronSeparationEnergy = sen; }
void setLambdaSeparationEnergy(const G4double s) { lambdaSeparationEnergy = s; }
void setLambdaSeparationEnergy(const G4double sen) { lambdaSeparationEnergy = sen; }
std::string getElementName(const G4int Z) {
if(Z<1) {
@@ -1177,9 +1177,9 @@ namespace G4INCL {
return ParticleTable::parseIUPACElement(pS);
}
G4int parseIUPACElement(std::string const &s) {
G4int parseIUPACElement(std::string const &sel) {
// Normalise to lower case
std::string elementName(s);
std::string elementName(sel);
std::transform(elementName.begin(), elementName.end(), elementName.begin(), ::tolower);
// Return 0 if the element name contains anything but IUPAC digits
if(elementName.find_first_not_of(elementIUPACDigits)!=std::string::npos)
@@ -14,6 +14,20 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
26 April 2022 Alberto Ribon (hard-lend-V10-07-03)
-------------------------------------------------
- MCGIDI_energy.cc : fixed compilation warnings for 'may be used uninitialized'
variables.
20 April 2022 Alberto Ribon
---------------------------
- MCGIDI_energy.cc, ptwXY_methods.cc, ptwXY_misc.cc : fixed compilation
warnings for 'may be used uninitialized' variables.
9 February 2022 Gabriele Cosmo
------------------------------
- Fixed compilation warning on Intel compilers for unused variable.
4 August 2021 Alberto Ribon (hadr-lend-V10-07-02)
-------------------------------------------------
- G4LENDModel, G4LENDCapture, G4LENDElastic, G4LENDFission, G4LENDInelastic :
@@ -419,7 +419,7 @@ static nfu_status MCGIDI_energy_parseMadlandNixFromTOM_callback( double Ep, doub
*/
static double MCGIDI_energy_parseMadlandNixFromTOM_callback_g( double Ep, double E_F, double T_M, nfu_status *status ) {
double u1, u2, E1, E2, gamma1, gamma2, signG = 1;
double u1, u2, E1, E2 = 0., gamma1 = 0., gamma2 = 0., signG = 1;
u1 = std::sqrt( Ep ) - std::sqrt( E_F );
u1 *= u1 / T_M;
@@ -612,7 +612,7 @@ static int MCGIDI_energy_sampleWatt( statusMessageReporting * /*smr*/, double e_
/*
* From MCAPM via Sample Watt Spectrum as in TART ( Kalos algorithm ).
*/
double WattMin = 0., WattMax = e_in_U, x, y, z, energyOut, rand1, rand2;
double WattMin = 0., WattMax = e_in_U, x, y, z, energyOut = 0., rand1, rand2;
x = 1. + ( Watt_b / ( 8. * Watt_a ) );
y = ( x + std::sqrt( x * x - 1. ) ) / Watt_a;
@@ -266,7 +266,7 @@ static nfu_status ptwXY_thin2( ptwXYPoints *thinned, char *thin, double accuracy
int64_t i, iMax = 0;
double y, s, dY, dYMax = 0., dYR, dYRMax = 0;
double x1 = thinned->points[i1].x, y1 = thinned->points[i1].y, x2 = thinned->points[i2].x, y2 = thinned->points[i2].y;
nfu_status status;
nfu_status status = nfu_Okay;
if( i1 + 1 >= i2 ) return( nfu_Okay );
for( i = i1 + 1; i < i2; i++ ) {
@@ -41,7 +41,7 @@ ptwXYPoints *ptwXY_createFromFunction( int n, double *xs, ptwXY_createFromFuncti
int biSectionMax, nfu_status *status ) {
int64_t i;
double x1, y1, x2, y2, eps = ClosestAllowXFactor * DBL_EPSILON;
double x1, y1, x2 = 0., y2, eps = ClosestAllowXFactor * DBL_EPSILON;
ptwXYPoints *ptwXY;
ptwXYPoint *p1, *p2;
@@ -94,7 +94,6 @@ xDataXML_document *xDataXML_importFile2( statusMessageReporting *smr, char const
int f;
char buffer[10 * 1000];
ssize_t count, n = sizeof( buffer ) - 1;
ssize_t s = 0;
xDataXML_document *doc;
if( ( doc = xDataXML_mallocDoc( smr ) ) == NULL ) return( NULL );
@@ -105,7 +104,6 @@ xDataXML_document *xDataXML_importFile2( statusMessageReporting *smr, char const
smr_setReportError2( smr, xDataTOM_smrLibraryID, xDataXML_errFileError, "could not open XML file %s", fileName ); }
else {
while( ( count = read( f, buffer, n ) ) > 0 ) {
s += count;
buffer[count] = 0;
if( xDataXML_parse( doc, buffer ) ) break;
if( !smr_isOk( doc->smr ) ) break;
@@ -14,6 +14,19 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
20 April 2022 Alberto Ribon (hadr-lepnuc-V10-07-06)
---------------------------------------------------
- G4MuonVDNuclearModel.cc : fixed compilation warnings for
'may be used uninitialized' variables.
17 February 2022 Vladimir Ivanchenko
------------------------------------
- G4NeutrinoNucleusModel - fixed memory leak reported by Coverity
09 February 2022 Gabriele Cosmo
-------------------------------
- Fixed compilation warning on Intel compilers for unused variables.
04 August 2021 A. Ribon (hadr-lepnuc-V10-07-05)
--------------------------------------------------
- G4ElectroVDNuclearModel, G4MuonVDNuclearModel,
@@ -216,7 +216,7 @@ void G4ANuElNucleusCcModel::InitialiseModel()
/////////////////////////////////////////////////////////
G4bool G4ANuElNucleusCcModel::IsApplicable(const G4HadProjectile & aPart,
G4Nucleus & targetNucleus)
G4Nucleus & )
{
G4bool result = false;
G4String pName = aPart.GetDefinition()->GetParticleName();
@@ -229,8 +229,6 @@ G4bool G4ANuElNucleusCcModel::IsApplicable(const G4HadProjectile & aPart,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -196,7 +196,7 @@ void G4ANuElNucleusNcModel::InitialiseModel()
/////////////////////////////////////////////////////////
G4bool G4ANuElNucleusNcModel::IsApplicable(const G4HadProjectile & aPart,
G4Nucleus & targetNucleus)
G4Nucleus & )
{
G4bool result = false;
G4String pName = aPart.GetDefinition()->GetParticleName();
@@ -209,8 +209,6 @@ G4bool G4ANuElNucleusNcModel::IsApplicable(const G4HadProjectile & aPart,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -214,7 +214,7 @@ void G4ANuMuNucleusCcModel::InitialiseModel()
/////////////////////////////////////////////////////////
G4bool G4ANuMuNucleusCcModel::IsApplicable(const G4HadProjectile & aPart,
G4Nucleus & targetNucleus)
G4Nucleus & )
{
G4bool result = false;
G4String pName = aPart.GetDefinition()->GetParticleName();
@@ -226,8 +226,6 @@ G4bool G4ANuMuNucleusCcModel::IsApplicable(const G4HadProjectile & aPart,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -197,7 +197,7 @@ void G4ANuMuNucleusNcModel::InitialiseModel()
/////////////////////////////////////////////////////////
G4bool G4ANuMuNucleusNcModel::IsApplicable(const G4HadProjectile & aPart,
G4Nucleus & targetNucleus)
G4Nucleus & )
{
G4bool result = false;
G4String pName = aPart.GetDefinition()->GetParticleName();
@@ -209,8 +209,6 @@ G4bool G4ANuMuNucleusNcModel::IsApplicable(const G4HadProjectile & aPart,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -223,8 +223,8 @@ G4MuonVDNuclearModel::CalculateEMVertex(const G4HadProjectile& aTrack,
G4double y2 = 0.5*yy*yy;
G4double y3 = y1+y2;
G4double t;
G4double rej;
G4double t = 0.0;
G4double rej = 0.0;
// Now sample t
G4int ntry = 0;
@@ -96,7 +96,7 @@ void G4NeutrinoElectronCcModel::ModelDescription(std::ostream& outFile) const
/////////////////////////////////////////////////////////
G4bool G4NeutrinoElectronCcModel::IsApplicable(const G4HadProjectile & aPart,
G4Nucleus & targetNucleus)
G4Nucleus & )
{
G4bool result = false;
G4String pName = aPart.GetDefinition()->GetParticleName();
@@ -115,8 +115,6 @@ G4bool G4NeutrinoElectronCcModel::IsApplicable(const G4HadProjectile & aPart,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -126,7 +124,7 @@ G4bool G4NeutrinoElectronCcModel::IsApplicable(const G4HadProjectile & aPart,
//
G4HadFinalState* G4NeutrinoElectronCcModel::ApplyYourself(
const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
const G4HadProjectile& aTrack, G4Nucleus& )
{
theParticleChange.Clear();
@@ -197,9 +195,6 @@ G4HadFinalState* G4NeutrinoElectronCcModel::ApplyYourself(
}
if(aNu) { theParticleChange.AddSecondary( aNu, secID ); }
if(aLept) { theParticleChange.AddSecondary( aLept, secID ); }
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return &theParticleChange;
}
@@ -67,7 +67,6 @@
// #include "G4QGSMFragmentation.hh"
// #include "G4QGSParticipants.hh"
#include "G4MuonMinus.hh"
#include "G4MuonPlus.hh"
#include "G4Nucleus.hh"
@@ -205,7 +204,7 @@ void G4NeutrinoNucleusModel::ModelDescription(std::ostream& outFile) const
/////////////////////////////////////////////////////////
G4bool G4NeutrinoNucleusModel::IsApplicable(const G4HadProjectile & aPart,
G4Nucleus & targetNucleus)
G4Nucleus & )
{
G4bool result = false;
G4String pName = aPart.GetDefinition()->GetParticleName();
@@ -217,8 +216,6 @@ G4bool G4NeutrinoNucleusModel::IsApplicable(const G4HadProjectile & aPart,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -580,21 +577,17 @@ void G4NeutrinoNucleusModel::RecoilDeexcitation( G4Fragment& fragment)
if( products != nullptr )
{
for( auto iter = products->cbegin(); iter != products->cend(); ++iter )
// for( auto & prod : products ) // prod = (*iter) is the pointer to final hadronic particle
for( auto & prod : *products ) // prod is the pointer to final hadronic particle
{
theParticleChange.AddSecondary(new G4DynamicParticle( (*iter)->GetDefinition(),
(*iter)->GetTotalEnergy(),
(*iter)->GetMomentum() ), fSecID );
// delete prod;
theParticleChange.AddSecondary(new G4DynamicParticle( prod->GetDefinition(),
prod->GetTotalEnergy(),
prod->GetMomentum() ), fSecID );
delete prod;
}
// delete products;
products->clear();
delete products;
}
return;
}
///////////////////////////////////////////
//
// Fragmentation of lvX directly to pion and recoil nucleus (A,Z): fLVh + fLVt -> pi + A*
@@ -216,7 +216,7 @@ void G4NuElNucleusCcModel::InitialiseModel()
/////////////////////////////////////////////////////////
G4bool G4NuElNucleusCcModel::IsApplicable(const G4HadProjectile & aPart,
G4Nucleus & targetNucleus)
G4Nucleus & )
{
G4bool result = false;
G4String pName = aPart.GetDefinition()->GetParticleName();
@@ -229,8 +229,6 @@ G4bool G4NuElNucleusCcModel::IsApplicable(const G4HadProjectile & aPart,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -196,7 +196,7 @@ void G4NuElNucleusNcModel::InitialiseModel()
/////////////////////////////////////////////////////////
G4bool G4NuElNucleusNcModel::IsApplicable(const G4HadProjectile & aPart,
G4Nucleus & targetNucleus)
G4Nucleus & )
{
G4bool result = false;
G4String pName = aPart.GetDefinition()->GetParticleName();
@@ -209,8 +209,6 @@ G4bool G4NuElNucleusNcModel::IsApplicable(const G4HadProjectile & aPart,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -215,7 +215,7 @@ void G4NuMuNucleusCcModel::InitialiseModel()
/////////////////////////////////////////////////////////
G4bool G4NuMuNucleusCcModel::IsApplicable(const G4HadProjectile & aPart,
G4Nucleus & targetNucleus)
G4Nucleus & )
{
G4bool result = false;
G4String pName = aPart.GetDefinition()->GetParticleName();
@@ -227,8 +227,6 @@ G4bool G4NuMuNucleusCcModel::IsApplicable(const G4HadProjectile & aPart,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -197,7 +197,7 @@ void G4NuMuNucleusNcModel::InitialiseModel()
/////////////////////////////////////////////////////////
G4bool G4NuMuNucleusNcModel::IsApplicable(const G4HadProjectile & aPart,
G4Nucleus & targetNucleus)
G4Nucleus & )
{
G4bool result = false;
G4String pName = aPart.GetDefinition()->GetParticleName();
@@ -209,8 +209,6 @@ G4bool G4NuMuNucleusNcModel::IsApplicable(const G4HadProjectile & aPart,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -14,6 +14,49 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
11 May 2022 Dennis Wright (hadr-hpp-V10-07-12)
----------------------------------------------
- code cleanup of G4ParticleHPContEnergyAngular.cc and
G4ParticleHPContAngularPar.cc : remove debug code, remove commented out code,
fix indentation of loops and if branches
27 April 2022 Dennis Wright
---------------------------
- fix of bug #2468: many or most photons generated from G4NDL/Capture/FSMF6 data
are too high in energy. Bug reported and fixed by Sven Menke.
- G4ParticleHPContEnergyAngular
::Sample: do not call ClearHistories - needed in case of multiple photons
::ClearHistories: check cache before clear
- G4ParticleHPContAngularPar - much code replaced here
::Sample: reduce remaining energy before sampling next photon
::PrepareTableInterpolation: fix to handle table entries with identical energies
: disable code that incorrectly assumes identical min
and max energies for two different data sets
::BuildByInterpolation: re-build interpolation table only if new interaction
: re-write merge of two data sets to fix incorrect
assignment of elements
: disable and replace code with incorrect assignment of
continuous energies
26 April 2022 Alberto Ribon
---------------------------
- G4ParticleHPVector : fixed compilation warning for 'may be used uninitialized'
variable.
20 April 2022 Alberto Ribon
---------------------------
- G4ParticleHPFissionSpectrum.hh, G4ParticleHPSimpleEvapSpectrum.hh,
G4FPYNormalFragmentDist.cc, G4FissionProductYieldDist.cc,
G4ParticleHPInelasticCompFS.cc, G4ParticleHPKallbachMannSyst.cc,
G4ParticleHPLegendreStore.cc, G4ParticleHPNBodyPhaseSpace.cc,
G4ParticleHPVector.cc, G4ParticleHPWattSpectrum.cc : fixed compilation
warnings for 'may be used uninitialized' variables.
09 February 2022 Gabriele Cosmo
-------------------------------
- Fixed compilation warnings on Intel compilers for deprecated use of
operator=() in G4ParticleHPDataPoint.
05 November 2021 Alberto Ribon (hadr-hpp-V10-07-11)
--------------------------------------------------
Improvements made by Loic Thulliez and Eric Dumonteil (CEA Saclay):
@@ -79,6 +79,31 @@ class G4ParticleHPContAngularPar
adjustResult = true;
}
G4ParticleHPContAngularPar(G4ParticleHPContAngularPar & val)
{
theEnergy = val.theEnergy;
nEnergies = val.nEnergies;
nDiscreteEnergies = val.nDiscreteEnergies;
nAngularParameters= val.nAngularParameters;
theProjectile = val.theProjectile;
theManager = val.theManager;
theInt = val.theInt;
adjustResult = val.adjustResult;
theMinEner = val.theMinEner;
theMaxEner = val.theMaxEner;
theEnergiesTransformed = val.theEnergiesTransformed;
theDiscreteEnergies = val.theDiscreteEnergies;
theDiscreteEnergiesOwn = val.theDiscreteEnergiesOwn;
fCache.Put(0);
theAngular = new G4ParticleHPList[nEnergies];
for(G4int ie=0;ie<nEnergies;++ie) {
theAngular[ie].SetLabel(val.theAngular[ie].GetLabel());
for(G4int ip=0;ip<nAngularParameters;++ip) {
theAngular[ie].SetValue(ip,val.theAngular[ie].GetValue(ip));
}
}
}
G4ParticleHPContAngularPar(G4ParticleDefinition* projectile);
~G4ParticleHPContAngularPar()
@@ -92,7 +117,7 @@ class G4ParticleHPContAngularPar
G4ReactionProduct* Sample(G4double anEnergy, G4double massCode, G4double mass,
G4int angularRep, G4int interpol);
G4double GetEnergy()
G4double GetEnergy() const
{
if( std::getenv("G4PHPTEST") )
G4cout << this << " G4ParticleHPContAngularPar::GetEnergy "
@@ -125,7 +150,7 @@ class G4ParticleHPContAngularPar
G4ParticleHPContAngularPar & store2);
// NOTE: this interpolates legendre coefficients
void PrepareTableInterpolation(const G4ParticleHPContAngularPar* angularPrev);
void PrepareTableInterpolation();
G4double MeanEnergyOfThisInteraction()
{
@@ -182,7 +207,7 @@ class G4ParticleHPContAngularPar
fCache.Get()->fresh = true;
}
void Dump();
void Dump() const;
private:
@@ -78,9 +78,9 @@ public:
theAngular[i].SetInterpolation(theInterpolation);
#ifndef PHP_AS_HP
if( i != 0 ) {
theAngular[i].PrepareTableInterpolation(&(theAngular[i-1]));
theAngular[i].PrepareTableInterpolation();
} else {
theAngular[i].PrepareTableInterpolation((G4ParticleHPContAngularPar*)0);
theAngular[i].PrepareTableInterpolation();
}
#endif
}
@@ -38,11 +38,7 @@ class G4ParticleHPDataPoint
G4ParticleHPDataPoint(){energy = 0; xSec = 0;}
G4ParticleHPDataPoint(G4double e, G4double x){ energy = e; xSec = x;}
G4ParticleHPDataPoint & operator= (const G4ParticleHPDataPoint & aSet) = default;
// ~G4ParticleHPDataPoint(){}
inline G4double GetEnergy() const {return energy;}
inline G4double GetXsection() const {return xSec;}
@@ -68,7 +68,7 @@ class G4ParticleHPFissionSpectrum : public G4VParticleHPEDis
G4double theta = theThetaDist.GetY(anEnergy);
// here we need to sample Maxwells distribution, if
// need be.
G4double result, cut;
G4double result=0., cut;
G4double range =50*CLHEP::MeV;
G4double max = Maxwell((theta*CLHEP::eV)/2., theta);
G4double value;
@@ -67,7 +67,7 @@ class G4ParticleHPSimpleEvapSpectrum : public G4VParticleHPEDis
inline G4double Sample(G4double anEnergy)
{
G4double theta = theThetaDist.GetY(anEnergy)*CLHEP::eV;
G4double random, cut, max, result;
G4double random, cut, max, result=0.;
max = 10.*theta;
G4int icounter=0;
G4int icounter_max=1024;
@@ -88,7 +88,7 @@ GetFissionProduct( void )
{
G4FFG_FUNCTIONENTER__
G4Ions* Particle;
G4Ions* Particle=nullptr;
// Generate a (0, 1] random number and return the respective particle.
// The ENDF data tables lists 72172 as the largest fission fragment produced
@@ -313,7 +313,7 @@ G4FFG_FUNCTIONENTER__
// distribution is dependant on the alpha particle generation and the
// Watt fission sampling for neutrons, we only have the left-over energy
// to work with for the fission daughter products.
G4double FragmentsKE;
G4double FragmentsKE=0.;
G4int icounter=0;
G4int icounter_max=1024;
do
@@ -1327,8 +1327,8 @@ G4FFG_FUNCTIONENTER__
// The condition of sampling more energy from the fission products than is
// alloted is statistically unfavorable, but it could still happen. The
// do-while loop prevents such an occurrence from happening
G4double TotalNeutronEnergy;
G4double NeutronEnergy;
G4double TotalNeutronEnergy=0.;
G4double NeutronEnergy=0.;
// Make sure that we don't sample more energy than is available
G4int icounter=0;
File diff suppressed because it is too large Load Diff
@@ -33,101 +33,106 @@
//
#include "G4ParticleHPContEnergyAngular.hh"
G4ReactionProduct * G4ParticleHPContEnergyAngular::Sample(G4double anEnergy, G4double massCode, G4double /*mass*/)
G4ReactionProduct*
G4ParticleHPContEnergyAngular::Sample(G4double anEnergy, G4double massCode,
G4double /*mass*/)
{
G4ReactionProduct * result;
G4int i(0);
G4int it(0);
for(i=0;i<nEnergy;i++)
{
it = i;
G4ReactionProduct* result;
G4int i(0);
G4int it(0);
for (i = 0; i < nEnergy; i++) {
it = i;
#ifdef PHP_AS_HP
if(theAngular[i].GetEnergy()>anEnergy) break;
if(theAngular[i].GetEnergy() > anEnergy) break;
#else
if(theAngular[i].GetEnergy()>=anEnergy) break;
if(theAngular[i].GetEnergy() >= anEnergy) break;
#endif
}
if( std::getenv("G4PHPTEST") ) G4cout << i << " G4ParticleHPContEnergyAngular dataE " << theAngular[i].GetEnergy() << " > " << anEnergy << " it_theAngular " << it << " interpolation " << theInterpolation << G4endl; //GDEB
G4double targetMass = GetTarget()->GetMass();
if(it==0)
{
theAngular[0].SetTarget(GetTarget());
theAngular[0].SetTargetCode(theTargetCode);
theAngular[0].SetPrimary(GetProjectileRP());
result = theAngular[0].Sample(anEnergy, massCode, targetMass,
}
if (std::getenv("G4PHPTEST") )
G4cout << i << " G4ParticleHPContEnergyAngular dataE "
<< theAngular[i].GetEnergy()
<< " > " << anEnergy << " it_theAngular " << it << " interpolation "
<< theInterpolation << G4endl; //GDEB
G4double targetMass = GetTarget()->GetMass();
if (it == 0) {
theAngular[0].SetTarget(GetTarget());
theAngular[0].SetTargetCode(theTargetCode);
theAngular[0].SetPrimary(GetProjectileRP());
result = theAngular[0].Sample(anEnergy, massCode, targetMass,
theAngularRep, theInterpolation);
currentMeanEnergy.Put( theAngular[0].MeanEnergyOfThisInteraction() );
}
else
{
currentMeanEnergy.Put(theAngular[0].MeanEnergyOfThisInteraction() );
} else {
// interpolation through alternating sampling. This needs improvement @@@
// This is the cause of the He3 problem !!!!!!!!
// See to it, if you can improve this.
//080714 TK commnet Randomizing use angular distribution
//080714 TK Always use the upper side distribution. enabling ClearHistories method.
//G4double random = G4UniformRand();
//G4double deltaE = theAngular[it].GetEnergy()-theAngular[it-1].GetEnergy();
//G4double offset = theAngular[it].GetEnergy()-anEnergy;
//if(random<offset/deltaE) it--;
//--- create new
// if( theManager.GetScheme(0) != LINLIN ) { // asserted in G4ParticleHPContEnergyAngular::init there is only one range
// if (theManager.GetScheme(0) != LINLIN) {
// // asserted in G4ParticleHPContEnergyAngular::init there is only one range
#ifdef PHP_AS_HP
theAngular[it].SetTarget(GetTarget());
theAngular[it].SetTargetCode(theTargetCode);
theAngular[it].SetPrimary(GetProjectileRP());
result = theAngular[it].Sample(anEnergy, massCode, targetMass,
theAngular[it].SetTarget(GetTarget());
theAngular[it].SetTargetCode(theTargetCode);
theAngular[it].SetPrimary(GetProjectileRP());
result = theAngular[it].Sample(anEnergy, massCode, targetMass,
theAngularRep, theInterpolation);
currentMeanEnergy.Put( theAngular[it].MeanEnergyOfThisInteraction() );
currentMeanEnergy.Put(theAngular[it].MeanEnergyOfThisInteraction() );
#else
if( std::getenv("G4PHPTEST") ) G4cout << i << " G4ParticleHPContEnergyAngular To BUILDBYINTERPOLATION " << it << " : " << theAngular[it].GetEnergy()<< " , " << theAngular[it].GetNEnergies() << " " << it-1 << " : " << theAngular[it-1].GetEnergy()<< " : " << theAngular[it-1].GetNEnergies() << G4endl; //GDEB
if (std::getenv("G4PHPTEST") )
G4cout << i << " G4ParticleHPContEnergyAngular To BUILDBYINTERPOLATION "
<< it << " : " << theAngular[it].GetEnergy()<< " , "
<< theAngular[it].GetNEnergies() << " " << it-1 << " : "
<< theAngular[it-1].GetEnergy()<< " : "
<< theAngular[it-1].GetNEnergies() << G4endl; //GDEB
// G4ParticleHPContAngularPar * fAngular = new G4ParticleHPContAngularPar(theProjectile ); //fix start
if (fCacheAngular.Get() == NULL) {
G4ParticleHPContAngularPar* angpar = new G4ParticleHPContAngularPar(theProjectile);
fCacheAngular.Put(angpar);
}
fCacheAngular.Get()->SetInterpolation(theInterpolation);
fCacheAngular.Get()->BuildByInterpolation( anEnergy, theManager.GetScheme(0), (theAngular[it-1]), (theAngular[it]) );
fCacheAngular.Get()->SetTarget(GetTarget());
fCacheAngular.Get()->SetTargetCode(theTargetCode);
fCacheAngular.Get()->SetPrimary(GetProjectileRP());
result = fCacheAngular.Get()->Sample(anEnergy, massCode, targetMass,
theAngularRep, theInterpolation);
currentMeanEnergy.Put( fCacheAngular.Get()->MeanEnergyOfThisInteraction() );
fCacheAngular.Get()->ClearHistories();
// delete fAngular; //fix end
if (fCacheAngular.Get() == NULL) {
G4ParticleHPContAngularPar* angpar = new G4ParticleHPContAngularPar(theProjectile);
fCacheAngular.Put(angpar);
}
fCacheAngular.Get()->SetInterpolation(theInterpolation);
fCacheAngular.Get()->BuildByInterpolation(anEnergy, theManager.GetScheme(0),
(theAngular[it-1]), (theAngular[it]) );
fCacheAngular.Get()->SetTarget(GetTarget());
fCacheAngular.Get()->SetTargetCode(theTargetCode);
fCacheAngular.Get()->SetPrimary(GetProjectileRP());
result = fCacheAngular.Get()->Sample(anEnergy, massCode, targetMass,
theAngularRep, theInterpolation);
currentMeanEnergy.Put(fCacheAngular.Get()->MeanEnergyOfThisInteraction() );
#endif
}
} // end (it != 0) branch
// G4cout << " 0 0 @@@ G4ParticleHPContEnergyAngular::Sample " << result->GetDefinition()->GetParticleName() << " E= " << result->GetKineticEnergy() << G4endl;//GDEB
return result;
return result;
}
G4double G4ParticleHPContEnergyAngular::
MeanEnergyOfThisInteraction()
G4double G4ParticleHPContEnergyAngular::MeanEnergyOfThisInteraction()
{
G4double result(0);
if(currentMeanEnergy.Get()<-1)
{
throw G4HadronicException(__FILE__, __LINE__, "G4ParticleHPContEnergyAngular: Logical error in Product class");
}
else
{
result = currentMeanEnergy.Get();
}
currentMeanEnergy.Put( -2 );
return result;
G4double result(0);
if (currentMeanEnergy.Get() < -1) {
throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPContEnergyAngular: Logical error in Product class");
} else {
result = currentMeanEnergy.Get();
}
currentMeanEnergy.Put(-2);
return result;
}
void G4ParticleHPContEnergyAngular::ClearHistories()
{
if ( theAngular!= NULL )
{
for ( G4int i = 0 ; i< nEnergy ; i++ )
theAngular[i].ClearHistories();
}
if (theAngular!= NULL) {
for (G4int i = 0; i < nEnergy; i++) theAngular[i].ClearHistories();
}
// Added fCacheAngular ClearHistories() - this is the one actually used!
// Maybe theAngular does not even need ClearHistories()?
if (fCacheAngular.Get() != 0) fCacheAngular.Get()->ClearHistories();
}
@@ -368,7 +368,7 @@ void G4ParticleHPInelasticCompFS::CompositeApply(const G4HadProjectile& theTrack
G4double dqi = 0.0;
if ( QI[it] < 0 || 849 < QI[it] ) dqi = QI[it]; //For backword compatibility QI introduced since G4NDL3.15
G4double MaxEne=eKinetic+dqi;
G4double eSecN;
G4double eSecN=0.;
G4int icounter=0;
G4int icounter_max=1024;
@@ -43,7 +43,7 @@
G4double G4ParticleHPKallbachMannSyst::Sample(G4double anEnergy)
{
G4double result;
G4double result=0.;
G4double zero = GetKallbachZero(anEnergy);
if(zero>1) zero=1.;

Some files were not shown because too many files have changed in this diff Show More