Commit in lcsim/src/org/lcsim/mc/CCDSim on MAIN
CCDCluster.java+15-21.2 -> 1.3
CCDClusterCenter.java+4-11.4 -> 1.5
FullCCDSimulation.java+32-261.9 -> 1.10
ReconstructedCCDHit.java+101.4 -> 1.5
+61-29
4 modified files
Improved hit error estimation (covariance matrix) for EC hits

lcsim/src/org/lcsim/mc/CCDSim
CCDCluster.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- CCDCluster.java	17 Feb 2007 02:00:18 -0000	1.2
+++ CCDCluster.java	15 Oct 2008 22:42:53 -0000	1.3
@@ -6,7 +6,7 @@
 /**
  * class for keeping information about cluster of active pixels.
  * @author sinev U of Oregon; SLAC x2970; [log in to unmask]
- * @version $Id: CCDCluster.java,v 1.2 2007/02/17 02:00:18 sinev Exp $
+ * @version $Id: CCDCluster.java,v 1.3 2008/10/15 22:42:53 sinev Exp $
  * @see CCD
  * @see CCDPixel
  * @see CCDClusterCenter
@@ -20,6 +20,10 @@
     private double CenDepth = 0.;
     private int totalAmp = 0;
     private int cluster_size = 0;
+    private int min_row =100000;
+    private int max_row =0;
+    private int min_col =100000;
+    private int max_col =0; 
     private ReconstructedCCDHit trhit = null;
    /**
     * constructor using CCD object as parameter
@@ -68,6 +72,11 @@
     public void addPixel(CCDPixel p)
     {
       int rn = p.getRowNumber();
+      if(rn < min_row) min_row = rn;
+      if(rn > max_row) max_row = rn;
+      int cn = p.getColumnNumber();
+      if(cn < min_col) min_col=cn;
+      if(cn > max_col) max_col=cn; 
       boolean newrow; 
       CCDActiveRow ar;
       newrow = true;
@@ -154,7 +163,11 @@
      * setting the value of the total cluster amplitude
      * @param ta sum of the signals (in ADC counts) from all of the pixels, composing this cluster 
      */
-    public void setTotalAmp(int ta) { totalAmp = ta; }   
+    public void setTotalAmp(int ta) { totalAmp = ta; }
+
+    public int getSizeX() { return max_col-min_col+1; }
+
+    public int getSizeY() { return max_row-min_row+1; }   
     
 }
 

lcsim/src/org/lcsim/mc/CCDSim
CCDClusterCenter.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- CCDClusterCenter.java	3 Mar 2007 02:45:58 -0000	1.4
+++ CCDClusterCenter.java	15 Oct 2008 22:42:53 -0000	1.5
@@ -6,7 +6,7 @@
  * class implementing algorithm of cluster center finding in CCD active pixels cluster.
  * Center finding algorithm is choosen from 3 currently implemented by setting Method parameter.
  * @author sinev ; U of Oregon; SLAC x2970; [log in to unmask]
- * @version $Id: CCDClusterCenter.java,v 1.4 2007/03/03 02:45:58 sinev Exp $
+ * @version $Id: CCDClusterCenter.java,v 1.5 2008/10/15 22:42:53 sinev Exp $
  * @see CCDCluster
  */
 public class CCDClusterCenter
@@ -166,6 +166,8 @@
       ReconstructedCCDHit th = makeTrackerHit(cls,parents,eloss);
       th.setADCCounts(totalAmp);
       th.setClusterSize(cls.getClusterSize());
+      th.setSizeX(cls.getSizeX());
+      th.setSizeY(cls.getSizeY());
 //      List<ClusterOfHits> rlop = th.getParents();
 //      int rnop = rlop.size();
 //      System.out.println("Built Reconstructed Hit has "+rnop+" parents");    
@@ -184,6 +186,7 @@
                 int type = 0;
 		CCD ccd;
 		double r=0.;
+               
 		
                 dedx=elos;
 		ccd = cl.getCCD();

lcsim/src/org/lcsim/mc/CCDSim
FullCCDSimulation.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- FullCCDSimulation.java	11 Oct 2008 00:06:53 -0000	1.9
+++ FullCCDSimulation.java	15 Oct 2008 22:42:53 -0000	1.10
@@ -31,7 +31,7 @@
  * objects, which emplement SimTrackerHit interface, so can be used instead
  * of original Simulated Tracker Hits generated by Geant4.  
  * @author sinev U of Oregon; SLAC x2970; [log in to unmask]
- * @version $Id: FullCCDSimulation.java,v 1.9 2008/10/11 00:06:53 sinev Exp $
+ * @version $Id: FullCCDSimulation.java,v 1.10 2008/10/15 22:42:53 sinev Exp $
  */
 public class FullCCDSimulation extends Driver
 {
@@ -374,35 +374,41 @@
              double[] point=sht.getPosition();
              double shr= Math.sqrt(point[0]*point[0]+point[1]*point[1]);
              double shp = Math.atan2(point[1],point[0]);
-             double tl = shr/Math.abs(point[2]);
-             int ti=0;
+             double tl1 = Math.abs(point[0]/point[2]);
+             double tl2 = Math.abs(point[1]/point[2]); 
+             int ti1=0;
+             int ti2=0;  
              for(int k=0; k<20; k++)
              {
-              if(_tangs[k]<tl) ti++;
-              if(_tangs[k]>tl) break; 
+              if(_tangs[k]<tl1) ti1++;
+              if(_tangs[k]<tl2) tl2++; 
              }
-             if(ti > 19) ti=19;
-             if(ti == 0) ti=1;
-             double re1 = _resalf[ti-1];
-             double re2 = _resalf[ti];
-             double slo = (re2-re1)/(_tangs[ti]-_tangs[ti-1]);
-             double over = tl-_tangs[ti-1];
+             if(ti1 > 19) ti1=19;
+             if(ti1 == 0) ti1=1;
+             if(ti2 > 19) ti2=19;
+             if(ti2 == 0) ti2=1;
+             double re1 = _resalf[ti1-1];
+             double re2 = _resalf[ti1];
+             double slo = (re2-re1)/(_tangs[ti1]-_tangs[ti1-1]);
+             double over = tl1-_tangs[ti1-1];
+             double resx = re1+over*slo;
+             re1 = _resalf[ti2-1];
+             re2 = _resalf[ti2];
+             slo = (re2-re1)/(_tangs[ti2]-_tangs[ti2-1]);
              double resy = re1+over*slo;
-             double resx = _rescrfp[0];
-             int npix = sht.getClusterSize();   
-             double[] V = new double[3];
-             V[0]=resx*npix;
-             V[1]=resy*npix;
-             V[2]=0.;
-             if(npix > 8)
-             {
-              double pszx = sp.getPixelSizeX() * 0.001;
-              double pszy = sp.getPixelSizeY() * 0.001;
-              double psz = Math.sqrt(pszx*pszx+pszy*pszy);
-              V[0]+=0.5*npix*psz;
-              V[1]+=0.5*npix*psz;
-             }   
-             double[] cm = _cmt.disk2Cart(V,point);
+             int npix = sht.getClusterSize();
+             int cszx = sht.getClusterSizeX()-3;
+             int cszy = sht.getClusterSizeY()-3;
+             if(cszx < 1) cszx=1;
+             if(cszy < 1) cszy=1;    
+             double[] cm = new double[6];
+             cm[0]=resx*cszx;
+             cm[2]=resy*cszy;
+             cm[1]=0.;
+             cm[3]=0.;
+             cm[4]=0.;
+             cm[5]=0.;   
+
              sht.setCovarianceMatrix(cm);
              ecsimhits.addElement((Object) sht);
             }

lcsim/src/org/lcsim/mc/CCDSim
ReconstructedCCDHit.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- ReconstructedCCDHit.java	17 Feb 2007 02:00:18 -0000	1.4
+++ ReconstructedCCDHit.java	15 Oct 2008 22:42:53 -0000	1.5
@@ -47,6 +47,8 @@
     int ADCcounts = 0;
     int layer = -1;
     List<RawTrackSegment> _parents = null;
+     int sizeX = 1;
+     int sizeY = 1;
 
     /**
      * constructor using hit position, energy loss and parent hit
@@ -138,5 +140,13 @@
  
      public void setClusterSize( int clsz) {npix=clsz;}
 
+     public void setSizeX( int sx) { sizeX=sx; }
+
+     public void setSizeY( int sy) { sizeY=sy; }
+
+     public int getClusterSizeX() { return sizeX; }
+
+     public int getClusterSizeY() { return sizeY; } 
+
 
 }
CVSspam 0.2.8