Import Geant4 10.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2017-12-08 12:52:30 +01:00
parent 98e455a940
commit fc6af9e721
2166 changed files with 276760 additions and 100873 deletions
+27 -1
View File
@@ -1,4 +1,4 @@
$Id: History 103892 2017-05-03 08:11:00Z gcosmo $
$Id: History 106143 2017-09-14 06:34:42Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,32 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
- 13 September 2017 Krzysztof Genser ( particles-V10-03-16 )
- moved G4MuonicAtom & G4MuonicAtomHelper to management
to avoid circular reference in the granular lib case
- 12 September 2017 Krzysztof Genser ( particles-V10-03-15 )
- corrected warning in G4MuonicAtom
- 12 September 2017 Krzysztof Genser ( particles-V10-03-14 )
- Moved Muonic Atom files to hadrons/ions; introduced G4GenericMuonicAtom
- revised G4MuonicAtomHelper, added G4MuonicAtom support
- 16 Aug. 2017 Hisaya Kurashige ( particles-V10-03-13 )
- Fix problem of G4DecayTable::SelectADecayChannel
in case of sum of BR is not equal to 1.0
- Add protection to protect BR<0 or BR>1 for G4VDecayChannel
- 14 Aug. 2017 Hisaya Kurashige ( particles-V10-03-11 )
- Fix G4PDGCodeChecker to solve Coverity defect #94101
- 11 Aug. 2017 Hisaya Kurashige ( particles-V10-03-10 )
- Modify test projects
- 11 Aug. 2017 Hisaya Kurashige ( particles-V10-03-09 )
- Update mass, width and life time according to PDG2017
- 1 May 2017 Tatsumi Koi ( particles-V10-03-08 )
- Fix inconsistency between enum definition of G4FloatLevelBase
and initialization of G4Ions::G4FloatLevelBase flb[].
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AntiLambdab.cc 95951 2016-03-03 10:44:16Z gcosmo $
// $Id: G4AntiLambdab.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -70,11 +70,11 @@ G4AntiLambdab* G4AntiLambdab::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 5.61951*GeV, 0.449e-9*MeV, 0.,
name, 5.61958*GeV, 0.4478e-9*MeV, 0.,
1, +1, 0,
0, 0, 0,
"baryon", 0, -1, -5122,
false, 1.466e-3*ns, NULL,
false, 1.470e-3*ns, NULL,
false, "lambda_b");
}
theInstance = reinterpret_cast<G4AntiLambdab*>(anInstance);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AntiOmegabMinus.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4AntiOmegabMinus.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -69,11 +69,11 @@ G4AntiOmegabMinus* G4AntiOmegabMinus::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 6.0464*GeV, 0.42e-9*MeV, +1.*eplus,
name, 6.0461*GeV, 0.40e-9*MeV, +1.*eplus,
1, +1, 0,
0, 0, 0,
"baryon", 0, -1, -5332,
false, 1.570e-3*ns, NULL,
false, 1.640e-3*ns, NULL,
false, "omega_b");
}
theInstance = reinterpret_cast<G4AntiOmegabMinus*>(anInstance);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AntiXibMinus.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4AntiXibMinus.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -70,11 +70,11 @@ G4AntiXibMinus* G4AntiXibMinus::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 5.7945*GeV, 0.422e-9*MeV, +1.*eplus,
name, 5.7945*GeV, 0.419e-9*MeV, +1.*eplus,
1, +1, 0,
1, +1, 0,
"baryon", 0, -1, -5132,
false, 1.560e-3*ns, NULL,
false, 1.571e-3*ns, NULL,
false, "xi_b");
}
theInstance = reinterpret_cast<G4AntiXibMinus*>(anInstance);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AntiXibZero.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4AntiXibZero.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -70,11 +70,11 @@ G4AntiXibZero* G4AntiXibZero::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 5.7919*GeV, 0.45e-9*MeV, 0,
name, 5.7919*GeV, 0.445e-9*MeV, 0,
1, +1, 0,
1, -1, 0,
"baryon", 0, -1, -5232,
false, 1.464e-3*ns, NULL,
false, 1.479e-3*ns, NULL,
false, "xi_b");
}
theInstance = reinterpret_cast<G4AntiXibZero*>(anInstance);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AntiXicPlus.cc 95951 2016-03-03 10:44:16Z gcosmo $
// $Id: G4AntiXicPlus.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -69,7 +69,7 @@ G4AntiXicPlus* G4AntiXicPlus::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 2.46793*GeV, 1.49e-9*MeV, -1.*eplus,
name, 2.46787*GeV, 1.49e-9*MeV, -1.*eplus,
1, +1, 0,
1, -1, 0,
"baryon", 0, -1, -4232,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Lambdab.cc 95951 2016-03-03 10:44:16Z gcosmo $
// $Id: G4Lambdab.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -70,11 +70,11 @@ G4Lambdab* G4Lambdab::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 5.61951*GeV, 0.449e-9*MeV, 0.,
name, 5.61958*GeV, 0.4478e-9*MeV, 0.,
1, +1, 0,
0, 0, 0,
"baryon", 0, +1, 5122,
false, 1.466e-3*ns, NULL,
false, 1.470e-3*ns, NULL,
false, "lambda_b");
}
theInstance = reinterpret_cast<G4Lambdab*>(anInstance);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4OmegabMinus.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4OmegabMinus.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -69,11 +69,11 @@ G4OmegabMinus* G4OmegabMinus::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 6.0464*GeV, 0.42e-9*MeV, -1.*eplus,
name, 6.0461*GeV, 0.40e-9*MeV, -1.*eplus,
1, +1, 0,
0, 0, 0,
"baryon", 0, +1, 5332,
false, 1.570e-3*ns, NULL,
false, 1.640e-3*ns, NULL,
false, "omega_b");
}
theInstance = reinterpret_cast<G4OmegabMinus*>(anInstance);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4XibMinus.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4XibMinus.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -70,11 +70,11 @@ G4XibMinus* G4XibMinus::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 5.7945*GeV, 0.422e-9*MeV, -1.*eplus,
name, 5.7945*GeV, 0.419e-9*MeV, -1.*eplus,
1, +1, 0,
1, -1, 0,
"baryon", 0, +1, 5132,
false, 1.560e-3*ns, NULL,
false, 1.571e-3*ns, NULL,
false, "xi_b");
}
theInstance = reinterpret_cast<G4XibMinus*>(anInstance);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4XibZero.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4XibZero.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -70,11 +70,11 @@ G4XibZero* G4XibZero::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 5.7919*GeV, 0.45e-9*MeV, 0,
name, 5.7919*GeV, 0.445e-9*MeV, 0,
1, +1, 0,
1, +1, 0,
"baryon", 0, +1, 5232,
false, 1.464e-3*ns, NULL,
false, 1.479e-3*ns, NULL,
false, "xi_b");
}
theInstance = reinterpret_cast<G4XibZero*>(anInstance);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4XicPlus.cc 95951 2016-03-03 10:44:16Z gcosmo $
// $Id: G4XicPlus.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -69,7 +69,7 @@ G4XicPlus* G4XicPlus::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 2.46793*GeV, 1.49e-9*MeV, +1.*eplus,
name, 2.46787*GeV, 1.49e-9*MeV, +1.*eplus,
1, +1, 0,
1, +1, 0,
"baryon", 0, +1, 4232,
@@ -24,16 +24,44 @@
// ********************************************************************
//
//
// $Id: G4MuonicAtomDIODecayChannel.hh 96314 2016-04-06 07:21:51Z gcosmo $
// $Id: G4GenericMuonicAtom.hh 67971 2013-03-13 10:13:24Z gcosmo $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
// GEANT 4 class header file
//
// History: first implementation, 17 October 16 K.Lynch
// ------------------------------------------------------------
#ifndef G4MuonicAtomDIODecayChannel_h
#define G4MuonicAtomDIODecayChannel_h 1
// History: first implementation, K.L. Genser 2 December 2016
// based on G4GenericIon
//
// ****************************************************************
// This class is used only by G4IonTable and not for tracking
// One should register processes for G4MuonicAtoms with this class
//
// ----------------------------------------------------------------------
#ifndef G4GenericMuonicAtom_h
#define G4GenericMuonicAtom_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4ParticleDefinition.hh"
#include "G4MuonicAtom.hh"
// ######################################################################
// ### GenericMuonicAtom ###
// ######################################################################
class G4GenericMuonicAtom : public G4MuonicAtom
{
private:
static G4GenericMuonicAtom* theInstance;
G4GenericMuonicAtom(){}
~G4GenericMuonicAtom(){}
public:
static G4GenericMuonicAtom* Definition();
static G4GenericMuonicAtom* GenericMuonicAtomDefinition();
static G4GenericMuonicAtom* GenericMuonicAtom();
};
#endif
+3 -1
View File
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 66892 2013-01-17 10:57:59Z gunter $
# $Id: sources.cmake 106143 2017-09-14 06:34:42Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -41,6 +41,7 @@ GEANT4_DEFINE_MODULE(NAME G4ions
G4He3.hh
G4IonConstructor.hh
G4Triton.hh
G4GenericMuonicAtom.hh
SOURCES
G4Alpha.cc
G4AntiAlpha.cc
@@ -52,6 +53,7 @@ GEANT4_DEFINE_MODULE(NAME G4ions
G4He3.cc
G4IonConstructor.cc
G4Triton.cc
G4GenericMuonicAtom.cc
GRANULAR_DEPENDENCIES
G4globman
G4materials
@@ -0,0 +1,108 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4GenericMuonicAtom.cc 72056 2013-07-04 13:06:21Z gcosmo $
//
//
// ----------------------------------------------------------------------
// GEANT 4 class implementation file
//
// History:
// December 2016, K.L.Genser - first implementation
// based on G4GenericIon
// ----------------------------------------------------------------------
#include "G4GenericMuonicAtom.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4ParticleTable.hh"
// ######################################################################
// ### GenericMuonicAtom ###
// ######################################################################
G4GenericMuonicAtom* G4GenericMuonicAtom::theInstance = nullptr;
G4GenericMuonicAtom* G4GenericMuonicAtom::Definition()
{
if (theInstance != nullptr) return theInstance;
const G4String name = "GenericMuonicAtom";
// search in particle table]
G4ParticleTable* pTable = G4ParticleTable::GetParticleTable();
G4MuonicAtom* anInstance = static_cast<G4MuonicAtom*>(pTable->FindParticle(name));
if (anInstance == nullptr)
{
// create particle
//
// Arguments for constructor are as follows
// name mass width charge
// 2*spin parity C-conjugation
// 2*Isospin 2*Isospin3 G-parity
// type lepton number baryon number PDG encoding
// stable lifetime decay table
// shortlived subType anti_encoding
// excitation
//!!!!
//!!!! this particle should not be used for tracking
//!!!! all properties except the name and type are meaningless
//!!!!
anInstance = new G4MuonicAtom(
name, 0.9382723*GeV, 0.0*MeV, eplus,
1, +1, 0,
1, +1, 0,
"MuonicAtom", 0, +1, 0,
true, -1.0, nullptr,
false, "generic", 0,
0.0
);
}
theInstance = static_cast<G4GenericMuonicAtom*>(anInstance);
// static const int tmpVerbosityFlag = 2;
// if ( tmpVerbosityFlag > 1 ) {
// G4cout << __func__
// << " theInstance "
// << theInstance
// << G4endl;
// if (theInstance!=nullptr) {
// G4cout << __func__ << G4endl;
// theInstance->DumpTable();
// }
// }
pTable->SetGenericMuonicAtom(theInstance);
return theInstance;
}
// do not inline to avoid undefined reference
G4GenericMuonicAtom* G4GenericMuonicAtom::GenericMuonicAtomDefinition()
{
return Definition();
}
G4GenericMuonicAtom* G4GenericMuonicAtom::GenericMuonicAtom()
{
return Definition();
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AntiBMesonZero.cc 95951 2016-03-03 10:44:16Z gcosmo $
// $Id: G4AntiBMesonZero.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -65,7 +65,7 @@ G4AntiBMesonZero* G4AntiBMesonZero::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 5.27961*GeV, 4.333e-10*MeV, 0.,
name, 5.27961*GeV, 4.33e-10*MeV, 0.,
0, -1, 0,
1, +1, 0,
"meson", 0, 0, -511,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4AntiBsMesonZero.cc 95951 2016-03-03 10:44:16Z gcosmo $
// $Id: G4AntiBsMesonZero.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -65,11 +65,11 @@ G4AntiBsMesonZero* G4AntiBsMesonZero::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 5.36679*GeV, 4.359e-10*MeV, 0.,
name, 5.36689*GeV, 4.374e-10*MeV, 0.,
0, -1, 0,
0, 0, 0,
"meson", 0, 0, -531,
false, 1.510e-3*ns, NULL,
false, 1.505e-3*ns, NULL,
false, "Bs");
}
theInstance = reinterpret_cast<G4AntiBsMesonZero*>(anInstance);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4BMesonZero.cc 95951 2016-03-03 10:44:16Z gcosmo $
// $Id: G4BMesonZero.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -65,7 +65,7 @@ G4BMesonZero* G4BMesonZero::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 5.27961*GeV, 4.333e-10*MeV, 0.,
name, 5.27961*GeV, 4.33e-10*MeV, 0.,
0, -1, 0,
1, -1, 0,
"meson", 0, 0, 511,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4BcMesonMinus.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4BcMesonMinus.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -64,7 +64,7 @@ G4BcMesonMinus* G4BcMesonMinus::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 6.2751*GeV, 1.298e-9*MeV, -1.*eplus,
name, 6.2749*GeV, 1.298e-9*MeV, -1.*eplus,
0, -1, 0,
0, 0, 0,
"meson", 0, 0, -541,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4BcMesonPlus.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4BcMesonPlus.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -64,7 +64,7 @@ G4BcMesonPlus* G4BcMesonPlus::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 6.2751*GeV, 1.298e-9*MeV, +1.*eplus,
name, 6.2749*GeV, 1.298e-9*MeV, +1.*eplus,
0, -1, 0,
0, 0, 0,
"meson", 0, 0, 541,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4BsMesonZero.cc 95951 2016-03-03 10:44:16Z gcosmo $
// $Id: G4BsMesonZero.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -64,11 +64,11 @@ G4BsMesonZero* G4BsMesonZero::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 5.36679*GeV, 4.359e-10*MeV, 0.,
name, 5.36689*GeV, 4.374e-10*MeV, 0.,
0, -1, 0,
0, 0, 0,
"meson", 0, 0, 531,
false, 1.510e-3*ns, NULL,
false, 1.505e-3*ns, NULL,
false, "Bs");
}
theInstance = reinterpret_cast<G4BsMesonZero*>(anInstance);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4EtaPrime.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4EtaPrime.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------
@@ -70,7 +70,7 @@ G4EtaPrime* G4EtaPrime::Definition()
// shortlived subType anti_encoding
anInstance = new G4ParticleDefinition(
name, 0.95778*GeV, 0.197*MeV, 0.0,
name, 0.95778*GeV, 0.196*MeV, 0.0,
0, -1, +1,
0, 0, +1,
"meson", 0, 0, 331,
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4DecayTable.hh 92057 2015-08-14 13:34:55Z gcosmo $
// $Id: G4DecayTable.hh 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -93,7 +93,7 @@ class G4DecayTable
private:
G4ParticleDefinition *parent;
G4VDecayChannelVector *channels;
G4VDecayChannelVector *channels;
};
inline
@@ -112,7 +112,7 @@ inline
inline
G4VDecayChannel* G4DecayTable::GetDecayChannel(G4int index) const
{
G4VDecayChannel* selectedChannel = 0;
G4VDecayChannel* selectedChannel = nullptr;
if ( (index>=0) && (index<G4int(channels->size())) ){
selectedChannel = (*channels)[index];
}
@@ -28,10 +28,11 @@
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
// GEANT 4 class header file
//
// History: first implementation,
// History: first implementation,
// July 2016, K. Lynch
// June 2017, K.L. Genser added baseion, lifetimes and access functions
#ifndef G4MuonicAtom_h
#define G4MuonicAtom_h 1
@@ -40,21 +41,83 @@
class G4MuonicAtom : public G4Ions
{
public:
G4MuonicAtom(
const G4String& aName, G4double mass,
G4double width, G4double charge,
G4int iSpin, G4int iParity,
G4int iConjugation, G4int iIsospin,
G4int iIsospin3, G4int gParity,
const G4String& pType, G4int lepton,
G4int baryon, G4int encoding,
G4bool stable, G4double lifetime,
G4DecayTable *decaytable, G4bool shortlived,
const G4String& subType =""
);
protected:
G4MuonicAtom(){};
public:
G4MuonicAtom(
const G4String& aName, G4double mass,
G4double width, G4double charge,
G4int iSpin, G4int iParity,
G4int iConjugation, G4int iIsospin,
G4int iIsospin3, G4int gParity,
const G4String& pType, G4int lepton,
G4int baryon, G4int encoding,
G4bool stable, G4double lifeTime,
G4DecayTable *decaytable, G4bool shortlived,
const G4String& subType, G4Ions const* baseion,
G4int anti_encoding =0,
G4double excitation = 0.0,
G4int isomer = 0,
G4double DIOLifeTime = -1.0,
G4double NCLifeTime = -1.0
);
virtual ~G4MuonicAtom();
G4MuonicAtom* MuonicAtomDefinition();
G4MuonicAtom* MuonicAtom();
G4Ions const* GetBaseIon() const;
G4double GetDIOLifeTime() const;
void SetDIOLifeTime(G4double lt);
G4double GetNCLifeTime() const;
void SetNCLifeTime(G4double lt);
private:
G4Ions const* baseIon;
G4double fDIOLifeTime;
G4double fNCLifeTime;
};
inline
G4MuonicAtom* G4MuonicAtom::MuonicAtomDefinition()
{
return this;
}
inline
G4MuonicAtom* G4MuonicAtom::MuonicAtom()
{
return this;
}
inline
G4Ions const* G4MuonicAtom::GetBaseIon() const
{
return baseIon;
}
inline
G4double G4MuonicAtom::GetDIOLifeTime() const
{
return fDIOLifeTime;
}
inline
void G4MuonicAtom::SetDIOLifeTime(G4double lt)
{
fDIOLifeTime = lt;
}
inline
G4double G4MuonicAtom::GetNCLifeTime() const
{
return fNCLifeTime;
}
inline
void G4MuonicAtom::SetNCLifeTime(G4double lt)
{
fNCLifeTime = lt;
}
#endif
@@ -30,7 +30,11 @@
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, 1 July 16 K.Lynch
// History:
// 20160701 K.Lynch first implementation
// 20170612 K L Genser major revision; also copied
// functions from G4MuonMinusBoundDecay &
// old G4MuMinusCaptureCascade; used constexpr
// ------------------------------------------------------------
#ifndef G4MuonicAtomHelper_h
#define G4MuonicAtomHelper_h 1
@@ -41,6 +45,20 @@
class G4MuonicAtomHelper {
public:
static G4MuonicAtom* ConstructMuonicAtom(G4String name, G4int encoding, G4Ions const* baseion);
static G4double GetMuonCaptureRate(G4int Z, G4int A);
static G4double GetMuonDecayRate(G4int Z);
static G4double GetMuonZeff(G4int Z);
static G4double GetKShellEnergy(G4double A);
static G4double GetLinApprox(G4int N,
const G4double* const X,
const G4double* const Y,
G4double Xuser);
};
#endif
@@ -1,39 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4MuonicAtomNuclearCaptureChannel.hh 96314 2016-04-06 07:21:51Z gcosmo $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, 17 October 16 K.Lynch
// ------------------------------------------------------------
#ifndef G4MuonicAtomNuclearCaptureChannel_h
#define G4MuonicAtomNuclearCaptureChannel_h 1
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleDefinition.hh 103108 2017-03-16 13:00:35Z gcosmo $
// $Id: G4ParticleDefinition.hh 106143 2017-09-14 06:34:42Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -49,6 +49,7 @@
// restructuring for Cuts per Region - H.Kurashige - 11 March 2003
// added MagneticMoment - H.Kurashige - March 2007
// modified for thread-safety for MT - G.Cosmo, A.Dotti - January 2013
// added support for MuonicAtom - K.L.Genser - September 2017
// ------------------------------------------------------------
#ifndef G4ParticleDefinition_h
@@ -200,6 +201,10 @@ class G4ParticleDefinition
// true only if the particle is G4Ions
// (it means that theProcessManager is same as one for G4GenricIon)
G4bool IsMuonicAtom() const;
// true only if the particle is a G4MuonicAtom
// (it means that theProcessManager is same as the one for G4GenricMuonicAtom)
G4int operator==(const G4ParticleDefinition &right) const;
G4int operator!=(const G4ParticleDefinition &right) const;
@@ -366,6 +371,7 @@ class G4ParticleDefinition
protected:
G4bool isGeneralIon;
G4bool isMuonicAtom;
public:
void SetParticleDefinitionID(G4int id=-1);
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleDefinition.icc 99391 2016-09-20 13:32:30Z gcosmo $
// $Id: G4ParticleDefinition.icc 106143 2017-09-14 06:34:42Z gcosmo $
//
inline
@@ -204,6 +204,12 @@ inline
return isGeneralIon;
}
inline
G4bool G4ParticleDefinition::IsMuonicAtom() const
{
return isMuonicAtom;
}
inline
G4int G4ParticleDefinition::GetParticleDefinitionID() const
{
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleTable.hh 94421 2015-11-16 08:22:56Z gcosmo $
// $Id: G4ParticleTable.hh 106143 2017-09-14 06:34:42Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -45,6 +45,7 @@
// 28 ct., 99 H.Kurashige
// modified implementation of Remove 21 Mar.,08 H.Kurashige
// remove G4ShortLivedTable 25 July, 13 H.Kurashige
// added support for MuonicAtom September, 17 K.L.Genser
//
#ifndef G4ParticleTable_h
@@ -219,12 +220,15 @@ class G4ParticleTable
G4bool readyToUse;
G4ParticleDefinition* genericIon;
G4ParticleDefinition* genericMuonicAtom;
public:
void SetReadiness(G4bool val=true);
G4bool GetReadiness() const;
G4ParticleDefinition* GetGenericIon() const;
void SetGenericIon(G4ParticleDefinition*);
G4ParticleDefinition* GetGenericMuonicAtom() const;
void SetGenericMuonicAtom(G4ParticleDefinition*);
private:
void CheckReadiness() const;
@@ -24,12 +24,13 @@
// ********************************************************************
//
//
// $Id: G4ParticleTable.icc 73711 2013-09-09 09:57:29Z gcosmo $
// $Id: G4ParticleTable.icc 106143 2017-09-14 06:34:42Z gcosmo $
//
//
// ------------------------------------------------------------
// implement new version for using STL map instaed of RW PtrHashedDictionary
// 28 ct., 99 H.Kurashige
// added support for MuonicAtom Sep, 17 K.L.Genser
inline
@@ -100,3 +101,15 @@ inline
{
genericIon = gi;
}
inline
G4ParticleDefinition* G4ParticleTable::GetGenericMuonicAtom() const
{
return genericMuonicAtom;
}
inline
void G4ParticleTable::SetGenericMuonicAtom(G4ParticleDefinition* gma)
{
genericMuonicAtom = gma;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VDecayChannel.hh 95906 2016-03-02 10:56:50Z gcosmo $
// $Id: G4VDecayChannel.hh 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -290,9 +290,6 @@ inline
inline
const G4String& G4VDecayChannel::GetKinematicsName() const { return kinematics_name; }
inline
void G4VDecayChannel::SetBR(G4double value){ rbranch = value; }
inline
G4double G4VDecayChannel::GetBR() const { return rbranch; }
+5 -9
View File
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 101025 2016-11-04 08:36:30Z gcosmo $
# $Id: sources.cmake 106143 2017-09-14 06:34:42Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -45,13 +45,11 @@ GEANT4_DEFINE_MODULE(NAME G4partman
G4Ions.hh
G4IsotopeProperty.hh
G4KL3DecayChannel.hh
G4MuonicAtom.hh
G4MuonicAtomHelper.hh
G4MuonDecayChannel.hh
G4MuonDecayChannelWithSpin.hh
G4MuonRadiativeDecayChannelWithSpin.hh
G4MuonicAtom.hh
G4MuonicAtomDIODecayChannel.hh
G4MuonicAtomHelper.hh
G4MuonicAtomNuclearCaptureChannel.hh
G4NeutronBetaDecayChannel.hh
G4NucleiProperties.hh
G4NucleiPropertiesTableAME03.hh
@@ -96,12 +94,10 @@ GEANT4_DEFINE_MODULE(NAME G4partman
G4Ions.cc
G4IsotopeProperty.cc
G4KL3DecayChannel.cc
G4MuonicAtom.cc
G4MuonicAtomHelper.cc
G4MuonDecayChannel.cc
G4MuonDecayChannelWithSpin.cc
G4MuonicAtom.cc
G4MuonicAtomDIODecayChannel.cc
G4MuonicAtomHelper.cc
G4MuonicAtomNuclearCaptureChannel.cc
G4MuonRadiativeDecayChannelWithSpin.cc
G4NeutronBetaDecayChannel.cc
G4NucleiProperties.cc
+43 -25
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4DecayTable.cc 95052 2016-01-21 08:34:03Z gcosmo $
// $Id: G4DecayTable.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -40,7 +40,8 @@
#include "G4DecayTable.hh"
#include "Randomize.hh"
G4DecayTable::G4DecayTable():parent(0)
G4DecayTable::G4DecayTable()
:parent(nullptr), channels(nullptr)
{
channels = new G4VDecayChannelVector;
}
@@ -48,29 +49,32 @@ G4DecayTable::G4DecayTable():parent(0)
G4DecayTable::~G4DecayTable()
{
// remove and delete all contents
G4VDecayChannelVector::iterator i;
for (i = channels->begin(); i!= channels->end(); ++i) {
delete (*i);
G4VDecayChannelVector::iterator iCh;
for (iCh = channels->begin(); iCh!= channels->end(); ++iCh) {
delete (*iCh);
}
channels->clear();
delete channels;
channels = 0;
channels = nullptr;
parent = nullptr;
}
void G4DecayTable::Insert( G4VDecayChannel * aChannel){
if (parent == 0) { parent = (G4ParticleDefinition*)(aChannel->GetParent()); }
if (parent == nullptr) {
parent = (G4ParticleDefinition*)(aChannel->GetParent());
}
if (parent != aChannel->GetParent()) {
#ifdef G4VERBOSE
G4cout << " G4DecayTable::Insert :: bad G4VDecayChannel (mismatch parent) "
G4cout << " G4DecayTable::Insert :: bad G4VDecayChannel (mismatch parent) "
<< " " << parent->GetParticleName()
<< " input:" << aChannel->GetParent()->GetParticleName() << G4endl;
#endif
} else {
G4double r = aChannel->GetBR();
G4VDecayChannelVector::iterator i;
for (i = channels->begin(); i!= channels->end(); ++i) {
if (r > (*i)->GetBR()) {
channels->insert(i,aChannel);
G4double br = aChannel->GetBR();
G4VDecayChannelVector::iterator iCh;
for (iCh = channels->begin(); iCh!= channels->end(); ++iCh) {
if (br > (*iCh)->GetBR()) {
channels->insert(iCh,aChannel);
return;
}
}
@@ -84,30 +88,44 @@ G4VDecayChannel *G4DecayTable::SelectADecayChannel(G4double parentMass)
if (channels->size()<1) return 0;
if(parentMass<0.) parentMass=parent->GetPDGMass();
G4VDecayChannelVector::iterator iCh;
G4double sumBR = 0.;
for (iCh = channels->begin(); iCh!= channels->end(); ++iCh) {
if ( !((*iCh)->IsOKWithParentMass(parentMass)) ) continue;
sumBR += (*iCh)->GetBR();
}
if (sumBR <=0.0) {
#ifdef G4VERBOSE
G4cout << " G4DecayTable::SelectADecayChannel :: no possible DecayChannel"
<< " " << parent->GetParticleName() << G4endl;
#endif
return nullptr;
}
const size_t MAX_LOOP = 10000;
for (size_t loop_counter=0; loop_counter <MAX_LOOP; ++loop_counter){
G4double sumBR = 0.0;
G4double r= G4UniformRand();
G4double sum = 0.0;
G4double br= sumBR*G4UniformRand();
// select decay channel
G4VDecayChannelVector::iterator i;
for (i = channels->begin(); i!= channels->end(); ++i) {
sumBR += (*i)->GetBR();
if ( !((*i)->IsOKWithParentMass(parentMass)) ) continue;
if (r < sumBR) return (*i);
for (iCh = channels->begin(); iCh!= channels->end(); ++iCh) {
sum += (*iCh)->GetBR();
if ( !((*iCh)->IsOKWithParentMass(parentMass)) ) continue;
if (br < sum) return (*iCh);
}
}
return 0;
return nullptr;
}
void G4DecayTable::DumpInfo() const
{
G4cout << "G4DecayTable: " << parent->GetParticleName() << G4endl;
G4int index =0;
G4VDecayChannelVector::iterator i;
for (i = channels->begin(); i!= channels->end(); ++i) {
G4VDecayChannelVector::iterator iCh;
for (iCh = channels->begin(); iCh!= channels->end(); ++iCh) {
G4cout << index << ": ";
(*i)->DumpInfo();
index +=1;
(*iCh)->DumpInfo();
index += 1;
}
G4cout << G4endl;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4DecayTableMessenger.cc 81373 2014-05-27 13:06:32Z gcosmo $
// $Id: G4DecayTableMessenger.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
//---------------------------------------------------------------
@@ -57,13 +57,19 @@
G4DecayTableMessenger::G4DecayTableMessenger(G4ParticleTable* pTable)
:theParticleTable(pTable),
currentParticle(0), currentDecayTable(0),
idxCurrentChannel(-1), currentChannel(0),
thisDirectory(0),dumpCmd(0),selectCmd(0),brCmd(0)
currentParticle(nullptr),
currentDecayTable(nullptr),
idxCurrentChannel(-1),
currentChannel(nullptr),
thisDirectory(nullptr),
dumpCmd(nullptr),
selectCmd(nullptr),
brCmd(nullptr)
{
if ( theParticleTable == 0) theParticleTable = G4ParticleTable::GetParticleTable();
currentParticle = 0;
if ( theParticleTable == nullptr ) {
theParticleTable = G4ParticleTable::GetParticleTable();
}
currentParticle = nullptr;
//Commnad /particle/property/decay/
thisDirectory = new G4UIdirectory("/particle/property/decay/");
@@ -75,7 +81,7 @@ G4DecayTableMessenger::G4DecayTableMessenger(G4ParticleTable* pTable)
selectCmd->SetParameterName("mode", true);
selectCmd->SetDefaultValue(0);
selectCmd->SetRange("mode >=0");
currentChannel = 0;
currentChannel = nullptr;
//Commnad /particle/property/decay/dump
dumpCmd = new G4UIcmdWithoutParameter("/particle/property/decay/dump",this);
@@ -91,19 +97,19 @@ G4DecayTableMessenger::G4DecayTableMessenger(G4ParticleTable* pTable)
G4DecayTableMessenger::~G4DecayTableMessenger()
{
delete dumpCmd;
delete selectCmd;
delete brCmd;
delete thisDirectory;
if (dumpCmd != nullptr) delete dumpCmd;
if (selectCmd != nullptr) delete selectCmd;
if (brCmd != nullptr) delete brCmd;
if (thisDirectory != nullptr) delete thisDirectory;
}
void G4DecayTableMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if (SetCurrentParticle()==0) {
if (SetCurrentParticle()== nullptr) {
G4cout << "Particle is not selected yet !! Command ignored." << G4endl;
return;
}
if (currentDecayTable==0) {
if (currentDecayTable== nullptr) {
G4cout << "The particle has no decay table !! Command ignored." << G4endl;
return;
}
@@ -116,14 +122,14 @@ void G4DecayTableMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
//Commnad /particle/property/decay/select
G4int index = selectCmd->GetNewIntValue(newValue) ;
currentChannel = currentDecayTable->GetDecayChannel(index);
if ( currentChannel == 0 ) {
if ( currentChannel == nullptr ) {
G4cout << "Invalid index. Command ignored." << G4endl;
} else {
idxCurrentChannel = index;
}
} else {
if ( currentChannel == 0 ) {
if ( currentChannel == nullptr ) {
G4cout << "Select a decay channel. Command ignored." << G4endl;
return;
}
@@ -142,36 +148,36 @@ void G4DecayTableMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
G4ParticleDefinition* G4DecayTableMessenger::SetCurrentParticle()
{
// set currentParticle pointer
// set currentParticle pointer
// get particle name by asking G4ParticleMessenger via UImanager
G4String particleName = G4UImanager::GetUIpointer()->GetCurrentStringValue("/particle/select");
if (currentParticle != 0 ){
if (currentParticle != nullptr ){
// check whether selection is changed
if (currentParticle->GetParticleName() != particleName) {
currentParticle = theParticleTable->FindParticle(particleName);
idxCurrentChannel = -1;
currentDecayTable = 0;
currentDecayTable = nullptr;
} else {
// no change
return currentParticle;
}
} else {
currentParticle = theParticleTable->FindParticle(particleName);
idxCurrentChannel = -1;
currentDecayTable = 0;
}
if (currentParticle != 0 ){
currentDecayTable = currentParticle->GetDecayTable();
if ((currentDecayTable != 0 ) && (idxCurrentChannel >0) ) {
currentChannel = currentDecayTable->GetDecayChannel(idxCurrentChannel);
} else {
idxCurrentChannel = -1;
currentChannel = 0;
currentDecayTable = nullptr;
if (currentParticle != nullptr ){
currentDecayTable = currentParticle->GetDecayTable();
if ((currentDecayTable != nullptr ) && (idxCurrentChannel >0) ) {
currentChannel = currentDecayTable->GetDecayChannel(idxCurrentChannel);
} else {
idxCurrentChannel = -1;
currentChannel = nullptr;
}
}
}
return currentParticle;
}
@@ -180,7 +186,7 @@ G4String G4DecayTableMessenger::GetCurrentValue(G4UIcommand * command)
{
G4String returnValue('\0');
if (SetCurrentParticle()==0) {
if (SetCurrentParticle()==nullptr) {
// no particle is selected. return null
return returnValue;
}
@@ -190,7 +196,7 @@ G4String G4DecayTableMessenger::GetCurrentValue(G4UIcommand * command)
returnValue = selectCmd->ConvertToString(idxCurrentChannel);
} else if( command == brCmd ){
if ( currentChannel != 0) {
if ( currentChannel != nullptr) {
returnValue = brCmd->ConvertToString(currentChannel->GetBR());
}
}
+62 -16
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4IonTable.cc 102916 2017-03-02 12:58:58Z gcosmo $
// $Id: G4IonTable.cc 106143 2017-09-14 06:34:42Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -44,6 +44,7 @@
// Modified Element Name for Z>103 06 Apr. 01 H.Kurashige
// Remove test of cuts in SetCuts 16 Jan 03 V.Ivanchenko
// Added initial support for Muonic Atoms 1 Jul 16 K.Lynch
// Extended support for Muonic Atoms September 17 K.L.Genser
#include <iostream>
#include <iomanip>
@@ -1518,23 +1519,68 @@ void G4IonTable::AddProcessManager(G4ParticleDefinition* ion)
// return;
// }
// check whether GenericIon has processes
G4ParticleDefinition* genericIon =
G4ParticleTable::GetParticleTable()->GetGenericIon();
if(ion->IsGeneralIon()) {
G4ProcessManager* pman=0;
if (genericIon!=0) pman = genericIon->GetProcessManager();
if ((genericIon ==0) || (genericIon->GetParticleDefinitionID() < 0) || (pman==0)){
G4cout << "G4IonTable::AddProcessManager() : can not create ion of "
<< ion->GetParticleName()
<< " because GenericIon is not available!!" << G4endl;
G4Exception( "G4IonTable::AddProcessManager()","PART105", FatalException,
"Can not create ions because GenericIon is not available");
return;
}
// check whether GenericIon has processes
G4ParticleDefinition* genericIon =
G4ParticleTable::GetParticleTable()->GetGenericIon();
G4ProcessManager* pman=0;
if (genericIon!=0) pman = genericIon->GetProcessManager();
if ((genericIon ==0) || (genericIon->GetParticleDefinitionID() < 0) || (pman==0)){
G4cout << "G4IonTable::AddProcessManager() : can not create ion of "
<< ion->GetParticleName()
<< " because GenericIon is not available!!" << G4endl;
G4Exception( "G4IonTable::AddProcessManager()","PART105", FatalException,
"Can not create ions because GenericIon is not available");
return;
}
//////// ion->SetProcessManager(pman);
ion->SetParticleDefinitionID(genericIon->GetParticleDefinitionID());
//////// ion->SetProcessManager(pman);
ion->SetParticleDefinitionID(genericIon->GetParticleDefinitionID());
}
else {
// is this a MuonicAtom ?
G4MuonicAtom* muatom = dynamic_cast<G4MuonicAtom*> (ion);
if ( muatom != nullptr ) {
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) {
G4cout << "G4IonTable::AddProcessManager() : MuonicAtom dynamic_cast succeeded for "
<< ion->GetParticleName() << G4endl;
}
#endif
// check whether GenericMuonicAtom has processes
G4ParticleDefinition* genericMA =
G4ParticleTable::GetParticleTable()->GetGenericMuonicAtom();
G4ProcessManager* pman = nullptr;
if (genericMA != nullptr) pman = genericMA->GetProcessManager();
if ((genericMA == nullptr) || (genericMA->GetParticleDefinitionID() < 0) || (pman==nullptr)){
G4cout << "G4IonTable::AddProcessManager() : can not create MuonicAtom "
<< ion->GetParticleName()
<< " because GenericMuonicAtom is not available!!" << G4endl;
G4Exception( "G4IonTable::AddProcessManager()","PART106", FatalException,
"Can not create MuonicAtoms because GenericMuonicAtom is not available");
return;
}
//////// ion->SetProcessManager(pman);
ion->SetParticleDefinitionID(genericMA->GetParticleDefinitionID());
}
else {
G4cout << "G4IonTable::AddProcessManager() : can not create "
<< ion->GetParticleName()
<< " because of unsupported particle type !!" << G4endl;
G4Exception( "G4IonTable::AddProcessManager()","PART107", FatalException,
"Can not create particle");
return;
}
}
return;
}
#include <vector>
@@ -30,7 +30,9 @@
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// History: first implementation, K.Lynch July 2016
// History:
// July 2016, K.Lynch - first implementation
// June 2017, K.L.Genser - added baseion, lifetimes and access functions
#include "G4MuonicAtom.hh"
@@ -42,17 +44,28 @@ G4MuonicAtom::G4MuonicAtom(
G4int iIsospin3, G4int gParity,
const G4String& pType, G4int lepton,
G4int baryon, G4int encoding,
G4bool stable, G4double lifetime,
G4bool stable, G4double lifeTime,
G4DecayTable *decaytable, G4bool shortlived,
const G4String& subType
const G4String& subType, G4Ions const* baseion,
G4int anti_encoding,
G4double excitation,
G4int isomer,
G4double DIOLifeTime,
G4double NCLifeTime
) : G4Ions( aName,mass,width,charge,iSpin,iParity,
iConjugation,iIsospin,iIsospin3,gParity,pType,
lepton,baryon,encoding,stable,lifetime,decaytable,
shortlived, subType, 0,0,0)
iConjugation,iIsospin,iIsospin3,gParity,pType,
lepton,baryon,encoding,stable,lifeTime,decaytable,
shortlived,subType,anti_encoding,excitation,isomer),
baseIon(baseion),
fDIOLifeTime(DIOLifeTime),
fNCLifeTime(NCLifeTime)
{
// member is private in base, so we need to go through the public
// interface
SetFloatLevelBase(G4FloatLevelBase::no_Float);
isGeneralIon=true;
SetFloatLevelBase(G4FloatLevelBase::no_Float);
// from G4ParticleDefinition
isGeneralIon = false;
isMuonicAtom = true;
}
G4MuonicAtom::~G4MuonicAtom(){}
@@ -1,36 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4MuonicAtomDIODecayChannel.cc 96797 2016-05-09 10:13:42Z gcosmo $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// History: first implementation, 17 October 16 K.Lynch
// ---------------------------------------------------------------
#include "G4MuonicAtomDIODecayChannel.hh"
@@ -26,53 +26,364 @@
//
// $Id: G4MuonicAtomHelper.cc 96797 2016-05-09 10:13:42Z gcosmo $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// History: first implementation, 1 July 16 K.Lynch
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// History:
// July 2016, K.Lynch - first implementation
// June 2017, K.L.Genser - major revision;
// also copied functions from G4MuonMinusBoundDecay &
// old G4MuMinusCaptureCascade; used constexpr
// ---------------------------------------------------------------
#include "G4MuonicAtomHelper.hh"
#include "G4DecayTable.hh"
#include "G4PhaseSpaceDecayChannel.hh"
#include "G4ParticleTable.hh"
#include "G4SystemOfUnits.hh"
#include "G4PhysicalConstants.hh"
#include "Randomize.hh"
G4MuonicAtom*
G4MuonicAtom*
G4MuonicAtomHelper::ConstructMuonicAtom(G4String name, G4int encoding, G4Ions const* baseion){
// mass calculation is missing binding energy correction
//auto const mass = G4MuonMinus::Definition()->GetPDGMass() + baseion->GetPDGMass();
auto const mass = 0.1056583715*CLHEP::GeV + baseion->GetPDGMass();
// what should static charge be? for G4Ions, it is Z ... should it
// be Z-1 here (since there will always be a muon attached), or Z?
auto const charge = baseion->GetPDGCharge();
auto muatom = new G4MuonicAtom(name, mass, 0.0, charge,
const G4double charge = baseion->GetPDGCharge();
static const G4String pType("MuonicAtom"); // put in an include? in an enum?
G4bool stable = false;
// Get the lifetime
G4int Z = baseion->GetAtomicNumber();
G4int A = baseion->GetAtomicMass();
G4double lambdac = GetMuonCaptureRate(Z, A);
G4double lambdad = GetMuonDecayRate(Z);
G4double lifetime = 1./(lambdac+lambdad);
G4bool shortlived = false;
const G4double mass =
(G4ParticleTable::GetParticleTable()->FindParticle("mu-"))->GetPDGMass() +
baseion->GetPDGMass() - GetKShellEnergy(G4double(Z)); //fixme check
G4DecayTable* decayTable = new G4DecayTable();
auto muatom = new G4MuonicAtom(name, mass, 0.0, charge,
baseion->GetPDGiSpin(),
baseion->GetPDGiParity(),
baseion->GetPDGiConjugation(),
baseion->GetPDGiIsospin(),
baseion->GetPDGiIsospin3(),
baseion->GetPDGiGParity(),
baseion->GetParticleType(),
pType,
baseion->GetLeptonNumber(),
baseion->GetBaryonNumber(),
encoding,
baseion->GetPDGStable(),
// TODO: this is wrong ... need to
// get correct muonic atom lifetime.
// but see next comment
baseion->GetPDGLifeTime(),
// TODO: this is _definitely_ wrong:
// we need to add muonic atom decay
// channels ... do we try to support
// other modes of decay, or do we
// just assume for now that we don't
// need to worry about radioactive
// decay and the like?
baseion->GetDecayTable(),
baseion->IsShortLived(),
baseion->GetParticleSubType());
stable,
lifetime,
decayTable,
shortlived,
baseion->GetParticleSubType(),
baseion);
muatom->SetPDGMagneticMoment(baseion->GetPDGMagneticMoment());
// by this time both G4MuonicAtom and baseion should exist
// if we choose DIO this will be the channel we'll use, so we put
// br=1. to force it in that case
decayTable->Insert(new G4PhaseSpaceDecayChannel(name, 1., 4,
"e-","anti_nu_e","nu_mu",
baseion->GetParticleName()));
muatom->SetDIOLifeTime(1./lambdad);
muatom->SetNCLifeTime(1./lambdac);
return muatom;
}
G4double G4MuonicAtomHelper::GetMuonCaptureRate(G4int Z, G4int A)
{
// Initialize data
// Mu- capture data from
// T. Suzuki, D. F. Measday, J.P. Roalsvig Phys.Rev. C35 (1987) 2212
// weighted average of the two most precise measurements
// Data for Hydrogen from Phys. Rev. Lett. 99(2007)032002
// Data for Helium from D.F. Measday Phys. Rep. 354(2001)243
struct capRate {
G4int Z;
G4int A;
G4double cRate;
G4double cRErr;
};
// this struct has to be sorted by Z when initialized as we exit the
// loop once Z is above the stored value; cRErr are not used now but
// are included for completeness and future use
constexpr capRate capRates [] = {
{ 1, 1, 0.000725, 0.000017 },
{ 2, 3, 0.002149, 0.00017 },
{ 2, 4, 0.000356, 0.000026 },
{ 3, 6, 0.004647, 0.00012 },
{ 3, 7, 0.002229, 0.00012 },
{ 4, 9, 0.006107, 0.00019 },
{ 5, 10, 0.02757 , 0.00063 },
{ 5, 11, 0.02188 , 0.00064 },
{ 6, 12, 0.03807 , 0.00031 },
{ 6, 13, 0.03474 , 0.00034 },
{ 7, 14, 0.06885 , 0.00057 },
{ 8, 16, 0.10242 , 0.00059 },
{ 8, 18, 0.0880 , 0.0015 },
{ 9, 19, 0.22905 , 0.00099 },
{ 10, 20, 0.2288 , 0.0045 },
{ 11, 23, 0.3773 , 0.0014 },
{ 12, 24, 0.4823 , 0.0013 },
{ 13, 27, 0.6985 , 0.0012 },
{ 14, 28, 0.8656 , 0.0015 },
{ 15, 31, 1.1681 , 0.0026 },
{ 16, 32, 1.3510 , 0.0029 },
{ 17, 35, 1.800 , 0.050 },
{ 17, 37, 1.250 , 0.050 },
{ 18, 40, 1.2727 , 0.0650 },
{ 19, 39, 1.8492 , 0.0050 },
{ 20, 40, 2.5359 , 0.0070 },
{ 21, 45, 2.711 , 0.025 },
{ 22, 48, 2.5908 , 0.0115 },
{ 23, 51, 3.073 , 0.022 },
{ 24, 50, 3.825 , 0.050 },
{ 24, 52, 3.465 , 0.026 },
{ 24, 53, 3.297 , 0.045 },
{ 24, 54, 3.057 , 0.042 },
{ 25, 55, 3.900 , 0.030 },
{ 26, 56, 4.408 , 0.022 },
{ 27, 59, 4.945 , 0.025 },
{ 28, 58, 6.11 , 0.10 },
{ 28, 60, 5.56 , 0.10 },
{ 28, 62, 4.72 , 0.10 },
{ 29, 63, 5.691 , 0.030 },
{ 30, 66, 5.806 , 0.031 },
{ 31, 69, 5.700 , 0.060 },
{ 32, 72, 5.561 , 0.031 },
{ 33, 75, 6.094 , 0.037 },
{ 34, 80, 5.687 , 0.030 },
{ 35, 79, 7.223 , 0.28 },
{ 35, 81, 7.547 , 0.48 },
{ 37, 85, 6.89 , 0.14 },
{ 38, 88, 6.93 , 0.12 },
{ 39, 89, 7.89 , 0.11 },
{ 40, 91, 8.620 , 0.053 },
{ 41, 93, 10.38 , 0.11 },
{ 42, 96, 9.298 , 0.063 },
{ 45, 103, 10.010 , 0.045 },
{ 46, 106, 10.000 , 0.070 },
{ 47, 107, 10.869 , 0.095 },
{ 48, 112, 10.624 , 0.094 },
{ 49, 115, 11.38 , 0.11 },
{ 50, 119, 10.60 , 0.11 },
{ 51, 121, 10.40 , 0.12 },
{ 52, 128, 9.174 , 0.074 },
{ 53, 127, 11.276 , 0.098 },
{ 55, 133, 10.98 , 0.25 },
{ 56, 138, 10.112 , 0.085 },
{ 57, 139, 10.71 , 0.10 },
{ 58, 140, 11.501 , 0.087 },
{ 59, 141, 13.45 , 0.13 },
{ 60, 144, 12.35 , 0.13 },
{ 62, 150, 12.22 , 0.17 },
{ 64, 157, 12.00 , 0.13 },
{ 65, 159, 12.73 , 0.13 },
{ 66, 163, 12.29 , 0.18 },
{ 67, 165, 12.95 , 0.13 },
{ 68, 167, 13.04 , 0.27 },
{ 72, 178, 13.03 , 0.21 },
{ 73, 181, 12.86 , 0.13 },
{ 74, 184, 12.76 , 0.16 },
{ 79, 197, 13.35 , 0.10 },
{ 80, 201, 12.74 , 0.18 },
{ 81, 205, 13.85 , 0.17 },
{ 82, 207, 13.295 , 0.071 },
{ 83, 209, 13.238 , 0.065 },
{ 90, 232, 12.555 , 0.049 },
{ 92, 238, 12.592 , 0.035 },
{ 92, 233, 14.27 , 0.15 },
{ 92, 235, 13.470 , 0.085 },
{ 92, 236, 13.90 , 0.40 },
{ 93, 237, 13.58 , 0.18 },
{ 94, 239, 13.90 , 0.20 },
{ 94, 242, 12.86 , 0.19 }
};
G4double lambda = -1.;
size_t nCapRates = sizeof(capRates)/sizeof(capRates[0]);
for (size_t j = 0; j < nCapRates; ++j) {
if( capRates[j].Z == Z && capRates[j].A == A ) {
lambda = capRates[j].cRate / microsecond;
break;
}
// make sure the data is sorted for the next statement to work correctly
if (capRates[j].Z > Z) {break;}
}
if (lambda < 0.) {
// == Mu capture lifetime (Goulard and Primakoff PRC10(1974)2034.
constexpr G4double b0a = -0.03;
constexpr G4double b0b = -0.25;
constexpr G4double b0c = 3.24;
constexpr G4double t1 = 875.e-9; // -10-> -9 suggested by user
G4double r1 = GetMuonZeff(Z);
G4double zeff2 = r1 * r1;
// ^-4 -> ^-5 suggested by user
G4double xmu = zeff2 * 2.663e-5;
G4double a2ze = 0.5 *G4double(A) / G4double(Z);
G4double r2 = 1.0 - xmu;
lambda = t1 * zeff2 * zeff2 * (r2 * r2) * (1.0 - (1.0 - xmu) * .75704) *
(a2ze * b0a + 1.0 - (a2ze - 1.0) * b0b -
G4double(2 * (A - Z) + std::abs(a2ze - 1.) ) * b0c / G4double(A * 4) );
}
return lambda;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4MuonicAtomHelper::GetMuonZeff(G4int Z)
{
// == Effective charges from
// "Total Nuclear Capture Rates for Negative Muons"
// T. Suzuki, D. F. Measday, J.P. Roalsvig Phys.Rev. C35 (1987) 2212
// and if not present from
// Ford and Wills Nucl Phys 35(1962)295 or interpolated
constexpr size_t maxZ = 100;
constexpr G4double zeff[maxZ+1] =
{ 0.,
1.00, 1.98, 2.94, 3.89, 4.81, 5.72, 6.61, 7.49, 8.32, 9.14,
9.95,10.69,11.48,12.22,12.90,13.64,14.24,14.89,15.53,16.15,
16.77,17.38,18.04,18.49,19.06,19.59,20.13,20.66,21.12,21.61,
22.02,22.43,22.84,23.24,23.65,24.06,24.47,24.85,25.23,25.61,
25.99,26.37,26.69,27.00,27.32,27.63,27.95,28.20,28.42,28.64,
28.79,29.03,29.27,29.51,29.75,29.99,30.22,30.36,30.53,30.69,
30.85,31.01,31.18,31.34,31.48,31.62,31.76,31.90,32.05,32.19,
32.33,32.47,32.61,32.76,32.94,33.11,33.29,33.46,33.64,33.81,
34.21,34.18,34.00,34.10,34.21,34.31,34.42,34.52,34.63,34.73,
34.84,34.94,35.05,35.16,35.25,35.36,35.46,35.57,35.67,35.78 };
if (Z<0) {Z=0;}
if (Z>G4int(maxZ)) {Z=maxZ;}
return zeff[Z];
}
G4double G4MuonicAtomHelper::GetMuonDecayRate(G4int Z)
{
// Decay time on K-shell
// N.C.Mukhopadhyay Phys. Rep. 30 (1977) 1.
// this is the "small Z" approximation formula (2.9)
// Lambda(bound)/Lambda(free) = 1-beta(Z*alpha)**2 with beta~=2.5
// we assume that Z is Zeff
// PDG 2012 muon lifetime value is 2.1969811(22) 10e-6s
// which when inverted gives 0.45517005 10e+6/s
struct decRate {
G4int Z;
G4double dRate;
G4double dRErr;
};
// this struct has to be sorted by Z when initialized as we exit the
// loop once Z is above the stored value
constexpr decRate decRates [] = {
{ 1, 0.4558514, 0.0000151 }
};
G4double lambda = -1.;
// size_t nDecRates = sizeof(decRates)/sizeof(decRates[0]);
// for (size_t j = 0; j < nDecRates; ++j) {
// if( decRates[j].Z == Z ) {
// lambda = decRates[j].dRate / microsecond;
// break;
// }
// // make sure the data is sorted for the next statement to work
// if (decRates[j].Z > Z) {break;}
// }
// we'll use the above code once we have more data
// since we only have one value we just assign it
if (Z == 1) {lambda = decRates[0].dRate/microsecond;}
if (lambda < 0.) {
constexpr G4double freeMuonDecayRate = 0.45517005 / microsecond;
lambda = 1.0;
G4double x = GetMuonZeff(Z)*fine_structure_const;
lambda -= 2.5 * x * x;
lambda *= freeMuonDecayRate;
}
return lambda;
}
// From V.Ivanchenko's G4MuMinusCaptureCascade
G4double G4MuonicAtomHelper::GetKShellEnergy(G4double Z) {
// Calculate the Energy of K Mesoatom Level for this Element using
// the Energy of Hydrogen Atom taken into account finite size of the
// nucleus (V.Ivanchenko)
constexpr G4int ListK = 28;
constexpr G4double ListZK[ListK] = {
1., 2., 4., 6., 8., 11., 14., 17., 18., 21., 24.,
26., 29., 32., 38., 40., 41., 44., 49., 53., 55.,
60., 65., 70., 75., 81., 85., 92.};
constexpr G4double ListKEnergy[ListK] = {
0.00275, 0.011, 0.043, 0.098, 0.173, 0.326,
0.524, 0.765, 0.853, 1.146, 1.472,
1.708, 2.081, 2.475, 3.323, 3.627,
3.779, 4.237, 5.016, 5.647, 5.966,
6.793, 7.602, 8.421, 9.249, 10.222,
10.923,11.984};
// Energy with finite size corrections
G4double KEnergy = GetLinApprox(ListK,ListZK,ListKEnergy,Z);
return KEnergy;
}
// From V.Ivanchenko's G4MuMinusCaptureCascade
G4double G4MuonicAtomHelper::GetLinApprox(G4int N,
const G4double* const X,
const G4double* const Y,
G4double Xuser) {
G4double Yuser;
if(Xuser <= X[0]) Yuser = Y[0];
else if(Xuser >= X[N-1]) Yuser = Y[N-1];
else {
G4int i;
for (i=1; i<N; i++){
if(Xuser <= X[i]) break;
}
if(Xuser == X[i]) Yuser = Y[i];
else Yuser = Y[i-1] + (Y[i] - Y[i-1])*(Xuser - X[i-1])/(X[i] - X[i-1]);
}
return Yuser;
}
@@ -1,36 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4MuonicAtomNuclearCaptureChannel.cc 96797 2016-05-09 10:13:42Z gcosmo $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// History: first implementation, 17 October 16 K.Lynch
// ---------------------------------------------------------------
#include "G4MuonicAtomNuclearCaptureChannel.hh"
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4PDGCodeChecker.cc 94091 2015-11-05 15:13:52Z gcosmo $
// $Id: G4PDGCodeChecker.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ----------------------------------------------------------------------
@@ -325,6 +325,8 @@ G4int G4PDGCodeChecker::CheckForDiQuarks()
/////////////
G4int G4PDGCodeChecker::CheckForQuarks()
{
quark1 = std::abs(code);
if ( std::abs(quark1)>NumberOfQuarkFlavor ) {
#ifdef G4VERBOSE
if (verboseLevel>0) {
@@ -338,8 +340,6 @@ G4int G4PDGCodeChecker::CheckForQuarks()
}
quark1 = std::abs(code);
// Fill Quark Contents
if (code>0){
theQuarkContent[quark1-1] =1;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleDefinition.cc 103108 2017-03-16 13:00:35Z gcosmo $
// $Id: G4ParticleDefinition.cc 106143 2017-09-14 06:34:42Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -48,6 +48,7 @@
//
// modify FillQuarkContents() to use G4PDGCodeChecker 17 Aug. 99 H.Kurashige
// modified for thread-safety for MT - G.Cosmo, A.Dotti - January 2013
// added support for MuonicAtom - K.L.Genser - June 2017
// --------------------------------------------------------------
@@ -121,9 +122,11 @@ G4ParticleDefinition::G4ParticleDefinition(
theAtomicMass(0),
verboseLevel(1),
fApplyCutsFlag(false),
isGeneralIon(false)
isGeneralIon(false),
isMuonicAtom(false)
{
static G4String nucleus("nucleus");
static const G4String nucleus("nucleus");
static const G4String muAtom("MuonicAtom");
g4particleDefinitionInstanceID = -1;
theProcessManagerShadow = 0;
@@ -151,7 +154,7 @@ G4ParticleDefinition::G4ParticleDefinition(
// check initialization is in Pre_Init state except for ions
G4ApplicationState currentState = G4StateManager::GetStateManager()->GetCurrentState();
if ( !fShortLivedFlag && (theParticleType!=nucleus) && (currentState!=G4State_PreInit)){
if ( !fShortLivedFlag && (theParticleType!=nucleus) && (theParticleType!=muAtom) && (currentState!=G4State_PreInit)){
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
G4cout << "G4ParticleDefintion (other than ions and shortlived) should be created in Pre_Init state "
@@ -440,7 +443,7 @@ void G4ParticleDefinition::SetParticleDefinitionID(G4int id)
}
else
{
if(isGeneralIon)
if( isGeneralIon || isMuonicAtom )
{ g4particleDefinitionInstanceID = id; }
else
{
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ParticleTable.cc 103108 2017-03-16 13:00:35Z gcosmo $
// $Id: G4ParticleTable.cc 106143 2017-09-14 06:34:42Z gcosmo $
//
// class G4ParticleTable
//
@@ -47,6 +47,7 @@
// RW PtrHashedDictionary 28 Oct., 99 H.Kurashige
// remove G4ShortLivedTable 25 July, 13 H.Kurashige
// remove FindIon/GetIon 25 Sep. 14 H.Kurashige
// added support for MuonicAtom September, 17 K.L.Genser
//
#include "globals.hh"
@@ -112,7 +113,8 @@ G4ParticleTable::G4ParticleTable()
:verboseLevel(1),
noName(" "),
readyToUse(false),
genericIon(NULL)
genericIon(nullptr),
genericMuonicAtom(nullptr)
{
fDictionary = new G4PTblDictionary();
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VDecayChannel.cc 98352 2016-07-08 08:21:00Z gcosmo $
// $Id: G4VDecayChannel.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// ------------------------------------------------------------
@@ -50,17 +50,18 @@ G4VDecayChannel::G4VDecayChannel()
:kinematics_name(""),
rbranch(0.0),
numberOfDaughters(0),
parent_name(0), daughters_name(0),
parent_name(nullptr),
daughters_name(nullptr),
rangeMass(2.5),
parent_polarization(),
particletable(0),
particletable(nullptr),
verboseLevel(1)
{
G4MT_parent = 0;
G4MT_daughters = 0;
G4MT_parent = nullptr;
G4MT_daughters = nullptr;
G4MT_parent_mass = 0.0;
G4MT_daughters_mass = 0;
G4MT_daughters_width = 0;
G4MT_daughters_mass = nullptr;
G4MT_daughters_width = nullptr;
// set pointer to G4ParticleTable (static and singleton object)
particletable = G4ParticleTable::GetParticleTable();
@@ -70,19 +71,20 @@ G4VDecayChannel::G4VDecayChannel(const G4String &aName, G4int Verbose)
:kinematics_name(aName),
rbranch(0.0),
numberOfDaughters(0),
parent_name(0), daughters_name(0),
parent_name(nullptr),
daughters_name(nullptr),
rangeMass(2.5),
parent_polarization(),
particletable(0),
particletable(nullptr),
verboseLevel(Verbose),
daughtersMutex(G4MUTEX_INITIALIZER),
parentMutex(G4MUTEX_INITIALIZER)
{
G4MT_parent = 0;
G4MT_daughters = 0;
G4MT_parent = nullptr;
G4MT_daughters = nullptr;
G4MT_parent_mass = 0.0;
G4MT_daughters_mass = 0;
G4MT_daughters_width = 0;
G4MT_daughters_mass = nullptr;
G4MT_daughters_width = nullptr;
// set pointer to G4ParticleTable (static and singleton object)
particletable = G4ParticleTable::GetParticleTable();
@@ -99,7 +101,8 @@ G4VDecayChannel::G4VDecayChannel(const G4String &aName,
:kinematics_name(aName),
rbranch(theBR),
numberOfDaughters(theNumberOfDaughters),
parent_name(0), daughters_name(0),
parent_name(nullptr),
daughters_name(nullptr),
rangeMass(1.0),
parent_polarization(),
particletable(0),
@@ -107,11 +110,11 @@ G4VDecayChannel::G4VDecayChannel(const G4String &aName,
daughtersMutex(G4MUTEX_INITIALIZER),
parentMutex(G4MUTEX_INITIALIZER)
{
G4MT_parent = 0;
G4MT_daughters = 0;
G4MT_parent = nullptr;
G4MT_daughters = nullptr;
G4MT_parent_mass = 0.0;
G4MT_daughters_mass = 0;
G4MT_daughters_width = 0;
G4MT_daughters_mass = nullptr;
G4MT_daughters_width = nullptr;
// set pointer to G4ParticleTable (static and singleton object)
particletable = G4ParticleTable::GetParticleTable();
@@ -128,6 +131,9 @@ G4VDecayChannel::G4VDecayChannel(const G4String &aName,
if (numberOfDaughters>1) daughters_name[1] = new G4String(theDaughterName2);
if (numberOfDaughters>2) daughters_name[2] = new G4String(theDaughterName3);
if (numberOfDaughters>3) daughters_name[3] = new G4String(theDaughterName4);
if (rbranch <0. ) rbranch = 0.0;
else if (rbranch >1.0 ) rbranch = 1.0;
}
G4VDecayChannel::G4VDecayChannel(const G4VDecayChannel &right)
@@ -139,26 +145,25 @@ G4VDecayChannel::G4VDecayChannel(const G4VDecayChannel &right)
// copy parent name
parent_name = new G4String(*right.parent_name);
G4MT_parent = 0;
G4MT_parent = nullptr;
G4MT_parent_mass = 0.0;
//create array
numberOfDaughters = right.numberOfDaughters;
daughters_name =0;
daughters_name =nullptr;
if ( numberOfDaughters >0 ) {
daughters_name = new G4String*[numberOfDaughters];
//copy daughters name
for (G4int index=0; index < numberOfDaughters; index++)
{
daughters_name[index] = new G4String(*right.daughters_name[index]);
}
for (G4int index=0; index < numberOfDaughters; index++){
daughters_name[index] = new G4String(*right.daughters_name[index]);
}
}
//
G4MT_daughters_mass = 0;
G4MT_daughters = 0;
G4MT_daughters_width = 0;
G4MT_daughters_mass = nullptr;
G4MT_daughters = nullptr;
G4MT_daughters_width = nullptr;
// particle table
particletable = G4ParticleTable::GetParticleTable();
@@ -186,7 +191,7 @@ G4VDecayChannel & G4VDecayChannel::operator=(const G4VDecayChannel &right)
// recreate array
numberOfDaughters = right.numberOfDaughters;
if ( numberOfDaughters >0 ) {
if (daughters_name !=0) ClearDaughtersName();
if (daughters_name != nullptr) ClearDaughtersName();
daughters_name = new G4String*[numberOfDaughters];
//copy daughters name
for (G4int index=0; index < numberOfDaughters; index++) {
@@ -196,11 +201,11 @@ G4VDecayChannel & G4VDecayChannel::operator=(const G4VDecayChannel &right)
}
//
G4MT_parent = 0;
G4MT_daughters = 0;
G4MT_parent = nullptr;
G4MT_daughters = nullptr;
G4MT_parent_mass = 0.0;
G4MT_daughters_mass = 0;
G4MT_daughters_width = 0;
G4MT_daughters_mass = nullptr;
G4MT_daughters_width = nullptr;
// particle table
particletable = G4ParticleTable::GetParticleTable();
@@ -214,12 +219,12 @@ G4VDecayChannel & G4VDecayChannel::operator=(const G4VDecayChannel &right)
G4VDecayChannel::~G4VDecayChannel()
{
ClearDaughtersName();
if (parent_name != 0) delete parent_name;
parent_name = 0;
if (G4MT_daughters_mass != 0) delete [] G4MT_daughters_mass;
G4MT_daughters_mass =0;
if (G4MT_daughters_width != 0) delete [] G4MT_daughters_width;
G4MT_daughters_width = 0;
if (parent_name != nullptr) delete parent_name;
parent_name = nullptr;
if (G4MT_daughters_mass != nullptr) delete [] G4MT_daughters_mass;
G4MT_daughters_mass =nullptr;
if (G4MT_daughters_width != nullptr) delete [] G4MT_daughters_width;
G4MT_daughters_width = nullptr;
G4MUTEXDESTROY(daughtersMutex);
G4MUTEXDESTROY(parentMutex);
}
@@ -227,7 +232,7 @@ G4VDecayChannel::~G4VDecayChannel()
void G4VDecayChannel::ClearDaughtersName()
{
G4AutoLock l(&daughtersMutex);
if ( daughters_name != 0) {
if ( daughters_name != nullptr) {
if (numberOfDaughters>0) {
#ifdef G4VERBOSE
if (verboseLevel>1) {
@@ -236,20 +241,19 @@ void G4VDecayChannel::ClearDaughtersName()
}
#endif
for (G4int index=0; index < numberOfDaughters; index++) {
if (daughters_name[index] != 0) delete daughters_name[index];
if (daughters_name[index] != nullptr) delete daughters_name[index];
}
}
delete [] daughters_name;
daughters_name = 0;
daughters_name = nullptr;
}
//
if (G4MT_daughters != 0) delete [] G4MT_daughters;
if (G4MT_daughters_mass != 0) delete [] G4MT_daughters_mass;
if (G4MT_daughters_width != 0) delete [] G4MT_daughters_width;
G4MT_daughters_width = 0;
G4MT_daughters = 0;
G4MT_daughters_mass = 0;
G4MT_daughters_width = 0;
if (G4MT_daughters != nullptr) delete [] G4MT_daughters;
if (G4MT_daughters_mass != nullptr) delete [] G4MT_daughters_mass;
if (G4MT_daughters_width != nullptr) delete [] G4MT_daughters_width;
G4MT_daughters_width = nullptr;
G4MT_daughters = nullptr;
G4MT_daughters_mass = nullptr;
numberOfDaughters = 0;
}
@@ -261,7 +265,7 @@ void G4VDecayChannel::SetNumberOfDaughters(G4int size)
ClearDaughtersName();
// cleate array
daughters_name = new G4String*[size];
for (G4int index=0;index<size;index++) daughters_name[index]=0;
for (G4int index=0;index<size;index++) daughters_name[index]=nullptr;
numberOfDaughters = size;
}
}
@@ -290,15 +294,15 @@ void G4VDecayChannel::SetDaughter(G4int anIndex,
// at construction, i.e. when G4MT_daugheters == 0
// moreover this method can be called only after SetNumberOfDaugthers
// has been called (see previous if), in such a case daughters_name != 0
if ( daughters_name == 0 ) {
G4Exception("G4VDecayChannel::SetDaughter","PART112",FatalException,
"Trying to add a daughter without specifying number of secondaries, useSetNumberOfDaughters first");
return;
if ( daughters_name == nullptr ) {
G4Exception("G4VDecayChannel::SetDaughter","PART112",FatalException,
"Trying to add a daughter without specifying number of secondaries, useSetNumberOfDaughters first");
return;
}
if ( G4MT_daughters != 0 ) {
G4Exception("G4VDecayChannel::SetDaughter","PART111",FatalException,
"Trying to modify a daughter of a decay channel, but decay channel already has daughters.");
return;
if ( G4MT_daughters != nullptr ) {
G4Exception("G4VDecayChannel::SetDaughter","PART111",FatalException,
"Trying to modify a daughter of a decay channel, but decay channel already has daughters.");
return;
}
//<-:ANDREA
@@ -324,7 +328,7 @@ void G4VDecayChannel::SetDaughter(G4int anIndex,
void G4VDecayChannel::SetDaughter(G4int anIndex, const G4ParticleDefinition * parent_type)
{
if (parent_type != 0) SetDaughter(anIndex, parent_type->GetParticleName());
if (parent_type != nullptr) SetDaughter(anIndex, parent_type->GetParticleName());
}
void G4VDecayChannel::FillDaughters()
@@ -332,16 +336,16 @@ void G4VDecayChannel::FillDaughters()
G4AutoLock lock(&daughtersMutex);
//Double check, check again if another thread has already filled this, in
//case do not need to do anything
if ( G4MT_daughters != 0 ) return;
if ( G4MT_daughters != nullptr ) return;
G4int index;
#ifdef G4VERBOSE
if (verboseLevel>1) G4cout << "G4VDecayChannel::FillDaughters()" <<G4endl;
#endif
if (G4MT_daughters != 0) {
if (G4MT_daughters != nullptr) {
delete [] G4MT_daughters;
G4MT_daughters = 0;
G4MT_daughters = nullptr;
}
// parent mass
@@ -352,7 +356,7 @@ void G4VDecayChannel::FillDaughters()
G4double sumofdaughtermass = 0.0;
G4double sumofdaughterwidthsq = 0.0;
if ((numberOfDaughters <=0) || (daughters_name == 0) ){
if ((numberOfDaughters <=0) || (daughters_name == nullptr) ){
#ifdef G4VERBOSE
if (verboseLevel>0) {
G4cout << "G4VDecayChannel::FillDaughters "
@@ -360,7 +364,7 @@ void G4VDecayChannel::FillDaughters()
<< "numberOfDaughters is not defined yet";
}
#endif
G4MT_daughters = 0;
G4MT_daughters = nullptr;
G4Exception("G4VDecayChannel::FillDaughters",
"PART011", FatalException,
"Can not fill daughters: numberOfDaughters is not defined yet");
@@ -368,13 +372,13 @@ void G4VDecayChannel::FillDaughters()
//create and set the array of pointers to daughter particles
G4MT_daughters = new G4ParticleDefinition*[numberOfDaughters];
if (G4MT_daughters_mass != 0) delete [] G4MT_daughters_mass;
if (G4MT_daughters_width != 0) delete [] G4MT_daughters_width;
if (G4MT_daughters_mass != nullptr) delete [] G4MT_daughters_mass;
if (G4MT_daughters_width != nullptr) delete [] G4MT_daughters_width;
G4MT_daughters_mass = new G4double[numberOfDaughters];
G4MT_daughters_width = new G4double[numberOfDaughters];
// loop over all daughters
for (index=0; index < numberOfDaughters; index++) {
if (daughters_name[index] == 0) {
if (daughters_name[index] == nullptr) {
// daughter name is not defined
#ifdef G4VERBOSE
if (verboseLevel>0) {
@@ -383,14 +387,14 @@ void G4VDecayChannel::FillDaughters()
<< index << "-th daughter is not defined yet" << G4endl;
}
#endif
G4MT_daughters[index] = 0;
G4MT_daughters[index] = nullptr;
G4Exception("G4VDecayChannel::FillDaughters",
"PART011", FatalException,
"Can not fill daughters: name of a daughter is not defined yet");
}
//search daughter particles in the particle table
G4MT_daughters[index] = particletable->FindParticle(*daughters_name[index]);
if (G4MT_daughters[index] == 0) {
if (G4MT_daughters[index] == nullptr ) {
// can not find the daughter particle
#ifdef G4VERBOSE
if (verboseLevel>0) {
@@ -448,9 +452,9 @@ void G4VDecayChannel::FillParent()
G4AutoLock lock(&parentMutex);
//Double check, check again if another thread has already filled this, in
//case do not need to do anything
if ( G4MT_parent != 0 ) return;
if ( G4MT_parent != nullptr ) return;
if (parent_name == 0) {
if (parent_name == nullptr) {
// parent name is not defined
#ifdef G4VERBOSE
if (verboseLevel>0) {
@@ -458,7 +462,7 @@ void G4VDecayChannel::FillParent()
<< ": parent name is not defined !!" << G4endl;
}
#endif
G4MT_parent = 0;
G4MT_parent = nullptr;
G4Exception("G4VDecayChannel::FillParent()",
"PART012", FatalException,
"Can not fill parent: parent name is not defined yet");
@@ -466,7 +470,7 @@ void G4VDecayChannel::FillParent()
}
// search parent particle in the particle table
G4MT_parent = particletable->FindParticle(*parent_name);
if (G4MT_parent == 0) {
if (G4MT_parent == nullptr) {
// parent particle does not exist
#ifdef G4VERBOSE
if (verboseLevel>0) {
@@ -484,7 +488,7 @@ void G4VDecayChannel::FillParent()
void G4VDecayChannel::SetParent(const G4ParticleDefinition * parent_type)
{
if (parent_type != 0) SetParent(parent_type->GetParticleName());
if (parent_type != nullptr) SetParent(parent_type->GetParticleName());
}
G4int G4VDecayChannel::GetAngularMomentum()
@@ -550,7 +554,7 @@ void G4VDecayChannel::DumpInfo()
G4cout << " BR: " << rbranch << " [" << kinematics_name << "]";
G4cout << " : " ;
for (G4int index=0; index < numberOfDaughters; index++){
if(daughters_name[index] != 0) {
if(daughters_name[index] != nullptr) {
G4cout << " " << *(daughters_name[index]);
} else {
G4cout << " not defined ";
@@ -597,3 +601,11 @@ G4bool G4VDecayChannel::IsOKWithParentMass(G4double parentMass)
}
return (parentMass >= sumOfDaughterMassMin);
}
void G4VDecayChannel::SetBR(G4double value)
{
rbranch = value;
if (rbranch <0. ) rbranch = 0.0;
else if (rbranch >1.0 ) rbranch = 1.0;
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ExcitedMesonConstructor.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4ExcitedMesonConstructor.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -1431,13 +1431,13 @@ const G4double G4ExcitedMesonConstructor::mass[G4ExcitedMesonConstructor::NMulti
{
{ 1.2295*GeV, 1.170*GeV, 1.386*GeV, 1.272*GeV, 1.272*GeV },
{ 1.474*GeV, 1.350*GeV, 0.0, 1.430*GeV, 1.430*GeV },
{ 1.230*GeV, 1.282*GeV,1.4264*GeV, 1.403*GeV, 1.403*GeV },
{ 1.230*GeV,1.2819*GeV,1.4264*GeV, 1.403*GeV, 1.403*GeV },
{ 1.3183*GeV,1.2755*GeV, 1.525*GeV,1.4256*GeV, 1.4256*GeV },
{ 1.6722*GeV, 1.617*GeV, 1.842*GeV, 1.773*GeV, 1.773*GeV },
{ 1.720*GeV, 1.670*GeV, 0.0, 1.717*GeV, 1.717*GeV },
{ 1.720*GeV, 1.670*GeV, 0.0, 1.718*GeV, 1.718*GeV },
{ 1.6888*GeV, 1.667*GeV, 1.854*GeV, 1.776*GeV, 1.776*GeV },
{ 1.300*GeV, 1.294*GeV, 1.476*GeV, 1.460*GeV, 1.460*GeV },
{ 1.465*GeV, 1.425*GeV, 1.680*GeV, 1.414*GeV, 1.414*GeV },
{ 1.465*GeV, 1.425*GeV, 1.680*GeV, 1.421*GeV, 1.421*GeV },
{ 0.0, 1.815*GeV, 2.010*GeV, 1.973*GeV, 1.973*GeV }
};
@@ -1455,13 +1455,13 @@ const G4double G4ExcitedMesonConstructor::width[G4ExcitedMesonConstructor::NMult
{
{ 142.0*MeV, 360.0*MeV, 91.0*MeV, 90.0*MeV, 90.0*MeV },
{ 265.0*MeV, 350.0*MeV, 0.0, 270.0*MeV, 270.0*MeV },
{ 420.0*MeV, 24.1*MeV, 54.9*MeV, 174.0*MeV, 174.0*MeV },
{ 420.0*MeV, 22.7*MeV, 54.9*MeV, 174.0*MeV, 174.0*MeV },
{ 107.0*MeV, 186.7*MeV, 73.0*MeV, 98.5*MeV, 98.5*MeV },
{ 260.0*MeV, 181.0*MeV, 225.0*MeV, 186.0*MeV, 186.0*MeV },
{ 250.0*MeV, 315.0*MeV, 0.0, 320.0*MeV, 320.0*MeV },
{ 161.0*MeV, 168.0*MeV, 87.0*MeV, 159.0*MeV, 159.0*MeV },
{ 400.0*MeV, 55.0*MeV, 85.0*MeV, 260.0*MeV, 260.0*MeV },
{ 400.0*MeV, 215.0*MeV, 150.0*MeV, 232.0*MeV, 232.0*MeV },
{ 400.0*MeV, 215.0*MeV, 150.0*MeV, 236.0*MeV, 236.0*MeV },
{ 0.0, 197.0*MeV, 200.0*MeV, 373.0*MeV, 373.0*MeV }
};
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ShortLivedConstructor.cc 102905 2017-03-02 09:50:56Z gcosmo $
// $Id: G4ShortLivedConstructor.cc 105720 2017-08-16 12:38:10Z gcosmo $
//
//
// --------------------------------------------------------------
@@ -110,7 +110,7 @@ void G4ShortLivedConstructor::ConstructQuarks()
true, -1.0, NULL);
// c-quark
particle = new G4Quarks(
"c_quark", 1.27*GeV, 0.0*keV, +2./3.*eplus,
"c_quark", 1.28*GeV, 0.0*keV, +2./3.*eplus,
1, +1, 0,
0, 0, 0,
"quarks", 0, 0, 4,
@@ -124,7 +124,7 @@ void G4ShortLivedConstructor::ConstructQuarks()
true, -1.0, NULL);
// t-quark
particle = new G4Quarks(
"t_quark", 173.21*GeV, 1.41*GeV, +2./3.*eplus,
"t_quark", 173.1*GeV, 1.41*GeV, +2./3.*eplus,
1, +1, 0,
0, 0, 0,
"quarks", 0, 0, 6,
@@ -152,7 +152,7 @@ void G4ShortLivedConstructor::ConstructQuarks()
true, -1.0, NULL);
// anti c-quark
particle = new G4Quarks(
"anti_c_quark", 1.27*GeV, 0.0*keV, -2./3.*eplus,
"anti_c_quark", 1.28*GeV, 0.0*keV, -2./3.*eplus,
1, +1, 0,
0, 0, 0,
"quarks", 0, 0, -4,
@@ -166,7 +166,7 @@ void G4ShortLivedConstructor::ConstructQuarks()
true, -1.0, NULL);
// anti t-quark
particle = new G4Quarks(
"anti_t_quark", 173.21*GeV, 1.41*GeV, -2./3.*eplus,
"anti_t_quark", 173.1*GeV, 1.41*GeV, -2./3.*eplus,
1, +1, 0,
0, 0, 0,
"quarks", 0, 0, -6,
@@ -604,7 +604,7 @@ void G4ShortLivedConstructor::ConstructMesons()
// phi
particle = new G4ExcitedMesons(
"phi", 1019.46*MeV, 4.266*MeV, +0.0*eplus,
"phi", 1019.46*MeV, 4.247*MeV, +0.0*eplus,
2, -1, -1,
0, +0, -1,
"meson", 0, 0, 333,
@@ -867,7 +867,7 @@ void G4ShortLivedConstructor::ConstructMesons()
// k_star+
particle = new G4ExcitedMesons(
"k_star+", 891.66*MeV, 50.8*MeV, +1.0*eplus,
"k_star+", 891.76*MeV, 50.3*MeV, +1.0*eplus,
2, -1, 0,
1, +1, 0,
"meson", 0, 0, 323,
@@ -892,7 +892,7 @@ void G4ShortLivedConstructor::ConstructMesons()
// k_star0
particle = new G4ExcitedMesons(
"k_star0", 895.81*MeV, 47.4*MeV, 0.0*eplus,
"k_star0", 895.55*MeV, 47.3*MeV, 0.0*eplus,
2, -1, 0,
1, -1, 0,
"meson", 0, 0, 313,
@@ -917,7 +917,7 @@ void G4ShortLivedConstructor::ConstructMesons()
// k_star-
particle = new G4ExcitedMesons(
"k_star-", 891.66*MeV, 50.8*MeV, -1.0*eplus,
"k_star-", 891.76*MeV, 50.3*MeV, -1.0*eplus,
2, -1, 0,
1, +1, 0,
"meson", 0, 0, -323,
@@ -943,7 +943,7 @@ void G4ShortLivedConstructor::ConstructMesons()
// anti_k_star0
particle = new G4ExcitedMesons(
"anti_k_star0", 895.81*MeV, 47.4*MeV, 0.0*eplus,
"anti_k_star0", 895.55*MeV, 47.3*MeV, 0.0*eplus,
2, -1, 0,
1, -1, 0,
"meson", 0, 0, -313,