-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMCS.java~
57 lines (35 loc) · 1.44 KB
/
MCS.java~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import java.io.*;
public class MCS
{
static PrintWriter screen = new PrintWriter (System.out, true);
protected String Element;
protected double Z, A, Ro, T, E;
protected final double Q=1.0; //charge of muon in units of electron charge
protected final double mu= 106;
protected double theta, X0, Xa, beta;
public double getThetaL(double inputEnergy, double thickness)
{
double E=inputEnergy; //muon momentum
double t=thickness;
double beta;
double p=Math.sqrt(E*E-mu*mu); //momentum of the muon
beta=p/(Math.sqrt(p*p + 11236));
X0=716.4*A*(1/(Z*(Z+1)*Math.log((287/Math.sqrt(Z))))); //Average energy loose due to bremsstrahlung and pair production up to a factor of 1/e
Xa=X0/Ro;
theta=(13.6/(beta*E))*Q*(Math.sqrt(t/Xa))*(1+0.038*Math.log(t/Xa));
return theta;
}
public MCS ( String Element, double z, double a, double ro, double t, double e)
{
Z=z;
A=a;
Ro=ro;
T=t; //thickness of iron
E=e; //muon momentum
//double Q=1; //charge of muon in units of e
//double theta; // Multiple Coulomb scattering angle
screen.println(" Name of the element "+Element);
theta=getThetaL(e, t);
screen.println("X0 "+X0+" Xa "+Xa+" Beta "+beta+" Theta "+theta);
}
}