67 projectile->IncrementCollisionCount( 1 );
68 target->IncrementCollisionCount( 1 );
74 if ( Pprojectile.
z() < 0.0 )
return false;
75 G4bool PutOnMassShell(
false );
81 if ( M0projectile < MminProjectile ) {
82 PutOnMassShell =
true;
83 M0projectile = projectile->GetDefinition()->GetPDGMass();
85 G4double M0projectile2 = M0projectile * M0projectile;
95 if ( M0target < MminTarget ) {
96 PutOnMassShell =
true;
97 M0target =
target->GetDefinition()->GetPDGMass();
99 G4double M0target2 = M0target * M0target;
103 Psum = Pprojectile + Ptarget;
106 if ( Ptmp.pz() <= 0.0 )
return false;
109 toCms.
rotateZ( -1*Ptmp.phi() );
110 toCms.
rotateY( -1*Ptmp.theta() );
119 if ( SqrtS < M0projectile + M0target )
return false;
121 PZcms2 = ( S*S +
sqr( M0projectile2 ) +
sqr( M0target2 )
122 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
124 if ( PZcms2 < 0.0 ) {
125 if ( M0projectile > projectile->GetDefinition()->GetPDGMass() ) {
128 M0projectile = projectile->GetDefinition()->GetPDGMass();
129 M0projectile2 = M0projectile * M0projectile;
130 PZcms2= ( S*S +
sqr( M0projectile2 ) +
sqr( M0target2 )
131 - 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
132 if ( PZcms2 < 0.0 ) {
return false; }
139 PZcms = std::sqrt( PZcms2 );
141 if ( PutOnMassShell ) {
142 if ( Pprojectile.z() > 0.0 ) {
143 Pprojectile.setPz( PZcms );
144 Ptarget.setPz( -PZcms );
146 Pprojectile.setPz( -PZcms );
147 Ptarget.setPz( PZcms );
149 Pprojectile.setE( std::sqrt( M0projectile2 + Pprojectile.x() * Pprojectile.x() +
150 Pprojectile.y() * Pprojectile.y() + PZcms2 ) );
151 Ptarget.setE( std::sqrt( M0target2 + Ptarget.x() * Ptarget.x() + Ptarget.y() * Ptarget.y() +
163 const G4int maxNumberOfLoops = 1000;
164 G4int loopCounter = 0;
166 Qmomentum =
G4LorentzVector( GaussianPt( AveragePt2, maxPtSquare ), 0.0 );
168 ProjMassT2 = M0projectile2 + Pt2;
169 ProjMassT = std::sqrt( ProjMassT2 );
170 TargMassT2 = M0target2 + Pt2;
171 TargMassT = std::sqrt( TargMassT2 );
172 }
while ( ( SqrtS < ProjMassT + TargMassT ) &&
173 ++loopCounter < maxNumberOfLoops );
174 if ( loopCounter >= maxNumberOfLoops ) {
178 PZcms2 = ( S*S +
sqr( ProjMassT2 ) +
sqr( TargMassT2 )
179 - 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
181 if ( PZcms2 < 0.0 ) { PZcms2 = 0.0; };
182 PZcms = std::sqrt( PZcms2 );
183 Pprojectile.setPz( PZcms );
184 Ptarget.setPz( -PZcms );
185 Pprojectile += Qmomentum;
186 Ptarget -= Qmomentum;
193 projectile->SetTimeOfCreation(
target->GetTimeOfCreation() );
194 projectile->SetPosition(
target->GetPosition() );
199 projectile->Set4Momentum( Pprojectile );
200 target->Set4Momentum( Ptarget );
Hep3Vector boostVector() const
CLHEP::Hep3Vector G4ThreeVector
G4double GetAvaragePt2ofElasticScattering()
HepLorentzVector & rotateZ(double)
HepLorentzRotation & transform(const HepBoost &b)
G4double GetMinimumMass(const G4ParticleDefinition *p) const
HepLorentzVector & rotateY(double)
HepLorentzVector & transform(const HepRotation &)
CLHEP::HepLorentzVector G4LorentzVector