1 added + 1 removed + 5 modified, total 7 files
lcsim
diff -u -r1.4 -r1.5
--- build.sh 22 Feb 2007 21:32:00 -0000 1.4
+++ build.sh 6 May 2007 07:20:44 -0000 1.5
@@ -3,39 +3,8 @@
#
# org.lcsim build on Unix or Cygwin
#
-
-# check for Maven installation
-maven_not_found=`which maven | grep -v "Command not found"`
-
-if [ -z "$maven_not_found" ]; then
-
- echo "ERROR: maven executable was not found."
-
- if [ -z "$MAVEN_HOME" ]; then
- echo "WARNING: MAVEN_HOME doesn't appear to be set."
- else
- echo "Trying adding MAVEN_HOME to the PATH."
- fi
-
- exit 1
-
-fi
-
-# maven cmd
-maven_run="maven"
-
-# COMMENT OUT to include tests
-maven_run=$maven_run" -Dmaven.test.skip=true"
-
-# COMMENT IN for (extremely) verbose debugging output
-#maven_run=$maven_run" -Dmaven.compile.compilerargs=-Xlint:unchecked -Dmaven.compile.fork=true"
-
-# final build target
-maven_run=$maven_run" jar:install jas:install eclipse"
-
-# OR ...
-# COMMENT OUT to NOT do JAS3 jar install into ~/.JAS3/extensions
-#maven_run=$maven_run" jas:install"
-
-echo $maven_run
-exec $maven_run
+export MAVEN_OPTS=-Xmx1024m
+#-Dmaven.test.skip=true
+maven -Dmaven.compile.compilerargs=-Xlint:unchecked -Dmaven.compile.fork=true jar:install eclipse
+#-Dmaven.test.skip=true
+#site
lcsim/src/org/lcsim/contrib/NickSinev/event/base
diff -u -r1.2 -r1.3
--- BaseSimTrackerHit.java 27 Apr 2007 01:10:23 -0000 1.2
+++ BaseSimTrackerHit.java 6 May 2007 07:20:44 -0000 1.3
@@ -61,4 +61,4 @@
public DetectorElement getDetectorElement() { return null; }
public void setDetectorElement(IDetectorElement de) { };
-}
\ No newline at end of file
+}
lcsim/src/org/lcsim/detector/driver
diff -u -r1.1 -r1.2
--- SimTrackerHitPositionalReadoutDriver.java 1 May 2007 23:36:37 -0000 1.1
+++ SimTrackerHitPositionalReadoutDriver.java 6 May 2007 07:20:44 -0000 1.2
@@ -37,7 +37,7 @@
{
IDetectorElement deSubdet = hit.getSubdetector().getDetectorElement();
DetectorElement deHit =
- (DetectorElement)deSubdet.findDetectorElement( new BasicHep3Vector( hit.getPoint() ) );
+ (DetectorElement)deSubdet.findDetectorElement( new BasicHep3Vector( hit.getPoint() ) );
hit.setDetectorElement( deHit );
Readout<SimTrackerHit> ro = (Readout<SimTrackerHit>)deHit.getReadout();
ro.addHit( hit );
@@ -45,4 +45,4 @@
}
}
}
-}
\ No newline at end of file
+}
lcsim/src/org/lcsim/event
diff -u -r1.10 -r1.11
--- SimTrackerHit.java 27 Apr 2007 01:10:23 -0000 1.10
+++ SimTrackerHit.java 6 May 2007 07:20:44 -0000 1.11
@@ -4,11 +4,14 @@
import org.lcsim.geometry.IDDecoder;
import org.lcsim.geometry.Subdetector;
+import org.lcsim.detector.IDetectorElementMixin;
+import org.lcsim.detector.identifier.IIdentifiable;
+
/**
- * @version $Id: SimTrackerHit.java,v 1.10 2007/04/27 01:10:23 jeremy Exp $
+ * @version $Id: SimTrackerHit.java,v 1.11 2007/05/06 07:20:44 jeremy Exp $
*/
-
public interface SimTrackerHit
+extends IDetectorElementMixin
{
/** Layer containing hit */
public int getLayer();
@@ -40,15 +43,4 @@
/** Using the IDDecoder, returns the Subdetector associated with this hit */
Subdetector getSubdetector();
-
- /**
- * Return the DetectorElement associated with this hit or <code>null</code>
- * if there is none.
- */
- IDetectorElement getDetectorElement();
-
- /**
- * Set the DetectorElement associated with this SimTrackerHit.
- */
- void setDetectorElement(IDetectorElement detectorElement);
}
lcsim/src/org/lcsim/util/lcio
diff -u -r1.7 -r1.8
--- SIOSimTrackerHit.java 27 Apr 2007 01:10:23 -0000 1.7
+++ SIOSimTrackerHit.java 6 May 2007 07:20:44 -0000 1.8
@@ -3,6 +3,9 @@
import hep.lcd.io.sio.SIOInputStream;
import hep.lcd.io.sio.SIOOutputStream;
import hep.lcd.io.sio.SIORef;
+import hep.physics.vec.BasicHep3Vector;
+import hep.physics.vec.Hep3Vector;
+import hep.physics.vec.VecOp;
import java.io.IOException;
@@ -13,9 +16,11 @@
import org.lcsim.geometry.IDDecoder;
import org.lcsim.geometry.Subdetector;
+import org.lcsim.detector.identifier.*;
+
/**
* @author Tony Johnson
- * @version $Id: SIOSimTrackerHit.java,v 1.7 2007/04/27 01:10:23 jeremy Exp $
+ * @version $Id: SIOSimTrackerHit.java,v 1.8 2007/05/06 07:20:44 jeremy Exp $
*/
class SIOSimTrackerHit implements SimTrackerHit
{
@@ -27,8 +32,14 @@
private Object particle;
private float pathLength;
LCMetaData meta;
+
IDetectorElement detectorElement;
+ IIdentifier compactId;
+ IExpandedIdentifier expId;
+ Hep3Vector startPoint;
+ Hep3Vector endPoint;
+
SIOSimTrackerHit(SIOInputStream in, int flags, int version, LCMetaData meta) throws IOException
{
this.meta = meta;
@@ -127,11 +138,64 @@
return getIDDecoder().getValue("layer");
}
+ public double[] getStartPoint()
+ {
+ if ( startPoint == null )
+ {
+ computePoints();
+ }
+ return startPoint.v();
+ }
+
+ public double[] getEndPoint()
+ {
+ if ( endPoint == null )
+ {
+ computePoints();
+ }
+ return endPoint.v();
+ }
+
+ private void computePoints()
+ {
+ Hep3Vector midpoint = new BasicHep3Vector(getPoint());
+ Hep3Vector direction = VecOp.unit(new BasicHep3Vector(getMomentum()));
+ Hep3Vector half_length = VecOp.mult(getPathLength()/2.0,direction);
+
+ startPoint = VecOp.add(midpoint,VecOp.mult(-1.0,half_length));
+ endPoint = VecOp.add(midpoint,half_length);
+ }
+
+/*
+ public IIdentifierHelper getIdentifierHelper()
+ {
+ return getSubdetector().getDetectorElement().getIdentifierHelper();
+ }
+
+ public IIdentifier getIdentifier()
+ {
+ if ( compactId == null )
+ {
+ compactId = new Identifier( getCellID() );
+ }
+ return compactId;
+ }
+
+ public IExpandedIdentifier getExpandedIdentifier()
+ {
+ if ( expId == null )
+ {
+ expId = getIdentifierHelper().unpack( getIdentifier() );
+ }
+ return expId;
+ }
+*/
+
public IDetectorElement getDetectorElement()
{
return detectorElement;
}
-
+
public void setDetectorElement(IDetectorElement detectorElement)
{
this.detectorElement = detectorElement;
lcsim/test/org/lcsim/detector/driver
diff -N SimTrackerHitIdentifierTest.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SimTrackerHitIdentifierTest.java 6 May 2007 07:20:44 -0000 1.1
@@ -0,0 +1,99 @@
+package org.lcsim.detector.driver;
+
+import java.util.List;
+
+import java.io.File;
+import java.net.URL;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.lcsim.util.cache.FileCache;
+import org.lcsim.util.loop.LCSimLoop;
+
+import org.lcsim.util.Driver;
+import org.lcsim.event.*;
+import org.lcsim.detector.identifier.*;
+
+import org.lcsim.geometry.IDDecoder;
+
+/**
+ * Checks whether the {@link org.lcsim.identifier} package
+ * can unpack the value from {@link org.lcsim.event.SimTrackerHit#getCellI}
+ * and get the same results as {@link org.lcsim.geometry.IDDecoder}
+ * on some {@link org.lcsim.event.SimTrackerHit} objects from SiTrackerBarrel00.
+ *
+ * @see org.lcsim.identifier
+ * @see org.lcsim.detector.identifier.IIdentifier
+ * @see org.lcsim.detector.identifier.IExpandedIdentifier
+ * @see org.lcsim.geometry.IDDecoder
+ * @see org.lcsim.detector.IDetectorElement
+ * @see org.lcsim.geometry.Subdetector
+ *
+ * @version $Id: SimTrackerHitIdentifierTest.java,v 1.1 2007/05/06 07:20:44 jeremy Exp $
+ * @author jeremym
+ */
+public class SimTrackerHitIdentifierTest
+extends TestCase
+{
+ public SimTrackerHitIdentifierTest(String testName)
+ {
+ super(testName);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(SimTrackerHitIdentifierTest.class);
+ }
+
+ public void testReadLcio() throws Exception
+ {
+ URL url =
+ new URL("http://www.lcsim.org/test/lcio/mu-_10GeV_10_SLIC_v2r1p7_geant4-v8r2p0_SiTrackerBarrelTest00.slcio");
+ FileCache cache = new FileCache();
+ File file = cache.getCachedFile(url);
+
+ LCSimLoop loop = new LCSimLoop();
+ loop.setLCIORecordSource(file);
+ loop.add( new SimTrackerHitPositionalReadoutDriver(
+ new String[] { "SiTrackerBarrel_RO" } ) );
+ loop.add( new TestDriver() );
+ loop.loop(2);
+ loop.dispose();
+ }
+
+ class TestDriver
+ extends Driver
+ {
+ protected void process( EventHeader event )
+ {
+ List<SimTrackerHit> collection = event.get( SimTrackerHit.class, "SiTrackerBarrel_RO" );
+ IDDecoder decoder = event.getMetaData( collection ).getIDDecoder();
+ IIdentifierHelper helper = decoder.getSubdetector().getDetectorElement().getIdentifierHelper();
+ for ( SimTrackerHit hit : collection )
+ {
+ // Setup the IDDecoder.
+ decoder.setID( hit.getCellID() );
+
+ // Create an Identifier from the CellID.
+ Identifier id = new Identifier( hit.getCellID() );
+
+ // Create an ExpandedIdentifier from the CellID.
+ IExpandedIdentifier exp = helper.unpack( id );
+
+ // Test that IDDecoder and ExpandedIdentifier have the same number of fields.
+ assertEquals( "IDs have different number of fields.", decoder.getFieldCount(), exp.size() );
+
+ // Check that the packed values are equal.
+ assertEquals( "Packed values not equal.", hit.getCellID(), (int)id.getValue() );
+
+ // Test that the IDDecoder and ExpandedIdentifier have the same values.
+ for ( int i=0; i<decoder.getFieldCount(); i++ )
+ {
+ assertEquals( "Field value <" + i + "> is different." + decoder.getFieldName( i ), decoder.getValue( i ), exp.getValue( i ) );
+ }
+ }
+ }
+ }
+}
lcsim/test/org/lcsim/detector/driver
diff -N SimTrackerHitIdHelperCheck.java
--- SimTrackerHitIdHelperCheck.java 4 May 2007 01:32:45 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,93 +0,0 @@
-package org.lcsim.detector.driver;
-
-import java.util.List;
-
-import java.io.File;
-import java.net.URL;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.lcsim.util.cache.FileCache;
-import org.lcsim.util.loop.LCSimLoop;
-
-import org.lcsim.util.Driver;
-import org.lcsim.event.*;
-import org.lcsim.detector.identifier.*;
-
-import org.lcsim.geometry.IDDecoder;
-
-/**
- * Checks whether the {@link org.lcsim.identifier} package
- * can unpack the value from {@link org.lcsim.event.SimTrackerHit#getCellI}
- * and get the same results as {@link org.lcsim.geometry.IDDecoder}
- * on some {@link org.lcsim.event.SimTrackerHit} objects from SiTrackerBarrel00.
- *
- * @see org.lcsim.identifier
- * @see org.lcsim.detector.identifier.IIdentifier
- * @see org.lcsim.detector.identifier.IExpandedIdentifier
- * @see org.lcsim.geometry.IDDecoder
- * @see org.lcsim.detector.IDetectorElement
- * @see org.lcsim.geometry.Subdetector
- *
- * @version $Id: SimTrackerHitIdHelperCheck.java,v 1.1 2007/05/04 01:32:45 jeremy Exp $
- * @author jeremym
- */
-public class SimTrackerHitIdHelperCheck
-extends TestCase
-{
- public SimTrackerHitIdHelperCheck(String testName)
- {
- super(testName);
- }
-
- public static Test suite()
- {
- return new TestSuite(SimTrackerHitIdHelperCheck.class);
- }
-
- public void testReadLcio() throws Exception
- {
- URL url =
- new URL("http://www.lcsim.org/test/lcio/mu-_10GeV_10_SLIC_v2r1p7_geant4-v8r2p0_SiTrackerBarrelTest00.slcio");
- FileCache cache = new FileCache();
- File file = cache.getCachedFile(url);
-
- LCSimLoop loop = new LCSimLoop();
- loop.setLCIORecordSource(file);
- loop.add( new SimTrackerHitPositionalReadoutDriver(
- new String[] { "SiTrackerBarrel_RO" } ) );
- loop.add( new TestDriver() );
- loop.loop(2);
- loop.dispose();
- }
-
- class TestDriver
- extends Driver
- {
- protected void process( EventHeader event )
- {
- List<SimTrackerHit> collection = event.get( SimTrackerHit.class, "SiTrackerBarrel_RO" );
- IDDecoder decoder = event.getMetaData( collection ).getIDDecoder();
- IIdentifierHelper helper = decoder.getSubdetector().getDetectorElement().getIdentifierHelper();
- for ( SimTrackerHit hit : collection )
- {
- // Setup the IDDecoder.
- decoder.setID( hit.getCellID() );
-
- // Create an ExpandedIdentifier.
- IExpandedIdentifier exp = helper.unpack( new Identifier( hit.getCellID() ) );
-
- // Check that both have the same number of fields.
- assertEquals( "IDs have different number of fields.", decoder.getFieldCount(), exp.size() );
-
- // Check that the ids have all the same values.
- for ( int i=0; i<decoder.getFieldCount(); i++ )
- {
- assertEquals( "Field value <" + i + "> is different." + decoder.getFieldName( i ), decoder.getValue( i ), exp.getValue( i ) );
- }
- }
- }
- }
-}
CVSspam 0.2.8