Print

Print


Commit in GeomConverter/src/org/lcsim/geometry/subdetector/tracker/silicon on MAIN
Box.java+67added 1.1
SiTrackerModule.java+41added 1.1
SiTrackerBarrelLayer.java+127added 1.1
Solid.java+24added 1.1
Component.java+43added 1.1
+302
5 added files
Classes for representation of SiTrackerBarrel components

GeomConverter/src/org/lcsim/geometry/subdetector/tracker/silicon
Box.java added at 1.1
diff -N Box.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Box.java	10 Oct 2006 21:58:06 -0000	1.1
@@ -0,0 +1,67 @@
+/*
+ * Box.java
+ *
+ * Created on October 6, 2006, 4:41 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.lcsim.geometry.subdetector.tracker.silicon;
+
+/**
+ *
+ * @author tknelson
+ */
+public class Box implements Solid
+{
+    
+    // Fields
+    //=======
+    private double _dimensions[] = {0.0,0.0,0.0};
+    // private CoordinateTransformation3D _coordinates = new CoordinateTransformation3D();
+    
+    /** Creates a new instance of Box */
+    public Box()
+    {
+    }
+    
+    public Box(double[] dimensions)
+    {
+        _dimensions = dimensions;
+    }
+    
+    public Box(double x, double y, double z)
+    {
+        _dimensions[0] = x;
+        _dimensions[1] = y;
+        _dimensions[2] = z;
+    }
+    
+//    public Box(double[] dimensions, CoordinateTransformation3D coordinates)
+//    {
+//        _dimensions = dimensions;
+//        _coordinates = coordinates;
+//    }
+        
+    // Public methods
+    //===============
+    public double[] getDimensions()
+    {
+        return _dimensions;
+    }
+    
+    public double getVolume()
+    {
+        double volume = 1.0;
+        for (int i = 0; i < 3; i++) volume *= _dimensions[i];
+        return volume;
+    }
+    
+//    public SpacePoint3D local_position(SpacePoint3D global_position)
+//    {
+//        return _coordinates.transform(global_position);
+//    }
+    
+    
+}

GeomConverter/src/org/lcsim/geometry/subdetector/tracker/silicon
SiTrackerModule.java added at 1.1
diff -N SiTrackerModule.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SiTrackerModule.java	10 Oct 2006 21:58:07 -0000	1.1
@@ -0,0 +1,41 @@
+/*
+ * SiTrackerModule.java
+ *
+ * Created on October 6, 2006, 4:06 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.lcsim.geometry.subdetector.tracker.silicon;
+
+import java.util.*;
+
+/**
+ *
+ * @author tknelson
+ */
+public class SiTrackerModule
+{
+    
+    private Box _envelope = new Box();
+    private List<Component> _components = new ArrayList<Component>();
+    
+    /** Creates a new instance of SiTrackerModule */
+    public SiTrackerModule()
+    {
+    }
+    
+    public SiTrackerModule(Box envelope)
+    {
+        _envelope = envelope;
+    }
+    
+    // Setters
+    public void addComponent(Component component)
+    {
+        _components.add(component);
+    }
+    
+    
+}

GeomConverter/src/org/lcsim/geometry/subdetector/tracker/silicon
SiTrackerBarrelLayer.java added at 1.1
diff -N SiTrackerBarrelLayer.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SiTrackerBarrelLayer.java	10 Oct 2006 21:58:07 -0000	1.1
@@ -0,0 +1,127 @@
+/*
+ * SiTrackerBarrelLayer.java
+ *
+ * Created on October 6, 2006, 2:01 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.lcsim.geometry.subdetector.tracker.silicon;
+
+/**
+ *
+ * @author tknelson
+ */
+public class SiTrackerBarrelLayer
+{
+    
+    // Fields
+    //========
+    
+    // layer envelope
+    //---------------
+    private double _r_inner = 0.0;
+    private double _r_outer = 0.0;
+    private double _z_length = 0.0;
+    
+    // module layout
+    //--------------
+    
+    // module
+    private SiTrackerModule _module;
+    
+    // phi
+    private double _r_center = 0.0;
+    private int _n_phi = 0;
+    private double _phi_0 = 0.0;
+    private double _phi_tilt = 0.0;
+    private double _dr_phi = 0.0;
+    
+    // z
+    private int _n_z;
+    private double _z_0 = 0.0;
+    private double _dr_z = 0.0;
+    
+    // Constructors
+    //=============
+    public SiTrackerBarrelLayer()
+    {
+    }
+    
+    public SiTrackerBarrelLayer(double r_inner, double r_outer, double z_length)
+    {
+        _r_inner = r_inner;
+        _r_outer = r_outer;
+        _z_length = z_length;
+    }
+    
+    // Initializers
+    //=============
+    public void setPhiLayout(double r_center, int n_phi, double phi_0, double phi_tilt, double dr_phi)
+    {
+        _r_center = r_center;
+        _n_phi = n_phi;
+        _phi_0 = phi_0;
+        _phi_tilt = phi_tilt;
+        _dr_phi = dr_phi;
+    }
+    
+    public void setZLayout(int n_z, double z_0, double dr_z)
+    {
+        _n_z = n_z;
+        _z_0 = z_0;
+        _dr_z = dr_z;
+    }
+    
+    public void setModule(SiTrackerModule module)
+    {
+        _module = module;
+    }
+    
+    // Public methods
+    //===============
+    
+    public int getNModules()
+    {
+        return _n_phi * _n_z;
+    }
+    
+    public int getPhiModuleIndex(double phi)
+    {
+        double phi_slice_size = 2.0*Math.PI/_n_phi;
+        double relative_phi_position = phi - _phi_0;
+        int phi_index = (int)Math.round(relative_phi_position/phi_slice_size);
+        return checkedPhiIndex(phi_index);
+    }
+    
+    public int getZModuleIndex(double z)
+    {
+        double z_slice_size = 2.0*_z_0 / (_n_z - 1);
+        double relative_z_position = z - _z_0;
+        int z_index = (int)Math.round(relative_z_position/z_slice_size);
+        return checkedZIndex(z_index);
+    }    
+    
+//    public CoordinateTransformation3D getModuleCoordinates(int phi_index, int z_index)
+//    {
+//        
+//    }
+    
+    // Private methods
+    //================
+    private int checkedPhiIndex(int phi_index)
+    {
+        while (phi_index < 0) phi_index += _n_phi;
+        while (phi_index >= _n_phi) phi_index -= _n_phi;
+        return phi_index;
+    }
+    
+    private int checkedZIndex(int z_index)
+    {
+        if (z_index < 0) z_index = 0;
+        if (z_index > _n_z) z_index = _n_z;
+        return z_index;
+    }
+    
+}

GeomConverter/src/org/lcsim/geometry/subdetector/tracker/silicon
Solid.java added at 1.1
diff -N Solid.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Solid.java	10 Oct 2006 21:58:07 -0000	1.1
@@ -0,0 +1,24 @@
+/*
+ * Solid.java
+ *
+ * Created on October 9, 2006, 3:44 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.lcsim.geometry.subdetector.tracker.silicon;
+
+/**
+ *
+ * @author tknelson
+ */
+public interface Solid
+{
+    // Return dimensions
+    public double[] getDimensions();
+    
+    // Calculate volume
+    public double getVolume();
+ 
+}

GeomConverter/src/org/lcsim/geometry/subdetector/tracker/silicon
Component.java added at 1.1
diff -N Component.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Component.java	10 Oct 2006 21:58:07 -0000	1.1
@@ -0,0 +1,43 @@
+/*
+ * Component.java
+ *
+ * Created on October 9, 2006, 3:15 PM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.lcsim.geometry.subdetector.tracker.silicon;
+
+import org.lcsim.material.Material;
+import org.lcsim.material.MaterialManager;
+
+/**
+ *
+ * @author tknelson
+ */
+public class Component
+{
+    
+    // Fields
+    Material _material = MaterialManager.getMaterial("Air");
+    Solid _solid = new Box();
+    
+    /** Creates a new instance of Component */
+    public Component()
+    {
+    }
+    
+    public Component(Solid solid, Material material)
+    {
+        _solid = solid;
+        _material = material;
+    }
+    
+    // Accessors
+    public Material getMaterial()
+    {
+        return _material;
+    }
+    
+}
CVSspam 0.2.8