Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class HelicalTrackHitDriver extends org.lcsim.fit.helicaltrack.HelicalTra
private boolean allowHoleSlotCombo = false;

/**
* Default Ctor
* Default Constructor
*/
public HelicalTrackHitDriver() {
_crosser.setMaxSeparation(20.0);
Expand Down Expand Up @@ -272,6 +272,7 @@ public void process(EventHeader event) {
System.out.printf("%s: found %d SiTrackerHits\n", this.getClass().getSimpleName(), hitlist.size());
}
Map<HelicalTrackStrip, SiTrackerHitStrip1D> stripmap = new LinkedHashMap<HelicalTrackStrip, SiTrackerHitStrip1D>();
Map<HelicalTrackStrip, TrackerHit> oldstripmap = new LinkedHashMap<>();
for (SiTrackerHit hit : hitlist) {
//if (hit instanceof SiTrackerHitStrip1D) {
// Cast the hit as a 1D strip hit and find the
Expand Down Expand Up @@ -301,6 +302,7 @@ public void process(EventHeader event) {
// Map a reference back to the hit needed to create
// the stereo hit LC relations
stripmap.put(strip, h);
oldstripmap.put(strip,(TrackerHit)hit);
if (_debug) {
System.out.printf("%s: added strip org %s layer %d\n", this.getClass().getSimpleName(), strip.origin().toString(), strip.layer());
}
Expand Down Expand Up @@ -358,7 +360,7 @@ public void process(EventHeader event) {
}
}
for (HelicalTrackStrip strip : cross.getStrips()) {
hitrelations.add(new MyLCRelation(cross, stripmap.get(strip)));
hitrelations.add(new MyLCRelation(cross, oldstripmap.get(strip)));
}
if (_debug) {
System.out.printf("%s: cross at %.2f,%.2f,%.2f \n", this.getClass().getSimpleName(), cross.getPosition()[0], cross.getPosition()[1], cross.getPosition()[2]);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package org.hps.recon.tracking;

import java.io.File;
import java.net.URL;
import junit.framework.TestCase;
import org.hps.conditions.database.DatabaseConditionsManager;
import org.hps.detector.svt.SvtDetectorSetup;
import org.lcsim.recon.tracking.digitization.sisim.config.RawTrackerHitSensorSetup;
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.loop.LCIODriver;
import org.lcsim.util.loop.LCSimLoop;

/**
*
* @author ngraf
*/
public class HelicalTrackHitDriverTest extends TestCase {

static final String testFileName = "hps_010022.evio.00000-0-10.slcio";

public void testIt() throws Exception {

URL testURL = new URL("http://www.lcsim.org/test/hps-java/hps_010022.evio.00000-0-10.slcio");
FileCache cache = new FileCache();
File lcioInputFile = cache.getCachedFile(testURL);

final DatabaseConditionsManager manager = DatabaseConditionsManager.getInstance();
manager.addConditionsListener(new SvtDetectorSetup());

//File lcioInputFile = TestUtil.downloadTestFile("hps_010022.evio.00000-0-10.slcio");
LCSimLoop loop = new LCSimLoop();
loop.setLCIORecordSource(lcioInputFile);

RawTrackerHitSensorSetup d1 = new RawTrackerHitSensorSetup();
d1.setReadoutCollections(new String[]{"SVTRawTrackerHits"});

RawTrackerHitFitterDriver d2 = new RawTrackerHitFitterDriver();
d2.setFitAlgorithm("Pileup");
d2.setUseTimestamps(false);
d2.setCorrectTimeOffset(true);
d2.setCorrectT0Shift(false);
d2.setUseTruthTime(false);
d2.setSubtractTOF(true);
d2.setSubtractTriggerTime(true);
d2.setCorrectChanT0(false);
d2.setDebug(false);

DataTrackerHitDriver d3 = new DataTrackerHitDriver();
d3.setNeighborDeltaT(8.0);
d3.setDebug(false);

HelicalTrackHitDriver d4 = new HelicalTrackHitDriver();
d4.setClusterTimeCut(40.0);
d4.setClusterAmplitudeCut(400.0);
d4.setMaxDt(20.0);
d4.setSaveAxialHits(false);
d4.setDebug(true);

loop.add(d1);
loop.add(d2);
loop.add(d3);
loop.add(d4);
loop.add(new LCIODriver("test.slcio"));
loop.loop(1);
loop.dispose();
}
}