Geant4-11
Public Member Functions | Private Member Functions
G4ElasticHNScattering Class Reference

#include <G4ElasticHNScattering.hh>

Public Member Functions

virtual G4bool ElasticScattering (G4VSplitableHadron *aPartner, G4VSplitableHadron *bPartner, G4FTFParameters *theParameters) const
 
 G4ElasticHNScattering ()
 
virtual ~G4ElasticHNScattering ()
 

Private Member Functions

 G4ElasticHNScattering (const G4ElasticHNScattering &right)
 
G4ThreeVector GaussianPt (G4double AveragePt2, G4double maxPtSquare) const
 
G4bool operator!= (const G4ElasticHNScattering &right) const
 
const G4ElasticHNScatteringoperator= (const G4ElasticHNScattering &right)
 
G4bool operator== (const G4ElasticHNScattering &right) const
 

Detailed Description

Definition at line 50 of file G4ElasticHNScattering.hh.

Constructor & Destructor Documentation

◆ G4ElasticHNScattering() [1/2]

G4ElasticHNScattering::G4ElasticHNScattering ( )

Definition at line 59 of file G4ElasticHNScattering.cc.

59{}

◆ ~G4ElasticHNScattering()

G4ElasticHNScattering::~G4ElasticHNScattering ( )
virtual

Definition at line 189 of file G4ElasticHNScattering.cc.

189{}

◆ G4ElasticHNScattering() [2/2]

G4ElasticHNScattering::G4ElasticHNScattering ( const G4ElasticHNScattering right)
private

Definition at line 181 of file G4ElasticHNScattering.cc.

181 {
182 throw G4HadronicException( __FILE__, __LINE__,
183 "G4ElasticHNScattering copy constructor not meant to be called" );
184}

Member Function Documentation

◆ ElasticScattering()

G4bool G4ElasticHNScattering::ElasticScattering ( G4VSplitableHadron aPartner,
G4VSplitableHadron bPartner,
G4FTFParameters theParameters 
) const
virtual

Definition at line 64 of file G4ElasticHNScattering.cc.

66 {
67 projectile->IncrementCollisionCount( 1 );
68 target->IncrementCollisionCount( 1 );
69
70 if ( projectile->Get4Momentum().z() < 0.0 ) return false; //Uzhi Aug.2019
71
72 // Projectile parameters
73 G4LorentzVector Pprojectile = projectile->Get4Momentum();
74 G4double M0projectile = Pprojectile.mag();
75 G4double M0projectile2 = M0projectile * M0projectile;
76
77 // Target parameters
78 G4LorentzVector Ptarget = target->Get4Momentum();
79 G4double M0target = Ptarget.mag();
80 G4double M0target2 = M0target * M0target;
81
82 G4double AveragePt2 = theParameters->GetAvaragePt2ofElasticScattering();
83
84 // Transform momenta to cms and then rotate parallel to z axis;
85 G4LorentzVector Psum;
86 Psum = Pprojectile + Ptarget;
87 G4LorentzRotation toCms( -1*Psum.boostVector() );
88 G4LorentzVector Ptmp = toCms*Pprojectile;
89 if ( Ptmp.pz() <= 0.0 ) return false;
90 //"String" moving backwards in CMS, abort collision !
91 //G4cout << " abort Collision! " << G4endl;
92 toCms.rotateZ( -1*Ptmp.phi() );
93 toCms.rotateY( -1*Ptmp.theta() );
94 G4LorentzRotation toLab( toCms.inverse() );
95 Pprojectile.transform( toCms );
96 Ptarget.transform( toCms );
97
98 G4double PZcms2, PZcms;
99 G4double S = Psum.mag2();
100 G4double SqrtS = std::sqrt( S );
101 if ( SqrtS < M0projectile + M0target ) return false;
102
103 PZcms2 = ( S*S + sqr( M0projectile2 ) + sqr( M0target2 )
104 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
105
106 PZcms = ( PZcms2 > 0.0 ? std::sqrt( PZcms2 ) : 0.0 );
107
108 G4double maxPtSquare = PZcms2;
109
110 // Now we can calculate the transferred Pt
111 G4double Pt2;
112 G4double ProjMassT2, ProjMassT;
113 G4double TargMassT2, TargMassT;
114 G4LorentzVector Qmomentum;
115
116 const G4int maxNumberOfLoops = 1000;
117 G4int loopCounter = 0;
118 do {
119 Qmomentum = G4LorentzVector( GaussianPt( AveragePt2, maxPtSquare ), 0.0 );
120 Pt2 = G4ThreeVector( Qmomentum.vect() ).mag2();
121 ProjMassT2 = M0projectile2 + Pt2;
122 ProjMassT = std::sqrt( ProjMassT2 );
123 TargMassT2 = M0target2 + Pt2;
124 TargMassT = std::sqrt( TargMassT2 );
125 } while ( ( SqrtS < ProjMassT + TargMassT ) &&
126 ++loopCounter < maxNumberOfLoops ); /* Loop checking, 10.08.2015, A.Ribon */
127 if ( loopCounter >= maxNumberOfLoops ) {
128 return false;
129 }
130
131 PZcms2 = ( S*S + sqr( ProjMassT2 ) + sqr( TargMassT2 )
132 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
133
134 if ( PZcms2 < 0.0 ) { PZcms2 = 0.0; }; // to avoid the exactness problem
135 PZcms = std::sqrt( PZcms2 );
136 Pprojectile.setPz( PZcms );
137 Ptarget.setPz( -PZcms );
138 Pprojectile += Qmomentum;
139 Ptarget -= Qmomentum;
140
141 // Transform back and update SplitableHadron Participant.
142 Pprojectile.transform( toLab );
143 Ptarget.transform( toLab );
144
145 // Calculation of the creation time
146 projectile->SetTimeOfCreation( target->GetTimeOfCreation() );
147 projectile->SetPosition( target->GetPosition() );
148
149 // Creation time and position of target nucleon were determined at
150 // ReggeonCascade() of G4FTFModel
151
152 projectile->Set4Momentum( Pprojectile );
153 target->Set4Momentum( Ptarget );
154
155 //projectile->IncrementCollisionCount( 1 );
156 //target->IncrementCollisionCount( 1 );
157
158 return true;
159}
G4double S(G4double temp)
CLHEP::HepLorentzVector G4LorentzVector
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
double mag2() const
double theta() const
Hep3Vector boostVector() const
Hep3Vector vect() const
HepLorentzVector & rotateZ(double)
HepLorentzVector & rotateY(double)
HepLorentzVector & transform(const HepRotation &)
G4ThreeVector GaussianPt(G4double AveragePt2, G4double maxPtSquare) const
G4double GetAvaragePt2ofElasticScattering()
T sqr(const T &x)
Definition: templates.hh:128

References CLHEP::HepLorentzVector::boostVector(), GaussianPt(), G4VSplitableHadron::Get4Momentum(), G4FTFParameters::GetAvaragePt2ofElasticScattering(), G4VSplitableHadron::GetPosition(), G4VSplitableHadron::GetTimeOfCreation(), G4VSplitableHadron::IncrementCollisionCount(), CLHEP::HepLorentzRotation::inverse(), CLHEP::HepLorentzVector::mag(), CLHEP::HepLorentzVector::mag2(), CLHEP::Hep3Vector::mag2(), CLHEP::HepLorentzVector::phi(), CLHEP::HepLorentzVector::pz(), CLHEP::HepLorentzRotation::rotateY(), CLHEP::HepLorentzRotation::rotateZ(), S(), G4VSplitableHadron::Set4Momentum(), G4VSplitableHadron::SetPosition(), CLHEP::HepLorentzVector::setPz(), G4VSplitableHadron::SetTimeOfCreation(), sqr(), CLHEP::HepLorentzVector::theta(), CLHEP::HepLorentzVector::transform(), CLHEP::HepLorentzVector::vect(), and CLHEP::HepLorentzVector::z().

Referenced by G4FTFModel::ExciteParticipants(), and G4DiffractiveExcitation::ExciteParticipants_doChargeExchange().

◆ GaussianPt()

G4ThreeVector G4ElasticHNScattering::GaussianPt ( G4double  AveragePt2,
G4double  maxPtSquare 
) const
private

Definition at line 164 of file G4ElasticHNScattering.cc.

165 {
166 // @@ this method is used in FTFModel as well. Should go somewhere common!
167 G4double Pt2( 0.0 );
168 if ( AveragePt2 <= 0.0 ) {
169 Pt2 = 0.0;
170 } else {
171 Pt2 = -AveragePt2 * G4Log( 1.0 + G4UniformRand() * ( G4Exp( -maxPtSquare/AveragePt2 ) -1.0 ) );
172 }
173 G4double Pt = ( Pt2 > 0.0 ? std::sqrt( Pt2 ) : 0.0 );
174 G4double phi = G4UniformRand() * twopi;
175 return G4ThreeVector( Pt * std::cos( phi ), Pt * std::sin( phi ), 0.0 );
176}
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:179
G4double G4Log(G4double x)
Definition: G4Log.hh:226
static constexpr double twopi
Definition: G4SIunits.hh:56
#define G4UniformRand()
Definition: Randomize.hh:52

References G4Exp(), G4Log(), G4UniformRand, and twopi.

Referenced by ElasticScattering().

◆ operator!=()

G4bool G4ElasticHNScattering::operator!= ( const G4ElasticHNScattering right) const
private

Definition at line 210 of file G4ElasticHNScattering.cc.

210 {
211 throw G4HadronicException( __FILE__, __LINE__,
212 "G4ElasticHNScattering != operator not meant to be called" );
213}

◆ operator=()

const G4ElasticHNScattering & G4ElasticHNScattering::operator= ( const G4ElasticHNScattering right)
private

Definition at line 194 of file G4ElasticHNScattering.cc.

194 {
195 throw G4HadronicException( __FILE__, __LINE__,
196 "G4ElasticHNScattering = operator not meant to be called" );
197}

◆ operator==()

G4bool G4ElasticHNScattering::operator== ( const G4ElasticHNScattering right) const
private

Definition at line 202 of file G4ElasticHNScattering.cc.

202 {
203 throw G4HadronicException( __FILE__, __LINE__,
204 "G4ElasticHNScattering == operator not meant to be called" );
205}

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