source: trunk/source/processes/hadronic/models/parton_string/diffraction/src/G4FTFParticipants.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.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.9 2008/06/13 12:49:23 vuzhinsk Exp $
28// GEANT4 tag $Name: geant4-09-02 $
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) // Uzhi 29.03.08
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;
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 theNucleus->StartLoop();
99 G4Nucleon * nucleon;
100//G4int InterNumber=0; // Uzhi
101//while ( (nucleon=theNucleus->GetNextNucleon())&& (InterNumber < 1) ) // Uzhi
102 while ( (nucleon=theNucleus->GetNextNucleon()) ) // Uzhi
103 {
104 G4double impact2= sqr(impactX - nucleon->GetPosition().x()) +
105 sqr(impactY - nucleon->GetPosition().y());
106
107// if ( theParameters->GetInelasticProbability(impact2/fermi/fermi) // Uzhi 29.03.08
108 if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi) // Uzhi 29.03.08
109 > G4UniformRand() )
110 {
111//InterNumber++;
112 if ( nucleusNeedsShift )
113 { // on the first hit, shift nucleus
114 nucleusNeedsShift = false;
115 theNucleus->DoTranslation(G4ThreeVector(-1*impactX,-1*impactY,0.));
116 impactX=0;
117 impactY=0;
118 }
119 G4VSplitableHadron * targetSplitable;
120 if ( (targetSplitable=nucleon->GetSplitableHadron()) == NULL )
121 {
122 targetSplitable= new G4DiffractiveSplitableHadron(*nucleon);
123 nucleon->Hit(targetSplitable);
124 }
125 G4InteractionContent * aInteraction =
126 new G4InteractionContent(primarySplitable);
127 aInteraction->SetTarget(targetSplitable);
128 theInteractions.push_back(aInteraction);
129 }
130 }
131
132// G4cout << "Number of Hit nucleons " << theInteractions.size() // entries()
133// << "\t" << impactX/fermi << "\t"<<impactY/fermi
134// << "\t" << std::sqrt(sqr(impactX)+sqr(impactY))/fermi <<G4endl;
135
136 }
137
138}
139
140
141// Implementation (private) methods
Note: See TracBrowser for help on using the repository browser.