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

#include <G4VScatteringCollision.hh>

+ Inheritance diagram for G4VScatteringCollision:

Public Member Functions

 G4VScatteringCollision ()
 
void establish_G4MT_TLS_G4VScatteringCollision ()
 
virtual ~G4VScatteringCollision ()
 
G4bool operator== (const G4VScatteringCollision &right) const
 
G4bool operator!= (const G4VScatteringCollision &right) const
 
virtual G4KineticTrackVectorFinalState (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual const G4VAngularDistributionGetAngularDistribution () 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
 

Protected Member Functions

virtual const std::vector< const G4ParticleDefinition * > & GetOutgoingParticles () const =0
 
- 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 55 of file G4VScatteringCollision.hh.

Constructor & Destructor Documentation

◆ G4VScatteringCollision()

G4VScatteringCollision::G4VScatteringCollision ( )

Definition at line 47 of file G4VScatteringCollision.cc.

48{
49 theAngularDistribution = new G4AngularDistribution(true);
50}

◆ ~G4VScatteringCollision()

G4VScatteringCollision::~G4VScatteringCollision ( )
virtual

Definition at line 53 of file G4VScatteringCollision.cc.

54{
55 delete theAngularDistribution;
56 theAngularDistribution=0;
57}

Member Function Documentation

◆ establish_G4MT_TLS_G4VScatteringCollision()

void G4VScatteringCollision::establish_G4MT_TLS_G4VScatteringCollision ( )

Definition at line 180 of file G4VScatteringCollision.cc.

181{
183 if ( theAngularDistribution ) delete theAngularDistribution;
184 theAngularDistribution = new G4AngularDistribution(true);
185}
void establish_G4MT_TLS_G4VCollision()

Referenced by G4ConcreteNNTwoBodyResonance::establish_G4MT_TLS_G4ConcreteNNTwoBodyResonance().

◆ FinalState()

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

Implements G4VCollision.

Definition at line 60 of file G4VScatteringCollision.cc.

62{
63 const G4VAngularDistribution* angDistribution = GetAngularDistribution();
64 G4LorentzVector p = trk1.Get4Momentum() + trk2.Get4Momentum();
65 G4double sqrtS = p.m();
66 G4double S = sqrtS * sqrtS;
67
68 std::vector<const G4ParticleDefinition*> OutputDefinitions = GetOutgoingParticles();
69 if (OutputDefinitions.size() != 2)
70 throw G4HadronicException(__FILE__, __LINE__, "G4VScatteringCollision: Too many output particles!");
71
72 if (OutputDefinitions[0]->IsShortLived() && OutputDefinitions[1]->IsShortLived())
73 {
74 if(std::getenv("G4KCDEBUG")) G4cerr << "two shortlived for Type = "<<typeid(*this).name()<<G4endl;
75 // throw G4HadronicException(__FILE__, __LINE__, "G4VScatteringCollision: can't handle two shortlived particles!"); // @hpw@
76 }
77
78 G4double outm1 = OutputDefinitions[0]->GetPDGMass();
79 G4double outm2 = OutputDefinitions[1]->GetPDGMass();
80
81 if (OutputDefinitions[0]->IsShortLived())
82 {
83 outm1 = SampleResonanceMass(outm1,
84 OutputDefinitions[0]->GetPDGWidth(),
85 G4Neutron::NeutronDefinition()->GetPDGMass()+G4PionPlus::PionPlus()->GetPDGMass(),
86 sqrtS-(G4Neutron::NeutronDefinition()->GetPDGMass()+G4PionPlus::PionPlus()->GetPDGMass()));
87
88 }
89 if (OutputDefinitions[1]->IsShortLived())
90 {
91 outm2 = SampleResonanceMass(outm2, OutputDefinitions[1]->GetPDGWidth(),
92 G4Neutron::NeutronDefinition()->GetPDGMass()+G4PionPlus::PionPlus()->GetPDGMass(),
93 sqrtS-outm1);
94 }
95
96 // Angles of outgoing particles
97 G4double cosTheta = angDistribution->CosTheta(S, trk1.GetActualMass(), trk2.GetActualMass());
98 G4double phi = angDistribution->Phi();
99
100 // Unit vector of three-momentum
101 G4LorentzRotation fromCMSFrame(p.boostVector());
102 G4LorentzRotation toCMSFrame(fromCMSFrame.inverse());
103 G4LorentzVector TempPtr = toCMSFrame*trk1.Get4Momentum();
105 toZ.rotateZ(-1*TempPtr.phi());
106 toZ.rotateY(-1*TempPtr.theta());
107 G4LorentzRotation toCMS(toZ.inverse());
108
109 G4ThreeVector pFinal1(std::sin(std::acos(cosTheta))*std::cos(phi), std::sin(std::acos(cosTheta))*std::sin(phi), cosTheta);
110
111 // Three momentum in cm system
112 G4double pCM = std::sqrt( (S-(outm1+outm2)*(outm1+outm2)) * (S-(outm1-outm2)*(outm1-outm2)) /(4.*S));
113 pFinal1 = pFinal1 * pCM;
114 G4ThreeVector pFinal2 = -pFinal1;
115
116 G4double eFinal1 = std::sqrt(pFinal1.mag2() + outm1*outm1);
117 G4double eFinal2 = std::sqrt(pFinal2.mag2() + outm2*outm2);
118
119 G4LorentzVector p4Final1(pFinal1, eFinal1);
120 G4LorentzVector p4Final2(pFinal2, eFinal2);
121 p4Final1 = toCMS*p4Final1;
122 p4Final2 = toCMS*p4Final2;
123
124
125 // Lorentz transformation
126 G4LorentzRotation toLabFrame(p.boostVector());
127 p4Final1 *= toLabFrame;
128 p4Final2 *= toLabFrame;
129
130 // Final tracks are copies of incoming ones, with modified 4-momenta
131
132 G4double chargeBalance = OutputDefinitions[0]->GetPDGCharge()+OutputDefinitions[1]->GetPDGCharge();
133 chargeBalance-= trk1.GetDefinition()->GetPDGCharge();
134 chargeBalance-= trk2.GetDefinition()->GetPDGCharge();
135 if(std::abs(chargeBalance) >.1)
136 {
137 G4cout << "Charges in "<<typeid(*this).name()<<G4endl;
138 G4cout << OutputDefinitions[0]->GetPDGCharge()<<" "<<OutputDefinitions[0]->GetParticleName()
139 << OutputDefinitions[1]->GetPDGCharge()<<" "<<OutputDefinitions[1]->GetParticleName()
140 << trk1.GetDefinition()->GetPDGCharge()<<" "<<trk1.GetDefinition()->GetParticleName()
141 << trk2.GetDefinition()->GetPDGCharge()<<" "<<trk2.GetDefinition()->GetParticleName()<<G4endl;
142 }
143 G4KineticTrack* final1 = new G4KineticTrack(OutputDefinitions[0], 0.0, trk1.GetPosition(), p4Final1);
144 G4KineticTrack* final2 = new G4KineticTrack(OutputDefinitions[1], 0.0, trk2.GetPosition(), p4Final2);
145
147
148 finalTracks->push_back(final1);
149 finalTracks->push_back(final2);
150
151 return finalTracks;
152}
G4double S(G4double temp)
double G4double
Definition: G4Types.hh:83
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
double mag2() const
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
double theta() const
Hep3Vector boostVector() const
const G4ThreeVector & GetPosition() const
const G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & Get4Momentum() const
G4double GetActualMass() const
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:98
G4double GetPDGCharge() const
const G4String & GetParticleName() const
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:97
virtual G4double Phi() const
virtual G4double CosTheta(G4double s, G4double m1, G4double m2) const =0
virtual const G4VAngularDistribution * GetAngularDistribution() const
virtual const std::vector< const G4ParticleDefinition * > & GetOutgoingParticles() const =0

◆ GetAngularDistribution()

virtual const G4VAngularDistribution * G4VScatteringCollision::GetAngularDistribution ( ) const
inlinevirtual

Implements G4VCollision.

Definition at line 69 of file G4VScatteringCollision.hh.

70 {
71 return theAngularDistribution;
72 }

Referenced by FinalState().

◆ GetOutgoingParticles()

virtual const std::vector< const G4ParticleDefinition * > & G4VScatteringCollision::GetOutgoingParticles ( ) const
protectedpure virtual

Implemented in G4ConcreteNNTwoBodyResonance.

Referenced by FinalState().

◆ operator!=()

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

◆ operator==()

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

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