Commit in hps-java/src/main/java/org/lcsim/hps on MAIN | |||
users/phansson/ecalGainAna.java | +2 | -2 | 1.4 -> 1.5 |
/ECalGainDriver.java | +9 | -2 | 1.5 -> 1.6 |
recon/tracking/EcalTrackMatch.java | +82 | -75 | 1.1 -> 1.2 |
/TrackUtils.java | +5 | -5 | 1.3 -> 1.4 |
users/omoreno/ExtendTrack.java | +6 | -6 | 1.3 -> 1.4 |
+104 | -90 |
use Track or BaseTrack instead of SeedTrack when possible
diff -u -r1.4 -r1.5 --- ecalGainAna.java 24 Aug 2012 01:02:54 -0000 1.4 +++ ecalGainAna.java 27 Aug 2012 20:02:04 -0000 1.5 @@ -199,7 +199,7 @@
throw new RuntimeException(e); }
- int minCount = 10;
+ int minCount = 50;
gainStream.format("#x\ty\tgain\n"); for (int x = -23; x <= 23; x++) {
@@ -213,7 +213,7 @@
if (peSim.allEntries() >= minCount && peReal.allEntries() >= minCount) { gain *= (peSim.mean() / peReal.mean()); } else if (peHVSim.allEntries() >= minCount && peHVReal.allEntries() >= minCount) {
- gain *= (peHVSim.mean() / peHVReal.mean());
+// gain *= (peHVSim.mean() / peHVReal.mean());
} gainStream.format("%d\t%d\t%f\n", x, y, gain); ecalPlot.fill(x, y, gain);
diff -u -r1.5 -r1.6 --- ECalGainDriver.java 14 Aug 2012 22:35:00 -0000 1.5 +++ ECalGainDriver.java 27 Aug 2012 20:02:04 -0000 1.6 @@ -15,6 +15,7 @@
import org.lcsim.event.CalorimeterHit; import org.lcsim.event.EventHeader; import org.lcsim.event.Track;
+import org.lcsim.event.base.BaseTrack;
import org.lcsim.geometry.Detector; import org.lcsim.hps.monitoring.AIDAFrame; import org.lcsim.hps.monitoring.Redrawable;
@@ -184,11 +185,12 @@
} public ECalGainDriver() {
- trkMatchTool = new EcalTrackMatch(false);
+ trkMatchTool = new EcalTrackMatch(debug);
} public void setDebug(boolean flag) { this.debug = flag;
+ trkMatchTool.setDebug(flag);
} public void setSimTrigger(boolean simTrigger) {
@@ -247,7 +249,12 @@
} else { return; }
-
+ + for (Track track : tracks) { + BaseTrack trk = (BaseTrack) track; + trk.setTrackParameters(trk.getTrackStates().get(0).getParameters(), 0.491); + } +
if (debug) { System.out.println(tracks.size() + " tracks in this event"); }
diff -u -r1.1 -r1.2 --- EcalTrackMatch.java 11 Jun 2012 21:01:13 -0000 1.1 +++ EcalTrackMatch.java 27 Aug 2012 20:02:04 -0000 1.2 @@ -6,147 +6,154 @@
import hep.physics.vec.Hep3Vector; import java.util.List;
-import org.lcsim.event.EventHeader;
import org.lcsim.event.Track; import org.lcsim.hps.recon.ecal.HPSEcalCluster; import org.lcsim.hps.users.omoreno.ExtendTrack;
-import org.lcsim.recon.tracking.seedtracker.SeedTrack;
/** * * @author phansson */ public class EcalTrackMatch {
-
+
public static final double crystalSizeX = (13.3 + 16.0) / 2; public static final double crystalSizeY = (13.3 + 16.0) / 2;
- private double RADIUS = crystalSizeX; - private String trackCollectionName = "MatchedTracks"; -
+// private double RADIUS = crystalSizeX; +// private String trackCollectionName = "MatchedTracks";
HPSEcalCluster cluster; Track matchedTrack; ExtendTrack extrapolator; //SvtTrackExtrapolator extrapolator; private boolean debug = false;
- - - - public EcalTrackMatch () {
+ + public EcalTrackMatch() {
cluster = null; matchedTrack = null; extrapolator = new ExtendTrack(); //extrapolator = new SvtTrackExtrapolator(); }
- public EcalTrackMatch (boolean deb) {
+ public EcalTrackMatch(boolean deb) {
cluster = null; matchedTrack = null; extrapolator = new ExtendTrack(); //extrapolator = new SvtTrackExtrapolator(); debug = deb;
- - }
+ + } + + public void setDebug(boolean debug) { + this.debug = debug; + }
public Track getMatchedTrack() { return matchedTrack; }
-
+
public void setCluster(HPSEcalCluster cl) { this.cluster = cl; } public double dX(Track track) {
- return dist(track,0);
+ return dist(track, 0);
}
-
+
public double dY(Track track) {
- return dist(track,1);
+ return dist(track, 1);
}
-
+
public double dist(Track track, int dir) {
- SeedTrack trk = (SeedTrack)track; - extrapolator.setTrack(trk); - //extend.setTrack(stEle); - //Hep3Vector posAtEcal = extend.positionAtEcal(); - Hep3Vector trk_pos = extrapolator.positionAtEcal(); - double dx; - if(dir==0) { - dx = cluster.getPosition()[0] - trk_pos.y(); - } else { - dx = cluster.getPosition()[1] - trk_pos.z(); - } - if(debug) System.out.println("dist = " + dx + " from cluster to track in " + (dir==0?"X":"Y") + " to track at " + trk_pos.x() + "," + trk_pos.y() + "," + trk_pos.z()); - return dx;
+// SeedTrack trk = (SeedTrack)track; + extrapolator.setTrack(track); + //extend.setTrack(stEle); + //Hep3Vector posAtEcal = extend.positionAtEcal(); + Hep3Vector trk_pos = extrapolator.positionAtEcal(); + double dx; + if (dir == 0) { + dx = cluster.getPosition()[0] - trk_pos.y(); + } else { + dx = cluster.getPosition()[1] - trk_pos.z(); + } + if (debug) { + System.out.println("dist = " + dx + " from cluster to track in " + (dir == 0 ? "X" : "Y") + " to track at " + trk_pos.x() + "," + trk_pos.y() + "," + trk_pos.z()); + } + return dx;
}
- - public double dR(Track track) { - SeedTrack trk = (SeedTrack)track; - extrapolator.setTrack(trk); - //extend.setTrack(stEle); - //Hep3Vector posAtEcal = extend.positionAtEcal(); - Hep3Vector trk_pos = extrapolator.positionAtEcal(); - double dx = dX(track); - double dy = dY(track); - double dr = Math.sqrt(dx*dx+dy*dy); - if(debug) System.out.println("dR = " + dr + " to track at " + trk_pos.toString()); - return dr; - } - - - - public void match (List<Track> tracks) { - matchedTrack = null; - if(debug) System.out.println("Matching cluster at " + cluster.getPosition()[0] + "," + cluster.getPosition()[1] + "," + cluster.getPosition()[2] + " with " + tracks.size() + " tracks.");
+ + public double dR(Track track) { +// SeedTrack trk = (SeedTrack)track; + extrapolator.setTrack(track); + //extend.setTrack(stEle); + //Hep3Vector posAtEcal = extend.positionAtEcal(); + Hep3Vector trk_pos = extrapolator.positionAtEcal(); + double dx = dX(track); + double dy = dY(track); + double dr = Math.sqrt(dx * dx + dy * dy); + if (debug) { + System.out.println("dR = " + dr + " to track at " + trk_pos.toString()); + } + return dr; + } + + public void match(List<Track> tracks) { + matchedTrack = null; + if (debug) { + System.out.println("Matching cluster at " + cluster.getPosition()[0] + "," + cluster.getPosition()[1] + "," + cluster.getPosition()[2] + " with " + tracks.size() + " tracks."); + }
//get the position of the cluster anc compare to tracks at the ecal face double dr;
- SeedTrack trk; - Hep3Vector trk_pos;
+// SeedTrack trk; +// Hep3Vector trk_pos;
double drmin = 999999.9;
- for(Track track : tracks) {
+ for (Track track : tracks) {
dr = dR(track);
- if(dr<drmin) {
+ if (dr < drmin) {
drmin = dr; matchedTrack = track; } }
- if(debug) { - if(matchedTrack==null) System.out.println("Not matched track was found"); - else System.out.println("Matched a track with dr " + dR(matchedTrack));
+ if (debug) { + if (matchedTrack == null) { + System.out.println("No matched track was found"); + } else { + System.out.println("Matched a track with dr " + dR(matchedTrack)); + }
}
- }
+ }
- public boolean match (List<Track> tracks,double drmax) {
+ public boolean match(List<Track> tracks, double drmax) {
match(tracks); return isMatched(drmax); }
- -
+
public boolean isMatched(double rad_max) {
- if(matchedTrack==null) return false;
+ if (matchedTrack == null) { + return false; + }
double dr = dR(matchedTrack);
- return (dr<rad_max ? true : false);
+ return (dr < rad_max ? true : false);
} public boolean isMatchedY(double max) {
- if(matchedTrack==null) return false;
+ if (matchedTrack == null) { + return false; + }
double dy = dY(matchedTrack);
- return (dy<max ? true : false);
+ return (dy < max ? true : false);
} public double getDistanceToTrack() {
- return matchedTrack==null ? -1 : dR(matchedTrack); -
+ return matchedTrack == null ? -1 : dR(matchedTrack); +
}
-
+
public double getDistanceToTrackInX() {
- return matchedTrack==null ? -1 : dX(matchedTrack); -
+ return matchedTrack == null ? -1 : dX(matchedTrack); +
}
-
+
public double getDistanceToTrackInY() {
- return matchedTrack==null ? -1 : dY(matchedTrack); -
+ return matchedTrack == null ? -1 : dY(matchedTrack); +
}
- -
}
diff -u -r1.3 -r1.4 --- TrackUtils.java 31 May 2012 06:59:47 -0000 1.3 +++ TrackUtils.java 27 Aug 2012 20:02:04 -0000 1.4 @@ -5,18 +5,18 @@
import hep.physics.vec.Hep3Vector; //--- org.lcsim ---//
-import org.lcsim.recon.tracking.seedtracker.SeedTrack;
+import org.lcsim.event.Track;
/** * * @author Omar Moreno <[log in to unmask]>
- * @version $Id: TrackUtils.java,v 1.3 2012/05/31 06:59:47 omoreno Exp $
+ * @version $Id: TrackUtils.java,v 1.4 2012/08/27 20:02:04 meeg Exp $
* TODO: Switch to JLab coordinates */ public class TrackUtils {
- SeedTrack track;
+ Track track;
double[] trackParameters; /**
@@ -29,7 +29,7 @@
/** * */
- public void setTrack(SeedTrack track){
+ public void setTrack(Track track){
this.track = track; trackParameters = new double[9]; this.setTrackParameters(track);
@@ -158,7 +158,7 @@
/** * */
- private void setTrackParameters(SeedTrack track){
+ private void setTrackParameters(Track track){
// All track parameters are in LCSim coordinates system trackParameters[0] = track.getTrackParameter(0); // DOCA
diff -u -r1.3 -r1.4 --- ExtendTrack.java 11 May 2012 13:07:44 -0000 1.3 +++ ExtendTrack.java 27 Aug 2012 20:02:04 -0000 1.4 @@ -5,12 +5,12 @@
import hep.physics.vec.Hep3Vector; //--- org.lcsim ---//
-import org.lcsim.recon.tracking.seedtracker.SeedTrack;
+import org.lcsim.event.Track;
/** * * @author Omar Moreno <[log in to unmask]>
- * @version $Id: ExtendTrack.java,v 1.3 2012/05/11 13:07:44 omoreno Exp $
+ * @version $Id: ExtendTrack.java,v 1.4 2012/08/27 20:02:04 meeg Exp $
*/ public class ExtendTrack {
@@ -20,7 +20,7 @@
public static final double DIPOLE_EDGE = 914; // mm
- SeedTrack track;
+ Track track;
double[] trackParameters; boolean debug = true;
@@ -35,7 +35,7 @@
/** * */
- public void setTrack(SeedTrack track){
+ public void setTrack(Track track){
this.track = track; trackParameters = new double[9]; this.setTrackParameters(track);
@@ -44,7 +44,7 @@
/** * */
- public void setTrackParameters(SeedTrack track){
+ public void setTrackParameters(Track track){
// All track parameters are in LCSim coordinates system trackParameters[0] = track.getTrackParameter(0); // DOCA
@@ -156,7 +156,7 @@
// Check if a track has been set if(track == null) throw new RuntimeException("Track has not been set!");
-
+
return this.getYC() + Math.signum(this.getR())*Math.sqrt(this.getR()*this.getR() - Math.pow(x-this.getXC(), 2));
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1