00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include <utility>
00043 #include <vector>
00044 #include <algorithm>
00045
00046 #include "G4FTFParticipants.hh"
00047 #include "G4ios.hh"
00048 #include "Randomize.hh"
00049 #include "G4SystemOfUnits.hh"
00050 #include "G4FTFParameters.hh"
00051 #include "G4DiffractiveSplitableHadron.hh"
00052 #include "G4VSplitableHadron.hh"
00053
00054 G4FTFParticipants::G4FTFParticipants() :
00055 theProjectileNucleus(0),
00056 currentInteraction(-1)
00057 {
00058 }
00059
00060 G4FTFParticipants::G4FTFParticipants(const G4FTFParticipants &): G4VParticipants()
00061 , theProjectileNucleus(0), currentInteraction(-1)
00062 {
00063 G4Exception("G4FTFParticipants::G4FTFParticipants()","HAD_FTF_001",
00064 FatalException," Must not use copy ctor()");
00065 }
00066
00067
00068 G4FTFParticipants::~G4FTFParticipants()
00069 {
00070 if ( theProjectileNucleus != NULL ) delete theProjectileNucleus;
00071 }
00072
00073
00074
00075 void G4FTFParticipants::SetProjectileNucleus(G4V3DNucleus * aNucleus)
00076 {
00077 if (theProjectileNucleus) delete theProjectileNucleus;
00078
00079 theProjectileNucleus = aNucleus;
00080 }
00081
00082 G4V3DNucleus * G4FTFParticipants::GetProjectileNucleus()
00083 {
00084 return theProjectileNucleus;
00085 }
00086
00087 void G4FTFParticipants::InitProjectileNucleus(G4int theA, G4int theZ)
00088 {
00089 if ( theProjectileNucleus == NULL ) theProjectileNucleus = new G4Fancy3DNucleus();
00090 theProjectileNucleus->Init(theA, theZ);
00091 theProjectileNucleus->SortNucleonsDecZ();
00092 }
00093
00094 void G4FTFParticipants::GetList(const G4ReactionProduct &thePrimary,
00095 G4FTFParameters *theParameters)
00096 {
00097
00098
00099 StartLoop();
00100
00101 for(unsigned int i=0; i<theInteractions.size(); i++) delete theInteractions[i];
00102 theInteractions.clear();
00103
00104 G4double deltaxy=2 * fermi;
00105
00106 if(theProjectileNucleus == 0)
00107 {
00108
00109
00110 G4double impactX(0.), impactY(0.);
00111
00112 G4VSplitableHadron * primarySplitable=new G4DiffractiveSplitableHadron(thePrimary);
00113
00114 G4double xyradius;
00115 xyradius =theNucleus->GetOuterRadius() + deltaxy;
00116
00117
00118
00119 do
00120 {
00121 std::pair<G4double, G4double> theImpactParameter;
00122 theImpactParameter = theNucleus->ChooseImpactXandY(xyradius);
00123 impactX = theImpactParameter.first;
00124 impactY = theImpactParameter.second;
00125
00126 G4ThreeVector thePosition(impactX, impactY, -DBL_MAX);
00127 primarySplitable->SetPosition(thePosition);
00128
00129 theNucleus->StartLoop();
00130 G4Nucleon * nucleon;
00131
00132 G4int TrN(0);
00133 while ( (nucleon=theNucleus->GetNextNucleon()) )
00134 {
00135 G4double impact2= sqr(impactX - nucleon->GetPosition().x()) +
00136 sqr(impactY - nucleon->GetPosition().y());
00137
00138 if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi)
00139 > G4UniformRand() )
00140 {
00141 primarySplitable->SetStatus(1);
00142
00143 G4VSplitableHadron * targetSplitable=0;
00144 if ( ! nucleon->AreYouHit() )
00145 {
00146 targetSplitable= new G4DiffractiveSplitableHadron(*nucleon);
00147 nucleon->Hit(targetSplitable);
00148 nucleon->SetBindingEnergy(3.*nucleon->GetBindingEnergy());
00149
00150
00151 targetSplitable->SetStatus(1);
00152 }
00153 G4InteractionContent * aInteraction =
00154 new G4InteractionContent(primarySplitable);
00155 aInteraction->SetTarget(targetSplitable);
00156 aInteraction->SetTargetNucleon(nucleon);
00157 aInteraction->SetStatus(1);
00158 theInteractions.push_back(aInteraction);
00159 }
00160 TrN++;
00161 }
00162 } while ( theInteractions.size() == 0 );
00163
00164
00165
00166
00167
00168
00169
00170 return;
00171 }
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183 G4double xyradius;
00184 xyradius =theProjectileNucleus->GetOuterRadius() +
00185 theNucleus->GetOuterRadius() + deltaxy;
00186
00187 G4double impactX(0.), impactY(0.);
00188
00189 do
00190 {
00191
00192 std::pair<G4double, G4double> theImpactParameter;
00193 theImpactParameter = theNucleus->ChooseImpactXandY(xyradius);
00194 impactX = theImpactParameter.first;
00195 impactY = theImpactParameter.second;
00196
00197
00198 G4ThreeVector thePosition(impactX, impactY, -DBL_MAX);
00199
00200
00201 theProjectileNucleus->StartLoop();
00202 G4Nucleon * ProjectileNucleon;
00203 G4int PrNuclN(0);
00204
00205 while ( (ProjectileNucleon=theProjectileNucleus->GetNextNucleon()) )
00206 {
00207 G4VSplitableHadron * ProjectileSplitable=0;
00208
00209 theNucleus->StartLoop();
00210 G4Nucleon * TargetNucleon;
00211
00212 G4int TrNuclN(0);
00213 while ( (TargetNucleon=theNucleus->GetNextNucleon()) )
00214 {
00215
00216 G4double impact2=
00217 sqr(impactX+ProjectileNucleon->GetPosition().x()-TargetNucleon->GetPosition().x())+
00218 sqr(impactY+ProjectileNucleon->GetPosition().y()-TargetNucleon->GetPosition().y());
00219
00220 G4VSplitableHadron * TargetSplitable=0;
00221
00222 if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi)
00223 > G4UniformRand() )
00224 {
00225
00226
00227
00228 if ( ! ProjectileNucleon->AreYouHit() )
00229 {
00230 ProjectileSplitable= new G4DiffractiveSplitableHadron(*ProjectileNucleon);
00231 ProjectileNucleon->Hit(ProjectileSplitable);
00232 ProjectileNucleon->SetBindingEnergy(3.*ProjectileNucleon->GetBindingEnergy());
00233 ProjectileSplitable->SetStatus(1);
00234 }
00235 else
00236 {
00237 ProjectileSplitable=ProjectileNucleon->GetSplitableHadron();
00238 }
00239
00240 if ( ! TargetNucleon->AreYouHit() )
00241 {
00242 TargetSplitable= new G4DiffractiveSplitableHadron(*TargetNucleon);
00243 TargetNucleon->Hit(TargetSplitable);
00244 TargetNucleon->SetBindingEnergy(3.*ProjectileNucleon->GetBindingEnergy());
00245 TargetSplitable->SetStatus(1);
00246 }
00247 else
00248 {
00249 TargetSplitable=TargetNucleon->GetSplitableHadron();
00250 }
00251
00252 G4InteractionContent * anInteraction =
00253 new G4InteractionContent(ProjectileSplitable);
00254 anInteraction->SetTarget(TargetSplitable);
00255 anInteraction->SetTargetNucleon(TargetNucleon);
00256 anInteraction->SetStatus(1);
00257
00258
00259
00260 theInteractions.push_back(anInteraction);
00261
00262 }
00263 TrNuclN++;
00264 }
00265 PrNuclN++;
00266 }
00267 } while ( theInteractions.size() == 0 );
00268
00269
00270
00271
00272
00273
00274
00275 return;
00276 }
00277
00278
00279