8 added + 4 modified, total 12 files
lcsim/src/org/lcsim/util/lcio
diff -N SIOTrackerPulse.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SIOTrackerPulse.java 4 Jun 2007 06:50:39 -0000 1.1
@@ -0,0 +1,73 @@
+package org.lcsim.util.lcio;
+
+import hep.lcd.io.sio.SIOInputStream;
+import hep.lcd.io.sio.SIOOutputStream;
+import hep.lcd.io.sio.SIORef;
+import java.io.IOException;
+import org.lcsim.event.TrackerData;
+import org.lcsim.event.TrackerPulse;
+
+class SIOTrackerPulse implements TrackerPulse
+{
+ private SIORef data;
+ private long cellid;
+ private double time;
+ private double charge;
+ private int quality;
+
+ SIOTrackerPulse(SIOInputStream in, int flags, int version) throws IOException
+ {
+ int cellid0 = in.readInt();
+ int cellid1 = 0;
+ if (LCIOUtil.bitTest(flags,LCIOConstants.TRAWBIT_ID1))
+ {
+ cellid1 = in.readInt();
+ }
+ this.cellid = ((long) cellid1)<<32 | cellid0;
+
+ time = in.readFloat();
+ charge = in.readFloat();
+ quality = in.readInt();
+ data = in.readPntr();
+ in.readPTag(this);
+ }
+ static void write(TrackerPulse hit, SIOOutputStream out, int flags) throws IOException
+ {
+ long cellid = hit.getCellID();
+ out.writeInt((int) cellid);
+ if (LCIOUtil.bitTest(flags,LCIOConstants.TRAWBIT_ID1))
+ {
+ out.writeInt((int) (cellid>>32));
+ }
+ out.writeFloat((float) hit.getTime());
+ out.writeFloat((float) hit.getCharge());
+ out.writeInt(hit.getQuality());
+ out.writePntr(hit.getTrackerData());
+ out.writePTag(hit);
+ }
+
+ public TrackerData getTrackerData()
+ {
+ return (TrackerData) data.getObject();
+ }
+
+ public long getCellID()
+ {
+ return cellid;
+ }
+
+ public double getTime()
+ {
+ return time;
+ }
+
+ public double getCharge()
+ {
+ return charge;
+ }
+
+ public int getQuality()
+ {
+ return quality;
+ }
+}
lcsim/src/org/lcsim/util/lcio
diff -N SIOTrackerPulseBlockHandler.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SIOTrackerPulseBlockHandler.java 4 Jun 2007 06:50:39 -0000 1.1
@@ -0,0 +1,26 @@
+package org.lcsim.util.lcio;
+
+import hep.lcd.io.sio.SIOInputStream;
+import hep.lcd.io.sio.SIOOutputStream;
+
+import java.io.IOException;
+import org.lcsim.event.TrackerPulse;
+
+/**
+ *
+ * @author tonyj
+ */
+class SIOTrackerPulseBlockHandler extends AbstractBlockHandler
+{
+ public String getType() { return "TrackerPulse"; }
+ public Class getClassForType() { return TrackerPulse.class; }
+ void addCollectionElements(LCIOEvent event, LCIOCollection collection, SIOInputStream in, int n, int version) throws IOException
+ {
+ for (int i = 0; i < n; i++)
+ collection.add(new SIOTrackerPulse(in, collection.getFlags(), version));
+ }
+ void writeCollectionElement(Object element, SIOOutputStream out, int flags) throws IOException
+ {
+ SIOTrackerPulse.write((TrackerPulse) element, out, flags);
+ }
+}
lcsim/src/org/lcsim/util/lcio
diff -N SIOTrackerData.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SIOTrackerData.java 4 Jun 2007 06:50:39 -0000 1.1
@@ -0,0 +1,71 @@
+package org.lcsim.util.lcio;
+
+import hep.lcd.io.sio.SIOInputStream;
+import hep.lcd.io.sio.SIOOutputStream;
+import java.io.IOException;
+import org.lcsim.event.TrackerData;
+
+class SIOTrackerData implements TrackerData
+{
+ private long cellid;
+ private double time;
+ private double[] chargeValues;
+
+ SIOTrackerData(SIOInputStream in, int flags, int version) throws IOException
+ {
+ int cellid0 = in.readInt();
+ int cellid1 = 0;
+ if (LCIOUtil.bitTest(flags,LCIOConstants.TRAWBIT_ID1))
+ {
+ cellid1 = in.readInt();
+ }
+ this.cellid = ((long) cellid1)<<32 | cellid0;
+
+ time = in.readFloat();
+ int n = in.readInt();
+ if (n > 0)
+ {
+ chargeValues = new double[n];
+ for (int i=0; i<n; i++) chargeValues[i] = in.readFloat();
+ }
+ in.readPTag(this);
+ }
+ static void write(TrackerData hit, SIOOutputStream out, int flags) throws IOException
+ {
+ long cellid = hit.getCellID();
+ out.writeInt((int) cellid);
+ if (LCIOUtil.bitTest(flags,LCIOConstants.TRAWBIT_ID1))
+ {
+ out.writeInt((int) (cellid>>32));
+ }
+ out.writeFloat((float) hit.getTime());
+ double[] c = hit.getChargeValues();
+ if (c == null)
+ {
+ out.writeInt(0);
+ }
+ else
+ {
+ out.writeInt(c.length);
+ for (int i=0; i<c.length; i++) out.writeFloat((float) c[i]);
+ }
+ out.writePTag(hit);
+ }
+
+
+ public long getCellID()
+ {
+ return cellid;
+ }
+
+ public double getTime()
+ {
+ return time;
+ }
+
+ public double[] getChargeValues()
+ {
+ return chargeValues;
+ }
+
+}
lcsim/src/org/lcsim/util/lcio
diff -N SIOTrackerDataBlockHandler.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SIOTrackerDataBlockHandler.java 4 Jun 2007 06:50:39 -0000 1.1
@@ -0,0 +1,26 @@
+package org.lcsim.util.lcio;
+
+import hep.lcd.io.sio.SIOInputStream;
+import hep.lcd.io.sio.SIOOutputStream;
+
+import java.io.IOException;
+import org.lcsim.event.TrackerData;
+
+/**
+ *
+ * @author tonyj
+ */
+class SIOTrackerDataBlockHandler extends AbstractBlockHandler
+{
+ public String getType() { return "TrackerData"; }
+ public Class getClassForType() { return TrackerData.class; }
+ void addCollectionElements(LCIOEvent event, LCIOCollection collection, SIOInputStream in, int n, int version) throws IOException
+ {
+ for (int i = 0; i < n; i++)
+ collection.add(new SIOTrackerData(in, collection.getFlags(), version));
+ }
+ void writeCollectionElement(Object element, SIOOutputStream out, int flags) throws IOException
+ {
+ SIOTrackerData.write((TrackerData) element, out, flags);
+ }
+}
lcsim/src/org/lcsim/util/lcio
diff -u -r1.11 -r1.12
--- HandlerManager.java 24 Oct 2006 19:01:49 -0000 1.11
+++ HandlerManager.java 4 Jun 2007 06:50:39 -0000 1.12
@@ -37,6 +37,8 @@
register(new SIOGenericObjectBlockHandler());
register(new SIOSiliconTrackerHitBlockHandler());
register(new SIORawTrackerHitBlockHandler());
+ register(new SIOTrackerDataBlockHandler());
+ register(new SIOTrackerPulseBlockHandler());
}
static HandlerManager instance()
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.7 -r1.8
--- LCIOConstants.java 23 Mar 2006 00:09:57 -0000 1.7
+++ LCIOConstants.java 4 Jun 2007 06:50:39 -0000 1.8
@@ -59,6 +59,9 @@
// raw data stored(1) - not stored(0)
int TPCBIT_NO_PTR = 30;
+ // cellid1 stored
+ int TRAWBIT_ID1 = 31;
+
// 1: pointer tag not added (needed for TrackerHit)
// LCRelation
// public const int LCREL_ONE2MANY = 31 ; // relation is one to many
lcsim/src/org/lcsim/event
diff -N TrackerData.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TrackerData.java 4 Jun 2007 06:50:40 -0000 1.1
@@ -0,0 +1,25 @@
+package org.lcsim.event;
+
+/** TrackerData contains the corrected (calibrated) raw tracker data.
+ * @see TrackerRawData
+ * @see TrackerPulse
+ *
+ * @author gaede
+ * @version $Id: TrackerData.java,v 1.1 2007/06/04 06:50:40 tonyj Exp $
+ */
+
+public interface TrackerData {
+
+ /** Returns the first detector specific (geometrical) cell id.
+ */
+ long getCellID();
+
+ /** Returns a time measurement associated with the adc values, e.g. the
+ * t0 of the spectrum for the TPC. Subdetector dependent.
+ */
+ double getTime();
+
+ /** The corrected (calibrated) FADC spectrum.
+ */
+ double[] getChargeValues();
+} // class or interface
lcsim/src/org/lcsim/event
diff -N TrackerPulse.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TrackerPulse.java 4 Jun 2007 06:50:40 -0000 1.1
@@ -0,0 +1,36 @@
+package org.lcsim.event;
+
+/** Tracker pulses as computed from TrackerData objects or as directly measured by a specific
+ * subdetector. Typically TrackerHIts are created from TrackerPulses by some sort of clustering.
+ * @see TrackerRawData
+ * @see TrackerData
+ *
+ * @author gaede
+ * @version $Id: TrackerPulse.java,v 1.1 2007/06/04 06:50:40 tonyj Exp $
+ */
+
+public interface TrackerPulse {
+
+ /** Returns the first detector specific (geometrical) cell id.
+ */
+ long getCellID();
+
+ /** The time of the pulse - arbitrary units.
+ */
+ double getTime();
+
+ /** The integrated charge of the pulse - arbitrary units.
+ */
+ double getCharge();
+
+ /** The quality bit flag of the pulse - check/set collection parameters
+ * TrackerPulseQualityNames and TrackerPulseQualityNamesValues.
+ */
+ int getQuality();
+
+ /** Optionally the TrackerData that has been used to create the pulse
+ * can be stored with the pulse - NULL if none. Check the quality bits for reason
+ * why the spectrum has been stored for the pulse.
+ */
+ TrackerData getTrackerData();
+} // class or interface
lcsim/src/org/lcsim/plugin/browser/sort
diff -u -r1.1 -r1.2
--- DefaultSortableTableModel.java 1 Jun 2007 23:58:58 -0000 1.1
+++ DefaultSortableTableModel.java 4 Jun 2007 06:50:40 -0000 1.2
@@ -11,7 +11,7 @@
/**
* Converts any TableModel to a SortableTableModel.
* @author Tony Johnson
- * @version $Id: DefaultSortableTableModel.java,v 1.1 2007/06/01 23:58:58 tonyj Exp $
+ * @version $Id: DefaultSortableTableModel.java,v 1.2 2007/06/04 06:50:40 tonyj Exp $
*/
public class DefaultSortableTableModel implements SortableTableModel
{
@@ -160,7 +160,7 @@
rowMap = new int[nRows+10]; // Leave a little room for expansion
for (int i=0; i<nRows; i++) rowMap[i] = i;
reverseMapValid = false;
- sort1(0,nRows);
+ if (sortColumn != UNSORTED) sort1(0,nRows);
TableModelEvent ee = new TableModelEvent(this,0,Integer.MAX_VALUE,TableModelEvent.ALL_COLUMNS);
fireTableChanged(ee);
}
lcsim/src/org/lcsim/plugin/browser
diff -N TrackerDataTableModel.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TrackerDataTableModel.java 4 Jun 2007 06:50:40 -0000 1.1
@@ -0,0 +1,18 @@
+package org.lcsim.plugin.browser;
+import org.lcsim.event.TrackerData;
+
+
+/**
+ *
+ * @author tonyj
+ */
+class TrackerDataTableModel extends GenericTableModel
+{
+ private static final String[] columns = {"CellID","Time","ChargeValues"};
+ private static Class klass = TrackerData.class;
+
+ TrackerDataTableModel()
+ {
+ super(klass,columns);
+ }
+}
lcsim/src/org/lcsim/plugin/browser
diff -N TrackerPulseTableModel.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ TrackerPulseTableModel.java 4 Jun 2007 06:50:40 -0000 1.1
@@ -0,0 +1,18 @@
+package org.lcsim.plugin.browser;
+import org.lcsim.event.TrackerPulse;
+
+
+/**
+ *
+ * @author tonyj
+ */
+class TrackerPulseTableModel extends GenericTableModel
+{
+ private static final String[] columns = {"CellID","Time","Charge","Quality"}; //,"TrackerData"};
+ private static Class klass = TrackerPulse.class;
+
+ TrackerPulseTableModel()
+ {
+ super(klass,columns);
+ }
+}
lcsim/src/org/lcsim/plugin/browser
diff -u -r1.10 -r1.11
--- LCSimEventBrowser.java 31 May 2007 00:27:55 -0000 1.10
+++ LCSimEventBrowser.java 4 Jun 2007 06:50:40 -0000 1.11
@@ -75,6 +75,8 @@
lookup.add(new ReconstructedParticleTableModel());
lookup.add(new LCGenericObjectTableModel());
lookup.add(new Hep3VectorTableModel());
+ lookup.add(new TrackerPulseTableModel());
+ lookup.add(new TrackerDataTableModel());
}
public LCSimEventBrowser(Studio app, SequentialRecordLoop loop)
CVSspam 0.2.8