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

#include <G4VElasticCollision.hh>

+ Inheritance diagram for G4VElasticCollision:

Public Member Functions

 G4VElasticCollision ()
 
virtual ~G4VElasticCollision ()
 
G4bool operator== (const G4VElasticCollision &right) const
 
G4bool operator!= (const G4VElasticCollision &right) const
 
virtual G4KineticTrackVectorFinalState (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
- Public Member Functions inherited from G4VCollision
 G4VCollision ()
 
void establish_G4MT_TLS_G4VCollision ()
 
 G4VCollision (void *s1, void *s2, void *s3, void *s4, void *s5, void *s6, void *s7)
 
virtual ~G4VCollision ()
 
G4bool operator== (const G4VCollision &right) const
 
G4bool operator!= (const G4VCollision &right) const
 
virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual G4KineticTrackVectorFinalState (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
 
virtual G4bool IsInCharge (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
 
virtual G4String GetName () const =0
 
virtual void Print () const
 
virtual void Print (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCollision
G4int GetNumberOfPartons (const G4ParticleDefinition *aP) const
 
virtual const G4CollisionVectorGetComponents () const
 
virtual const G4VCrossSectionSourceGetCrossSectionSource () const =0
 
virtual const G4VAngularDistributionGetAngularDistribution () const =0
 
virtual const std::vector< G4String > & GetListOfColliders (G4int whichOne) const =0
 

Detailed Description

Definition at line 39 of file G4VElasticCollision.hh.

Constructor & Destructor Documentation

◆ G4VElasticCollision()

G4VElasticCollision::G4VElasticCollision ( )

Definition at line 44 of file G4VElasticCollision.cc.

45{
46}

◆ ~G4VElasticCollision()

G4VElasticCollision::~G4VElasticCollision ( )
virtual

Definition at line 49 of file G4VElasticCollision.cc.

50{ }

Member Function Documentation

◆ FinalState()

G4KineticTrackVector * G4VElasticCollision::FinalState ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
virtual

Implements G4VCollision.

Definition at line 53 of file G4VElasticCollision.cc.

55{
56 const G4VAngularDistribution* angDistribution;
57
58 angDistribution = GetAngularDistribution();
59
60
61 G4LorentzVector pCM=trk1.Get4Momentum() + trk2.Get4Momentum();
62
63 G4LorentzRotation toLabFrame(pCM.boostVector());
64 G4LorentzVector Ptmp=toLabFrame.inverse() * trk1.Get4Momentum(); //trk1 in CMS
66 toZ.rotateZ(-Ptmp.phi());
67 toZ.rotateY(-Ptmp.theta());
68 toLabFrame *= toZ.inverse();
69
70 G4double S = pCM.mag2();
71 G4double m10 = trk1.GetDefinition()->GetPDGMass();
72 G4double m20 = trk2.GetDefinition()->GetPDGMass();
73 if(S-(m10+m20)*(m10+m20) < 0) return new G4KineticTrackVector;
74
75 G4double m_1 = trk1.GetActualMass();
76 G4double m_2 = trk2.GetActualMass();
77
78 // Angles of outgoing particles
79 G4double cosTheta = angDistribution->CosTheta(S,m_1,m_2);
80
81 if ( (trk1.GetDefinition() == G4Proton::Proton() || trk1.GetDefinition() == G4Neutron::Neutron() )
82 &&(trk2.GetDefinition() == G4Proton::Proton() || trk2.GetDefinition() == G4Neutron::Neutron() ) )
83 {
84 if ( trk1.GetDefinition() == trk2.GetDefinition() )
85 {
86 if ( trk1.GetDefinition() == G4Proton::Proton() )
87 {
88// G4cout << "scatterangle pp " << cosTheta
89// << " " << typeid(*angDistribution).name() << G4endl;
90 } else {
91// G4cout << "scatterangle nn " << cosTheta
92// << " " << typeid(*angDistribution).name() << G4endl;
93 }
94 } else {
95// G4cout << "scatterangle pn " << cosTheta
96// << " " << typeid(*angDistribution).name() << G4endl;
97 }
98 } else {
99// G4cout << "scatterangle other " << cosTheta
100// << " " << typeid(*angDistribution).name() << G4endl;
101 }
102
103 G4double phi = angDistribution->Phi();
104 G4double Theta = std::acos(cosTheta);
105
106 // Unit vector of three-momentum
107 G4ThreeVector pFinal1(std::sin(Theta)*std::cos(phi), std::sin(Theta)*std::sin(phi), cosTheta);
108 // Three momentum in cm system
109 G4double pInCM = std::sqrt((S-(m10+m20)*(m10+m20))*(S-(m10-m20)*(m10-m20))/(4.*S));
110 pFinal1 = pFinal1 * pInCM;
111 G4ThreeVector pFinal2 = -pFinal1;
112
113 G4double eFinal1 = std::sqrt(pFinal1.mag2() + m10*m10);
114 G4double eFinal2 = std::sqrt(pFinal2.mag2() + m20*m20);
115
116 G4LorentzVector p4Final1(pFinal1, eFinal1);
117 G4LorentzVector p4Final2(pFinal2, eFinal2);
118
119 // Lorentz transformation
120 p4Final1 *= toLabFrame;
121 p4Final2 *= toLabFrame;
122
123 // Final tracks are copies of incoming ones, with modified 4-momenta
124 G4KineticTrack* final1 = new G4KineticTrack(trk1);
125 final1->Set4Momentum(p4Final1);
126 G4KineticTrack* final2 = new G4KineticTrack(trk2);
127 final2->Set4Momentum(p4Final2);
128
130 finalTracks->push_back(final1);
131 finalTracks->push_back(final2);
132
133 return finalTracks;
134}
G4double S(G4double temp)
double G4double
Definition: G4Types.hh:83
double mag2() const
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
double theta() const
Hep3Vector boostVector() const
void Set4Momentum(const G4LorentzVector &a4Momentum)
const G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & Get4Momentum() const
G4double GetActualMass() const
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
static G4Proton * Proton()
Definition: G4Proton.cc:92
virtual G4double Phi() const
virtual G4double CosTheta(G4double s, G4double m1, G4double m2) const =0
virtual const G4VAngularDistribution * GetAngularDistribution() const =0

◆ operator!=()

G4bool G4VElasticCollision::operator!= ( const G4VElasticCollision right) const

◆ operator==()

G4bool G4VElasticCollision::operator== ( const G4VElasticCollision right) const

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