lcsim/src/org/lcsim/recon/util
diff -u -r1.2 -r1.3
--- CalorimeterInformation.java 3 Feb 2010 19:44:40 -0000 1.2
+++ CalorimeterInformation.java 4 Feb 2010 21:09:37 -0000 1.3
@@ -10,10 +10,14 @@
import org.lcsim.geometry.IDDecoder;
import org.lcsim.geometry.layer.Layer;
import org.lcsim.geometry.layer.LayerSlice;
-import org.lcsim.material.Material;
+import org.lcsim.detector.material.IMaterial;
+import org.lcsim.detector.material.BetheBlochCalculator;
+import org.lcsim.detector.material.MaterialStore;
+import org.lcsim.detector.material.IMaterialStore;
import org.lcsim.geometry.compact.Subdetector;
import org.lcsim.geometry.subdetector.*;
-import org.lcsim.util.step.DeDx;
+import hep.physics.vec.Hep3Vector;
+import hep.physics.vec.BasicHep3Vector;
public class CalorimeterInformation
{
@@ -37,7 +41,8 @@
private List[] nlam;
private Map<Calorimeter.CalorimeterType,Integer> indexmap;
private int index;
- private DeDx materialDatabase;
+ private BetheBlochCalculator bbc;
+ private IMaterialStore ms;
public CalorimeterInformation()
{
theCalorimeterInformation = this;
@@ -52,7 +57,8 @@
*/
protected void init(Detector d)
{
- materialDatabase = DeDx.instance();
+ bbc = new BetheBlochCalculator();
+ ms = MaterialStore.getInstance();
sublist = new ArrayList<Subdetector>();
for(Subdetector s:d.getSubdetectors().values())
{
@@ -86,6 +92,8 @@
nrad = new List[ncal];
nlam = new List[ncal];
indexmap = new HashMap<Calorimeter.CalorimeterType,Integer>();
+ Hep3Vector p = new BasicHep3Vector(0.,0.,100.);
+ Map<String,Double> dedxmap = new HashMap<String,Double>();
for(int i=0;i<ncal;i++)
{
Subdetector s = sublist.get(i);
@@ -110,15 +118,22 @@
double xde = 0.;
for(LayerSlice slice:layer.getSlices())
{
- Material m = slice.getMaterial();
+ IMaterial m = ms.get(slice.getMaterial().getName());
+ double dedx;
+ if(dedxmap.containsKey(slice.getMaterial().getName()))dedx = dedxmap.get(slice.getMaterial().getName()).doubleValue();
+ else
+ {
+ dedx = bbc.computeBetheBloch(m, p, 105., 1., .01)/10000.;
+ dedxmap.put(slice.getMaterial().getName(),new Double(dedx));
+ }
double dx = slice.getThickness();
xrad += dx/m.getRadiationLengthWithDensity();
xlam += dx/m.getNuclearInteractionLengthWithDensity();
- xde += dx*materialDatabase.getDeDx(m.getName());
+ xde += dx*dedx;
}
nrad[i].add(new Double(xrad/10.));
nlam[i].add(new Double(xlam/10.));
- de[i].add(new Double(xde/10.));
+ de[i].add(new Double(xde));
}
if(s.isBarrel())
{