Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/hadronic/models/parton_string/diffraction/src/G4FTFParticipants.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/hadronic/models/parton_string/diffraction/src/G4FTFParticipants.cc (Version 11.3.0) and /processes/hadronic/models/parton_string/diffraction/src/G4FTFParticipants.cc (Version 9.5.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
                                                   >>  27 // $Id: G4FTFParticipants.cc,v 1.18 2010/12/07 10:42:40 vuzhinsk Exp $
                                                   >>  28 // GEANT4 tag $Name:  $
 27 //                                                 29 //
 28                                                << 
 29 // -------------------------------------------     30 // ------------------------------------------------------------
 30 //      GEANT 4 class implementation file          31 //      GEANT 4 class implementation file
 31 //                                                 32 //
 32 //      ---------------- G4FTFParticipants----     33 //      ---------------- G4FTFParticipants----------------
 33 //             by Gunter Folger, June 1998.        34 //             by Gunter Folger, June 1998.
 34 //       class finding colliding particles in      35 //       class finding colliding particles in FTFPartonStringModel
 35 //  Changed in a part by V. Uzhinsky in oder t     36 //  Changed in a part by V. Uzhinsky in oder to put in correcpondence
 36 //        with original FRITIOF mode. November     37 //        with original FRITIOF mode. November - December 2006.
 37 //  Ajusted for (anti) nucleus - nucleus inter     38 //  Ajusted for (anti) nucleus - nucleus interactions by V. Uzhinsky.
 38 //                    (February 2011)              39 //                    (February 2011)
 39 // -------------------------------------------     40 // ------------------------------------------------------------
 40                                                    41 
 41 #include <utility>                             <<  42 #include "G4FTFParameters.hh"                            // Uzhi 29.03.08
 42 #include <vector>                              << 
 43 #include <algorithm>                           << 
 44                                                << 
 45 #include "G4FTFParticipants.hh"                    43 #include "G4FTFParticipants.hh"
 46 #include "G4ios.hh"                            << 
 47 #include "Randomize.hh"                        << 
 48 #include "G4SystemOfUnits.hh"                  << 
 49 #include "G4FTFParameters.hh"                  << 
 50 #include "G4DiffractiveSplitableHadron.hh"         44 #include "G4DiffractiveSplitableHadron.hh"
 51 #include "G4VSplitableHadron.hh"                   45 #include "G4VSplitableHadron.hh"
 52 #include "G4PhysicalConstants.hh"              <<  46 #include "Randomize.hh"
 53                                                <<  47 #include <utility>                                        // Uzhi 29.03.08
 54                                                <<  48 #include "G4ios.hh"
 55 //============================================ <<  49 #include <vector>
 56                                                <<  50 #include <algorithm>
 57 //#define debugFTFparticipant                  <<  51 // Class G4FTFParticipants 
 58                                                << 
 59                                                << 
 60 //============================================ << 
 61                                                << 
 62 G4FTFParticipants::G4FTFParticipants() : Bimpa << 
 63                                          Bmin2 << 
 64                                          curre << 
 65 {}                                             << 
 66                                                << 
 67                                                << 
 68 //============================================ << 
 69                                                << 
 70 G4FTFParticipants::~G4FTFParticipants() {}     << 
 71                                                << 
 72 //============================================ << 
 73                                                << 
 74 void G4FTFParticipants::GetList( const G4React << 
 75                                  G4FTFParamete << 
 76                                                << 
 77   #ifdef debugFTFparticipant                   << 
 78   G4cout << "Participants::GetList" << G4endl  << 
 79          << "thePrimary " << thePrimary.GetMom << 
 80   #endif                                       << 
 81                                                << 
 82   G4double betta_z = thePrimary.GetMomentum(). << 
 83   if ( betta_z < 1.0e-10 ) betta_z = 1.0e-10;  << 
 84                                                << 
 85   StartLoop(); // reset Loop over Interactions << 
 86                                                << 
 87   for ( unsigned int i = 0; i < theInteraction << 
 88   theInteractions.clear();                     << 
 89                                                << 
 90   G4double deltaxy = 2.0 * fermi;  // Extra nu << 
 91                                                << 
 92   if ( theProjectileNucleus == nullptr ) {  // << 
 93                                                << 
 94     G4double impactX( 0.0 ), impactY( 0.0 );   << 
 95     G4double B( 0.0 ), B2( 0.0 );              << 
 96                                                << 
 97     G4VSplitableHadron* primarySplitable = new << 
 98                                                << 
 99     #ifdef debugFTFparticipant                 << 
100     G4cout << "Hadron-nucleus or anti-baryon-n << 
101     #endif                                     << 
102                                                << 
103     G4double xyradius = theNucleus->GetOuterRa << 
104                                                << 
105     const G4int maxNumberOfLoops = 1000;       << 
106     G4int loopCounter = 0;                     << 
107     do {                                       << 
108                                                << 
109       std::pair< G4double, G4double > theImpac << 
110       if ( SampleBinInterval() ) {             << 
111         B2 = GetBmin2() + G4UniformRand() * (  << 
112         B  = B2 > 0.0 ? std::sqrt( B2 ) : 0.0; << 
113         G4double Phi = twopi * G4UniformRand() << 
114         impactX = B * std::cos( Phi );         << 
115         impactY = B * std::sin( Phi );         << 
116         SetImpactParameter( B );               << 
117       } else {                                 << 
118         theImpactParameter = theNucleus->Choos << 
119         impactX = theImpactParameter.first;    << 
120         impactY = theImpactParameter.second;   << 
121         SetImpactParameter( std::sqrt( sqr(imp << 
122       }                                        << 
123                                                << 
124       #ifdef debugFTFparticipant               << 
125       G4cout << "New interaction list," << " b << 
126              << std::sqrt( sqr(impactX ) + sqr << 
127       #endif                                   << 
128                                                << 
129       G4ThreeVector thePosition( impactX, impa << 
130       primarySplitable->SetPosition( thePositi << 
131                                                << 
132       theNucleus->StartLoop();                 << 
133       G4Nucleon* nucleon;                      << 
134                                                << 
135       #ifdef debugFTFparticipant               << 
136       G4int TrN( 0 );                          << 
137       #endif                                   << 
138                                                << 
139       while ( ( nucleon = theNucleus->GetNextN << 
140                                                << 
141         G4double impact2 = sqr( impactX - nucl << 
142                            sqr( impactY - nucl << 
143                                                << 
144         if ( theParameters->GetProbabilityOfIn << 
145              G4UniformRand() ) {               << 
146           primarySplitable->SetStatus( 1 );  / << 
147           G4VSplitableHadron* targetSplitable  << 
148           if ( ! nucleon->AreYouHit() ) {      << 
149             targetSplitable = new G4Diffractiv << 
150             nucleon->Hit( targetSplitable );   << 
151             targetSplitable->SetStatus( 1 ); / << 
152                                                << 
153             #ifdef debugFTFparticipant         << 
154             G4cout << "Participated nucleons # << 
155                    << primarySplitable << " "  << 
156             #endif                             << 
157                                                << 
158           }                                    << 
159           G4InteractionContent* aInteraction = << 
160           G4Nucleon* PrNucleon = 0;            << 
161           aInteraction->SetProjectileNucleon(  << 
162           aInteraction->SetTarget( targetSplit << 
163           aInteraction->SetTargetNucleon( nucl << 
164           aInteraction->SetStatus( 1 );        << 
165           aInteraction->SetInteractionTime( (  << 
166                                                << 
167           theInteractions.push_back( aInteract << 
168         }                                      << 
169                                                << 
170         #ifdef debugFTFparticipant             << 
171         TrN++;                                 << 
172         #endif                                 << 
173                                                << 
174       }                                        << 
175                                                << 
176     } while ( ( theInteractions.size() == 0 )  << 
177               ++loopCounter < maxNumberOfLoops << 
178     if ( loopCounter >= maxNumberOfLoops ) {   << 
179       #ifdef debugFTFparticipant               << 
180       G4cout << "BAD situation: forced exit fr << 
181       #endif                                   << 
182       return;                                  << 
183     }                                          << 
184                                                << 
185     #ifdef debugFTFparticipant                 << 
186     G4cout << "Number of Hit nucleons " << the << 
187            << "\t By[fm] " << impactY/fermi << << 
188            << std::sqrt( sqr( impactX ) + sqr( << 
189     #endif                                     << 
190                                                << 
191     //SortInteractionsIncT(); // Not need beca << 
192     ShiftInteractionTime();  // To put correct << 
193     return;                                    << 
194                                                << 
195   }  // end of if ( theProjectileNucleus == 0  << 
196                                                << 
197   // Projectile and target are nuclei          << 
198                                                << 
199   #ifdef debugFTFparticipant                   << 
200   G4cout << "Projectile and target are nuclei" << 
201   #endif                                       << 
202                                                << 
203   //G4cout<<theProjectileNucleus->GetOuterRadi << 
204                                                << 
205   // Range of impact parameter sampling        << 
206   G4double xyradius = theProjectileNucleus->Ge << 
207                                                << 
208   G4double impactX( 0.0 ), impactY( 0.0 );     << 
209   G4double B( 0.0 ), B2( 0.0 );                << 
210                                                << 
211   const G4int maxNumberOfLoops = 1000;         << 
212   G4int loopCounter = 0;                       << 
213   do {                                         << 
214                                                << 
215     std::pair< G4double, G4double > theImpactP << 
216     if ( SampleBinInterval() ) {               << 
217       B2 = GetBmin2() + G4UniformRand() * ( Ge << 
218       B  = B2 > 0.0 ? std::sqrt( B2 ) : 0.0;   << 
219       G4double Phi = twopi * G4UniformRand();  << 
220       impactX = B * std::cos( Phi );           << 
221       impactY = B * std::sin( Phi );           << 
222       SetImpactParameter( B );                 << 
223     } else {                                   << 
224       theImpactParameter = theNucleus->ChooseI << 
225       impactX = theImpactParameter.first;      << 
226       impactY = theImpactParameter.second;     << 
227       SetImpactParameter( std::sqrt( sqr(impac << 
228     }                                          << 
229                                                << 
230     #ifdef debugFTFparticipant                 << 
231     G4cout << "New interaction list, " << "b[f << 
232            << std::sqrt( sqr( impactX ) + sqr( << 
233     #endif                                     << 
234                                                << 
235     G4ThreeVector theBeamPosition( impactX, im << 
236                                                << 
237     theProjectileNucleus->StartLoop();         << 
238     G4Nucleon* ProjectileNucleon;              << 
239                                                << 
240     #ifdef debugFTFparticipant                 << 
241     G4int PrNuclN( 0 );                        << 
242     #endif                                     << 
243                                                << 
244     while ( ( ProjectileNucleon = theProjectil << 
245                                                << 
246       G4VSplitableHadron* ProjectileSplitable  << 
247       theNucleus->StartLoop();                 << 
248       G4Nucleon* TargetNucleon = 0;            << 
249                                                << 
250       #ifdef debugFTFparticipant               << 
251       G4int TrNuclN( 0 );                      << 
252       #endif                                   << 
253                                                << 
254       while ( ( TargetNucleon = theNucleus->Ge << 
255                                                << 
256         G4double impact2 = sqr( impactX + Proj << 
257                                 TargetNucleon- << 
258                            sqr( impactY + Proj << 
259                                 TargetNucleon- << 
260         G4VSplitableHadron* TargetSplitable =  << 
261         if ( theParameters->GetProbabilityOfIn << 
262              G4UniformRand() ) {  // An intera << 
263                                                << 
264           #ifdef debugFTFparticipant           << 
265           G4cout << G4endl << "An Interaction  << 
266                  << " " << ProjectileNucleon-> << 
267                  << "Targ N mom " << TrNuclN < << 
268                  << "PrN TrN Z coords [fm]" << << 
269                  << " " << TargetNucleon->GetP << 
270                  << " " << ProjectileNucleon-> << 
271                            TargetNucleon->GetP << 
272           #endif                               << 
273                                                << 
274           if ( ! ProjectileNucleon->AreYouHit( << 
275             // Projectile nucleon was not invo << 
276             ProjectileSplitable = new G4Diffra << 
277             ProjectileNucleon->Hit( Projectile << 
278             ProjectileSplitable->SetStatus( 1  << 
279           } else {  // Projectile nucleon was  << 
280             ProjectileSplitable = ProjectileNu << 
281           }                                    << 
282                                                << 
283           if ( ! TargetNucleon->AreYouHit() )  << 
284             TargetSplitable = new G4Diffractiv << 
285             TargetNucleon->Hit( TargetSplitabl << 
286             TargetSplitable->SetStatus( 1 );   << 
287           } else {  // Target nucleon was invo << 
288             TargetSplitable = TargetNucleon->G << 
289           }                                    << 
290                                                << 
291           G4InteractionContent* anInteraction  << 
292           anInteraction->SetTarget( TargetSpli << 
293           anInteraction->SetProjectileNucleon( << 
294           anInteraction->SetTargetNucleon( Tar << 
295           anInteraction->SetInteractionTime( ( << 
296                                                << 
297           anInteraction->SetStatus( 1 );       << 
298                                                << 
299           #ifdef debugFTFparticipant           << 
300           G4cout << "Part anInteraction->GetIn << 
301                  << anInteraction->GetInteract << 
302                  << "Splitable Pr* Tr* " << Pr << 
303                  << TargetSplitable << G4endl; << 
304           #endif                               << 
305                                                << 
306           theInteractions.push_back( anInterac << 
307                                                << 
308         } // End of an Interaction has happend << 
309                                                << 
310         #ifdef debugFTFparticipant             << 
311         TrNuclN++;                             << 
312         #endif                                 << 
313                                                << 
314       }  // End of while ( ( TargetNucleon = t << 
315                                                << 
316       #ifdef debugFTFparticipant               << 
317       PrNuclN++;                               << 
318       #endif                                   << 
319                                                << 
320     }  // End of while ( ( ProjectileNucleon = << 
321                                                << 
322     if ( theInteractions.size() != 0 ) theProj << 
323                                                << 
324   } while ( ( theInteractions.size() == 0 ) && << 
325             ++loopCounter < maxNumberOfLoops ) << 
326   if ( loopCounter >= maxNumberOfLoops ) {     << 
327     #ifdef debugFTFparticipant                 << 
328     G4cout << "BAD situation: forced exit from << 
329     #endif                                     << 
330     return;                                    << 
331   }                                            << 
332                                                << 
333   SortInteractionsIncT();                      << 
334   ShiftInteractionTime();                      << 
335                                                    52 
336   #ifdef debugFTFparticipant                   <<  53 G4FTFParticipants::G4FTFParticipants() 
337   G4cout << G4endl << "Number of primary colli <<  54 {
338          << "\t Bx[fm] " << impactX/fermi << " <<  55  theProjectileNucleus=0;
339          << "\t B[fm] " << std::sqrt( sqr( imp << 
340          << "FTF participant End. ############ << 
341   #endif                                       << 
342   return;                                      << 
343 }                                                  56 }
344                                                    57 
345                                                <<  58 G4FTFParticipants::G4FTFParticipants(const G4FTFParticipants &): G4VParticipants()
346 //============================================ <<  59 {
347                                                <<  60   G4Exception("G4FTFParticipants::G4FTFParticipants()","HAD_FTF_001",
348 bool G4FTFPartHelperForSortInT( const G4Intera <<  61           FatalException," Must not use copy ctor()");
349                                 const G4Intera << 
350   return Int1->GetInteractionTime() < Int2->Ge << 
351 }                                                  62 }
352                                                    63 
353                                                    64 
354 //============================================ <<  65 G4FTFParticipants::~G4FTFParticipants()
355                                                <<  66 {
356 void G4FTFParticipants::SortInteractionsIncT() <<  67   if ( theProjectileNucleus != NULL ) delete theProjectileNucleus;
357   if ( theInteractions.size() < 2 ) return;  / << 
358   std::sort( theInteractions.begin(), theInter << 
359 }                                                  68 }
360                                                    69 
                                                   >>  70 //-------------------------------------------------------------------------
361                                                    71 
362 //============================================ <<  72 void G4FTFParticipants::SetProjectileNucleus(G4V3DNucleus * aNucleus)
363                                                <<  73 {
364 void G4FTFParticipants::ShiftInteractionTime() <<  74   if (theProjectileNucleus) delete theProjectileNucleus;
365   G4double InitialTime = theInteractions[0]->G <<  75   
366   for ( unsigned int i = 1; i < theInteraction <<  76   theProjectileNucleus = aNucleus;
367     G4double InterTime = theInteractions[i]->G << 
368     theInteractions[i]->SetInteractionTime( In << 
369     G4InteractionContent* aCollision = theInte << 
370     G4VSplitableHadron* projectile = aCollisio << 
371     G4VSplitableHadron* target = aCollision->G << 
372     G4ThreeVector prPosition = projectile->Get << 
373     prPosition.setZ( target->GetPosition().z() << 
374     projectile->SetPosition( prPosition );     << 
375     projectile->SetTimeOfCreation( InterTime ) << 
376     target->SetTimeOfCreation( InterTime );    << 
377   }                                            << 
378   return;                                      << 
379 }                                                  77 }
380                                                    78 
                                                   >>  79 G4V3DNucleus * G4FTFParticipants::GetProjectileNucleus()
                                                   >>  80 {
                                                   >>  81   return theProjectileNucleus;
                                                   >>  82 }
381                                                    83 
382 //============================================ <<  84 void G4FTFParticipants::InitProjectileNucleus(G4int theA, G4int theZ)
383                                                <<  85 {
384 void G4FTFParticipants::Clean() {              <<  86   if ( theProjectileNucleus == NULL ) theProjectileNucleus = new G4Fancy3DNucleus();
385   for ( size_t i = 0; i < theInteractions.size <<  87   theProjectileNucleus->Init(theA, theZ);
386     if ( theInteractions[ i ] ) {              <<  88         theProjectileNucleus->SortNucleonsDecZ();
387       delete theInteractions[ i ];             <<  89 }
388       theInteractions[ i ] = 0;                <<  90 //-------------------------------------------------------------------------
389     }                                          <<  91 void G4FTFParticipants::GetList(const G4ReactionProduct  &thePrimary,
390   }                                            <<  92                                       G4FTFParameters    *theParameters) 
391   theInteractions.clear();                     <<  93 { 
392   currentInteraction = -1;                     <<  94 //G4cout<<"Participants::GetList"<<G4endl;
                                                   >>  95 //G4cout<<"thePrimary "<<thePrimary.GetMomentum()<<G4endl;
                                                   >>  96     StartLoop();  // reset Loop over Interactions
                                                   >>  97 
                                                   >>  98     for(unsigned int i=0; i<theInteractions.size(); i++) delete theInteractions[i];
                                                   >>  99     theInteractions.clear();
                                                   >> 100 
                                                   >> 101     G4double deltaxy=2 * fermi;                       // Extra nuclear radius
                                                   >> 102 //G4cout<<"theProjectileNucleus "<<theProjectileNucleus<<G4endl;
                                                   >> 103     if(theProjectileNucleus == 0)
                                                   >> 104     { // Hadron-nucleus or anti-baryon-nucleus interactions
                                                   >> 105 //G4cout<<"Hadron-nucleus or anti-baryon-nucleus interactions"<<G4endl;
                                                   >> 106 
                                                   >> 107      G4double impactX(0.), impactY(0.);
                                                   >> 108 
                                                   >> 109      G4VSplitableHadron * primarySplitable=new G4DiffractiveSplitableHadron(thePrimary);
                                                   >> 110 //G4cout<<"Prim in Part "<<primarySplitable->Get4Momentum()<<G4endl;
                                                   >> 111      G4double xyradius;                          
                                                   >> 112      xyradius =theNucleus->GetOuterRadius() + deltaxy; // Impact parameter sampling
                                                   >> 113                                                       
                                                   >> 114 //    G4bool nucleusNeedsShift = true;                // Uzhi 20 July 2009
                                                   >> 115     
                                                   >> 116      while ( theInteractions.size() == 0 )
                                                   >> 117      {
                                                   >> 118    std::pair<G4double, G4double> theImpactParameter;
                                                   >> 119    theImpactParameter = theNucleus->ChooseImpactXandY(xyradius);
                                                   >> 120    impactX = theImpactParameter.first; 
                                                   >> 121    impactY = theImpactParameter.second;
                                                   >> 122 
                                                   >> 123          G4ThreeVector thePosition(impactX, impactY, -DBL_MAX);     
                                                   >> 124          primarySplitable->SetPosition(thePosition);                
                                                   >> 125 
                                                   >> 126    theNucleus->StartLoop();
                                                   >> 127    G4Nucleon * nucleon;
                                                   >> 128 
                                                   >> 129 G4int TrN(0);
                                                   >> 130    while ( (nucleon=theNucleus->GetNextNucleon()) ) 
                                                   >> 131    {
                                                   >> 132          G4double impact2= sqr(impactX - nucleon->GetPosition().x()) +
                                                   >> 133                              sqr(impactY - nucleon->GetPosition().y());
                                                   >> 134 
                                                   >> 135      if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi) 
                                                   >> 136     > G4UniformRand() )
                                                   >> 137      {
                                                   >> 138                 primarySplitable->SetStatus(1);        // It takes part in the interaction
                                                   >> 139 
                                                   >> 140     G4VSplitableHadron * targetSplitable=0;
                                                   >> 141       if ( ! nucleon->AreYouHit() )
                                                   >> 142       {
                                                   >> 143           targetSplitable= new G4DiffractiveSplitableHadron(*nucleon);
                                                   >> 144           nucleon->Hit(targetSplitable);
                                                   >> 145           nucleon->SetBindingEnergy(3.*nucleon->GetBindingEnergy()); 
                                                   >> 146 //G4cout<<" Part nucl "<<TrN<<" "<<nucleon->Get4Momentum()<<G4endl;
                                                   >> 147 //G4cout<<" Part nucl "<<G4endl;
                                                   >> 148                     targetSplitable->SetStatus(1);     // It takes part in the interaction
                                                   >> 149       }
                                                   >> 150       G4InteractionContent * aInteraction = 
                                                   >> 151                                        new G4InteractionContent(primarySplitable);
                                                   >> 152     aInteraction->SetTarget(targetSplitable);
                                                   >> 153                 aInteraction->SetTargetNucleon(nucleon);     // Uzhi 16.07.09
                                                   >> 154                 aInteraction->SetStatus(1);                  // Uzhi Feb26
                                                   >> 155     theInteractions.push_back(aInteraction);
                                                   >> 156      }
                                                   >> 157 TrN++;
                                                   >> 158    }    
                                                   >> 159      }      // end of while ( theInteractions.size() == 0 )
                                                   >> 160 
                                                   >> 161 //  G4cout << "Number of Hit nucleons " << theInteractions.size()
                                                   >> 162 //    << "\t" << impactX/fermi << "\t"<<impactY/fermi
                                                   >> 163 //    << "\t" << std::sqrt(sqr(impactX)+sqr(impactY))/fermi <<G4endl;
                                                   >> 164 
                                                   >> 165      return;
                                                   >> 166     }       // end of if(theProjectileNucleus == 0)
                                                   >> 167 
                                                   >> 168 //-------------------------------------------------------------------
                                                   >> 169 //                Projectile and target are nuclei
                                                   >> 170 //-------------------------------------------------------------------
                                                   >> 171 //VU    G4VSplitableHadron * primarySplitable=new G4DiffractiveSplitableHadron(thePrimary);
                                                   >> 172 //G4cout<<"Prim in Part "<<primarySplitable->Get4Momentum()<<G4endl;
                                                   >> 173 //G4cout<<"Projectile and target are nuclei"<<G4endl;
                                                   >> 174 //G4cout<<thePrimary.GetMomentum()<<G4endl;
                                                   >> 175 //G4cout<<"Part Pr Tr "<<theProjectileNucleus<<" "<<theNucleus<<G4endl;
                                                   >> 176 
                                                   >> 177 
                                                   >> 178     G4double xyradius;                          
                                                   >> 179     xyradius =theProjectileNucleus->GetOuterRadius() +  // Impact parameter sampling
                                                   >> 180                         theNucleus->GetOuterRadius() + deltaxy;
                                                   >> 181 
                                                   >> 182     G4double impactX(0.), impactY(0.);
                                                   >> 183 
                                                   >> 184     while ( theInteractions.size() == 0 )
                                                   >> 185     {
                                                   >> 186 //G4cout<<"New interaction list"<<G4endl;
                                                   >> 187    std::pair<G4double, G4double> theImpactParameter;
                                                   >> 188    theImpactParameter = theNucleus->ChooseImpactXandY(xyradius);
                                                   >> 189    impactX = theImpactParameter.first; 
                                                   >> 190    impactY = theImpactParameter.second;
                                                   >> 191 //G4cout<<"B "<<std::sqrt(sqr(impactX)+sqr(impactY))/fermi<<G4endl;
                                                   >> 192 
                                                   >> 193          G4ThreeVector thePosition(impactX, impactY, -DBL_MAX);     
                                                   >> 194 //VU         primarySplitable->SetPosition(thePosition);                
                                                   >> 195 
                                                   >> 196    theProjectileNucleus->StartLoop();
                                                   >> 197    G4Nucleon * ProjectileNucleon;
                                                   >> 198 G4int PrNuclN(0);
                                                   >> 199 
                                                   >> 200    while ( (ProjectileNucleon=theProjectileNucleus->GetNextNucleon()) ) 
                                                   >> 201    {
                                                   >> 202            G4VSplitableHadron * ProjectileSplitable=0;
                                                   >> 203 //G4cout<<G4endl<<"Prj N mom "<<ProjectileNucleon->Get4Momentum()<<"-------------"<<G4endl;
                                                   >> 204            theNucleus->StartLoop();
                                                   >> 205            G4Nucleon * TargetNucleon;
                                                   >> 206 
                                                   >> 207 G4int TrNuclN(0);
                                                   >> 208            while ( (TargetNucleon=theNucleus->GetNextNucleon()) )
                                                   >> 209            {
                                                   >> 210 //G4cout<<"Trg N mom "<<TargetNucleon->Get4Momentum()<<G4endl;
                                                   >> 211           G4double impact2=
                                                   >> 212             sqr(impactX+ProjectileNucleon->GetPosition().x()-TargetNucleon->GetPosition().x())+
                                                   >> 213             sqr(impactY+ProjectileNucleon->GetPosition().y()-TargetNucleon->GetPosition().y());
                                                   >> 214 
                                                   >> 215             G4VSplitableHadron * TargetSplitable=0;
                                                   >> 216 
                                                   >> 217       if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi) 
                                                   >> 218      > G4UniformRand() )
                                                   >> 219       { // An Interaction has happend!
                                                   >> 220 //G4cout<<"An Interaction has happend"<<G4endl;
                                                   >> 221 //G4cout<<"PrN TrN "<<PrNuclN<<" "<<TrNuclN<<" "<<ProjectileNucleon->GetPosition().z()/fermi<<" "<<TargetNucleon->GetPosition().z()/fermi<<" "<<ProjectileNucleon->GetPosition().z()/fermi + TargetNucleon->GetPosition().z()/fermi <<G4endl;
                                                   >> 222 
                                                   >> 223              if ( ! ProjectileNucleon->AreYouHit() )
                                                   >> 224              { // Projectile nucleon was not involved until now.
                                                   >> 225               ProjectileSplitable= new G4DiffractiveSplitableHadron(*ProjectileNucleon);
                                                   >> 226               ProjectileNucleon->Hit(ProjectileSplitable);
                                                   >> 227               ProjectileNucleon->SetBindingEnergy(3.*ProjectileNucleon->GetBindingEnergy());
                                                   >> 228               ProjectileSplitable->SetStatus(1);     // It takes part in the interaction
                                                   >> 229              }
                                                   >> 230              else
                                                   >> 231              {  // Projectile nucleon was involved before.
                                                   >> 232               ProjectileSplitable=ProjectileNucleon->GetSplitableHadron();
                                                   >> 233              } // End of if ( ! Projectileucleon->AreYouHit() )
                                                   >> 234 
                                                   >> 235              if ( ! TargetNucleon->AreYouHit() )
                                                   >> 236              {  // Target nucleon was not involved until now
                                                   >> 237               TargetSplitable= new G4DiffractiveSplitableHadron(*TargetNucleon);
                                                   >> 238               TargetNucleon->Hit(TargetSplitable);
                                                   >> 239               TargetNucleon->SetBindingEnergy(3.*ProjectileNucleon->GetBindingEnergy());
                                                   >> 240               TargetSplitable->SetStatus(1);     // It takes part in the interaction
                                                   >> 241              }
                                                   >> 242              else
                                                   >> 243              {  // Target nucleon was involved before.
                                                   >> 244               TargetSplitable=TargetNucleon->GetSplitableHadron();
                                                   >> 245              } // End of if ( ! TargetNeucleon->AreYouHit() )
                                                   >> 246 
                                                   >> 247              G4InteractionContent * anInteraction = 
                                                   >> 248                                    new G4InteractionContent(ProjectileSplitable);
                                                   >> 249              anInteraction->SetTarget(TargetSplitable);
                                                   >> 250              anInteraction->SetTargetNucleon(TargetNucleon);
                                                   >> 251              anInteraction->SetStatus(1);                      // Uzhi Feb26
                                                   >> 252 //             anInteraction->SetInteractionTime(ProjectileNucleon->GetPosition().z()+
                                                   >> 253 //                                                   TargetNucleon->GetPosition().z());
                                                   >> 254 //G4cout<<"Z's pr tr "<<ProjectileNucleon->GetPosition().z()/fermi<<" "<<TargetNucleon->GetPosition().z()/fermi<<" "<<ProjectileNucleon->GetPosition().z()/fermi + TargetNucleon->GetPosition().z()/fermi <<G4endl;
                                                   >> 255              theInteractions.push_back(anInteraction);
                                                   >> 256 //G4cout<<"Ppr tr "<<ProjectileSplitable<<" "<<TargetSplitable<<G4endl;
                                                   >> 257             } // End of An Interaction has happend!
                                                   >> 258 TrNuclN++;
                                                   >> 259            } // End of while ( (TargetNucleon=theNucleus->GetNextNucleon()) )
                                                   >> 260 PrNuclN++;
                                                   >> 261    } // End of   while ( (ProjectileNucleon=theProjectileNucleus->GetNextNucleon()) )
                                                   >> 262     }      // end of while ( theInteractions.size() == 0 )
                                                   >> 263 
                                                   >> 264 //std::sort(theInteractions.begin(),theInteractions.end()); // ????
                                                   >> 265 
                                                   >> 266 //  G4cout << "Number of primary collisions " << theInteractions.size() 
                                                   >> 267 //    << "\t" << impactX/fermi << "\t"<<impactY/fermi
                                                   >> 268 //    << "\t" << std::sqrt(sqr(impactX)+sqr(impactY))/fermi <<G4endl;
                                                   >> 269 //G4int Uzhi; G4cin >> Uzhi;
                                                   >> 270     return;
393 }                                                 271 }
                                                   >> 272 //--------------------------------------------------------------
394                                                   273 
                                                   >> 274 // Implementation (private) methods
395                                                   275