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
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4EventGenerator.hh,v 1.2 1999/12/15 14:52:45 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G4EventGenerator_h
#define G4EventGenerator_h 1
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4InteractionCode.hh,v 1.2 1999/12/15 14:52:45 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G4InteractionCode_h
#define G4InteractionCode_h 1
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4InteractionContent.hh,v 1.2 1999/12/15 14:52:45 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4InteractionContent.hh,v 1.3 2000/09/18 07:40:44 hpw Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G4InteractionContent_h
@@ -52,8 +52,8 @@ class G4InteractionContent
void SplitHadrons();
private:
G4InteractionContent();
public:
G4InteractionContent(){}
G4InteractionContent(const G4InteractionContent &right);
const G4InteractionContent & operator=(const G4InteractionContent &right);
@@ -8,7 +8,7 @@
// and all its terms.
//
// $Id: G4PomeronCrossSection.hh,v 1.3 1999/12/15 14:52:45 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4Proton.hh"
#include "G4Neutron.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4StringModel.hh,v 1.3 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G4StringModel_h
#define G4StringModel_h 1
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VParticipants.hh,v 1.2 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G4VParticipants_h
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VPartonStringModel.hh,v 1.3 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G4VPartonStringModel_h
#define G4VPartonStringModel_h 1
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VSplitableHadron.hh,v 1.3 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G4VSplitableHadron_h
@@ -5,14 +5,14 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VStringFragmentation.hh,v 1.2 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4VStringFragmentation.hh,v 1.3 2000/08/02 08:13:05 hpw Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G4VStringFragmentation_h
#define G4VStringFragmentation_h 1
#include "G4ExcitedString.hh"
//GF#include "G4ReactionProductVector.hh"
#include "G4ExcitedStringVector.hh"
class G4KineticTrackVector;
class G4VStringFragmentation
@@ -28,8 +28,7 @@ class G4VStringFragmentation
int operator!=(const G4VStringFragmentation &right) const;
public:
// virtual G4ReactionProductVector * FragmentString(const G4ExcitedString &theString)=0;
virtual G4KineticTrackVector * FragmentString(const G4ExcitedString &theString)=0;
virtual G4KineticTrackVector * FragmentStrings(const G4ExcitedStringVector * theStrings)=0;
private:
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VertexCode.hh,v 1.2 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#ifndef G4VertexCode_h
#define G4VertexCode_h 1
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4EventGenerator.cc,v 1.2 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
// G4EventGenerator
#include "G4EventGenerator.hh"
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4InteractionContent.cc,v 1.2 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4InteractionContent.cc,v 1.3 2000/09/18 07:40:45 hpw Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -21,7 +21,7 @@
#include "G4InteractionContent.hh"
G4InteractionContent::G4InteractionContent(G4VSplitableHadron *aPrimaryParticipant)
: theNumberOfHard(NULL), theNumberOfSoft(NULL)
: theNumberOfHard(0), theNumberOfSoft(0)
{
theProjectile=aPrimaryParticipant;
}
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4PomeronCrossSection.cc,v 1.3 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
#include "G4PomeronCrossSection.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4StringModel.cc,v 1.2 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
// G4StringModel
#include "G4StringModel.hh"
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VParticipants.cc,v 1.2 1999/12/15 14:52:46 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VPartonStringModel.cc,v 1.6 1999/12/15 17:51:27 gcosmo Exp $
// GEANT4 tag $Name: geant4-02-00 $
// $Id: G4VPartonStringModel.cc,v 1.7 2000/08/02 08:13:35 hpw Exp $
// GEANT4 tag $Name: geant4-03-00 $
//
//// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -18,8 +18,6 @@
// abstract class for all Parton String Models
// ------------------------------------------------------------
// Modified at 8-Oct-1998 by Maxim Komogorov. Method EnergyAndMomentumCorrector was added.
#include "G4VPartonStringModel.hh"
#include "G4ios.hh"
@@ -86,166 +84,17 @@ G4KineticTrackVector * G4VPartonStringModel::Scatter(const G4Nucleus &theNucleus
strings = GetStrings();
}
// G4cout << "Number of strings " << strings->entries() << G4endl << G4endl;
G4KineticTrackVector * theResult = new G4KineticTrackVector;
G4LorentzVector KTsum;
G4bool NeedEnergyCorrector=false;
G4KineticTrackVector * theResult = 0;
for ( G4int astring=0; astring < strings->entries(); astring++)
{
// rotate string to lab frame, models have it aligned to z
strings->at(astring)->LorentzRotate(toLab);
KTsum+= strings->at(astring)->Get4Momentum();
G4KineticTrackVector * generatedKineticTracks = NULL;
// G4cout << " strings["<<astring<<"] Momentum " << strings->at(astring)->Get4Momentum() << G4endl;
// G4cout << " strings["<<astring<<"] Mass " << strings->at(astring)->Get4Momentum().mag() << G4endl;
// G4cout << " strings["<<astring<<"] Position " << strings->at(astring)->GetPosition() << G4endl;
// G4cout << "Parton Left " << strings->at(astring)->GetLeftParton()->Get4Momentum() << G4endl;
// G4cout << " code " << strings->at(astring)->GetLeftParton()->GetPDGcode()<< G4endl;
// G4cout << "Parton Right " << strings->at(astring)->GetRightParton()->Get4Momentum() << G4endl;
// G4cout << " code " << strings->at(astring)->GetRightParton()->GetPDGcode()<< G4endl;
if ( strings->at(astring)->IsExcited() )
{
generatedKineticTracks=stringFragmentationModel->FragmentString(*strings->at(astring));
} else {
generatedKineticTracks = new G4KineticTrackVector;
generatedKineticTracks->insert(strings->at(astring)->GetKineticTrack());
}
// G4cout <<" number of generated tracks : " << generatedKineticTracks->entries() << G4endl;
if (generatedKineticTracks == NULL)
{
G4cout << "G4VPartonStringModel:No KineticTracks produced" << G4endl;
continue;
}
// if ( generatedKineticTracks->entries() == 1 )
// {
// G4cout << " Only one track created, mass "
// << generatedKineticTracks->at(0)->Get4Momentum().mag() << G4endl;
//
// G4cout << " strings["<<astring<<"] Momentum " << strings->at(astring)->Get4Momentum() << G4endl;
// G4cout << " strings["<<astring<<"] Mass " << strings->at(astring)->Get4Momentum().mag() << G4endl;
//
// }
G4LorentzVector KTsum1;
for ( G4int aTrack=0; aTrack<generatedKineticTracks->entries();aTrack++)
{
theResult->insert(generatedKineticTracks->at(aTrack));
KTsum1+= (*generatedKineticTracks)[aTrack]->Get4Momentum();
// G4cout << " Momentum/ Mass " <<
// (*generatedKineticTracks)[aTrack]->Get4Momentum() <<
// " / " << (*generatedKineticTracks)[aTrack]->Get4Momentum().mag()
// << G4endl;
// G4cout << " Position " <<
// (*generatedKineticTracks)[aTrack]->GetPosition()
// << G4endl;
}
// G4cout << " KTsum Momentum " << KTsum << G4endl;
// G4cout << " KTsum Mass " << KTsum.mag() << G4endl;
if ( abs((KTsum1.e()-strings->at(astring)->Get4Momentum().e()) / KTsum1.e()) > perMillion )
{
NeedEnergyCorrector=true;
// G4cout << " strings["<<astring<<"] Momentum " << strings->at(astring)->Get4Momentum() << G4endl;
// G4cout << " strings["<<astring<<"] Mass " << strings->at(astring)->Get4Momentum().mag() << G4endl;
// G4cout <<" number of generated tracks : " << generatedKineticTracks->entries() << G4endl;
// for ( G4int bTrack=0; bTrack<generatedKineticTracks->entries();bTrack++)
// {
// G4cout << " Particle : " <<
// (*generatedKineticTracks)[bTrack]->GetDefinition()->GetParticleName()
// << G4endl;
// G4cout << " Momentum " <<
// (*generatedKineticTracks)[bTrack]->Get4Momentum()
// << G4endl;
// G4cout << " Mass " <<
// (*generatedKineticTracks)[bTrack]->Get4Momentum().mag()
// << G4endl;
// }
//
}
// clean up
delete generatedKineticTracks;
}
if ( NeedEnergyCorrector ) EnergyAndMomentumCorrector(theResult, KTsum);
theResult = stringFragmentationModel->FragmentStrings(strings);
strings->clearAndDestroy();
delete strings;
return theResult;
}
//***********************************************************************************************
// This method was implemented by Maxim Komogorov
// Maxim.Komogorov@cern.ch
// This method was implemented by Maxim Komogorov
// Maxim.Komogorov@cern.ch
G4bool G4VPartonStringModel::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: G4VSplitableHadron.cc,v 1.2 1999/12/15 14:52:47 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
// ------------------------------------------------------------
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4VStringFragmentation.cc,v 1.2 1999/12/15 14:52:47 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
// GEANT4 tag $Name: geant4-03-00 $
//
// G4VStringFragmentation
#include "G4VStringFragmentation.hh"