Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ROOT script for just calculating quenching factor of Si-28 by Lindhard eq. Lindhardの式でシリコンのQFを計算するだけのスクリプト。
{
double z = 14.; // atomic number
double a = 28.; // mass number
int npoint = 1000;
// double range[2] = {0., 1000.}; // 0 - 1 MeV
// double range[2] = {0., 100.}; // 0 - 100 keV
double range[2] = {0., 10.}; // 0 - 10 keV
TGraph *g1 = new TGraph();
double k = 0.133 * pow(z, 2.0/3.0) * pow(a, -0.5);
for (int ipoint = 0; ipoint < npoint; ipoint++){
double energy = (range[1]-range[0])/npoint * ipoint + range[0];
double epsilon = 11.5*energy * pow(z, -7.0/3.0);
double g = 3 * pow(epsilon, 0.15) + pow(epsilon, 0.6) + epsilon;
double kg = k*g;
double f = kg / (1+kg);
g1->SetPoint(ipoint, energy, f);
}
g1->Draw("AP");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment