69 #ifdef debug_PartonStringModel
71 G4cout <<
"-----------------------Parton-String model is runnung ------------" <<
G4endl;
81 G4cout <<
"-------------- Parton-String model: Generation of strings -------" << G4endl
88 G4int QsumSec( 0 ), BsumSec( 0 );
100 G4int attempts = 0, maxAttempts = 1000;
103 if ( attempts++ > maxAttempts ) {
108 ed <<
" Target nucleus A Z " << theNucleus.
GetA_asInt() <<
" "
110 G4Exception(
"G4VPartonStringModel::Scatter(): fails to generate or fragment strings ",
116 theThis->
Init( theNucleus, thePrimary );
119 if ( strings == 0 ) {
127 #ifdef debug_PartonStringModel
128 G4cout <<
"------------ Parton-String model: Number of produced strings ---- " << strings->size() <<
G4endl;
131 for (
unsigned int astring = 0; astring < strings->size(); astring++ ) {
133 if ( (*strings)[astring]->IsExcited() ) {
134 stringEnergy += (*strings)[astring]->GetLeftParton()->Get4Momentum().t();
135 stringEnergy += (*strings)[astring]->GetRightParton()->Get4Momentum().t();
136 (*strings)[astring]->LorentzRotate( toLab );
137 SumStringMom += (*strings)[astring]->Get4Momentum();
139 #ifdef debug_PartonStringModel
140 G4cout <<
"String No " << astring + 1 <<
" " << (*strings)[astring]->Get4Momentum()
141 <<
" " << (*strings)[astring]->Get4Momentum().mag()
142 <<
" Partons " << (*strings)[astring]->GetLeftParton()->GetDefinition()->GetPDGEncoding()
143 <<
" " << (*strings)[astring]->GetRightParton()->GetDefinition()->GetPDGEncoding()
148 stringEnergy += (*strings)[astring]->GetKineticTrack()->Get4Momentum().t();
149 (*strings)[astring]->LorentzRotate( toLab );
150 SumStringMom += (*strings)[astring]->GetKineticTrack()->Get4Momentum();
152 #ifdef debug_PartonStringModel
153 G4cout <<
"A track No " << astring + 1 <<
" "
154 << (*strings)[astring]->GetKineticTrack()->Get4Momentum() <<
" "
155 << (*strings)[astring]->GetKineticTrack()->Get4Momentum().mag() <<
" "
156 << (*strings)[astring]->GetKineticTrack()->GetDefinition()->GetParticleName()
163 #ifdef debug_PartonStringModel
164 G4cout << G4endl <<
"SumString4Mom " << SumStringMom <<
G4endl;
167 G4int hitsT( 0 ), charged_hitsT( 0 );
168 G4int hitsP( 0 ), charged_hitsP( 0 );
169 G4double ExcitationEt( 0.0 ), ExcitationEp( 0.0 );
175 if ( ProjResNucleus != 0 ) {
177 while ( theNuclNucleon ) {
178 if ( theNuclNucleon->AreYouHit() ) {
181 #ifdef debug_PartonStringModel
182 ProjectileResidual4Momentum += tmp;
184 if ( theNuclNucleon->GetDefinition() ==
G4Proton::Proton() ) ++charged_hitsP;
185 ExcitationEp += theNuclNucleon->GetBindingEnergy();
188 theNuclNucleon->SetMomentum( tmp );
193 #ifdef debug_PartonStringModel
194 G4cout <<
"Projectile residual A, Z and E* "
197 << ExcitationEp <<
G4endl;
198 G4cout <<
"Projectile residual 4 momentum " << ProjectileResidual4Momentum <<
G4endl;
206 while ( theNuclNucleon ) {
207 if ( theNuclNucleon->AreYouHit() ) {
210 #ifdef debug_PartonStringModel
211 TargetResidual4Momentum += tmp;
213 if ( theNuclNucleon->GetDefinition() ==
G4Proton::Proton() ) ++charged_hitsT;
214 ExcitationEt += theNuclNucleon->GetBindingEnergy();
217 theNuclNucleon->SetMomentum( tmp );
222 #ifdef debug_PartonStringModel
223 G4cout <<
"Target residual A, Z and E* "
225 << theNucleus.
GetZ_asInt() - charged_hitsT <<
" "
226 << ExcitationEt <<
G4endl;
227 G4cout <<
"Target residual 4 momentum " << TargetResidual4Momentum <<
G4endl;
228 Bsum += ( hitsT + hitsP );
229 Qsum += ( charged_hitsT + charged_hitsP );
230 G4cout <<
"Hitted # of nucleons of projectile and target "
231 << hitsP <<
" " << hitsT <<
G4endl;
232 G4cout <<
"Hitted # of protons of projectile and target "
233 << charged_hitsP <<
" " << charged_hitsT << G4endl <<
G4endl;
234 G4cout <<
"Bsum Qsum " << Bsum <<
" " << Qsum << G4endl <<
G4endl;
239 #ifdef debug_PartonStringModel
240 G4cout <<
"------Parton-String model: Number of produced strings ----------- " << strings->size() <<
G4endl;
243 G4double InvMass = SumStringMom.mag();
246 #ifdef debug_PartonStringModel
247 QsumSec = 0; BsumSec = 0;
251 if ( theResult != 0 ) {
258 if ( theResult == 0 ) {
263 #ifdef debug_PartonStringModel
264 G4cout <<
"Attempt to fragment the strings " << attempts <<
G4endl;
265 G4cout <<
"Parton-String model: Number of produced particles " << theResult->size() <<
G4endl;
267 QsumSec = 0; BsumSec = 0;
272 for (
unsigned int i = 0; i < theResult->size(); i++ ) {
273 SumMass += (*theResult)[i]->Get4Momentum().mag();
275 #ifdef debug_PartonStringModel
276 G4cout << i <<
" : " << (*theResult)[i]->GetDefinition()->GetParticleName() <<
" "
277 << (*theResult)[i]->Get4Momentum() <<
" "
278 << (*theResult)[i]->Get4Momentum().mag() <<
" "
279 << (*theResult)[i]->GetDefinition()->GetPDGMass() <<
G4endl;
280 SumPsecondr += (*theResult)[i]->Get4Momentum();
281 BsumSec += (*theResult)[i]->GetDefinition()->GetBaryonNumber();
282 QsumSec += (*theResult)[i]->GetDefinition()->GetPDGCharge();
286 #ifdef debug_PartonStringModel
287 G4cout << G4endl <<
"-----------------------Parton-String model: balances -------------" <<
G4endl;
288 if ( Qsum != QsumSec ) {
290 G4cout <<
" Qsum != QsumSec " << Qsum <<
" " << QsumSec <<
G4endl;
292 if ( Bsum != BsumSec ) {
293 G4cout <<
"Baryon number is not conserved!!!" <<
G4endl;
294 G4cout <<
" Bsum != BsumSec " << Bsum <<
" " << BsumSec <<
G4endl;
298 if ( SumMass > InvMass || SumMass == 0.0 ) Success =
false;
300 std::for_each( strings->begin(), strings->end(),
DeleteString() );
303 }
while ( ! Success );
305 #ifdef debug_PartonStringModel
306 G4cout <<
"Baryon number balance " << Bsum - BsumSec <<
G4endl;
307 G4cout <<
"Charge balance " << Qsum - QsumSec <<
G4endl;
308 G4cout <<
"4 momentum balance " << SumStringMom - SumPsecondr <<
G4endl;
309 G4cout <<
"---------------------End of Parton-String model work -------------" << G4endl <<
G4endl;
std::vector< G4ExcitedString * > G4ExcitedStringVector
virtual G4KineticTrackVector * FragmentStrings(const G4ExcitedStringVector *theStrings)=0
std::ostringstream G4ExceptionDescription
virtual G4bool StartLoop()=0
virtual G4V3DNucleus * GetWoundedNucleus() const =0
virtual G4V3DNucleus * GetProjectileNucleus() const
G4ParticleDefinition * GetDefinition() const
const G4String & GetParticleName() const
HepLorentzRotation & rotateY(double delta)
G4GLOB_DLL std::ostream G4cout
static G4Proton * Proton()
G4LorentzVector Get4Momentum() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
HepLorentzRotation & rotateZ(double delta)
void Set4Momentum(const G4LorentzVector &momentum)
virtual void Init(const G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)=0
virtual G4ExcitedStringVector * GetStrings()=0
virtual G4Nucleon * GetNextNucleon()=0
HepLorentzRotation inverse() const
G4double GetPDGCharge() const
G4int GetBaryonNumber() const
CLHEP::HepLorentzVector G4LorentzVector