Import Geant4 6.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:41:53 +02:00
parent 4aea781e80
commit 96686e0c8f
6560 changed files with 153347 additions and 238155 deletions
@@ -0,0 +1,61 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4ASCCrossSection_h
#define G4ASCCrossSection_h
#include "globals.hh"
#include "G4VAnnihilationCrossSection.hh"
class G4ASCCrossSection : public G4VAnnihilationCrossSection
{
public:
G4ASCCrossSection(G4int, G4int, G4double, G4double, G4double, G4double);
G4bool InCharge(G4int aCode, G4int bCode);
G4double GetXsec(G4double s);
private:
G4int theCode1;
G4int theCode2;
G4double theX;
G4double theY;
G4double theEta;
G4double theEps;
};
inline G4bool G4ASCCrossSection::
InCharge(G4int aCode, G4int bCode)
{
G4bool result;
result = (aCode==theCode1&&bCode==theCode2)||(aCode==theCode2&&bCode==theCode1);
return result;
}
inline G4double G4ASCCrossSection::
GetXsec(G4double s)
{
G4double result = theX*pow(s, theEps) + theY*pow(s, -theEta);
return result;
}
#endif
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4AnnihilationCrossSection_h
#define G4AnnihilationCrossSection_h
#include "globals.hh"
#include <vector>
#include "G4VAnnihilationCrossSection.hh"
class G4AnnihilationCrossSection
{
public:
G4AnnihilationCrossSection();
G4double GetCrossSection(int aCode, int bCode, G4double s);
private:
std::vector<G4VAnnihilationCrossSection*> theDataSets;
};
inline G4double G4AnnihilationCrossSection::GetCrossSection(G4int aCode, G4int bCode, G4double s)
{
G4double result = 0.;
typedef std::vector<G4VAnnihilationCrossSection*>::iterator iter;
iter i;
for(i=theDataSets.begin(); i!=theDataSets.end(); i++)
{
if((*i)->InCharge(aCode, bCode))
{
result = (*i)->GetXsec(s);
break;
}
}
return result;
}
#endif
@@ -0,0 +1,47 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4BaryonSplitter_h
#define G4BaryonSplitter_h
// HPW Feb1999 based on prototype, needs urgent clean-up of data structures.
// Also needs clean-up of interfaces.
// @@@@@@@@@@@@@@@@@
// clean-up of data structures
#include "globals.hh"
#include "G4SPBaryonTable.hh"
class G4BaryonSplitter
{
public:
G4BaryonSplitter();
G4bool SplitBarion(G4int PDGCode, G4int* q_or_qqbar, G4int* qbar_or_qq);
G4bool FindDiquark(G4int PDGCode, G4int Quark, G4int* Diquark);
const G4SPBaryon & GetSPBaryon(G4int PDGCode);
private:
G4SPBaryonTable theBaryons;
};
#endif
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4DiffractiveStringBuilder_h
#define G4DiffractiveStringBuilder_h 1
#include "globals.hh"
#include "G4KineticTrackVector.hh"
#include "G4ExcitedStringVector.hh"
#include "G4PartonPair.hh"
class G4DiffractiveStringBuilder
{
public:
G4DiffractiveStringBuilder();
G4DiffractiveStringBuilder(const G4DiffractiveStringBuilder &right);
~G4DiffractiveStringBuilder();
G4int operator==(const G4DiffractiveStringBuilder &right) const;
G4int operator!=(const G4DiffractiveStringBuilder &right) const;
G4ExcitedString* BuildString(G4PartonPair* aParton);
private:
};
inline G4int G4DiffractiveStringBuilder::operator==(const G4DiffractiveStringBuilder &) const
{
return 1;
}
inline G4int G4DiffractiveStringBuilder::operator!=(const G4DiffractiveStringBuilder &) const
{
return 0;
}
#endif
@@ -0,0 +1,44 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4GammaAnnCrossSection_h
#define G4GammaAnnCrossSection_h
#include "globals.hh"
#include <vector>
#include "G4VAnnihilationCrossSection.hh"
#include "G4ASCCrossSection.hh"
class G4GammaAnnCrossSection : public G4VAnnihilationCrossSection
{
public:
G4GammaAnnCrossSection();
G4bool InCharge(G4int aCode, G4int bCode);
G4double GetXsec(G4double s);
virtual ~G4GammaAnnCrossSection(){}
private:
std::vector<G4ASCCrossSection*> theGammaNucXSections;
};
#endif
@@ -0,0 +1,46 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4GammaParticipants_h
#define G4GammaParticipants_h 1
// An implementation of a parton string model, re-using
// the most parts of quark gluon string model. The calculation
// of collision probabilities was implemented as a transparent
// nucleus approximation. This implies that exactely ont nucleon
// in the nucleus participates in the reaction.
#include "G4QGSParticipants.hh"
class G4GammaParticipants : public G4QGSParticipants
{
public:
virtual ~G4GammaParticipants(){}
private:
virtual G4VSplitableHadron* SelectInteractions(const G4ReactionProduct &thePrimary);
};
#endif
@@ -0,0 +1,124 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4HeavyIonParticipants_h
#define G4HeavyIonParticipants_h 1
#include "Randomize.hh"
#include "G4VParticipants.hh"
#include "G4Nucleon.hh"
#include "G4InteractionContent.hh"
#include "G4PomeronCrossSection.hh"
#include "G4DiffractiveExcitation.hh"
#include "G4SingleDiffractiveExcitation.hh"
#include "G4PartonPair.hh"
#include "G4QGSMSplitableHadron.hh"
G4int G4IonParticipants_NPart = 0;
G4int G4IonParticipants_NPro = 0;
class G4HeavyIonParticipants : public G4VParticipants
{
enum { SOFT, HARD, DIFFRACTIVE };
public:
G4HeavyIonParticipants();
G4HeavyIonParticipants(const G4HeavyIonParticipants &right);
const G4HeavyIonParticipants & operator=(const G4HeavyIonParticipants &right);
~G4HeavyIonParticipants();
int operator==(const G4HeavyIonParticipants &right) const;
int operator!=(const G4HeavyIonParticipants &right) const;
G4PartonPair* GetNextPartonPair();
void BuildInteractions(const G4ReactionProduct &thePrimary);
void StartPartonPairLoop();
virtual void DoLorentzBoost(Hep3Vector aBoost)
{
if(theNucleus) theNucleus->DoLorentzBoost(aBoost);
theBoost = aBoost;
}
private:
void SplitHadrons();
void PerformSoftCollisions();
void PerformDiffractiveCollisions();
private:
std::vector<G4InteractionContent*> theInteractions;
struct DeleteInteractionContent {void operator()(G4InteractionContent*aC){delete aC;}};
std::vector<G4VSplitableHadron*> theTargets;
std::vector<G4VSplitableHadron*> theProjectiles;
struct DeleteSplitableHadron{void operator()(G4VSplitableHadron*aS){delete aS;}};
std::vector<G4PartonPair*> thePartonPairs;
struct DeletePartonPair{void operator()(G4PartonPair*aP){delete aP;}};
G4Fancy3DNucleus theIncoming;
G4SingleDiffractiveExcitation theSingleDiffExcitation;
G4DiffractiveExcitation theDiffExcitaton;
G4int ModelMode;
G4bool IsSingleDiffractive();
G4ThreeVector theBoost;
private:
// model parameters HPW
const G4int nCutMax;
const G4double ThersholdParameter;
const G4double QGSMThershold;
const G4double theNucleonRadius;
G4PomeronCrossSection theProtonProbability;
G4PomeronCrossSection theNeutronProbability;
};
inline G4bool G4HeavyIonParticipants::IsSingleDiffractive()
{
G4bool result=false;
if(G4UniformRand()<1.) result = true;
return result;
}
inline void G4HeavyIonParticipants::StartPartonPairLoop()
{
}
inline G4PartonPair* G4HeavyIonParticipants::GetNextPartonPair()
{
if (thePartonPairs.empty()) return 0;
G4PartonPair * result = thePartonPairs.back();
thePartonPairs.pop_back();
return result;
}
inline void G4HeavyIonParticipants::SplitHadrons()
{
unsigned int i;
for(i = 0; i < theInteractions.size(); i++)
{
theInteractions[i]->SplitHadrons();
}
}
#endif
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * 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 *
// * 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: G4InelasticSplitableHadron.hh,v 1.1 2003/10/07 11:26:25 hpw Exp $
// GEANT4 tag $Name: geant4-06-00 $
//
#ifndef G4InelasticSplitableHadron_h
#define G4InelasticSplitableHadron_h 1
#include "G4VSplitableHadron.hh"
class G4InelasticSplitableHadron : public G4VSplitableHadron
{
public:
G4InelasticSplitableHadron(const G4ReactionProduct & aPrimary);
G4InelasticSplitableHadron(const G4Nucleon & aNucleon);
~G4InelasticSplitableHadron();
int operator==(const G4InelasticSplitableHadron &right) const;
int operator!=(const G4InelasticSplitableHadron &right) const;
void SplitUp();
G4Parton * GetNextParton() ;
private:
G4InelasticSplitableHadron();
G4InelasticSplitableHadron(const G4InelasticSplitableHadron &right);
const G4InelasticSplitableHadron & operator=(const G4InelasticSplitableHadron &right);
//implementation
void GetValenceQuarkFlavors(G4int PDGcode, G4int& aEnd, G4int& bEnd);
G4int Diquark(G4int aquark,G4int bquark,G4int Spin) const; // to splitable hadron
private:
G4Parton *Parton[2];
G4int PartonIndex;
G4double udspin1; // 1./6.
G4double uuspin1; // 1./3.
G4double udspin0; // 1./2.
};
#endif
@@ -0,0 +1,42 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4MesonSplitter_h
#define G4MesonSplitter_h
// HPW Feb 1999, based on Annihilator prototype.
// Simple class to split a meson, only one trivial method at the moment
// liable for improvement. @@@
// interfaces need change. @@@
#include "globals.hh"
class G4MesonSplitter
{
public:
G4bool SplitMeson(G4int PDGcode, G4int* aEnd, G4int* bEnd);
private:
};
#endif
@@ -0,0 +1,111 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4PartonPair_h
#define G4PartonPair_h 1
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4LorentzVector.hh"
#include "G4Parton.hh"
#include "G4PartonVector.hh"
class G4PartonPair
{
public:
enum {
DIFFRACTIVE = 1,
SOFT = 2,
HARD = 3
};
enum
{
PROJECTILE = 1,
TARGET = -1
};
public:
G4PartonPair(G4Parton* P1, G4Parton* P2, G4int Type, G4int Direction);
G4PartonPair(const G4PartonPair &right);
~G4PartonPair();
int operator==(const G4PartonPair &right) const;
int operator!=(const G4PartonPair &right) const;
void SetPartons(G4Parton* P1, G4Parton* P2);
void SetCollisionType(G4int Type);
G4int GetCollisionType();
G4Parton* GetParton1(void);
G4Parton* GetParton2(void);
G4int GetDirection();
private:
G4Parton* Parton1;
G4Parton* Parton2;
G4int CollisionType;
G4int Direction;
};
inline int G4PartonPair::operator==(const G4PartonPair &right) const
{
return (CollisionType == right.CollisionType &&
*Parton1 == *right.Parton1 &&
*Parton2 == *right.Parton2)? 1: 0;
}
inline int G4PartonPair::operator!=(const G4PartonPair &right) const
{
return (CollisionType == right.CollisionType &&
*Parton1 == *right.Parton1 &&
*Parton2 == *right.Parton2)? 0: 1;
}
inline G4Parton* G4PartonPair::GetParton1(void)
{
return Parton1;
}
inline G4Parton* G4PartonPair::GetParton2(void)
{
return Parton2;
}
inline void G4PartonPair::SetCollisionType(G4int Type)
{
CollisionType = Type;
}
inline G4int G4PartonPair::GetCollisionType()
{
return CollisionType;
}
inline G4int G4PartonPair::GetDirection()
{
return Direction;
}
#endif
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * 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 *
// * 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: G4PartonStringAnnihilator.hh,v 1.1 2003/10/07 11:26:26 hpw Exp $
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
//
// History: first implementation, Maxim Komogorov, 9-Oct-1998
// -----------------------------------------------------------------------------
#ifndef G4PartonStringAnnihilator_h
#define G4PartonStringAnnihilator_h 1
#include "G4KineticTrack.hh"
#include "G4ExcitedString.hh"
#include "G4MesonSplitter.hh"
#include "G4BaryonSplitter.hh"
class G4PartonStringAnnihilator
{
public:
G4PartonStringAnnihilator();
public:
G4double GetCrossSection(G4KineticTrack& aTarget, G4KineticTrack& aProjectile);
G4ExcitedString* GetString(G4KineticTrack& Target, G4KineticTrack& Projectile);
G4bool SplitUpBarion(G4int Encoding, G4int* q_or_qqbar, G4int* qbar_or_qq); //!
G4bool isMeson(G4int Encoding);
G4bool isBarion(G4int Encoding);
G4bool isAntiParticle(G4int Encoding);
private:
G4bool GetStringEnds(G4int Projectile, G4int Target, G4int* Left, G4int* Right);
G4bool FindDiquark(G4int Encoding, G4int Quark, G4int* Diquark);
G4bool FindQuark(G4int Encoding, G4int Diquark, G4int* Quark);
private:
G4double widthOfPtSquare;
G4MesonSplitter theMesonSplitter;
G4BaryonSplitter theBaryonSplitter;
};
// *************************************************************************************************
#endif
@@ -0,0 +1,50 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4QGSMParameters_h
#define G4QGSMParameters_h 1
#include "globals.hh"
class G4QGSMParameters
{
public:
G4QGSMParameters();
G4QGSMParameters(const G4QGSMParameters &right);
~G4QGSMParameters();
int operator==(const G4QGSMParameters &right) const;
int operator!=(const G4QGSMParameters &right) const;
private:
};
inline int G4QGSMParameters::operator==(const G4QGSMParameters &right) const
{
return 1;
}
inline int G4QGSMParameters::operator!=(const G4QGSMParameters &right) const
{
return 0;
}
#endif
@@ -0,0 +1,105 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4QGSMSplitableHadron_h
#define G4QGSMSplitableHadron_h 1
#include "G4VSplitableHadron.hh"
#include "G4PartonVector.hh"
#include "G4MesonSplitter.hh"
#include "G4BaryonSplitter.hh"
#include "Randomize.hh"
#include <deque>
// based on prototype by Maxim Komogorov
// Splitting into methods, and centralizing of model parameters HPW Feb 1999
// continued clean-up of interfaces and algorithms HPW 1999.
// Redesign of data structures and algorithms HPW Feb 1999
class G4QGSMSplitableHadron : public G4VSplitableHadron
{
public:
G4QGSMSplitableHadron();
G4QGSMSplitableHadron(const G4ReactionProduct & aPrimary);
G4QGSMSplitableHadron(const G4ReactionProduct & aPrimary, G4bool Direction);
G4QGSMSplitableHadron(const G4Nucleon & aNucleon);
G4QGSMSplitableHadron(const G4Nucleon & aNucleon, G4bool Direction);
virtual ~G4QGSMSplitableHadron();
const G4QGSMSplitableHadron & operator=(const G4QGSMSplitableHadron &right);
virtual void SplitUp();
virtual G4Parton * GetNextParton();
virtual G4Parton * GetNextAntiParton();
private:
void InitParameters();
void DiffractiveSplitUp();
void SoftSplitUp();
G4ThreeVector GaussianPt(G4double widthSquare, G4double maxPtSquare);
void GetValenceQuarkFlavors(const G4ParticleDefinition * aPart,
G4Parton *& Parton1, G4Parton *& Parton2);
G4Parton * BuildSeaQuark(G4bool isAntiQuark, G4int aPDGCode, G4int nSeaPair);
G4double SampleX(G4double anXmin, G4int nSea, G4int theTotalSea, G4double aBeta);
private:
// aggregated data
G4bool Direction; // FALSE is target. - candidate for more detailed design. @@@@ HPW
std::deque<G4Parton *> Color;
std::deque<G4Parton *> AntiColor;
private:
// associated classes
G4MesonSplitter theMesonSplitter;
G4BaryonSplitter theBaryonSplitter;
private:
// model parameters
double alpha;
double beta;
double theMinPz;
double StrangeSuppress;
double sigmaPt;
double widthOfPtSquare;
};
inline G4Parton* G4QGSMSplitableHadron::GetNextParton()
{
if(Color.size()==0) return 0;
G4Parton * result = Color.back();
Color.pop_back();
return result;
}
inline G4Parton* G4QGSMSplitableHadron::GetNextAntiParton()
{
if(AntiColor.size() == 0) return 0;
G4Parton * result = AntiColor.front();
AntiColor.pop_front();
return result;
}
#endif
@@ -0,0 +1,85 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4QGSModel_h
#define G4QGSModel_h 1
// Class Description
// Model for hadron (p,n,pi,K) nuclear reactions in geant4. IT implements
// A. Kaydalov's quark gluon string model.
// To be used in your physics list, in case you need this kind of physics.
// Class Description - End
#include "G4ExcitedStringVector.hh"
#include "G4KineticTrackVector.hh"
#include "G4PomeronCrossSection.hh"
#include "G4ParticleTable.hh"
#include "G4Fancy3DNucleus.hh"
#include "G4VPartonStringModel.hh"
#include "G4QGSParticipants.hh"
#include "G4DiffractiveStringBuilder.hh"
#include "G4SoftStringBuilder.hh"
#include "G4PartonPair.hh"
//***********************************************************************************************
//*****************************************************************************************
template<class ParticipantType>
class G4QGSModel : public G4VPartonStringModel
{
// Constructors
public:
G4QGSModel();
G4QGSModel(const G4QGSModel &right);
virtual ~G4QGSModel();
// Method
public:
virtual G4V3DNucleus* GetWoundedNucleus() const;
public:
virtual void Init(const G4Nucleus& Nucleus, const G4DynamicParticle& Projectile);
virtual G4ExcitedStringVector * GetStrings();
private:
ParticipantType theParticipants;
G4DiffractiveStringBuilder theDiffractiveStringBuilder;
G4SoftStringBuilder theSoftStringBuilder;
private:
// cash theCurrentVelocity for lorentztrafo HPW
G4ThreeVector theCurrentVelocity;
};
//-------------------------------------------------------------------------------------------
//*****************************************************************************************
#include "G4QGSModel.icc"
#endif
@@ -0,0 +1,122 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#include <stdlib.h>
//****************************************************************************************************************
template<class ParticipantType>
G4QGSModel<ParticipantType>::G4QGSModel()
{
G4VPartonStringModel::SetThisPointer(this);
}
template<class ParticipantType>
G4QGSModel<ParticipantType>::G4QGSModel(const G4QGSModel &right)
{
G4VPartonStringModel::SetThisPointer(this);
}
template<class ParticipantType>
G4QGSModel<ParticipantType>::~G4QGSModel()
{
}
template<class ParticipantType>
void G4QGSModel<ParticipantType>::Init(const G4Nucleus & aNucleus, const G4DynamicParticle & aProjectile)
{
// clean-up and consistency with design, HPW Feb 1999
theParticipants.Init(aNucleus.GetN(),aNucleus.GetZ());
theCurrentVelocity.setX(0);
theCurrentVelocity.setY(0);
// HPW Feb 1999
// this is an approximation, neglecting the motion of nucleons in the nucleus & p,n mass differences. @@@
// G4double vz_old = aProjectile.Get4Momentum().pz()/
// (aProjectile.Get4Momentum().e() + G4Proton::Proton()->GetPDGMass());
G4double nCons = 1;
if(abs(aProjectile.GetDefinition()->GetBaryonNumber()) !=0)
{
nCons = abs(aProjectile.GetDefinition()->GetBaryonNumber());
}
G4double pz_per_projectile = aProjectile.Get4Momentum().pz()/nCons;
// G4double e_per_projectile = aProjectile.Get4Momentum().vect()*aProjectile.Get4Momentum().vect();
// e_per_projectile /=nCons*nCons;
// e_per_projectile += G4Proton::Proton()->GetPDGMass()*G4Proton::Proton()->GetPDGMass();
G4double e_per_projectile = aProjectile.Get4Momentum()*aProjectile.Get4Momentum();
e_per_projectile += aProjectile.Get4Momentum().vect()*aProjectile.Get4Momentum().vect();
e_per_projectile /=nCons*nCons;
e_per_projectile = sqrt(e_per_projectile);
e_per_projectile += G4Proton::Proton()->GetPDGMass();
G4double vz = pz_per_projectile/e_per_projectile;
//--DEBUG-- cout << "IncomingMomentum "<<aProjectile.Get4Momentum()<<G4endl;
theCurrentVelocity.setZ(vz);
theParticipants.DoLorentzBoost(-theCurrentVelocity);
G4LorentzVector Mom = aProjectile.Get4Momentum();
Mom.boost(-theCurrentVelocity);
G4ReactionProduct theProjectile;
theProjectile.SetDefinition(aProjectile.GetDefinition());
theProjectile.SetTotalEnergy(Mom.e());
theProjectile.SetMomentum(Mom.vect());
//--DEBUG-- cout << "PreInteractionMomentum "<<Mom<<G4endl;
theParticipants.BuildInteractions(theProjectile);
theParticipants.GetWoundedNucleus()->DoLorentzBoost(theCurrentVelocity);
}
template<class ParticipantType>
G4ExcitedStringVector * G4QGSModel<ParticipantType>::GetStrings()
{
// clean-up and consistancy with design, HPW Feb 1999
// also fixing a memory leak, removing unnecessary caching, and
// streamlining of logic
G4PartonPair* aPair;
G4ExcitedStringVector* theStrings = new G4ExcitedStringVector;
G4ExcitedString * aString;
while(aPair = theParticipants.GetNextPartonPair())
{
if (aPair->GetCollisionType() == G4PartonPair::DIFFRACTIVE)
{
aString = theDiffractiveStringBuilder.BuildString(aPair);
// G4cout << "diffractive "<<aString->Get4Momentum()<<endl;
}
else
{
aString = theSoftStringBuilder.BuildString(aPair);
// G4cout << "soft "<<aString->Get4Momentum()<<endl;
}
aString->Boost(theCurrentVelocity);
theStrings->push_back(aString);
delete aPair;
}
//--DEBUG-- cout << G4endl;
// for(G4int i=0; i<theStrings->size(); i++)
// {
// cout << "String = "<<theStrings->operator[](i)->Get4Momentum()<<G4endl;
// }
return theStrings;
}
template<class ParticipantType>
G4V3DNucleus* G4QGSModel<ParticipantType>::GetWoundedNucleus() const
{
return theParticipants.GetWoundedNucleus();
}
//*********************************************************************************************************************
@@ -0,0 +1,120 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4QGSParticipants_h
#define G4QGSParticipants_h 1
#include "Randomize.hh"
#include "G4VParticipants.hh"
#include "G4Nucleon.hh"
#include "G4InteractionContent.hh"
#include "G4PomeronCrossSection.hh"
#include "G4DiffractiveExcitation.hh"
#include "G4SingleDiffractiveExcitation.hh"
#include "G4PartonPair.hh"
#include "G4QGSMSplitableHadron.hh"
class G4QGSParticipants : public G4VParticipants
{
public:
G4QGSParticipants();
G4QGSParticipants(const G4QGSParticipants &right);
const G4QGSParticipants & operator=(const G4QGSParticipants &right);
virtual ~G4QGSParticipants();
int operator==(const G4QGSParticipants &right) const;
int operator!=(const G4QGSParticipants &right) const;
virtual void DoLorentzBoost(Hep3Vector aBoost)
{
if(theNucleus) theNucleus->DoLorentzBoost(aBoost);
theBoost = aBoost;
}
G4PartonPair* GetNextPartonPair();
void BuildInteractions(const G4ReactionProduct &thePrimary);
void StartPartonPairLoop();
protected:
virtual G4VSplitableHadron* SelectInteractions(const G4ReactionProduct &thePrimary);
void SplitHadrons();
void PerformSoftCollisions();
void PerformDiffractiveCollisions();
protected:
struct DeleteInteractionContent {void operator()(G4InteractionContent*aC){delete aC;}};
std::vector<G4InteractionContent*> theInteractions;
struct DeleteSplitableHadron{void operator()(G4VSplitableHadron*aS){delete aS;}};
std::vector<G4VSplitableHadron*> theTargets;
struct DeletePartonPair{void operator()(G4PartonPair*aP){delete aP;}};
std::vector<G4PartonPair*> thePartonPairs;
G4SingleDiffractiveExcitation theSingleDiffExcitation;
G4DiffractiveExcitation theDiffExcitaton;
G4int ModelMode;
G4bool IsSingleDiffractive();
G4ThreeVector theBoost;
protected:
// model parameters HPW
enum { SOFT, DIFFRACTIVE };
const G4int nCutMax;
const G4double ThersholdParameter;
const G4double QGSMThershold;
const G4double theNucleonRadius;
};
inline G4bool G4QGSParticipants::IsSingleDiffractive()
{
G4bool result=false;
if(G4UniformRand()<1.) result = true;
return result;
}
inline void G4QGSParticipants::StartPartonPairLoop()
{
}
inline G4PartonPair* G4QGSParticipants::GetNextPartonPair()
{
if (thePartonPairs.empty()) return 0;
G4PartonPair * result = thePartonPairs.back();
thePartonPairs.pop_back();
return result;
}
inline void G4QGSParticipants::SplitHadrons()
{
unsigned int i;
for(i = 0; i < theInteractions.size(); i++)
{
theInteractions[i]->SplitHadrons();
}
}
#endif
@@ -0,0 +1,99 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4SPBaryon_h
#define G4SPBaryon_h
#include "globals.hh"
#include "G4Proton.hh"
#include "G4Neutron.hh"
#include "G4SigmaPlus.hh"
#include "G4SigmaZero.hh"
#include "G4SigmaMinus.hh"
#include "G4XiMinus.hh"
#include "G4XiZero.hh"
#include "G4Lambda.hh"
#include "G4OmegaMinus.hh"
#include "G4AntiProton.hh"
#include "G4AntiNeutron.hh"
#include "G4AntiSigmaPlus.hh"
#include "G4AntiSigmaZero.hh"
#include "G4AntiSigmaMinus.hh"
#include "G4AntiXiMinus.hh"
#include "G4AntiXiZero.hh"
#include "G4AntiLambda.hh"
#include "G4AntiOmegaMinus.hh"
#include "G4ParticleDefinition.hh"
#include "G4SPPartonInfo.hh"
#include <vector>
#include "globals.hh"
class G4SPBaryon
{
public:
G4SPBaryon(G4Proton * aProton);
G4SPBaryon(G4Neutron * aNeutron);
G4SPBaryon(G4Lambda * aLambda);
G4SPBaryon(G4SigmaPlus * aSigmaPlus);
G4SPBaryon(G4SigmaZero * aSigmaZero);
G4SPBaryon(G4SigmaMinus * aSigmaMinus);
G4SPBaryon(G4XiMinus * aXiMinus);
G4SPBaryon(G4XiZero * aXiZero);
G4SPBaryon(G4OmegaMinus * anOmegaMinus);
G4SPBaryon(G4AntiProton * aAntiProton);
G4SPBaryon(G4AntiNeutron * aAntiNeutron);
G4SPBaryon(G4AntiLambda * aAntiLambda);
G4SPBaryon(G4AntiSigmaPlus * aAntiSigmaPlus);
G4SPBaryon(G4AntiSigmaZero * aAntiSigmaZero);
G4SPBaryon(G4AntiSigmaMinus * aAntiSigmaMinus);
G4SPBaryon(G4AntiXiMinus * aAntiXiMinus);
G4SPBaryon(G4AntiXiZero * aAntiXiZero);
G4SPBaryon(G4AntiOmegaMinus * anAntiOmegaMinus);
G4SPBaryon(G4ParticleDefinition * aDefinition);
~G4SPBaryon()
{
for(unsigned int i=0;i<thePartonInfo.size(); i++) delete thePartonInfo[i];
}
G4bool operator == ( const G4SPBaryon & aBaryon) const
{return this == &aBaryon; }
G4ParticleDefinition * GetDefinition() {return theDefinition;}
void SampleQuarkAndDiquark(G4int & quark, G4int & diQuark) const;
void FindDiquark(G4int quark, G4int & diQuark) const;
G4int FindQuark(G4int diQuark) const;
G4double GetProbability(G4int diQuark) const;
G4int MatchDiQuarkAndGetQuark(const G4SPBaryon & aBaryon, G4int & aDiQuark) const;
private:
G4ParticleDefinition * theDefinition;
std::vector<G4SPPartonInfo *> thePartonInfo;
};
#endif
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4SPBaryonTable_h
#define G4SPBaryonTable_h
#include <vector>
#include "G4SPBaryon.hh"
class G4SPBaryonTable
{
public:
struct DeleteSPBaryon{void operator()(G4SPBaryon* aS){delete aS;} };
~G4SPBaryonTable() {std::for_each(theBaryons.begin(), theBaryons.end(), G4SPBaryonTable::DeleteSPBaryon());}
void insert(G4SPBaryon * aBaryon) { theBaryons.push_back(aBaryon);}
G4double length() {return theBaryons.size();}
const G4SPBaryon * GetBaryon(G4ParticleDefinition * aDefinition);
private:
std::vector<G4SPBaryon *> theBaryons;
};
inline const G4SPBaryon * G4SPBaryonTable::
GetBaryon(G4ParticleDefinition * aDefinition)
{
G4SPBaryon * result = 0;
for(unsigned int i=0; i<theBaryons.size(); i++)
{
if(theBaryons[i]->GetDefinition()==aDefinition)
{
result = theBaryons[i];
break;
}
}
return result;
}
#endif
@@ -0,0 +1,42 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4SPPartonInfo_h
#define G4SPPartonInfo_h
class G4SPPartonInfo
{
public:
G4SPPartonInfo(G4int diq, G4int q, G4double prob)
{ diQuarkPDGCode = diq; quarkPDGCode = q; probability = prob; }
G4int GetQuark() const {return quarkPDGCode;}
G4int GetDiQuark() const {return diQuarkPDGCode;}
G4double GetProbability() const {return probability;}
G4bool operator == (const G4SPPartonInfo & aInfo) const
{return this == &aInfo;}
private:
G4int quarkPDGCode;
G4int diQuarkPDGCode;
G4double probability;
};
#endif
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4SoftStringBuilder_h
#define G4SoftStringBuilder_h 1
#include "globals.hh"
#include "G4KineticTrackVector.hh"
#include "G4ExcitedStringVector.hh"
#include "G4PartonPair.hh"
class G4SoftStringBuilder
{
public:
G4SoftStringBuilder();
G4SoftStringBuilder(const G4SoftStringBuilder &right);
~G4SoftStringBuilder();
G4int operator==(const G4SoftStringBuilder &right) const;
G4int operator!=(const G4SoftStringBuilder &right) const;
G4ExcitedString* BuildString(G4PartonPair * aPair);
private:
};
inline G4int G4SoftStringBuilder::operator==(const G4SoftStringBuilder &) const
{
return 1;
}
inline G4int G4SoftStringBuilder::operator!=(const G4SoftStringBuilder &) const
{
return 0;
}
#endif
@@ -0,0 +1,35 @@
//
// ********************************************************************
// * 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 *
// * 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. *
// ********************************************************************
//
#ifndef G4VAnnihilationCrossSection_h
#define G4VAnnihilationCrossSection_h
#include "globals.hh"
class G4VAnnihilationCrossSection
{
public:
virtual G4bool InCharge(G4int aCode, G4int bCode) = 0;
virtual G4double GetXsec(G4double s) = 0;
};
#endif