1 package org.lcsim.recon.tracking.trfeloss;
2 /**
3 * Class for evaluating a fixed energy loss.
4 *
5 *@author Norman A. Graf
6 *@version 1.0
7 *
8 */
9 public class DeDxFixed extends DeDx
10 {
11
12 private double _density;
13
14 /**
15 *Construct an instance given a material density.
16 *
17 * @param density The density of the material.
18 */
19 public DeDxFixed(double density)
20 {
21 _density = density;
22 }
23
24 /**
25 *Return energy loss (dE/dx) for a given energy.
26 *
27 * @param energy The energy of the particle.
28 * @return The average energy lost by a particle of this energy.
29 */
30 public double dEdX(double energy)
31 {
32 double mip = 1.665; // this is an average mip
33 double de_dx = mip*_density; // MeV/cm
34 de_dx /= 1000.; // GeV/cm
35 return de_dx;
36 }
37
38 /**
39 *Return the uncertainty in the energy lost sigma(E).
40 *
41 * @param energy The energy of the particle.
42 * @param x The amount of material.
43 * @return The uncertainty in the energy lost sigma(E).
44 */
45 public double sigmaEnergy(double energy, double x)
46 {
47 final double pionMass = 0.13957;
48 double ZoverA = 0.5; // assume Z/A = 0.5
49 double sigma_e = 0.1569*ZoverA*_density*x;
50
51 // add relativistic correction
52 if(energy>pionMass)
53 {
54 double gamma = energy/pionMass;
55 double beta = Math.sqrt(gamma*gamma - 1)/gamma;
56 sigma_e *= (1-0.5*beta*beta)*gamma*gamma; // MeV^2
57 sigma_e = Math.sqrt(sigma_e)/1000; // GeV
58 }
59 return sigma_e;
60 }
61
62 /**
63 *Return new energy for a given path distance.
64 * Energy increases if x < 0.
65 *
66 * @param energy The energy of the particle.
67 * @param x The amount of material.
68 * @return New energy for a given path distance.
69 */
70 public double loseEnergy(double energy, double x)
71 {
72 double deltaE = dEdX(energy)*x;
73 return energy-deltaE;
74 }
75
76
77 /**
78 *output stream
79 *
80 * @return A String representation of this instance.
81 */
82 public String toString()
83 {
84 return "DeDxFixed with density "+_density;
85 }
86 }