17 #include "Randomize.hh" 52 thetacmsInput = 12.3456789;
54 ANGAs =
new G4double[2];
55 ANGAr =
new G4double[2];
57 for(G4int i = 0;i<2;i++){
89 const G4double U = 931.49401;
90 const G4double rad2deg = 0.0174532925;
91 const G4double PI=3.14159265358979323846;
93 G4double wm1=m1*U+ex1;
94 G4double wm2=m2*U+ex2;
95 G4double wm3=m3*U+ex3;
96 G4double wm4=m4*U+ex4;
99 G4double pb2=tb*tb+2.0*tb*wm1;
100 G4double pb=sqrt(pb2);
101 G4double beta=pb/(eb+wm2);
102 G4double gamma=1.0/sqrt(1.0-beta*beta);
104 G4double thetacms=thetacmsInput*rad2deg;
106 G4double thetacmr=PI-thetacms;
107 G4double e=tb+wm1+wm2;
108 G4double e_cm2 = e*e-pb2;
109 G4double e_cm = sqrt(e_cm2);
110 G4double t_cm = e_cm-wm3-wm4;
113 G4cout <<
"Kine No solution!";
118 G4double t_cm2=t_cm*t_cm;
119 G4double t3_cm=(t_cm2+2.*wm4*t_cm)/(t_cm+wm3+wm4)/2.0;
120 G4double t4_cm=(t_cm2+2.*wm3*t_cm)/(t_cm+wm3+wm4)/2.0;
121 G4double p3_cm2=t3_cm*t3_cm+2.0*t3_cm*wm3;
122 G4double p3_cm =sqrt(p3_cm2);
123 G4double tg_thetalabs=p3_cm*sin(thetacms)/(gamma*(p3_cm*cos(thetacms)+beta*sqrt(p3_cm*p3_cm+wm3*wm3)));
125 if(tg_thetalabs>=1.0e6){
129 ANGAs[0]=atan(tg_thetalabs);
132 if(ANGAs[0]<0.0) ANGAs[0]=PI+ANGAs[0];
134 G4double p4_cm2=t4_cm*t4_cm+2.*t4_cm*wm4;
135 G4double p4_cm =sqrt(p4_cm2);
136 G4double tg_thetalabr=p4_cm*sin(thetacmr)/(gamma*(p4_cm*cos(thetacmr)+beta*sqrt(p4_cm*p4_cm+wm4*wm4)));
138 if(tg_thetalabr>1.0e6){
142 ANGAr[0]=atan(tg_thetalabr);
145 if(ANGAr[0]<0.0) ANGAr[0]=PI+ANGAr[0];
148 G4double p3_cmx = p3_cm*sin(thetacms);
149 G4double p3_cmz = p3_cm*cos(thetacms);
150 G4double p3_labx = p3_cmx;
151 G4double p3_labz = gamma*(p3_cmz+beta*(t3_cm+wm3));
152 G4double p3_lab = sqrt(p3_labx*p3_labx+p3_labz*p3_labz);
153 ANGAs[1]=sqrt(p3_lab*p3_lab+wm3*wm3)-wm3;
155 G4double p4_cmx = p4_cm*sin(thetacmr);
156 G4double p4_cmz = p4_cm*cos(thetacmr);
157 G4double p4_labx = p4_cmx;
158 G4double p4_labz = gamma*(p4_cmz+beta*(t4_cm+wm4));
159 G4double p4_lab = sqrt(p4_labx*p4_labx+p4_labz*p4_labz);
160 ANGAr[1] = sqrt(p4_lab*p4_lab+wm4*wm4)-wm4;
171 G4double rad2deg= 0.0174532925;
173 G4cout << G4endl <<
" ActarSimKinePrimGenerator::printResult()" << G4endl;
175 G4cout <<
"Incident Mass: " << m1 <<
" " 176 <<
"Target Mass: " << m2 << G4endl;
177 G4cout <<
"Scattered Mass: " << m3 <<
" " 178 <<
"Recoil Mass: " << m4 << G4endl;
179 G4cout <<
"Theta CM Angle: " << thetacmsInput <<
" " 180 <<
"LAB energy :" << tb << G4endl;
181 G4cout <<
"Scattered excitation energy: " << ex3 << G4endl;
183 G4cout <<
"Lab Scattering angle:" << ANGAs[0]/rad2deg <<
", Scattering energy=" << ANGAs[1] << endl;
184 G4cout <<
" Lab Recoil angle:" << ANGAr[0]/rad2deg <<
", Recoil energy=" << ANGAr[1] << endl;
192 G4double rad2deg= 0.0174532925;
194 G4int prec = G4cout.precision(6);
196 G4cout << G4endl <<
" ActarSimKinePrimGenerator::printResult()" << G4endl;
198 G4cout <<
"Incident Mass: " << m1 <<
" " 199 <<
"Target Mass: " << m2 << G4endl;
200 G4cout <<
"Scattered Mass: " << m3 <<
" " 201 <<
"Recoil Mass: " << m4 << G4endl;
202 G4cout <<
"Theta CM Angle: " << thetacmsInput <<
" " 203 <<
"LAB energy :" << tb << G4endl;
204 G4cout <<
"Scattered excitation energy: " << ex3 << G4endl;
206 G4cout <<
"Lab Scattering angle:" << ANGAs[0]/rad2deg <<
", Scattering energy=" << ANGAs[1] << endl;
207 G4cout <<
" Lab Recoil angle:" << ANGAr[0]/rad2deg <<
", Recoil energy=" << ANGAr[1] << endl;
209 G4cout.precision(prec);
ActarSimKinePrimGenerator()
~ActarSimKinePrimGenerator()
Destructor.
void PrintResults()
Print the results for each solution.