Import Geant4 3.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:55:53 +02:00
parent e7d7193284
commit cfcb558cfe
3050 changed files with 91703 additions and 48310 deletions
@@ -5,14 +5,15 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ExcitedStringDecay.hh,v 1.2 1999/12/15 14:52:47 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4ExcitedStringDecay.hh,v 1.6 2000/11/10 08:30:07 hpw Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G4ExcitedStringDecay_h
#define G4ExcitedStringDecay_h 1
#include "globals.hh"
#include "G4VStringFragmentation.hh"
#include "G4ExcitedString.hh"
#include "G4ExcitedStringVector.hh"
#include "G4KineticTrackVector.hh"
#include "G4LundStringFragmentation.hh"
@@ -30,17 +31,20 @@ class G4ExcitedStringDecay: public G4VStringFragmentation
int operator!=(const G4ExcitedStringDecay &right) const;
public:
// virtual G4ReactionProductVector * FragmentString(const G4ExcitedString &theString)=0;
virtual G4KineticTrackVector * FragmentString(const G4ExcitedString &theString);
virtual G4KineticTrackVector * FragmentStrings(const G4ExcitedStringVector * theStrings);
private:
G4KineticTrackVector * FragmentString(const G4ExcitedString &theString);
G4bool EnergyAndMomentumCorrector(G4KineticTrackVector* Output, G4LorentzVector& TotalCollisionMom);
G4VLongitudinalStringDecay * theStringDecay;
};
inline
G4KineticTrackVector *G4ExcitedStringDecay::FragmentString(const G4ExcitedString &theString)
G4KineticTrackVector *G4ExcitedStringDecay::
FragmentString(const G4ExcitedString &theString)
{
if ( theStringDecay == NULL )
theStringDecay=new G4LundStringFragmentation();
@@ -48,6 +52,56 @@ G4KineticTrackVector *G4ExcitedStringDecay::FragmentString(const G4ExcitedString
return theStringDecay->FragmentString(theString);
}
inline
G4KineticTrackVector *G4ExcitedStringDecay::
FragmentStrings(const G4ExcitedStringVector * theStrings)
{
G4KineticTrackVector * theResult = new G4KineticTrackVector;
G4LorentzVector KTsum;
G4bool NeedEnergyCorrector=false;
for ( G4int astring=0; astring < theStrings->entries(); astring++)
{
KTsum+= theStrings->at(astring)->Get4Momentum();
G4KineticTrackVector * generatedKineticTracks = NULL;
if ( theStrings->at(astring)->IsExcited() )
{
generatedKineticTracks=FragmentString(*theStrings->at(astring));
} else {
generatedKineticTracks = new G4KineticTrackVector;
generatedKineticTracks->insert(theStrings->at(astring)->GetKineticTrack());
}
if (generatedKineticTracks == NULL)
{
G4cerr << "G4VPartonStringModel:No KineticTracks produced" << G4endl;
continue;
}
G4LorentzVector KTsum1;
for ( G4int aTrack=0; aTrack<generatedKineticTracks->entries();aTrack++)
{
theResult->insert(generatedKineticTracks->at(aTrack));
KTsum1+= (*generatedKineticTracks)[aTrack]->Get4Momentum();
}
if ( abs((KTsum1.e()-theStrings->at(astring)->Get4Momentum().e()) / KTsum1.e()) > perMillion )
{
NeedEnergyCorrector=true;
}
// clean up
delete generatedKineticTracks;
}
// G4cout << "String total energy and 4 momentum" <<KTsum.t()<<" "<< KTsum << endl;
if ( NeedEnergyCorrector ) EnergyAndMomentumCorrector(theResult, KTsum);
return theResult;
}
#endif
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4LundStringFragmentation.hh,v 1.2 1999/12/15 14:52:47 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $ Maxim Komogorov
// GEANT4 tag $Name: geant4-03-00 $ Maxim Komogorov
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4QGSMFragmentation.hh,v 1.3 1999/12/15 14:52:47 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VKinkyStringDecay.hh,v 1.2 1999/12/15 14:52:47 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
// Maxim Komogorov
//
// -----------------------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VLongitudinalStringDecay.hh,v 1.6 1999/12/15 17:51:27 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4VLongitudinalStringDecay.hh,v 1.7 2000/08/02 08:14:13 hpw Exp $
// GEANT4 tag $Name: geant4-03-00 $
// Maxim Komogorov
//
// -----------------------------------------------------------------------------
@@ -25,7 +25,7 @@
//**********************************************************************************************
class G4VLongitudinalStringDecay: public G4VStringFragmentation
class G4VLongitudinalStringDecay
{
public:
G4VLongitudinalStringDecay();
@@ -1,15 +1,4 @@
// This code implementation is the intellectual property of
// 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: G4ExcitedStringDecay.cc,v 1.2 1999/12/15 14:52:47 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// G4ExcitedStringDecay
// Historic fragment from M.Komogorov; clean-up still necessary @@@
#include "G4ExcitedStringDecay.hh"
G4ExcitedStringDecay::G4ExcitedStringDecay()
@@ -23,7 +12,7 @@ G4ExcitedStringDecay::G4ExcitedStringDecay(G4VLongitudinalStringDecay * aStringD
G4ExcitedStringDecay::G4ExcitedStringDecay(const G4ExcitedStringDecay &right)
{
}
}
G4ExcitedStringDecay::~G4ExcitedStringDecay()
{
@@ -45,3 +34,60 @@ int G4ExcitedStringDecay::operator!=(const G4ExcitedStringDecay &right) const
return 1;
}
G4bool G4ExcitedStringDecay::
EnergyAndMomentumCorrector(G4KineticTrackVector* Output, G4LorentzVector& TotalCollisionMom)
{
const int nAttemptScale = 500;
const double ErrLimit = 1.E-5;
if (Output->isEmpty())
return TRUE;
G4LorentzVector SumMom;
G4double SumMass = 0;
G4double TotalCollisionMass = TotalCollisionMom.m();
// Calculate sum hadron 4-momenta and summing hadron mass
G4int cHadron;
for(cHadron = 0; cHadron < Output->length(); cHadron++)
{
SumMom += Output->at(cHadron)->Get4Momentum();
SumMass += Output->at(cHadron)->GetDefinition()->GetPDGMass();
}
if (SumMass > TotalCollisionMass) return FALSE;
SumMass = SumMom.m2();
if (SumMass < 0) return FALSE;
SumMass = sqrt(SumMass);
// Compute c.m.s. hadron velocity and boost KTV to hadron c.m.s.
G4ThreeVector Beta = -SumMom.boostVector();
Output->Boost(Beta);
// Scale total c.m.s. hadron energy (hadron system mass).
// It should be equal interaction mass
G4double Scale = 1;
for(G4int cAttempt = 0; cAttempt < nAttemptScale; cAttempt++)
{
G4double Sum = 0;
for(cHadron = 0; cHadron < Output->length(); cHadron++)
{
G4LorentzVector HadronMom = Output->at(cHadron)->Get4Momentum();
HadronMom.setVect(Scale*HadronMom.vect());
G4double E = sqrt(HadronMom.vect().mag2() + sqr(Output->at(cHadron)->GetDefinition()->GetPDGMass()));
HadronMom.setE(E);
Output->at(cHadron)->Set4Momentum(HadronMom);
Sum += E;
}
Scale = TotalCollisionMass/Sum;
if (Scale - 1 <= ErrLimit) goto LTRUE;
}
G4cout << "G4VPartonStringModel::EnergyAndMomentumCorrector"<<G4endl;
G4cout << " Increase number of attempts or increase ERRLIMIT"<<G4endl;
LTRUE:
// Compute c.m.s. interaction velocity and KTV back boost
Beta = TotalCollisionMom.boostVector();
Output->Boost(Beta);
return TRUE;
}
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4LundStringFragmentation.cc,v 1.2 1999/12/15 14:52:47 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4QGSMFragmentation.cc,v 1.4 1999/12/15 14:52:47 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VKinkyStringDecay.cc,v 1.3 1999/12/15 14:52:48 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
// Maxim Komogorov
//
// -----------------------------------------------------------------------------
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VLongitudinalStringDecay.cc,v 1.6 1999/12/15 14:52:48 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
// Maxim Komogorov
//
// -----------------------------------------------------------------------------