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[ 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/de_excitation/multifragmentation/src/G4StatMFMacroCanonical.cc (Version 11.3.0) and /processes/hadronic/models/de_excitation/multifragmentation/src/G4StatMFMacroCanonical.cc (Version 5.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 // by V. Lara                                     
 29 // -------------------------------------------    
 30 //                                                
 31 // Modified:                                      
 32 // 25.07.08 I.Pshenichnov (in collaboration wi    
 33 //          Mishustin (FIAS, Frankfurt, INR, M    
 34 //          Moscow, pshenich@fias.uni-frankfur    
 35 //          a fagment with Z=A; fixed memory l    
 36                                                   
 37 #include "G4StatMFMacroCanonical.hh"              
 38 #include "G4PhysicalConstants.hh"                 
 39 #include "G4SystemOfUnits.hh"                     
 40 #include "G4Pow.hh"                               
 41                                                   
 42 // constructor                                    
 43 G4StatMFMacroCanonical::G4StatMFMacroCanonical    
 44 {                                                 
 45                                                   
 46   // Get memory for clusters                      
 47   _theClusters.push_back(new G4StatMFMacroNucl    
 48   _theClusters.push_back(new G4StatMFMacroBiNu    
 49   _theClusters.push_back(new G4StatMFMacroTriN    
 50   _theClusters.push_back(new G4StatMFMacroTetr    
 51   for (G4int i = 4; i < theFragment.GetA_asInt    
 52     _theClusters.push_back(new G4StatMFMacroMu    
 53                                                   
 54   // Perform class initialization                 
 55   Initialize(theFragment);                        
 56                                                   
 57 }                                                 
 58                                                   
 59 // destructor                                     
 60 G4StatMFMacroCanonical::~G4StatMFMacroCanonica    
 61 {                                                 
 62   // garbage collection                           
 63   if (!_theClusters.empty())                      
 64     {                                             
 65       std::for_each(_theClusters.begin(),_theC    
 66     }                                             
 67 }                                                 
 68                                                   
 69 // Initialization method                          
 70 void G4StatMFMacroCanonical::Initialize(const     
 71 {                                                 
 72                                                   
 73   G4int A = theFragment.GetA_asInt();             
 74   G4int Z = theFragment.GetZ_asInt();             
 75   G4double x = 1.0 - 2.0*Z/G4double(A);           
 76   G4Pow* g4calc = G4Pow::GetInstance();           
 77                                                   
 78   // Free Internal energy at T = 0                
 79   __FreeInternalE0 = A*( -G4StatMFParameters::    
 80        G4StatMFParameters::GetGamma0()*x*x) //    
 81     + G4StatMFParameters::GetBeta0()*g4calc->Z    
 82     0.6*elm_coupling*Z*Z/(G4StatMFParameters::    
 83         g4calc->Z13(A));                          
 84                                                   
 85   CalculateTemperature(theFragment);              
 86   return;                                         
 87 }                                                 
 88                                                   
 89 void G4StatMFMacroCanonical::CalculateTemperat    
 90 {                                                 
 91   // Excitation Energy                            
 92   G4double U = theFragment.GetExcitationEnergy    
 93                                                   
 94   G4int A = theFragment.GetA_asInt();             
 95   G4int Z = theFragment.GetZ_asInt();             
 96                                                   
 97   // Fragment Multiplicity                        
 98   G4double FragMult = std::max((1.0+(2.31/MeV)    
 99                                                   
100   // Parameter Kappa                              
101   G4Pow* g4calc = G4Pow::GetInstance();           
102   _Kappa = (1.0+elm_coupling*(g4calc->A13(Frag    
103       (G4StatMFParameters::Getr0()*g4calc->Z13    
104   _Kappa = _Kappa*_Kappa*_Kappa - 1.0;            
105                                                   
106   G4StatMFMacroTemperature * theTemp = new        
107     G4StatMFMacroTemperature(A,Z,U,__FreeInter    
108                                                   
109   __MeanTemperature = theTemp->CalcTemperature    
110   _ChemPotentialNu = theTemp->GetChemicalPoten    
111   _ChemPotentialMu = theTemp->GetChemicalPoten    
112   __MeanMultiplicity = theTemp->GetMeanMultipl    
113   __MeanEntropy = theTemp->GetEntropy();          
114                                                   
115   delete theTemp;                                 
116                                                   
117   return;                                         
118 }                                                 
119                                                   
120 // -------------------------------------------    
121                                                   
122 G4StatMFChannel * G4StatMFMacroCanonical::Choo    
123 // Calculate total fragments multiplicity, fra    
124 {                                                 
125   G4int A = theFragment.GetA_asInt();             
126   G4int Z = theFragment.GetZ_asInt();             
127                                                   
128   std::vector<G4int> ANumbers(A);                 
129                                                   
130   G4double Multiplicity = ChooseA(A,ANumbers);    
131                                                   
132   std::vector<G4int> FragmentsA;                  
133                                                   
134   G4int i = 0;                                    
135   for (i = 0; i < A; i++)                         
136     {                                             
137       for (G4int j = 0; j < ANumbers[i]; j++)     
138     }                                             
139                                                   
140   // Sort fragments in decreasing order           
141   G4int im = 0;                                   
142   for (G4int j = 0; j < Multiplicity; j++)        
143     {                                             
144       G4int FragmentsAMax = 0;                    
145       im = j;                                     
146       for (i = j; i < Multiplicity; i++)          
147   {                                               
148     if (FragmentsA[i] <= FragmentsAMax) { cont    
149     else                                          
150       {                                           
151         im = i;                                   
152         FragmentsAMax = FragmentsA[im];           
153       }                                           
154   }                                               
155       if (im != j)                                
156   {                                               
157     FragmentsA[im] = FragmentsA[j];               
158     FragmentsA[j]  = FragmentsAMax;               
159   }                                               
160     }                                             
161   return ChooseZ(Z,FragmentsA);                   
162 }                                                 
163                                                   
164 G4double G4StatMFMacroCanonical::ChooseA(G4int    
165   // Determines fragments multiplicities and c    
166 {                                                 
167   G4double multiplicity = 0.0;                    
168   G4int i;                                        
169                                                   
170   std::vector<G4double> AcumMultiplicity;         
171   AcumMultiplicity.reserve(A);                    
172                                                   
173   AcumMultiplicity.push_back((*(_theClusters.b    
174   for (std::vector<G4VStatMFMacroCluster*>::it    
175        it != _theClusters.end(); ++it)            
176     {                                             
177       AcumMultiplicity.push_back((*it)->GetMea    
178     }                                             
179                                                   
180   G4int CheckA;                                   
181   do {                                            
182     CheckA = -1;                                  
183     G4int SumA = 0;                               
184     G4int ThisOne = 0;                            
185     multiplicity = 0.0;                           
186     for (i = 0; i < A; i++) ANumbers[i] = 0;      
187     do {                                          
188       G4double RandNumber = G4UniformRand()*__    
189       for (i = 0; i < A; i++) {                   
190   if (RandNumber < AcumMultiplicity[i]) {         
191     ThisOne = i;                                  
192     break;                                        
193   }                                               
194       }                                           
195       multiplicity++;                             
196       ANumbers[ThisOne] = ANumbers[ThisOne]+1;    
197       SumA += ThisOne+1;                          
198       CheckA = A - SumA;                          
199                                                   
200       // Loop checking, 05-Aug-2015, Vladimir     
201     } while (CheckA > 0);                         
202                                                   
203     // Loop checking, 05-Aug-2015, Vladimir Iv    
204   } while (CheckA < 0 || std::abs(__MeanMultip    
205                                                   
206   return multiplicity;                            
207 }                                                 
208                                                   
209 G4StatMFChannel * G4StatMFMacroCanonical::Choo    
210               std::vector<G4int> & FragmentsA)    
211     //                                            
212 {                                                 
213   G4Pow* g4calc = G4Pow::GetInstance();           
214   std::vector<G4int> FragmentsZ;                  
215                                                   
216   G4int DeltaZ = 0;                               
217   G4double CP =  G4StatMFParameters::GetCoulom    
218   G4int multiplicity = (G4int)FragmentsA.size(    
219                                                   
220   do {                                            
221     FragmentsZ.clear();                           
222     G4int SumZ = 0;                               
223     for (G4int i = 0; i < multiplicity; ++i)      
224       {                                           
225   G4int A = FragmentsA[i];                        
226   if (A <= 1)                                     
227     {                                             
228       G4double RandNumber = G4UniformRand();      
229       if (RandNumber < (*_theClusters.begin())    
230         {                                         
231     FragmentsZ.push_back(1);                      
232     SumZ += FragmentsZ[i];                        
233         }                                         
234       else FragmentsZ.push_back(0);               
235     }                                             
236   else                                            
237     {                                             
238       G4double RandZ;                             
239       G4double CC = 8.0*G4StatMFParameters::Ge    
240         + 2*CP*g4calc->Z23(FragmentsA[i]);        
241       G4double ZMean;                             
242       if (FragmentsA[i] > 1 && FragmentsA[i] <    
243       else {                                      
244         ZMean = FragmentsA[i]*(4.0*G4StatMFPar    
245              + _ChemPotentialNu)/CC;              
246       }                                           
247       G4double ZDispersion = std::sqrt(Fragmen    
248       G4int z;                                    
249       do                                          
250         {                                         
251     RandZ = G4RandGauss::shoot(ZMean,ZDispersi    
252     z = G4lrint(RandZ+0.5);                       
253     // Loop checking, 05-Aug-2015, Vladimir Iv    
254         } while (z < 0 || z > A);                 
255       FragmentsZ.push_back(z);                    
256       SumZ += z;                                  
257     }                                             
258       }                                           
259     DeltaZ = Z - SumZ;                            
260   // Loop checking, 05-Aug-2015, Vladimir Ivan    
261   } while (std::abs(DeltaZ) > 1);                 
262                                                   
263   // DeltaZ can be 0, 1 or -1                     
264   G4int idx = 0;                                  
265   if (DeltaZ < 0.0)                               
266     {                                             
267       while (FragmentsZ[idx] < 1) { ++idx; }      
268     }                                             
269   FragmentsZ[idx] += DeltaZ;                      
270                                                   
271   G4StatMFChannel * theChannel = new G4StatMFC    
272   for (G4int i = multiplicity-1; i >= 0; --i)     
273     {                                             
274       theChannel->CreateFragment(FragmentsA[i]    
275     }                                             
276                                                   
277   return theChannel;                              
278 }                                                 
279