Geant4-11
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
G4VScatteringCollision Class Referenceabstract

#include <G4VScatteringCollision.hh>

Inheritance diagram for G4VScatteringCollision:
G4VCollision G4ConcreteNNTwoBodyResonance G4ConcreteNNToDeltaDelta G4ConcreteNNToDeltaDeltastar G4ConcreteNNToDeltaNstar G4ConcreteNNToNDelta G4ConcreteNNToNDeltaStar G4ConcreteNNToNNStar G4ConcreteNStarNToNN

Public Member Functions

virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
void establish_G4MT_TLS_G4VCollision ()
 
void establish_G4MT_TLS_G4VScatteringCollision ()
 
virtual G4KineticTrackVectorFinalState (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
 G4VScatteringCollision ()
 
virtual const G4VAngularDistributionGetAngularDistribution () const
 
virtual G4String GetName () const =0
 
virtual G4bool IsInCharge (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
 
G4bool operator!= (const G4VCollision &right) const
 
G4bool operator!= (const G4VScatteringCollision &right) const
 
G4bool operator== (const G4VCollision &right) const
 
G4bool operator== (const G4VScatteringCollision &right) const
 
virtual void Print () const
 
virtual void Print (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual ~G4VScatteringCollision ()
 

Protected Member Functions

virtual const G4CollisionVectorGetComponents () const
 
virtual const G4VCrossSectionSourceGetCrossSectionSource () const =0
 
virtual const std::vector< G4String > & GetListOfColliders (G4int whichOne) const =0
 
G4int GetNumberOfPartons (const G4ParticleDefinition *aP) const
 
virtual const std::vector< const G4ParticleDefinition * > & GetOutgoingParticles () const =0
 

Private Member Functions

double BrWigInt0 (const double x, const double gamma, const double m0) const
 
G4double BrWigInt1 (const G4double x, const G4double gamma, const G4double m0) const
 
double BrWigInv (const double x, const double gamma, const double m0) const
 
 G4VScatteringCollision (const G4VScatteringCollision &)
 
G4VScatteringCollisionoperator= (const G4VScatteringCollision &)
 
double SampleResonanceMass (const double poleMass, const double width, const double minMass, const double maxMass) const
 

Private Attributes

G4VAngularDistributiontheAngularDistribution
 

Detailed Description

Definition at line 55 of file G4VScatteringCollision.hh.

Constructor & Destructor Documentation

◆ G4VScatteringCollision() [1/2]

G4VScatteringCollision::G4VScatteringCollision ( )

Definition at line 47 of file G4VScatteringCollision.cc.

References theAngularDistribution.

◆ ~G4VScatteringCollision()

G4VScatteringCollision::~G4VScatteringCollision ( )
virtual

Definition at line 53 of file G4VScatteringCollision.cc.

References theAngularDistribution.

◆ G4VScatteringCollision() [2/2]

G4VScatteringCollision::G4VScatteringCollision ( const G4VScatteringCollision )
private

Member Function Documentation

◆ BrWigInt0()

double G4VScatteringCollision::BrWigInt0 ( const double  x,
const double  gamma,
const double  m0 
) const
inlineprivate

Definition at line 84 of file G4VScatteringCollision.hh.

85 { return 2.0*gamma*std::atan( 2.0 * (x-m0)/ gamma ); }

Referenced by BrWigInt1(), and SampleResonanceMass().

◆ BrWigInt1()

G4double G4VScatteringCollision::BrWigInt1 ( const G4double  x,
const G4double  gamma,
const G4double  m0 
) const
inlineprivate

Definition at line 87 of file G4VScatteringCollision.hh.

88 { return 0.5*gamma*gamma*G4Log( (x-m0)*(x-m0)+gamma*gamma/4.0 ) + m0*BrWigInt0(x,gamma,m0); }
G4double G4Log(G4double x)
Definition: G4Log.hh:226
double BrWigInt0(const double x, const double gamma, const double m0) const

References BrWigInt0(), and G4Log().

◆ BrWigInv()

double G4VScatteringCollision::BrWigInv ( const double  x,
const double  gamma,
const double  m0 
) const
inlineprivate

Definition at line 90 of file G4VScatteringCollision.hh.

91 { return 0.5*gamma*std::tan( 0.5*x/gamma )+m0; }

Referenced by SampleResonanceMass().

◆ CrossSection()

G4double G4VCollision::CrossSection ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
virtualinherited

Reimplemented in G4CollisionComposite, G4CollisionMesonBaryonToResonance, and G4CollisionNN.

Definition at line 54 of file G4VCollision.cc.

56{
57 G4double sigma = 0.;
58
60
61 if (xSource != 0)
62 {
63 // There is a cross section for this Collision
64 sigma = xSource->CrossSection(aTrk1,aTrk2);
65 }
66 return sigma;
67}
double G4double
Definition: G4Types.hh:83
virtual const G4VCrossSectionSource * GetCrossSectionSource() const =0
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0

References G4VCrossSectionSource::CrossSection(), and G4VCollision::GetCrossSectionSource().

Referenced by G4Scatterer::GetCrossSection(), G4Scatterer::GetTimeToInteraction(), G4VCollision::Print(), and G4Scatterer::Scatter().

◆ establish_G4MT_TLS_G4VCollision()

void G4VCollision::establish_G4MT_TLS_G4VCollision ( )
inherited

Definition at line 143 of file G4VCollision.cc.

143{ }

Referenced by establish_G4MT_TLS_G4VScatteringCollision().

◆ establish_G4MT_TLS_G4VScatteringCollision()

void G4VScatteringCollision::establish_G4MT_TLS_G4VScatteringCollision ( )

◆ 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)
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
double SampleResonanceMass(const double poleMass, const double width, const double minMass, const double maxMass) const
virtual const std::vector< const G4ParticleDefinition * > & GetOutgoingParticles() const =0

References CLHEP::HepLorentzVector::boostVector(), G4VAngularDistribution::CosTheta(), G4cerr, G4cout, G4endl, G4KineticTrack::Get4Momentum(), G4KineticTrack::GetActualMass(), GetAngularDistribution(), G4KineticTrack::GetDefinition(), GetOutgoingParticles(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGCharge(), G4KineticTrack::GetPosition(), CLHEP::HepLorentzRotation::inverse(), CLHEP::HepLorentzVector::m(), CLHEP::Hep3Vector::mag2(), G4Neutron::NeutronDefinition(), CLHEP::HepLorentzVector::phi(), G4VAngularDistribution::Phi(), G4PionPlus::PionPlus(), CLHEP::HepLorentzRotation::rotateY(), CLHEP::HepLorentzRotation::rotateZ(), S(), SampleResonanceMass(), and CLHEP::HepLorentzVector::theta().

◆ GetAngularDistribution()

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

Implements G4VCollision.

Definition at line 69 of file G4VScatteringCollision.hh.

70 {
72 }

References theAngularDistribution.

Referenced by FinalState().

◆ GetComponents()

virtual const G4CollisionVector * G4VCollision::GetComponents ( ) const
inlineprotectedvirtualinherited

◆ GetCrossSectionSource()

virtual const G4VCrossSectionSource * G4VCollision::GetCrossSectionSource ( ) const
protectedpure virtualinherited

◆ GetListOfColliders()

virtual const std::vector< G4String > & G4VCollision::GetListOfColliders ( G4int  whichOne) const
protectedpure virtualinherited

◆ GetName()

virtual G4String G4VCollision::GetName ( ) const
pure virtualinherited

◆ GetNumberOfPartons()

G4int G4VCollision::GetNumberOfPartons ( const G4ParticleDefinition aP) const
inlineprotectedinherited

Definition at line 68 of file G4VCollision.hh.

69 {
70 G4int result = 0;
71 for(G4int i=0; i<6; i++)
72 {
73 result += aP->GetQuarkContent(i+1);
74 result += aP->GetAntiQuarkContent(i+1);
75 }
76 return result;
77 }
int G4int
Definition: G4Types.hh:85
G4int GetQuarkContent(G4int flavor) const
G4int GetAntiQuarkContent(G4int flavor) const

References G4ParticleDefinition::GetAntiQuarkContent(), and G4ParticleDefinition::GetQuarkContent().

Referenced by G4CollisionMesonBaryonElastic::IsInCharge().

◆ GetOutgoingParticles()

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

Implemented in G4ConcreteNNTwoBodyResonance.

Referenced by FinalState().

◆ IsInCharge()

virtual G4bool G4VCollision::IsInCharge ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
pure virtualinherited

◆ operator!=() [1/2]

G4bool G4VCollision::operator!= ( const G4VCollision right) const
inherited

Definition at line 48 of file G4VCollision.cc.

49{
50 return (this != (G4VCollision *) &right);
51}

◆ operator!=() [2/2]

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

◆ operator=()

G4VScatteringCollision & G4VScatteringCollision::operator= ( const G4VScatteringCollision )
private

◆ operator==() [1/2]

G4bool G4VCollision::operator== ( const G4VCollision right) const
inherited

Definition at line 42 of file G4VCollision.cc.

43{
44 return (this == (G4VCollision *) &right);
45}

◆ operator==() [2/2]

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

◆ Print() [1/2]

void G4VCollision::Print ( ) const
virtualinherited

Definition at line 70 of file G4VCollision.cc.

71{
73
74 G4cout << "---- " << name << "---- Cross section" << G4endl;
75
77 if (xSource) xSource->Print();
78
79 G4int nComponents = 0;
80 const G4CollisionVector* components = GetComponents();
81 if (components)
82 {
83 nComponents = components->size();
84 }
85 G4cout << "---- " << name << "---- has " << nComponents << " components" <<G4endl;
86 G4int i = 0;
87 G4CollisionVector::const_iterator iter;
88 if (components)
89 {
90 for (iter = components->begin(); iter != components->end(); ++iter)
91 {
92 G4cout << "---- " << name << " ---- Component " << i << G4endl;
93 ((*iter))->Print();
94 i++;
95 }
96 }
97
98}
std::vector< G4VCollision * > G4CollisionVector
virtual const G4CollisionVector * GetComponents() const
Definition: G4VCollision.hh:79
virtual void Print() const
Definition: G4VCollision.cc:70
virtual G4String GetName() const =0
virtual void Print() const
const char * name(G4int ptype)

References G4cout, G4endl, G4VCollision::GetComponents(), G4VCollision::GetCrossSectionSource(), G4VCollision::GetName(), G4InuclParticleNames::name(), G4VCollision::Print(), and G4VCrossSectionSource::Print().

Referenced by G4VCollision::Print().

◆ Print() [2/2]

void G4VCollision::Print ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
virtualinherited

Definition at line 101 of file G4VCollision.cc.

103{
105
106 if (IsInCharge(trk1,trk2))
107 {
108 G4cout << "---- " << name << "is in charge ---- " << G4endl;
109 }
110 else
111 {
112 G4cout << "---- " << name << "is not in charge ---- " << G4endl;
113 }
114
115 G4cout << "---- " << name << "---- Cross section" << G4endl;
116
118 if (xSource) xSource->Print();
119 G4cout << "Cross section = " << CrossSection(trk1,trk2) << G4endl;
120
121 G4int nComponents = 0;
122 const G4CollisionVector* components = GetComponents();
123 if (components)
124 {
125 nComponents = components->size();
126 }
127 G4cout << "---- " << name << "has " << nComponents << " components" <<G4endl;
128
129 G4int i = 0;
130 G4CollisionVector::const_iterator iter;
131 if (components)
132 {
133 for (iter = components->begin(); iter != components->end(); ++iter)
134 {
135 G4cout << "Component " << i << G4endl;
136 ((*iter))->Print();
137 i++;
138 }
139 }
140}
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
Definition: G4VCollision.cc:54
virtual G4bool IsInCharge(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0

References G4VCollision::CrossSection(), G4cout, G4endl, G4VCollision::GetComponents(), G4VCollision::GetCrossSectionSource(), G4VCollision::GetName(), G4VCollision::IsInCharge(), G4InuclParticleNames::name(), G4VCollision::Print(), and G4VCrossSectionSource::Print().

◆ SampleResonanceMass()

double G4VScatteringCollision::SampleResonanceMass ( const double  poleMass,
const double  width,
const double  minMass,
const double  maxMass 
) const
private

Definition at line 156 of file G4VScatteringCollision.cc.

160{
161 // Chooses a mass randomly between minMass and maxMass
162 // according to a Breit-Wigner function with constant
163 // width gamma and pole poleMass
164
165 G4double minMass = aMinMass;
166 if (minMass > maxMass) G4cerr << "##################### SampleResonanceMass: particle out of mass range" << G4endl;
167 if(minMass > maxMass) minMass -= G4PionPlus::PionPlus()->GetPDGMass();
168 if(minMass > maxMass) minMass = 0;
169
170 if (gamma < 1E-10*GeV)
171 return std::max(minMass,std::min(maxMass, poleMass));
172 else {
173 double fmin = BrWigInt0(minMass, gamma, poleMass);
174 double fmax = BrWigInt0(maxMass, gamma, poleMass);
175 double f = fmin + (fmax-fmin)*G4UniformRand();
176 return BrWigInv(f, gamma, poleMass);
177 }
178}
static constexpr double GeV
Definition: G4SIunits.hh:203
#define G4UniformRand()
Definition: Randomize.hh:52
double BrWigInv(const double x, const double gamma, const double m0) const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments

References BrWigInt0(), BrWigInv(), G4cerr, G4endl, G4UniformRand, G4ParticleDefinition::GetPDGMass(), GeV, G4INCL::Math::max(), G4INCL::Math::min(), and G4PionPlus::PionPlus().

Referenced by FinalState().

Field Documentation

◆ theAngularDistribution

G4VAngularDistribution* G4VScatteringCollision::theAngularDistribution
private

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