Import Geant4 4.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:18:25 +02:00
parent 36c080dca6
commit 921d3b1cda
3990 changed files with 185376 additions and 82884 deletions
@@ -14,14 +14,14 @@
// * 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: G4DiffractiveHHScatterer.hh,v 1.2.8.2 2001/06/28 20:19:55 gunter Exp $
// $Id: G4DiffractiveHHScatterer.hh,v 1.4 2001/08/01 17:05:44 hpw Exp $
#ifndef G4DiffractiveHHScatterer_h
#define G4DiffractiveHHScatterer_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: G4DiffractiveSplitableHadron.hh,v 1.3.8.2 2001/06/28 20:19:55 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4DiffractiveSplitableHadron.hh,v 1.5 2001/08/01 17:05:44 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
#ifndef G4DiffractiveSplitableHadron_h
@@ -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: G4FTFModel.hh,v 1.4.6.2 2001/06/28 20:19:55 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4FTFModel.hh,v 1.6 2001/08/01 17:05:44 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// Class Description
// Final state production code for hadron inelastic scattering above 20 GeV
@@ -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: G4FTFParticipants.hh,v 1.3.8.2 2001/06/28 20:19:55 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4FTFParticipants.hh,v 1.7 2001/10/05 16:13:58 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
#ifndef G4FTFParticipants_h
@@ -37,7 +37,7 @@
// ------------------------------------------------------------
#include "G4VParticipants.hh"
#include "g4rw/tpordvec.h"
#include "g4std/vector"
#include "G4Nucleon.hh"
#include "G4V3DNucleus.hh"
#include "G4Fancy3DNucleus.hh"
@@ -64,7 +64,7 @@ class G4FTFParticipants : public G4VParticipants
private:
G4RWTPtrOrderedVector<G4InteractionContent> theInteractions;
G4std::vector<G4InteractionContent *> theInteractions;
G4int currentInteraction;
@@ -80,7 +80,7 @@ void G4FTFParticipants::StartLoop()
inline
G4bool G4FTFParticipants::Next()
{
return ++currentInteraction < theInteractions.entries();
return ++currentInteraction < static_cast<G4int>(theInteractions.size());
}
@@ -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. *
@@ -50,16 +50,16 @@ Scatter(const G4KineticTrack & aTrack, const G4KineticTrack & bTrack)
string = theExcitation->String(& aHadron, true); // Projectile
fragments=theStringFragmentation->FragmentString(*string);
for (G4int aFragment=0; aFragment < fragments->entries(); aFragment++)
for (unsigned int aFragment=0; aFragment < fragments->size(); aFragment++)
{
result->append(fragments->at(aFragment));
result->push_back(fragments->operator[](aFragment));
}
string = theExcitation->String(& bHadron, false); // Target
fragments=theStringFragmentation->FragmentString(*string);
for (G4int bFragment=0; bFragment < fragments->entries(); bFragment++)
for (unsigned int bFragment=0; bFragment < fragments->size(); bFragment++)
{
result->append(fragments->at(bFragment));
result->push_back(fragments->operator[](bFragment));
}
@@ -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: G4DiffractiveSplitableHadron.cc,v 1.2.8.2 2001/06/28 20:19:56 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4DiffractiveSplitableHadron.cc,v 1.7 2001/10/25 16:15:32 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ------------------------------------------------------------
@@ -75,6 +75,8 @@ const G4DiffractiveSplitableHadron & G4DiffractiveSplitableHadron::operator=(con
void G4DiffractiveSplitableHadron::SplitUp()
{
if (IsSplit()) return;
Splitting();
// Split once only...
if (Parton[0] != NULL) return;
@@ -111,7 +113,7 @@ void G4DiffractiveSplitableHadron::ChooseStringEnds(G4int PDGcode,G4int * aEnd,
{
const G4double udspin1= 1./6.;
const G4double uuspin1= 1./3.;
const G4double udspin0= 1./2.;
// const G4double udspin0= 1./2.; //@
G4int absPDGcode=abs(PDGcode);
@@ -160,7 +162,9 @@ void G4DiffractiveSplitableHadron::ChooseStringEnds(G4int PDGcode,G4int * aEnd,
} else
{
*aEnd=j100;
*bEnd= Diquark( j1000, j10, 0);
// Careful, there is no diquark q1=q2, (q1 q2)0,
// possible for Omega-
*bEnd= Diquark( j1000, j10, j1000 != j100 ? 0 : 1);
}
} else
{
@@ -168,7 +172,8 @@ void G4DiffractiveSplitableHadron::ChooseStringEnds(G4int PDGcode,G4int * aEnd,
if ( random < udspin1 )
{
*aEnd=j1000;
*bEnd= Diquark( j100, j10, 0);
// as above, but with charmed barions
*bEnd= Diquark( j100, j10, j100 != j10 ? 0 : 10);
} else if ( random < (udspin1 + uuspin1) )
{
*aEnd= j10;
@@ -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: G4FTFModel.cc,v 1.4.8.2 2001/06/28 20:19:56 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4FTFModel.cc,v 1.9 2001/10/20 10:45:24 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ------------------------------------------------------------
@@ -97,6 +97,8 @@ G4ExcitedStringVector * G4FTFModel::GetStrings()
return theStrings;
}
struct DeleteVSplitableHadron { void operator()(G4VSplitableHadron * aH){delete aH;} };
G4ExcitedStringVector * G4FTFModel::BuildStrings()
{
@@ -106,18 +108,19 @@ G4ExcitedStringVector * G4FTFModel::BuildStrings()
G4ExcitedStringVector * strings;
strings = new G4ExcitedStringVector();
G4RWTPtrOrderedVector<G4VSplitableHadron> primaries;
G4RWTPtrOrderedVector<G4VSplitableHadron> targets;
G4std::vector<G4VSplitableHadron *> primaries;
G4std::vector<G4VSplitableHadron *> targets;
theParticipants.StartLoop(); // restart a loop
while ( theParticipants.Next() )
{
const G4InteractionContent & interaction=theParticipants.GetInteraction();
// do not allow for duplicates ...
if ( ! primaries.contains(interaction.GetProjectile()) )
primaries.insert(interaction.GetProjectile());
if ( ! targets.contains(interaction.GetTarget()) )
targets.insert(interaction.GetTarget());
if ( primaries.end() == G4std::find(primaries.begin(), primaries.end(), interaction.GetProjectile()) )
primaries.push_back(interaction.GetProjectile());
if ( targets.end() == G4std::find(targets.begin(), targets.end(),interaction.GetTarget()) )
targets.push_back(interaction.GetTarget());
}
@@ -125,20 +128,22 @@ G4ExcitedStringVector * G4FTFModel::BuildStrings()
// targets.entries() << G4endl;
G4int ahadron;
for ( ahadron=0; ahadron < primaries.entries() ; ahadron++)
unsigned int ahadron;
for ( ahadron=0; ahadron < primaries.size() ; ahadron++)
{
G4bool isProjectile=true;
strings->insert(theExcitation->String(primaries[ahadron], isProjectile));
strings->push_back(theExcitation->String(primaries[ahadron], isProjectile));
}
for ( ahadron=0; ahadron < targets.entries() ; ahadron++)
for ( ahadron=0; ahadron < targets.size() ; ahadron++)
{
G4bool isProjectile=false;
strings->insert(theExcitation->String(targets[ahadron], isProjectile));
strings->push_back(theExcitation->String(targets[ahadron], isProjectile));
}
primaries.clearAndDestroy();
targets.clearAndDestroy();
G4std::for_each(primaries.begin(), primaries.end(), DeleteVSplitableHadron());
primaries.clear();
G4std::for_each(targets.begin(), targets.end(), DeleteVSplitableHadron());
targets.clear();
return strings;
}
@@ -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: G4FTFParticipants.cc,v 1.3.8.2 2001/06/28 20:19:56 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4FTFParticipants.cc,v 1.6 2001/10/04 20:00:28 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -74,7 +74,8 @@ void G4FTFParticipants::BuildInteractions(const G4ReactionProduct &thePrimary)
StartLoop(); // reset Loop over Interactions
theInteractions.clearAndDestroy();
for(unsigned int i=0; i<theInteractions.size(); i++) delete theInteractions[i];
theInteractions.clear();
// --- cms energy
@@ -101,7 +102,7 @@ void G4FTFParticipants::BuildInteractions(const G4ReactionProduct &thePrimary)
G4bool nucleusNeedsShift = true;
while ( theInteractions.entries() == 0 )
while ( theInteractions.size() == 0 )
{
G4Pair<G4double, G4double> theImpactParameter;
theImpactParameter = theNucleus->ChooseImpactXandY(xyradius);
@@ -112,7 +113,7 @@ void G4FTFParticipants::BuildInteractions(const G4ReactionProduct &thePrimary)
theNucleus->StartLoop();
G4Nucleon * nucleon;
while ( nucleon=theNucleus->GetNextNucleon() )
while ( (nucleon=theNucleus->GetNextNucleon()) )
{
G4double impact2= sqr(impactX - nucleon->GetPosition().x()) +
sqr(impactY - nucleon->GetPosition().y());
@@ -134,7 +135,7 @@ void G4FTFParticipants::BuildInteractions(const G4ReactionProduct &thePrimary)
}
G4InteractionContent * aInteraction = new G4InteractionContent(primarySplitable);
aInteraction->SetTarget(targetSplitable);
theInteractions.insert(aInteraction);
theInteractions.push_back(aInteraction);
}
}