source: trunk/source/processes/hadronic/models/parton_string/diffraction/src/G4FTFParticipants.cc@ 1315

Last change on this file since 1315 was 1228, checked in by garnier, 16 years ago

update geant4.9.3 tag

File size: 5.4 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: G4FTFParticipants.cc,v 1.16 2009/11/25 09:14:03 vuzhinsk Exp $
28// GEANT4 tag $Name: geant4-09-03 $
29//
30// ------------------------------------------------------------
31// GEANT 4 class implementation file
32//
33// ---------------- G4FTFParticipants----------------
34// by Gunter Folger, June 1998.
35// class finding colliding particles in FTFPartonStringModel
36// Changed in a part by V. Uzhinsky in oder to put in correcpondence
37// with original FRITIOF mode. November - December 2006.
38// ------------------------------------------------------------
39
40#include "G4FTFParameters.hh" // Uzhi 29.03.08
41#include "G4FTFParticipants.hh"
42#include "G4DiffractiveSplitableHadron.hh"
43#include "G4VSplitableHadron.hh"
44#include "Randomize.hh"
45#include <utility> // Uzhi 29.03.08
46
47// Class G4FTFParticipants
48
49G4FTFParticipants::G4FTFParticipants()
50{
51}
52
53G4FTFParticipants::G4FTFParticipants(const G4FTFParticipants &): G4VParticipants()
54{
55}
56
57
58G4FTFParticipants::~G4FTFParticipants()
59{
60}
61
62
63//const G4FTFParticipants & G4FTFParticipants::operator=(const G4FTFParticipants &right)
64//{}
65
66
67//int G4FTFParticipants::operator==(const G4FTFParticipants &right) const
68//{}
69
70//int G4FTFParticipants::operator!=(const G4FTFParticipants &right) const
71//{}
72
73void G4FTFParticipants::GetList(const G4ReactionProduct &thePrimary,
74 G4FTFParameters *theParameters)
75{
76
77 StartLoop(); // reset Loop over Interactions
78
79 for(unsigned int i=0; i<theInteractions.size(); i++) delete theInteractions[i];
80 theInteractions.clear();
81
82 G4double deltaxy=2 * fermi; // Extra nuclear radius
83
84 G4VSplitableHadron * primarySplitable=new G4DiffractiveSplitableHadron(thePrimary);
85
86 G4double xyradius;
87 xyradius =theNucleus->GetOuterRadius() + deltaxy; // Impact parameter sampling
88 // radius
89// G4bool nucleusNeedsShift = true; // Uzhi 20 July 2009
90
91 while ( theInteractions.size() == 0 )
92 {
93 std::pair<G4double, G4double> theImpactParameter;
94 theImpactParameter = theNucleus->ChooseImpactXandY(xyradius);
95 G4double impactX = theImpactParameter.first;
96 G4double impactY = theImpactParameter.second;
97
98 G4ThreeVector thePosition(impactX, impactY, -DBL_MAX);
99 primarySplitable->SetPosition(thePosition);
100
101 theNucleus->StartLoop();
102 G4Nucleon * nucleon;
103
104 while ( (nucleon=theNucleus->GetNextNucleon()) )
105 {
106 G4double impact2= sqr(impactX - nucleon->GetPosition().x()) +
107 sqr(impactY - nucleon->GetPosition().y());
108
109 if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi)
110 > G4UniformRand() )
111 {
112 primarySplitable->SetStatus(1); // It takes part in the interaction
113
114 G4VSplitableHadron * targetSplitable=0;
115 if ( ! nucleon->AreYouHit() )
116 {
117 targetSplitable= new G4DiffractiveSplitableHadron(*nucleon);
118 nucleon->Hit(targetSplitable);
119 nucleon->SetBindingEnergy(3.*nucleon->GetBindingEnergy());
120 targetSplitable->SetStatus(1); // It takes part in the interaction
121 }
122 G4InteractionContent * aInteraction =
123 new G4InteractionContent(primarySplitable);
124 aInteraction->SetTarget(targetSplitable);
125 aInteraction->SetTargetNucleon(nucleon); // Uzhi 16.07.09
126 theInteractions.push_back(aInteraction);
127 }
128 }
129
130// G4cout << "Number of Hit nucleons " << theInteractions.size()<<G4endl; // entries()
131// << "\t" << impactX/fermi << "\t"<<impactY/fermi
132// << "\t" << std::sqrt(sqr(impactX)+sqr(impactY))/fermi <<G4endl;
133
134 }
135
136}
137
138
139// Implementation (private) methods
Note: See TracBrowser for help on using the repository browser.