source: trunk/source/processes/hadronic/models/theo_high_energy/src/G4QuasiElasticChannel.cc@ 1036

Last change on this file since 1036 was 1007, checked in by garnier, 17 years ago

update to geant4.9.2

File size: 5.1 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//
27// $Id: G4QuasiElasticChannel.cc,v 1.4 2008/04/24 13:26:19 gunter Exp $
28// GEANT4 tag $Name: geant4-09-02 $
29//
30
31// Author : Gunter Folger March 2007
32// Class Description
33// Final state production model for theoretical models of hadron inelastic
34// quasi elastic scattering in geant4;
35// Class Description - End
36//
37// Modified:
38
39#include "G4QuasiElasticChannel.hh"
40
41#include "G4Fancy3DNucleus.hh"
42
43
44#include "G4HadTmpUtil.hh" //lrint
45
46//#define debug_scatter
47
48G4QuasiElasticChannel::G4QuasiElasticChannel()
49{
50 theQuasiElastic=G4QuasiFreeRatios::GetPointer();
51}
52
53G4QuasiElasticChannel::~G4QuasiElasticChannel()
54{}
55
56G4double G4QuasiElasticChannel::GetFraction(G4Nucleus &theNucleus,
57 const G4DynamicParticle & thePrimary)
58{
59 std::pair<G4double,G4double> ratios;
60 ratios=theQuasiElastic->GetRatios(thePrimary.GetTotalMomentum(),
61 thePrimary.GetDefinition()->GetPDGEncoding(),
62 G4lrint(theNucleus.GetZ()),
63 G4lrint(theNucleus.GetN()-theNucleus.GetZ()));
64#ifdef debug_getFraction
65 G4cout << "G4QuasiElasticChannel::ratios " << ratios.first << " x " <<ratios.second
66 << " = " << ratios.first*ratios.second << G4endl;
67#endif
68
69 return ratios.first*ratios.second;
70}
71
72G4KineticTrackVector * G4QuasiElasticChannel::Scatter(G4Nucleus &theNucleus,
73 const G4DynamicParticle & thePrimary)
74{
75
76
77 G4int A=G4lrint(theNucleus.GetN());
78// G4int Z=G4lrint(theNucleus.GetZ());
79// build Nucleus and choose random nucleon to scatter with
80 the3DNucleus.Init(theNucleus.GetN(),theNucleus.GetZ());
81 const std::vector<G4Nucleon *> nucleons=the3DNucleus.GetNucleons();
82
83 G4int index;
84 do {
85 index=G4lrint((A-1)*G4UniformRand());
86
87 } while (index < 0 || index >= static_cast<G4int>(nucleons.size()));
88
89// G4double an=G4UniformRand()*A;
90 G4ParticleDefinition * pDef= nucleons[index]->GetDefinition();
91
92#ifdef debug_scatter
93 G4cout << " neutron - proton? A, Z, an, pdg" <<" "
94 << A <<" "<<G4lrint(theNucleus.GetZ())
95 << " "<<an <<" " << pDef->GetParticleName()<< G4endl;
96#endif
97// G4LorentzVector pNucleon(G4ThreeVector(0,0,0),pDef->GetPDGMass());
98 G4LorentzVector pNucleon=nucleons[index]->Get4Momentum();
99
100 std::pair<G4LorentzVector,G4LorentzVector> result;
101
102 result=theQuasiElastic->Scatter(pDef->GetPDGEncoding(),pNucleon,
103 thePrimary.GetDefinition()->GetPDGEncoding(),
104 thePrimary.Get4Momentum());
105
106 if (result.first.e() == 0.)
107 {
108 G4cout << "Warning - G4QuasiElasticChannel::Scatter no scattering" << G4endl;
109 return 0; //no scatter
110 }
111
112#ifdef debug_scatter
113 G4LorentzVector EpConservation=pNucleon+thePrimary.Get4Momentum()
114 - result.first - result.second;
115 if ( (EpConservation.vect().mag2() > 0.01*MeV*MeV )
116 || (std::abs(EpConservation.e()) > 0.1 * MeV ) )
117 {
118 G4cout << "Warning - G4QuasiElasticChannel::Scatter E-p non conservation : "
119 << EpConservation << G4endl;
120 }
121#endif
122
123 G4KineticTrackVector * ktv;
124 ktv=new G4KineticTrackVector();
125 G4KineticTrack * sPrim=new G4KineticTrack(thePrimary.GetDefinition(),
126 0.,G4ThreeVector(0), result.second);
127 ktv->push_back(sPrim);
128 G4KineticTrack * sNuc=new G4KineticTrack(pDef,
129 0.,G4ThreeVector(0), result.first);
130 ktv->push_back(sNuc);
131
132#ifdef debug_scatter
133 G4cout << " scattered Nucleon : " << result.first << " mass " <<result.first.mag() << G4endl;
134 G4cout << " scattered Project : " << result.second << " mass " <<result.second.mag() << G4endl;
135#endif
136 return ktv;
137}
Note: See TracBrowser for help on using the repository browser.