Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FTFParticipants Class Reference

#include <G4FTFParticipants.hh>

+ Inheritance diagram for G4FTFParticipants:

Public Member Functions

 G4FTFParticipants ()
 
const G4FTFParticipantsoperator= (const G4FTFParticipants &right)
 
 ~G4FTFParticipants ()
 
int operator== (const G4FTFParticipants &right) const
 
int operator!= (const G4FTFParticipants &right) const
 
void InitProjectileNucleus (G4int theZ, G4int theA)
 
void SetProjectileNucleus (G4V3DNucleus *aNucleus)
 
G4V3DNucleusGetProjectileNucleus ()
 
void GetList (const G4ReactionProduct &thePrimary, G4FTFParameters *theParameters)
 
void StartLoop ()
 
G4bool Next ()
 
G4InteractionContentGetInteraction ()
 
- Public Member Functions inherited from G4VParticipants
 G4VParticipants ()
 
 G4VParticipants (const G4VParticipants &right)
 
virtual ~G4VParticipants ()
 
const G4VParticipantsoperator= (const G4VParticipants &right)
 
int operator== (const G4VParticipants &right) const
 
int operator!= (const G4VParticipants &right) const
 
virtual void Init (G4int theZ, G4int theA)
 
virtual void SetNucleus (G4V3DNucleus *aNucleus)
 
virtual G4V3DNucleusGetWoundedNucleus () const
 

Public Attributes

std::vector< G4InteractionContent * > theInteractions
 
G4V3DNucleustheProjectileNucleus
 
- Public Attributes inherited from G4VParticipants
G4V3DNucleustheNucleus
 

Detailed Description

Definition at line 50 of file G4FTFParticipants.hh.

Constructor & Destructor Documentation

◆ G4FTFParticipants()

G4FTFParticipants::G4FTFParticipants ( )

Definition at line 54 of file G4FTFParticipants.cc.

54 :
56 currentInteraction(-1)
57{
58}
G4V3DNucleus * theProjectileNucleus

◆ ~G4FTFParticipants()

G4FTFParticipants::~G4FTFParticipants ( )

Definition at line 68 of file G4FTFParticipants.cc.

69{
70 if ( theProjectileNucleus != NULL ) delete theProjectileNucleus;
71}

Member Function Documentation

◆ GetInteraction()

G4InteractionContent & G4FTFParticipants::GetInteraction ( )
inline

Definition at line 103 of file G4FTFParticipants.hh.

104{
105 return *theInteractions[currentInteraction];
106}
std::vector< G4InteractionContent * > theInteractions

Referenced by G4FTFModel::GetStrings().

◆ GetList()

void G4FTFParticipants::GetList ( const G4ReactionProduct thePrimary,
G4FTFParameters theParameters 
)

Definition at line 94 of file G4FTFParticipants.cc.

96{
97//G4cout<<"Participants::GetList"<<G4endl;
98//G4cout<<"thePrimary "<<thePrimary.GetMomentum()<<G4endl;
99 StartLoop(); // reset Loop over Interactions
100
101 for(unsigned int i=0; i<theInteractions.size(); i++) delete theInteractions[i];
102 theInteractions.clear();
103
104 G4double deltaxy=2 * fermi; // Extra nuclear radius
105//G4cout<<"theProjectileNucleus "<<theProjectileNucleus<<G4endl;
106 if(theProjectileNucleus == 0)
107 { // Hadron-nucleus or anti-baryon-nucleus interactions
108//G4cout<<"Hadron-nucleus or anti-baryon-nucleus interactions"<<G4endl;
109
110 G4double impactX(0.), impactY(0.);
111
112 G4VSplitableHadron * primarySplitable=new G4DiffractiveSplitableHadron(thePrimary);
113//G4cout<<"Prim in Part "<<primarySplitable->Get4Momentum()<<G4endl;
114 G4double xyradius;
115 xyradius =theNucleus->GetOuterRadius() + deltaxy; // Impact parameter sampling
116
117// G4bool nucleusNeedsShift = true; // Uzhi 20 July 2009
118
119 do
120 {
121 std::pair<G4double, G4double> theImpactParameter;
122 theImpactParameter = theNucleus->ChooseImpactXandY(xyradius);
123 impactX = theImpactParameter.first;
124 impactY = theImpactParameter.second;
125
126 G4ThreeVector thePosition(impactX, impactY, -DBL_MAX);
127 primarySplitable->SetPosition(thePosition);
128
130 G4Nucleon * nucleon;
131
132G4int TrN(0);
133 while ( (nucleon=theNucleus->GetNextNucleon()) )
134 {
135 G4double impact2= sqr(impactX - nucleon->GetPosition().x()) +
136 sqr(impactY - nucleon->GetPosition().y());
137
138 if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi)
139 > G4UniformRand() )
140 {
141 primarySplitable->SetStatus(1); // It takes part in the interaction
142
143 G4VSplitableHadron * targetSplitable=0;
144 if ( ! nucleon->AreYouHit() )
145 {
146 targetSplitable= new G4DiffractiveSplitableHadron(*nucleon);
147 nucleon->Hit(targetSplitable);
148 nucleon->SetBindingEnergy(3.*nucleon->GetBindingEnergy());
149//G4cout<<" Part nucl "<<TrN<<" "<<nucleon->Get4Momentum()<<G4endl;
150//G4cout<<" Part nucl "<<G4endl;
151 targetSplitable->SetStatus(1); // It takes part in the interaction
152 }
153 G4InteractionContent * aInteraction =
154 new G4InteractionContent(primarySplitable);
155 aInteraction->SetTarget(targetSplitable);
156 aInteraction->SetTargetNucleon(nucleon); // Uzhi 16.07.09
157 aInteraction->SetStatus(1); // Uzhi Feb26
158 theInteractions.push_back(aInteraction);
159 }
160TrN++;
161 }
162 } while ( theInteractions.size() == 0 );
163
164 //if ( theInteractions.size() == 0 ) delete primarySplitable; //A.R. 14-Aug-2012 Coverity fix
165
166// G4cout << "Number of Hit nucleons " << theInteractions.size()
167// << "\t" << impactX/fermi << "\t"<<impactY/fermi
168// << "\t" << std::sqrt(sqr(impactX)+sqr(impactY))/fermi <<G4endl;
169
170 return;
171 } // end of if(theProjectileNucleus == 0)
172
173//-------------------------------------------------------------------
174// Projectile and target are nuclei
175//-------------------------------------------------------------------
176//VU G4VSplitableHadron * primarySplitable=new G4DiffractiveSplitableHadron(thePrimary);
177//G4cout<<"Prim in Part "<<primarySplitable->Get4Momentum()<<G4endl;
178//G4cout<<"Projectile and target are nuclei"<<G4endl;
179//G4cout<<thePrimary.GetMomentum()<<G4endl;
180//G4cout<<"Part Pr Tr "<<theProjectileNucleus<<" "<<theNucleus<<G4endl;
181
182
183 G4double xyradius;
184 xyradius =theProjectileNucleus->GetOuterRadius() + // Impact parameter sampling
185 theNucleus->GetOuterRadius() + deltaxy;
186
187 G4double impactX(0.), impactY(0.);
188
189 do
190 {
191//G4cout<<"New interaction list"<<G4endl;
192 std::pair<G4double, G4double> theImpactParameter;
193 theImpactParameter = theNucleus->ChooseImpactXandY(xyradius);
194 impactX = theImpactParameter.first;
195 impactY = theImpactParameter.second;
196//G4cout<<"B "<<std::sqrt(sqr(impactX)+sqr(impactY))/fermi<<G4endl;
197
198 G4ThreeVector thePosition(impactX, impactY, -DBL_MAX);
199//VU primarySplitable->SetPosition(thePosition);
200
202 G4Nucleon * ProjectileNucleon;
203G4int PrNuclN(0);
204
205 while ( (ProjectileNucleon=theProjectileNucleus->GetNextNucleon()) )
206 {
207 G4VSplitableHadron * ProjectileSplitable=0;
208//G4cout<<G4endl<<"Prj N mom "<<ProjectileNucleon->Get4Momentum()<<"-------------"<<G4endl;
210 G4Nucleon * TargetNucleon;
211
212G4int TrNuclN(0);
213 while ( (TargetNucleon=theNucleus->GetNextNucleon()) )
214 {
215//G4cout<<"Trg N mom "<<TargetNucleon->Get4Momentum()<<G4endl;
216 G4double impact2=
217 sqr(impactX+ProjectileNucleon->GetPosition().x()-TargetNucleon->GetPosition().x())+
218 sqr(impactY+ProjectileNucleon->GetPosition().y()-TargetNucleon->GetPosition().y());
219
220 G4VSplitableHadron * TargetSplitable=0;
221
222 if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi)
223 > G4UniformRand() )
224 { // An Interaction has happend!
225//G4cout<<"An Interaction has happend"<<G4endl;
226//G4cout<<"PrN TrN "<<PrNuclN<<" "<<TrNuclN<<" "<<ProjectileNucleon->GetPosition().z()/fermi<<" "<<TargetNucleon->GetPosition().z()/fermi<<" "<<ProjectileNucleon->GetPosition().z()/fermi + TargetNucleon->GetPosition().z()/fermi <<G4endl;
227
228 if ( ! ProjectileNucleon->AreYouHit() )
229 { // Projectile nucleon was not involved until now.
230 ProjectileSplitable= new G4DiffractiveSplitableHadron(*ProjectileNucleon);
231 ProjectileNucleon->Hit(ProjectileSplitable);
232 ProjectileNucleon->SetBindingEnergy(3.*ProjectileNucleon->GetBindingEnergy());
233 ProjectileSplitable->SetStatus(1); // It takes part in the interaction
234 }
235 else
236 { // Projectile nucleon was involved before.
237 ProjectileSplitable=ProjectileNucleon->GetSplitableHadron();
238 } // End of if ( ! Projectileucleon->AreYouHit() )
239
240 if ( ! TargetNucleon->AreYouHit() )
241 { // Target nucleon was not involved until now
242 TargetSplitable= new G4DiffractiveSplitableHadron(*TargetNucleon);
243 TargetNucleon->Hit(TargetSplitable);
244 TargetNucleon->SetBindingEnergy(3.*ProjectileNucleon->GetBindingEnergy());
245 TargetSplitable->SetStatus(1); // It takes part in the interaction
246 }
247 else
248 { // Target nucleon was involved before.
249 TargetSplitable=TargetNucleon->GetSplitableHadron();
250 } // End of if ( ! TargetNeucleon->AreYouHit() )
251
252 G4InteractionContent * anInteraction =
253 new G4InteractionContent(ProjectileSplitable);
254 anInteraction->SetTarget(TargetSplitable);
255 anInteraction->SetTargetNucleon(TargetNucleon);
256 anInteraction->SetStatus(1); // Uzhi Feb26
257// anInteraction->SetInteractionTime(ProjectileNucleon->GetPosition().z()+
258// TargetNucleon->GetPosition().z());
259//G4cout<<"Z's pr tr "<<ProjectileNucleon->GetPosition().z()/fermi<<" "<<TargetNucleon->GetPosition().z()/fermi<<" "<<ProjectileNucleon->GetPosition().z()/fermi + TargetNucleon->GetPosition().z()/fermi <<G4endl;
260 theInteractions.push_back(anInteraction);
261//G4cout<<"Ppr tr "<<ProjectileSplitable<<" "<<TargetSplitable<<G4endl;
262 } // End of An Interaction has happend!
263TrNuclN++;
264 } // End of while ( (TargetNucleon=theNucleus->GetNextNucleon()) )
265PrNuclN++;
266 } // End of while ( (ProjectileNucleon=theProjectileNucleus->GetNextNucleon()) )
267 } while ( theInteractions.size() == 0 ); // end of while ( theInteractions.size() == 0 )
268
269//std::sort(theInteractions.begin(),theInteractions.end()); // ????
270
271// G4cout << "Number of primary collisions " << theInteractions.size()
272// << "\t" << impactX/fermi << "\t"<<impactY/fermi
273// << "\t" << std::sqrt(sqr(impactX)+sqr(impactY))/fermi <<G4endl;
274//G4int Uzhi; G4cin >> Uzhi;
275 return;
276}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4UniformRand()
Definition: Randomize.hh:53
double x() const
double y() const
G4double GetProbabilityOfInteraction(const G4double impactsquare)
void SetTargetNucleon(G4Nucleon *aNucleon)
void SetTarget(G4VSplitableHadron *aTarget)
void SetStatus(G4int aValue)
G4bool AreYouHit() const
Definition: G4Nucleon.hh:97
G4VSplitableHadron * GetSplitableHadron() const
Definition: G4Nucleon.hh:96
void Hit(G4VSplitableHadron *aHit)
Definition: G4Nucleon.hh:90
virtual const G4ThreeVector & GetPosition() const
Definition: G4Nucleon.hh:68
G4double GetBindingEnergy() const
Definition: G4Nucleon.hh:75
void SetBindingEnergy(G4double anEnergy)
Definition: G4Nucleon.hh:74
virtual G4double GetOuterRadius()=0
virtual G4Nucleon * GetNextNucleon()=0
virtual G4bool StartLoop()=0
std::pair< G4double, G4double > ChooseImpactXandY(G4double maxImpact)
Definition: G4V3DNucleus.hh:87
G4V3DNucleus * theNucleus
void SetStatus(const G4int aStatus)
void SetPosition(const G4ThreeVector &aPosition)
T sqr(const T &x)
Definition: templates.hh:145
#define DBL_MAX
Definition: templates.hh:83

Referenced by G4FTFModel::GetStrings().

◆ GetProjectileNucleus()

G4V3DNucleus * G4FTFParticipants::GetProjectileNucleus ( )

Definition at line 82 of file G4FTFParticipants.cc.

83{
85}

◆ InitProjectileNucleus()

void G4FTFParticipants::InitProjectileNucleus ( G4int  theZ,
G4int  theA 
)

Definition at line 87 of file G4FTFParticipants.cc.

88{
90 theProjectileNucleus->Init(theA, theZ);
92}
virtual void Init(G4int theA, G4int theZ)=0
virtual void SortNucleonsDecZ()=0

Referenced by G4FTFModel::Init().

◆ Next()

G4bool G4FTFParticipants::Next ( )
inline

Definition at line 94 of file G4FTFParticipants.hh.

95{
96 return ++currentInteraction < static_cast<G4int>(theInteractions.size());
97}

Referenced by G4FTFModel::GetStrings().

◆ operator!=()

int G4FTFParticipants::operator!= ( const G4FTFParticipants right) const

◆ operator=()

const G4FTFParticipants & G4FTFParticipants::operator= ( const G4FTFParticipants right)

◆ operator==()

int G4FTFParticipants::operator== ( const G4FTFParticipants right) const

◆ SetProjectileNucleus()

void G4FTFParticipants::SetProjectileNucleus ( G4V3DNucleus aNucleus)

Definition at line 75 of file G4FTFParticipants.cc.

76{
78
79 theProjectileNucleus = aNucleus;
80}

Referenced by G4FTFModel::Init().

◆ StartLoop()

void G4FTFParticipants::StartLoop ( )
inline

Definition at line 88 of file G4FTFParticipants.hh.

89{
90 currentInteraction=-1;
91}

Referenced by GetList(), and G4FTFModel::GetStrings().

Member Data Documentation

◆ theInteractions

std::vector<G4InteractionContent *> G4FTFParticipants::theInteractions

Definition at line 73 of file G4FTFParticipants.hh.

Referenced by GetInteraction(), GetList(), and Next().

◆ theProjectileNucleus

G4V3DNucleus* G4FTFParticipants::theProjectileNucleus

The documentation for this class was generated from the following files: