Pluto v6.3.0
Loading...
Searching...
No Matches
KineticRecoilEnergy.C
Go to the documentation of this file.
1
2TLorentzVector doCalEnergy(double BeamEnergy,
3 TLorentzVector Particle1,
4 TLorentzVector Particle2,
5 double nucleusMass,
6 double Particle2Mass,
7 double Particle3Mass)
8{
9 double E_Particle1 = Particle1.E();
10 double p_Particle1_x = Particle1.Px();
11 double p_Particle1_y = Particle1.Py();
12 double p_Particle1_z = Particle1.Pz();
13 double p_Particle1 = sqrt(TMath::Power(p_Particle1_x,2.0) +
14 TMath::Power(p_Particle1_y,2.0) +
15 TMath::Power(p_Particle1_z,2.0));
16 double phi = Particle2.Phi();
17 double theta = Particle2.Theta();
18 double b = 2.0 * ( p_Particle1_x * cos(phi) * sin(theta) +
19 p_Particle1_y * sin(phi) * sin(theta) +
20 p_Particle1_z * cos(theta) -
21 BeamEnergy * cos(theta)
22 );
23 double c = p_Particle1 * p_Particle1 + BeamEnergy * BeamEnergy - 2.0 * BeamEnergy * p_Particle1_z;
24 double d = BeamEnergy + nucleusMass - E_Particle1;
25 double e = TMath::Power(Particle3Mass,2.0) - TMath::Power(Particle2Mass,2.0) - d * d + c;
26 double Delta = 16.0 * TMath::Power(d,2.0) * (TMath::Power(e,2.0) +
27 TMath::Power(b * Particle2Mass,2.0) -
28 TMath::Power(d * Particle2Mass * 2.0,2.0));
29
30 TLorentzVector NewParticle(0.0,0.0,0.0,0.0);
31 if(Delta>0.)
32 {
33 double sol2 = (2.0 * e * b + sqrt(Delta)) / (2.0 * (4.0 * TMath::Power(d,2.0) - TMath::Power(b,2.0)));
34 double newpxcal = sol2 * cos(phi) * sin(theta);
35 double newpycal = sol2 * sin(phi) * sin(theta);
36 double newpzcal = sol2 * cos(theta);
37 double energy = sqrt(TMath::Power(sol2,2.0) + TMath::Power(Particle2Mass,2.0));
38
39 TLorentzVector NewParticle2(newpxcal,newpycal,newpzcal,energy);
40 NewParticle = NewParticle2;
41 }
42
43 return NewParticle;
44}
TLorentzVector doCalEnergy(double BeamEnergy, TLorentzVector Particle1, TLorentzVector Particle2, double nucleusMass, double Particle2Mass, double Particle3Mass)
PParticle * d
double BeamEnergy
PChannel * c[]