java/trunk/hps-java/src/main/java/org/lcsim/hps/recon/tracking
--- java/trunk/hps-java/src/main/java/org/lcsim/hps/recon/tracking/HPSRawTrackerHitFitterDriver.java 2014-03-26 03:00:05 UTC (rev 364)
+++ java/trunk/hps-java/src/main/java/org/lcsim/hps/recon/tracking/HPSRawTrackerHitFitterDriver.java 2014-03-26 03:07:43 UTC (rev 365)
@@ -5,9 +5,7 @@
import org.lcsim.detector.tracker.silicon.SiSensor;
import org.lcsim.event.EventHeader;
-import org.lcsim.event.MCParticle;
import org.lcsim.event.RawTrackerHit;
-import org.lcsim.event.SimTrackerHit;
import org.lcsim.hps.readout.ecal.ReadoutTimestamp;
import org.lcsim.hps.recon.tracking.HPSSVTCalibrationConstants.ChannelConstants;
import org.lcsim.util.Driver;
@@ -28,6 +26,7 @@
private int relationFlags = 0;
private boolean correctT0Shift = false;
private boolean useTimestamps = false;
+ private boolean useTruthTime = false;
public void setDebug(boolean debug) {
this.debug = debug;
@@ -41,6 +40,15 @@
this.useTimestamps = useTimestamps;
}
+ /**
+ * Report time relative to the nearest expected truth event time.
+ *
+ * @param useTruthTime
+ */
+ public void setUseTruthTime(boolean useTruthTime) {
+ this.useTruthTime = useTruthTime;
+ }
+
public void setFitAlgorithm(String fitAlgorithm) {
if (fitAlgorithm.equals("Analytic")) {
_shaper = new HPSShaperAnalyticFitAlgorithm();
@@ -88,16 +96,20 @@
ChannelConstants constants = HPSSVTCalibrationConstants.getChannelConstants((SiSensor) hit.getDetectorElement(), strip);
HPSShapeFitParameters fit = _shaper.fitShape(hit, constants);
if (correctT0Shift) {
- double corMod = 0;
- if (useTimestamps) {
- double t0Svt = ReadoutTimestamp.getTimestamp(ReadoutTimestamp.SYSTEM_TRACKER, event);
- double t0Trig = ReadoutTimestamp.getTimestamp(ReadoutTimestamp.SYSTEM_TRIGGER, event);
- corMod += (t0Svt - t0Trig);
- }
- corMod -= constants.getT0Shift();
+ fit.setT0(fit.getT0() - constants.getT0Shift());
+ }
+ if (useTimestamps) {
+ double t0Svt = ReadoutTimestamp.getTimestamp(ReadoutTimestamp.SYSTEM_TRACKER, event);
+ double t0Trig = ReadoutTimestamp.getTimestamp(ReadoutTimestamp.SYSTEM_TRIGGER, event);
+ double corMod = (t0Svt - t0Trig);
fit.setT0(fit.getT0() + corMod);
-// fit.setT0(fit.getT0() - constants.getT0Shift());
+ }
+ if (useTruthTime) {
+ double t0Svt = ReadoutTimestamp.getTimestamp(ReadoutTimestamp.SYSTEM_TRACKER, event);
+ double absoluteHitTime = fit.getT0() + t0Svt;
+ double relativeHitTime = ((absoluteHitTime + 250.0) % 500.0) - 250.0;
+ fit.setT0(relativeHitTime);
}
if (debug) {
System.out.println(fit);
java/trunk/hps-java/src/main/resources/org/lcsim/hps/steering/recon
--- java/trunk/hps-java/src/main/resources/org/lcsim/hps/steering/recon/HPS2014OfflineRecon.lcsim 2014-03-26 03:00:05 UTC (rev 364)
+++ java/trunk/hps-java/src/main/resources/org/lcsim/hps/steering/recon/HPS2014OfflineRecon.lcsim 2014-03-26 03:07:43 UTC (rev 365)
@@ -30,11 +30,12 @@
<fitAlgorithm>Analytic</fitAlgorithm>
<useTimestamps>true</useTimestamps>
<correctT0Shift>true</correctT0Shift>
+ <useTruthTime>false</useTruthTime>
</driver>
<driver name="TrackerHitDriver" type="org.lcsim.hps.recon.tracking.DataTrackerHitDriver" />
<driver name="HelicalTrackHitDriver" type="org.lcsim.hps.recon.tracking.HelicalTrackHitDriver">
<debug>false</debug>
- <clusterTimeCut>4.0</clusterTimeCut>
+ <clusterTimeCut>8.0</clusterTimeCut>
<maxSeperation>20.0</maxSeperation>
<tolerance>1.0</tolerance>
</driver>
@@ -43,6 +44,7 @@
</driver>
<driver name="EcalRawConverter" type="org.lcsim.hps.recon.ecal.EcalRawConverterDriver">
<ecalCollectionName>EcalCalHits</ecalCollectionName>
+ <use2014Gain>true</use2014Gain>
</driver>
<driver name="EcalClusterer" type="org.lcsim.hps.recon.ecal.EcalClusterer">
<ecalName>Ecal</ecalName>