63 Bmin2( -1.0 ), Bmax2( -1.0 ),
64 currentInteraction( -1 )
77 #ifdef debugFTFparticipant
83 if ( betta_z < 1.0e-10 ) betta_z = 1.0e-10;
87 for (
unsigned int i = 0; i < theInteractions.size(); i++ )
delete theInteractions[i];
88 theInteractions.clear();
94 G4double impactX( 0.0 ), impactY( 0.0 );
99 #ifdef debugFTFparticipant
100 G4cout <<
"Hadron-nucleus or anti-baryon-nucleus interactions" <<
G4endl;
105 const G4int maxNumberOfLoops = 1000;
106 G4int loopCounter = 0;
109 std::pair< G4double, G4double > theImpactParameter;
112 B = B2 > 0.0 ? std::sqrt( B2 ) : 0.0;
114 impactX =
B * std::cos( Phi );
115 impactY =
B * std::sin( Phi );
119 impactX = theImpactParameter.first;
120 impactY = theImpactParameter.second;
124 #ifdef debugFTFparticipant
125 G4cout <<
"New interaction list," <<
" b[fm]= "
126 << std::sqrt(
sqr(impactX ) +
sqr( impactY ) )/fermi <<
G4endl;
135 #ifdef debugFTFparticipant
141 G4double impact2 =
sqr( impactX - nucleon->GetPosition().x() ) +
142 sqr( impactY - nucleon->GetPosition().y() );
148 if ( ! nucleon->AreYouHit() ) {
150 nucleon->Hit( targetSplitable );
153 #ifdef debugFTFparticipant
154 G4cout <<
"Participated nucleons #, " << TrN <<
" " <<
"Splitable Pr* Tr* "
155 << primarySplitable <<
" " << targetSplitable <<
G4endl;
162 aInteraction->
SetTarget( targetSplitable );
166 nucleon->GetPosition().z() ) / betta_z );
167 theInteractions.push_back( aInteraction );
170 #ifdef debugFTFparticipant
176 }
while ( ( theInteractions.size() == 0 ) &&
177 ++loopCounter < maxNumberOfLoops );
178 if ( loopCounter >= maxNumberOfLoops ) {
179 #ifdef debugFTFparticipant
180 G4cout <<
"BAD situation: forced exit from the while loop!" <<
G4endl;
185 #ifdef debugFTFparticipant
186 G4cout <<
"Number of Hit nucleons " << theInteractions.size() <<
"\t Bx[fm] " << impactX/fermi
187 <<
"\t By[fm] " << impactY/fermi <<
"\t B[fm] "
199 #ifdef debugFTFparticipant
208 G4double impactX( 0.0 ), impactY( 0.0 );
211 const G4int maxNumberOfLoops = 1000;
212 G4int loopCounter = 0;
215 std::pair< G4double, G4double > theImpactParameter;
218 B = B2 > 0.0 ? std::sqrt( B2 ) : 0.0;
220 impactX =
B * std::cos( Phi );
221 impactY =
B * std::sin( Phi );
225 impactX = theImpactParameter.first;
226 impactY = theImpactParameter.second;
230 #ifdef debugFTFparticipant
231 G4cout <<
"New interaction list, " <<
"b[fm] "
232 << std::sqrt(
sqr( impactX ) +
sqr( impactY ) )/fermi <<
G4endl;
240 #ifdef debugFTFparticipant
250 #ifdef debugFTFparticipant
264 #ifdef debugFTFparticipant
265 G4cout <<
G4endl <<
"An Interaction has happend" <<
G4endl <<
"Proj N mom " << PrNuclN
268 <<
"PrN TrN Z coords [fm]" << ProjectileNucleon->
GetPosition().
z()/fermi
274 if ( ! ProjectileNucleon->
AreYouHit() ) {
277 ProjectileNucleon->
Hit( ProjectileSplitable );
285 TargetNucleon->
Hit( TargetSplitable );
292 anInteraction->
SetTarget( TargetSplitable );
299 #ifdef debugFTFparticipant
300 G4cout <<
"Part anInteraction->GetInteractionTime() [fm] "
302 <<
"Splitable Pr* Tr* " << ProjectileSplitable <<
" "
303 << TargetSplitable <<
G4endl;
306 theInteractions.push_back( anInteraction );
310 #ifdef debugFTFparticipant
316 #ifdef debugFTFparticipant
324 }
while ( ( theInteractions.size() == 0 ) &&
325 ++loopCounter < maxNumberOfLoops );
326 if ( loopCounter >= maxNumberOfLoops ) {
327 #ifdef debugFTFparticipant
328 G4cout <<
"BAD situation: forced exit from the while loop!" <<
G4endl;
336 #ifdef debugFTFparticipant
337 G4cout <<
G4endl <<
"Number of primary collisions " << theInteractions.size()
338 <<
"\t Bx[fm] " << impactX/fermi <<
"\t By[fm] " << impactY/fermi
339 <<
"\t B[fm] " << std::sqrt(
sqr( impactX ) +
sqr( impactY ) )/fermi <<
G4endl
340 <<
"FTF participant End. #######################" <<
G4endl <<
G4endl;
357 if ( theInteractions.size() < 2 )
return;
365 G4double InitialTime = theInteractions[0]->GetInteractionTime();
366 for (
unsigned int i = 1; i < theInteractions.size(); i++ ) {
367 G4double InterTime = theInteractions[i]->GetInteractionTime() - InitialTime;
368 theInteractions[i]->SetInteractionTime( InterTime );
385 for (
size_t i = 0; i < theInteractions.size(); i++ ) {
386 if ( theInteractions[ i ] ) {
387 delete theInteractions[ i ];
388 theInteractions[ i ] = 0;
391 theInteractions.clear();
392 currentInteraction = -1;
G4double B(G4double temperature)
bool G4FTFPartHelperForSortInT(const G4InteractionContent *Int1, const G4InteractionContent *Int2)
G4GLOB_DLL std::ostream G4cout
G4double GetProbabilityOfInteraction(const G4double impactsquare)
void ShiftInteractionTime()
G4double GetBmin2() const
void GetList(const G4ReactionProduct &thePrimary, G4FTFParameters *theParameters)
G4bool SampleBinInterval() const
void SortInteractionsIncT()
void SetImpactParameter(const G4double b_value)
G4double GetBmax2() const
G4double GetInteractionTime() const
void SetTargetNucleon(G4Nucleon *aNucleon)
G4VSplitableHadron * GetProjectile() const
void SetTarget(G4VSplitableHadron *aTarget)
void SetStatus(G4int aValue)
void SetInteractionTime(G4double aValue)
G4VSplitableHadron * GetTarget() const
void SetProjectileNucleon(G4Nucleon *aNucleon)
const G4ThreeVector & GetPosition() const
G4VSplitableHadron * GetSplitableHadron() const
virtual const G4LorentzVector & Get4Momentum() const
void Hit(G4VSplitableHadron *aHit)
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
virtual G4double GetOuterRadius()=0
virtual G4Nucleon * GetNextNucleon()=0
virtual G4bool StartLoop()=0
virtual void DoTranslation(const G4ThreeVector &theShift)=0
std::pair< G4double, G4double > ChooseImpactXandY(G4double maxImpact)
G4V3DNucleus * theProjectileNucleus
G4V3DNucleus * theNucleus
void SetTimeOfCreation(G4double aTime)
void SetStatus(const G4int aStatus)
const G4ThreeVector & GetPosition() const
void SetPosition(const G4ThreeVector &aPosition)