Import Geant4 4.0.0 source tree
This commit is contained in:
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ExcitedString.hh,v 1.5.8.2 2001/06/28 20:20:01 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4ExcitedString.hh,v 1.9 2001/10/06 08:17:01 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#ifndef G4ExcitedString_h
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "G4Parton.hh"
|
||||
#include "G4PartonVector.hh"
|
||||
#include "G4KineticTrack.hh"
|
||||
#include "g4std/algorithm"
|
||||
|
||||
class G4ExcitedString
|
||||
{
|
||||
@@ -137,7 +138,7 @@ inline
|
||||
G4LorentzVector G4ExcitedString::Get4Momentum() const
|
||||
{
|
||||
G4LorentzVector momentum;
|
||||
for ( G4int index=0; index < thePartons.entries() ; index++ )
|
||||
for ( unsigned int index=0; index < thePartons.size() ; index++ )
|
||||
{
|
||||
momentum += thePartons[index]->Get4Momentum();
|
||||
}
|
||||
@@ -147,7 +148,7 @@ G4LorentzVector G4ExcitedString::Get4Momentum() const
|
||||
inline
|
||||
void G4ExcitedString::LorentzRotate(const G4LorentzRotation & rotation)
|
||||
{
|
||||
for ( G4int index=0; index < thePartons.entries() ; index++ )
|
||||
for ( unsigned int index=0; index < thePartons.size() ; index++ )
|
||||
{
|
||||
thePartons[index]->Set4Momentum(rotation*thePartons[index]->Get4Momentum());
|
||||
}
|
||||
@@ -157,18 +158,18 @@ inline
|
||||
void G4ExcitedString::InsertParton(G4Parton *aParton, const G4Parton * addafter)
|
||||
{
|
||||
|
||||
G4int insert_index=1;
|
||||
G4PartonVector::iterator insert_index;
|
||||
|
||||
if ( addafter != NULL )
|
||||
{
|
||||
insert_index=thePartons.index(addafter);
|
||||
if (insert_index == G4std::string::npos) // No object addafter in thePartons
|
||||
insert_index=G4std::find(thePartons.begin(), thePartons.end(), addafter);
|
||||
if (insert_index == thePartons.end()) // No object addafter in thePartons
|
||||
{
|
||||
G4Exception("G4ExcitedString::InsertParton called with invalid second argument");
|
||||
}
|
||||
}
|
||||
|
||||
thePartons.insertAt(insert_index+1, aParton);
|
||||
thePartons.insert(insert_index+1, aParton);
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -177,7 +178,7 @@ G4LorentzRotation G4ExcitedString::TransformToCenterOfMass()
|
||||
G4LorentzVector momentum=Get4Momentum();
|
||||
G4LorentzRotation toCms(-1*momentum.boostVector());
|
||||
|
||||
for ( G4int index=0; index < thePartons.entries() ; index++ )
|
||||
for ( unsigned int index=0; index < thePartons.size() ; index++ )
|
||||
{
|
||||
momentum=toCms * thePartons[index]->Get4Momentum();
|
||||
thePartons[index]->Set4Momentum(momentum);
|
||||
@@ -195,7 +196,7 @@ G4LorentzRotation G4ExcitedString::TransformToAlignedCms()
|
||||
toAlignedCms.rotateZ(-1*momentum.phi());
|
||||
toAlignedCms.rotateY(-1*momentum.theta());
|
||||
|
||||
for ( G4int index=0; index < thePartons.entries() ; index++ )
|
||||
for ( unsigned int index=0; index < thePartons.size() ; index++ )
|
||||
{
|
||||
momentum=toAlignedCms * thePartons[index]->Get4Momentum();
|
||||
thePartons[index]->Set4Momentum(momentum);
|
||||
|
||||
@@ -14,18 +14,18 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ExcitedStringVector.hh,v 1.3.8.2 2001/06/28 20:20:01 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4ExcitedStringVector.hh,v 1.6 2001/10/04 20:00:32 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
#ifndef G4ExcitedStringVector_h
|
||||
#define G4ExcitedStringPartonVector_h 1
|
||||
#define G4ExcitedStringVector_h 1
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
@@ -35,8 +35,9 @@
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include "G4ExcitedString.hh"
|
||||
#include "g4rw/tpordvec.h"
|
||||
#include "g4std/vector"
|
||||
|
||||
typedef G4RWTPtrOrderedVector<G4ExcitedString> G4ExcitedStringVector;
|
||||
typedef G4std::vector<G4ExcitedString *> G4ExcitedStringVector;
|
||||
struct DeleteString { void operator()(G4ExcitedString* aS){delete aS;} };
|
||||
|
||||
#endif
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Fancy3DNucleus.hh,v 1.6.8.2 2001/06/28 20:20:01 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4Fancy3DNucleus.hh,v 1.9 2001/10/04 20:00:32 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
#ifndef G4Fancy3DNucleus_h
|
||||
#define G4Fancy3DNucleus_h 1
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "G4Nucleon.hh"
|
||||
#include "G4VNuclearDensity.hh"
|
||||
#include "G4FermiMomentum.hh"
|
||||
#include "g4rw/tpordvec.h"
|
||||
#include "g4std/vector"
|
||||
|
||||
class G4Fancy3DNucleus : public G4V3DNucleus
|
||||
{
|
||||
@@ -68,7 +68,7 @@ class G4Fancy3DNucleus : public G4V3DNucleus
|
||||
void Init(G4double theA, G4double theZ);
|
||||
G4bool StartLoop();
|
||||
G4Nucleon * GetNextNucleon();
|
||||
const G4RWTPtrOrderedVector<G4Nucleon> & GetNucleons();
|
||||
const G4std::vector<G4Nucleon *> & GetNucleons();
|
||||
G4int GetMassNumber();
|
||||
G4double GetMass();
|
||||
G4int GetCharge();
|
||||
@@ -87,7 +87,8 @@ class G4Fancy3DNucleus : public G4V3DNucleus
|
||||
G4int myA;
|
||||
G4int myZ;
|
||||
G4Nucleon * theNucleons;
|
||||
G4RWTPtrOrderedVector<G4Nucleon> theRWNucleons; // should not have two...
|
||||
G4std::vector<G4Nucleon *> theRWNucleons; // should not have two...
|
||||
struct DeleteNucleon{ void operator()(G4Nucleon *aN){delete aN;} };
|
||||
G4int currentNucleon;
|
||||
G4VNuclearDensity * theDensity;
|
||||
G4FermiMomentum theFermi;
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FermiMomentum.hh,v 1.3.2.1 2001/06/28 19:13:47 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4FermiMomentum.hh,v 1.5 2001/08/01 17:09:17 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
#ifndef G4FermiMomentum_h
|
||||
#define G4FermiMomentum_h 1
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Fragment.hh,v 1.8.2.1 2001/06/28 19:13:47 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4Fragment.hh,v 1.11 2001/10/04 20:00:32 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// Hadronic Process: Nuclear De-excitations
|
||||
// by V. Lara (May 1998)
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/iomanip"
|
||||
#include "g4rw/tpordvec.h"
|
||||
#include "g4std/vector"
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4LorentzVector.hh"
|
||||
@@ -49,7 +49,6 @@
|
||||
class G4ParticleDefinition;
|
||||
|
||||
class G4Fragment; // Forward deckaration
|
||||
//typedef G4RWTPtrOrderedVector<G4Fragment> G4FragmentVector;
|
||||
typedef G4std::vector<G4Fragment*> G4FragmentVector;
|
||||
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FragmentVector.hh,v 1.2.8.1 2001/06/28 19:13:47 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4FragmentVector.hh,v 1.4 2001/08/01 17:09:18 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// Hadronic Process: Nuclear De-excitations
|
||||
// by V. Lara (May 1998)
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeneralPhaseSpaceDecay.hh,v 1.3.8.2 2001/06/28 20:20:01 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4GeneralPhaseSpaceDecay.hh,v 1.5 2001/08/01 17:09:18 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
//$Id: G4GeneralPhaseSpaceDecay.hh,v 1.1 1997/05/21
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
@@ -14,15 +14,13 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4KineticTrack.hh,v 1.3.8.2 2001/06/28 20:20:01 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
// $Id: G4KineticTrack.hh,v 1.0 1998/05/20
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -93,14 +91,14 @@ class G4KineticTrack : public G4VKineticNucleon
|
||||
// LB move to public (before was private) LB
|
||||
G4double* GetActualWidth() const;
|
||||
|
||||
G4double GetActualMass() const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
G4int GetnChannels() const;
|
||||
void SetnChannels(const G4int aChannel);
|
||||
|
||||
G4double GetActualMass() const;
|
||||
|
||||
void SetActualWidth(G4double* anActualWidth);
|
||||
|
||||
G4double EvaluateTotalActualWidth();
|
||||
@@ -108,9 +106,9 @@ class G4KineticTrack : public G4VKineticNucleon
|
||||
G4double EvaluateCMMomentum (const G4double mass,
|
||||
const G4double* m_ij) const;
|
||||
|
||||
G4double IntegrateCMMomentum() const;
|
||||
G4double IntegrateCMMomentum(const G4double lowerLimit) const;
|
||||
|
||||
G4double IntegrateCMMomentum(const G4double polemass) const;
|
||||
G4double IntegrateCMMomentum(const G4double lowerLimit ,const G4double polemass) const;
|
||||
|
||||
G4double IntegrateCMMomentum2() const;
|
||||
|
||||
@@ -121,13 +119,15 @@ class G4KineticTrack : public G4VKineticNucleon
|
||||
const G4double rmass,
|
||||
const G4double mass) const;
|
||||
|
||||
friend G4double IntegrandFunction1 (G4double xmass);
|
||||
private:
|
||||
G4double IntegrandFunction1 (G4double xmass) const;
|
||||
G4double IntegrandFunction2 (G4double xmass) const;
|
||||
G4double IntegrandFunction3 (G4double xmass) const;
|
||||
G4double IntegrandFunction4 (G4double xmass) const;
|
||||
public:
|
||||
// friend G4double IntegrandFunction3 (G4double xmass);
|
||||
|
||||
friend G4double IntegrandFunction2 (G4double xmass);
|
||||
|
||||
friend G4double IntegrandFunction3 (G4double xmass);
|
||||
|
||||
friend G4double IntegrandFunction4 (G4double xmass);
|
||||
// friend G4double IntegrandFunction4 (G4double xmass);
|
||||
|
||||
// LB new variable created LB
|
||||
G4int chosench;
|
||||
@@ -227,7 +227,7 @@ inline G4double G4KineticTrack::GetActualMass() const
|
||||
G4ThreeVector theMomentum = the4Momentum.vect();
|
||||
G4double theMomentum2 = theMomentum.mag2();
|
||||
G4double theTotalEnergy = the4Momentum.e();
|
||||
G4double theMass = sqrt(theTotalEnergy * theTotalEnergy - theMomentum2);
|
||||
G4double theMass = sqrt(abs(theTotalEnergy * theTotalEnergy - theMomentum2));
|
||||
return theMass;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4KineticTrackVector.hh,v 1.3.8.1 2001/06/28 19:13:47 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4KineticTrackVector.hh,v 1.6 2001/10/04 20:00:33 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
|
||||
// Modified at 8-Oct-1998 by Maxim Komogorov. Methods BoostBeam,Boost,Shift
|
||||
// were added.
|
||||
@@ -32,9 +32,9 @@
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4KineticTrack.hh"
|
||||
#include "g4rw/tpordvec.h"
|
||||
#include "g4std/vector"
|
||||
|
||||
class G4KineticTrackVector : public G4RWTPtrOrderedVector<G4KineticTrack>
|
||||
class G4KineticTrackVector : public G4std::vector<G4KineticTrack *>
|
||||
{
|
||||
public:
|
||||
G4KineticTrackVector();
|
||||
@@ -45,5 +45,7 @@ public:
|
||||
void Shift(G4ThreeVector& Pos);
|
||||
};
|
||||
|
||||
struct DeleteKineticTrack{void operator()(G4KineticTrack * aT){delete aT;}};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NuclearFermiDensity.hh,v 1.3.8.1 2001/06/28 19:13:48 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4NuclearFermiDensity.hh,v 1.5 2001/08/01 17:09:19 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
#ifndef G4NuclearFermiDensity_h
|
||||
#define G4NuclearFermiDensity_h 1
|
||||
|
||||
+3
-3
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NuclearShellModelDensity.hh,v 1.3.8.1 2001/06/28 19:13:48 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4NuclearShellModelDensity.hh,v 1.5 2001/08/01 17:09:19 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
#ifndef G4NuclearShellModelDensity_h
|
||||
#define G4NuclearShellModelDensity_h 1
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Nucleon.hh,v 1.3.8.2 2001/06/28 20:20:02 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4Nucleon.hh,v 1.5 2001/08/01 17:09:20 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
#ifndef G4Nucleon_h
|
||||
#define G4Nucleon_h 1
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Parton.hh,v 1.9.8.2 2001/06/28 20:20:02 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4Parton.hh,v 1.13 2001/08/01 17:09:21 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#ifndef G4Parton_h
|
||||
@@ -41,16 +41,20 @@
|
||||
#include "G4LorentzVector.hh"
|
||||
#include "g4std/iostream"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
class G4Parton
|
||||
{
|
||||
public:
|
||||
G4Parton()
|
||||
{
|
||||
PDGencoding=0;
|
||||
theColour = 1;
|
||||
theIsoSpinZ = 0.5;
|
||||
theSpinZ = 0.5;
|
||||
// CAUTION:
|
||||
// this is a preliminary definition yielding u and d quarks only!
|
||||
//
|
||||
PDGencoding=(G4int)(2.*G4UniformRand());
|
||||
theColour = (G4int)(3.*G4UniformRand())+1;
|
||||
theIsoSpinZ = ((G4int)(G4UniformRand()))-0.5;
|
||||
theSpinZ = ((G4int)(G4UniformRand()))-0.5;
|
||||
}
|
||||
|
||||
G4Parton(G4int PDGencoding);
|
||||
@@ -81,10 +85,10 @@ class G4Parton
|
||||
void SetColour(G4int aColour) {theColour = aColour;}
|
||||
G4int GetColour() {return theColour;}
|
||||
|
||||
void SetIsoSpinZ(G4int anIsoSpinZ) {theIsoSpinZ = anIsoSpinZ;}
|
||||
void SetIsoSpinZ(G4double anIsoSpinZ) {theIsoSpinZ = anIsoSpinZ;}
|
||||
G4double GetIsoSpinZ() {return theIsoSpinZ;}
|
||||
|
||||
void SetSpinZ(G4int anIsoSpinZ) {theIsoSpinZ = anIsoSpinZ;}
|
||||
void SetSpinZ(G4double aSpinZ) {theSpinZ = aSpinZ;}
|
||||
G4double GetSpinZ() {return theSpinZ;}
|
||||
|
||||
private:
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PartonVector.hh,v 1.3.8.2 2001/06/28 20:20:02 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4PartonVector.hh,v 1.6 2001/10/04 20:00:33 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
#ifndef G4PartonVector_h
|
||||
#define G4PartonVector_h 1
|
||||
@@ -35,8 +35,9 @@
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include "G4Parton.hh"
|
||||
#include "g4rw/tpordvec.h"
|
||||
#include "g4std/vector"
|
||||
|
||||
typedef G4RWTPtrOrderedVector<G4Parton> G4PartonVector;
|
||||
typedef G4std::vector<G4Parton *> G4PartonVector;
|
||||
struct DeleteParton{ void operator()(G4Parton*aP){delete aP;} };
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SampleResonance.hh,v 1.4 2001/10/04 20:00:33 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#ifndef G4SampleResonance_h
|
||||
#define G4SampleResonance_h 1
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// ---------------- G4SampleResonance ----------------
|
||||
// by Henning Weber, March 2001.
|
||||
// helper class for sampling resonance masses
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include "globals.hh"
|
||||
#include "g4std/map"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
|
||||
class G4SampleResonance
|
||||
{
|
||||
public:
|
||||
|
||||
G4double GetMinimumMass(const G4ParticleDefinition* p) const;
|
||||
G4double SampleMass(const G4double poleMass,
|
||||
const G4double gamma,
|
||||
const G4double minMass,
|
||||
const G4double maxMass) const;
|
||||
G4double SampleMass(const G4ParticleDefinition* p, const G4double maxMass) const;
|
||||
|
||||
private:
|
||||
|
||||
G4double BrWigInt0(const G4double x, const G4double gamma, const G4double m0) const
|
||||
{ return 2.0*gamma*atan( 2.0 * (x-m0)/ gamma ); }
|
||||
|
||||
G4double BrWigInt1(const G4double x, const G4double gamma, const G4double m0) const
|
||||
{ return 0.5*gamma*gamma*log( (x-m0)*(x-m0)+gamma*gamma/4.0 ) + m0*BrWigInt0(x,gamma,m0); }
|
||||
|
||||
G4double BrWigInv(const G4double x, const G4double gamma, const G4double m0) const
|
||||
{ return 0.5*gamma*tan( 0.5*x/gamma )+m0; }
|
||||
|
||||
public:
|
||||
|
||||
typedef G4std::map<const G4ParticleDefinition*, G4double, G4std::less<const G4ParticleDefinition*> >::const_iterator minMassMapIterator;
|
||||
typedef G4std::map<const G4ParticleDefinition*, G4double, G4std::less<const G4ParticleDefinition*> > minMassMapType;
|
||||
|
||||
private:
|
||||
|
||||
static minMassMapType minMassCache;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ExcitedString.cc,v 1.3.8.2 2001/06/28 20:20:02 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4ExcitedString.cc,v 1.6 2001/10/04 20:00:33 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
// ------------------------------------------------------------
|
||||
@@ -36,14 +36,15 @@
|
||||
|
||||
// G4ExcitedString
|
||||
#include "G4ExcitedString.hh"
|
||||
#include "g4std/algorithm"
|
||||
|
||||
//G4ExcitedString::G4ExcitedString(const G4ExcitedString &right)
|
||||
//{}
|
||||
|
||||
G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* AntiColor, G4int Direction)
|
||||
{
|
||||
thePartons.insert(Color);
|
||||
thePartons.insert(AntiColor);
|
||||
thePartons.push_back(Color);
|
||||
thePartons.push_back(AntiColor);
|
||||
thePosition = Color->GetPosition();
|
||||
theDirection = Direction;
|
||||
theTrack=0;
|
||||
@@ -51,9 +52,9 @@ G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* AntiColor, G4int Dir
|
||||
|
||||
G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* Gluon, G4Parton* AntiColor, G4int Direction)
|
||||
{
|
||||
thePartons.insert(Color);
|
||||
thePartons.insert(Gluon);
|
||||
thePartons.insert(AntiColor);
|
||||
thePartons.push_back(Color);
|
||||
thePartons.push_back(Gluon);
|
||||
thePartons.push_back(AntiColor);
|
||||
thePosition = Color->GetPosition();
|
||||
theDirection = Direction;
|
||||
theTrack=0;
|
||||
@@ -68,7 +69,7 @@ G4ExcitedString::G4ExcitedString(G4KineticTrack * track)
|
||||
|
||||
G4ExcitedString::~G4ExcitedString()
|
||||
{
|
||||
thePartons.clearAndDestroy();
|
||||
G4std::for_each(thePartons.begin(), thePartons.end(), DeleteParton());
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +90,7 @@ G4ExcitedString::~G4ExcitedString()
|
||||
|
||||
void G4ExcitedString::Boost(G4ThreeVector& Velocity)
|
||||
{
|
||||
for(G4int cParton = 0; cParton < thePartons.entries() ; cParton++ )
|
||||
for(unsigned int cParton = 0; cParton < thePartons.size() ; cParton++ )
|
||||
{
|
||||
G4LorentzVector Mom = thePartons[cParton]->Get4Momentum();
|
||||
Mom.boost(Velocity);
|
||||
@@ -101,41 +102,45 @@ void G4ExcitedString::Boost(G4ThreeVector& Velocity)
|
||||
|
||||
G4Parton* G4ExcitedString::GetColorParton(void) const
|
||||
{
|
||||
G4int Encoding = thePartons.first()->GetPDGcode();
|
||||
G4Parton * start = *(thePartons.begin());
|
||||
G4Parton * end = *(thePartons.end()-1);
|
||||
G4int Encoding = start->GetPDGcode();
|
||||
if (Encoding < -1000 || ((Encoding < 1000) && (Encoding > 0)))
|
||||
return thePartons.first();
|
||||
return thePartons.last();
|
||||
return start;
|
||||
return end;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
G4Parton* G4ExcitedString::GetGluon(void) const
|
||||
{
|
||||
return thePartons.at(1);
|
||||
return thePartons[1];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
G4Parton* G4ExcitedString::GetGluon(G4int GluonPos) const
|
||||
{
|
||||
return thePartons.at(1 + GluonPos);
|
||||
return thePartons[1 + GluonPos];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
G4Parton* G4ExcitedString::GetAntiColorParton(void) const
|
||||
{
|
||||
G4int Encoding = thePartons.first()->GetPDGcode();
|
||||
G4Parton * start = *(thePartons.begin());
|
||||
G4Parton * end = *(thePartons.end()-1);
|
||||
G4int Encoding = start->GetPDGcode();
|
||||
if (Encoding < -1000 || ((Encoding < 1000) && (Encoding > 0)))
|
||||
return thePartons.last();
|
||||
return thePartons.first();
|
||||
return end;
|
||||
return start;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
G4bool G4ExcitedString::IsItKinkyString(void) const
|
||||
{
|
||||
return (thePartons.entries() > 2);
|
||||
return (thePartons.size() > 2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
@@ -149,14 +154,14 @@ G4int G4ExcitedString::GetDirection(void) const
|
||||
|
||||
G4Parton* G4ExcitedString::GetLeftParton(void) const
|
||||
{
|
||||
return thePartons.first();
|
||||
return *thePartons.begin();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
G4Parton* G4ExcitedString::GetRightParton(void) const
|
||||
{
|
||||
return thePartons.last();
|
||||
return *(thePartons.end()-1);
|
||||
}
|
||||
|
||||
//*********************************************************************************
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Fancy3DNucleus.cc,v 1.8.8.2 2001/06/28 20:20:02 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4Fancy3DNucleus.cc,v 1.14 2001/10/20 10:48:43 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "G4NucleiPropertiesTable.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4rw/tvvector.h"
|
||||
#include "g4std/algorithm"
|
||||
|
||||
G4Fancy3DNucleus::G4Fancy3DNucleus()
|
||||
: nucleondistance(0.8*fermi)
|
||||
@@ -79,11 +79,11 @@ G4Fancy3DNucleus::~G4Fancy3DNucleus()
|
||||
|
||||
void G4Fancy3DNucleus::Init(G4double theA, G4double theZ)
|
||||
{
|
||||
G4int i;
|
||||
// G4cout << "G4Fancy3DNucleus::Init(theA, theZ) called"<<G4endl;
|
||||
currentNucleon=-1;
|
||||
if(theNucleons!=NULL) delete [] theNucleons;
|
||||
|
||||
G4std::for_each(theRWNucleons.begin(), theRWNucleons.end(), DeleteNucleon());
|
||||
theRWNucleons.clear();
|
||||
|
||||
myZ = G4int(theZ);
|
||||
@@ -134,13 +134,13 @@ G4Nucleon * G4Fancy3DNucleus::GetNextNucleon()
|
||||
}
|
||||
|
||||
|
||||
const G4RWTPtrOrderedVector<G4Nucleon> & G4Fancy3DNucleus::GetNucleons()
|
||||
const G4std::vector<G4Nucleon *> & G4Fancy3DNucleus::GetNucleons()
|
||||
{
|
||||
if ( theRWNucleons.isEmpty() )
|
||||
if ( theRWNucleons.size()==0 )
|
||||
{
|
||||
for (G4int i=0; i< myA; i++)
|
||||
{
|
||||
theRWNucleons.append(theNucleons+i);
|
||||
theRWNucleons.push_back(theNucleons+i);
|
||||
}
|
||||
}
|
||||
return theRWNucleons;
|
||||
@@ -316,7 +316,7 @@ void G4Fancy3DNucleus::ChooseFermiMomenta()
|
||||
// G4ThreeVector sum;
|
||||
// for (G4int index=0; index<myA;sum+=momentum[index++])
|
||||
// ;
|
||||
// cout << "final sum / mag() " << sum << " / " << sum.mag() << G4endl;
|
||||
// G4cout << "final sum / mag() " << sum << " / " << sum.mag() << G4endl;
|
||||
|
||||
|
||||
G4double energy;
|
||||
@@ -324,7 +324,7 @@ void G4Fancy3DNucleus::ChooseFermiMomenta()
|
||||
{
|
||||
energy=theNucleons[i].GetParticleType()->GetPDGMass()
|
||||
+ BindingEnergy()/myA;
|
||||
G4LorentzVector tempV(momentum[i],energy);
|
||||
G4LorentzVector tempV(momentum[i],sqrt(energy*energy+momentum[i].mag2()));
|
||||
theNucleons[i].SetMomentum(tempV);
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ void G4Fancy3DNucleus::ChooseFermiMomenta()
|
||||
}
|
||||
int operator < (const G4Fancy3DNucleusHelper &right) const
|
||||
{
|
||||
return this->Size<right.Size;
|
||||
return size()<right.size();
|
||||
}
|
||||
const G4ThreeVector& vector() const
|
||||
{
|
||||
@@ -357,16 +357,19 @@ void G4Fancy3DNucleus::ChooseFermiMomenta()
|
||||
{
|
||||
return anInt;
|
||||
}
|
||||
private:
|
||||
G4Fancy3DNucleusHelper operator =(const G4Fancy3DNucleusHelper &right) const
|
||||
G4Fancy3DNucleusHelper operator =(const G4Fancy3DNucleusHelper &right)
|
||||
{
|
||||
G4cout <<" G4Fancy3DNucleus::G4Fancy3DNucleusHelper op = called------------------" << G4endl;
|
||||
return G4Fancy3DNucleusHelper();
|
||||
Vector = right.Vector;
|
||||
Size = right.Size;
|
||||
anInt = right.anInt;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
G4Fancy3DNucleusHelper(): Vector(0), Size(0), anInt(0) {G4cout << "def ctor for MixMasch" << G4endl;}
|
||||
const G4ThreeVector Vector;
|
||||
const G4double Size;
|
||||
const G4int anInt;
|
||||
G4ThreeVector Vector;
|
||||
G4double Size;
|
||||
G4int anInt;
|
||||
};
|
||||
|
||||
G4bool G4Fancy3DNucleus::ReduceSum(G4ThreeVector * momentum, G4double *pFermiM)
|
||||
@@ -386,31 +389,33 @@ G4bool G4Fancy3DNucleus::ReduceSum(G4ThreeVector * momentum, G4double *pFermiM)
|
||||
|
||||
// find all possible changes in momentum, changing only the component parallel to sum
|
||||
G4ThreeVector testDir=sum.unit();
|
||||
G4RWTPtrSortedVector<G4Fancy3DNucleusHelper> testSums(myA-1); // Sorted on delta.mag()
|
||||
G4std::vector<G4Fancy3DNucleusHelper> testSums; // Sorted on delta.mag()
|
||||
|
||||
for ( G4int aNucleon=0; aNucleon < myA-1; aNucleon++){
|
||||
G4ThreeVector delta=2*((momentum[aNucleon]*testDir)* testDir);
|
||||
testSums.insert(new G4Fancy3DNucleusHelper(delta,delta.mag(),aNucleon));
|
||||
testSums.push_back(G4Fancy3DNucleusHelper(delta,delta.mag(),aNucleon));
|
||||
}
|
||||
G4std::sort(testSums.begin(), testSums.end());
|
||||
|
||||
// reduce Momentum Sum until the next would be allowed.
|
||||
G4int index=testSums.entries();
|
||||
while ( (sum-testSums[--index]->vector()).mag()>PFermi && index>0)
|
||||
G4int index=testSums.size();
|
||||
while ( (sum-testSums[--index].vector()).mag()>PFermi && index>0)
|
||||
{
|
||||
// Only take one which improve, ie. don't change sign and overshoot...
|
||||
if ( sum.mag() > (sum-testSums[index]->vector()).mag() ) {
|
||||
// momentum[testSums[index]->index()]-=testSums[index]->vector();
|
||||
// sum-=testSums[index]->vector();
|
||||
if ( sum.mag() > (sum-testSums[index].vector()).mag() ) {
|
||||
momentum[testSums[index].index()]-=testSums[index].vector();
|
||||
sum-=testSums[index].vector();
|
||||
}
|
||||
}
|
||||
|
||||
if ( (sum-testSums[index]->vector()).mag() <= PFermi )
|
||||
if ( (sum-testSums[index].vector()).mag() <= PFermi )
|
||||
{
|
||||
G4int best=-1;
|
||||
G4double pBest=2*PFermi; // anything larger than PFermi
|
||||
for ( G4int aNucleon=0; aNucleon<=index; aNucleon++)
|
||||
{
|
||||
// find the momentum closest to choosen momentum for last Nucleon.
|
||||
G4double pTry=(testSums[aNucleon]->vector()-sum).mag();
|
||||
G4double pTry=(testSums[aNucleon].vector()-sum).mag();
|
||||
if ( pTry < PFermi
|
||||
&& abs(momentum[myA-1].mag() - pTry ) < pBest )
|
||||
{
|
||||
@@ -419,14 +424,14 @@ G4bool G4Fancy3DNucleus::ReduceSum(G4ThreeVector * momentum, G4double *pFermiM)
|
||||
}
|
||||
}
|
||||
if ( best < 0 ) G4Exception( " Logic error in Fancy3DNucleus");
|
||||
// momentum[testSums[best]->index()]-=testSums[best]->vector();
|
||||
// momentum[myA-1]=testSums[best]->vector()-sum;
|
||||
momentum[testSums[best].index()]-=testSums[best].vector();
|
||||
momentum[myA-1]=testSums[best].vector()-sum;
|
||||
|
||||
testSums.clearAndDestroy();
|
||||
testSums.clear();
|
||||
return true;
|
||||
|
||||
}
|
||||
testSums.clearAndDestroy();
|
||||
testSums.clear();
|
||||
|
||||
// try to compensate momentum using another Nucleon....
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FermiMomentum.cc,v 1.2.8.1 2001/06/28 19:13:48 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4FermiMomentum.cc,v 1.4 2001/08/01 17:09:26 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
#include "G4FermiMomentum.hh"
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Fragment.cc,v 1.9.2.1 2001/06/28 19:13:48 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4Fragment.cc,v 1.12 2001/11/29 15:41:25 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// Hadronic Process: Nuclear De-excitations
|
||||
// by V. Lara (May 1998)
|
||||
@@ -139,7 +139,12 @@ G4bool G4Fragment::operator!=(const G4Fragment &right) const
|
||||
|
||||
G4std::ostream& operator << (G4std::ostream &out, const G4Fragment *theFragment)
|
||||
{
|
||||
#ifdef G4USE_STD_NAMESPACE
|
||||
G4std::ios::fmtflags old_floatfield = out.flags();
|
||||
out.setf(G4std::ios::floatfield);
|
||||
#else
|
||||
long old_floatfield = out.setf(0,G4std::ios::floatfield);
|
||||
#endif
|
||||
|
||||
out
|
||||
<< "Fragment: A = " << G4std::setprecision(3) << theFragment->theA
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeneralPhaseSpaceDecay.cc,v 1.2.8.2 2001/06/28 20:20:02 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4GeneralPhaseSpaceDecay.cc,v 1.5 2001/10/05 16:17:55 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// $Id: G4GeneralSpaceDecay.cc,v 1.0 1998/05/21
|
||||
// ----------------------------------------------------------------
|
||||
@@ -79,13 +79,13 @@ G4GeneralPhaseSpaceDecay::G4GeneralPhaseSpaceDecay(const G4String& theParentName
|
||||
const G4String& theDaughterName1,
|
||||
const G4String& theDaughterName2,
|
||||
const G4String& theDaughterName3) :
|
||||
parentmass(theParentMass),
|
||||
G4VDecayChannel("Phase Space",
|
||||
theParentName,theBR,
|
||||
theNumberOfDaughters,
|
||||
theDaughterName1,
|
||||
theDaughterName2,
|
||||
theDaughterName3)
|
||||
theDaughterName3),
|
||||
parentmass(theParentMass)
|
||||
{
|
||||
if (GetVerboseLevel()>1) G4cout << "G4GeneralPhaseSpaceDecay:: constructor " << G4endl;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ G4DecayProducts *G4GeneralPhaseSpaceDecay::OneBodyDecayIt()
|
||||
{
|
||||
if (GetVerboseLevel()>1) G4cout << "G4GeneralPhaseSpaceDecay::OneBodyDecayIt()"<<G4endl;
|
||||
|
||||
G4double daughtermass = daughters[0]->GetPDGMass();
|
||||
// G4double daughtermass = daughters[0]->GetPDGMass();
|
||||
|
||||
//create parent G4DynamicParticle at rest
|
||||
G4ParticleMomentum dummy;
|
||||
@@ -166,7 +166,7 @@ G4DecayProducts *G4GeneralPhaseSpaceDecay::TwoBodyDecayIt()
|
||||
G4double daughtermomentum;
|
||||
daughtermass[0] = daughters[0]->GetPDGMass();
|
||||
daughtermass[1] = daughters[1]->GetPDGMass();
|
||||
G4double sumofdaughtermass = daughtermass[0] + daughtermass[1];
|
||||
// G4double sumofdaughtermass = daughtermass[0] + daughtermass[1];
|
||||
|
||||
//create parent G4DynamicParticle at rest
|
||||
G4ParticleMomentum dummy;
|
||||
|
||||
@@ -14,17 +14,13 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4KineticTrack.cc,v 1.10.6.2 2001/06/28 20:20:03 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
// $Id: G4KineticTrack.cc,v 1.0 1998/05/20
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
@@ -46,12 +42,18 @@
|
||||
#include "G4GeneralPhaseSpaceDecay.hh"
|
||||
#include "G4DecayProducts.hh"
|
||||
#include "G4LorentzRotation.hh"
|
||||
#include "G4SampleResonance.hh"
|
||||
#include "G4Integrator.hh"
|
||||
#include "G4KaonZero.hh"
|
||||
#include "G4KaonZeroShort.hh"
|
||||
#include "G4KaonZeroLong.hh"
|
||||
#include "G4AntiKaonZero.hh"
|
||||
|
||||
//
|
||||
// Some static clobal for integration
|
||||
//
|
||||
|
||||
static G4double G4KineticTrack_Gmass, G4KineticTrack_Gmass1, G4KineticTrack_Gmass2,G4KineticTrack_Ggamma1,G4KineticTrack_Ggamma2,G4KineticTrack_xmass1;
|
||||
static G4double G4KineticTrack_Gmass, G4KineticTrack_xmass1;
|
||||
|
||||
//
|
||||
// Default constructor
|
||||
@@ -124,11 +126,23 @@ G4KineticTrack::G4KineticTrack(G4ParticleDefinition* aDefinition,
|
||||
G4double aFormationTime,
|
||||
G4ThreeVector aPosition,
|
||||
G4LorentzVector& a4Momentum) :
|
||||
theDefinition(aDefinition),
|
||||
theFormationTime(aFormationTime),
|
||||
thePosition(aPosition),
|
||||
the4Momentum(a4Momentum)
|
||||
{
|
||||
theDefinition = aDefinition;
|
||||
if(G4KaonZero::KaonZero() == theDefinition ||
|
||||
G4AntiKaonZero::AntiKaonZero() == theDefinition)
|
||||
{
|
||||
if(G4UniformRand()<0.5)
|
||||
{
|
||||
theDefinition = G4KaonZeroShort::KaonZeroShort();
|
||||
}
|
||||
else
|
||||
{
|
||||
theDefinition = G4KaonZeroLong::KaonZeroLong();
|
||||
}
|
||||
}
|
||||
//
|
||||
// Initialize the InitialCoordinates 4vector
|
||||
//
|
||||
@@ -172,12 +186,12 @@ G4KineticTrack::G4KineticTrack(G4ParticleDefinition* aDefinition,
|
||||
// cout << " ****CONSTR*** ActualMass ******* " << theActualMass << G4endl;
|
||||
G4int index;
|
||||
for (index = nChannels - 1; index >= 0; index--)
|
||||
{
|
||||
{
|
||||
G4VDecayChannel* theChannel = theDecayTable->GetDecayChannel(index);
|
||||
G4int nDaughters = theChannel->GetNumberOfDaughters();
|
||||
G4double theMotherWidth;
|
||||
if (nDaughters == 2)
|
||||
{
|
||||
if (nDaughters == 2 || nDaughters == 3)
|
||||
{
|
||||
G4double thePoleMass = theDefinition->GetPDGMass();
|
||||
theMotherWidth = theDefinition->GetPDGWidth();
|
||||
G4double thePoleWidth = theChannel->GetBR()*theMotherWidth;
|
||||
@@ -187,161 +201,183 @@ G4KineticTrack::G4KineticTrack(G4ParticleDefinition* aDefinition,
|
||||
theDaughterIsShortLived = new G4bool[nDaughters];
|
||||
G4int n;
|
||||
for (n = 0; n < nDaughters; n++)
|
||||
{
|
||||
{
|
||||
aDaughter = theChannel->GetDaughter(n);
|
||||
theDaughterMass[n] = aDaughter->GetPDGMass();
|
||||
theDaughterWidth[n] = aDaughter->GetPDGWidth();
|
||||
theDaughterIsShortLived[n] = aDaughter->IsShortLived();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Check whether both the decay products are stable
|
||||
//
|
||||
|
||||
G4double theActualMom = 0.0;
|
||||
G4double thePoleMom = 0.0;
|
||||
|
||||
if ( !theDaughterIsShortLived[0] && !theDaughterIsShortLived[1] )
|
||||
{
|
||||
|
||||
// G4cout << G4endl << "Both the " << nDaughters <<
|
||||
// " decay products are stable!";
|
||||
// cout << " LB: Both decay products STABLE !" << G4endl;
|
||||
// cout << " parent: " << theChannel->GetParentName() << G4endl;
|
||||
// cout << " particle1: " << theChannel->GetDaughterName(0) << G4endl;
|
||||
// cout << " particle2: " << theChannel->GetDaughterName(1) << G4endl;
|
||||
|
||||
theActualMom = EvaluateCMMomentum(theActualMass,
|
||||
theDaughterMass);
|
||||
thePoleMom = EvaluateCMMomentum(thePoleMass,
|
||||
theDaughterMass);
|
||||
// cout << G4endl;
|
||||
// cout << " LB: ActualMass/DaughterMass " << theActualMass << " " << theDaughterMass << G4endl;
|
||||
// cout << " LB: ActualMom " << theActualMom << G4endl;
|
||||
// cout << " LB: PoleMom " << thePoleMom << G4endl;
|
||||
// cout << G4endl;
|
||||
}
|
||||
else if ( !theDaughterIsShortLived[0] && theDaughterIsShortLived[1] )
|
||||
{
|
||||
|
||||
// G4cout << G4endl << "Only the first of the " << nDaughters <<" decay products is stable!";
|
||||
// cout << " LB: only the first decay product is STABLE !" << G4endl;
|
||||
// cout << " parent: " << theChannel->GetParentName() << G4endl;
|
||||
// cout << " particle1: " << theChannel->GetDaughterName(0) << G4endl;
|
||||
// cout << " particle2: " << theChannel->GetDaughterName(1) << G4endl;
|
||||
|
||||
G4SampleResonance aSampler;
|
||||
if (nDaughters==2)
|
||||
{
|
||||
if ( !theDaughterIsShortLived[0] && !theDaughterIsShortLived[1] )
|
||||
{
|
||||
|
||||
// G4cout << G4endl << "Both the " << nDaughters <<
|
||||
// " decay products are stable!";
|
||||
// cout << " LB: Both decay products STABLE !" << G4endl;
|
||||
// cout << " parent: " << theChannel->GetParentName() << G4endl;
|
||||
// cout << " particle1: " << theChannel->GetDaughterName(0) << G4endl;
|
||||
// cout << " particle2: " << theChannel->GetDaughterName(1) << G4endl;
|
||||
|
||||
theActualMom = EvaluateCMMomentum(theActualMass,
|
||||
theDaughterMass);
|
||||
thePoleMom = EvaluateCMMomentum(thePoleMass,
|
||||
theDaughterMass);
|
||||
// cout << G4endl;
|
||||
// cout << " LB: ActualMass/DaughterMass " << theActualMass << " " << theDaughterMass << G4endl;
|
||||
// cout << " LB: ActualMom " << theActualMom << G4endl;
|
||||
// cout << " LB: PoleMom " << thePoleMom << G4endl;
|
||||
// cout << G4endl;
|
||||
}
|
||||
else if ( !theDaughterIsShortLived[0] && theDaughterIsShortLived[1] )
|
||||
{
|
||||
|
||||
// G4cout << G4endl << "Only the first of the " << nDaughters <<" decay products is stable!";
|
||||
// cout << " LB: only the first decay product is STABLE !" << G4endl;
|
||||
// cout << " parent: " << theChannel->GetParentName() << G4endl;
|
||||
// cout << " particle1: " << theChannel->GetDaughterName(0) << G4endl;
|
||||
// cout << " particle2: " << theChannel->GetDaughterName(1) << G4endl;
|
||||
|
||||
// global variable definition
|
||||
G4KineticTrack_Gmass = theActualMass;
|
||||
G4KineticTrack_Gmass1 = theDaughterMass[0];
|
||||
G4KineticTrack_Gmass2 = theDaughterMass[1];
|
||||
G4KineticTrack_Ggamma2 = theDaughterWidth[1];
|
||||
theActualMom = IntegrateCMMomentum();
|
||||
|
||||
G4KineticTrack_Gmass = thePoleMass;
|
||||
thePoleMom = IntegrateCMMomentum(thePoleMass);
|
||||
// cout << " LB Parent Mass = " << G4KineticTrack_Gmass << G4endl;
|
||||
// cout << " LB Actual Mass = " << theActualMass << G4endl;
|
||||
// cout << " LB Daughter1 Mass = " << G4KineticTrack_Gmass1 << G4endl;
|
||||
// cout << " LB Daughter2 Mass = " << G4KineticTrack_Gmass2 << G4endl;
|
||||
// cout << " The Actual Momentum = " << theActualMom << G4endl;
|
||||
// cout << " The Pole Momentum = " << thePoleMom << G4endl;
|
||||
// cout << G4endl;
|
||||
|
||||
}
|
||||
else if ( theDaughterIsShortLived[0] && !theDaughterIsShortLived[1] )
|
||||
{
|
||||
|
||||
// G4cout << G4endl << "Only the second of the " << nDaughters <<
|
||||
// " decay products is stable!";
|
||||
// cout << " LB: only the second decay product is STABLE !" << G4endl;
|
||||
// cout << " parent: " << theChannel->GetParentName() << G4endl;
|
||||
// cout << " particle1: " << theChannel->GetDaughterName(0) << G4endl;
|
||||
// cout << " particle2: " << theChannel->GetDaughterName(1) << G4endl;
|
||||
|
||||
G4double lowerLimit = aSampler.GetMinimumMass(theChannel->GetDaughter(1));
|
||||
theActualMom = IntegrateCMMomentum(lowerLimit);
|
||||
thePoleMom = IntegrateCMMomentum(lowerLimit, thePoleMass);
|
||||
// cout << " LB Parent Mass = " << G4KineticTrack_Gmass << G4endl;
|
||||
// cout << " LB Actual Mass = " << theActualMass << G4endl;
|
||||
// cout << " LB Daughter1 Mass = " << G4KineticTrack_Gmass1 << G4endl;
|
||||
// cout << " LB Daughter2 Mass = " << G4KineticTrack_Gmass2 << G4endl;
|
||||
// cout << " The Actual Momentum = " << theActualMom << G4endl;
|
||||
// cout << " The Pole Momentum = " << thePoleMom << G4endl;
|
||||
// cout << G4endl;
|
||||
|
||||
}
|
||||
else if ( theDaughterIsShortLived[0] && !theDaughterIsShortLived[1] )
|
||||
{
|
||||
|
||||
// G4cout << G4endl << "Only the second of the " << nDaughters <<
|
||||
// " decay products is stable!";
|
||||
// cout << " LB: only the second decay product is STABLE !" << G4endl;
|
||||
// cout << " parent: " << theChannel->GetParentName() << G4endl;
|
||||
// cout << " particle1: " << theChannel->GetDaughterName(0) << G4endl;
|
||||
// cout << " particle2: " << theChannel->GetDaughterName(1) << G4endl;
|
||||
|
||||
//
|
||||
// Swap the content of the theDaughterMass and theDaughterWidth arrays!!!
|
||||
//
|
||||
|
||||
G4SwapObj(theDaughterMass, theDaughterMass + 1);
|
||||
G4SwapObj(theDaughterWidth, theDaughterWidth + 1);
|
||||
|
||||
|
||||
G4SwapObj(theDaughterMass, theDaughterMass + 1);
|
||||
G4SwapObj(theDaughterWidth, theDaughterWidth + 1);
|
||||
|
||||
// global variable definition
|
||||
G4KineticTrack_Gmass = theActualMass;
|
||||
G4KineticTrack_Gmass1 = theDaughterMass[0];
|
||||
G4KineticTrack_Gmass2 = theDaughterMass[1];
|
||||
G4KineticTrack_Ggamma2 = theDaughterWidth[1];
|
||||
theActualMom = IntegrateCMMomentum();
|
||||
|
||||
G4KineticTrack_Gmass = thePoleMass;
|
||||
thePoleMom = IntegrateCMMomentum(thePoleMass);
|
||||
// cout << " LB Parent Mass = " << G4KineticTrack_Gmass << G4endl;
|
||||
// cout << " LB Actual Mass = " << theActualMass << G4endl;
|
||||
// cout << " LB Daughter1 Mass = " << G4KineticTrack_Gmass1 << G4endl;
|
||||
// cout << " LB Daughter2 Mass = " << G4KineticTrack_Gmass2 << G4endl;
|
||||
// cout << " The Actual Momentum = " << theActualMom << G4endl;
|
||||
// cout << " The Pole Momentum = " << thePoleMom << G4endl;
|
||||
// cout << G4endl;
|
||||
|
||||
}
|
||||
else if ( theDaughterIsShortLived[0] && theDaughterIsShortLived[1] )
|
||||
{
|
||||
|
||||
G4double lowerLimit = aSampler.GetMinimumMass(theChannel->GetDaughter(0));
|
||||
theActualMom = IntegrateCMMomentum(lowerLimit);
|
||||
thePoleMom = IntegrateCMMomentum(lowerLimit, thePoleMass);
|
||||
// cout << " LB Parent Mass = " << G4KineticTrack_Gmass << G4endl;
|
||||
// cout << " LB Actual Mass = " << theActualMass << G4endl;
|
||||
// cout << " LB Daughter1 Mass = " << G4KineticTrack_Gmass1 << G4endl;
|
||||
// cout << " LB Daughter2 Mass = " << G4KineticTrack_Gmass2 << G4endl;
|
||||
// cout << " The Actual Momentum = " << theActualMom << G4endl;
|
||||
// cout << " The Pole Momentum = " << thePoleMom << G4endl;
|
||||
// cout << G4endl;
|
||||
|
||||
}
|
||||
else if ( theDaughterIsShortLived[0] && theDaughterIsShortLived[1] )
|
||||
{
|
||||
|
||||
// G4cout << G4endl << "Both the " << nDaughters <<
|
||||
// " decay products are resonances!";
|
||||
// cout << " LB: both decay products are RESONANCES !" << G4endl;
|
||||
// cout << " parent: " << theChannel->GetParentName() << G4endl;
|
||||
// cout << " particle1: " << theChannel->GetDaughterName(0) << G4endl;
|
||||
// cout << " particle2: " << theChannel->GetDaughterName(1) << G4endl;
|
||||
|
||||
// cout << " LB: both decay products are RESONANCES !" << G4endl;
|
||||
// cout << " parent: " << theChannel->GetParentName() << G4endl;
|
||||
// cout << " particle1: " << theChannel->GetDaughterName(0) << G4endl;
|
||||
// cout << " particle2: " << theChannel->GetDaughterName(1) << G4endl;
|
||||
|
||||
// global variable definition
|
||||
G4KineticTrack_Gmass = theActualMass;
|
||||
G4KineticTrack_Gmass1 = theDaughterMass[0];
|
||||
G4KineticTrack_Ggamma1 = theDaughterWidth[0];
|
||||
G4KineticTrack_Gmass2 = theDaughterMass[1];
|
||||
G4KineticTrack_Ggamma2 = theDaughterWidth[1];
|
||||
theActualMom = IntegrateCMMomentum2();
|
||||
|
||||
G4KineticTrack_Gmass = thePoleMass;
|
||||
thePoleMom = IntegrateCMMomentum2();
|
||||
// cout << " LB Parent Mass = " << G4KineticTrack_Gmass << G4endl;
|
||||
// cout << " LB Daughter1 Mass = " << G4KineticTrack_Gmass1 << G4endl;
|
||||
// cout << " LB Daughter2 Mass = " << G4KineticTrack_Gmass2 << G4endl;
|
||||
// cout << " The Actual Momentum = " << theActualMom << G4endl;
|
||||
// cout << " The Pole Momentum = " << thePoleMom << G4endl;
|
||||
// cout << G4endl;
|
||||
|
||||
}
|
||||
|
||||
G4double theMassRatio = thePoleMass / theActualMass;
|
||||
G4KineticTrack_Gmass = theActualMass;
|
||||
theActualMom = IntegrateCMMomentum2();
|
||||
G4KineticTrack_Gmass = thePoleMass;
|
||||
thePoleMom = IntegrateCMMomentum2();
|
||||
// cout << " LB Parent Mass = " << G4KineticTrack_Gmass << G4endl;
|
||||
// cout << " LB Daughter1 Mass = " << G4KineticTrack_Gmass1 << G4endl;
|
||||
// cout << " LB Daughter2 Mass = " << G4KineticTrack_Gmass2 << G4endl;
|
||||
// cout << " The Actual Momentum = " << theActualMom << G4endl;
|
||||
// cout << " The Pole Momentum = " << thePoleMom << G4endl;
|
||||
// cout << G4endl;
|
||||
|
||||
}
|
||||
}
|
||||
else // (nDaughter==3)
|
||||
{
|
||||
|
||||
int nShortLived = 0;
|
||||
if ( theDaughterIsShortLived[0] )
|
||||
{
|
||||
nShortLived++;
|
||||
}
|
||||
if ( theDaughterIsShortLived[1] )
|
||||
{
|
||||
nShortLived++;
|
||||
G4SwapObj(theDaughterMass, theDaughterMass + 1);
|
||||
G4SwapObj(theDaughterWidth, theDaughterWidth + 1);
|
||||
}
|
||||
if ( theDaughterIsShortLived[2] )
|
||||
{
|
||||
nShortLived++;
|
||||
G4SwapObj(theDaughterMass, theDaughterMass + 2);
|
||||
G4SwapObj(theDaughterWidth, theDaughterWidth + 2);
|
||||
}
|
||||
if ( nShortLived == 0 )
|
||||
{
|
||||
theDaughterMass[1]+=theDaughterMass[2];
|
||||
theActualMom = EvaluateCMMomentum(theActualMass,
|
||||
theDaughterMass);
|
||||
thePoleMom = EvaluateCMMomentum(thePoleMass,
|
||||
theDaughterMass);
|
||||
}
|
||||
// else if ( nShortLived == 1 )
|
||||
else if ( nShortLived >= 1 )
|
||||
{
|
||||
// need the shortlived particle in slot 1! (very bad style...)
|
||||
G4SwapObj(theDaughterMass, theDaughterMass + 1);
|
||||
G4SwapObj(theDaughterWidth, theDaughterWidth + 1);
|
||||
theDaughterMass[0] += theDaughterMass[2];
|
||||
theActualMom = IntegrateCMMomentum(0.0);
|
||||
thePoleMom = IntegrateCMMomentum(0.0, thePoleMass);
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// G4Exception ("can't handle more than one shortlived in 3 particle output channel");
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
G4double l=0; // needs to be generalized
|
||||
G4double theMassRatio = thePoleMass / theActualMass;
|
||||
G4double theMomRatio = theActualMom / thePoleMom;
|
||||
G4int l = 0; /* code has to be made more general */
|
||||
|
||||
//
|
||||
// Evaluate tha "actual widths"
|
||||
//
|
||||
|
||||
theActualWidth[index] = thePoleWidth * theMassRatio *
|
||||
pow(theMomRatio, (2 * l + 1)) *
|
||||
(1.2 / (1+ 0.2*pow(theMomRatio, (2 * l))));
|
||||
|
||||
// cout << " LB The Mass Ratio = " << theMassRatio << G4endl;
|
||||
// cout << " LB The Mom. Ratio = " << theMomRatio << G4endl;
|
||||
// cout << " LB The Pole Width = " << thePoleWidth << G4endl;
|
||||
// cout << " LB The Actual Width = " << theActualWidth[index] << "index: " << index << G4endl;
|
||||
|
||||
delete [] theDaughterMass;
|
||||
theDaughterMass = 0;
|
||||
delete [] theDaughterWidth;
|
||||
theDaughterWidth = 0;
|
||||
delete [] theDaughterIsShortLived;
|
||||
theDaughterIsShortLived = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
theMotherWidth = theDefinition->GetPDGWidth();
|
||||
theActualWidth[index] = theChannel->GetBR()*theMotherWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else // nDaughter = 1 ( e.g. K0 decays 50% to Kshort, 50% Klong
|
||||
{
|
||||
theMotherWidth = theDefinition->GetPDGWidth();
|
||||
theActualWidth[index] = theChannel->GetBR()*theMotherWidth;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////
|
||||
// DEBUG //
|
||||
@@ -505,7 +541,7 @@ G4KineticTrackVector* G4KineticTrack::Decay()
|
||||
theDynamicParticle = theDecayProducts->PopProducts();
|
||||
theDefinition = theDynamicParticle->GetDefinition();
|
||||
the4Momentum = toMoving*theDynamicParticle->Get4Momentum();
|
||||
theDecayProductList->insert(new G4KineticTrack (theDefinition,
|
||||
theDecayProductList->push_back(new G4KineticTrack (theDefinition,
|
||||
theFormationTime,
|
||||
thePosition,
|
||||
the4Momentum));
|
||||
@@ -521,135 +557,106 @@ G4KineticTrackVector* G4KineticTrack::Decay()
|
||||
}
|
||||
}
|
||||
|
||||
G4double G4KineticTrack_IntegrandFunction1(G4double xmass)
|
||||
G4double G4KineticTrack::IntegrandFunction1(G4double xmass) const
|
||||
{
|
||||
// G4double mass = theActualMass; /* the actual mass value */
|
||||
G4double mass = G4KineticTrack_Gmass; /* the actual mass value */
|
||||
// G4double mass1 = theDaughterMass[0];
|
||||
G4double mass1 = G4KineticTrack_Gmass1;
|
||||
// G4double mass2 = theDaughterMass[1];
|
||||
G4double mass2 = G4KineticTrack_Gmass2;
|
||||
// G4double gamma2 = theDaughterWidth[1];
|
||||
G4double gamma2 = G4KineticTrack_Ggamma2;
|
||||
G4KineticTrack wei;
|
||||
G4double result = (1. / (2 * mass)) *
|
||||
sqrt(((mass * mass) - (mass1 + xmass) * (mass1 + xmass)) *
|
||||
((mass * mass) - (mass1 - xmass) * (mass1 - xmass))) *
|
||||
wei.BrWig(gamma2, mass2, xmass);
|
||||
G4double mass = theActualMass; /* the actual mass value */
|
||||
G4double mass1 = theDaughterMass[0];
|
||||
G4double mass2 = theDaughterMass[1];
|
||||
G4double gamma2 = theDaughterWidth[1];
|
||||
|
||||
G4double result = (1. / (2 * mass)) *
|
||||
sqrt(G4std::max((((mass * mass) - (mass1 + xmass) * (mass1 + xmass)) *
|
||||
((mass * mass) - (mass1 - xmass) * (mass1 - xmass))),0.0)) *
|
||||
BrWig(gamma2, mass2, xmass);
|
||||
return result;
|
||||
}
|
||||
|
||||
G4double G4KineticTrack::IntegrandFunction2(G4double xmass) const
|
||||
{
|
||||
G4double mass = theDefinition->GetPDGMass(); /* the pole mass value */
|
||||
G4double mass1 = theDaughterMass[0];
|
||||
G4double mass2 = theDaughterMass[1];
|
||||
G4double gamma2 = theDaughterWidth[1];
|
||||
G4double result = (1. / (2 * mass)) *
|
||||
sqrt(G4std::max((((mass * mass) - (mass1 + xmass) * (mass1 + xmass)) *
|
||||
((mass * mass) - (mass1 - xmass) * (mass1 - xmass))),0.0)) *
|
||||
BrWig(gamma2, mass2, xmass);
|
||||
return result;
|
||||
}
|
||||
|
||||
G4double G4KineticTrack_IntegrandFunction2(G4double xmass)
|
||||
G4double G4KineticTrack::IntegrandFunction3(G4double xmass) const
|
||||
{
|
||||
// G4double mass = theDefinition->GetPDGMass(); /* the pole mass value */
|
||||
G4double mass = G4KineticTrack_Gmass; /* the actual mass value */
|
||||
// G4double mass1 = theDaughterMass[0];
|
||||
G4double mass1 = G4KineticTrack_Gmass1;
|
||||
// G4double mass2 = theDaughterMass[1];
|
||||
G4double mass2 = G4KineticTrack_Gmass2;
|
||||
// G4double gamma2 = theDaughterWidth[1];
|
||||
G4double gamma2 = G4KineticTrack_Ggamma2;
|
||||
G4KineticTrack wei;
|
||||
G4double result = (1. / (2 * mass)) *
|
||||
sqrt(((mass * mass) - (mass1 + xmass) * (mass1 + xmass)) *
|
||||
((mass * mass) - (mass1 - xmass) * (mass1 - xmass))) *
|
||||
wei.BrWig(gamma2, mass2, xmass);
|
||||
return result;
|
||||
const G4double mass = G4KineticTrack_Gmass; /* the actual mass value */
|
||||
// const G4double mass1 = theDaughterMass[0];
|
||||
const G4double mass2 = theDaughterMass[1];
|
||||
const G4double gamma2 = theDaughterWidth[1];
|
||||
|
||||
const G4double result = (1. / (2 * mass)) *
|
||||
sqrt(((mass * mass) - (G4KineticTrack_xmass1 + xmass) * (G4KineticTrack_xmass1 + xmass)) *
|
||||
((mass * mass) - (G4KineticTrack_xmass1 - xmass) * (G4KineticTrack_xmass1 - xmass))) *
|
||||
BrWig(gamma2, mass2, xmass);
|
||||
return result;
|
||||
}
|
||||
|
||||
G4double G4KineticTrack_IntegrandFunction3(G4double xmass)
|
||||
G4double G4KineticTrack::IntegrandFunction4(G4double xmass) const
|
||||
{
|
||||
G4double mass = G4KineticTrack_Gmass; /* the actual mass value */
|
||||
G4double mass1 = G4KineticTrack_Gmass1;
|
||||
G4double gamma1 = G4KineticTrack_Ggamma1;
|
||||
G4double mass2 = G4KineticTrack_Gmass2;
|
||||
G4double gamma2 = G4KineticTrack_Ggamma2;
|
||||
G4KineticTrack wei;
|
||||
G4double result = (1. / (2 * mass)) *
|
||||
sqrt(((mass * mass) - (G4KineticTrack_xmass1 + xmass) * (G4KineticTrack_xmass1 + xmass)) *
|
||||
((mass * mass) - (G4KineticTrack_xmass1 - xmass) * (G4KineticTrack_xmass1 - xmass))) *
|
||||
wei.BrWig(gamma2, mass2, xmass);
|
||||
return result;
|
||||
const G4double mass = G4KineticTrack_Gmass;
|
||||
const G4double mass1 = theDaughterMass[0];
|
||||
const G4double gamma1 = theDaughterWidth[0];
|
||||
// const G4double mass2 = theDaughterMass[1];
|
||||
|
||||
G4KineticTrack_xmass1 = xmass;
|
||||
|
||||
const G4double theLowerLimit = 0.0;
|
||||
const G4double theUpperLimit = mass - xmass;
|
||||
const G4int nIterations = 100;
|
||||
|
||||
G4Integrator<const G4KineticTrack, G4double(G4KineticTrack::*)(G4double) const> integral;
|
||||
G4double result = BrWig(gamma1, mass1, xmass)*
|
||||
integral.Simpson(this, &G4KineticTrack::IntegrandFunction3, theLowerLimit, theUpperLimit, nIterations);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
G4double G4KineticTrack_IntegrandFunction4(G4double xmass)
|
||||
G4double G4KineticTrack::IntegrateCMMomentum(const G4double theLowerLimit) const
|
||||
{
|
||||
G4double mass = G4KineticTrack_Gmass;
|
||||
G4double mass1 = G4KineticTrack_Gmass1;
|
||||
G4double gamma1 = G4KineticTrack_Ggamma1;
|
||||
G4double mass2 = G4KineticTrack_Gmass2;
|
||||
G4double gamma2 = G4KineticTrack_Ggamma2;
|
||||
G4KineticTrack wei;
|
||||
G4double G4KineticTrack_xmass1=xmass;
|
||||
G4double theLowerLimit = 0.0;
|
||||
G4double theUpperLimit = mass - xmass;
|
||||
G4int nIterations = 100;
|
||||
G4SimpleIntegration theIntegrandMomentum(&G4KineticTrack_IntegrandFunction3);
|
||||
G4double result = wei.BrWig(gamma1, mass1, xmass)*
|
||||
theIntegrandMomentum.Simpson(theLowerLimit,
|
||||
theUpperLimit,
|
||||
nIterations);
|
||||
return result;
|
||||
const G4double theUpperLimit = theActualMass - theDaughterMass[0];
|
||||
const G4int nIterations = 100;
|
||||
|
||||
if (theLowerLimit>=theUpperLimit) return 0.0;
|
||||
|
||||
G4Integrator<const G4KineticTrack, G4double(G4KineticTrack::*)(G4double) const> integral;
|
||||
G4double theIntegralOverMass2 = integral.Simpson(this, &G4KineticTrack::IntegrandFunction1,
|
||||
theLowerLimit, theUpperLimit, nIterations);
|
||||
return theIntegralOverMass2;
|
||||
}
|
||||
|
||||
G4double G4KineticTrack::IntegrateCMMomentum() const
|
||||
G4double G4KineticTrack::IntegrateCMMomentum(const G4double theLowerLimit, const G4double poleMass) const
|
||||
{
|
||||
G4double theLowerLimit = 0.0;
|
||||
G4double theUpperLimit = theActualMass - theDaughterMass[0];
|
||||
G4int nIterations = 100;
|
||||
G4SimpleIntegration theIntegrandMomentum(&G4KineticTrack_IntegrandFunction1);
|
||||
G4double theIntegralOverMass2;
|
||||
if(theUpperLimit>0.)
|
||||
theIntegralOverMass2 = theIntegrandMomentum.Simpson(theLowerLimit,
|
||||
theUpperLimit,
|
||||
nIterations);
|
||||
else
|
||||
theIntegralOverMass2 = 0.;
|
||||
const G4double theUpperLimit = poleMass - theDaughterMass[0];
|
||||
const G4int nIterations = 100;
|
||||
|
||||
if (theLowerLimit>=theUpperLimit) return 0.0;
|
||||
|
||||
// G4cout << G4endl << "Inside IntegrateCMMomentum (actual mass case): ";
|
||||
// G4cout << G4endl << " Integration result = " << theIntegralOverMass2 << G4endl ;
|
||||
return theIntegralOverMass2;
|
||||
G4Integrator<const G4KineticTrack, G4double(G4KineticTrack::*)(G4double) const> integral;
|
||||
const G4double theIntegralOverMass2 = integral.Simpson(this, &G4KineticTrack::IntegrandFunction2,
|
||||
theLowerLimit, theUpperLimit, nIterations);
|
||||
return theIntegralOverMass2;
|
||||
}
|
||||
|
||||
G4double G4KineticTrack::IntegrateCMMomentum(const G4double polemass) const
|
||||
{
|
||||
G4double theLowerLimit = 0.0;
|
||||
G4double theUpperLimit = polemass - theDaughterMass[0];
|
||||
G4int nIterations = 100;
|
||||
G4SimpleIntegration theIntegrandMomentum(&G4KineticTrack_IntegrandFunction1);
|
||||
G4double theIntegralOverMass2;
|
||||
if(theUpperLimit>0.)
|
||||
theIntegralOverMass2 = theIntegrandMomentum.Simpson(theLowerLimit,
|
||||
theUpperLimit,
|
||||
nIterations);
|
||||
else
|
||||
theIntegralOverMass2 = 0.;
|
||||
|
||||
// G4cout << G4endl << "Inside IntegrateCMMomentum (pole mass case): ";
|
||||
// G4cout << G4endl << " Integration result = " << theIntegralOverMass2 << G4endl;
|
||||
// G4cout << G4endl << " Lower / upper limit " << theLowerLimit << " / " << theUpperLimit << G4endl;
|
||||
|
||||
return theIntegralOverMass2;
|
||||
}
|
||||
|
||||
G4double G4KineticTrack::IntegrateCMMomentum2() const
|
||||
{
|
||||
G4double theLowerLimit = 0.0;
|
||||
G4double theUpperLimit = theActualMass;
|
||||
G4int nIterations = 100;
|
||||
G4SimpleIntegration theIntegrandMomentum(&G4KineticTrack_IntegrandFunction4);
|
||||
G4double theIntegralOverMass2;
|
||||
if(theUpperLimit>0.)
|
||||
theIntegralOverMass2 = theIntegrandMomentum.Simpson(theLowerLimit,
|
||||
theUpperLimit,
|
||||
nIterations);
|
||||
else
|
||||
theIntegralOverMass2 = 0.;
|
||||
|
||||
// G4cout << G4endl << "Inside IntegrateCMMomentum 2: ";
|
||||
// G4cout << G4endl << " Integration result = " << theIntegralOverMass2 << G4endl;
|
||||
|
||||
return theIntegralOverMass2;
|
||||
const G4double theLowerLimit = 0.0;
|
||||
const G4double theUpperLimit = theActualMass;
|
||||
const G4int nIterations = 100;
|
||||
|
||||
if (theLowerLimit>=theUpperLimit) return 0.0;
|
||||
|
||||
G4Integrator<const G4KineticTrack, G4double(G4KineticTrack::*)(G4double) const> integral;
|
||||
G4double theIntegralOverMass2 = integral.Simpson(this, &G4KineticTrack::IntegrandFunction4,
|
||||
theLowerLimit, theUpperLimit, nIterations);
|
||||
return theIntegralOverMass2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
@@ -23,8 +23,8 @@
|
||||
#include "G4KineticTrackVector.hh"
|
||||
|
||||
G4KineticTrackVector::G4KineticTrackVector()
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************
|
||||
@@ -33,9 +33,9 @@ G4KineticTrackVector::G4KineticTrackVector()
|
||||
|
||||
void G4KineticTrackVector::BoostBeam(G4ThreeVector& BeamMom)
|
||||
{
|
||||
for(G4int c1 = 0; c1 < length(); c1++)
|
||||
for(unsigned int c1 = 0; c1 < size(); c1++)
|
||||
{
|
||||
G4KineticTrack& KT =*at(c1);
|
||||
G4KineticTrack& KT =**(begin()+c1);
|
||||
G4LorentzVector Mom = KT.Get4Momentum();
|
||||
G4ThreeVector Velocity = (1/sqrt(BeamMom.mag2() + sqr(KT.GetDefinition()->GetPDGMass())))*BeamMom;
|
||||
Mom.boost(Velocity);
|
||||
@@ -46,9 +46,9 @@ void G4KineticTrackVector::BoostBeam(G4ThreeVector& BeamMom)
|
||||
|
||||
void G4KineticTrackVector::Boost(G4ThreeVector& Velocity)
|
||||
{
|
||||
for(G4int c1 = 0; c1 < length(); c1++)
|
||||
for(unsigned int c1 = 0; c1 < size(); c1++)
|
||||
{
|
||||
G4KineticTrack& KT =*at(c1);
|
||||
G4KineticTrack& KT =**(begin()+c1);
|
||||
G4LorentzVector Mom = KT.Get4Momentum();
|
||||
Mom.boost(Velocity);
|
||||
KT.Set4Momentum(Mom);
|
||||
@@ -59,9 +59,9 @@ void G4KineticTrackVector::Boost(G4ThreeVector& Velocity)
|
||||
|
||||
void G4KineticTrackVector::Shift(G4ThreeVector& Pos)
|
||||
{
|
||||
for(G4int c1 = 0; c1 < length(); c1++)
|
||||
for(unsigned int c1 = 0; c1 < size(); c1++)
|
||||
{
|
||||
G4KineticTrack& KT =*at(c1);
|
||||
G4KineticTrack& KT =**(begin()+c1);
|
||||
KT.SetPosition(KT.GetPosition() + Pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NuclearFermiDensity.cc,v 1.6.8.1 2001/06/28 19:13:49 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4NuclearFermiDensity.cc,v 1.8 2001/08/01 17:09:30 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#include "G4NuclearFermiDensity.hh"
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4NuclearShellModelDensity.cc,v 1.4.8.1 2001/06/28 19:13:49 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4NuclearShellModelDensity.cc,v 1.6 2001/08/01 17:09:31 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
|
||||
#include "G4NuclearShellModelDensity.hh"
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Nucleon.cc,v 1.3.8.2 2001/06/28 20:20:03 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4Nucleon.cc,v 1.5 2001/08/01 17:09:31 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
#include "G4Nucleon.hh"
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Parton.cc,v 1.7.8.2 2001/06/28 20:20:03 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
// $Id: G4Parton.cc,v 1.12 2001/11/15 14:10:48 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
@@ -38,15 +38,66 @@ G4Parton::G4Parton(G4int PDGcode)
|
||||
{
|
||||
PDGencoding=PDGcode;
|
||||
theX = 0;
|
||||
theDefinition=G4ParticleTable::GetParticleTable()->FindParticle(PDGencoding);;
|
||||
theDefinition=G4ParticleTable::GetParticleTable()->FindParticle(PDGencoding);
|
||||
if (theDefinition == NULL)
|
||||
{
|
||||
G4cout << "Encoding = "<<PDGencoding<<G4endl;
|
||||
G4Exception("G4Parton::GetDefinition(): Encoding not in particle table");
|
||||
}
|
||||
theColour = 1;
|
||||
theIsoSpinZ = 0.5;
|
||||
theSpinZ = 0.5;
|
||||
//
|
||||
// colour by random in (1,2,3)=(R,G,B) for quarks and
|
||||
// in (-1,-2,-3)=(Rbar,Gbar,Bbar) for anti-quarks:
|
||||
//
|
||||
if (theDefinition->GetParticleType() == "quarks") {
|
||||
theColour = ((G4int)(3.*G4UniformRand())+1)*(abs(PDGencoding)/PDGencoding) ;
|
||||
}
|
||||
//
|
||||
// colour by random in (-1,-2,-3)=(Rbar,Gbar,Bbar)=(GB,RB,RG) for di-quarks and
|
||||
// in (1,2,3)=(R,G,B)=(GB,RB,RG) for anti-di-quarks:
|
||||
//
|
||||
else if (theDefinition->GetParticleType() == "diquarks") {
|
||||
theColour = -((G4int)(3.*G4UniformRand())+1)*(abs(PDGencoding)/PDGencoding);
|
||||
}
|
||||
//
|
||||
// colour by random in (-11,-12,...,-33)=(RRbar,RGbar,RBbar,...,BBbar) for gluons:
|
||||
//
|
||||
else if (theDefinition->GetParticleType() == "gluons") {
|
||||
theColour = -(((G4int)(3.*G4UniformRand())+1)*10 + ((G4int)(3.*G4UniformRand())+1));
|
||||
}
|
||||
else {
|
||||
G4cout << "Encoding = "<<PDGencoding<<G4endl;
|
||||
G4Exception("G4Parton::GetDefinition(): Particle is not a parton");
|
||||
}
|
||||
//
|
||||
// isospin-z from PDG-encoded isospin-z for
|
||||
// quarks, anti-quarks, di-quarks, and anti-di-quarks:
|
||||
//
|
||||
if ((theDefinition->GetParticleType() == "quarks") || (theDefinition->GetParticleType() == "diquarks")){
|
||||
theIsoSpinZ = theDefinition->GetPDGIsospin3();
|
||||
}
|
||||
//
|
||||
// isospin-z choosen at random from PDG-encoded isospin for gluons (should be zero):
|
||||
//
|
||||
else {
|
||||
G4int thisPDGiIsospin=theDefinition->GetPDGiIsospin();
|
||||
if (thisPDGiIsospin == 0) {
|
||||
theIsoSpinZ = 0;
|
||||
}
|
||||
else {
|
||||
theIsoSpinZ = ((G4int)((thisPDGiIsospin+1)*G4UniformRand()))-thisPDGiIsospin*0.5;
|
||||
}
|
||||
}
|
||||
//
|
||||
// spin-z choosen at random from PDG-encoded spin:
|
||||
//
|
||||
G4int thisPDGiSpin=theDefinition->GetPDGiSpin();
|
||||
if (thisPDGiSpin == 0) {
|
||||
theSpinZ = 0;
|
||||
}
|
||||
else {
|
||||
G4int rand=((G4int)((thisPDGiSpin+1)*G4UniformRand()));
|
||||
theSpinZ = rand-thisPDGiSpin*0.5;;
|
||||
}
|
||||
}
|
||||
|
||||
G4Parton::G4Parton(const G4Parton &right)
|
||||
@@ -76,7 +127,10 @@ const G4Parton & G4Parton::operator=(const G4Parton &right)
|
||||
}
|
||||
|
||||
G4Parton::~G4Parton()
|
||||
{}
|
||||
{
|
||||
// cout << "G4Parton::~G4Parton(): this = "<<this <<endl;
|
||||
// cout << "break here"<<this <<endl;
|
||||
}
|
||||
|
||||
void G4Parton::DefineMomentumInZ(G4double aLightConeMomentum, G4bool aDirection)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * 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. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * authors in the GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4SampleResonance.cc,v 1.4 2001/10/06 08:17:02 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// ---------------- G4SampleResonance ----------------
|
||||
// by Henning Weber, March 2001.
|
||||
// helper class for sampling resonance masses
|
||||
// ------------------------------------------------------------
|
||||
|
||||
|
||||
#include "globals.hh"
|
||||
#include "g4std/iostream"
|
||||
#include "G4SampleResonance.hh"
|
||||
#include "G4DecayTable.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
|
||||
G4SampleResonance::minMassMapType G4SampleResonance::minMassCache;
|
||||
|
||||
G4double G4SampleResonance::GetMinimumMass(const G4ParticleDefinition* p) const
|
||||
{
|
||||
|
||||
G4double minResonanceMass = DBL_MAX;
|
||||
|
||||
if ( p->IsShortLived() )
|
||||
{
|
||||
minMassMapIterator i = minMassCache.find(p);
|
||||
if ( i!=minMassCache.end() )
|
||||
{
|
||||
minResonanceMass = (*i).second;
|
||||
}
|
||||
else
|
||||
{
|
||||
// G4cout << "--> request for " << p->GetParticleName() << G4endl;
|
||||
|
||||
const G4DecayTable* theDecays = const_cast<G4ParticleDefinition*>(p)->GetDecayTable();
|
||||
const G4int nDecays = theDecays->entries();
|
||||
|
||||
for (G4int i=0; i<nDecays; i++)
|
||||
{
|
||||
const G4VDecayChannel* aDecay = theDecays->GetDecayChannel(i);
|
||||
const G4int nDaughters = aDecay->GetNumberOfDaughters();
|
||||
|
||||
G4double minChannelMass = 0;
|
||||
|
||||
for (G4int j=0; j<nDaughters; j++)
|
||||
{
|
||||
const G4ParticleDefinition* aDaughter = const_cast<G4VDecayChannel*>(aDecay)->GetDaughter(j);
|
||||
G4double minMass = GetMinimumMass(aDaughter);
|
||||
if (!minMass) minMass = DBL_MAX; // exclude gamma channel;
|
||||
minChannelMass+=minMass;
|
||||
}
|
||||
// G4cout << "channel mass for the above is " << minChannelMass/MeV << G4endl;
|
||||
if (minChannelMass < minResonanceMass) minResonanceMass = minChannelMass;
|
||||
|
||||
}
|
||||
// replace this as soon as the compiler supports mutable!!
|
||||
G4SampleResonance* self = const_cast<G4SampleResonance*>(this);
|
||||
(self->minMassCache)[p] = minResonanceMass;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
minResonanceMass = p->GetPDGMass();
|
||||
|
||||
}
|
||||
// G4cout << "minimal mass for " << p->GetParticleName() << " is " << minResonanceMass/MeV << G4endl;
|
||||
|
||||
return minResonanceMass;
|
||||
}
|
||||
|
||||
|
||||
|
||||
G4double G4SampleResonance::SampleMass(const G4ParticleDefinition* p, const G4double maxMass) const
|
||||
{
|
||||
return SampleMass(p->GetPDGMass(), p->GetPDGWidth(), GetMinimumMass(p), maxMass);
|
||||
}
|
||||
|
||||
|
||||
G4double G4SampleResonance::SampleMass(const G4double poleMass,
|
||||
const G4double gamma,
|
||||
const G4double minMass,
|
||||
const G4double maxMass) const
|
||||
{
|
||||
// Chooses a mass randomly between minMass and maxMass
|
||||
// according to a Breit-Wigner function with constant
|
||||
// width gamma and pole poleMass
|
||||
|
||||
if ( minMass > maxMass )
|
||||
{
|
||||
G4Exception("SampleResonanceMass: mass range negative (minMass>maxMass)");
|
||||
}
|
||||
|
||||
G4double returnMass;
|
||||
|
||||
if ( gamma < DBL_EPSILON )
|
||||
{
|
||||
returnMass = G4std::max(minMass, G4std::min(maxMass, poleMass));
|
||||
}
|
||||
else
|
||||
{
|
||||
double fmin = BrWigInt0(minMass, gamma, poleMass);
|
||||
double fmax = BrWigInt0(maxMass, gamma, poleMass);
|
||||
double f = fmin + (fmax-fmin)*G4UniformRand();
|
||||
returnMass = BrWigInv(f, gamma, poleMass);
|
||||
}
|
||||
|
||||
return returnMass;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user