source: trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4LowEIonFragmentation.cc @ 1340

Last change on this file since 1340 was 1340, checked in by garnier, 14 years ago

update ti head

File size: 8.6 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26// $Id: G4LowEIonFragmentation.cc,v 1.7 2010/09/08 16:38:09 gunter Exp $
27// GEANT4 tag $Name: geant4-09-03-ref-09 $
28//
29//---------------------------------------------------------------------------
30//
31// ClassName:   G4LowEIonFragmentation
32//
33// Author:  H.P. Wellisch
34//
35// Modified:
36// 02 Jun 2010 M. A. Cortes Giraldo fix: particlesFromTarget must be
37//                     accounted for as particles of initial compound nucleus
38
39#include "G4LowEIonFragmentation.hh"
40#include <algorithm>
41
42G4int G4LowEIonFragmentation::hits = 0;
43G4int G4LowEIonFragmentation::totalTries = 0;
44G4double G4LowEIonFragmentation::area = 0;
45
46G4LowEIonFragmentation::G4LowEIonFragmentation(G4ExcitationHandler * const value) 
47{
48  theHandler = value;
49  theModel = new G4PreCompoundModel(theHandler);
50}
51
52G4LowEIonFragmentation::G4LowEIonFragmentation() 
53{
54  theHandler = new G4ExcitationHandler;
55  theModel = new G4PreCompoundModel(theHandler);
56}
57
58G4LowEIonFragmentation::~G4LowEIonFragmentation() 
59{
60  delete theModel;
61}
62
63G4HadFinalState * G4LowEIonFragmentation::
64ApplyYourself(const G4HadProjectile & thePrimary, G4Nucleus & theNucleus)
65{
66  area = 0;
67  // initialize the particle change
68  theResult.Clear();
69  theResult.SetStatusChange( stopAndKill );
70  theResult.SetEnergyChange( 0.0 );
71
72  // Get Target A, Z
73  G4int aTargetA = theNucleus.GetA_asInt();
74  G4int aTargetZ = theNucleus.GetZ_asInt();
75
76  // Get Projectile A, Z
77  G4int aProjectileA = thePrimary.GetDefinition()->GetBaryonNumber();
78  G4int aProjectileZ = G4lrint(thePrimary.GetDefinition()->GetPDGCharge());
79
80  // Get Maximum radius of both
81 
82  G4Fancy3DNucleus aPrim;
83  aPrim.Init(aProjectileA, aProjectileZ);
84  G4double projectileOuterRadius = aPrim.GetOuterRadius();
85 
86  G4Fancy3DNucleus aTarg;
87  aTarg.Init(aTargetA, aTargetZ);
88  G4double targetOuterRadius = aTarg.GetOuterRadius();
89
90  // Get the Impact parameter
91  G4int particlesFromProjectile = 0;
92  G4int chargedFromProjectile = 0;
93  G4double impactParameter = 0;
94  G4double x,y;
95  G4Nucleon * pNucleon;
96  // need at lease one particle from the projectile model beyond the
97  // projectileHorizon.
98  while(0==particlesFromProjectile)
99  {
100    do
101    {
102      x = 2*G4UniformRand() - 1;
103      y = 2*G4UniformRand() - 1;
104    }
105    while(x*x + y*y > 1);
106    impactParameter = std::sqrt(x*x+y*y)*(targetOuterRadius+projectileOuterRadius);
107    totalTries++;
108    area = pi*(targetOuterRadius+projectileOuterRadius)*
109              (targetOuterRadius+projectileOuterRadius);
110    G4double projectileHorizon = impactParameter-targetOuterRadius; 
111   
112    // Empirical boundary transparency.
113    G4double empirical = G4UniformRand();
114    if(projectileHorizon/projectileOuterRadius>empirical) continue;
115   
116    // Calculate the number of nucleons involved in collision
117    // From projectile
118    aPrim.StartLoop();
119    while((pNucleon = aPrim.GetNextNucleon()))
120    {
121      if(pNucleon->GetPosition().y()>projectileHorizon)
122      {
123        // We have one
124        particlesFromProjectile++;
125        if(pNucleon->GetParticleType()==G4Proton::ProtonDefinition()) 
126        {
127          chargedFromProjectile++;
128        } 
129      }
130    }
131  }
132  hits++;
133
134  // From target:
135  G4double targetHorizon = impactParameter-projectileOuterRadius;
136  G4int chargedFromTarget = 0;
137  G4int particlesFromTarget = 0;
138  aTarg.StartLoop(); 
139  while((pNucleon = aTarg.GetNextNucleon()))
140  {
141    if(pNucleon->GetPosition().y()>targetHorizon)
142    {
143      // We have one
144      particlesFromTarget++;
145      if(pNucleon->GetParticleType()==G4Proton::ProtonDefinition()) 
146      {
147        chargedFromTarget++;
148      }
149    }
150  }
151 
152  // Energy sharing between projectile and target. Note that this is a quite simplistic kinetically.
153  G4ThreeVector exciton3Momentum = thePrimary.Get4Momentum().vect();
154  exciton3Momentum *= particlesFromProjectile/aProjectileA;
155 
156  G4double compoundEnergy = thePrimary.GetTotalEnergy()*particlesFromProjectile/aProjectileA; 
157  G4double targetMass = G4ParticleTable::GetParticleTable()
158                        ->GetIonTable()->GetIonMass(aTargetZ, aTargetA);
159  compoundEnergy += targetMass;
160  G4LorentzVector fragment4Momentum(exciton3Momentum, compoundEnergy);
161 
162  // take the nucleons and fill the Fragments
163  G4Fragment anInitialState;
164  anInitialState.SetZandA_asInt(aTargetZ+chargedFromProjectile,
165                                aTargetA+particlesFromProjectile);
166  // M.A. Cortes fix
167  //anInitialState.SetNumberOfParticles(particlesFromProjectile);
168  anInitialState.SetNumberOfParticles(particlesFromProjectile+particlesFromTarget);
169  anInitialState.SetNumberOfHoles(particlesFromTarget);
170  anInitialState.SetNumberOfCharged(chargedFromProjectile + chargedFromTarget);
171  anInitialState.SetMomentum(fragment4Momentum);
172
173  // Fragment the Fragment using Pre-compound
174  G4ReactionProductVector* thePreCompoundResult;
175  thePreCompoundResult = theModel->DeExcite(anInitialState);
176 
177  // De-excite the projectile using ExcitationHandler
178 
179  G4ReactionProductVector * theExcitationResult = 0; 
180  if(particlesFromProjectile != aProjectileA)
181  {
182    G4ThreeVector residual3Momentum = thePrimary.Get4Momentum().vect();
183    residual3Momentum -= exciton3Momentum;
184    G4double residualEnergy = thePrimary.GetTotalEnergy()*(1.-particlesFromProjectile/aProjectileA);
185    G4LorentzVector residual4Momentum(residual3Momentum, residualEnergy); 
186 
187    G4Fragment initialState2;
188    initialState2.SetZandA_asInt(aProjectileZ-chargedFromProjectile,
189                                 aProjectileA-particlesFromProjectile);
190    initialState2.SetNumberOfHoles(static_cast<G4int>((aProjectileA-particlesFromProjectile)/2.0));
191    initialState2.SetNumberOfParticles(static_cast<G4int>((aProjectileZ-chargedFromProjectile)/2.0));
192    initialState2.SetNumberOfCharged(static_cast<G4int>((aProjectileZ-chargedFromProjectile)/2.0));
193
194
195    initialState2.SetMomentum(residual4Momentum);
196    theExcitationResult = theHandler->BreakItUp(initialState2);
197  }
198
199  // Fill the particle change
200  G4int nSecondaries = 0;
201  if(theExcitationResult) nSecondaries+=theExcitationResult->size();
202  if(thePreCompoundResult) nSecondaries+=thePreCompoundResult->size();
203 
204  unsigned int k;
205  if(theExcitationResult!=0)
206  {
207    for(k=0; k<theExcitationResult->size(); k++)
208    {
209      G4DynamicParticle* p0 = new G4DynamicParticle;
210      p0->SetDefinition( theExcitationResult->operator[](k)->GetDefinition() );
211      p0->SetMomentum( theExcitationResult->operator[](k)->GetMomentum() );
212      theResult.AddSecondary(p0);
213    }
214  }
215 
216  for(k=0; k<thePreCompoundResult->size(); k++)
217  {
218    G4DynamicParticle* p0 = new G4DynamicParticle;
219    p0->SetDefinition(thePreCompoundResult->operator[](k)->GetDefinition());
220    p0->SetMomentum(thePreCompoundResult->operator[](k)->GetMomentum());
221    theResult.AddSecondary(p0);
222  }
223 
224  // clean up
225  std::for_each(thePreCompoundResult->begin(), thePreCompoundResult->end(), DeleteReactionProduct());
226  if(theExcitationResult) 
227  {
228    std::for_each(theExcitationResult->begin(), theExcitationResult->end(), DeleteReactionProduct());
229  }
230  delete thePreCompoundResult;
231  if(theExcitationResult) delete theExcitationResult;
232
233  // return the particle change
234  return &theResult;
235 
236}
Note: See TracBrowser for help on using the repository browser.