92 {
93
94 #ifdef debugFTFexictation
96 #endif
97
98 CommonVariables common;
99
100
101 common.Pprojectile = projectile->Get4Momentum();
102 if ( common.Pprojectile.z() < 0.0 ) return false;
103 common.ProjectilePDGcode = projectile->GetDefinition()->GetPDGEncoding();
104 common.absProjectilePDGcode = std::abs( common.ProjectilePDGcode );
105 common.M0projectile = projectile->GetDefinition()->GetPDGMass();
106 G4double ProjectileRapidity = common.Pprojectile.rapidity();
107
108
109 common.Ptarget = target->Get4Momentum();
110 common.TargetPDGcode = target->GetDefinition()->GetPDGEncoding();
111 common.absTargetPDGcode = std::abs( common.TargetPDGcode );
112 common.M0target = target->GetDefinition()->GetPDGMass();
113 G4double TargetRapidity = common.Ptarget.rapidity();
114
115
117 common.S = Psum.
mag2();
118 common.SqrtS = std::sqrt( common.S );
119
120
121 G4bool toBePutOnMassShell =
true;
122 common.MminProjectile = common.BrW.GetMinimumMass( projectile->GetDefinition() );
123
124
125
126
127
128
129
130
131 common.M0projectile2 = common.M0projectile * common.M0projectile;
134 if ( common.M0projectile > common.ProjectileDiffStateMinMass ) {
135 common.ProjectileDiffStateMinMass = common.MminProjectile + 220.0*MeV;
136 common.ProjectileNonDiffStateMinMass = common.MminProjectile + 220.0*MeV;
137 if ( common.absProjectilePDGcode > 3000 ) {
138 common.ProjectileDiffStateMinMass += 140.0*MeV;
139 common.ProjectileNonDiffStateMinMass += 140.0*MeV;
140 }
141 }
142 common.MminTarget = common.BrW.GetMinimumMass( target->GetDefinition() );
143
144
145
146
147
148
149
150
151 common.M0target2 = common.M0target * common.M0target;
154 if ( common.M0target > common.TargetDiffStateMinMass ) {
155 common.TargetDiffStateMinMass = common.MminTarget + 220.0*MeV;
156 common.TargetNonDiffStateMinMass = common.MminTarget + 220.0*MeV;
157 if ( common.absTargetPDGcode > 3000 ) {
158 common.TargetDiffStateMinMass += 140.0*MeV;
159 common.TargetNonDiffStateMinMass += 140.0*MeV;
160 }
161 };
162 #ifdef debugFTFexictation
163 G4cout <<
"Proj Targ PDGcodes " << common.ProjectilePDGcode <<
" " << common.TargetPDGcode <<
G4endl
164 <<
"Mprojectile Y " << common.Pprojectile.mag() <<
" " << ProjectileRapidity <<
G4endl
165 <<
"M0projectile Y " << common.M0projectile <<
" " << ProjectileRapidity <<
G4endl;
166 G4cout <<
"Mtarget Y " << common.Ptarget.mag() <<
" " << TargetRapidity <<
G4endl
167 <<
"M0target Y " << common.M0target <<
" " << TargetRapidity <<
G4endl;
168 G4cout <<
"Pproj " << common.Pprojectile <<
G4endl <<
"Ptarget " << common.Ptarget <<
G4endl;
169 #endif
170
171
174 if ( Ptmp.
pz() <= 0.0 )
return false;
177 common.toLab = common.toCms.inverse();
178 common.Pprojectile.
transform( common.toCms );
179 common.Ptarget.
transform( common.toCms );
180
181 G4double SumMasses = common.M0projectile + common.M0target;
182 #ifdef debugFTFexictation
183 G4cout <<
"SqrtS " << common.SqrtS <<
G4endl <<
"M0pr M0tr SumM " << common.M0projectile
184 <<
" " << common.M0target <<
" " << SumMasses <<
G4endl;
185 #endif
186 if ( common.SqrtS < SumMasses ) return false;
187
188 common.PZcms2 = (
sqr( common.S ) +
sqr( common.M0projectile2 ) +
sqr( common.M0target2 )
189 - 2.0 * ( common.S * ( common.M0projectile2 + common.M0target2 )
190 + common.M0projectile2 * common.M0target2 ) ) / 4.0 / common.S;
191 #ifdef debugFTFexictation
192 G4cout <<
"PZcms2 after toBePutOnMassShell " << common.PZcms2 <<
G4endl;
193 #endif
194 if ( common.PZcms2 < 0.0 ) return false;
195
196 common.PZcms = std::sqrt( common.PZcms2 );
197 if ( toBePutOnMassShell ) {
198 if ( common.Pprojectile.z() > 0.0 ) {
199 common.Pprojectile.setPz( common.PZcms );
200 common.Ptarget.setPz( -common.PZcms );
201 } else {
202 common.Pprojectile.setPz( -common.PZcms );
203 common.Ptarget.setPz( common.PZcms );
204 }
205 common.Pprojectile.setE( std::sqrt( common.M0projectile2
206 + common.Pprojectile.x() * common.Pprojectile.x()
207 + common.Pprojectile.y() * common.Pprojectile.y()
208 + common.PZcms2 ) );
209 common.Ptarget.setE( std::sqrt( common.M0target2
210 + common.Ptarget.x() * common.Ptarget.x()
211 + common.Ptarget.y() * common.Ptarget.y()
212 + common.PZcms2 ) );
213 }
214 #ifdef debugFTFexictation
215 G4cout <<
"Start --------------------" <<
G4endl <<
"Proj M0 Mdif Mndif " << common.M0projectile
216 << " " << common.ProjectileDiffStateMinMass << " " << common.ProjectileNonDiffStateMinMass
218 << "Targ M0 Mdif Mndif " << common.M0target << " " << common.TargetDiffStateMinMass
219 <<
" " << common.TargetNonDiffStateMinMass <<
G4endl <<
"SqrtS " << common.SqrtS <<
G4endl
220 <<
"Proj CMS " << common.Pprojectile <<
G4endl <<
"Targ CMS " << common.Ptarget <<
G4endl;
221 #endif
222
223
224 ProjectileRapidity = common.Pprojectile.rapidity();
225 TargetRapidity = common.Ptarget.rapidity();
228 theParameters->
GetProcProb( 4, ProjectileRapidity - TargetRapidity );
229 common.ProbProjectileDiffraction =
230 theParameters->
GetProcProb( 2, ProjectileRapidity - TargetRapidity );
231 common.ProbTargetDiffraction =
232 theParameters->
GetProcProb( 3, ProjectileRapidity - TargetRapidity );
233 common.ProbOfDiffraction = common.ProbProjectileDiffraction + common.ProbTargetDiffraction;
234 #ifdef debugFTFexictation
235 G4cout <<
"Proc Probs " << QeNoExc <<
" " << QeExc <<
" "
236 << common.ProbProjectileDiffraction <<
" " << common.ProbTargetDiffraction <<
G4endl
237 <<
"ProjectileRapidity " << ProjectileRapidity <<
G4endl;
238 #endif
239
240 if ( QeNoExc + QeExc + common.ProbProjectileDiffraction + common.ProbTargetDiffraction > 1.0 ) {
241 QeNoExc = 1.0 - QeExc - common.ProbProjectileDiffraction - common.ProbTargetDiffraction;
242 }
243 if ( QeExc + QeNoExc != 0.0 ) {
244 common.ProbExc = QeExc / ( QeExc + QeNoExc );
245 }
246 if ( 1.0 - QeExc - QeNoExc > 0.0 ) {
247 common.ProbProjectileDiffraction /= ( 1.0 - QeExc - QeNoExc );
248 common.ProbTargetDiffraction /= ( 1.0 - QeExc - QeNoExc );
249 }
250 #ifdef debugFTFexictation
251 G4cout <<
"Proc Probs " << QeNoExc <<
" " << QeExc <<
" "
252 << common.ProbProjectileDiffraction <<
" " << common.ProbTargetDiffraction <<
G4endl
253 <<
"ProjectileRapidity " << ProjectileRapidity <<
G4endl;
254 #endif
255
256
257 G4int returnCode = 1;
259 returnCode = ExciteParticipants_doChargeExchange( projectile, target, theParameters,
260 theElastic, common );
261 }
262
263 G4bool returnResult =
false;
264 if ( returnCode == 0 ) {
265 returnResult = true;
266 } else if ( returnCode == 1 ) {
267
268 common.ProbOfDiffraction = common.ProbProjectileDiffraction + common.ProbTargetDiffraction;
269 #ifdef debugFTFexictation
271 << "Proj M0 MdMin MndMin " << common.M0projectile << " "
272 << common.ProjectileDiffStateMinMass << " " << common.ProjectileNonDiffStateMinMass
274 << "Targ M0 MdMin MndMin " << common.M0target << " " << common.TargetDiffStateMinMass
275 <<
" " << common.TargetNonDiffStateMinMass <<
G4endl <<
"SqrtS " << common.SqrtS
277 << "Prob: ProjDiff TargDiff + Sum " << common.ProbProjectileDiffraction << " "
278 << common.ProbTargetDiffraction <<
" " << common.ProbOfDiffraction <<
G4endl;
279 #endif
280 if ( common.ProbOfDiffraction != 0.0 ) {
281 common.ProbProjectileDiffraction /= common.ProbOfDiffraction;
282 } else {
283 common.ProbProjectileDiffraction = 0.0;
284 }
285 #ifdef debugFTFexictation
286 G4cout <<
"Prob: ProjDiff TargDiff + Sum " << common.ProbProjectileDiffraction <<
" "
287 << common.ProbTargetDiffraction <<
" " << common.ProbOfDiffraction <<
G4endl;
288 #endif
289 common.ProjectileDiffStateMinMass2 =
sqr( common.ProjectileDiffStateMinMass );
290 common.ProjectileNonDiffStateMinMass2 =
sqr( common.ProjectileNonDiffStateMinMass );
291 common.TargetDiffStateMinMass2 =
sqr( common.TargetDiffStateMinMass );
292 common.TargetNonDiffStateMinMass2 =
sqr( common.TargetNonDiffStateMinMass );
293
295
296 returnResult = ExciteParticipants_doDiffraction( projectile, target, theParameters, common );
297
298 } else {
299
300 returnResult = ExciteParticipants_doNonDiffraction( projectile, target, theParameters, common );
301
302 }
303 if ( returnResult ) {
304 common.Pprojectile += common.Qmomentum;
305 common.Ptarget -= common.Qmomentum;
306
307 common.Pprojectile.transform( common.toLab );
308 common.Ptarget.transform( common.toLab );
309 #ifdef debugFTFexictation
310 G4cout <<
"Mproj " << common.Pprojectile.mag() <<
G4endl <<
"Mtarg " << common.Ptarget.mag()
312 #endif
313 projectile->Set4Momentum( common.Pprojectile );
314 target->Set4Momentum( common.Ptarget );
315 projectile->IncrementCollisionCount( 1 );
316 target->IncrementCollisionCount( 1 );
317 }
318 }
319
320 return returnResult;
321}
CLHEP::HepLorentzRotation G4LorentzRotation
HepLorentzVector & rotateZ(double)
HepLorentzVector & rotateY(double)
HepLorentzVector & transform(const HepRotation &)
G4double GetProjMinNonDiffMass()
G4double GetTarMinNonDiffMass()
G4double GetProcProb(const G4int ProcN, const G4double y)