Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions
G4VPartonStringModel Class Referenceabstract

#include <G4VPartonStringModel.hh>

Inheritance diagram for G4VPartonStringModel:
G4VHighEnergyGenerator G4FTFModel G4QGSModel< ParticipantType > G4QGSModel< G4GammaParticipants > G4QGSModel< G4QGSParticipants >

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
 
virtual G4V3DNucleusGetProjectileNucleus () const
 
- Public Member Functions inherited from G4VHighEnergyGenerator
 G4VHighEnergyGenerator (const G4String &modelName="High Energy Generator")
 
virtual ~G4VHighEnergyGenerator ()
 
std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double AbsoluteLevel)
 
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 ( const G4String modelName = "Parton String Model")

Definition at line 49 of file G4VPartonStringModel.cc.

References G4ShortLivedConstructor::ConstructParticle().

50  : G4VHighEnergyGenerator(modelName),
51  stringFragmentationModel(0),
52  theThis(0)
53 {
54 // Make shure Shotrylived partyicles are constructed.
55  G4ShortLivedConstructor ShortLived;
56  ShortLived.ConstructParticle();
57 }
G4VHighEnergyGenerator(const G4String &modelName="High Energy Generator")
G4VPartonStringModel::~G4VPartonStringModel ( )
virtual

Definition at line 59 of file G4VPartonStringModel.cc.

60 {
61 }

Member Function Documentation

G4bool G4VPartonStringModel::EnergyAndMomentumCorrector ( G4KineticTrackVector Output,
G4LorentzVector TotalCollisionMomentum 
)
protected
G4V3DNucleus * G4VPartonStringModel::GetProjectileNucleus ( ) const
virtual
virtual G4ExcitedStringVector* G4VPartonStringModel::GetStrings ( )
protectedpure virtual
virtual G4V3DNucleus* G4VPartonStringModel::GetWoundedNucleus ( ) const
pure virtual
virtual void G4VPartonStringModel::Init ( const G4Nucleus theNucleus,
const G4DynamicParticle thePrimary 
)
protectedpure virtual
void G4VPartonStringModel::ModelDescription ( std::ostream &  outFile) const
virtual

Reimplemented from G4VHighEnergyGenerator.

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

Definition at line 208 of file G4VPartonStringModel.cc.

References G4VHighEnergyGenerator::GetModelName().

209 {
210  outFile << GetModelName() << " has no description yet.\n";
211 }
std::ofstream outFile
Definition: GammaRayTel.cc:68
virtual G4String GetModelName() const
G4KineticTrackVector * G4VPartonStringModel::Scatter ( const G4Nucleus theNucleus,
const G4DynamicParticle thePrimary 
)
virtual

Implements G4VHighEnergyGenerator.

Definition at line 63 of file G4VPartonStringModel.cc.

References G4Nucleon::AreYouHit(), CLHEP::HepLorentzVector::e(), G4VStringFragmentation::FragmentStrings(), G4cout, G4endl, G4Nucleon::Get4Momentum(), G4DynamicParticle::Get4Momentum(), G4Nucleus::GetA_asInt(), G4V3DNucleus::GetCharge(), G4Nucleon::GetDefinition(), G4DynamicParticle::GetDefinition(), G4IonTable::GetIonMass(), G4ParticleTable::GetIonTable(), G4DynamicParticle::GetMass(), G4V3DNucleus::GetMassNumber(), G4DynamicParticle::GetMomentum(), G4V3DNucleus::GetNextNucleon(), G4ParticleDefinition::GetParticleName(), G4ParticleTable::GetParticleTable(), GetStrings(), GetWoundedNucleus(), G4Nucleus::GetZ_asInt(), Init(), CLHEP::HepLorentzRotation::inverse(), CLHEP::HepLorentzVector::mag(), CLHEP::HepLorentzVector::phi(), G4Proton::Proton(), CLHEP::HepLorentzRotation::rotateY(), CLHEP::HepLorentzRotation::rotateZ(), G4DynamicParticle::Set4Momentum(), G4V3DNucleus::StartLoop(), CLHEP::HepLorentzVector::theta(), and CLHEP::HepLorentzVector::vect().

65 {
66  G4ExcitedStringVector * strings = NULL;
67 
68  G4DynamicParticle thePrimary=aPrimary;
69 
70 #ifdef debug_PartonStringModel
71  G4cout<<"Parton-String model is runnung ------------"<<G4endl;
72  G4cout<<"Projectile Name Mass "<<thePrimary.GetDefinition()->GetParticleName()<<" "
73  <<thePrimary.GetMass()<<G4endl;
74  G4cout<<" Momentum "<<thePrimary.Get4Momentum()<<G4endl;
75  G4cout<<"Target nucleus A Z "<<theNucleus.GetA_asInt()<<" "
76  <<theNucleus.GetZ_asInt()<<G4endl<<G4endl;
77 #endif
78 
80  G4LorentzVector Ptmp=thePrimary.Get4Momentum();
81  toZ.rotateZ(-1*Ptmp.phi());
82  toZ.rotateY(-1*Ptmp.theta());
83  thePrimary.Set4Momentum(toZ*Ptmp);
84  G4LorentzRotation toLab(toZ.inverse());
85 
86  G4int attempts = 0, maxAttempts=20;
87  while ( strings == NULL )
88  {
89  if (attempts++ > maxAttempts )
90  {
91  throw G4HadronicException(__FILE__, __LINE__,
92  "G4VPartonStringModel::Scatter(): fails to generate strings");
93  }
94  theThis->Init(theNucleus,thePrimary);
95 
96  strings = GetStrings();
97  }
98 
99  G4double stringEnergy(0);
100  G4LorentzVector SumStringMom(0.,0.,0.,0.);
101 
102 #ifdef debug_PartonStringModel
103  G4cout<<"Parton-String model: Number of produced strings "<<strings->size()<<G4endl;
104 #endif
105 
106  for ( unsigned int astring=0; astring < strings->size(); astring++)
107  {
108 // rotate string to lab frame, models have it aligned to z
109  stringEnergy += (*strings)[astring]->GetLeftParton()->Get4Momentum().t();
110  stringEnergy += (*strings)[astring]->GetRightParton()->Get4Momentum().t();
111  (*strings)[astring]->LorentzRotate(toLab);
112  SumStringMom+=(*strings)[astring]->Get4Momentum();
113  }
114 
115  G4double InvMass=SumStringMom.mag();
116 
117 #ifdef debug_PartonStringModel
118  G4cout<<"Parton-String model: SumStringMom "<<SumStringMom<<G4endl;
119 
120  G4V3DNucleus * fancynucleus=theThis->GetWoundedNucleus();
121 
122  // loop over wounded nucleus
123  G4int hits(0), charged_hits(0);
124  G4ThreeVector hitNucleonMomentum(0.,0.,0.);
125  G4Nucleon * theCurrentNucleon = fancynucleus->StartLoop() ?
126  fancynucleus->GetNextNucleon() : NULL;
127  while( theCurrentNucleon )
128  {
129  if(theCurrentNucleon->AreYouHit())
130  {
131  hits++;
132  hitNucleonMomentum += theCurrentNucleon->Get4Momentum().vect();
133  if ( theCurrentNucleon->GetDefinition() == G4Proton::Proton() ) ++charged_hits;
134  }
135  theCurrentNucleon = fancynucleus->GetNextNucleon();
136  }
137 
138  G4int initialZ=fancynucleus->GetCharge();
139  G4int initialA=fancynucleus->GetMassNumber();
140  G4double initial_mass=
142  G4double final_mass =
144  initialZ-charged_hits, initialA-hits);
145  G4cout << "G4VPSM: " <<G4endl
146  << "strE "<<stringEnergy <<G4endl
147  << "hit nucleons "<<hits <<G4endl
148  << "Primary "<<Ptmp.e() <<G4endl
149  << "SumStringE "<<SumStringMom.e() <<G4endl
150  << "Nucleus intial "<<initial_mass <<G4endl
151  << "Nucleus final "<<final_mass <<G4endl
152  << "Excitation estimate "
153  <<Ptmp.e() + initial_mass - final_mass - stringEnergy << G4endl;
154  G4cout << "momentum balance "
155  << thePrimary.GetMomentum() + hitNucleonMomentum -
156  SumStringMom.vect()<< G4endl;
157 #endif
158 
159 // Fragment strings
160 
161  G4KineticTrackVector * theResult = 0;
162  G4double SumMass(0.);
163  attempts = 0;
164  maxAttempts=100;
165  do
166  {
167  attempts++;
168  if(theResult != 0)
169  {
170  std::for_each(theResult->begin(), theResult->end(), DeleteKineticTrack());
171  delete theResult;
172  }
173  theResult = stringFragmentationModel->FragmentStrings(strings);
174  if(attempts > maxAttempts ) break;
175 
176 #ifdef debug_PartonStringModel
177  G4cout<<"Parton-String model: Number of produced particles "<<theResult->size()<<G4endl;
178  G4LorentzVector SumPsecondr(0.,0.,0.,0.);
179 #endif
180 
181  SumMass=0.;
182 
183  for ( unsigned int i=0; i < theResult->size(); i++)
184  {
185  SumMass+=(*theResult)[i]->GetDefinition()->GetPDGMass();
186  //SumP+=(*theResult)[i]->Get4Momentum();
187 #ifdef debug_PartonStringModel
188  G4cout<<i<<" : "<<(*theResult)[i]->GetDefinition()->GetParticleName()<<" "
189  <<(*theResult)[i]->Get4Momentum()<<" "
190  <<(*theResult)[i]->Get4Momentum().mag()<<G4endl;
191  SumPsecondr+=(*theResult)[i]->Get4Momentum();
192 #endif
193  }
194 #ifdef debug_PartonStringModel
195  G4cout<<"SumP secondaries "<<SumPsecondr<<G4endl;
196 #endif
197  } while(SumMass > InvMass);
198 
199  std::for_each(strings->begin(), strings->end(), DeleteString() );
200  delete strings;
201 
202 #ifdef debug_PartonStringModel
203  G4cout<<"End of string model work ------------"<<G4endl<<G4endl;
204 #endif
205  return theResult;
206 }
G4int GetA_asInt() const
Definition: G4Nucleus.hh:109
std::vector< G4ExcitedString * > G4ExcitedStringVector
virtual G4KineticTrackVector * FragmentStrings(const G4ExcitedStringVector *theStrings)=0
virtual G4int GetCharge()=0
virtual G4bool StartLoop()=0
virtual G4V3DNucleus * GetWoundedNucleus() const =0
virtual G4int GetMassNumber()=0
virtual const G4LorentzVector & Get4Momentum() const
Definition: G4Nucleon.hh:72
G4ParticleDefinition * GetDefinition() const
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
HepLorentzRotation & rotateY(double delta)
double phi() const
G4IonTable * GetIonTable() const
Hep3Vector vect() const
G4GLOB_DLL std::ostream G4cout
double theta() const
G4double GetMass() const
G4double GetIonMass(G4int Z, G4int A, G4int L=0, G4int lvl=0) const
Definition: G4IonTable.cc:1232
G4bool AreYouHit() const
Definition: G4Nucleon.hh:97
static G4Proton * Proton()
Definition: G4Proton.cc:93
G4LorentzVector Get4Momentum() const
HepLorentzRotation & rotateZ(double delta)
void Set4Momentum(const G4LorentzVector &momentum)
static G4ParticleTable * GetParticleTable()
virtual void Init(const G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)=0
G4int GetZ_asInt() const
Definition: G4Nucleus.hh:115
virtual G4ExcitedStringVector * GetStrings()=0
#define G4endl
Definition: G4ios.hh:61
virtual G4ParticleDefinition * GetDefinition() const
Definition: G4Nucleon.hh:85
virtual G4Nucleon * GetNextNucleon()=0
HepLorentzRotation inverse() const
double G4double
Definition: G4Types.hh:76
G4ThreeVector GetMomentum() const
void G4VPartonStringModel::SetFragmentationModel ( G4VStringFragmentation aModel)
inline

Definition at line 86 of file G4VPartonStringModel.hh.

Referenced by G4BertiniElectroNuclearBuilder::Build(), G4FTFBuilder::BuildModel(), G4QGSBuilder::BuildModel(), B03PhysicsList::ConstructHad(), DMXPhysicsList::ConstructHad(), exrdmPhysListHadron::ConstructProcess(), GammaRayTelIonPhysics::ConstructProcess(), GammaRayTelHadronPhysics::ConstructProcess(), G4ElectroVDNuclearModel::G4ElectroVDNuclearModel(), G4FTFBinaryKaonBuilder::G4FTFBinaryKaonBuilder(), G4FTFBinaryNeutronBuilder::G4FTFBinaryNeutronBuilder(), G4FTFBinaryPiKBuilder::G4FTFBinaryPiKBuilder(), G4FTFBinaryPionBuilder::G4FTFBinaryPionBuilder(), G4FTFBinaryProtonBuilder::G4FTFBinaryProtonBuilder(), G4FTFPAntiBarionBuilder::G4FTFPAntiBarionBuilder(), G4FTFPKaonBuilder::G4FTFPKaonBuilder(), G4FTFPNeutronBuilder::G4FTFPNeutronBuilder(), G4FTFPPiKBuilder::G4FTFPPiKBuilder(), G4FTFPPionBuilder::G4FTFPPionBuilder(), G4FTFPProtonBuilder::G4FTFPProtonBuilder(), G4HadronicAbsorptionFritiof::G4HadronicAbsorptionFritiof(), G4HyperonFTFPBuilder::G4HyperonFTFPBuilder(), G4MuonVDNuclearModel::G4MuonVDNuclearModel(), G4QGSBinaryKaonBuilder::G4QGSBinaryKaonBuilder(), G4QGSBinaryNeutronBuilder::G4QGSBinaryNeutronBuilder(), G4QGSBinaryPiKBuilder::G4QGSBinaryPiKBuilder(), G4QGSBinaryPionBuilder::G4QGSBinaryPionBuilder(), G4QGSBinaryProtonBuilder::G4QGSBinaryProtonBuilder(), G4QGSPNeutronBuilder::G4QGSPNeutronBuilder(), G4QGSPPiKBuilder::G4QGSPPiKBuilder(), G4QGSPPionBuilder::G4QGSPPionBuilder(), G4QGSPProtonBuilder::G4QGSPProtonBuilder(), and TheoModelFactory< C, S, F >::New().

87 {
88  stringFragmentationModel = aModel;
89 }
void G4VPartonStringModel::SetThisPointer ( G4VPartonStringModel aPointer)
inlineprotected

Definition at line 92 of file G4VPartonStringModel.hh.

Referenced by G4FTFModel::G4FTFModel().

93 {
94  theThis=aPointer;
95 }

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