Import Geant4 9.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:58:43 +02:00
parent 96c8bcd0af
commit b79225fb37
7544 changed files with 245407 additions and 91099 deletions
@@ -13,6 +13,27 @@ code and to keep track of all tags.
---------------------------------------------------------------
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
23 June 2008 V. Uzhinsky (hadr-prtn-V09-01-02)
G4QGSMFragmentation.cc and G4LundStringFragmentation.cc were
decoupled at calculation of formation time due to adding methods
and member in G4VLongitudinalStringDecay class for manipulation
with string tension.
Memory leak was erased in G4QGSMFragmentation.cc and
G4VLongitudinalStringDecay.cc thank to Gunter.
18 June 2008 V. Uzhinsky (hadr-prtn-V09-01-01)
Changes in G4ExcitedString class were tagged. They are needed for
operation of FTF.
13 June 2008 V. Uzhinsky (hadr-prtn-V09-01-00)
-----------------------------------------------
1. String fragmentation was revised, and parameters were tuned.
2. FTF parameters were tuned for proton-proton interaction
3. FTF parameters for pion-nucleon interactions were determined very rouhgly
4. Quiasi-elastic hadron-nucleus scattering was implemented in FTF
5. Formation time was implemented in FTF, and string tension was tuned
25 May 2007 G.Folger (hadr-prtn-V08-02-02)
-----------------------------------------------
@@ -52,3 +73,12 @@ code and to keep track of all tags.
(tag had-hadronization-V07-01-00)
- D. Wright created History file for parton_string directory
31 March 2008 V. Uzhinsky (hadr-string-diff-V09-01-00)
--------------------------------------------------------
- Elastic hadron intra-nuclear nucleon scattering was inserted in
FTF model. This allows to simulate quasi-elastic and multi-particles
production together.
- Small re-orangement of FTF model was done. G4FTFCrossSection modules
were re-named into G4FTFParameters and moved to /diffraction
@@ -1,4 +1,4 @@
$Id: History,v 1.1 2007/04/24 10:32:59 gunter Exp $
$Id: History,v 1.5 2008/12/09 10:43:47 vuzhinsk Exp $
-------------------------------------------------------------------
==========================================================
@@ -14,8 +14,32 @@ code and to keep track of all tags.
---------------------------------------------------------------
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
9 December 08, V. Uzhinsky (hadr-string-diff-V09-01-04)
- Improvement of delete operators in FTF
5 December 08, V. Uzhinsky (hadr-string-diff-V09-01-03)
- Some objects did not erase in FTFModel desructor. These lead to memory
leak.
2 June 08, G.Folger (hadr-string-diff-V09-01-02)
- on branch geant4-09-01-patches_branch, fix compilation warning for unused
variables in G4FTFModel.cc
?????????????????????????????? (hadr-string-diff-V09-01-01)
31 March 2008 V. Uzhinsky Tag : hadr-string-diff-V09-01-00
- G4FTFParameters.cc and G4FTFParameters.hh were copied from G4FTFCrossSection
corresponding files.
- New files - G4ElasticHNScattering have been added. They implement elastic
scattering of hadron in intra-nuclear collisions in FTF model.
- The corresponding changes have been done in G4FTFModel.cc and
G4FTFParticipants.cc
24 Apr 2007 Gunter Folger (hadr-string-diff-V08-02-00)
- merge in change done by ftf development.
- Created History file.
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4DiffractiveExcitation.hh,v 1.1 2007/05/25 06:56:53 vuzhinsk Exp $
// $Id: G4DiffractiveExcitation.hh,v 1.2 2008/04/25 14:20:13 vuzhinsk Exp $
#ifndef G4DiffractiveExcitation_h
#define G4DiffractiveExcitation_h 1
@@ -41,6 +41,7 @@
#include "globals.hh"
class G4VSplitableHadron;
class G4ExcitedString;
#include "G4FTFParameters.hh" // Uzhi 19.04.08
#include "G4ThreeVector.hh"
class G4DiffractiveExcitation
@@ -51,35 +52,23 @@ class G4DiffractiveExcitation
G4DiffractiveExcitation(); // Uzhi
virtual ~G4DiffractiveExcitation();
virtual G4bool ExciteParticipants (G4VSplitableHadron *aPartner, G4VSplitableHadron * bPartner) const;
virtual G4ExcitedString * String(G4VSplitableHadron * aHadron, G4bool isProjectile) const;
// void SetPtWidth(G4double aValue) { widthOfPtSquare = aValue*aValue; }
// void SetExtraMass(G4double aValue) { minExtraMass = aValue; }
// void SetMinimumMass(G4double aValue) { minmass = aValue; }
virtual G4bool ExciteParticipants (G4VSplitableHadron *aPartner,
G4VSplitableHadron * bPartner,
G4FTFParameters *theParameters) const;
virtual G4ExcitedString * String(G4VSplitableHadron * aHadron, G4bool isProjectile) const;
private:
G4DiffractiveExcitation(const G4DiffractiveExcitation &right);
// G4double ChooseX(G4double Xmin, G4double Xmax) const; // Uzhi
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) const; // Uzhi
G4double ChooseP(G4double Pmin, G4double Pmax) const; // Uzhi
// G4ThreeVector GaussianPt(G4double widthSquare, G4double maxPtSquare) const;
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) const; // Uzhi
const G4DiffractiveExcitation & operator=(const G4DiffractiveExcitation &right);
int operator==(const G4DiffractiveExcitation &right) const;
int operator!=(const G4DiffractiveExcitation &right) const;
private:
// Model Parameters:
/* // Uzhi
const G4double widthOfPtSquare; // width^2 of pt for string excitation
const G4double minExtraMass; // minimum excitation mass
const G4double minmass; // mean pion transverse mass; used for Xmin
*/ // Uzhi
};
#endif
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4DiffractiveHHScatterer.hh,v 1.3 2006/06/29 20:54:25 gunter Exp $
// $Id: G4DiffractiveHHScatterer.hh,v 1.4 2008/04/25 14:20:13 vuzhinsk Exp $
#ifndef G4DiffractiveHHScatterer_h
#define G4DiffractiveHHScatterer_h 1
@@ -43,6 +43,7 @@ class G4DiffractiveExcitation;
class G4LundStringFragmentation;
class G4KineticTrack;
#include "G4KineticTrackVector.hh"
#include "G4FTFParameters.hh" // Uzhi 21.04.08
class G4DiffractiveHHScatterer
{
@@ -56,6 +57,7 @@ private:
const G4DiffractiveExcitation * theExcitation;
G4LundStringFragmentation * theStringFragmentation;
G4FTFParameters *theParameters; // Uzhi 21.04.08
};
#endif
@@ -25,7 +25,7 @@
//
//
// $Id: G4DiffractiveSplitableHadron.hh,v 1.4 2006/06/29 20:54:27 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4DiffractiveSplitableHadron_h
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4ElasticHNScattering.hh,v 1.1 2008/03/31 15:34:01 vuzhinsk Exp $
#ifndef G4ElasticHNScattering_h
#define G4ElasticHNScattering_h 1
// ------------------------------------------------------------
// GEANT 4 class header file
//
// ---------------- G4ElasticHNScattering --------------
// by V. Uzhinsky, March 2008.
// elastic scattering used by Fritiof model
// Take a projectile and a target
// scatter the projectile and target
// ------------------------------------------------------------
#include "globals.hh"
class G4VSplitableHadron;
class G4ExcitedString;
#include "G4FTFParameters.hh" // Uzhi 29.03.08
#include "G4ThreeVector.hh"
class G4ElasticHNScattering
{
public:
G4ElasticHNScattering(); // Uzhi
virtual ~G4ElasticHNScattering();
virtual G4bool ElasticScattering (G4VSplitableHadron *aPartner,
G4VSplitableHadron * bPartner,
G4FTFParameters *theParameters) const;
private:
G4ElasticHNScattering(const G4ElasticHNScattering &right);
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) const; // Uzhi
const G4ElasticHNScattering & operator=(const G4ElasticHNScattering &right);
int operator==(const G4ElasticHNScattering &right) const;
int operator!=(const G4ElasticHNScattering &right) const;
};
#endif
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4FTFModel.hh,v 1.5 2007/04/24 10:32:59 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4FTFModel.hh,v 1.7 2008/04/25 14:20:13 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// Class Description
// Final state production code for hadron inelastic scattering above 20 GeV
@@ -51,11 +51,13 @@
class G4VSplitableHadron;
class G4ExcitedString;
#include "G4FTFParameters.hh" // Uzhi 29.03.08
#include "G4FTFParticipants.hh"
#include "G4ExcitedStringVector.hh"
#include "G4DiffractiveExcitation.hh"
#include "G4ElasticHNScattering.hh"
class G4FTFModel : public G4VPartonStringModel
{
@@ -83,16 +85,18 @@ class G4FTFModel : public G4VPartonStringModel
G4ExcitedStringVector * BuildStrings();
private:
G4FTFParticipants theParticipants;
G4ReactionProduct theProjectile;
G4DiffractiveExcitation * theExcitation;
G4ReactionProduct theProjectile;
G4FTFParticipants theParticipants;
G4FTFParameters *theParameters; // Uzhi 29.03.08
G4DiffractiveExcitation * theExcitation;
G4ElasticHNScattering * theElastic; // Uzhi 29.03.08
};
// ------------------------------------------------------------
inline
G4V3DNucleus * G4FTFModel::GetWoundedNucleus() const
{
@@ -0,0 +1,223 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef G4FTFParameters_h
#define G4FTFParameters_h 1
//
// $Id: G4FTFParameters.hh,v 1.2 2008/06/13 12:49:23 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
#include "G4Proton.hh"
class G4FTFParameters
{
public:
G4FTFParameters(const G4ParticleDefinition * , G4double theA,
G4double theZ,
G4double s);
~G4FTFParameters();
// --------- Set geometrical parameteres -----------------------------
void SethNcmsEnergy(const G4double s);
void SetTotalCrossSection(const G4double Xtotal);
void SetElastisCrossSection(const G4double Xelastic);
void SetInelasticCrossSection(const G4double Xinelastic);
void SetProbabilityOfElasticScatt(const G4double Xtotal, const G4double Xelastic);
void SetProbabilityOfElasticScatt(const G4double aValue);
void SetRadiusOfHNinteractions2(const G4double Radius2);
void SetSlope(const G4double Slope);
void SetGamma0(const G4double Gamma0);
G4double GammaElastic(const G4double impactsquare)
{return (FTFGamma0 * std::exp(-FTFSlope * impactsquare));};
// --------- Set parameters of elastic scattering --------------------
void SetAvaragePt2ofElasticScattering(const G4double aPt2);
// --------- Set parameters of excitations ---------------------------
void SetProjMinDiffMass(const G4double aValue); // Uzhi 19.04.08
void SetProjMinNonDiffMass(const G4double aValue);
void SetProbabilityOfProjDiff(const G4double aValue);
void SetTarMinDiffMass(const G4double aValue); // Uzhi 19.04.08
void SetTarMinNonDiffMass(const G4double aValue);
void SetProbabilityOfTarDiff(const G4double aValue);
void SetAveragePt2(const G4double aValue);
// Perevod mass*GeV Pt2*GeV*GeV
// --------- Get geometrical parameteres -----------------------------
G4double GetTotalCrossSection();
G4double GetElasticCrossSection();
G4double GetInelasticCrossSection();
G4double GetProbabilityOfElasticScatt();
G4double GetSlope();
G4double GetProbabilityOfInteraction(const G4double impactsquare);
G4double GetInelasticProbability(const G4double impactsquare);
// --------- Get parameters of elastic scattering --------------------
G4double GetAvaragePt2ofElasticScattering();
// --------- Get parameters of excitations ---------------------------
G4double GetProjMinDiffMass(); // Uzhi 19.04.08
G4double GetProjMinNonDiffMass();
G4double GetProbabilityOfProjDiff();
G4double GetTarMinDiffMass(); // Uzhi 19.04.08
G4double GetTarMinNonDiffMass();
G4double GetProbabilityOfTarDiff();
G4double GetAveragePt2();
// private:
G4FTFParameters();
// ------------ Initial energy of hN interactions --------------------
G4double FTFhNcmsEnergy; // Initial hN CMS energy
// ------------ Geometrical parameteres ------------------------------
G4double FTFXtotal; // Total X in mb
G4double FTFXelastic; // Elastic X in mb
G4double FTFXinelastic; // Inelastic X in mb
G4double ProbabilityOfElasticScatt; // Xel/Xtot
G4double RadiusOfHNinteractions2; // Xtot/pi, in fn^2
G4double FTFSlope; // in fm^-1
G4double AvaragePt2ofElasticScattering; // in MeV^2
G4double FTFGamma0;
// --------- Parameters of excitations -------------------------------
G4double ProjMinDiffMass; // Uzhi 19.04.08
G4double ProjMinNonDiffMass;
G4double ProbabilityOfProjDiff;
G4double TarMinDiffMass;
G4double TarMinNonDiffMass;
G4double ProbabilityOfTarDiff;
G4double AveragePt2;
};
// --------------------------------------------------------------------
inline void G4FTFParameters::SethNcmsEnergy(const G4double s)
{FTFhNcmsEnergy = s;}
// --------- Set geometrical parameteres ------------------------------
inline void G4FTFParameters::SetTotalCrossSection(const G4double Xtotal)
{FTFXtotal = Xtotal;}
inline void G4FTFParameters::SetElastisCrossSection(const G4double Xelastic)
{FTFXelastic = Xelastic;}
inline void G4FTFParameters::SetInelasticCrossSection(const G4double Xinelastic)
{FTFXinelastic = Xinelastic;}
inline void G4FTFParameters::SetProbabilityOfElasticScatt(const G4double Xtotal,
const G4double Xelastic)
{
if(Xtotal==0.) {ProbabilityOfElasticScatt = 0.;}
else {ProbabilityOfElasticScatt = Xelastic/Xtotal;};
}
inline void G4FTFParameters::SetProbabilityOfElasticScatt(const G4double aValue)
{ProbabilityOfElasticScatt = aValue;}
inline void G4FTFParameters::SetRadiusOfHNinteractions2(const G4double Radius2)
{RadiusOfHNinteractions2 = Radius2;}
inline void G4FTFParameters::SetSlope(const G4double Slope)
{FTFSlope = 12.84/Slope;} // Slope is in GeV^-2, FTFSlope in fm^-2
inline void G4FTFParameters::SetGamma0(const G4double Gamma0)
{FTFGamma0 = Gamma0;}
// --------- Set parameters of elastic scattering ---------------------
inline void G4FTFParameters::SetAvaragePt2ofElasticScattering(const G4double aPt2)
{
//G4cout<<"Pt2 El "<<aPt2<<" "<<std::sqrt(aPt2)<<G4endl;
//G4int Uzhi; G4cin>>Uzhi;
AvaragePt2ofElasticScattering = aPt2;}
// --------- Set parameters of excitations ----------------------------
inline void G4FTFParameters::SetProjMinDiffMass(const G4double aValue) // Uzhi 19.04.08
{ProjMinDiffMass = aValue*GeV;}
inline void G4FTFParameters::SetProjMinNonDiffMass(const G4double aValue)
{ProjMinNonDiffMass = aValue*GeV;}
inline void G4FTFParameters::SetProbabilityOfProjDiff(const G4double aValue)
{ProbabilityOfProjDiff = aValue;}
inline void G4FTFParameters::SetTarMinDiffMass(const G4double aValue) // Uzhi 19.04.08
{TarMinDiffMass = aValue*GeV;}
inline void G4FTFParameters::SetTarMinNonDiffMass(const G4double aValue)
{TarMinNonDiffMass = aValue*GeV;}
inline void G4FTFParameters::SetProbabilityOfTarDiff(const G4double aValue)
{ProbabilityOfTarDiff = aValue;}
inline void G4FTFParameters::SetAveragePt2(const G4double aValue)
{AveragePt2 = aValue*GeV*GeV;}
// --------- Get geometrical parameteres ------------------------------
inline G4double G4FTFParameters::GetTotalCrossSection() {return FTFXtotal;}
inline G4double G4FTFParameters::GetElasticCrossSection() {return FTFXelastic;}
inline G4double G4FTFParameters::GetInelasticCrossSection() {return FTFXinelastic;}
inline G4double G4FTFParameters::GetSlope() {return FTFSlope;}
inline G4double G4FTFParameters::GetProbabilityOfInteraction(const G4double impactsquare)
{
if(RadiusOfHNinteractions2 > impactsquare) {return 1.;}
else {return 0.;}
}
inline G4double G4FTFParameters::GetProbabilityOfElasticScatt()
{return ProbabilityOfElasticScatt;}
inline G4double G4FTFParameters::GetInelasticProbability( const G4double impactsquare)
{
G4double Gamma = GammaElastic(impactsquare);
return 2 * Gamma - Gamma *Gamma;
}
// --------- Get parameters of elastic scattering ---------------------
inline G4double G4FTFParameters::GetAvaragePt2ofElasticScattering()
{return AvaragePt2ofElasticScattering;}
// --------- Get parameters of excitations ---------------------------
inline G4double G4FTFParameters::GetProjMinDiffMass() {return ProjMinDiffMass;}
inline G4double G4FTFParameters::GetProjMinNonDiffMass() {return ProjMinNonDiffMass;}
inline G4double G4FTFParameters::GetProbabilityOfProjDiff() {return ProbabilityOfProjDiff;}
inline G4double G4FTFParameters::GetTarMinDiffMass() {return TarMinDiffMass;}
inline G4double G4FTFParameters::GetTarMinNonDiffMass() {return TarMinNonDiffMass;}
inline G4double G4FTFParameters::GetProbabilityOfTarDiff() {return ProbabilityOfTarDiff;}
inline G4double G4FTFParameters::GetAveragePt2() {return AveragePt2;}
#endif
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4FTFParticipants.hh,v 1.4 2006/06/29 20:54:32 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4FTFParticipants.hh,v 1.5 2008/03/31 15:34:01 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4FTFParticipants_h
@@ -40,6 +40,7 @@
// ------------------------------------------------------------
#include "G4VParticipants.hh"
#include "G4FTFParameters.hh" // Uzhi 29.03.08
#include <vector>
#include "G4Nucleon.hh"
#include "G4V3DNucleus.hh"
@@ -59,15 +60,17 @@ class G4FTFParticipants : public G4VParticipants
int operator==(const G4FTFParticipants &right) const;
int operator!=(const G4FTFParticipants &right) const;
void BuildInteractions(const G4ReactionProduct &thePrimary);
G4bool Next();
const G4InteractionContent & GetInteraction() const;
void GetList(const G4ReactionProduct &thePrimary,
G4FTFParameters *theParameters); // Uzhi 29.03.08
void StartLoop();
G4bool Next();
const G4InteractionContent & GetInteraction() const;
std::vector<G4InteractionContent *> theInteractions;
private:
std::vector<G4InteractionContent *> theInteractions;
// std::vector<G4InteractionContent *> theInteractions;
G4int currentInteraction;
@@ -94,5 +97,3 @@ const G4InteractionContent & G4FTFParticipants::GetInteraction() const
}
#endif
@@ -29,6 +29,7 @@
#include "G4LundStringFragmentation.hh"
#include "G4KineticTrack.hh"
#include "G4DiffractiveSplitableHadron.hh"
#include "G4FTFParameters.hh" // Uzhi 21.04.08
G4DiffractiveHHScatterer::G4DiffractiveHHScatterer()
:
@@ -36,6 +37,7 @@ G4DiffractiveHHScatterer::G4DiffractiveHHScatterer()
theStringFragmentation(new G4LundStringFragmentation())
{}
// -------------------------------------------------------------------
G4KineticTrackVector * G4DiffractiveHHScatterer::
Scatter(const G4KineticTrack & aTrack, const G4KineticTrack & bTrack)
{
@@ -43,7 +45,12 @@ Scatter(const G4KineticTrack & aTrack, const G4KineticTrack & bTrack)
G4DiffractiveSplitableHadron aHadron(& aTrack);
G4DiffractiveSplitableHadron bHadron(& bTrack);
if ( ! theExcitation->ExciteParticipants(& aHadron, & bHadron))
theParameters = new G4FTFParameters(aHadron.GetDefinition(), // -------- Uzhi 21.04.08
1.,1., 100.);
//s);// ------------------------- Uzhi 21.04.08
if ( ! theExcitation->ExciteParticipants(& aHadron,
& bHadron,
theParameters)) // -------- Uzhi 21.04.08
{
return NULL;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4DiffractiveSplitableHadron.cc,v 1.6 2006/06/29 20:54:36 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4DiffractiveSplitableHadron.cc,v 1.7 2008/03/31 15:34:01 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// ------------------------------------------------------------
@@ -0,0 +1,286 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4ElasticHNScattering.cc,v 1.3 2008/05/19 12:56:36 vuzhinsk Exp $
// ------------------------------------------------------------
// GEANT 4 class implemetation file
//
// ---------------- G4ElasticHNScattering --------------
// by V. Uzhinsky, March 2008.
// elastic scattering used by Fritiof model
// Take a projectile and a target
// scatter the projectile and target
// ---------------------------------------------------------------------
#include "globals.hh"
#include "Randomize.hh"
#include "G4ElasticHNScattering.hh"
#include "G4LorentzRotation.hh"
#include "G4ThreeVector.hh"
#include "G4ParticleDefinition.hh"
#include "G4VSplitableHadron.hh"
#include "G4ExcitedString.hh"
#include "G4FTFParameters.hh" // Uzhi 29.03.08
//#include "G4ios.hh"
G4ElasticHNScattering::G4ElasticHNScattering()
{
}
G4bool G4ElasticHNScattering::
ElasticScattering (G4VSplitableHadron *projectile,
G4VSplitableHadron *target,
G4FTFParameters *theParameters) const
{
//G4cout<<"G4ElasticHNScattering::ElasticScattering"<<G4endl;
G4LorentzVector Pprojectile=projectile->Get4Momentum();
// -------------------- Projectile parameters -----------------------------------
G4bool PutOnMassShell=0;
G4double M0projectile = Pprojectile.mag();
if(M0projectile < projectile->GetDefinition()->GetPDGMass())
{
PutOnMassShell=1;
M0projectile=projectile->GetDefinition()->GetPDGMass();
}
G4double Mprojectile2 = M0projectile * M0projectile;
// G4double AveragePt2=theParameters->GetSlope(); // Uzhi ???
// AveragePt2 = AveragePt2 * GeV*GeV;
G4double AveragePt2=theParameters->GetAvaragePt2ofElasticScattering();
// -------------------- Target parameters ----------------------------------------------
G4LorentzVector Ptarget=target->Get4Momentum();
G4double M0target = Ptarget.mag();
//G4cout<<" Mp Mt Pt2 "<<M0projectile<<" "<<M0target<<" "<<AveragePt2/GeV/GeV<<G4endl;
if(M0target < target->GetDefinition()->GetPDGMass())
{
PutOnMassShell=1;
M0target=target->GetDefinition()->GetPDGMass();
}
G4double Mtarget2 = M0target * M0target; //Ptarget.mag2();
// for AA-inter.
// Transform momenta to cms and then rotate parallel to z axis;
G4LorentzVector Psum;
Psum=Pprojectile+Ptarget;
G4LorentzRotation toCms(-1*Psum.boostVector());
G4LorentzVector Ptmp=toCms*Pprojectile;
if ( Ptmp.pz() <= 0. ) // Uzhi ???
{
// "String" moving backwards in CMS, abort collision !!
//G4cout << " abort Collision!! " << G4endl;
return false;
}
toCms.rotateZ(-1*Ptmp.phi());
toCms.rotateY(-1*Ptmp.theta());
G4LorentzRotation toLab(toCms.inverse());
Pprojectile.transform(toCms);
Ptarget.transform(toCms);
// ---------------------- Sampling of transfered Pt ------------------------
G4double Pt2;
G4double ProjMassT2, ProjMassT;
G4double TargMassT2, TargMassT;
G4double PZcms2, PZcms;
G4double S=Psum.mag2();
// G4double SqrtS=std::sqrt(S);
PZcms2=(S*S+Mprojectile2*Mprojectile2+Mtarget2*Mtarget2-
2*S*Mprojectile2-2*S*Mtarget2-2*Mprojectile2*Mtarget2)/4./S;
if(PZcms2 < 0)
{return false;} // It can be in an interaction with off-shell nuclear nucleon
PZcms = std::sqrt(PZcms2);
if(PutOnMassShell)
{
if(Pprojectile.z() > 0.)
{
Pprojectile.setPz( PZcms);
Ptarget.setPz( -PZcms);
}
else
{
Pprojectile.setPz(-PZcms);
Ptarget.setPz( PZcms);
};
Pprojectile.setE(std::sqrt(Mprojectile2+
Pprojectile.x()*Pprojectile.x()+
Pprojectile.y()*Pprojectile.y()+
PZcms2));
Ptarget.setE(std::sqrt( Mtarget2 +
Ptarget.x()*Ptarget.x()+
Ptarget.y()*Ptarget.y()+
PZcms2));
}
G4double maxPtSquare = PZcms2;
G4LorentzVector Qmomentum;
Qmomentum=G4LorentzVector(GaussianPt(AveragePt2,maxPtSquare),0);
Pt2=G4ThreeVector(Qmomentum.vect()).mag2();
//G4cout<<"Pt2 GeV^2 "<<(Pt2)/GeV/GeV<<G4endl;
ProjMassT2=Mprojectile2+Pt2;
ProjMassT =std::sqrt(ProjMassT2);
TargMassT2=Mtarget2+Pt2;
TargMassT =std::sqrt(TargMassT2);
PZcms2=(S*S+ProjMassT2*ProjMassT2+
TargMassT2*TargMassT2-
2.*S*ProjMassT2-2.*S*TargMassT2-
2.*ProjMassT2*TargMassT2)/4./S;
if(PZcms2 < 0 ) {PZcms2=0;};
PZcms =std::sqrt(PZcms2);
Pprojectile.setPz( PZcms); // Uzhi Proj can move backward
Ptarget.setPz( -PZcms); // Uzhi Proj can move backward
//G4cout << "Qplus / Qminus " << Qplus << " / " << Qminus<<G4endl;
// G4cout << "pt2" << pt2 << G4endl;
// G4cout << "Qmomentum " << Qmomentum << G4endl;
// G4cout << " Masses (P/T) : " << (Pprojectile+Qmomentum).mag() <<
// " / " << (Ptarget-Qmomentum).mag() << G4endl;
Pprojectile += Qmomentum;
Ptarget -= Qmomentum;
//G4cout << "Pprojectile with Q : " << Pprojectile << G4endl;
//G4cout << "Ptarget with Q : " << Ptarget << G4endl;
// G4cout << "Projectile back: " << toLab * Pprojectile << G4endl;
// G4cout << "Target back: " << toLab * Ptarget << G4endl;
// Transform back and update SplitableHadron Participant.
Pprojectile.transform(toLab);
Ptarget.transform(toLab);
//G4cout << "Pprojectile with Q M: " << Pprojectile<<" "<< Pprojectile.mag() << G4endl;
//G4cout << "Ptarget with Q M: " << Ptarget <<" "<< Ptarget.mag() << G4endl;
//G4cout << "Target mass " << Ptarget.mag() << G4endl;
//G4cout << "Projectile mass " << Pprojectile.mag() << G4endl;
G4double ZcoordinateOfCurrentInteraction = target->GetPosition().z();
// It is assumed that nucleon z-coordinates are ordered on increasing -----------
G4double betta_z=projectile->Get4Momentum().pz()/projectile->Get4Momentum().e();
G4double ZcoordinateOfPreviousCollision=projectile->GetPosition().z();
if(projectile->GetSoftCollisionCount()==0) {
projectile->SetTimeOfCreation(0.);
target->SetTimeOfCreation(0.);
ZcoordinateOfPreviousCollision=ZcoordinateOfCurrentInteraction;
}
G4ThreeVector thePosition(projectile->GetPosition().x(),
projectile->GetPosition().y(),
ZcoordinateOfCurrentInteraction);
projectile->SetPosition(thePosition);
G4double TimeOfPreviousCollision=projectile->GetTimeOfCreation();
G4double TimeOfCurrentCollision=TimeOfPreviousCollision+
(ZcoordinateOfCurrentInteraction-ZcoordinateOfPreviousCollision)/betta_z;
projectile->SetTimeOfCreation(TimeOfCurrentCollision);
target->SetTimeOfCreation(TimeOfCurrentCollision);
projectile->Set4Momentum(Pprojectile);
target->Set4Momentum(Ptarget);
projectile->IncrementCollisionCount(1);
target->IncrementCollisionCount(1);
return true;
}
// --------- private methods ----------------------
G4ThreeVector G4ElasticHNScattering::GaussianPt(G4double AveragePt2, G4double maxPtSquare) const
{ // @@ this method is used in FTFModel as well. Should go somewhere common!
G4double Pt2;
Pt2 = -AveragePt2 * std::log(1. + G4UniformRand() *
(std::exp(-maxPtSquare/AveragePt2)-1.));
G4double Pt=std::sqrt(Pt2);
G4double phi=G4UniformRand() * twopi;
return G4ThreeVector (Pt*std::cos(phi), Pt*std::sin(phi), 0.);
}
G4ElasticHNScattering::G4ElasticHNScattering(const G4ElasticHNScattering &)
{
throw G4HadronicException(__FILE__, __LINE__, "G4ElasticHNScattering copy contructor not meant to be called");
}
G4ElasticHNScattering::~G4ElasticHNScattering()
{
}
const G4ElasticHNScattering & G4ElasticHNScattering::operator=(const G4ElasticHNScattering &)
{
throw G4HadronicException(__FILE__, __LINE__, "G4ElasticHNScattering = operator meant to be called");
return *this;
}
int G4ElasticHNScattering::operator==(const G4ElasticHNScattering &) const
{
throw G4HadronicException(__FILE__, __LINE__, "G4ElasticHNScattering == operator meant to be called");
return false;
}
int G4ElasticHNScattering::operator!=(const G4ElasticHNScattering &) const
{
throw G4HadronicException(__FILE__, __LINE__, "G4ElasticHNScattering != operator meant to be called");
return true;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4FTFModel.cc,v 1.7 2007/04/24 10:32:59 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4FTFModel.cc,v 1.13 2008/12/09 10:40:52 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// ------------------------------------------------------------
@@ -37,20 +37,25 @@
// ------------------------------------------------------------
#include "G4FTFModel.hh"
#include "G4FTFParameters.hh" // Uzhi 29.03.08
#include "G4FTFParticipants.hh"
#include "G4InteractionContent.hh"
#include "G4LorentzRotation.hh"
#include "G4ParticleDefinition.hh"
#include "G4ios.hh"
#include <utility> // Uzhi 29.03.08
// Class G4FTFModel
G4FTFModel::G4FTFModel():theExcitation(new G4DiffractiveExcitation()) // Uzhi
G4FTFModel::G4FTFModel():theExcitation(new G4DiffractiveExcitation()),
theElastic(new G4ElasticHNScattering()) // Uzhi 29.03.08
{
G4VPartonStringModel::SetThisPointer(this);
theParameters=0; // Uzhi 9.12.08
}
G4FTFModel::G4FTFModel(G4double a, G4double b, G4double c):theExcitation(new G4DiffractiveExcitation())
/*
G4FTFModel::G4FTFModel(G4double , G4double , G4double ):theExcitation(new // Uzhi 9.12.08 G4DiffractiveExcitation())
{
G4VPartonStringModel::SetThisPointer(this);
}
@@ -61,11 +66,18 @@ theExcitation(anExcitation)
{
G4VPartonStringModel::SetThisPointer(this);
}
*/
G4FTFModel::~G4FTFModel()
{}
{
if( theParameters != 0 ) delete theParameters; // Uzhi 5.12.08
// Because FTF model can be called for various particles
// theParameters must be erased at the end of each call.
// Thus the delete is olso in G4FTFModel::GetStrings() method
if( theExcitation != 0 ) delete theExcitation; // Uzhi 5.12.08
if( theElastic != 0 ) delete theElastic; // Uzhi 5.12.08
}
const G4FTFModel & G4FTFModel::operator=(const G4FTFModel &)
@@ -85,29 +97,123 @@ int G4FTFModel::operator!=(const G4FTFModel &right) const
return this!=&right;
}
// ------------------------------------------------------------
void G4FTFModel::Init(const G4Nucleus & aNucleus, const G4DynamicParticle & aProjectile)
{
theParticipants.Init(aNucleus.GetN(),aNucleus.GetZ()); // Uzhi N-mass number Z-charge
theProjectile = aProjectile;
//G4cout<<"G4FTFModel::Init "<<aNucleus.GetN()<<" "<<aNucleus.GetZ()<<G4endl;
theParticipants.Init(aNucleus.GetN(),aNucleus.GetZ());
// Uzhi N-mass number Z-charge ------------------------- Uzhi 29.03.08
// --- cms energy
G4double s = sqr( theProjectile.GetMass() ) +
sqr( G4Proton::Proton()->GetPDGMass() ) +
2*theProjectile.GetTotalEnergy()*G4Proton::Proton()->GetPDGMass();
/*
G4cout << " primary Total E (GeV): " << theProjectile.GetTotalEnergy()/GeV << G4endl;
G4cout << " primary Mass (GeV): " << theProjectile.GetMass() /GeV << G4endl;
G4cout << "cms std::sqrt(s) (GeV) = " << std::sqrt(s) / GeV << G4endl;
*/
if( theParameters != 0 ) delete theParameters; // Uzhi 9.12.08
theParameters = new G4FTFParameters(theProjectile.GetDefinition(),
aNucleus.GetN(),aNucleus.GetZ(),
s);// ------------------------- Uzhi 19.04.08
//theParameters->SetProbabilityOfElasticScatt(0.); // To turn on/off (1/0) elastic scattering
}
// ------------------------------------------------------------
G4ExcitedStringVector * G4FTFModel::GetStrings()
{
theParticipants.BuildInteractions(theProjectile);
//G4cout<<"theParticipants.GetList"<<G4endl;
theParticipants.GetList(theProjectile,theParameters);
//G4cout<<"ExciteParticipants()"<<G4endl;
if (! ExciteParticipants()) return NULL;;
//G4cout<<"theStrings = BuildStrings()"<<G4endl;
G4ExcitedStringVector * theStrings = BuildStrings();
//G4cout<<"Return to theStrings "<<G4endl;
if( theParameters != 0 ) // Uzhi 9.12.08
{ // Uzhi 9.12.08
delete theParameters; // Uzhi 9.12.08
theParameters=0; // Uzhi 9.12.08
} // Uzhi 9.12.08
return theStrings;
}
// ------------------------------------------------------------
struct DeleteVSplitableHadron { void operator()(G4VSplitableHadron * aH){delete aH;} };
// ------------------------------------------------------------
G4bool G4FTFModel::ExciteParticipants()
{
/* // Uzhi 29.03.08 For elastic Scatt.
G4cout<<" In ExciteParticipants() "<<theParticipants.theInteractions.size()<<G4endl;
G4cout<<" test Params Tot "<<theParameters->GetTotalCrossSection()<<G4endl;
G4cout<<" test Params Ela "<<theParameters->GetElasticCrossSection()<<G4endl;
G4int counter=0;
*/ // Uzhi 29.03.08
while (theParticipants.Next())
{
const G4InteractionContent & collision=theParticipants.GetInteraction();
/*
counter++;
G4cout<<" Inter # "<<counter<<G4endl;
*/
G4VSplitableHadron * projectile=collision.GetProjectile();
G4VSplitableHadron * target=collision.GetTarget();
// // Uzhi 29.03.08
G4bool Successfull;
if(G4UniformRand()< theParameters->GetProbabilityOfElasticScatt())
{
//G4cout<<"Elastic"<<G4endl;
Successfull=theElastic->ElasticScattering(projectile, target, theParameters);
}
else
{
//G4cout<<"Inelastic"<<G4endl;
Successfull=theExcitation->ExciteParticipants(projectile, target, theParameters);
}
// if(!Successfull)
// // Uzhi 29.03.08
// if ( ! theExcitation->ExciteParticipants(projectile, target) )
if(!Successfull)
{
// give up, clean up
std::vector<G4VSplitableHadron *> primaries;
std::vector<G4VSplitableHadron *> targets;
theParticipants.StartLoop(); // restart a loop
while ( theParticipants.Next() )
{
const G4InteractionContent & interaction=theParticipants.GetInteraction();
// do not allow for duplicates ...
if ( primaries.end() == std::find(primaries.begin(), primaries.end(),
interaction.GetProjectile()) )
primaries.push_back(interaction.GetProjectile());
if ( targets.end() == std::find(targets.begin(), targets.end(),
interaction.GetTarget()) )
targets.push_back(interaction.GetTarget());
}
std::for_each(primaries.begin(), primaries.end(), DeleteVSplitableHadron());
primaries.clear();
std::for_each(targets.begin(), targets.end(), DeleteVSplitableHadron());
targets.clear();
return false;
} // End of the loop Uzhi
}
return true;
}
// ------------------------------------------------------------
G4ExcitedStringVector * G4FTFModel::BuildStrings()
{
// Loop over all collisions; find all primaries, and all target ( targets may
// be duplicate in the List ( to unique G4VSplitableHadrons)
@@ -122,26 +228,33 @@ G4ExcitedStringVector * G4FTFModel::BuildStrings()
{
const G4InteractionContent & interaction=theParticipants.GetInteraction();
// do not allow for duplicates ...
if ( primaries.end() == std::find(primaries.begin(), primaries.end(), interaction.GetProjectile()) )
if ( primaries.end() == std::find(primaries.begin(), primaries.end(),
interaction.GetProjectile()) )
primaries.push_back(interaction.GetProjectile());
if ( targets.end() == std::find(targets.begin(), targets.end(),interaction.GetTarget()) )
if ( targets.end() == std::find(targets.begin(), targets.end(),
interaction.GetTarget()) )
targets.push_back(interaction.GetTarget());
}
// G4cout << "BuildStrings prim/targ " << primaries.entries() << " , " <<
// targets.entries() << G4endl;
// G4cout << "BuildStrings prim/targ " << primaries.size() << " , " <<
// targets.size() << G4endl;
unsigned int ahadron;
// Only for hA-interactions Uzhi -------------------------------------
for ( ahadron=0; ahadron < primaries.size() ; ahadron++)
{
//G4ThreeVector aPosition=primaries[ahadron]->GetPosition();
//G4cout<<"Proj Build "<<aPosition<<" "<<primaries[ahadron]->GetTimeOfCreation()<<G4endl;
G4bool isProjectile=true;
strings->push_back(theExcitation->String(primaries[ahadron], isProjectile));
}
for ( ahadron=0; ahadron < targets.size() ; ahadron++)
{
//G4ThreeVector aPosition=targets[ahadron]->GetPosition();
//G4cout<<"Targ Build "<<aPosition<<" "<<targets[ahadron]->GetTimeOfCreation()<<G4endl;
G4bool isProjectile=false;
strings->push_back(theExcitation->String(targets[ahadron], isProjectile));
}
@@ -153,42 +266,4 @@ G4ExcitedStringVector * G4FTFModel::BuildStrings()
return strings;
}
G4bool G4FTFModel::ExciteParticipants()
{
while (theParticipants.Next())
{
const G4InteractionContent & collision=theParticipants.GetInteraction();
//G4cout << " soft colls : " << collision.GetNumberOfSoftCollisions() << G4endl; // Uzhi no match
G4VSplitableHadron * projectile=collision.GetProjectile();
G4VSplitableHadron * target=collision.GetTarget();
if ( ! theExcitation->ExciteParticipants(projectile, target) )
{
// give up, clean up
std::vector<G4VSplitableHadron *> primaries;
std::vector<G4VSplitableHadron *> targets;
theParticipants.StartLoop(); // restart a loop
while ( theParticipants.Next() )
{
const G4InteractionContent & interaction=theParticipants.GetInteraction();
// do not allow for duplicates ...
if ( primaries.end() == std::find(primaries.begin(), primaries.end(), interaction.GetProjectile()) )
primaries.push_back(interaction.GetProjectile());
if ( targets.end() == std::find(targets.begin(), targets.end(),interaction.GetTarget()) )
targets.push_back(interaction.GetTarget());
}
std::for_each(primaries.begin(), primaries.end(), DeleteVSplitableHadron());
primaries.clear();
std::for_each(targets.begin(), targets.end(), DeleteVSplitableHadron());
targets.clear();
return false;
}
}
return true;
}
// ------------------------------------------------------------
@@ -24,21 +24,24 @@
// ********************************************************************
//
//
// $Id: G4FTFCrossSection.cc,v 1.2 2007/04/24 10:37:10 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4FTFParameters.cc,v 1.4 2008/12/18 13:02:00 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
#include "G4FTFCrossSection.hh"
#include "G4FTFParameters.hh"
G4FTFCrossSection::G4FTFCrossSection()
G4FTFParameters::G4FTFParameters()
{;}
G4FTFCrossSection::~G4FTFCrossSection()
G4FTFParameters::~G4FTFParameters()
{;}
//**********************************************************************************************
G4FTFCrossSection::G4FTFCrossSection(const G4ParticleDefinition * particle, G4double s)
G4FTFParameters::G4FTFParameters(const G4ParticleDefinition * particle,
G4double theA,
G4double theZ,
G4double s)
{
G4int PDGcode = particle->GetPDGEncoding();
G4int absPDGcode = std::abs(PDGcode);
@@ -48,10 +51,10 @@ G4FTFCrossSection::G4FTFCrossSection(const G4ParticleDefinition * particle, G4do
G4double LogPlab = std::log( Plab );
G4double sqrLogPlab = LogPlab * LogPlab;
//G4cout<<"G4FTFCrossSection Plab "<<Plab<<G4endl;
//G4cout<<"G4FTFParameters Plab "<<Plab<<G4endl;
G4int NumberOfTargetProtons = 1; //aNucleus.GetZ(); // ??????????????????????
G4int NumberOfTargetNeutrons = 1; //aNucleus.GetN();
G4int NumberOfTargetProtons = (G4int) theZ;
G4int NumberOfTargetNeutrons = (G4int) theA- (G4int) theZ;
G4int NumberOfTargetNucleons = NumberOfTargetProtons + NumberOfTargetNeutrons;
G4double Xtotal, Xelastic;
@@ -156,7 +159,7 @@ G4FTFCrossSection::G4FTFCrossSection(const G4ParticleDefinition * particle, G4do
Xelastic = ( NumberOfTargetProtons * XelKP +
NumberOfTargetNeutrons * XelKN ) / NumberOfTargetNucleons;
}
else //------Projectile is undefined, Nucleon assumed
else //------Projectile is undefined, Nucleon assumed
{
G4double XtotPP = 48.0 + 0. *std::pow(Plab, 0. ) + 0.522*sqrLogPlab - 4.51*LogPlab;
G4double XtotPN = 47.3 + 0. *std::pow(Plab, 0. ) + 0.513*sqrLogPlab - 4.27*LogPlab;
@@ -170,25 +173,96 @@ G4FTFCrossSection::G4FTFCrossSection(const G4ParticleDefinition * particle, G4do
NumberOfTargetNeutrons * XelPN ) / NumberOfTargetNucleons;
};
// Xtotal and Xelastic in mb
//----------- Geometrical parameters ------------------------------------------------
SetTotalCrossSection(Xtotal);
SetElastisCrossSection(Xelastic);
SetInelasticCrossSection(Xtotal-Xelastic);
//G4cout<<"G4FTFCrossSection Xt Xel "<<Xtotal<<" "<<Xelastic<<G4endl;
// // Interactions with elastic ans inelastic collisions
SetProbabilityOfElasticScatt(Xtotal, Xelastic);
SetRadiusOfHNinteractions2(Xtotal/pi/10.);
//
/* //==== No elastic scattering ============================
SetProbabilityOfElasticScatt(Xtotal, 0.);
SetRadiusOfHNinteractions2((Xtotal-Xelastic)/pi/10.);
*/ //=======================================================
//G4cout<<" Rnn "<<Xtotal/pi/10.<<" "<<Xtotal/pi/10.*fermi*fermi<<G4endl;
//G4cout<<"G4FTFParameters Xt Xel MeV "<<Xtotal<<" "<<Xelastic<<" "<<GeV<<G4endl;
//-----------------------------------------------------------------------------------
SetSlope( Xtotal*Xtotal/16./pi/Xelastic/0.3894 ); // Slope parameter of elastic scattering
// (GeV/c)^(-2))
// Gaussian parametrization of
// elastic scattering amplitude assumed
//G4cout<<"G4FTFCrossSection Slope "<<GetSlope()<<G4endl;
//G4cout<<"G4FTFParameters Slope "<<GetSlope()<<G4endl;
//-----------------------------------------------------------------------------------
SetGamma0( GetSlope()*Xtotal/10./2./pi );
//-----------------------------------------------------------------------------------
//G4cout<<"G4FTFCrossSection Out"<<G4endl;
//----------- Parameters of elastic scattering --------------------------------------
// Gaussian parametrization of
// elastic scattering amplitude assumed
SetAvaragePt2ofElasticScattering(1./(Xtotal*Xtotal/16./pi/Xelastic/0.3894)*GeV*GeV);
//----------- Parameters of excitations ---------------------------------------------
if( absPDGcode > 1000 ) //------Projectile is baryon --------
{
SetProjMinDiffMass(1.1); // GeV
SetProjMinNonDiffMass(1.1); // GeV
SetProbabilityOfProjDiff(0.95*std::pow(s/GeV/GeV,-0.35)); // 40/32 X-dif/X-inel
SetTarMinDiffMass(1.1); // GeV
SetTarMinNonDiffMass(1.1); // GeV
SetProbabilityOfTarDiff(0.95*std::pow(s/GeV/GeV,-0.35)); // 40/32 X-dif/X-inel
SetAveragePt2(0.3); // GeV^2
}
else if( absPDGcode == 211 || PDGcode == 111) //------Projectile is Pion -----------
{
SetProjMinDiffMass(0.5); // GeV
SetProjMinNonDiffMass(0.3); // GeV
SetProbabilityOfProjDiff(0.62*std::pow(s/GeV/GeV,-0.51)); // 40/32 X-dif/X-inel
SetTarMinDiffMass(1.1); // GeV
SetTarMinNonDiffMass(1.1); // GeV
SetProbabilityOfTarDiff(0.62*std::pow(s/GeV/GeV,-0.51)); // 40/32 X-dif/X-inel
/*
SetProjMinDiffMass(0.5);
SetProjMinNonDiffMass(0.3); // Uzhi 12.06.08
SetProbabilityOfProjDiff(0.05);
SetProbabilityOfTarDiff(0.05);
*/
SetAveragePt2(0.3); // GeV^2
}
else if( absPDGcode == 321 || PDGcode == -311) //------Projectile is Kaon -----------
{
SetProjMinDiffMass(0.7); // GeV 1.1
SetProjMinNonDiffMass(0.7); // GeV
SetProbabilityOfProjDiff(0.85*std::pow(s/GeV/GeV,-0.5)); // 40/32 X-dif/X-inel
SetTarMinDiffMass(1.1); // GeV
SetTarMinNonDiffMass(1.1); // GeV
SetProbabilityOfTarDiff(0.85*std::pow(s/GeV/GeV,-0.5)); // 40/32 X-dif/X-inel
SetAveragePt2(0.3); // GeV^2
}
else //------Projectile is undefined,
//------Nucleon assumed
{
SetProjMinDiffMass((particle->GetPDGMass()+160.*MeV)/GeV);
SetProjMinNonDiffMass((particle->GetPDGMass()+160.*MeV)/GeV);
SetProbabilityOfProjDiff(0.95*std::pow(s/GeV/GeV,-0.35)); // 40/32 X-dif/X-inel
SetTarMinDiffMass(1.1); // GeV
SetTarMinNonDiffMass(1.1); // GeV
SetProbabilityOfTarDiff(0.95*std::pow(s/GeV/GeV,-0.35)); // 40/32 X-dif/X-inel
SetAveragePt2(0.3); // GeV^2
};
//G4cout<<"G4FTFParameters Out"<<G4endl;
}
//**********************************************************************************************
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4FTFParticipants.cc,v 1.7 2007/04/24 10:33:00 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4FTFParticipants.cc,v 1.9 2008/06/13 12:49:23 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -37,19 +37,15 @@
// with original FRITIOF mode. November - December 2006.
// ------------------------------------------------------------
#include "G4FTFParameters.hh" // Uzhi 29.03.08
#include "G4FTFParticipants.hh"
#include "G4DiffractiveSplitableHadron.hh"
#include "G4VSplitableHadron.hh"
//#include "G4PomeronCrossSection.hh" // Uzhi
#include "G4FTFCrossSection.hh" // Uzhi
#include "Randomize.hh"
#include <utility>
#include <utility> // Uzhi 29.03.08
// Class G4FTFParticipants
G4FTFParticipants::G4FTFParticipants()
{
}
@@ -74,7 +70,8 @@ G4FTFParticipants::~G4FTFParticipants()
//int G4FTFParticipants::operator!=(const G4FTFParticipants &right) const
//{}
void G4FTFParticipants::BuildInteractions(const G4ReactionProduct &thePrimary)
void G4FTFParticipants::GetList(const G4ReactionProduct &thePrimary,
G4FTFParameters *theParameters) // Uzhi 29.03.08
{
StartLoop(); // reset Loop over Interactions
@@ -82,27 +79,13 @@ void G4FTFParticipants::BuildInteractions(const G4ReactionProduct &thePrimary)
for(unsigned int i=0; i<theInteractions.size(); i++) delete theInteractions[i];
theInteractions.clear();
// --- cms energy
G4double s = sqr( thePrimary.GetMass() ) +
sqr( G4Proton::Proton()->GetPDGMass() ) +
2*thePrimary.GetTotalEnergy()*G4Proton::Proton()->GetPDGMass();
// G4cout << " primary Total E (GeV): " << thePrimary.GetTotalEnergy()/GeV << G4endl;
// G4cout << " primary Mass (GeV): " << thePrimary.GetMass() /GeV << G4endl;
// G4cout << "cms std::sqrt(s) (GeV) = " << std::sqrt(s) / GeV << G4endl;
// G4PomeronCrossSection theCrossSection(thePrimary.GetDefinition()); // Uzhi
G4FTFCrossSection theCrossSection(thePrimary.GetDefinition(),s); // Uzhi
G4double deltaxy=2 * fermi;
G4double deltaxy=2 * fermi; // Extra nuclear radius
G4VSplitableHadron * primarySplitable=new G4DiffractiveSplitableHadron(thePrimary);
G4double xyradius;
xyradius =theNucleus->GetOuterRadius() + deltaxy;
G4double xyradius;
xyradius =theNucleus->GetOuterRadius() + deltaxy; // Impact parameter sampling
// radius
G4bool nucleusNeedsShift = true;
while ( theInteractions.size() == 0 )
@@ -114,14 +97,18 @@ void G4FTFParticipants::BuildInteractions(const G4ReactionProduct &thePrimary)
theNucleus->StartLoop();
G4Nucleon * nucleon;
while ( (nucleon=theNucleus->GetNextNucleon()) )
//G4int InterNumber=0; // Uzhi
//while ( (nucleon=theNucleus->GetNextNucleon())&& (InterNumber < 1) ) // Uzhi
while ( (nucleon=theNucleus->GetNextNucleon()) ) // Uzhi
{
G4double impact2= sqr(impactX - nucleon->GetPosition().x()) +
sqr(impactY - nucleon->GetPosition().y());
// if ( theCrossSection.GetInelasticProbability(s,impact2) // Uzhi
if ( theCrossSection.GetInelasticProbability( impact2/fermi/fermi) // Uzhi
sqr(impactY - nucleon->GetPosition().y());
// if ( theParameters->GetInelasticProbability(impact2/fermi/fermi) // Uzhi 29.03.08
if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi) // Uzhi 29.03.08
> G4UniformRand() )
{
//InterNumber++;
if ( nucleusNeedsShift )
{ // on the first hit, shift nucleus
nucleusNeedsShift = false;
@@ -135,7 +122,8 @@ void G4FTFParticipants::BuildInteractions(const G4ReactionProduct &thePrimary)
targetSplitable= new G4DiffractiveSplitableHadron(*nucleon);
nucleon->Hit(targetSplitable);
}
G4InteractionContent * aInteraction = new G4InteractionContent(primarySplitable);
G4InteractionContent * aInteraction =
new G4InteractionContent(primarySplitable);
aInteraction->SetTarget(targetSplitable);
theInteractions.push_back(aInteraction);
}
@@ -151,8 +139,3 @@ void G4FTFParticipants::BuildInteractions(const G4ReactionProduct &thePrimary)
// Implementation (private) methods
@@ -25,7 +25,7 @@
//
//
// $Id: G4ExcitedStringDecay.hh,v 1.7 2007/05/03 22:06:17 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4ExcitedStringDecay_h
#define G4ExcitedStringDecay_h 1
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4FragmentingString.hh,v 1.3 2006/06/29 20:54:44 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4FragmentingString.hh,v 1.4 2007/12/20 15:38:06 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4FragmentingString_h
@@ -57,7 +57,9 @@ class G4FragmentingString
G4FragmentingString(const G4FragmentingString &old,
G4ParticleDefinition * newdecay,
const G4LorentzVector *momentum);
G4FragmentingString(const G4FragmentingString &old, // Uzhi
G4ParticleDefinition * newdecay); // Uzhi
~G4FragmentingString();
int operator==(const G4FragmentingString &right) const;
@@ -76,7 +78,7 @@ class G4FragmentingString
G4double Mass() const;
G4double Mass2() const;
G4double MassT2() const;
G4ParticleDefinition* GetLeftParton(void) const;
G4ParticleDefinition* GetRightParton(void) const;
@@ -25,7 +25,7 @@
//
//
// $Id: G4HadronBuilder.hh,v 1.3 2006/06/29 20:54:46 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class header file
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4LundStringFragmentation.hh,v 1.4 2007/04/24 14:55:23 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $ Maxim Komogorov
// $Id: G4LundStringFragmentation.hh,v 1.6 2008/04/25 14:20:14 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $ Maxim Komogorov
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -43,34 +43,50 @@
class G4LundStringFragmentation: public G4VLongitudinalStringDecay
{
public:
G4LundStringFragmentation();
// G4LundStringFragmentation(G4double sigmaPt);
G4LundStringFragmentation(const G4LundStringFragmentation &right);
virtual ~G4LundStringFragmentation();
virtual G4KineticTrackVector* FragmentString(const G4ExcitedString& theString);
public:
G4LundStringFragmentation();
G4LundStringFragmentation(const G4LundStringFragmentation &right);
virtual ~G4LundStringFragmentation();
const G4LundStringFragmentation & operator=(const G4LundStringFragmentation &right);
int operator==(const G4LundStringFragmentation &right) const;
int operator!=(const G4LundStringFragmentation &right) const;
virtual G4KineticTrackVector* FragmentString(const G4ExcitedString& theString);
private:
virtual G4double GetLightConeZ(G4double zmin, G4double zmax, G4int PartonEncoding, G4ParticleDefinition* pHadron, G4double Px, G4double Py);
void SetMinimalStringMass(const G4FragmentingString * const string);
void SetMinimalStringMass2(const G4double aValue);
virtual void Sample4Momentum(G4LorentzVector* Mom, G4double Mass, G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass);
virtual G4bool StopFragmenting(const G4FragmentingString * const string);
virtual G4bool IsFragmentable(const G4FragmentingString * const string);
virtual G4LorentzVector * SplitEandP(G4ParticleDefinition * pHadron, G4FragmentingString * string);
virtual G4bool SplitLast(G4FragmentingString * string,
G4KineticTrackVector * LeftVector,
G4KineticTrackVector * RightVector);
void SetMinimalStringMass(const G4FragmentingString * const string);
void SetMinimalStringMass2(const G4double aValue);
virtual G4bool SplitLast(G4FragmentingString * string,
G4KineticTrackVector * LeftVector,
G4KineticTrackVector * RightVector);
virtual void Sample4Momentum(G4LorentzVector* Mom, G4double Mass,
G4LorentzVector* AntiMom, G4double AntiMass,
G4double InitialMass);
virtual G4LorentzVector * SplitEandP(G4ParticleDefinition * pHadron,
G4FragmentingString * string,
G4FragmentingString * newString); // Uzhi
virtual G4double GetLightConeZ(G4double zmin, G4double zmax,
G4int PartonEncoding,
G4ParticleDefinition* pHadron,
G4double Px, G4double Py);
private:
// ------ For estimation of a minimal string mass ---------------
G4double Mass_of_light_quark;
G4double Mass_of_heavy_quark;
G4double Mass_of_string_junction;
// ------ An estimated minimal string mass ----------------------
G4double MinimalStringMass;
G4double MinimalStringMass2;
// ------ Minimal invariant mass used at a string fragmentation -
G4double WminLUND;
};
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4QGSMFragmentation.hh,v 1.4 2007/04/24 14:55:23 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4QGSMFragmentation.hh,v 1.5 2007/12/20 15:38:07 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -56,7 +56,9 @@ public:
virtual void Sample4Momentum(G4LorentzVector* Mom, G4double Mass, G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass);
virtual G4bool StopFragmenting(const G4FragmentingString * const string);
virtual G4bool IsFragmentable(const G4FragmentingString * const string);
virtual G4LorentzVector * SplitEandP(G4ParticleDefinition * pHadron, G4FragmentingString * string);
virtual G4LorentzVector * SplitEandP(G4ParticleDefinition * pHadron,
G4FragmentingString * string, // Uzhi
G4FragmentingString * newString); // Uzhi
virtual G4bool SplitLast(G4FragmentingString * string,
G4KineticTrackVector * LeftVector,
G4KineticTrackVector * RightVector);
@@ -25,7 +25,7 @@
//
//
// $Id: G4VKinkyStringDecay.hh,v 1.3 2006/06/29 20:54:53 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
// Maxim Komogorov
//
// -----------------------------------------------------------------------------
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VLongitudinalStringDecay.hh,v 1.4 2007/04/24 14:55:23 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4VLongitudinalStringDecay.hh,v 1.6 2008/06/23 08:35:54 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
// Maxim Komogorov
//
// -----------------------------------------------------------------------------
@@ -42,24 +42,111 @@
#include "G4HadronBuilder.hh"
class G4FragmentingString;
//**********************************************************************************************
//**************************************************************************************
class G4VLongitudinalStringDecay
{
public:
G4VLongitudinalStringDecay();
G4VLongitudinalStringDecay();
virtual ~G4VLongitudinalStringDecay();
private:
// G4VLongitudinalStringDecay(const G4VLongitudinalStringDecay &right);
// const G4VLongitudinalStringDecay & operator=(const G4VLongitudinalStringDecay &right);
int operator==(const G4VLongitudinalStringDecay &right) const;
int operator!=(const G4VLongitudinalStringDecay &right) const;
public:
virtual G4KineticTrackVector* FragmentString(const G4ExcitedString& theString)=0;
protected:
// For changing Mass Cut used for selection of very small mass strings
virtual void SetMassCut(G4double aValue);
// For handling a string with very low mass
G4KineticTrackVector * LightFragmentationTest(const G4ExcitedString * const theString);
// To store created quarks or 2 last hadrons
typedef std::pair<G4ParticleDefinition*, G4ParticleDefinition*> pDefPair;
// For creation of hadrons from given quark pair
typedef G4ParticleDefinition * (G4HadronBuilder::*Pcreate)
(G4ParticleDefinition*, G4ParticleDefinition*);
//-----------------------------------------------------------------------------
// Used by LightFragmentationTest for estimation of lowest possible mass of
// given quark system
G4double FragmentationMass(const G4FragmentingString * const string,
Pcreate build=0,
pDefPair * pdefs=0);
G4ParticleDefinition* FindParticle(G4int Encoding);
virtual void Sample4Momentum(G4LorentzVector* Mom, G4double Mass,
G4LorentzVector* AntiMom, G4double AntiMass,
G4double InitialMass)=0;
//-----------------------------------------------------------------------------
// For decision on continue or stop string fragmentation
virtual G4bool StopFragmenting(const G4FragmentingString * const string)=0;
virtual G4bool IsFragmentable(const G4FragmentingString * const string)=0;
// If a string can not fragment, make last break into 2 hadrons
virtual G4bool SplitLast(G4FragmentingString * string,
G4KineticTrackVector * LeftVector,
G4KineticTrackVector * RightVector)=0;
//-----------------------------------------------------------------------------
// If a string fragments, do the following
// For transver of a string to its CMS frame
G4ExcitedString *CPExcited(const G4ExcitedString& string);
G4KineticTrack * Splitup(G4FragmentingString *string,
G4FragmentingString *&newString);
G4ParticleDefinition * QuarkSplitup(G4ParticleDefinition* decay,
G4ParticleDefinition *&created);
G4ParticleDefinition * DiQuarkSplitup(G4ParticleDefinition* decay,
G4ParticleDefinition *&created);
pDefPair CreatePartonPair(G4int NeedParticle, G4bool AllowDiquarks=true);
public:
// used by G4VKinkyStringDecy..
G4int SampleQuarkFlavor(void);
G4ThreeVector SampleQuarkPt();
protected:
//-----------------------------------------------------------------------------
// For determination of kinematical properties of created hadron
// virtual G4LorentzVector * SplitEandP(G4ParticleDefinition * pHadron, // Uzhi
// G4FragmentingString * string )=0; // Uzhi
virtual G4LorentzVector * SplitEandP(G4ParticleDefinition * pHadron, // Uzhi
G4FragmentingString * string, // Uzhi
G4FragmentingString * newString )=0;// Uzhi
virtual G4double GetLightConeZ(G4double zmin, G4double zmax,
G4int PartonEncoding,
G4ParticleDefinition* pHadron,
G4double Px, G4double Py ) = 0;
void CalculateHadronTimePosition(G4double theInitialStringMass,
G4KineticTrackVector *);
// Used for some test purposes ------------------------------------------------
void ConstructParticle();
G4ParticleDefinition* CreateHadron(G4int id1, G4int id2,
G4bool theGivenSpin, G4int theSpin);
//-----------------------------------------------------------------------------
public:
G4KineticTrackVector* DecayResonans (G4KineticTrackVector* aHadrons);
void SetSigmaTransverseMomentum(G4double aQT);
void SetStrangenessSuppression(G4double aValue);
void SetDiquarkSuppression(G4double aValue);
@@ -71,10 +158,8 @@ public:
void SetScalarMesonMixings( std::vector<G4double> aVector);
void SetVectorMesonMixings( std::vector<G4double> aVector);
// used by G4VKinkyStringDecy..
G4int SampleQuarkFlavor(void);
G4ThreeVector SampleQuarkPt();
void SetStringTensionParameter(G4double aValue); // Uzhi 20 June 08
//private:
protected:
G4double GetDiquarkSuppress() {return DiquarkSuppress;};
@@ -82,14 +167,9 @@ protected:
G4double GetStrangeSuppress() {return StrangeSuppress;};
G4double GetClusterMass() {return ClusterMass;};
G4int GetClusterLoopInterrupt() {return ClusterLoopInterrupt;};
G4double GetStringTensionParameter() {return Kappa;}; // Uzhi 20 June 08
G4ParticleDefinition* CreateHadron(G4int id1, G4int id2, G4bool theGivenSpin, G4int theSpin);
virtual void Sample4Momentum(G4LorentzVector* Mom, G4double Mass, G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass)=0;
protected:
// Additional protected declarations
virtual G4double GetLightConeZ(G4double zmin, G4double zmax, G4int PartonEncoding, G4ParticleDefinition* pHadron, G4double Px, G4double Py) = 0;
//private:
protected:
G4double MassCut;
@@ -104,52 +184,21 @@ protected:
G4int SideOfDecay;
G4HadronBuilder *hadronizer;
void ConstructParticle();
G4double pspin_meson;
G4double pspin_barion;
std::vector<G4double> vectorMesonMix;
std::vector<G4double> scalarMesonMix;
G4bool PastInitPhase;
G4KineticTrackVector * LightFragmentationTest(const G4ExcitedString * const theString);
virtual G4bool StopFragmenting(const G4FragmentingString * const string)=0;
virtual G4bool IsFragmentable(const G4FragmentingString * const string)=0;
G4double Kappa; // String tension parameter // Uzhi 20 June 08
// G4double MinFragmentationMass(G4ExcitedString * theString,
// G4ParticleDefinition*& Hadron1,
// G4ParticleDefinition*& Hadron2);
typedef std::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);
virtual G4LorentzVector * SplitEandP(G4ParticleDefinition * pHadron, G4FragmentingString * string)=0;
virtual G4bool SplitLast(G4FragmentingString * string,
G4KineticTrackVector * LeftVector,
G4KineticTrackVector * RightVector)=0;
void CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector *);
G4ExcitedString *CPExcited(const G4ExcitedString& string);
G4ParticleDefinition* FindParticle(G4int Encoding);
// Additional Implementation Declarations
G4ParticleDefinition * QuarkSplitup(G4ParticleDefinition* decay,
G4ParticleDefinition *&created);
G4ParticleDefinition * DiQuarkSplitup(G4ParticleDefinition* decay,
G4ParticleDefinition *&created);
pDefPair CreatePartonPair(G4int NeedParticle, G4bool AllowDiquarks=true);
};
//**********************************************************************************************
//*************************************************************************************
// Class G4VLongitudinalStringDecay
#endif
@@ -79,18 +79,28 @@ G4FragmentingString::G4FragmentingString(const G4FragmentingString &old,
decaying=None;
if ( old.decaying == Left )
{
//G4cout<<" Left "<<G4endl;
//G4cout<<"Pt right "<<Ptright<<G4endl;
//G4cout<<"Pt left "<<Ptleft <<G4endl;
RightParton= old.RightParton;
Ptright = old.Ptright;
LeftParton = newdecay;
Ptleft = old.Ptleft - momentum->vect();
Ptleft.setZ(0.);
//G4cout<<"Pt right "<<Ptright<<G4endl;
//G4cout<<"Pt left "<<Ptleft <<G4endl;
} else if ( old.decaying == Right )
{
//G4cout<<" Right "<<G4endl;
//G4cout<<"Pt right "<<Ptright<<G4endl;
//G4cout<<"Pt left "<<Ptleft <<G4endl;
RightParton = newdecay;
Ptright = old.Ptright - momentum->vect();
Ptright.setZ(0.);
LeftParton = old.LeftParton;
Ptleft = old.Ptleft;
//G4cout<<"Pt right "<<Ptright<<G4endl;
//G4cout<<"Pt left "<<Ptleft <<G4endl;
} else
{
throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::G4FragmentingString: no decay Direction defined");
@@ -103,6 +113,27 @@ G4FragmentingString::G4FragmentingString(const G4FragmentingString &old,
}
//---------------------------------------------------------------------------------
G4FragmentingString::G4FragmentingString(const G4FragmentingString &old, // Uzhi
G4ParticleDefinition * newdecay) // Uzhi
{ // Uzhi
decaying=None; // Uzhi
if ( old.decaying == Left ) // Uzhi
{ // Uzhi
RightParton= old.RightParton; // Uzhi
LeftParton = newdecay; // Uzhi
} else if ( old.decaying == Right ) // Uzhi
{ // Uzhi
RightParton = newdecay; // Uzhi
LeftParton = old.LeftParton; // Uzhi
} else // Uzhi
{
throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::G4FragmentingString: no decay Direction defined");
}
}
//---------------------------------------------------------------------------------
G4FragmentingString::~G4FragmentingString()
@@ -214,3 +245,8 @@ G4double G4FragmentingString::Mass() const
{
return std::sqrt(this->Mass2());
}
G4double G4FragmentingString::MassT2() const
{
return Pplus*Pminus;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4HadronBuilder.cc,v 1.6 2006/06/29 20:55:01 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4HadronBuilder.cc,v 1.7 2008/04/25 14:20:14 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4LundStringFragmentation.cc,v 1.7 2007/04/24 14:55:23 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4LundStringFragmentation.cc,v 1.13 2008/06/23 09:17:10 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-02 $ 1.8
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -40,32 +40,36 @@
#include "Randomize.hh"
// Class G4LundStringFragmentation
//****************************************************************************************
//*************************************************************************************
G4LundStringFragmentation::G4LundStringFragmentation()
{
MinimalStringMass = 0.; // Uzhi
MinimalStringMass2 = 0.; // Uzhi
WminLUND = 1.*GeV; // Uzhi
SmoothParam = 0.2; // Uzhi
// ------ For estimation of a minimal string mass ---------------
Mass_of_light_quark =140.*MeV;
Mass_of_heavy_quark =500.*MeV;
Mass_of_string_junction=720.*MeV;
// ------ An estimated minimal string mass ----------------------
MinimalStringMass = 0.;
MinimalStringMass2 = 0.;
// ------ Minimal invariant mass used at a string fragmentation -
WminLUND = 0.7*GeV; // Uzhi 0.8 1.5
// ------ Smooth parameter used at a string fragmentation for ---
// ------ smearinr sharp mass cut-off ---------------------------
SmoothParam = 0.2;
SetStringTensionParameter(0.25); // Uzhi 20 June 08
}
// G4LundStringFragmentation::G4LundStringFragmentation(G4double sigmaPt)
// : G4VLongitudinalStringDecay(sigmaPt)
// {
// }
// --------------------------------------------------------------
G4LundStringFragmentation::G4LundStringFragmentation(const G4LundStringFragmentation &) : G4VLongitudinalStringDecay()
{
}
G4LundStringFragmentation::~G4LundStringFragmentation()
{
}
//****************************************************************************************
//*************************************************************************************
const G4LundStringFragmentation & G4LundStringFragmentation::operator=(const G4LundStringFragmentation &)
{
@@ -83,10 +87,80 @@ int G4LundStringFragmentation::operator!=(const G4LundStringFragmentation &right
return memcmp(this, &right, sizeof(G4LundStringFragmentation));
}
//****************************************************************************************
//----------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------
void G4LundStringFragmentation::SetMinimalStringMass(const G4FragmentingString * const string) // Uzhi
{
/*
G4cout<<"In SetMinMass -------------------"<<std::sqrt(string->Mass2())<<G4endl;
G4cout<<string->GetLeftParton()->GetPDGEncoding()<<" "<<
string->GetRightParton()->GetPDGEncoding()<<G4endl;
*/
G4double EstimatedMass=0.;
G4int Number_of_quarks=0;
G4KineticTrackVector* G4LundStringFragmentation::FragmentString(const G4ExcitedString& theString)
G4int Qleft =std::abs(string->GetLeftParton()->GetPDGEncoding());
if( Qleft > 1000)
{
Number_of_quarks+=2;
G4int q1=Qleft/1000;
if( q1 < 3) {EstimatedMass +=Mass_of_light_quark;}
if( q1 > 2) {EstimatedMass +=Mass_of_heavy_quark;}
G4int q2=(Qleft/100)%10;
if( q2 < 3) {EstimatedMass +=Mass_of_light_quark;}
if( q2 > 2) {EstimatedMass +=Mass_of_heavy_quark;}
EstimatedMass +=Mass_of_string_junction;
}
else
{
Number_of_quarks++;
if( Qleft < 3) {EstimatedMass +=Mass_of_light_quark;}
if( Qleft > 2) {EstimatedMass +=Mass_of_heavy_quark;}
}
G4int Qright=std::abs(string->GetRightParton()->GetPDGEncoding());
if( Qright > 1000)
{
Number_of_quarks+=2;
G4int q1=Qright/1000;
if( q1 < 3) {EstimatedMass +=Mass_of_light_quark;}
if( q1 > 2) {EstimatedMass +=Mass_of_heavy_quark;}
G4int q2=(Qright/100)%10;
if( q2 < 3) {EstimatedMass +=Mass_of_light_quark;}
if( q2 > 2) {EstimatedMass +=Mass_of_heavy_quark;}
EstimatedMass +=Mass_of_string_junction;
}
else
{
Number_of_quarks++;
if( Qright < 3) {EstimatedMass +=Mass_of_light_quark;}
if( Qright > 2) {EstimatedMass +=Mass_of_heavy_quark;}
}
if(Number_of_quarks==2){EstimatedMass +=100.*MeV;}
if(Number_of_quarks==3){EstimatedMass += 20.*MeV;}
if(Number_of_quarks==4){EstimatedMass -=2.*Mass_of_string_junction;
if(EstimatedMass <= 1600.*MeV){EstimatedMass-=200.*MeV;}
else {EstimatedMass+=100.*MeV;}
}
MinimalStringMass=EstimatedMass;
SetMinimalStringMass2(EstimatedMass);
//G4cout<<"Out SetMinimalStringMass "<<MinimalStringMass<<G4endl;
}
//--------------------------------------------------------------------------------------
void G4LundStringFragmentation::SetMinimalStringMass2(
const G4double aValue)
{
MinimalStringMass2=aValue * aValue;
}
//--------------------------------------------------------------------------------------
G4KineticTrackVector* G4LundStringFragmentation::FragmentString(
const G4ExcitedString& theString)
{
//G4cout<<"In FragmentString"<<G4endl;
@@ -95,46 +169,80 @@ G4KineticTrackVector* G4LundStringFragmentation::FragmentString(const G4ExcitedS
PastInitPhase=true;
// check if string has enough mass to fragment...
SetMassCut(160.*MeV); // For LightFragmentationTest it is required
// that no one pi-meson can be produced
/*
G4cout<<G4endl<<"G4LundStringFragmentation::"<<G4endl;
G4cout<<"FragmentString Position"<<theString.GetPosition()/fermi<<" "<<
theString.GetTimeOfCreation()/fermi<<G4endl;
G4cout<<"FragmentString Momentum"<<theString.Get4Momentum()<<theString.Get4Momentum().mag()<<G4endl;
*/
G4KineticTrackVector * LeftVector=LightFragmentationTest(&theString);
if ( LeftVector != 0 ) {
//G4cout<<"Return single hadron from string"<<G4endl;
return LeftVector;}
LeftVector = new G4KineticTrackVector;
//G4cout<<"Return single hadron insted of string"<<G4endl;
// Uzhi insert 6.05.08 start
if(LeftVector->size() == 1){
// One hadron is saved in the interaction
LeftVector->operator[](0)->SetFormationTime(theString.GetTimeOfCreation());
LeftVector->operator[](0)->SetPosition(theString.GetPosition());
/* // To set large formation time open *
LeftVector->operator[](0)->SetFormationTime(theString.GetTimeOfCreation()+100.*fermi);
LeftVector->operator[](0)->SetPosition(theString.GetPosition());
G4ThreeVector aPosition(theString.GetPosition().x(),
theString.GetPosition().y(),
theString.GetPosition().z()+100.*fermi);
LeftVector->operator[](0)->SetPosition(aPosition);
*/
//G4cout<<"Single hadron "<<LeftVector->operator[](0)->GetPosition()<<" "<<LeftVector->operator[](0)->GetFormationTime()<<G4endl;
} else { // 2 hadrons created from qq-qqbar are stored
LeftVector->operator[](0)->SetFormationTime(theString.GetTimeOfCreation());
LeftVector->operator[](0)->SetPosition(theString.GetPosition());
LeftVector->operator[](1)->SetFormationTime(theString.GetTimeOfCreation());
LeftVector->operator[](1)->SetPosition(theString.GetPosition());
}
// Uzhi insert 6.05.08 end
return LeftVector;
}
//--------------------- The string can fragment -------------------------------
//--------------- At least two particles can be produced ----------------------
LeftVector =new G4KineticTrackVector;
G4KineticTrackVector * RightVector=new G4KineticTrackVector;
// this should work but its only a semi deep copy. %GF G4ExcitedString theStringInCMS(theString);
G4ExcitedString *theStringInCMS=CPExcited(theString);
G4LorentzRotation toCms=theStringInCMS->TransformToAlignedCms();
G4bool success=false, inner_sucess=true;
G4int attempt=0;
while ( !success && attempt++ < StringLoopInterrupt )
{
{ // If the string fragmentation do not be happend, repeat the fragmentation---
G4FragmentingString *currentString=new G4FragmentingString(*theStringInCMS);
//G4cout<<"Main FragmentString cur M2 "<<std::sqrt(currentString->Mass2())<<G4endl;
std::for_each(LeftVector->begin(), LeftVector->end(), DeleteKineticTrack());
//G4cout<<"FragmentString cur M2 "<<std::sqrt(currentString->Mass2())<<G4endl;
// Cleaning up the previously produced hadrons ------------------------------
std::for_each(LeftVector->begin() , LeftVector->end() , DeleteKineticTrack());
LeftVector->clear();
std::for_each(RightVector->begin(), RightVector->end(), DeleteKineticTrack());
RightVector->clear();
// Main fragmentation loop until the string will not be able to fragment ----
inner_sucess=true; // set false on failure..
while (! StopFragmenting(currentString) )
{ // Split current string into hadron + new string
// G4FragmentingString *PreviousString=currentString; // Uzhi
G4FragmentingString *newString=0; // used as output from SplitUp...
//G4cout<<"FragmentString to Splitup ===================================="<<G4endl;
//G4cout<<"++++++++++++++++++++++++++ Enter num--------------------------"<<G4endl;
//G4int Uzhi; G4cin>>Uzhi; // Uzhi
G4KineticTrack * Hadron=Splitup(currentString,newString);
//G4cout<<" Hadron "<<Hadron<<G4endl;
// if ( Hadron != 0 && IsFragmentable(newString)) // Uzhi
if ( Hadron != 0 ) // Uzhi
if ( Hadron != 0 ) // Store the hadron
{
if ( currentString->GetDecayDirection() > 0 )
LeftVector->push_back(Hadron);
@@ -142,25 +250,17 @@ G4KineticTrackVector* G4LundStringFragmentation::FragmentString(const G4ExcitedS
RightVector->push_back(Hadron);
delete currentString;
currentString=newString;
} /* else { // Uzhi
// abandon ... start from the beginning
if (newString) delete newString; // ??? Uzhi local?
if (Hadron) delete Hadron;
// currentString = PreviousString; // Uzhi
inner_sucess=false;
break;
} */ // Uzhi
// delete PreviousString; // ??? Uzhi local?
}
};
// Split current string into 2 final Hadrons
// Split remaining string into 2 final Hadrons ------------------------
//G4cout<<"FragmentString to SplitLast if inner_sucess#0"<<inner_sucess<<G4endl;
if ( inner_sucess && // Uzhi
if ( inner_sucess &&
SplitLast(currentString,LeftVector, RightVector) )
{
success=true;
}
delete currentString;
}
} // End of the loop in attemps to fragment the string
delete theStringInCMS;
@@ -187,168 +287,98 @@ G4KineticTrackVector* G4LundStringFragmentation::FragmentString(const G4ExcitedS
G4LorentzRotation toObserverFrame(toCms.inverse());
// LeftVector->operator[](0)->SetFormationTime(theString.GetTimeOfCreation());
// LeftVector->operator[](0)->SetPosition(theString.GetPosition());
G4double TimeOftheStringCreation=theString.GetTimeOfCreation();
G4ThreeVector PositionOftheStringCreation(theString.GetPosition());
/* // For large formation time open *
G4double TimeOftheStringCreation=theString.GetTimeOfCreation()+100*fermi;
G4ThreeVector PositionOftheStringCreation(theString.GetPosition().x(),
theString.GetPosition().y(),
theString.GetPosition().z()+100*fermi);
*/
/*
if(theString.GetPosition().y() > 100.*fermi){
// It is a projectile-like string -------------------------------------
G4double Zmin=theString.GetPosition().y()-1000.*fermi;
G4double Zmax=theString.GetPosition().z();
TimeOftheStringCreation=
(Zmax-Zmin)*theString.Get4Momentum().e()/theString.Get4Momentum().z();
G4ThreeVector aPosition(0.,0.,Zmax);
PositionOftheStringCreation=aPosition;
}
*/
for(size_t C1 = 0; C1 < LeftVector->size(); C1++)
{
G4KineticTrack* Hadron = LeftVector->operator[](C1);
G4LorentzVector Momentum = Hadron->Get4Momentum();
Momentum = toObserverFrame*Momentum;
Hadron->Set4Momentum(Momentum);
G4LorentzVector Coordinate(Hadron->GetPosition(), Hadron->GetFormationTime());
Momentum = toObserverFrame*Coordinate;
Hadron->SetFormationTime(Momentum.e());
Hadron->SetFormationTime(TimeOftheStringCreation+Momentum.e());
G4ThreeVector aPosition(Momentum.vect());
Hadron->SetPosition(theString.GetPosition()+aPosition);
}
// Hadron->SetPosition(theString.GetPosition()+aPosition);
Hadron->SetPosition(PositionOftheStringCreation+aPosition);
//G4cout<<"Hadron "<<C1<<" "<<Hadron->GetPosition()/fermi<<" "<<Hadron->GetFormationTime()/fermi<<G4endl;
};
//G4cout<<"Out FragmentString"<<G4endl;
return LeftVector;
}
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
G4bool G4LundStringFragmentation::IsFragmentable(const G4FragmentingString * const string)
{
//G4cout<<"In IsFragmentable"<<G4endl;
SetMinimalStringMass(string); // Uzhi
//G4cout<<"Out IsFragmentable MinMass"<<MinimalStringMass<<" String Mass"<<std::sqrt(string->Get4Momentum().mag2())<<G4endl;
return sqr(MinimalStringMass + WminLUND) < string->Get4Momentum().mag2(); // Uzhi
//G4double G4LundStringFragmentation::GetLightConeZ(G4double zmin, G4double zmax, // Uzhi
// G4int , G4ParticleDefinition* pHadron, // Uzhi
G4double G4LundStringFragmentation::GetLightConeZ(G4double zmin, G4double zmax,
G4int, G4ParticleDefinition* pHadron, // Uzhi
G4double Px, G4double Py)
{
const G4double alund = 0.7/GeV/GeV;
// If blund get restored, you MUST adapt the calculation of zOfMaxyf.
// const G4double blund = 1;
G4double z, yf;
G4double Mass = pHadron->GetPDGMass();
G4double Mt2 = Px*Px + Py*Py + Mass*Mass;
G4double zOfMaxyf=alund*Mt2/(alund*Mt2 + 1.);
G4double maxYf=(1-zOfMaxyf)/zOfMaxyf * std::exp(-alund*Mt2/zOfMaxyf);
// G4double N=1.; // Uzhi
// G4double OverN=1./N; // Uzhi
// G4double ZminN=std::pow(zmin,N); // Uzhi
// G4double ZmaxN=std::pow(zmax,N); // Uzhi
// G4double Brac=ZmaxN-ZminN; // Uzhi
//G4cout<<" ZminN ZmaxN Brac Code "<<ZminN<<" "<< ZmaxN<<" "<<Brac<<" "<<PartonEncoding<<G4endl;
// if(std::abs(PartonEncoding) < 1000) // Uzhi
{ // Uzhi q or q-bar
//G4cout<<" quark "<<G4endl; // Vova
do // Uzhi
{
z = zmin + G4UniformRand()*(zmax-zmin);
// yf = std::pow(1. - z, blund)/z*std::exp(-alund*Mt2/z);
yf = (1-z)/z * std::exp(-alund*Mt2/z);
}
while (G4UniformRand()*maxYf > yf);
} // Uzhi
// else // Uzhi
// { // Uzhi qq or qq-bar
// //G4cout<<"Di-quark"<<G4endl; // Vova
// z = std::pow(Brac * G4UniformRand() + ZminN, OverN); // Uzhi
// }; // Uzhi
//
//G4cout<<" test z "<<std::pow(2.,3.)<<" "<<z<<G4endl; // Vova
return z;
}
//-----------------------------------------------------------------------------------------
G4LorentzVector * G4LundStringFragmentation::SplitEandP(G4ParticleDefinition * pHadron,
G4FragmentingString * string)
{
G4double HadronMass = pHadron->GetPDGMass();
SetMinimalStringMass(string); // Uzhi
G4double StringMass2 = string->Mass2(); // Uzhi
//G4cout<<"SplitEandP string mass "<<string->Mass()<<" Hadron mass "<<HadronMass<<pHadron->GetParticleName()<<G4endl; // Uzhi
//G4cout<<string->GetLeftParton()->GetPDGEncoding()<<" "<<G4endl;
//G4cout<<string->GetRightParton()->GetPDGEncoding()<<" "<<G4endl;
//G4cout<<" Min string mass "<<MinimalStringMass<<G4endl;
// calculate and assign hadron transverse momentum component HadronPx andHadronPy
G4ThreeVector thePt;
thePt=SampleQuarkPt();
G4ThreeVector HadronPt = thePt +string->DecayPt();
HadronPt.setZ(0);
//... sample z to define hadron longitudinal momentum and energy
//... but first check the available phase space
// G4double DecayQuarkMass2 = sqr(string->GetDecayParton()->GetPDGMass());
//G4cout<<" QuarkMass "<<string->GetDecayParton()->GetPDGMass()<<G4endl; // Uzhi
G4double HadronMass2T = sqr(HadronMass) + HadronPt.mag2();
// G4double ResidualMass2T=sqr(MinimalStringMass + WminLUND) + HadronPt.mag2(); // Uzhi
G4double ResidualMass2T=sqr(MinimalStringMass + WminLUND) + HadronPt.mag2(); // Uzhi
//G4cout<<" Mt h res str "<<std::sqrt(HadronMass2T)<<" "<<std::sqrt(ResidualMass2T)<<" srt mass"<<string->Mass()<<G4endl;
// if (DecayQuarkMass2 + HadronMass2T >= SmoothParam*(string->Mass2()) ) // Uzhi
G4double Pz2 = (sqr(StringMass2 - HadronMass2T - ResidualMass2T) - // Uzhi
4*HadronMass2T * ResidualMass2T)/4./StringMass2; // Uzhi
//G4cout<<" Pz**2 "<<Pz2<<G4endl;
if(Pz2 < 0 ) {return 0;} // have to start all over! // Uzhi
//... then compute allowed z region z_min <= z <= z_max
G4double Pz = std::sqrt(Pz2); // Uzhi
G4double zMin = (std::sqrt(HadronMass2T+Pz2) - Pz)/std::sqrt(StringMass2); // Uzhi
G4double zMax = (std::sqrt(HadronMass2T+Pz2) + Pz)/std::sqrt(StringMass2); // Uzhi
//G4cout<<" Zmin max "<<zMin<<" "<<zMax<<G4endl; // Uzhi
// G4double zMax = 1. - DecayQuarkMass2/(string->Mass2()); // Uzhi
if (zMin >= zMax) return 0; // have to start all over!
G4double z = GetLightConeZ(zMin, zMax,
string->GetDecayParton()->GetPDGEncoding(), pHadron,
HadronPt.x(), HadronPt.y());
//... now compute hadron longitudinal momentum and energy
// longitudinal hadron momentum component HadronPz
HadronPt.setZ(0.5* string->GetDecayDirection() *
(z * string->LightConeDecay() -
HadronMass2T/(z * string->LightConeDecay())));
G4double HadronE = 0.5* (z * string->LightConeDecay() +
HadronMass2T/(z * string->LightConeDecay()));
G4LorentzVector * a4Momentum= new G4LorentzVector(HadronPt,HadronE);
//G4cout<<"Out of SplitEandP Pz E "<<HadronPt.getZ()<<" "<<0.5* (z * string->LightConeDecay() + HadronMass2T/(z * string->LightConeDecay()))<<G4endl;
return a4Momentum;
// return sqr(FragmentationMass(string)+MassCut) < // Uzhi
// string->Mass2(); // Uzhi
}
//----------------------------------------------------------------------------------------
G4bool G4LundStringFragmentation::StopFragmenting(const G4FragmentingString * const string)
{
//G4cout<<"StopFragmenting"<<G4endl;
//-----------------------------------------------------------------------------------------
SetMinimalStringMass(string);
//G4cout<<"StopFragm MinMass "<<MinimalStringMass<<" String Mass "<<std::sqrt(string->Get4Momentum().mag2())<<G4endl;
return (MinimalStringMass + WminLUND)*
(1 + SmoothParam * (1.-2*G4UniformRand())) >
string->Mass();
}
//----------------------------------------------------------------------------------------
G4bool G4LundStringFragmentation::SplitLast(G4FragmentingString * string,
G4KineticTrackVector * LeftVector,
G4KineticTrackVector * RightVector)
{
//... perform last cluster decay
//G4cout<<"SplitLast String mass "<<string->Mass()<<G4endl;
//G4cout<<string->GetLeftParton()->GetPDGEncoding()<<" "<<G4endl;
//G4cout<<string->GetRightParton()->GetPDGEncoding()<<" "<<G4endl;
/*
G4cout<<"SplitLast String mass "<<string->Mass()<<G4endl;
G4cout<<string->GetLeftParton()->GetPDGEncoding()<<" "<<G4endl;
G4cout<<string->GetRightParton()->GetPDGEncoding()<<" "<<G4endl;
*/
G4LorentzVector Str4Mom=string->Get4Momentum();
//G4cout<<"String 4 momentum "<<Str4Mom<<G4endl;
G4ThreeVector ClusterVel =string->Get4Momentum().boostVector();
G4double ResidualMass = string->Mass();
// G4double ClusterMassCut = ClusterMass;
G4int cClusterInterrupt = 0;
G4ParticleDefinition * LeftHadron, * RightHadron;
G4int cClusterInterrupt = 0;
do
{
//G4cout<<" Cicle "<<cClusterInterrupt<<" "<< ClusterLoopInterrupt<<G4endl;
@@ -360,48 +390,75 @@ G4bool G4LundStringFragmentation::SplitLast(G4FragmentingString * string,
G4ParticleDefinition * quark = NULL;
string->SetLeftPartonStable(); // to query quark contents..
if (string->DecayIsQuark() && string->StableIsQuark() )
{
//... there are quarks on cluster ends
LeftHadron= QuarkSplitup(string->GetLeftParton(), quark);
} else {
//... there is a Diquark on cluster ends
G4int IsParticle;
if (!string->FourQuarkString() )
{
// The string is q-qbar, or q-qq, or qbar-qqbar type
if (string->DecayIsQuark() && string->StableIsQuark() )
{
//... there are quarks on cluster ends
LeftHadron= QuarkSplitup(string->GetLeftParton(), quark);
} else
{
//... there is a Diquark on one of the cluster ends
G4int IsParticle;
if ( string->StableIsQuark() ) {
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
} else {
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? +1 : -1;
}
if ( string->StableIsQuark() )
{
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? -1 : +1;
} else
{
IsParticle=(string->GetLeftParton()->GetPDGEncoding()>0) ? +1 : -1;
}
pDefPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted
quark = QuarkPair.second;
pDefPair QuarkPair = CreatePartonPair(IsParticle,false); // no diquarks wanted
quark = QuarkPair.second;
LeftHadron=hadronizer->Build(QuarkPair.first, string->GetLeftParton());
}
LeftHadron=hadronizer->Build(QuarkPair.first, string->GetLeftParton());
}
RightHadron = hadronizer->Build(string->GetRightParton(), quark);
RightHadron = hadronizer->Build(string->GetRightParton(), quark);
} else
{
// The string is qq-qqbar type. Diquarks are on the string ends
G4int LiftQuark1= string->GetLeftParton()->GetPDGEncoding()/1000;
G4int LiftQuark2=(string->GetLeftParton()->GetPDGEncoding()/100)%10;
//G4cout<<"SplitLast Left Right hadrons "<<LeftHadron->GetPDGEncoding()<<" "<<RightHadron->GetPDGEncoding()<<G4endl;
//G4cout<<"SplitLast Left Right hadrons "<<LeftHadron->GetPDGMass()<<" "<<RightHadron->GetPDGMass()<<G4endl;
//G4cout<<" Sum H mass Str Mass "<<LeftHadron->GetPDGMass() + RightHadron->GetPDGMass()<<" "<<ResidualMass<<G4endl;
G4int RightQuark1= string->GetRightParton()->GetPDGEncoding()/1000;
G4int RightQuark2=(string->GetRightParton()->GetPDGEncoding()/100)%10;
if(G4UniformRand()<0.5)
{
LeftHadron =hadronizer->Build(FindParticle( LiftQuark1),
FindParticle(RightQuark1));
RightHadron=hadronizer->Build(FindParticle( LiftQuark2),
FindParticle(RightQuark2));
} else
{
LeftHadron =hadronizer->Build(FindParticle( LiftQuark1),
FindParticle(RightQuark2));
RightHadron=hadronizer->Build(FindParticle( LiftQuark2),
FindParticle(RightQuark1));
}
}
/*
G4cout<<"SplitLast Left Right hadrons "<<LeftHadron->GetPDGEncoding()<<" "<<RightHadron->GetPDGEncoding()<<G4endl;
G4cout<<"SplitLast Left Right hadrons "<<LeftHadron->GetPDGMass()<<" "<<RightHadron->GetPDGMass()<<G4endl;
G4cout<<"Sum H mass Str Mass "<<LeftHadron->GetPDGMass() + RightHadron->GetPDGMass()<<" "<<ResidualMass<<G4endl;
*/
//... repeat procedure, if mass of cluster is too low to produce hadrons
//... ClusterMassCut = 0.15*GeV model parameter
// if ( quark->GetParticleSubType()== "quark" ) {ClusterMassCut = 0.;} // Uzhi
// else {ClusterMassCut = ClusterMass;} // Uzhi
}
while (ResidualMass <= LeftHadron->GetPDGMass() + RightHadron->GetPDGMass()); // Uzhi VOVA
// while (ResidualMass <= LeftHadron->GetPDGMass() + RightHadron->GetPDGMass() + ClusterMassCut); // Uzhi
while (ResidualMass <= LeftHadron->GetPDGMass() + RightHadron->GetPDGMass());// UzhiVOVA
//... compute hadron momenta and energies
G4LorentzVector LeftMom, RightMom;
G4ThreeVector Pos;
//G4cout<<"Sample4Momentum"<<G4endl;
Sample4Momentum(&LeftMom, LeftHadron->GetPDGMass(), &RightMom, RightHadron->GetPDGMass(), ResidualMass);
Sample4Momentum(&LeftMom, LeftHadron->GetPDGMass(),
&RightMom, RightHadron->GetPDGMass(),
ResidualMass);
LeftMom.boost(ClusterVel);
RightMom.boost(ClusterVel);
@@ -409,186 +466,219 @@ G4bool G4LundStringFragmentation::SplitLast(G4FragmentingString * string,
LeftVector->push_back(new G4KineticTrack(LeftHadron, 0, Pos, LeftMom));
RightVector->push_back(new G4KineticTrack(RightHadron, 0, Pos, RightMom));
//G4cout<<"Out SplitLast "<<G4endl;
return true;
}
//----------------------------------------------------------------------------------------------------------
G4bool G4LundStringFragmentation::IsFragmentable(const G4FragmentingString * const string)
{
//G4cout<<"In IsFragmentable"<<G4endl;
SetMinimalStringMass(string); // Uzhi
//G4cout<<"Out IsFragmentable MinMass"<<MinimalStringMass<<" String Mass"<<std::sqrt(string->Get4Momentum().mag2())<<G4endl;
return sqr(MinimalStringMass + WminLUND) < string->Get4Momentum().mag2(); // Uzhi
// return sqr(FragmentationMass(string)+MassCut) < // Uzhi
// string->Mass2(); // Uzhi
}
//----------------------------------------------------------------------------------------------------------
G4bool G4LundStringFragmentation::StopFragmenting(const G4FragmentingString * const string)
{
//G4cout<<"StopFragmenting"<<G4endl;
SetMinimalStringMass(string); // Uzhi
//G4cout<<"StopFragm MinMass "<<MinimalStringMass<<" String Mass "<<std::sqrt(string->Get4Momentum().mag2())<<G4endl;
return sqr((MinimalStringMass + WminLUND)*(1 + SmoothParam * (1.-2*G4UniformRand()))) > // Uzhi
string->Get4Momentum().mag2(); // Uzhi
// sqr(FragmentationMass(string,&G4HadronBuilder::BuildHighSpin)+MassCut) > // Uzhi
// string->Get4Momentum().mag2(); // Uzhi
}
//----------------------------------------------------------------------------------------------------------
void G4LundStringFragmentation::Sample4Momentum(G4LorentzVector* Mom, G4double Mass, G4LorentzVector* AntiMom, G4double AntiMass, G4double InitialMass)
{
G4ThreeVector Pt; // Uzhi
G4double MassMt2, AntiMassMt2; // Uzhi
G4double AvailablePz, AvailablePz2; // Uzhi
{
// ------ Sampling of momenta of 2 last produced hadrons --------------------
G4ThreeVector Pt;
G4double MassMt2, AntiMassMt2;
G4double AvailablePz, AvailablePz2;
//G4cout<<" Smpl4Mom "<<Mass<<" "<<AntiMass<<" "<<InitialMass<<G4endl;
// Uzhi
do // Uzhi
{ // Uzhi
Pt=SampleQuarkPt(); Pt.setZ(0); G4double Pt2=Pt.mag2(); // Uzhi
//G4cout<<"Sample4Momentum "<<G4endl;
//G4cout<<"Sample4Momentum Mass"<<Mass<<" "<<AntiMass<<" "<<InitialMass<<G4endl;
if(Mass > 930. || AntiMass > 930.) // If there is a baryon
{
// ----------------- Isotripic decay ------------------------------------
G4double r_val = sqr(InitialMass*InitialMass - Mass*Mass - AntiMass*AntiMass) -
sqr(2.*Mass*AntiMass);
G4double Pabs = (r_val > 0.)? std::sqrt(r_val)/(2.*InitialMass) : 0;
//... sample unit vector
G4double pz = 1. - 2.*G4UniformRand();
G4double st = std::sqrt(1. - pz * pz)*Pabs;
G4double phi = 2.*pi*G4UniformRand();
G4double px = st*std::cos(phi);
G4double py = st*std::sin(phi);
pz *= Pabs;
Mom->setPx(px); Mom->setPy(py); Mom->setPz(pz);
Mom->setE(std::sqrt(Pabs*Pabs + Mass*Mass));
AntiMom->setPx(-px); AntiMom->setPy(-py); AntiMom->setPz(-pz);
AntiMom->setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass));
}
else
{
do
{
Pt=SampleQuarkPt(); Pt.setZ(0); G4double Pt2=Pt.mag2();
//G4cout<<"Sample4Momentum Pt x y "<<Pt.getX()<<" "<<Pt.getY()<<G4endl;
MassMt2 = Mass * Mass + Pt2; // Uzhi
AntiMassMt2= AntiMass * AntiMass + Pt2; // Uzhi
MassMt2 = Mass * Mass + Pt2;
AntiMassMt2= AntiMass * AntiMass + Pt2;
//G4cout<<"Mts "<<MassMt2<<" "<<AntiMassMt2<<" "<<InitialMass*InitialMass<<G4endl;
AvailablePz2= sqr(InitialMass*InitialMass - MassMt2 - AntiMassMt2) -
4.*MassMt2*AntiMassMt2; // Uzhi
} // Uzhi
while(AvailablePz2 < 0.); // Uzhi
// Uzhi
AvailablePz2 /=(4.*InitialMass*InitialMass); // Uzhi
// Uzhi
AvailablePz = std::sqrt(AvailablePz2); // Uzhi
AvailablePz2= sqr(InitialMass*InitialMass - MassMt2 - AntiMassMt2) -
4.*MassMt2*AntiMassMt2;
}
while(AvailablePz2 < 0.);
AvailablePz2 /=(4.*InitialMass*InitialMass);
AvailablePz = std::sqrt(AvailablePz2);
//G4cout<<"AvailablePz "<<AvailablePz<<G4endl;
G4double Px=Pt.getX();
G4double Py=Pt.getY();
G4double Px=Pt.getX(); // Uzhi
G4double Py=Pt.getY(); // Uzhi
// Uzhi
Mom->setPx(Px); Mom->setPy(Py); Mom->setPz(AvailablePz); // Uzhi
Mom->setE(std::sqrt(MassMt2+AvailablePz2)); // Uzhi
//if(Mass > AntiMass){AvailablePz=-AvailablePz;} // May30 // Uzhi
Mom->setPx(Px); Mom->setPy(Py); Mom->setPz(AvailablePz);
Mom->setE(std::sqrt(MassMt2+AvailablePz2));
//G4cout<<" 1 part "<<Px<<" "<<Py<<" "<<AvailablePz<<" "<<std::sqrt(MassMt2+AvailablePz2)<<G4endl;
// Uzhi
AntiMom->setPx(-Px); AntiMom->setPy(-Py); AntiMom->setPz(-AvailablePz); // Uzhi
AntiMom->setE (std::sqrt(AntiMassMt2+AvailablePz2)); // Uzhi
AntiMom->setPx(-Px); AntiMom->setPy(-Py); AntiMom->setPz(-AvailablePz);
AntiMom->setE (std::sqrt(AntiMassMt2+AvailablePz2));
//G4cout<<" 2 part "<<-Px<<" "<<-Py<<" "<<-AvailablePz<<" "<<std::sqrt(AntiMassMt2+AvailablePz2)<<G4endl;
// Maybe it must be inversed! // Uzhi
/* // Uzhi
G4double r_val = sqr(InitialMass*InitialMass - Mass*Mass - AntiMass*AntiMass) - sqr(2.*Mass*AntiMass);
G4double Pabs = (r_val > 0.)? std::sqrt(r_val)/(2.*InitialMass) : 0;
//... sample unit vector
G4double pz = 1. - 2.*G4UniformRand();
G4double st = std::sqrt(1. - pz * pz)*Pabs;
G4double phi = 2.*pi*G4UniformRand();
G4double px = st*std::cos(phi);
G4double py = st*std::sin(phi);
pz *= Pabs;
Mom->setPx(px); Mom->setPy(py); Mom->setPz(pz);
Mom->setE(std::sqrt(Pabs*Pabs + Mass*Mass));
AntiMom->setPx(-px); AntiMom->setPy(-py); AntiMom->setPz(-pz);
AntiMom->setE (std::sqrt(Pabs*Pabs + AntiMass*AntiMass));
*/ // Uzhi
}
//G4cout<<"Out Sample4Momentum "<<G4endl;
}
void G4LundStringFragmentation::SetMinimalStringMass(const G4FragmentingString * const string) // Uzhi
{
//G4cout<<"In SetMinMass -------------------"<<std::sqrt(string->Mass2())<<G4endl;
//G4cout<<string->GetLeftParton()->GetPDGEncoding()<<G4endl;
//G4cout<<string->GetRightParton()->GetPDGEncoding()<<G4endl;
//-----------------------------------------------------------------------------
G4double EstimatedMass=0.750* GeV; // 2*m_q
G4int Qleft =std::abs(string->GetLeftParton()->GetPDGEncoding());
if( Qleft > 1000)
{
G4int q1=Qleft/1000;
if( q1 < 3) {EstimatedMass += 0.325* GeV;}
if( q1 > 2) {EstimatedMass += 0.500* GeV;}
G4int q2=(Qleft/100)%10;
if( q2 < 3) {EstimatedMass += 0.325* GeV;}
if( q2 > 2) {EstimatedMass += 0.500* GeV;}
}
else
{
if( Qleft < 3) {EstimatedMass += 0.325* GeV;}
if( Qleft > 2) {EstimatedMass += 0.500* GeV;}
}
G4int Qright=std::abs(string->GetRightParton()->GetPDGEncoding());
if( Qright > 1000)
{
G4int q1=Qright/1000;
if( q1 < 3) {EstimatedMass += 0.325* GeV;}
if( q1 > 2) {EstimatedMass += 0.500* GeV;}
G4int q2=(Qright/100)%10;
if( q2 < 3) {EstimatedMass += 0.325* GeV;}
if( q2 > 2) {EstimatedMass += 0.500* GeV;}
}
else
{
if( Qright < 3) {EstimatedMass += 0.325* GeV;}
if( Qright > 2) {EstimatedMass += 0.500* GeV;}
}
MinimalStringMass=EstimatedMass;
SetMinimalStringMass2(EstimatedMass);
/*
Pcreate build=&G4HadronBuilder::BuildLowSpin;
G4ParticleDefinition *Hadron1, *Hadron2=0;
G4int iflc = (G4UniformRand() < 0.5)? 1 : 2;
if (string->GetLeftParton()->GetParticleSubType() == "quark") iflc = -iflc;
if (string->GetLeftParton()->GetPDGEncoding() < 0) iflc = -iflc;
// 1/2 baryon (anti-baryon) and scalar meson (QQ-q or QbarQbar-Qbar),
// or 2 scalar mesons (Q-Qbar),
// or 2 1/2 baryons (anti-baryons) will be built (QQ-QbarQbar)
//G4cout<<"In SetMinMass -------------------"<<std::sqrt(string->Mass2())<<G4endl;
//G4cout<<string->GetLeftParton()->GetPDGEncoding()<<" "<<FindParticle(iflc)->GetPDGEncoding()<<G4endl;
//G4cout<<string->GetRightParton()->GetPDGEncoding()<<" "<<FindParticle(-iflc)->GetPDGEncoding()<<G4endl;
Hadron1 = (hadronizer->*build)(string->GetLeftParton(),FindParticle(iflc));
Hadron2 =(hadronizer->*build)(string->GetRightParton(),FindParticle(-iflc));
MinimalStringMass = (Hadron1)->GetPDGMass() + (Hadron2)->GetPDGMass();
//G4cout<<(Hadron1)->GetPDGEncoding()<<" "<<(Hadron2)->GetPDGEncoding()<<G4endl;
//G4cout<<"Out SetMinMass "<<MinimalStringMass<<G4endl;
G4LorentzVector * G4LundStringFragmentation::SplitEandP(G4ParticleDefinition * pHadron,
G4FragmentingString * string, G4FragmentingString * newString)
{
/*
G4cout<<"SplitEandP "<<G4endl;
G4cout<<"SplitEandP string mass "<<string->Mass()<<G4endl;
G4cout<<string->GetLeftParton()->GetPDGEncoding()<<" "
<<string->GetRightParton()->GetPDGEncoding()<<" "<<G4endl;
G4cout<<G4endl;
G4cout<<newString->GetLeftParton()->GetPDGEncoding()<<" "<<G4endl;
G4cout<<newString->GetRightParton()->GetPDGEncoding()<<" "<<G4endl;
*/
// SetMinimalStringMass2(MinimalStringMass);
}
//*******************************************************************************************************
G4LorentzVector String4Momentum=string->Get4Momentum();
G4double StringMT2=string->Get4Momentum().mt2();
//G4cout<<"StringMt2 "<<StringMT2<<G4endl;
void G4LundStringFragmentation::SetMinimalStringMass2(const G4double aValue) // Uzhi
G4double HadronMass = pHadron->GetPDGMass();
//G4cout<<"Hadron mass "<<HadronMass<<" "<<pHadron->GetParticleName()<<G4endl;
SetMinimalStringMass(newString);
String4Momentum.setPz(0.);
G4ThreeVector StringPt=String4Momentum.vect();
//G4cout<<"StringPt "<<StringPt<<G4endl<<G4endl;
//G4cout<<"Min string mass "<<MinimalStringMass<<G4endl;
// calculate and assign hadron transverse momentum component HadronPx and HadronPy
G4ThreeVector thePt;
thePt=SampleQuarkPt();
G4ThreeVector HadronPt = thePt +string->DecayPt();
HadronPt.setZ(0);
//G4cout<<"Hadron Pt"<<HadronPt<<G4endl;
G4ThreeVector RemSysPt = StringPt - HadronPt;
//G4cout<<"RemSys Pt"<<RemSysPt<<G4endl;
//... sample z to define hadron longitudinal momentum and energy
//... but first check the available phase space
G4double HadronMassT2 = sqr(HadronMass) + HadronPt.mag2();
G4double ResidualMassT2=sqr(MinimalStringMass) + RemSysPt.mag2();
//G4cout<<"Mt h res str "<<std::sqrt(HadronMassT2)<<" "<<std::sqrt(ResidualMassT2)<<" srt mass"<<StringMT2<<G4endl;
G4double Pz2 = (sqr(StringMT2 - HadronMassT2 - ResidualMassT2) -
4*HadronMassT2 * ResidualMassT2)/4./StringMT2;
//G4cout<<"Pz**2 "<<Pz2<<G4endl;
if(Pz2 < 0 ) {return 0;} // have to start all over!
//... then compute allowed z region z_min <= z <= z_max
G4double Pz = std::sqrt(Pz2);
G4double zMin = (std::sqrt(HadronMassT2+Pz2) - Pz)/std::sqrt(StringMT2);
G4double zMax = (std::sqrt(HadronMassT2+Pz2) + Pz)/std::sqrt(StringMT2);
//G4cout<<"Zmin max "<<zMin<<" "<<zMax<<G4endl; // Uzhi
if (zMin >= zMax) return 0; // have to start all over!
G4double z = GetLightConeZ(zMin, zMax,
string->GetDecayParton()->GetPDGEncoding(), pHadron,
HadronPt.x(), HadronPt.y());
//... now compute hadron longitudinal momentum and energy
// longitudinal hadron momentum component HadronPz
HadronPt.setZ(0.5* string->GetDecayDirection() *
(z * string->LightConeDecay() -
HadronMassT2/(z * string->LightConeDecay())));
G4double HadronE = 0.5* (z * string->LightConeDecay() +
HadronMassT2/(z * string->LightConeDecay()));
G4LorentzVector * a4Momentum= new G4LorentzVector(HadronPt,HadronE);
//G4cout<<"Hadron Pt"<<HadronPt<<G4endl;
//G4cout<<"Out of SplitEandP Pz E "<<HadronPt.getZ()<<" "<<HadronE<<G4endl;
return a4Momentum;
}
//-----------------------------------------------------------------------------------------
G4double G4LundStringFragmentation::GetLightConeZ(G4double zmin, G4double zmax,
G4int PDGEncodingOfDecayParton,
G4ParticleDefinition* pHadron,
G4double Px, G4double Py)
{
MinimalStringMass2=aValue * aValue;
}
//*******************************************************************************************************
G4double alund;
//****************************************************************************************
// If blund get restored, you MUST adapt the calculation of zOfMaxyf.
// const G4double blund = 1;
G4double z, yf;
G4double Mass = pHadron->GetPDGMass();
// G4int HadronEncoding=pHadron->GetPDGEncoding();
G4double Mt2 = Px*Px + Py*Py + Mass*Mass;
if(std::abs(PDGEncodingOfDecayParton) < 1000)
{
// ---------------- Quark fragmentation ----------------------
alund=0.35/GeV/GeV; // Instead of 0.7 because kinks are not considered
G4double zOfMaxyf=alund*Mt2/(alund*Mt2 + 1.);
G4double maxYf=(1-zOfMaxyf)/zOfMaxyf * std::exp(-alund*Mt2/zOfMaxyf);
do
{
z = zmin + G4UniformRand()*(zmax-zmin);
// yf = std::pow(1. - z, blund)/z*std::exp(-alund*Mt2/z);
yf = (1-z)/z * std::exp(-alund*Mt2/z);
}
while (G4UniformRand()*maxYf > yf);
}
else
{
// ---------------- Di-quark fragmentation ----------------------
//G4cout<<"Di-quark"<<G4endl; // Vova
alund=0.7/GeV/GeV; // 0.7 2.0
G4double zOfMaxyf=alund*Mt2/(alund*Mt2 + 1.);
G4double maxYf=(1-zOfMaxyf)/zOfMaxyf * std::exp(-alund*Mt2/zOfMaxyf);
do
{
z = zmin + G4UniformRand()*(zmax-zmin);
// yf = std::pow(1. - z, blund)/z*std::exp(-alund*Mt2/z);
yf = (1-z)/z * std::exp(-alund*Mt2/z);
}
while (G4UniformRand()*maxYf > yf);
};
//G4cout<<" test z "<<std::pow(2.,3.)<<" "<<z<<G4endl;
return z;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4QGSMFragmentation.cc,v 1.6 2007/04/24 14:55:23 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4QGSMFragmentation.cc,v 1.9 2008/06/23 08:35:55 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -120,7 +120,7 @@ G4KineticTrackVector* G4QGSMFragmentation::FragmentString(const G4ExcitedString&
currentString=newString;
} else {
// abandon ... start from the beginning
if (newString) delete newString;
if (newString) delete newString; // Uzhi restore 20.06.08
if (Hadron) delete Hadron;
inner_sucess=false;
break;
@@ -228,7 +228,8 @@ G4double G4QGSMFragmentation::GetLightConeZ(G4double zmin, G4double zmax, G4int
//-----------------------------------------------------------------------------------------
G4LorentzVector * G4QGSMFragmentation::SplitEandP(G4ParticleDefinition * pHadron,
G4FragmentingString * string)
G4FragmentingString * string, // Uzhi
G4FragmentingString * ) // Uzhi
{
G4double HadronMass = pHadron->GetPDGMass();
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VKinkyStringDecay.cc,v 1.3 2006/06/29 20:55:07 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4VKinkyStringDecay.cc,v 1.4 2008/04/25 14:20:14 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
// Maxim Komogorov
//
// -----------------------------------------------------------------------------
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VLongitudinalStringDecay.cc,v 1.8 2007/04/24 14:55:23 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4VLongitudinalStringDecay.cc,v 1.13 2008/06/23 08:35:55 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// -----------------------------------------------------------------------------
// GEANT 4 class implementation file
@@ -74,7 +74,7 @@ G4VLongitudinalStringDecay::G4VLongitudinalStringDecay()
SigmaQT = 0.5 * GeV;
StrangeSuppress = 0.44; // 27 % strange quarks produced, ie. u:d:s=1:1:0.27
DiquarkSuppress = 0.1;
DiquarkSuppress = 0.07;
DiquarkBreakProb = 0.1;
//... pspin_meson is probability to create vector meson
@@ -105,6 +105,9 @@ G4VLongitudinalStringDecay::G4VLongitudinalStringDecay()
PastInitPhase=false;
hadronizer = new G4HadronBuilder(pspin_meson,pspin_barion,
scalarMesonMix,vectorMesonMix);
Kappa = 1.0 * GeV/fermi;
}
@@ -113,7 +116,7 @@ G4VLongitudinalStringDecay::~G4VLongitudinalStringDecay()
delete hadronizer;
}
//=============================================================================================-------------
//=============================================================================
// Operators
@@ -121,7 +124,7 @@ G4VLongitudinalStringDecay::~G4VLongitudinalStringDecay()
// {
// }
//----------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------
int G4VLongitudinalStringDecay::operator==(const G4VLongitudinalStringDecay &) const
{
@@ -129,7 +132,7 @@ int G4VLongitudinalStringDecay::operator==(const G4VLongitudinalStringDecay &) c
return false;
}
//----------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------
int G4VLongitudinalStringDecay::operator!=(const G4VLongitudinalStringDecay &) const
{
@@ -137,119 +140,260 @@ int G4VLongitudinalStringDecay::operator!=(const G4VLongitudinalStringDecay &) c
return true;
}
//==========================================================================================================
//***********************************************************************************
G4int G4VLongitudinalStringDecay::SampleQuarkFlavor(void)
{
return (1 + (int)(G4UniformRand()/StrangeSuppress));
}
// For changing Mass Cut used for selection of very small mass strings
void G4VLongitudinalStringDecay::SetMassCut(G4double aValue){MassCut=aValue;}
//----------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------
G4VLongitudinalStringDecay::pDefPair G4VLongitudinalStringDecay::CreatePartonPair(G4int NeedParticle,G4bool AllowDiquarks)
// For handling a string with very low mass
G4KineticTrackVector* G4VLongitudinalStringDecay::LightFragmentationTest(const
G4ExcitedString * const string)
{
// NeedParticle = +1 for Particle, -1 for Antiparticle
// Check string decay threshold
G4KineticTrackVector * result=0; // return 0 when string exceeds the mass cut
pDefPair hadrons((G4ParticleDefinition *)0,(G4ParticleDefinition *)0);
if ( AllowDiquarks && G4UniformRand() < DiquarkSuppress )
{
// Create a Diquark - AntiDiquark pair , first in pair is anti to IsParticle
G4int q1 = SampleQuarkFlavor();
G4int q2 = SampleQuarkFlavor();
G4int spin = (q1 != q2 && G4UniformRand() <= 0.5)? 1 : 3;
// convention: quark with higher PDG number is first
G4int PDGcode = (std::max(q1,q2) * 1000 + std::min(q1,q2) * 100 + spin) * NeedParticle;
return pDefPair (FindParticle(-PDGcode),FindParticle(PDGcode));
G4FragmentingString aString(*string);
} else {
// Create a Quark - AntiQuark pair, first in pair IsParticle
G4int PDGcode=SampleQuarkFlavor()*NeedParticle;
return pDefPair (FindParticle(PDGcode),FindParticle(-PDGcode));
}
if ( sqr(FragmentationMass(&aString,0,&hadrons)+MassCut) < aString.Mass2()) {
return 0;
}
// The string mass is very low ---------------------------
result=new G4KineticTrackVector;
if ( hadrons.second ==0 )
{
// Substitute string by light hadron, Note that Energy is not conserved here!
/*
#ifdef DEBUG_LightFragmentationTest
G4cout << "VlongSF Warning replacing string by single hadron " <<G4endl;
G4cout << hadrons.first->GetParticleName()
<< "string .. " << string->Get4Momentum() << " "
<< string->Get4Momentum().m() << G4endl;
#endif
G4cout << "VlongSF Warning replacing string by single hadron " <<G4endl;
G4cout << hadrons.first->GetParticleName() << " string .. " <<G4endl;
G4cout << string->Get4Momentum() << " " << string->Get4Momentum().m() << G4endl;
*/
G4ThreeVector Mom3 = string->Get4Momentum().vect();
G4LorentzVector Mom(Mom3,
std::sqrt(Mom3.mag2() +
sqr(hadrons.first->GetPDGMass())));
result->push_back(new G4KineticTrack(hadrons.first, 0,
string->GetPosition(),
Mom));
} else
{
//... string was qq--qqbar type: Build two stable hadrons,
#ifdef DEBUG_LightFragmentationTest
G4cout << "VlongSF Warning replacing qq-qqbar string by TWO hadrons "
<< hadrons.first->GetParticleName() << " / "
<< hadrons.second->GetParticleName()
<< "string .. " << string->Get4Momentum() << " "
<< string->Get4Momentum().m() << G4endl;
#endif
// Uzhi Formation time in the case???
G4LorentzVector Mom1, Mom2;
Sample4Momentum(&Mom1, hadrons.first->GetPDGMass(),
&Mom2,hadrons.second->GetPDGMass(),
string->Get4Momentum().mag());
result->push_back(new G4KineticTrack(hadrons.first, 0,
string->GetPosition(),
Mom1));
result->push_back(new G4KineticTrack(hadrons.second, 0,
string->GetPosition(),
Mom2));
G4ThreeVector Velocity = string->Get4Momentum().boostVector();
result->Boost(Velocity);
}
return result;
}
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
// G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt()
// {
// G4double width_param= 2.0 * GeV*GeV;
// G4double R = G4UniformRand();
// G4double Pt = std::sqrt(width_param*R/(1-R));
// G4double phi = 2.*pi*G4UniformRand();
// return G4ThreeVector(Pt * std::cos(phi),Pt * std::sin(phi),0);
// }
G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt()
G4double G4VLongitudinalStringDecay::FragmentationMass(
const G4FragmentingString * const string,
Pcreate build, pDefPair * pdefs )
{
G4double mass;
static G4bool NeedInit(true);
static std::vector<double> nomix;
static G4HadronBuilder * minMassHadronizer;
if ( NeedInit )
{
NeedInit = false;
nomix.resize(6);
for ( G4int i=0; i<6 ; i++ ) nomix[i]=0;
// minMassHadronizer=new G4HadronBuilder(pspin_meson,pspin_barion,nomix,nomix);
minMassHadronizer=hadronizer;
}
if ( build==0 ) build=&G4HadronBuilder::BuildLowSpin;
G4ParticleDefinition *Hadron1, *Hadron2=0;
if (!string->FourQuarkString() )
{
// spin 0 meson or spin 1/2 barion will be built
Hadron1 = (minMassHadronizer->*build)(string->GetLeftParton(),
string->GetRightParton());
mass= (Hadron1)->GetPDGMass();
} else
{
//... string is qq--qqbar: Build two stable hadrons,
//... with extra uubar or ddbar quark pair
G4int iflc = (G4UniformRand() < 0.5)? 1 : 2;
if (string->GetLeftParton()->GetPDGEncoding() < 0) iflc = -iflc;
//... theSpin = 4; spin 3/2 baryons will be built
Hadron1 = (minMassHadronizer->*build)(string->GetLeftParton(),
FindParticle(iflc) );
Hadron2 = (minMassHadronizer->*build)(string->GetRightParton(),
FindParticle(-iflc) );
mass = (Hadron1)->GetPDGMass() + (Hadron2)->GetPDGMass();
}
if ( pdefs != 0 )
{ // need to return hadrons as well....
pdefs->first = Hadron1;
pdefs->second = Hadron2;
}
return mass;
}
//----------------------------------------------------------------------------
G4ParticleDefinition* G4VLongitudinalStringDecay::FindParticle(G4int Encoding)
{
G4double Pt = -std::log(G4UniformRand());
Pt = SigmaQT * std::sqrt(Pt);
G4double phi = 2.*pi*G4UniformRand();
return G4ThreeVector(Pt * std::cos(phi),Pt * std::sin(phi),0);
G4ParticleDefinition* ptr = G4ParticleTable::GetParticleTable()->FindParticle(Encoding);
if (ptr == NULL)
{
G4cout << "Particle with encoding "<<Encoding<<" does not exist!!!"<<G4endl;
throw G4HadronicException(__FILE__, __LINE__, "Check your particle table");
}
return ptr;
}
//----------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// virtual void Sample4Momentum(G4LorentzVector* Mom, G4double Mass,
// G4LorentzVector* AntiMom, G4double AntiMass,
// G4double InitialMass)=0;
//-----------------------------------------------------------------------------
void G4VLongitudinalStringDecay::CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector* Hadrons)
{
// `yo-yo` formation time
const G4double kappa = 1.0 * GeV/fermi;
for(size_t c1 = 0; c1 < Hadrons->size(); c1++)
{
G4double SumPz = 0;
G4double SumE = 0;
for(size_t c2 = 0; c2 < c1; c2++)
{
SumPz += Hadrons->operator[](c2)->Get4Momentum().pz();
SumE += Hadrons->operator[](c2)->Get4Momentum().e();
}
G4double HadronE = Hadrons->operator[](c1)->Get4Momentum().e();
G4double HadronPz = Hadrons->operator[](c1)->Get4Momentum().pz();
Hadrons->operator[](c1)->SetFormationTime((theInitialStringMass - 2.*SumPz + HadronE - HadronPz)/(2.*kappa));
G4ThreeVector aPosition(0, 0, (theInitialStringMass - 2.*SumE - HadronE + HadronPz)/(2.*kappa));
Hadrons->operator[](c1)->SetPosition(aPosition);
}
}
//*********************************************************************************
// For decision on continue or stop string fragmentation
// virtual G4bool StopFragmenting(const G4FragmentingString * const string)=0;
// virtual G4bool IsFragmentable(const G4FragmentingString * const string)=0;
//----------------------------------------------------------------------------------------------------------
// If a string can not fragment, make last break into 2 hadrons
// virtual G4bool SplitLast(G4FragmentingString * string,
// G4KineticTrackVector * LeftVector,
// G4KineticTrackVector * RightVector)=0;
//-----------------------------------------------------------------------------
//
// If a string fragments, do the following
//
// For transver of a string to its CMS frame
//-----------------------------------------------------------------------------
/*
void G4VLongitudinalStringDecay::CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector* Hadrons)
{
// 'constituent' formation time
const G4double kappa = 1.0 * GeV/fermi;
for(G4int c1 = 0; c1 < Hadrons->length(); c1++)
{
G4double SumPz = 0;
G4double SumE = 0;
for(G4int c2 = 0; c2 <= c1; c2++)
{
SumPz += Hadrons->at(c2)->Get4Momentum().pz();
SumE += Hadrons->at(c2)->Get4Momentum().e();
}
Hadrons->at(c1)->SetFormationTime((theInitialStringMass - 2.*SumPz)/(2.*kappa));
G4ThreeVector aPosition(0, 0, (theInitialStringMass - 2.*SumE)/(2.*kappa));
Hadrons->at(c1)->SetPosition(aPosition);
}
c1 = Hadrons->length()-1;
Hadrons->at(c1)->SetFormationTime(Hadrons->at(c1-1)->GetFormationTime());
Hadrons->at(c1)->SetPosition(Hadrons->at(c1-1)->GetPosition());
}
*/
G4ExcitedString *G4VLongitudinalStringDecay::CPExcited(const G4ExcitedString & in)
{
G4Parton *Left=new G4Parton(*in.GetLeftParton());
G4Parton *Right=new G4Parton(*in.GetRightParton());
return new G4ExcitedString(Left,Right,in.GetDirection());
}
//----------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------
G4KineticTrack * G4VLongitudinalStringDecay::Splitup(
G4FragmentingString *string,
G4FragmentingString *&newString)
{
//G4cout<<"In G4VLong String Dec######################"<<G4endl;
//... random choice of string end to use for creating the hadron (decay)
SideOfDecay = (G4UniformRand() < 0.5)? 1: -1;
if (SideOfDecay < 0)
{
string->SetLeftPartonStable();
} else
{
string->SetRightPartonStable();
}
G4ParticleDefinition *newStringEnd;
G4ParticleDefinition * HadronDefinition;
if (string->DecayIsQuark())
{
HadronDefinition= QuarkSplitup(string->GetDecayParton(), newStringEnd);
} else {
HadronDefinition= DiQuarkSplitup(string->GetDecayParton(), newStringEnd);
}
// create new String from old, ie. keep Left and Right order, but replace decay
newString=new G4FragmentingString(*string,newStringEnd); // To store possible
// quark containt of new string
G4LorentzVector* HadronMomentum=SplitEandP(HadronDefinition, string, newString);
delete newString; newString=0; // Uzhi 20.06.08
G4KineticTrack * Hadron =0;
if ( HadronMomentum != 0 ) {
G4ThreeVector Pos;
Hadron = new G4KineticTrack(HadronDefinition, 0,Pos, *HadronMomentum);
newString=new G4FragmentingString(*string,newStringEnd,
HadronMomentum);
//G4cout<<"Out G4VLong String Dec######################"<<G4endl;
//G4cout<<"newString 4Mom"<<newString->Get4Momentum()<<G4endl;
//G4cout<<"newString Pl "<<newString->LightConePlus()<<G4endl;
//G4cout<<"newString Mi "<<newString->LightConeMinus()<<G4endl;
//G4cout<<"newString Pts "<<newString->StablePt()<<G4endl;
//G4cout<<"newString Ptd "<<newString->DecayPt()<<G4endl;
//G4cout<<"newString M2 "<<newString->Mass2()<<G4endl;
//G4cout<<"newString M2 "<<newString->Mass()<<G4endl;
delete HadronMomentum;
}
return Hadron;
}
//--------------------------------------------------------------------------------------
G4ParticleDefinition *
G4VLongitudinalStringDecay::QuarkSplitup(G4ParticleDefinition*
decay, G4ParticleDefinition *&created)
{
G4int IsParticle=(decay->GetPDGEncoding()>0) ? -1 : +1; // if we have a quark, we need antiquark (or diquark)
G4int IsParticle=(decay->GetPDGEncoding()>0) ? -1 : +1; // if we have a quark,
// we need antiquark
// (or diquark)
pDefPair QuarkPair = CreatePartonPair(IsParticle);
created = QuarkPair.second;
return hadronizer->Build(QuarkPair.first, decay);
}
//----------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------
G4ParticleDefinition *G4VLongitudinalStringDecay::DiQuarkSplitup(
G4ParticleDefinition* decay,
@@ -297,180 +441,112 @@ G4ParticleDefinition *G4VLongitudinalStringDecay::DiQuarkSplitup(
}
}
//-----------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------
G4KineticTrack * G4VLongitudinalStringDecay::Splitup(
G4FragmentingString *string,
G4FragmentingString *&newString)
{
//... random choice of string end to use for creating the hadron (decay)
SideOfDecay = (G4UniformRand() < 0.5)? 1: -1;
if (SideOfDecay < 0)
{
string->SetLeftPartonStable();
} else
{
string->SetRightPartonStable();
}
G4ParticleDefinition *newStringEnd;
G4ParticleDefinition * HadronDefinition;
if (string->DecayIsQuark())
{
HadronDefinition= QuarkSplitup(string->GetDecayParton(), newStringEnd);
} else {
HadronDefinition= DiQuarkSplitup(string->GetDecayParton(), newStringEnd);
}
// create new String from old, ie. keep Left and Right order, but replace decay
G4LorentzVector* HadronMomentum=SplitEandP(HadronDefinition, string);
G4KineticTrack * Hadron =0;
if ( HadronMomentum != 0 ) {
G4ThreeVector Pos;
Hadron = new G4KineticTrack(HadronDefinition, 0,Pos, *HadronMomentum);
newString=new G4FragmentingString(*string,newStringEnd,
HadronMomentum);
delete HadronMomentum;
}
return Hadron;
}
//----------------------------------------------------------------------------------------------------------
G4ExcitedString *G4VLongitudinalStringDecay::CPExcited(const G4ExcitedString & in)
{
G4Parton *Left=new G4Parton(*in.GetLeftParton());
G4Parton *Right=new G4Parton(*in.GetRightParton());
return new G4ExcitedString(Left,Right,in.GetDirection());
}
G4double G4VLongitudinalStringDecay::FragmentationMass(
const G4FragmentingString *
const string,
Pcreate build,
pDefPair * pdefs)
{
G4double mass;
static G4bool NeedInit(true);
static std::vector<double> nomix;
static G4HadronBuilder * minMassHadronizer;
if ( NeedInit )
{
NeedInit = false;
nomix.resize(6);
for ( G4int i=0; i<6 ; i++ ) nomix[i]=0;
// minMassHadronizer=new G4HadronBuilder(pspin_meson,pspin_barion,nomix,nomix);
minMassHadronizer=hadronizer;
}
if ( build==0 ) build=&G4HadronBuilder::BuildLowSpin;
G4ParticleDefinition *Hadron1, *Hadron2=0;
if (!string->FourQuarkString() )
{
// spin 0 meson or spin 1/2 barion will be built
Hadron1 = (minMassHadronizer->*build)(string->GetLeftParton(),
string->GetRightParton());
mass= (Hadron1)->GetPDGMass();
} else
{
//... string is qq--qqbar: Build two stable hadrons,
//... with extra uubar or ddbar quark pair
G4int iflc = (G4UniformRand() < 0.5)? 1 : 2;
if (string->GetLeftParton()->GetPDGEncoding() < 0) iflc = -iflc;
//... theSpin = 4; spin 3/2 baryons will be built
Hadron1 = (minMassHadronizer->*build)(string->GetLeftParton(),FindParticle(iflc));
Hadron2 =(minMassHadronizer->*build)(string->GetRightParton(),FindParticle(-iflc));
mass = (Hadron1)->GetPDGMass() + (Hadron2)->GetPDGMass();
}
if ( pdefs != 0 )
{ // need to return hadrons as well....
pdefs->first = Hadron1;
pdefs->second = Hadron2;
}
return mass;
}
G4KineticTrackVector* G4VLongitudinalStringDecay::LightFragmentationTest(const
G4ExcitedString * const string)
{
// Check string decay threshold
G4KineticTrackVector * result=0; // return 0 when string exceeds the mass cut
pDefPair hadrons((G4ParticleDefinition *)0,(G4ParticleDefinition *)0);
G4FragmentingString aString(*string);
if ( sqr(FragmentationMass(&aString,0,&hadrons)+MassCut) < aString.Mass2()) {
return 0;
}
result=new G4KineticTrackVector;
if ( hadrons.second ==0 )
{
// Substitute string by light hadron, Note that Energy is not conserved here!
#ifdef DEBUG_LightFragmentationTest
G4cout << "VlongSF Warning replacing string by single hadron "
<< hadrons.first->GetParticleName()
<< "string .. " << string->Get4Momentum() << " "
<< string->Get4Momentum().m() << G4endl;
#endif
G4ThreeVector Mom3 = string->Get4Momentum().vect();
G4LorentzVector Mom(Mom3,
std::sqrt(Mom3.mag2() + sqr(hadrons.first->GetPDGMass())));
result->push_back(new G4KineticTrack(hadrons.first, 0, string->GetPosition(), Mom));
} else
{
//... string was qq--qqbar type: Build two stable hadrons,
#ifdef DEBUG_LightFragmentationTest
G4cout << "VlongSF Warning replacing qq-qqbar string by TWO hadrons "
<< hadrons.first->GetParticleName() << " / "
<< hadrons.second->GetParticleName()
<< "string .. " << string->Get4Momentum() << " "
<< string->Get4Momentum().m() << G4endl;
#endif
G4LorentzVector Mom1, Mom2;
Sample4Momentum(&Mom1, hadrons.first->GetPDGMass(),
&Mom2,hadrons.second->GetPDGMass(),
string->Get4Momentum().mag());
result->push_back(new G4KineticTrack(hadrons.first, 0, string->GetPosition(), Mom1));
result->push_back(new G4KineticTrack(hadrons.second, 0, string->GetPosition(), Mom2));
G4ThreeVector Velocity = string->Get4Momentum().boostVector();
result->Boost(Velocity);
}
return result;
}
//----------------------------------------------------------------------------------------------------------
G4ParticleDefinition* G4VLongitudinalStringDecay::FindParticle(G4int Encoding)
G4int G4VLongitudinalStringDecay::SampleQuarkFlavor(void)
{
G4ParticleDefinition* ptr = G4ParticleTable::GetParticleTable()->FindParticle(Encoding);
if (ptr == NULL)
{
G4cout << "Particle with encoding "<<Encoding<<" does not exist!!!"<<G4endl;
throw G4HadronicException(__FILE__, __LINE__, "Check your particle table");
}
return ptr;
return (1 + (int)(G4UniformRand()/StrangeSuppress));
}
//----------------------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------
G4VLongitudinalStringDecay::pDefPair G4VLongitudinalStringDecay::CreatePartonPair(G4int NeedParticle,G4bool AllowDiquarks)
{
// NeedParticle = +1 for Particle, -1 for Antiparticle
if ( AllowDiquarks && G4UniformRand() < DiquarkSuppress )
{
// Create a Diquark - AntiDiquark pair , first in pair is anti to IsParticle
G4int q1 = SampleQuarkFlavor();
G4int q2 = SampleQuarkFlavor();
G4int spin = (q1 != q2 && G4UniformRand() <= 0.5)? 1 : 3;
// convention: quark with higher PDG number is first
G4int PDGcode = (std::max(q1,q2) * 1000 + std::min(q1,q2) * 100 + spin) * NeedParticle;
return pDefPair (FindParticle(-PDGcode),FindParticle(PDGcode));
} else {
// Create a Quark - AntiQuark pair, first in pair IsParticle
G4int PDGcode=SampleQuarkFlavor()*NeedParticle;
return pDefPair (FindParticle(PDGcode),FindParticle(-PDGcode));
}
}
//-----------------------------------------------------------------------------
// G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt()
// {
// G4double width_param= 2.0 * GeV*GeV;
// G4double R = G4UniformRand();
// G4double Pt = std::sqrt(width_param*R/(1-R));
// G4double phi = 2.*pi*G4UniformRand();
// return G4ThreeVector(Pt * std::cos(phi),Pt * std::sin(phi),0);
// }
G4ThreeVector G4VLongitudinalStringDecay::SampleQuarkPt()
{
G4double Pt = -std::log(G4UniformRand());
Pt = SigmaQT * std::sqrt(Pt);
G4double phi = 2.*pi*G4UniformRand();
return G4ThreeVector(Pt * std::cos(phi),Pt * std::sin(phi),0);
}
//******************************************************************************
void G4VLongitudinalStringDecay::CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector* Hadrons)
{
// `yo-yo` formation time
// const G4double kappa = 1.0 * GeV/fermi/4.; // Uzhi String tension 1.06.08
G4double kappa = GetStringTensionParameter();
//G4cout<<"Kappa "<<kappa<<G4endl; // Uzhi 20.06.08
//G4int Uzhi; G4cin>>Uzhi; // Uzhi 20.06.08
for(size_t c1 = 0; c1 < Hadrons->size(); c1++)
{
G4double SumPz = 0;
G4double SumE = 0;
for(size_t c2 = 0; c2 < c1; c2++)
{
SumPz += Hadrons->operator[](c2)->Get4Momentum().pz();
SumE += Hadrons->operator[](c2)->Get4Momentum().e();
}
G4double HadronE = Hadrons->operator[](c1)->Get4Momentum().e();
G4double HadronPz = Hadrons->operator[](c1)->Get4Momentum().pz();
Hadrons->operator[](c1)->SetFormationTime((theInitialStringMass - 2.*SumPz + HadronE - HadronPz)/(2.*kappa));
G4ThreeVector aPosition(0, 0, (theInitialStringMass - 2.*SumE - HadronE + HadronPz)/(2.*kappa));
Hadrons->operator[](c1)->SetPosition(aPosition);
}
}
//-----------------------------------------------------------------------------
/*
void G4VLongitudinalStringDecay::CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector* Hadrons)
{
// 'constituent' formation time
const G4double kappa = 1.0 * GeV/fermi;
for(G4int c1 = 0; c1 < Hadrons->length(); c1++)
{
G4double SumPz = 0;
G4double SumE = 0;
for(G4int c2 = 0; c2 <= c1; c2++)
{
SumPz += Hadrons->at(c2)->Get4Momentum().pz();
SumE += Hadrons->at(c2)->Get4Momentum().e();
}
Hadrons->at(c1)->SetFormationTime((theInitialStringMass - 2.*SumPz)/(2.*kappa));
G4ThreeVector aPosition(0, 0, (theInitialStringMass - 2.*SumE)/(2.*kappa));
Hadrons->at(c1)->SetPosition(aPosition);
}
c1 = Hadrons->length()-1;
Hadrons->at(c1)->SetFormationTime(Hadrons->at(c1-1)->GetFormationTime());
Hadrons->at(c1)->SetPosition(Hadrons->at(c1-1)->GetPosition());
}
*/
//*****************************************************************************
void G4VLongitudinalStringDecay::SetSigmaTransverseMomentum(G4double aValue)
{
@@ -503,6 +579,8 @@ void G4VLongitudinalStringDecay::SetDiquarkSuppression(G4double aValue)
}
}
//----------------------------------------------------------------------------------------
void G4VLongitudinalStringDecay::SetDiquarkBreakProbability(G4double aValue)
{
if ( PastInitPhase ) {
@@ -581,5 +659,12 @@ void G4VLongitudinalStringDecay::SetVectorMesonMixings(std::vector<G4double> aVe
scalarMesonMix,vectorMesonMix);
}
}
//-------------------------------------------------------------------------------------------
void G4VLongitudinalStringDecay::SetStringTensionParameter(G4double aValue)// Uzhi 20 June 08
{
Kappa = aValue * GeV/fermi;
}
//*******************************************************************************************************
//**************************************************************************************
@@ -1,4 +1,4 @@
$Id: History,v 1.3 2007/04/24 10:37:10 gunter Exp $
$Id: History,v 1.4 2008/04/01 08:20:25 vuzhinsk Exp $
-------------------------------------------------------------------
==========================================================
@@ -24,3 +24,8 @@ code and to keep track of all tags.
- Debug output in G4VPartonStringModel checking E-p conservation of string
model
31-March-2008 V. Uzhinsky Tag : had-partonstring-mgt-V09-01-00
- G4FTFCrossSection.cc and G4FTFCrossSection.hh were re-named into
G4FTFParameters.cc and .hh, and moved to diffraction directory.
The corresponding class was re-named too. All of these characterize
the content of the files more exactly.
@@ -25,7 +25,7 @@
//
//
// $Id: G4EventGenerator.hh,v 1.3 2006/06/29 20:55:13 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4EventGenerator_h
#define G4EventGenerator_h 1
@@ -1,90 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef G4FTFCrossSection_h
#define G4FTFCrossSection_h 1
//
// $Id: G4FTFCrossSection.hh,v 1.2 2007/04/24 10:37:10 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
#include "G4Proton.hh"
class G4FTFCrossSection
{
public:
G4FTFCrossSection(const G4ParticleDefinition * , G4double );
~G4FTFCrossSection();
void SethNcmsEnergy(const G4double s);
void SetTotalCrossSection(const G4double Xtotal);
void SetElastisCrossSection(const G4double Xelastic);
void SetInelasticCrossSection(const G4double Xinelastic);
void SetSlope(const G4double Slope);
void SetGamma0(const G4double Gamma0);
G4double GetTotalCrossSection();
G4double GetElasticCrossSection();
G4double GetInelasticCrossSection();
G4double GetSlope();
G4double GetInelasticProbability(const G4double impactsquare);
// private:
G4FTFCrossSection();
G4double GammaElastic(const G4double impactsquare) {return (FTFGamma0 * std::exp(-FTFSlope * impactsquare));};
G4double FTFhNcmsEnergy; // Uzhi Initial hN CMS energy
G4double FTFXtotal;
G4double FTFXelastic;
G4double FTFXinelastic;
G4double FTFSlope;
G4double FTFGamma0;
};
inline void G4FTFCrossSection::SethNcmsEnergy(const G4double s) {FTFhNcmsEnergy = s;}
inline void G4FTFCrossSection::SetTotalCrossSection(const G4double Xtotal) {FTFXtotal = Xtotal;}
inline void G4FTFCrossSection::SetElastisCrossSection(const G4double Xelastic) {FTFXelastic = Xelastic;}
inline void G4FTFCrossSection::SetInelasticCrossSection(const G4double Xinelastic) {FTFXinelastic = Xinelastic;}
inline void G4FTFCrossSection::SetSlope(const G4double Slope) {FTFSlope = 12.84/Slope;}
inline void G4FTFCrossSection::SetGamma0(const G4double Gamma0) {FTFGamma0 = Gamma0;}
inline G4double G4FTFCrossSection::GetTotalCrossSection() {return FTFXtotal;}
inline G4double G4FTFCrossSection::GetElasticCrossSection() {return FTFXelastic;}
inline G4double G4FTFCrossSection::GetInelasticCrossSection() {return FTFXinelastic;}
inline G4double G4FTFCrossSection::GetSlope() {return FTFSlope;}
inline G4double G4FTFCrossSection::GetInelasticProbability( const G4double impactsquare)
{
G4double Gamma = GammaElastic(impactsquare);
return 2 * Gamma - Gamma *Gamma;
}
#endif
@@ -25,7 +25,7 @@
//
//
// $Id: G4InteractionCode.hh,v 1.3 2006/06/29 20:55:15 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4InteractionCode_h
#define G4InteractionCode_h 1
@@ -25,7 +25,7 @@
//
//
// $Id: G4InteractionContent.hh,v 1.4 2007/01/24 10:28:54 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4InteractionContent_h
@@ -27,7 +27,7 @@
#define G4PomeronCrossSection_h 1
//
// $Id: G4PomeronCrossSection.hh,v 1.3 2006/06/29 20:55:19 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#include "G4Proton.hh"
#include "G4Neutron.hh"
@@ -25,7 +25,7 @@
//
//
// $Id: G4StringModel.hh,v 1.3 2006/06/29 20:55:23 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4StringModel_h
#define G4StringModel_h 1
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VParticipants.hh,v 1.3 2006/06/29 20:55:25 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4VParticipants.hh,v 1.4 2008/05/19 13:03:20 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4VParticipants_h
@@ -89,6 +89,7 @@ inline void G4VParticipants::Init(G4double theA, G4double theZ)
{
if ( theNucleus == NULL ) theNucleus = new G4Fancy3DNucleus();
theNucleus->Init(theA, theZ);
theNucleus->SortNucleonsInZ(); // Uzhi 16.05.08 Sorting of nucleon-Z
}
@@ -25,7 +25,7 @@
//
//
// $Id: G4VPartonStringModel.hh,v 1.3 2006/06/29 20:55:27 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4VPartonStringModel_h
#define G4VPartonStringModel_h 1
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VSplitableHadron.hh,v 1.3 2006/06/29 20:55:29 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4VSplitableHadron.hh,v 1.4 2008/05/19 13:03:20 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4VSplitableHadron_h
@@ -74,6 +74,9 @@ class G4VSplitableHadron
void IncrementCollisionCount(G4int aCount);
void SetCollisionCount(G4int aCount);
void SetTimeOfCreation(G4double aTime); // Uzhi 7.05.08
G4double GetTimeOfCreation(); // Uzhi 7.05.08
void SetPosition(const G4ThreeVector &aPosition);
const G4ThreeVector & GetPosition() const;
@@ -82,9 +85,9 @@ class G4VSplitableHadron
virtual G4Parton * GetNextAntiParton() = 0 ;
G4bool IsSplit() { return isSplit;}
protected:
G4int GetSoftCollisionCount();
protected:
void Splitting() {isSplit = true;}
private:
@@ -98,6 +101,7 @@ class G4VSplitableHadron
G4LorentzVector the4Momentum;
G4double TimeOfCreation; // Uzhi 7.05.08
G4ThreeVector thePosition;
G4int theCollisionCount;
@@ -140,6 +144,15 @@ inline void G4VSplitableHadron::IncrementCollisionCount(G4int aCount)
theCollisionCount += aCount;
}
inline void G4VSplitableHadron::SetTimeOfCreation(G4double aTime) // Uzhi 7.05.08
{
TimeOfCreation=aTime;
}
inline G4double G4VSplitableHadron::GetTimeOfCreation() // Uzhi 7.05.08
{
return TimeOfCreation;
}
inline void G4VSplitableHadron::SetPosition(const G4ThreeVector &aPosition)
{
@@ -25,7 +25,7 @@
//
//
// $Id: G4VStringFragmentation.hh,v 1.3 2006/06/29 20:55:31 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4VStringFragmentation_h
#define G4VStringFragmentation_h 1
@@ -25,7 +25,7 @@
//
//
// $Id: G4VertexCode.hh,v 1.3 2006/06/29 20:55:33 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#ifndef G4VertexCode_h
#define G4VertexCode_h 1
@@ -25,7 +25,7 @@
//
//
// $Id: G4EventGenerator.cc,v 1.4 2006/06/29 20:55:37 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
// G4EventGenerator
#include "G4EventGenerator.hh"
@@ -25,7 +25,7 @@
//
//
// $Id: G4InteractionContent.cc,v 1.4 2006/06/29 20:55:39 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -25,7 +25,7 @@
//
//
// $Id: G4PomeronCrossSection.cc,v 1.6 2006/11/07 12:51:39 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
#include "G4PomeronCrossSection.hh"
@@ -25,7 +25,7 @@
//
//
// $Id: G4StringModel.cc,v 1.4 2006/06/29 20:55:45 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
// G4StringModel
#include "G4StringModel.hh"
@@ -25,7 +25,7 @@
//
//
// $Id: G4VParticipants.cc,v 1.3 2006/06/29 20:55:47 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -25,7 +25,7 @@
//
//
// $Id: G4VPartonStringModel.cc,v 1.5 2007/01/24 10:29:30 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
//// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VSplitableHadron.cc,v 1.4 2006/06/29 20:55:51 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// $Id: G4VSplitableHadron.cc,v 1.5 2008/05/19 13:03:20 vuzhinsk Exp $
// GEANT4 tag $Name: geant4-09-02 $
//
// ------------------------------------------------------------
@@ -41,12 +41,12 @@
#include "G4VKineticNucleon.hh"
G4VSplitableHadron::G4VSplitableHadron()
: theDefinition(NULL), theCollisionCount(0), isSplit(false)
: theDefinition(NULL), TimeOfCreation(0.), theCollisionCount(0), isSplit(false) // Uzhi 8.05.08
{
}
G4VSplitableHadron::G4VSplitableHadron(const G4ReactionProduct & aPrimary)
: theCollisionCount(0), isSplit(false)
: TimeOfCreation(0.), theCollisionCount(0), isSplit(false) // Uzhi 8.05.08
{
theDefinition=aPrimary.GetDefinition();
the4Momentum.setVect(aPrimary.GetMomentum());
@@ -55,29 +55,32 @@ G4VSplitableHadron::G4VSplitableHadron(const G4ReactionProduct & aPrimary)
G4VSplitableHadron::G4VSplitableHadron(const G4Nucleon & aNucleon)
{
theCollisionCount=0;
isSplit = false;
theDefinition=aNucleon.GetParticleType();
the4Momentum=aNucleon.GetMomentum();
thePosition=aNucleon.GetPosition();
TimeOfCreation = 0.; // Uzhi 8.05.08
theCollisionCount= 0;
isSplit = false;
theDefinition =aNucleon.GetParticleType();
the4Momentum =aNucleon.GetMomentum();
thePosition =aNucleon.GetPosition();
}
G4VSplitableHadron::G4VSplitableHadron(const G4VKineticNucleon * aNucleon)
{
theCollisionCount=0;
isSplit = false;
theDefinition=aNucleon->GetDefinition();
the4Momentum=aNucleon->Get4Momentum();
thePosition=aNucleon->GetPosition();
TimeOfCreation = 0.; // Uzhi 8.05.08
theCollisionCount= 0;
isSplit = false;
theDefinition =aNucleon->GetDefinition();
the4Momentum =aNucleon->Get4Momentum();
thePosition =aNucleon->GetPosition();
}
G4VSplitableHadron::G4VSplitableHadron(const G4VSplitableHadron &right)
{
theCollisionCount=0;
isSplit = false;
theDefinition= right.GetDefinition();
the4Momentum= right.Get4Momentum();
thePosition= right.GetPosition();
TimeOfCreation = 0.; // Uzhi 8.05.08
theCollisionCount= 0;
isSplit = false;
theDefinition = right.GetDefinition();
the4Momentum = right.Get4Momentum();
thePosition = right.GetPosition();
}
@@ -25,7 +25,7 @@
//
//
// $Id: G4VStringFragmentation.cc,v 1.4 2006/06/29 20:55:53 gunter Exp $
// GEANT4 tag $Name: geant4-09-01 $
// GEANT4 tag $Name: geant4-09-02 $
//
// G4VStringFragmentation
#include "G4VStringFragmentation.hh"
@@ -1,4 +1,4 @@
$Id: History,v 1.4 2007/04/24 10:29:34 gunter Exp $
$Id: History,v 1.6 2008/09/19 09:54:23 gunter Exp $
-------------------------------------------------------------------
==========================================================
@@ -16,7 +16,17 @@ code and to keep track of all tags.
---------------------------------------------------------------
15 Sep 2008 G.Folger (hadr-qgsm-V09-01-01)
------------------------------------------------
- Fix for bug found on windows in G4QGSParticipants.cc, bug 1018:
decrement of iterator fails, improve logic to not decrement.
31 Mar 2008 Dennis Wright (hadr-qgsm-V09-01-00)
-----------------------------------------------
- fix gcc-4.3 compiler warnings at lines 293, 395 of G4QGSMSplittableHadron.cc
24 Apr 2007 Gunter Folger (hadr-qgsm-V08-02-02)
------------------------------------------------
- merge in change done by ftf dev; ie. in G4QGSParticipants, theDiffExcitaton
is constructed with default arguments.
@@ -287,10 +287,10 @@ void G4QGSMSplitableHadron::SoftSplitUp()
nAttempt++;
G4int NumberOfUnsampledSeaQuarks = 2*nSeaPair;
G4double beta1 = beta;
if (std::abs(ColorEncoding) <= 1000 && std::abs(AntiColorEncoding) <= 1000) beta1 = 1.; //... in a meson
if (std::abs(ColorEncoding) <= 1000 && std::abs(AntiColorEncoding) <= 1000) beta1 = 1.; //... in a meson
ColorX = SampleX(Xmin, NumberOfUnsampledSeaQuarks, 2*nSeaPair, aBeta);
HPWtest = ColorX;
while (ColorX < Xmin || ColorX > 1.|| 1. - ColorX <= Xmin);
while (ColorX < Xmin || ColorX > 1.|| 1. - ColorX <= Xmin) {;}
Color.back()->SetX(SumX = ColorX);// this is the valenz quark.
for(G4int aPair = 0; aPair < nSeaPair; aPair++)
{
@@ -392,7 +392,7 @@ void G4QGSMSplitableHadron::GetValenceQuarkFlavors(const G4ParticleDefinition *
G4ThreeVector G4QGSMSplitableHadron::GaussianPt(G4double widthSquare, G4double maxPtSquare)
{
G4double R;
while((R = -widthSquare*std::log(G4UniformRand())) > maxPtSquare);
while((R = -widthSquare*std::log(G4UniformRand())) > maxPtSquare) {;}
R = std::sqrt(R);
G4double phi = twopi*G4UniformRand();
return G4ThreeVector (R*std::cos(phi), R*std::sin(phi), 0.);
@@ -261,7 +261,8 @@ void G4QGSParticipants::PerformSoftCollisions()
{
std::vector<G4InteractionContent*>::iterator i;
G4LorentzVector str4Mom;
for(i = theInteractions.begin(); i != theInteractions.end(); i++)
i = theInteractions.begin();
while ( i != theInteractions.end() )
{
G4InteractionContent* anIniteraction = *i;
G4PartonPair * aPair = NULL;
@@ -303,9 +304,10 @@ void G4QGSParticipants::PerformSoftCollisions()
thePartonPairs.push_back(aPair);
}
delete *i;
i=theInteractions.erase(i);
i--;
}
i=theInteractions.erase(i); // i now points to the next interaction
} else {
i++;
}
}
#ifdef debug_G4QGSPart_PSoftColl
G4cout << " string 4 mom " << str4Mom << G4endl;