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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/G4ElasticHNScattering.cc (Version 11.3.0) and /processes/hadronic/models/parton_string/diffraction/src/G4ElasticHNScattering.cc (Version 4.1.p1)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 //                                                
 27 //                                                
 28                                                   
 29 // -------------------------------------------    
 30 //      GEANT 4 class implemetation file          
 31 //                                                
 32 //      ---------------- G4ElasticHNScattering    
 33 //                   by V. Uzhinsky, March 200    
 34 //             elastic scattering used by Frit    
 35 //                 Take a projectile and a tar    
 36 //                 scatter the projectile and     
 37 // -------------------------------------------    
 38                                                   
 39 #include "globals.hh"                             
 40 #include "Randomize.hh"                           
 41 #include "G4PhysicalConstants.hh"                 
 42 #include "G4SystemOfUnits.hh"                     
 43                                                   
 44 #include "G4ElasticHNScattering.hh"               
 45 #include "G4LorentzRotation.hh"                   
 46 #include "G4ThreeVector.hh"                       
 47 #include "G4ParticleDefinition.hh"                
 48 #include "G4VSplitableHadron.hh"                  
 49 #include "G4ExcitedString.hh"                     
 50 #include "G4FTFParameters.hh"                     
 51                                                   
 52 #include "G4SampleResonance.hh"                   
 53                                                   
 54 #include "G4Exp.hh"                               
 55 #include "G4Log.hh"                               
 56                                                   
 57 //============================================    
 58                                                   
 59 G4ElasticHNScattering::G4ElasticHNScattering()    
 60                                                   
 61                                                   
 62 //============================================    
 63                                                   
 64 G4bool G4ElasticHNScattering::ElasticScatterin    
 65                                                   
 66                                                   
 67   projectile->IncrementCollisionCount( 1 );       
 68   target->IncrementCollisionCount( 1 );           
 69                                                   
 70   if ( projectile->Get4Momentum().z() < 0.0 )     
 71                                                   
 72   // Projectile parameters                        
 73   G4LorentzVector Pprojectile = projectile->Ge    
 74   G4double M0projectile = Pprojectile.mag();      
 75   G4double M0projectile2 = M0projectile * M0pr    
 76                                                   
 77   // Target parameters                            
 78   G4LorentzVector Ptarget = target->Get4Moment    
 79   G4double M0target = Ptarget.mag();              
 80   G4double M0target2 = M0target * M0target;       
 81                                                   
 82   G4double AveragePt2 = theParameters->GetAvar    
 83                                                   
 84   // Transform momenta to cms and then rotate     
 85   G4LorentzVector Psum;                           
 86   Psum = Pprojectile + Ptarget;                   
 87   G4LorentzRotation toCms( -1*Psum.boostVector    
 88   G4LorentzVector Ptmp = toCms*Pprojectile;       
 89   if ( Ptmp.pz() <= 0.0 ) return false;           
 90   //"String" moving backwards in  CMS, abort c    
 91   //G4cout << " abort Collision! " << G4endl;     
 92   toCms.rotateZ( -1*Ptmp.phi() );                 
 93   toCms.rotateY( -1*Ptmp.theta() );               
 94   G4LorentzRotation toLab( toCms.inverse() );     
 95   Pprojectile.transform( toCms );                 
 96   Ptarget.transform( toCms );                     
 97                                                   
 98   G4double PZcms2, PZcms;                         
 99   G4double S = Psum.mag2();                       
100   G4double SqrtS = std::sqrt( S );                
101   if ( SqrtS < M0projectile + M0target ) retur    
102                                                   
103   PZcms2 = ( S*S + sqr( M0projectile2 ) + sqr(    
104              - 2*S*M0projectile2 - 2*S*M0targe    
105                                                   
106   PZcms = ( PZcms2 > 0.0 ? std::sqrt( PZcms2 )    
107                                                   
108   G4double maxPtSquare = PZcms2;                  
109                                                   
110   // Now we can calculate the transferred Pt      
111   G4double Pt2;                                   
112   G4double ProjMassT2, ProjMassT;                 
113   G4double TargMassT2, TargMassT;                 
114   G4LorentzVector Qmomentum;                      
115                                                   
116   const G4int maxNumberOfLoops = 1000;            
117   G4int loopCounter = 0;                          
118   do {                                            
119     Qmomentum = G4LorentzVector( GaussianPt( A    
120     Pt2 = G4ThreeVector( Qmomentum.vect() ).ma    
121     ProjMassT2 = M0projectile2 + Pt2;             
122     ProjMassT = std::sqrt( ProjMassT2 );          
123     TargMassT2 = M0target2 + Pt2;                 
124     TargMassT = std::sqrt( TargMassT2 );          
125   } while ( ( SqrtS < ProjMassT + TargMassT )     
126             ++loopCounter < maxNumberOfLoops )    
127   if ( loopCounter >= maxNumberOfLoops ) {        
128     return false;                                 
129   }                                               
130                                                   
131   PZcms2 = ( S*S + sqr( ProjMassT2 ) + sqr( Ta    
132              - 2.0*S*ProjMassT2 - 2.0*S*TargMa    
133                                                   
134   if ( PZcms2 < 0.0 ) { PZcms2 = 0.0; };  // t    
135   PZcms = std::sqrt( PZcms2 );                    
136   Pprojectile.setPz( PZcms );                     
137   Ptarget.setPz( -PZcms );                        
138   Pprojectile += Qmomentum;                       
139   Ptarget     -= Qmomentum;                       
140                                                   
141   // Transform back and update SplitableHadron    
142   Pprojectile.transform( toLab );                 
143   Ptarget.transform( toLab );                     
144                                                   
145   // Calculation of the creation time             
146   projectile->SetTimeOfCreation( target->GetTi    
147   projectile->SetPosition( target->GetPosition    
148                                                   
149   // Creation time and position of target nucl    
150   // ReggeonCascade() of G4FTFModel               
151                                                   
152   projectile->Set4Momentum( Pprojectile );        
153   target->Set4Momentum( Ptarget );                
154                                                   
155   //projectile->IncrementCollisionCount( 1 );     
156   //target->IncrementCollisionCount( 1 );         
157                                                   
158   return true;                                    
159 }                                                 
160                                                   
161                                                   
162 //============================================    
163                                                   
164 G4ThreeVector G4ElasticHNScattering::GaussianP    
165                                                   
166   // @@ this method is used in FTFModel as wel    
167   G4double Pt2( 0.0 );                            
168   if ( AveragePt2 <= 0.0 ) {                      
169     Pt2 = 0.0;                                    
170   } else {                                        
171     Pt2 = -AveragePt2 * G4Log( 1.0 + G4Uniform    
172   }                                               
173   G4double Pt = ( Pt2 > 0.0 ? std::sqrt( Pt2 )    
174   G4double phi = G4UniformRand() * twopi;         
175   return G4ThreeVector( Pt * std::cos( phi ),     
176 }                                                 
177                                                   
178                                                   
179 //============================================    
180                                                   
181 G4ElasticHNScattering::G4ElasticHNScattering(     
182   throw G4HadronicException( __FILE__, __LINE_    
183                              "G4ElasticHNScatt    
184 }                                                 
185                                                   
186                                                   
187 //============================================    
188                                                   
189 G4ElasticHNScattering::~G4ElasticHNScattering(    
190                                                   
191                                                   
192 //============================================    
193                                                   
194 const G4ElasticHNScattering & G4ElasticHNScatt    
195   throw G4HadronicException( __FILE__, __LINE_    
196                              "G4ElasticHNScatt    
197 }                                                 
198                                                   
199                                                   
200 //============================================    
201                                                   
202 G4bool G4ElasticHNScattering::operator==( cons    
203  throw G4HadronicException( __FILE__, __LINE__    
204                             "G4ElasticHNScatte    
205 }                                                 
206                                                   
207                                                   
208 //============================================    
209                                                   
210 G4bool G4ElasticHNScattering::operator!=( cons    
211   throw G4HadronicException( __FILE__, __LINE_    
212                             "G4ElasticHNScatte    
213 }                                                 
214                                                   
215