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,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: G4ExcitedStringDecay.hh,v 1.6.8.1 2001/06/28 19:13:45 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4ExcitedStringDecay.hh,v 1.9 2001/10/04 20:00:31 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
#ifndef G4ExcitedStringDecay_h
#define G4ExcitedStringDecay_h 1
@@ -77,17 +77,17 @@ FragmentStrings(const G4ExcitedStringVector * theStrings)
G4LorentzVector KTsum;
G4bool NeedEnergyCorrector=false;
for ( G4int astring=0; astring < theStrings->entries(); astring++)
for ( unsigned int astring=0; astring < theStrings->size(); astring++)
{
KTsum+= theStrings->at(astring)->Get4Momentum();
KTsum+= theStrings->operator[](astring)->Get4Momentum();
G4KineticTrackVector * generatedKineticTracks = NULL;
if ( theStrings->at(astring)->IsExcited() )
if ( theStrings->operator[](astring)->IsExcited() )
{
generatedKineticTracks=FragmentString(*theStrings->at(astring));
generatedKineticTracks=FragmentString(*theStrings->operator[](astring));
} else {
generatedKineticTracks = new G4KineticTrackVector;
generatedKineticTracks->insert(theStrings->at(astring)->GetKineticTrack());
generatedKineticTracks->push_back(theStrings->operator[](astring)->GetKineticTrack());
}
if (generatedKineticTracks == NULL)
@@ -97,14 +97,14 @@ FragmentStrings(const G4ExcitedStringVector * theStrings)
}
G4LorentzVector KTsum1;
for ( G4int aTrack=0; aTrack<generatedKineticTracks->entries();aTrack++)
for ( unsigned int aTrack=0; aTrack<generatedKineticTracks->size();aTrack++)
{
theResult->insert(generatedKineticTracks->at(aTrack));
theResult->push_back(generatedKineticTracks->operator[](aTrack));
KTsum1+= (*generatedKineticTracks)[aTrack]->Get4Momentum();
}
if ( abs((KTsum1.e()-theStrings->at(astring)->Get4Momentum().e()) / KTsum1.e()) > perMillion )
if ( abs((KTsum1.e()-theStrings->operator[](astring)->Get4Momentum().e()) / KTsum1.e()) > perMillion )
{
NeedEnergyCorrector=true;
}
@@ -0,0 +1,147 @@
//
// ********************************************************************
// * 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: G4FragmentingString.hh,v 1.1 2001/10/09 10:38:32 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
#ifndef G4FragmentingString_h
#define G4FragmentingString_h 1
// ------------------------------------------------------------
// GEANT 4 class header file
//
// ---------------- G4FragmentingString ----------------
// by Gunter Folger, September 2001.
// class for an excited string used in Fragmention
// ------------------------------------------------------------
#include "G4ios.hh"
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4LorentzVector.hh"
#include "G4ParticleDefinition.hh"
class G4ExcitedString;
class G4FragmentingString
{
public:
G4FragmentingString(const G4FragmentingString &right);
G4FragmentingString(const G4ExcitedString &excited);
G4FragmentingString(const G4FragmentingString &old,
G4ParticleDefinition * newdecay,
const G4LorentzVector *momentum);
~G4FragmentingString();
int operator==(const G4FragmentingString &right) const;
int operator!=(const G4FragmentingString &right) const;
G4LorentzVector Get4Momentum() const;
G4ThreeVector StablePt();
G4ThreeVector DecayPt();
G4double LightConePlus();
G4double LightConeMinus();
G4double LightConeDecay();
G4double Mass() const;
G4double Mass2() const;
G4ParticleDefinition* GetLeftParton(void) const;
G4ParticleDefinition* GetRightParton(void) const;
G4ParticleDefinition* GetStableParton() const; // stable at the moment
G4ParticleDefinition* GetDecayParton() const; // currently involved in fragmentation
void SetLeftPartonStable();
void SetRightPartonStable();
G4int GetDecayDirection() const;
G4bool DecayIsQuark();
G4bool StableIsQuark();
G4bool FourQuarkString(void) const;
private:
G4ParticleDefinition *LeftParton, *RightParton;
G4ThreeVector Ptleft,Ptright; // Pt (px,py) for partons (pz ignored!)
G4double Pplus, Pminus; // p-, p+ of string, Plus ass. to Left!
G4ParticleDefinition * theStableParton, * theDecayParton;
enum DecaySide { None, Left, Right };
DecaySide decaying;
};
inline
int G4FragmentingString::operator==(const G4FragmentingString &right) const
{
return this == &right;
}
inline
int G4FragmentingString::operator!=(const G4FragmentingString &right) const
{
return this != &right;
}
inline
G4ParticleDefinition * G4FragmentingString::GetStableParton() const
{
return theStableParton;
}
inline
G4ParticleDefinition * G4FragmentingString::GetDecayParton() const
{
return theDecayParton;
}
inline
G4ParticleDefinition* G4FragmentingString::GetLeftParton(void) const
{
return LeftParton;
}
inline
G4ParticleDefinition* G4FragmentingString::GetRightParton(void) const
{
return RightParton;
}
#endif
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * 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: G4HadronBuilder.hh,v 1.2 2001/10/30 08:33:26 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class header file
//
// History:
// Gunter Folger, August/September 2001
// Create class;
// -----------------------------------------------------------------------------
//
#ifndef G4HadronBuilder_h
#define G4HadronBuilder_h 1
#include "globals.hh"
#include <g4std/vector>
#include "G4ParticleDefinition.hh"
#include "G4ParticleDefinition.hh"
class G4HadronBuilder
{
public:
G4ParticleDefinition * Build(G4ParticleDefinition * black, G4ParticleDefinition * white);
G4ParticleDefinition * BuildLowSpin(G4ParticleDefinition * black, G4ParticleDefinition * white);
G4ParticleDefinition * BuildHighSpin(G4ParticleDefinition * black, G4ParticleDefinition * white);
// ctor
G4HadronBuilder(G4double mesonMix, G4double barionMix,
G4std::vector<double> scalarMesonMix,
G4std::vector<double> vectorMesonMix);
private:
G4HadronBuilder(); // no default ctor
enum Spin { SpinZero=1, SpinHalf=2, SpinOne=3, SpinThreeHalf=4 };
G4ParticleDefinition * Meson(G4ParticleDefinition * black, G4ParticleDefinition * white, Spin spin);
G4ParticleDefinition * Barion(G4ParticleDefinition * black, G4ParticleDefinition * white, Spin spin);
G4double mesonSpinMix;
G4double barionSpinMix;
G4std::vector<double> scalarMesonMixings;
G4std::vector<double> vectorMesonMixings;
};
#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: G4LundStringFragmentation.hh,v 1.2.8.2 2001/06/28 20:20:00 gunter Exp $
// GEANT4 tag $Name: $ Maxim Komogorov
// $Id: G4LundStringFragmentation.hh,v 1.5 2001/10/04 20:00:31 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $ Maxim Komogorov
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -43,7 +43,7 @@ public:
G4LundStringFragmentation();
// G4LundStringFragmentation(G4double sigmaPt);
G4LundStringFragmentation(const G4LundStringFragmentation &right);
~G4LundStringFragmentation();
virtual ~G4LundStringFragmentation();
public:
const G4LundStringFragmentation & operator=(const G4LundStringFragmentation &right);
@@ -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: G4QGSMFragmentation.hh,v 1.3.8.2 2001/06/28 20:20:00 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4QGSMFragmentation.hh,v 1.5 2001/08/01 17:09:07 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -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 *
// * 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: G4VKinkyStringDecay.hh,v 1.5 2001/10/05 16:17:36 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
// Maxim Komogorov
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
//
// History: first implementation, Maxim Komogorov, 10-Oct-1998
// -----------------------------------------------------------------------------
#ifndef G4VKinkyStringDecay_h
#define G4VKinkyStringDecay_h 1
#include "G4VLongitudinalStringDecay.hh"
//***********************************************************************************************
class G4VKinkyStringDecay
{
// Constructors
public:
G4VKinkyStringDecay(G4VLongitudinalStringDecay* theModal);
virtual ~G4VKinkyStringDecay() {};
//
public:
G4KineticTrackVector* FragmentString(const G4ExcitedString& String);
virtual G4double GetLightConeGluonZ(G4double zmin, G4double zmax);
void SetLongitudinalStringDecay(G4VLongitudinalStringDecay*);
private:
G4VLongitudinalStringDecay* theLongitudinalStringDecay;
};
//*****************************************************************************************
inline void G4VKinkyStringDecay::SetLongitudinalStringDecay(G4VLongitudinalStringDecay* theModal)
{
theLongitudinalStringDecay = theModal;
}
//*****************************************************************************************************
#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: G4VLongitudinalStringDecay.hh,v 1.7.8.2 2001/06/28 20:20:00 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4VLongitudinalStringDecay.hh,v 1.12 2001/10/10 08:23:57 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// Maxim Komogorov
//
// -----------------------------------------------------------------------------
@@ -36,14 +36,16 @@
#include "G4DynamicParticle.hh"
#include "G4KineticTrack.hh"
#include "G4KineticTrackVector.hh"
#include "G4HadronBuilder.hh"
class G4FragmentingString;
//**********************************************************************************************
class G4VLongitudinalStringDecay
{
public:
G4VLongitudinalStringDecay();
~G4VLongitudinalStringDecay();
virtual ~G4VLongitudinalStringDecay();
private:
// G4VLongitudinalStringDecay(const G4VLongitudinalStringDecay &right);
@@ -53,20 +55,7 @@ private:
public:
G4KineticTrackVector* FragmentString(const G4ExcitedString& theString);
G4bool FragmentString(G4KineticTrackVector* aHadrons, const G4ExcitedString* theString);
G4KineticTrackVector* DecayResonans (G4KineticTrackVector* aHadrons);
G4int SampleQuarkFlavor(void);
void SampleQuarkPt(G4double* thePx, G4double* thePy);
G4double GetDiquarkSuppress() {return DiquarkSuppress;};
G4double GetDiquarkBreakProb() {return DiquarkBreakProb;};
G4double GetStrangeSuppress() {return StrangeSuppress;};
G4double GetClusterMass() {return ClusterMass;};
G4int GetClusterLoopInterrupt() {return ClusterLoopInterrupt;};
G4ParticleDefinition* CreateHadron(G4int id1, G4int id2, G4bool theGivenSpin, G4int theSpin);
void Sample4Momentum(G4LorentzVector* Mom, G4double Mass, G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass);
void SetSigmaTransverseMomentum(G4double aQT);
void SetStrangenessSuppression(G4double aValue);
void SetDiquarkSuppression(G4double aValue);
@@ -77,14 +66,24 @@ public:
void SetScalarMesonMixings( G4std::vector<G4double> aVector);
void SetVectorMesonMixings( G4std::vector<G4double> aVector);
// used by G4VKinkyStringDecy..
G4int SampleQuarkFlavor(void);
G4ThreeVector SampleQuarkPt();
private:
G4double GetDiquarkSuppress() {return DiquarkSuppress;};
G4double GetDiquarkBreakProb() {return DiquarkBreakProb;};
G4double GetStrangeSuppress() {return StrangeSuppress;};
G4double GetClusterMass() {return ClusterMass;};
G4int GetClusterLoopInterrupt() {return ClusterLoopInterrupt;};
G4ParticleDefinition* CreateHadron(G4int id1, G4int id2, G4bool theGivenSpin, G4int theSpin);
void Sample4Momentum(G4LorentzVector* Mom, G4double Mass, G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass);
protected:
// Additional protected declarations
virtual G4double GetLightConeZ(G4double zmin, G4double zmax, G4int PartonEncoding, G4ParticleDefinition* pHadron, G4double Px, G4double Py) = 0;
void CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector *);
G4ParticleDefinition* FindParticle(G4int Encoding);
// Additional Implementation Declarations
private:
G4double MassCut;
@@ -96,92 +95,49 @@ private:
G4double StrangeSuppress ;
G4int StringLoopInterrupt;
G4int ClusterLoopInterrupt;
G4int SideOfDecay;
G4HadronBuilder *hadronizer;
void ConstructParticle();
G4double pspin_meson;
G4double pspin_barion;
G4double pmix_meson1[6];
G4double pmix_meson0[6];
G4std::vector<G4double> vectorMesonMix;
G4std::vector<G4double> scalarMesonMix;
G4bool PastInitPhase;
class SimpleString
{
private:
class SideOfString;
public:
SimpleString(const G4ExcitedString& excitedString, G4VLongitudinalStringDecay * stringdecay)
: left(new SideOfString(excitedString.GetLeftParton()->GetPDGcode(),excitedString.Get4Momentum().mag())),
right(new SideOfString(excitedString.GetRightParton()->GetPDGcode(),excitedString.Get4Momentum().mag())),
MassSquare(excitedString.Get4Momentum().mag2()),
theStringDecay(stringdecay),
decay(0), stable(0), Side(0)
{};
~SimpleString()
{
delete right;
delete left;
};
SideOfString * Left(){return left;};
SideOfString * Right(){return right;};
SideOfString * Stable(){return stable;};
SideOfString * Decay(){return decay;};
const G4double MassSquared(){return MassSquare;};
G4ParticleDefinition * Splitup(G4int & NewDecayEncoding);
G4bool SplitLast(G4KineticTrackVector * LeftVector,G4KineticTrackVector * RightVector);
G4int GetDecayDirection() { return Side;};
void update();
G4KineticTrackVector * LightFragmentationTest(const G4ExcitedString * const theString);
G4bool StopFragmenting(const G4FragmentingString * const string);
G4bool IsFragmentable(const G4FragmentingString * const string);
// G4double MinFragmentationMass(G4ExcitedString * theString,
// G4ParticleDefinition*& Hadron1,
// G4ParticleDefinition*& Hadron2);
typedef G4std::pair<G4ParticleDefinition*, G4ParticleDefinition*> pDefPair;
typedef G4ParticleDefinition * (G4HadronBuilder::*Pcreate)
(G4ParticleDefinition*, G4ParticleDefinition*);
G4double FragmentationMass(
const G4FragmentingString * const string,
Pcreate build=0,
pDefPair * pdefs=0);
G4KineticTrack * Splitup(G4FragmentingString *string, G4FragmentingString *&newString);
G4LorentzVector * SplitEandP(G4ParticleDefinition * pHadron, G4FragmentingString * string);
G4bool SplitLast(G4FragmentingString * string,
G4KineticTrackVector * LeftVector,
G4KineticTrackVector * RightVector);
void CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector *);
G4ExcitedString *CPExcited(const G4ExcitedString& string);
G4ParticleDefinition* FindParticle(G4int Encoding);
private:
SimpleString(){G4cout << " error calling bad ctor for class SimpleString"<< G4endl;};
SideOfString * left, * right;
SideOfString * decay, * stable;
G4double MassSquare;
G4VLongitudinalStringDecay *theStringDecay;
G4int Side;
class SideOfString
{
public:
G4int Encoding(){return theEncoding;};
G4double w(){return thew;};
G4double Px(){return thepx;};
G4double Py(){return thepy;};
void decreasew(G4double deltaw){thew -= deltaw;};
void setEncoding(G4int aEncoding){theEncoding=aEncoding;};
void setpxpy(G4double px,G4double py){thepx=px; thepy=py;};
// Additional Implementation Declarations
G4ParticleDefinition * QuarkSplitup(G4ParticleDefinition* decay,
G4ParticleDefinition *&created);
G4ParticleDefinition * DiQuarkSplitup(G4ParticleDefinition* decay,
G4ParticleDefinition *&created);
pDefPair CreatePartonPair(G4int NeedParticle, G4bool AllowDiquarks=true);
SideOfString(G4int aEncoding, G4double aw)
{
theEncoding = aEncoding;
thew = aw;
thepx = thepy = 0;
}
;
SideOfString(void) {};
// void Init(G4int aEncoding, G4double aw) {
// theEncoding = aEncoding;
// thew = aw;
// thepx = thepy = 0;
// };
private:
G4int theEncoding;
G4double thew, thepx, thepy;
};
};
G4KineticTrackVector * LightFragmentationTest(const G4ExcitedString& theString);
G4bool StopFragmenting(SimpleString& string);
G4double IsFragmentable(SimpleString & theString);
G4double MinFragmentationMass(SimpleString & theString,
G4ParticleDefinition*& Hadron1,
G4ParticleDefinition*& Hadron2);
G4KineticTrack * SplitEandP(G4ParticleDefinition * pHadron,
SimpleString * string, G4int newDecayEncoding);
};
@@ -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. *
@@ -61,17 +61,17 @@ EnergyAndMomentumCorrector(G4KineticTrackVector* Output, G4LorentzVector& TotalC
{
const int nAttemptScale = 500;
const double ErrLimit = 1.E-5;
if (Output->isEmpty())
if (Output->empty())
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++)
unsigned int cHadron;
for(cHadron = 0; cHadron < Output->size(); cHadron++)
{
SumMom += Output->at(cHadron)->Get4Momentum();
SumMass += Output->at(cHadron)->GetDefinition()->GetPDGMass();
SumMom += Output->operator[](cHadron)->Get4Momentum();
SumMass += Output->operator[](cHadron)->GetDefinition()->GetPDGMass();
}
if (SumMass > TotalCollisionMass) return FALSE;
SumMass = SumMom.m2();
@@ -88,13 +88,13 @@ EnergyAndMomentumCorrector(G4KineticTrackVector* Output, G4LorentzVector& TotalC
for(G4int cAttempt = 0; cAttempt < nAttemptScale; cAttempt++)
{
G4double Sum = 0;
for(cHadron = 0; cHadron < Output->length(); cHadron++)
for(cHadron = 0; cHadron < Output->size(); cHadron++)
{
G4LorentzVector HadronMom = Output->at(cHadron)->Get4Momentum();
G4LorentzVector HadronMom = Output->operator[](cHadron)->Get4Momentum();
HadronMom.setVect(Scale*HadronMom.vect());
G4double E = sqrt(HadronMom.vect().mag2() + sqr(Output->at(cHadron)->GetDefinition()->GetPDGMass()));
G4double E = sqrt(HadronMom.vect().mag2() + sqr(Output->operator[](cHadron)->GetDefinition()->GetPDGMass()));
HadronMom.setE(E);
Output->at(cHadron)->Set4Momentum(HadronMom);
Output->operator[](cHadron)->Set4Momentum(HadronMom);
Sum += E;
}
Scale = TotalCollisionMass/Sum;
@@ -0,0 +1,216 @@
//
// ********************************************************************
// * 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: G4FragmentingString.cc,v 1.3 2001/10/29 14:27:56 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
//
// ---------------- G4FragmentingString ----------------
// by Gunter Folger, September 2001.
// class for an excited string used in Fragmention
// ------------------------------------------------------------
// G4FragmentingString
#include "G4FragmentingString.hh"
#include "G4ExcitedString.hh"
//---------------------------------------------------------------------------------
//---------------------------------------------------------------------------------
G4FragmentingString::G4FragmentingString(const G4FragmentingString &old)
{
LeftParton=old.LeftParton;
RightParton=old.RightParton;
Ptleft=old.Ptleft;
Ptright=old.Ptright;
Pplus=old.Pplus;
Pminus=old.Pminus;
decaying=old.decaying;
}
//---------------------------------------------------------------------------------
G4FragmentingString::G4FragmentingString(const G4ExcitedString &excited)
{
LeftParton=excited.GetLeftParton()->GetDefinition();
RightParton=excited.GetRightParton()->GetDefinition();
Ptleft=excited.GetLeftParton()->Get4Momentum().vect();
Ptleft.setZ(0.);
Ptright=excited.GetRightParton()->Get4Momentum().vect();
Ptright.setZ(0.);
G4LorentzVector P=excited.Get4Momentum();
Pplus =P.e() + P.pz();
Pminus=P.e() - P.pz();
decaying=None;
}
//---------------------------------------------------------------------------------
G4FragmentingString::G4FragmentingString(const G4FragmentingString &old,
G4ParticleDefinition * newdecay,
const G4LorentzVector *momentum)
{
decaying=None;
if ( old.decaying == Left )
{
RightParton= old.RightParton;
Ptright = old.Ptright;
LeftParton = newdecay;
Ptleft = old.Ptleft - momentum->vect();
Ptleft.setZ(0.);
} else if ( old.decaying == Right )
{
RightParton = newdecay;
Ptright = old.Ptright - momentum->vect();
Ptright.setZ(0.);
LeftParton = old.LeftParton;
Ptleft = old.Ptleft;
} else
{
G4Exception("G4FragmentingString::G4FragmentingString: no decay Direction defined");
}
Pplus = old.Pplus - (momentum->e() + momentum->pz());
Pminus = old.Pminus - (momentum->e() - momentum->pz());
G4double Eold=0.5 * (old.Pplus + old.Pminus);
G4double Enew=0.5 * (Pplus + Pminus);
}
//---------------------------------------------------------------------------------
G4FragmentingString::~G4FragmentingString()
{}
//---------------------------------------------------------------------------------
void G4FragmentingString::SetLeftPartonStable()
{
theStableParton=GetLeftParton();
theDecayParton=GetRightParton();
decaying=Right;
}
//---------------------------------------------------------------------------------
void G4FragmentingString::SetRightPartonStable()
{
theStableParton=GetRightParton();
theDecayParton=GetLeftParton();
decaying=Left;
}
//---------------------------------------------------------------------------------
G4int G4FragmentingString::GetDecayDirection() const
{
if (decaying == Left ) return +1;
else if (decaying == Right) return -1;
else G4Exception("G4FragmentingString::GetDecayDirection: decay side UNdefined!");
return 0;
}
//---------------------------------------------------------------------------------
G4bool G4FragmentingString::FourQuarkString() const
{
return LeftParton->GetParticleSubType()== "di_quark"
&& RightParton->GetParticleSubType()== "di_quark";
}
//---------------------------------------------------------------------------------
G4bool G4FragmentingString::DecayIsQuark()
{
return theDecayParton->GetParticleSubType()== "quark";
}
G4bool G4FragmentingString::StableIsQuark()
{
return theStableParton->GetParticleSubType()== "quark";
}
//---------------------------------------------------------------------------------
G4ThreeVector G4FragmentingString::StablePt()
{
if (decaying == Left ) return Ptright;
else if (decaying == Right ) return Ptleft;
else G4Exception("G4FragmentingString::DecayPt: decay side UNdefined!");
return G4ThreeVector();
}
G4ThreeVector G4FragmentingString::DecayPt()
{
if (decaying == Left ) return Ptleft;
else if (decaying == Right ) return Ptright;
else G4Exception("G4FragmentingString::DecayPt: decay side UNdefined!");
return G4ThreeVector();
}
//---------------------------------------------------------------------------------
G4double G4FragmentingString::LightConePlus()
{
return Pplus;
}
G4double G4FragmentingString::LightConeMinus()
{
return Pminus;
}
G4double G4FragmentingString::LightConeDecay()
{
if (decaying == Left ) return Pplus;
else if (decaying == Right ) return Pminus;
else G4Exception("G4FragmentingString::DecayPt: decay side UNdefined!");
return 0;
}
//---------------------------------------------------------------------------------
G4LorentzVector G4FragmentingString::Get4Momentum() const
{
G4LorentzVector momentum(Ptleft+Ptright,0);
momentum.setPz(0.5*(Pplus-Pminus));
momentum.setE(0.5*(Pplus+Pminus));
return momentum;
}
G4double G4FragmentingString::Mass2() const
{
return Pplus*Pminus - (Ptleft+Ptright).mag2();
}
G4double G4FragmentingString::Mass() const
{
return sqrt(this->Mass2());
}
@@ -0,0 +1,273 @@
//
// ********************************************************************
// * 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: G4HadronBuilder.cc,v 1.3 2001/10/30 08:33:27 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
//
// History:
// Gunter Folger, August/September 2001
// Create class; algorithm previously in G4VLongitudinalStringDecay.
// -----------------------------------------------------------------------------
#include "G4HadronBuilder.hh"
#include "Randomize.hh"
#include "G4ParticleTable.hh"
G4HadronBuilder::G4HadronBuilder(G4double mesonMix, G4double barionMix,
G4std::vector<double> scalarMesonMix,
G4std::vector<double> vectorMesonMix)
{
mesonSpinMix=mesonMix;
barionSpinMix=barionMix;
scalarMesonMixings=scalarMesonMix;
vectorMesonMixings=vectorMesonMix;
}
G4ParticleDefinition * G4HadronBuilder::Build(G4ParticleDefinition * black, G4ParticleDefinition * white)
{
if (black->GetParticleSubType()== "di_quark" || white->GetParticleSubType()== "di_quark" ) {
// Barion
Spin spin = (G4UniformRand() < barionSpinMix) ? SpinHalf : SpinThreeHalf;
return Barion(black,white,spin);
} else {
// Meson
Spin spin = (G4UniformRand() < mesonSpinMix) ? SpinZero : SpinOne;
return Meson(black,white,spin);
}
}
//-------------------------------------------------------------------------
G4ParticleDefinition * G4HadronBuilder::BuildLowSpin(G4ParticleDefinition * black, G4ParticleDefinition * white)
{
if ( black->GetParticleSubType()== "quark" && white->GetParticleSubType()== "quark" ) {
return Meson(black,white, SpinZero);
} else {
// will return a SpinThreeHalf Barion if all quarks the same
return Barion(black,white, SpinHalf);
}
}
//-------------------------------------------------------------------------
G4ParticleDefinition * G4HadronBuilder::BuildHighSpin(G4ParticleDefinition * black, G4ParticleDefinition * white)
{
if ( black->GetParticleSubType()== "quark" && white->GetParticleSubType()== "quark" ) {
return Meson(black,white, SpinOne);
} else {
return Barion(black,white,SpinThreeHalf);
}
}
//-------------------------------------------------------------------------
G4ParticleDefinition * G4HadronBuilder::Meson(G4ParticleDefinition * black,
G4ParticleDefinition * white, Spin theSpin)
{
#ifdef G4VERBOSE
// Verify Input Charge
G4double charge = black->GetPDGCharge()
+ white->GetPDGCharge();
if (abs(charge) > 2 || abs(3.*charge - 3*G4int(charge)) > perCent )
{
G4cerr << " G4HadronBuilder::Build()" << G4endl;
G4cerr << " Invalid total charge found for on input: "
<< charge<< G4endl;
G4cerr << " PGDcode input quark1/quark2 : " <<
black->GetPDGEncoding() << " / "<<
white->GetPDGEncoding() << G4endl;
G4cerr << G4endl;
}
#endif
G4int id1= black->GetPDGEncoding();
G4int id2= white->GetPDGEncoding();
// G4int ifl1= G4std::max(abs(id1), abs(id2));
if ( abs(id1) < abs(id2) )
{
G4int xchg = id1;
id1 = id2;
id2 = xchg;
}
if (abs(id1) > 3 )
G4Exception("G4HadronBuilder::Meson : Illegal Quark content as input");
G4int PDGEncoding=0;
if (id1 + id2 == 0) {
G4double rmix = G4UniformRand();
G4int imix = 2*abs(id1) - 1;
if(theSpin == SpinZero) {
PDGEncoding = 110*(1 + (G4int)(rmix + scalarMesonMixings[imix - 1])
+ (G4int)(rmix + scalarMesonMixings[imix])
) + theSpin;
} else {
PDGEncoding = 110*(1 + (G4int)(rmix + vectorMesonMixings[imix - 1])
+ (G4int)(rmix + vectorMesonMixings[imix])
) + theSpin;
}
} else {
PDGEncoding = 100 * abs(id1) + 10 * abs(id2) + theSpin;
G4bool IsUp = (abs(id1)&1) == 0; // quark 1 up type quark (u or c)
G4bool IsAnti = id1 < 0; // quark 1 is antiquark?
if( (IsUp && IsAnti ) || (!IsUp && !IsAnti ) )
PDGEncoding = - PDGEncoding;
}
G4ParticleDefinition * MesonDef=
G4ParticleTable::GetParticleTable()->FindParticle(PDGEncoding);
#ifdef G4VERBOSE
if (MesonDef == 0 ) {
G4cerr << " G4HadronBuilder - Warning: No particle for PDGcode= "
<< PDGEncoding << G4endl;
}
if ( ( black->GetPDGCharge()
+ white->GetPDGCharge()
- MesonDef->GetPDGCharge() ) > perCent ) {
G4cerr << " G4HadronBuilder - Warning: Incorrect Charge : "
<< " Quark1/2 = "
<< black->GetParticleName() << " / "
<< white->GetParticleName()
<< " resulting Hadron " << MesonDef->GetParticleName()
<< G4endl;
}
#endif
return MesonDef;
}
G4ParticleDefinition * G4HadronBuilder::Barion(G4ParticleDefinition * black,
G4ParticleDefinition * white,Spin theSpin)
{
#ifdef G4VERBOSE
// Verify Input Charge
G4double charge = black->GetPDGCharge()
+ white->GetPDGCharge();
if (abs(charge) > 2 || abs(3.*charge - 3*G4int(charge)) > perCent )
{
G4cerr << " G4HadronBuilder::Build()" << G4endl;
G4cerr << " Invalid total charge found for on input: "
<< charge<< G4endl;
G4cerr << " PGDcode input quark1/quark2 : " <<
black->GetPDGEncoding() << " / "<<
white->GetPDGEncoding() << G4endl;
G4cerr << G4endl;
}
#endif
G4int id1= black->GetPDGEncoding();
G4int id2= white->GetPDGEncoding();
if ( abs(id1) < abs(id2) )
{
G4int xchg = id1;
id1 = id2;
id2 = xchg;
}
if (abs(id1) < 1000 || abs(id2) > 3 )
G4Exception("G4HadronBuilder::Barion: Illegal quark content as input");
G4int ifl1= abs(id1)/1000;
G4int ifl2 = (abs(id1) - ifl1 * 1000)/100;
G4int diquarkSpin = abs(id1)%10;
G4int ifl3 = id2;
if (id1 < 0)
{
ifl1 = - ifl1;
ifl2 = - ifl2;
}
//... Construct barion, distinguish Lambda and Sigma barions.
G4int kfla = abs(ifl1);
G4int kflb = abs(ifl2);
G4int kflc = abs(ifl3);
G4int kfld = G4std::max(kfla,kflb);
kfld = G4std::max(kfld,kflc);
G4int kflf = G4std::min(kfla,kflb);
kflf = G4std::min(kflf,kflc);
G4int kfle = kfla + kflb + kflc - kfld - kflf;
//... barion with content uuu or ddd or sss has always spin = 3/2
theSpin = (kfla == kflb && kflb == kflc)? SpinThreeHalf : theSpin;
G4int kfll = 0;
if(theSpin == SpinHalf && kfld > kfle && kfle > kflf) {
// Spin J=1/2 and all three quarks different
// Two states exist: (uds -> lambda or sigma0)
// - lambda: s(ud)0 s : 3122; ie. reverse the two lighter quarks
// - sigma0: s(ud)1 s : 3212
if(diquarkSpin == 1 ) {
if ( kfla == kfld) { // heaviest quark in diquark
kfll = 1;
} else {
kfll = (G4int)(0.25 + G4UniformRand());
}
}
if(diquarkSpin == 3 && kfla != kfld)
kfll = (G4int)(0.75 + G4UniformRand());
}
G4int PDGEncoding;
if (kfll == 1)
PDGEncoding = 1000 * kfld + 100 * kflf + 10 * kfle + theSpin;
else
PDGEncoding = 1000 * kfld + 100 * kfle + 10 * kflf + theSpin;
if (id1 < 0)
PDGEncoding = -PDGEncoding;
G4ParticleDefinition * BarionDef=
G4ParticleTable::GetParticleTable()->FindParticle(PDGEncoding);
#ifdef G4VERBOSE
if (BarionDef == 0 ) {
G4cerr << " G4HadronBuilder - Warning: No particle for PDGcode= "
<< PDGEncoding << G4endl;
}
if ( ( black->GetPDGCharge()
+ white->GetPDGCharge()
- BarionDef->GetPDGCharge() ) > perCent ) {
G4cerr << " G4HadronBuilder - Warning: Incorrect Charge : "
<< " DiQuark/Quark = "
<< black->GetParticleName() << " / "
<< white->GetParticleName()
<< " resulting Hadron " << BarionDef->GetParticleName()
<< G4endl;
}
#endif
return BarionDef;
}
@@ -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: G4LundStringFragmentation.cc,v 1.2.8.2 2001/06/28 20:20:00 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4LundStringFragmentation.cc,v 1.4 2001/08/01 17:09:08 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -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: G4QGSMFragmentation.cc,v 1.4.8.2 2001/06/28 20:20:00 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4QGSMFragmentation.cc,v 1.6 2001/08/01 17:09:09 hpw Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -0,0 +1,114 @@
//
// ********************************************************************
// * 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: G4VKinkyStringDecay.cc,v 1.7 2001/10/09 10:50:42 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// Maxim Komogorov
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
//
// History: first implementation, Maxim Komogorov, 10-Oct-1998
// -----------------------------------------------------------------------------
#include "G4VKinkyStringDecay.hh"
#include "G4KineticTrackVector.hh"
#include "G4KineticTrack.hh"
#include "Randomize.hh"
//*****************************************************************************************************
G4VKinkyStringDecay::G4VKinkyStringDecay(G4VLongitudinalStringDecay* theModal)
{
this->SetLongitudinalStringDecay(theModal);
}
//*****************************************************************************************************
G4double G4VKinkyStringDecay::GetLightConeGluonZ(G4double zmin, G4double zmax)
{
G4double z, yf;
do {
z = zmin + G4UniformRand()*(zmax-zmin);
yf = z*z +sqr(1 - z);
}
while (G4UniformRand() > yf);
return z;
}
//*****************************************************************************************************
G4KineticTrackVector* G4VKinkyStringDecay::FragmentString(const G4ExcitedString& String)
{
G4LorentzVector Mom = String.GetGluon()->Get4Momentum();
G4ThreeVector Pos = String.GetGluon()->GetPosition();
G4int QuarkEncoding = theLongitudinalStringDecay->SampleQuarkFlavor();
G4ThreeVector Pquark=theLongitudinalStringDecay->SampleQuarkPt();
G4double Pt2 = Pquark.mag2();
G4double z = GetLightConeGluonZ(0, 1);
G4double w = Mom.e() + Mom.pz();
//... now compute quark longitudinal momentum and energy
Pquark.setZ( (z*w - Pt2/(z*w))*0.5);
G4double E = (z*w + Pt2/(z*w))*0.5;
G4Parton* AntiColor = new G4Parton(-QuarkEncoding);
AntiColor->SetPosition(Pos);
G4LorentzVector AntiColorMom(-Pquark, E);
AntiColor->Set4Momentum(AntiColorMom);
G4Parton* Color = new G4Parton(*String.GetColorParton());
G4ExcitedString Str1(Color, AntiColor, String.GetDirection());
G4KineticTrackVector* KTV1 = theLongitudinalStringDecay->FragmentString(Str1);
Color = new G4Parton(QuarkEncoding);
Color->SetPosition(Pos);
G4LorentzVector ColorMom(Pquark, E);
Color->Set4Momentum(ColorMom);
AntiColor = new G4Parton(*String.GetAntiColorParton());
G4ExcitedString Str2(Color, AntiColor, String.GetDirection());
G4KineticTrackVector* KTV2 = theLongitudinalStringDecay->FragmentString(Str2);
if (KTV1 && KTV2)
while(!KTV2->empty())
{
KTV1->push_back(KTV2->back());
KTV1->erase(KTV1->end()-1);
}
return KTV1;
}
//*****************************************************************************************************