60{
61
63
64 if(Pprojectile.
z() < 0.)
65 {
66 target->SetStatus(2);
67 return false;
68 }
69
70 G4bool PutOnMassShell(
false);
71
73 if(M0projectile < projectile->GetDefinition()->GetPDGMass())
74 {
75 PutOnMassShell=true;
76 M0projectile=projectile->GetDefinition()->GetPDGMass();
77 }
78
79 G4double Mprojectile2 = M0projectile * M0projectile;
80
82
83
84
86
88
89 if(M0target < target->GetDefinition()->GetPDGMass())
90 {
91 PutOnMassShell=true;
92 M0target=target->GetDefinition()->GetPDGMass();
93 }
94
95 G4double Mtarget2 = M0target * M0target;
96
97
98
100 Psum=Pprojectile+Ptarget;
101
103
105
106 if ( Ptmp.
pz() <= 0. )
107 {
108
109
110 target->SetStatus(2);
111 return false;
112 }
113
116
118
119 Pprojectile.transform(toCms);
120 Ptarget.transform(toCms);
121
122
124
126
127
128 PZcms2=(S*S+Mprojectile2*Mprojectile2+Mtarget2*Mtarget2-
129 2*S*Mprojectile2-2*S*Mtarget2-2*Mprojectile2*Mtarget2)/4./S;
130
131 if(PZcms2 < 0.)
132 {
133 if(M0projectile > projectile->GetDefinition()->GetPDGMass())
134 {
135
136 M0projectile = projectile->GetDefinition()->GetPDGMass();
137 Mprojectile2=M0projectile*M0projectile;
138 PZcms2=(S*S+Mprojectile2*Mprojectile2+Mtarget2*Mtarget2-
139 2*S*Mprojectile2 - 2*S*Mtarget2 - 2*Mprojectile2*Mtarget2)
140 /4./S;
141
142 if(PZcms2 < 0.){ return false;}
143 }
144 else
145 {
146 target->SetStatus(2);
147 return false;
148
149
150 }
151 }
152
153 PZcms = std::sqrt(PZcms2);
154
155 if(PutOnMassShell)
156 {
157 if(Pprojectile.z() > 0.)
158 {
159 Pprojectile.setPz( PZcms);
160 Ptarget.setPz( -PZcms);
161 }
162 else
163 {
164 Pprojectile.setPz(-PZcms);
165 Ptarget.setPz( PZcms);
166 };
167
168 Pprojectile.setE(std::sqrt(Mprojectile2+
169 Pprojectile.x()*Pprojectile.x()+
170 Pprojectile.y()*Pprojectile.y()+
171 PZcms2));
172 Ptarget.setE(std::sqrt( Mtarget2 +
173 Ptarget.x()*Ptarget.x()+
174 Ptarget.y()*Ptarget.y()+
175 PZcms2));
176 }
177
179
180
184
187
189
190 ProjMassT2=Mprojectile2+Pt2;
191
192
193 TargMassT2=Mtarget2+Pt2;
194
195
196 PZcms2=(S*S+ProjMassT2*ProjMassT2+
197 TargMassT2*TargMassT2-
198 2.*S*ProjMassT2-2.*S*TargMassT2-
199 2.*ProjMassT2*TargMassT2)/4./S;
200 if(PZcms2 < 0 ) {PZcms2=0;};
201 PZcms =std::sqrt(PZcms2);
202
203 Pprojectile.setPz( PZcms);
204 Ptarget.setPz( -PZcms);
205
206 Pprojectile += Qmomentum;
207 Ptarget -= Qmomentum;
208
209
212
213
214
215
216
217
218
219 projectile->SetTimeOfCreation(target->GetTimeOfCreation());
220 projectile->SetPosition(target->GetPosition());
221
222
223
224
225 projectile->Set4Momentum(Pprojectile);
226 target->Set4Momentum(Ptarget);
227
228 projectile->IncrementCollisionCount(1);
229 target->IncrementCollisionCount(1);
230
231 return true;
232}
CLHEP::HepLorentzVector G4LorentzVector
CLHEP::Hep3Vector G4ThreeVector
Hep3Vector boostVector() const
HepLorentzVector & rotateZ(double)
HepLorentzVector & rotateY(double)
HepLorentzVector & transform(const HepRotation &)
G4double GetAvaragePt2ofElasticScattering()