Skip to content

Commit c2c5926

Browse files
committed
Added ratio to Rutherford output to "jibaltool cs"
1 parent 323b936 commit c2c5926

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

tools/jibaltool.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ int print_cs(jibaltool_global *global, int argc, char **argv) {
350350
double theta = jibal_get_val(jibal->units, JIBAL_UNIT_TYPE_ANGLE, argv[2]);
351351
double E = jibal_get_val(jibal->units, JIBAL_UNIT_TYPE_ENERGY, argv[3]);
352352

353-
double cs_rbs = 0.0;
354-
double cs_erd = 0.0;
353+
double cs_rbs = 0.0, cs_rbs_rutherford = 0.0;
354+
double cs_erd = 0.0, cs_erd_rutherford = 0.0;
355355
int erd = theta < (90.0*C_DEG);
356356
for(size_t i_elem = 0; i_elem < target_material->n_elements; i_elem++) {
357357
jibal_element *e = &target_material->elements[i_elem];
@@ -363,19 +363,21 @@ int print_cs(jibaltool_global *global, int argc, char **argv) {
363363
if(!(incident->mass > isotope->mass && theta > theta_max)) { /* Scattering possible */
364364
double sigma_rbs = jibal_cs_rbs(jibal->config, incident, isotope, theta, E);
365365
cs_rbs += c * sigma_rbs;
366+
cs_rbs_rutherford += c * jibal_cross_section_rbs(incident, isotope, theta, E, JIBAL_CS_RUTHERFORD);
366367
}
367368
if(erd) {
368369
double sigma_erd = jibal_cs_erd(jibal->config, incident, isotope, theta, E);
369370
cs_erd += c * sigma_erd;
371+
cs_erd_rutherford += c * jibal_cross_section_erd(incident, isotope, theta, E, JIBAL_CS_RUTHERFORD);
370372
}
371373
#ifdef DEBUG
372374
fprintf(stderr, "Isotope %zu conc %lf\n", i_isotope, e->concs[i_isotope]);
373375
#endif
374376
}
375377
}
376-
fprintf(stderr, "RBS cross section is %g mb/sr (%s)\n", cs_rbs/C_MB_SR, jibal_cs_rbs_name(jibal->config));
378+
fprintf(stderr, "RBS cross section is %g mb/sr (%s). Ratio to Rutherford: %.5lf\n", cs_rbs/C_MB_SR, jibal_cs_rbs_name(jibal->config), cs_rbs/cs_rbs_rutherford);
377379
if(erd) {
378-
fprintf(stderr, "ERD cross section is %g mb/sr (%s)\n", cs_erd / C_MB_SR, jibal_cs_erd_name(jibal->config));
380+
fprintf(stderr, "ERD cross section is %g mb/sr (%s). Ratio to Rutherford: %.5lf\n", cs_erd / C_MB_SR, jibal_cs_erd_name(jibal->config), cs_erd/cs_erd_rutherford);
379381
}
380382
jibal_material_free(target_material);
381383
return EXIT_SUCCESS;

0 commit comments

Comments
 (0)