Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VPartonStringModel Class Referenceabstract

#include <G4VPartonStringModel.hh>

+ Inheritance diagram for G4VPartonStringModel:

Public Member Functions

 G4VPartonStringModel (const G4String &modelName="Parton String Model")
 
virtual ~G4VPartonStringModel ()
 
void SetFragmentationModel (G4VStringFragmentation *aModel)
 
G4KineticTrackVectorScatter (const G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)
 
virtual G4V3DNucleusGetWoundedNucleus () const =0
 
virtual void ModelDescription (std::ostream &outFile) const
 
- Public Member Functions inherited from G4VHighEnergyGenerator
 G4VHighEnergyGenerator (const G4String &modelName="High Energy Generator")
 
virtual ~G4VHighEnergyGenerator ()
 
virtual G4V3DNucleusGetWoundedNucleus () const =0
 
virtual G4KineticTrackVectorScatter (const G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)=0
 
std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double AbsoluteLevel)
 
virtual void ModelDescription (std::ostream &) const
 
virtual G4String GetModelName () const
 

Protected Member Functions

virtual void Init (const G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)=0
 
virtual G4ExcitedStringVectorGetStrings ()=0
 
void SetThisPointer (G4VPartonStringModel *aPointer)
 
G4bool EnergyAndMomentumCorrector (G4KineticTrackVector *Output, G4LorentzVector &TotalCollisionMomentum)
 

Detailed Description

Definition at line 51 of file G4VPartonStringModel.hh.

Constructor & Destructor Documentation

◆ G4VPartonStringModel()

G4VPartonStringModel::G4VPartonStringModel ( const G4String modelName = "Parton String Model")

Definition at line 48 of file G4VPartonStringModel.cc.

49 : G4VHighEnergyGenerator(modelName),
50 stringFragmentationModel(0),
51 theThis(0)
52{
53// Make shure Shotrylived partyicles are constructed.
54 G4ShortLivedConstructor ShortLived;
55 ShortLived.ConstructParticle();
56}

◆ ~G4VPartonStringModel()

G4VPartonStringModel::~G4VPartonStringModel ( )
virtual

Definition at line 58 of file G4VPartonStringModel.cc.

59{
60}

Member Function Documentation

◆ EnergyAndMomentumCorrector()

G4bool G4VPartonStringModel::EnergyAndMomentumCorrector ( G4KineticTrackVector Output,
G4LorentzVector TotalCollisionMomentum 
)
protected

◆ GetStrings()

virtual G4ExcitedStringVector * G4VPartonStringModel::GetStrings ( )
protectedpure virtual

◆ GetWoundedNucleus()

virtual G4V3DNucleus * G4VPartonStringModel::GetWoundedNucleus ( ) const
pure virtual

◆ Init()

virtual void G4VPartonStringModel::Init ( const G4Nucleus theNucleus,
const G4DynamicParticle thePrimary 
)
protectedpure virtual

◆ ModelDescription()

void G4VPartonStringModel::ModelDescription ( std::ostream &  outFile) const
virtual

Reimplemented from G4VHighEnergyGenerator.

Reimplemented in G4FTFModel, G4QGSModel< ParticipantType >, G4QGSModel< G4GammaParticipants >, and G4QGSModel< G4QGSParticipants >.

Definition at line 171 of file G4VPartonStringModel.cc.

172{
173 outFile << GetModelName() << " has no description yet.\n";
174}
virtual G4String GetModelName() const

◆ Scatter()

G4KineticTrackVector * G4VPartonStringModel::Scatter ( const G4Nucleus theNucleus,
const G4DynamicParticle thePrimary 
)
virtual

Implements G4VHighEnergyGenerator.

Definition at line 62 of file G4VPartonStringModel.cc.

64{
65 G4ExcitedStringVector * strings = NULL;
66
67 G4DynamicParticle thePrimary=aPrimary;
68
70 G4LorentzVector Ptmp=thePrimary.Get4Momentum();
71 toZ.rotateZ(-1*Ptmp.phi());
72 toZ.rotateY(-1*Ptmp.theta());
73 thePrimary.Set4Momentum(toZ*Ptmp);
74 G4LorentzRotation toLab(toZ.inverse());
75
76 G4int attempts = 0, maxAttempts=20;
77 while ( strings == NULL )
78 {
79 if (attempts++ > maxAttempts )
80 {
81 throw G4HadronicException(__FILE__, __LINE__, "G4VPartonStringModel::Scatter(): fails to generate strings");
82 }
83
84 theThis->Init(theNucleus,thePrimary);
85
86 strings = GetStrings();
87 }
88
89 G4double stringEnergy(0);
90 G4LorentzVector SumStringMom(0.,0.,0.,0.);
91
92 for ( unsigned int astring=0; astring < strings->size(); astring++)
93 {
94// rotate string to lab frame, models have it aligned to z
95 stringEnergy += (*strings)[astring]->GetLeftParton()->Get4Momentum().t();
96 stringEnergy += (*strings)[astring]->GetRightParton()->Get4Momentum().t();
97 (*strings)[astring]->LorentzRotate(toLab);
98 SumStringMom+=(*strings)[astring]->Get4Momentum();
99 }
100
101 G4double InvMass=SumStringMom.mag();
102
103//#define debug_PartonStringModel
104#ifdef debug_PartonStringModel
105
106 G4V3DNucleus * fancynucleus=theThis->GetWoundedNucleus();
107
108 // loop over wounded nucleus
109 G4int hits(0), charged_hits(0);
110 G4ThreeVector hitNucleonMomentum(0.,0.,0.);
111 G4Nucleon * theCurrentNucleon = fancynucleus->StartLoop() ? fancynucleus->GetNextNucleon() : NULL;
112 while( theCurrentNucleon )
113 {
114 if(theCurrentNucleon->AreYouHit())
115 {
116 hits++;
117 hitNucleonMomentum += theCurrentNucleon->Get4Momentum().vect();
118 if ( theCurrentNucleon->GetDefinition() == G4Proton::Proton() ) ++charged_hits;
119 }
120 theCurrentNucleon = fancynucleus->GetNextNucleon();
121 }
122
123 G4int initialZ=fancynucleus->GetCharge();
124 G4int initialA=fancynucleus->GetMassNumber();
125 G4double initial_mass=G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(initialZ,initialA);
126 G4double final_mass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(initialZ-charged_hits, initialA-hits);
127 G4cout << "G4VPSM: strE, hit nucleons, Primary, SumStringE, nucleus intial, nucleus final, excitation estimate "
128 << stringEnergy << " " << hits << ", " << Ptmp.e() << ", "<< SumStringMom.e() << ", "
129 << initial_mass<< ", " << final_mass<< ", " << Ptmp.e() + initial_mass - final_mass - stringEnergy << G4endl;
130 G4cout << "momentum balance " << thePrimary.GetMomentum() + hitNucleonMomentum - SumStringMom.vect()<< G4endl;
131#endif
132
133// Fragment strings
134
135 G4KineticTrackVector * theResult = 0;
136 G4double SumMass(0.);
137 attempts = 0;
138 maxAttempts=100;
139 do
140 {
141 attempts++;
142 if(theResult != 0)
143 {
144 std::for_each(theResult->begin(), theResult->end(), DeleteKineticTrack());
145 delete theResult;
146 }
147 theResult = stringFragmentationModel->FragmentStrings(strings);
148 if(attempts > maxAttempts ) break;
149
150 //G4cout<<"G4endl<<"G4VPartonStringModel:: Final Result, Size "<<theResult->size()<<G4endl;
151
152 SumMass=0.;
153 //G4LorentzVector SumP(0.,0.,0.,0.);
154 for ( unsigned int i=0; i < theResult->size(); i++)
155 {
156 SumMass+=(*theResult)[i]->GetDefinition()->GetPDGMass();
157 //SumP+=(*theResult)[i]->Get4Momentum();
158 //G4cout<<i<<" : "<<(*theResult)[i]->GetDefinition()->GetParticleName();
159 //G4cout<<"p= " << (*theResult)[i]->Get4Momentum()<<" m= "<<(*theResult)[i]->Get4Momentum().mag()<<G4endl;
160 }
161
162 //G4cout<<"SumP "<<SumP<<G4endl;
163 } while(SumMass > InvMass);
164
165 std::for_each(strings->begin(), strings->end(), DeleteString() );
166 delete strings;
167
168 return theResult;
169}
std::vector< G4ExcitedString * > G4ExcitedStringVector
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
double theta() const
Hep3Vector vect() const
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &momentum)
G4ThreeVector GetMomentum() const
G4double GetIonMass(G4int Z, G4int A, G4int L=0) const
!! Only ground states are supported now
Definition: G4IonTable.cc:774
G4bool AreYouHit() const
Definition: G4Nucleon.hh:97
virtual const G4LorentzVector & Get4Momentum() const
Definition: G4Nucleon.hh:72
virtual G4ParticleDefinition * GetDefinition() const
Definition: G4Nucleon.hh:85
static G4ParticleTable * GetParticleTable()
G4IonTable * GetIonTable()
static G4Proton * Proton()
Definition: G4Proton.cc:93
virtual G4Nucleon * GetNextNucleon()=0
virtual G4int GetCharge()=0
virtual G4bool StartLoop()=0
virtual G4int GetMassNumber()=0
virtual G4V3DNucleus * GetWoundedNucleus() const =0
virtual void Init(const G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)=0
virtual G4ExcitedStringVector * GetStrings()=0
virtual G4KineticTrackVector * FragmentStrings(const G4ExcitedStringVector *theStrings)=0

◆ SetFragmentationModel()

void G4VPartonStringModel::SetFragmentationModel ( G4VStringFragmentation aModel)
inline

Definition at line 86 of file G4VPartonStringModel.hh.

87{
88 stringFragmentationModel = aModel;
89}

Referenced by G4BertiniElectroNuclearBuilder::Build(), G4ElectroNuclearBuilder::Build(), G4MiscQGSCBuilder::Build(), G4FTFBuilder::BuildModel(), G4QGSBuilder::BuildModel(), G4ElectroNuclearReaction::G4ElectroNuclearReaction(), G4ElectroVDNuclearModel::G4ElectroVDNuclearModel(), G4FTFBinaryKaonBuilder::G4FTFBinaryKaonBuilder(), G4FTFBinaryNeutronBuilder::G4FTFBinaryNeutronBuilder(), G4FTFBinaryPiKBuilder::G4FTFBinaryPiKBuilder(), G4FTFBinaryPionBuilder::G4FTFBinaryPionBuilder(), G4FTFBinaryProtonBuilder::G4FTFBinaryProtonBuilder(), G4FTFCNeutronBuilder::G4FTFCNeutronBuilder(), G4FTFCPiKBuilder::G4FTFCPiKBuilder(), G4FTFCProtonBuilder::G4FTFCProtonBuilder(), G4FTFPAntiBarionBuilder::G4FTFPAntiBarionBuilder(), G4FTFPNeutronBuilder::G4FTFPNeutronBuilder(), G4FTFPPiKBuilder::G4FTFPPiKBuilder(), G4FTFPProtonBuilder::G4FTFPProtonBuilder(), G4HadronicAbsorptionFritiof::G4HadronicAbsorptionFritiof(), G4HyperonFTFPBuilder::G4HyperonFTFPBuilder(), G4MuonVDNuclearModel::G4MuonVDNuclearModel(), G4QGSBinaryNeutronBuilder::G4QGSBinaryNeutronBuilder(), G4QGSBinaryPiKBuilder::G4QGSBinaryPiKBuilder(), G4QGSBinaryProtonBuilder::G4QGSBinaryProtonBuilder(), G4QGSC_CHIPSNeutronBuilder::G4QGSC_CHIPSNeutronBuilder(), G4QGSC_CHIPSPiKBuilder::G4QGSC_CHIPSPiKBuilder(), G4QGSC_CHIPSProtonBuilder::G4QGSC_CHIPSProtonBuilder(), G4QGSC_QGSCNeutronBuilder::G4QGSC_QGSCNeutronBuilder(), G4QGSC_QGSCPiKBuilder::G4QGSC_QGSCPiKBuilder(), G4QGSC_QGSCProtonBuilder::G4QGSC_QGSCProtonBuilder(), G4QGSCEflowNeutronBuilder::G4QGSCEflowNeutronBuilder(), G4QGSCEflowPiKBuilder::G4QGSCEflowPiKBuilder(), G4QGSCEflowProtonBuilder::G4QGSCEflowProtonBuilder(), G4QGSCNeutronBuilder::G4QGSCNeutronBuilder(), G4QGSCPiKBuilder::G4QGSCPiKBuilder(), G4QGSCProtonBuilder::G4QGSCProtonBuilder(), G4QGSPNeutronBuilder::G4QGSPNeutronBuilder(), G4QGSPPiKBuilder::G4QGSPPiKBuilder(), G4QGSPPionBuilder::G4QGSPPionBuilder(), G4QGSPProtonBuilder::G4QGSPProtonBuilder(), and TheoModelFactory< C, S, F >::New().

◆ SetThisPointer()

void G4VPartonStringModel::SetThisPointer ( G4VPartonStringModel aPointer)
inlineprotected

Definition at line 92 of file G4VPartonStringModel.hh.

93{
94 theThis=aPointer;
95}

Referenced by G4FTFModel::G4FTFModel().


The documentation for this class was generated from the following files: