4 modified files
lcsim/src/org/lcsim/event
diff -u -r1.11 -r1.12
--- CalorimeterHit.java 17 Mar 2009 22:45:44 -0000 1.11
+++ CalorimeterHit.java 4 May 2010 17:48:24 -0000 1.12
@@ -8,7 +8,7 @@
* @see org.lcsim.event.Hit
* @author tonyj
* @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: CalorimeterHit.java,v 1.11 2009/03/17 22:45:44 jeremy Exp $
+ * @version $Id: CalorimeterHit.java,v 1.12 2010/05/04 17:48:24 ngraf Exp $
*/
public interface CalorimeterHit
extends HitWithPosition
@@ -19,7 +19,7 @@
public double getRawEnergy();
/**
- * Corrected energy deposted in calorimeter cell.
+ * Corrected energy deposited in calorimeter cell.
*/
public double getCorrectedEnergy();
@@ -42,4 +42,12 @@
* the hit position from the hit ID.
*/
public double[] getPosition();
+
+ /**
+ * The type of the hit.
+ * Mapping of integer types to type names through collection parameters
+ * "CalorimeterHitTypeNames" and "CalorimeterHitTypeValues".
+ * @return
+ */
+ public int getType();
}
\ No newline at end of file
lcsim/src/org/lcsim/event/base
diff -u -r1.8 -r1.9
--- BaseCalorimeterHit.java 30 Mar 2009 19:34:59 -0000 1.8
+++ BaseCalorimeterHit.java 4 May 2010 17:48:24 -0000 1.9
@@ -21,6 +21,7 @@
protected Hep3Vector positionVec;
protected double time;
protected long id;
+ protected int type;
private static final double UNSET_CORRECTED_ENERGY = -1;
@@ -29,6 +30,11 @@
return time;
}
+ public int getType()
+ {
+ return type;
+ }
+
public double getRawEnergy()
{
return rawEnergy;
lcsim/test/org/lcsim/util/lcio
diff -u -r1.4 -r1.5
--- CalorimeterHitIOTest.java 23 May 2008 03:12:10 -0000 1.4
+++ CalorimeterHitIOTest.java 4 May 2010 17:48:24 -0000 1.5
@@ -19,14 +19,15 @@
* to a file, read back in, and checked for correctness.
*
* @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: CalorimeterHitIOTest.java,v 1.4 2008/05/23 03:12:10 jeremy Exp $
+ * @version $Id: CalorimeterHitIOTest.java,v 1.5 2010/05/04 17:48:24 ngraf Exp $
*/
public class CalorimeterHitIOTest extends TestCase
{
public void testCalorimeterHitIO() throws IOException
{
+ System.out.println("hi");
// Create an empty event.
- EventHeader event = new BaseLCSimEvent(0,0,"sdjan03");
+ EventHeader event = new BaseLCSimEvent(0,0,"sidloi");
// Create a list of test flags, all permutations of 4 settings for 16 total.
List<Integer> testFlags = makeTestFlags();
@@ -114,6 +115,7 @@
{
assertEquals("time should be zero", hit.getTime(), 0.0);
}
+ assertEquals(hit.getType(), 137);
}
}
}
@@ -176,7 +178,9 @@
this.id = Long.parseLong("800000001",16);
this.position = new double[] {1.0,2.0,3.0};
this.rawEnergy = 10.0;
+ this.corrEnergy = 100.;
this.time = 1.1;
+ this.type = 137;
}
}
}
\ No newline at end of file
lcsim/src/org/lcsim/util/lcio
diff -u -r1.10 -r1.11
--- SIOCalorimeterHit.java 23 May 2008 03:12:10 -0000 1.10
+++ SIOCalorimeterHit.java 4 May 2010 17:48:24 -0000 1.11
@@ -12,7 +12,7 @@
* SIO-based I/O implementation of the CalorimeterHit interface
*
* @author Guilherme Lima
- * @version $Id: SIOCalorimeterHit.java,v 1.10 2008/05/23 03:12:10 jeremy Exp $
+ * @version $Id: SIOCalorimeterHit.java,v 1.11 2010/05/04 17:48:24 ngraf Exp $
*/
class SIOCalorimeterHit extends BaseCalorimeterHit
{
@@ -41,7 +41,7 @@
if( version > 1002)
{
- int type = in.readInt() ;
+ type = in.readInt() ;
Object tempHit = in.readPntr();
// the logic has been reverted in v1.3 !
@@ -80,9 +80,7 @@
out.writeFloat((float) pos[2]);
}
- // FIXME: No type in java CalorimeterHit... write out zero instead,
- // otherwise output fsile will be corrupted
- out.writeInt( 0 );
+ out.writeInt( hit.getType() );
// FIXME: Java CalorimeterHit interface does not support getRawHit()
if(!LCIOUtil.bitTest(flags,LCIOConstants.RCHBIT_NO_PTR)) {
CVSspam 0.2.8