1 added + 7 modified, total 8 files
lcsim/src/org/lcsim/contrib/seedtracker
diff -N SeedTrack.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ SeedTrack.java 22 Jun 2008 23:19:34 -0000 1.1
@@ -0,0 +1,64 @@
+/*
+ * SeedTrack.java
+ *
+ * Created on June 17, 2008, 11:34 AM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.lcsim.contrib.seedtracker;
+
+import org.lcsim.event.base.BaseTrack;
+
+/**
+ * SeedTrack extends the BaseTrack class to methods to access the strategy
+ * used for finding the track.
+ * @author Richard Partridge
+ * @version 1.0
+ */
+public class SeedTrack extends BaseTrack {
+ private SeedStrategy _strategy;
+ private SeedCandidate _seed;
+
+ /**
+ * Creates a new instance of SeedTrack.
+ */
+ public SeedTrack() {
+ super();
+ }
+
+ /**
+ * Set the strategy used for finding this track.
+ * @param strategy strategy used to find this track
+ */
+ public void setStratetgy(SeedStrategy strategy) {
+ _strategy = strategy;
+ return;
+ }
+
+ /**
+ * Return the strategy used to find this track.
+ * @return strategy used to find the track
+ */
+ public SeedStrategy getStrategy() {
+ return _strategy;
+ }
+
+ /**
+ * Store the SeedCandidate that this track was constructed from.
+ * @param seed seed candidate
+ */
+ public void setSeedCandidate(SeedCandidate seed) {
+ _seed = seed;
+ return;
+ }
+
+ /**
+ * Return the SeedCandidate that this track was constructed from.
+ * @return seed candidate
+ */
+ public SeedCandidate getSeedCandidate() {
+ return _seed;
+ }
+}
lcsim/src/org/lcsim/contrib/seedtracker
diff -u -r1.5 -r1.6
--- FindSeeds.java 6 May 2008 23:52:00 -0000 1.5
+++ FindSeeds.java 22 Jun 2008 23:19:34 -0000 1.6
@@ -56,7 +56,7 @@
int maxseeds = _hitmanager.getTrackerHits(seedlayerlist.get(0)).size() *
_hitmanager.getTrackerHits(seedlayerlist.get(1)).size() *
_hitmanager.getTrackerHits(seedlayerlist.get(2)).size();
-
+
for (HelicalTrackHit hit1 : _hitmanager.getTrackerHits(seedlayerlist.get(0))) {
double r1 = hit1.r();
double phi1 = hit1.phi();
lcsim/src/org/lcsim/contrib/seedtracker
diff -u -r1.9 -r1.10
--- HelixFitter.java 17 Jun 2008 00:41:35 -0000 1.9
+++ HelixFitter.java 22 Jun 2008 23:19:34 -0000 1.10
@@ -111,7 +111,6 @@
// Set the non-holonomic constraint chi square
_constrain.setConstraintChisq(strategy, _helix, hitlist);
-
boolean success = _helix.chisqtot() <= strategy.getMaxChisq();
if(diag!=null) diag.fireFitterFitMade(seed, _helix, _circlefit, _linefit, _zsegmentfit, _status, success);
return success;
lcsim/src/org/lcsim/contrib/seedtracker
diff -u -r1.6 -r1.7
--- HitManager.java 10 Jun 2008 19:36:10 -0000 1.6
+++ HitManager.java 22 Jun 2008 23:19:34 -0000 1.7
@@ -53,6 +53,8 @@
List<HelicalTrackHit> hitcol = (List<HelicalTrackHit>) event.get("HelicalTrackHits");
for (HelicalTrackHit hit : hitcol) {
String identifier = ID.Identifier(hit);
+ // Save identifier in the hit
+ hit.setLayerIdentifier(identifier);
if (!_hitlist.containsKey(identifier)) {
_hitlist.put(identifier, new ArrayList<HelicalTrackHit>());
_rmin.put(identifier,9999999.);
lcsim/src/org/lcsim/contrib/seedtracker
diff -u -r1.2 -r1.3
--- MakeTracks.java 14 Mar 2008 18:58:22 -0000 1.2
+++ MakeTracks.java 22 Jun 2008 23:19:34 -0000 1.3
@@ -10,7 +10,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.lcsim.event.base.BaseTrack;
import org.lcsim.event.EventHeader;
import org.lcsim.event.Track;
import org.lcsim.event.TrackerHit;
@@ -18,38 +17,73 @@
import org.lcsim.fit.helicaltrack.HelicalTrackHit;
/**
- *
+ * Create a list of SeedTracks from a list of SeedCandidates that have passed
+ * the SeedTracker algorithm and store these tracks back into the event.
* @author Richard Partridge
* @version 1.0
*/
public class MakeTracks {
- /** Creates a new instance of MakeTracks */
+ /**
+ * Creates a new instance of MakeTracks.
+ */
public MakeTracks() {
}
+ /**
+ * Process a list of SeedCandidates to make a list of SeedTracks and store
+ * these tracks back into the event.
+ * @param event event header
+ * @param seedlist list of SeedCandidates that are to be turned into tracks
+ * @param bfield magnetic field (used to turn curvature into momentum)
+ */
public void Process(EventHeader event, List<SeedCandidate> seedlist, double bfield) {
+
+ // Create a the track list
List<Track> tracks = new ArrayList<Track>();
+
+ // Initialize the reference point to the origin
double[] ref = new double[3];
ref[0] = 0.;
ref[1] = 0.;
ref[2] = 0.;
+
+ // Loop over the SeedCandidates that have survived
for (SeedCandidate trackseed : seedlist) {
- BaseTrack trk = new BaseTrack();
+
+ // Create a new SeedTrack (SeedTrack extends BaseTrack)
+ SeedTrack trk = new SeedTrack();
+
+ // Add the hits to the track
for (HelicalTrackHit hit : trackseed.getHits()) {
trk.addHit((TrackerHit) hit);
}
+
+ // Retrieve the helix and save the relevant bits of helix info
HelicalTrackFit helix = trackseed.getHelix();
- trk.setChisq(helix.chisqtot());
+ trk.setTrackParameters(helix.parameters(), bfield);
trk.setCovarianceMatrix(helix.covariance());
- trk.setFitSuccess(true);
+ trk.setChisq(helix.chisqtot());
trk.setNDF(helix.ndf()[0]+helix.ndf()[1]);
- trk.setRefPointIsDCA(true);
- trk.setTrackParameters(helix.parameters(), bfield);
+
+ // Flag that the fit was successful and set the reference point
+ trk.setFitSuccess(true);
trk.setReferencePoint(ref);
+ trk.setRefPointIsDCA(true);
+
+ // Set the strategy used to find this track
+ trk.setStratetgy(trackseed.getSeedStrategy());
+
+ // Set the SeedCandidate this track is based on
+ trk.setSeedCandidate(trackseed);
+
+ // Add the track to the list of tracks
tracks.add((Track) trk);
}
+
+ // Put the tracks back into the event and exit
event.put(event.TRACKS, tracks, Track.class, 0);
+
return;
}
-}
+}
\ No newline at end of file
lcsim/src/org/lcsim/contrib/seedtracker
diff -u -r1.6 -r1.7
--- MaterialManager.java 6 Jun 2008 00:24:41 -0000 1.6
+++ MaterialManager.java 22 Jun 2008 23:19:34 -0000 1.7
@@ -196,7 +196,7 @@
for (UniquePV pv : pvlist) {
ISolid solid = pv.getPV().getLogicalVolume().getSolid();
- vtot += safeCubicVolume(solid);
+ if (solid instanceof Tube) vtot += safeCubicVolume(solid);
}
return vtot;
lcsim/src/org/lcsim/contrib/seedtracker
diff -u -r1.7 -r1.8
--- MultipleScattering.java 27 May 2008 19:09:51 -0000 1.7
+++ MultipleScattering.java 22 Jun 2008 23:19:34 -0000 1.8
@@ -7,7 +7,9 @@
package org.lcsim.contrib.seedtracker;
+import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
+import hep.physics.vec.VecOp;
import java.util.ArrayList;
import java.util.HashMap;
@@ -167,7 +169,8 @@
if (s > scmin && s < scmax) {
Hep3Vector dir = _hutil.Direction(helix, s);
Hep3Vector pos = _hutil.PointOnHelix(helix, s);
- double cth = ( pos.x() * dir.x() + pos.y() * dir.y() ) / r;
+ Hep3Vector rhat = VecOp.unit(new BasicHep3Vector(pos.x(), pos.y(), 0.));
+ double cth = Math.abs(VecOp.dot(dir, rhat));
double radlen = cyl.ThicknessInRL() / Math.max(cth, 0.001);
double angle = msangle(helix.p(_bfield), radlen);
scatters.add(new ScatterAngle(s, angle));
lcsim/src/org/lcsim/contrib/seedtracker
diff -u -r1.5 -r1.6
--- SeedCandidate.java 14 Mar 2008 18:58:22 -0000 1.5
+++ SeedCandidate.java 22 Jun 2008 23:19:34 -0000 1.6
@@ -16,7 +16,8 @@
import org.lcsim.fit.helicaltrack.HelicalTrackHit;
/**
- * Candidate seed containing a list of hits that make up the SeedCandidate and the associated helix parameters
+ * The SeedCandidate class encapsulates information about a track seed as it
+ * progresses throught the SeedTracker track finding algorithm.
* @author Richard Partridge
* @version 1.0
*/
@@ -24,39 +25,46 @@
private List<HelicalTrackHit> _hits = new LinkedList<HelicalTrackHit>();
private HelicalTrackFit _helix;
+ private SeedStrategy _strategy;
+ /**
+ * Create an empty SeedCandidate.
+ */
public SeedCandidate() {
}
/**
- * Create a new SeedCandidate from a list of hits
- * @param trackerhits List of tracker hits for the SeedCandidate
+ * Create a new SeedCandidate from a list of hits.
+ * @param hits list of hits for this SeedCandidate
+ * @param strategy strategy used for this SeedCandidate
*/
- public SeedCandidate(List<HelicalTrackHit> hits) {
+ public SeedCandidate(List<HelicalTrackHit> hits, SeedStrategy strategy) {
_hits.addAll(hits);
+ _strategy = strategy;
}
/**
- * Create a new SeedCandidate from a list of hits and a helix
- * @param trackerhits List of TrackerHits for the SeedCandidate
+ * Create a new SeedCandidate from a list of hits and a helix.
+ * @param hits list of hits for this SeedCandidate
+ * @param strategy strategy used for this SeedCandidate
* @param helix HelicalTrackFit associated with the SeedCandidate
*/
- public SeedCandidate(List<HelicalTrackHit> hits, HelicalTrackFit helix) {
- this(hits);
+ public SeedCandidate(List<HelicalTrackHit> hits, SeedStrategy strategy, HelicalTrackFit helix) {
+ this(hits, strategy);
_helix = helix;
}
/**
- * Creates a clone of an existing instance of SeedCandidate
- * @param seed Existing SeedCandidate to be cloned
+ * Creates a clone of an existing instance of SeedCandidate.
+ * @param seed existing SeedCandidate to be cloned
*/
public SeedCandidate(SeedCandidate seed) {
- this(seed.getHits(), seed.getHelix());
+ this(seed.getHits(), seed.getSeedStrategy(), seed.getHelix());
}
/**
- * Assign a list of TrackerHits to the SeedCandidate
- * @param trackerhits List of TrackerHits for the SeedCandidate
+ * Assign a list of TrackerHits to the SeedCandidate.
+ * @param hits list of hits for this SeedCandidate
*/
public void setHits(List<HelicalTrackHit> hits) {
_hits.clear();
@@ -65,32 +73,54 @@
}
/**
- * Assign helix parameters to the SeedCandidate
- * @param helix HelicalTrackFit associated with the SeedCandidate
+ * Add a hit to the SeedCandidate.
+ * @param hit TrackerHit to be added to the SeedCandidate
*/
- public void setHelix(HelicalTrackFit helix) {
- _helix = helix;
+ public void addHit(HelicalTrackHit hit) {
+ if (!_hits.contains(hit)) _hits.add(hit);
return;
}
/**
- * Add a hit to the SeedCandidate
- * @param hit TrackerHit to be added to the SeedCandidate
+ * Return a list of hits associated with this SeedCandidate.
+ * @return list of hits
*/
- public void addHit(HelicalTrackHit hit) {
- _hits.add(hit);
+ public List<HelicalTrackHit> getHits() {
+ return _hits;
+ }
+
+ /**
+ * Set the SeedStrategy used to construct this SeedCandidate.
+ * @param strategy strategy used to construct this SeedCandidate
+ */
+
+ public void setStrategy(SeedStrategy strategy) {
+ _strategy = strategy;
return;
}
- public List<HelicalTrackHit> getHits() {
- return _hits;
+ /**
+ * Return the SeedStrategy used to construct this SeedCandidate.
+ * @return strategy used to construct this SeedCandidate
+ */
+ public SeedStrategy getSeedStrategy() {
+ return _strategy;
+ }
+
+ /**
+ * Associate a HelicalTrackFit with this SeedCandidate.
+ * @param helix helix for this SeedCandidate
+ */
+ public void setHelix(HelicalTrackFit helix) {
+ _helix = helix;
+ return;
}
/**
- * Return the HelicalTrackFit associated with the SeedCandidate
+ * Return the HelicalTrackFit associated with this SeedCandidate.
* @return HelicalTrackFit associated with the SeedCandidate
*/
public HelicalTrackFit getHelix() {
return _helix;
}
-}
+}
\ No newline at end of file
CVSspam 0.2.8