lcsim/src/org/lcsim/contrib/seedtracker
diff -N MaterialLayer.java
--- MaterialLayer.java 11 Dec 2007 20:58:28 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,72 +0,0 @@
-/*
- * MaterialLayer.java
- *
- * Created on August 12, 2007, 8:44 PM
- *
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
- */
-
-package org.lcsim.contrib.seedtracker;
-
-import org.lcsim.geometry.subdetector.BarrelEndcapFlag;
-
-/**
- *
- * @author partridge
- */
-public class MaterialLayer {
- private double _rmin;
- private double _rmax;
- private double _zmin;
- private double _zmax;
- private double _X0;
- private double _thickness;
- private BarrelEndcapFlag _beflag;
-
- /** Creates a new instance of MaterialLayer */
- public MaterialLayer(double rmin, double rmax, double zmin, double zmax, double X0) {
- _rmin = rmin;
- _rmax = rmax;
- _zmin = zmin;
- _zmax = zmax;
- _X0 = X0;
- if (_rmax-_rmin < _zmax-_zmin) {
- _beflag = BarrelEndcapFlag.BARREL;
- _thickness = _rmax - _rmin;
- }
- else {
- if (_zmax > 0) _beflag = BarrelEndcapFlag.ENDCAP_NORTH;
- else _beflag = BarrelEndcapFlag.ENDCAP_SOUTH;
- _thickness = _zmax - _zmin;
- }
- }
-
- public double rmin() {
- return _rmin;
- }
-
- public double rmax() {
- return _rmax;
- }
-
- public double zmin() {
- return _zmin;
- }
-
- public double zmax() {
- return _zmax;
- }
-
- public double X0() {
- return _X0;
- }
-
- public double thickness() {
- return _thickness;
- }
-
- public BarrelEndcapFlag beflag() {
- return _beflag;
- }
-}
lcsim/src/org/lcsim/contrib/seedtracker
diff -N Scrap.java
--- Scrap.java 4 Feb 2008 20:53:19 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,65 +0,0 @@
- public double MSError(double p, double d0, double z0, double r, double z) {
- double slope = (r-d0) / (z-z0);
- double mserrorsq = 0.;
- for (MaterialLayer lyr : _matlyrs) {
- if (inside(d0,z0,lyr) != inside(r,z,lyr)) {
- if (lyr.beflag() == BarrelEndcapFlag.BARREL) {
- double zint = z0 + (lyr.rmax()-d0) * slope;
- if ((zint > lyr.zmin()) && (zint < lyr.zmax())) {
- double pathsq = Math.pow(r-lyr.rmax(),2)+Math.pow(z-zint,2);
- double radlen = lyr.thickness() * Math.sqrt(1+Math.pow(slope,2)) / lyr.X0();
- mserrorsq += msanglesq(p,radlen) * pathsq;
- }
- } else if (lyr.beflag() == BarrelEndcapFlag.ENDCAP_NORTH) {
- double rint = d0 + (lyr.zmax()-z0) / slope;
- if ((rint > lyr.rmin()) && (rint < lyr.rmax())) {
- double pathsq = Math.pow(r-rint,2)+Math.pow(z-lyr.zmax(),2);
- double radlen = lyr.thickness() * Math.sqrt(1+Math.pow(slope,-2)) / lyr.X0();
- mserrorsq += msanglesq(p,radlen) * pathsq;
- }
- } else if (lyr.beflag() == BarrelEndcapFlag.ENDCAP_SOUTH) {
- double rint = d0 + (lyr.zmin()-z0) / slope;
- if ((rint > lyr.rmin()) && (rint < lyr.rmax())) {
- double pathsq = Math.pow(r-rint,2)+Math.pow(z-lyr.zmin(),2);
- double radlen = lyr.thickness() * Math.sqrt(1+Math.pow(slope,-2)) / lyr.X0();
- mserrorsq += msanglesq(p,radlen) * pathsq;
- }
- }
- }
- }
- return Math.sqrt(mserrorsq);
- }
-
- public double MSError(SeedCandidate seed, double bfield, TrackerHit hit) {
- double[] pars = seed.getHelix().parameters();
- double p = 0.3 * bfield * Math.abs(pars[2]) / Math.sqrt(1+Math.pow(pars[4],-2));
- double[] pos = hit.getPosition();
- double r = Math.sqrt(Math.pow(pos[0],2)+Math.pow(pos[1],2));
- return MSError(p,pars[0],pars[3],r,pos[2]);
- }
-
-
- private boolean inside(double r, double z, MaterialLayer lyr) {
- if (lyr.beflag() == BarrelEndcapFlag.BARREL) {
- return r < lyr.rmin();
- } else if (lyr.beflag() == BarrelEndcapFlag.ENDCAP_NORTH) {
- return z < lyr.zmin();
- } else {
- return z > lyr.zmax();
- }
- }
-
- private boolean outside(double r, double z, MaterialLayer lyr) {
- if (lyr.beflag() == BarrelEndcapFlag.BARREL) {
- return r > lyr.rmax();
- } else if (lyr.beflag() == BarrelEndcapFlag.ENDCAP_NORTH) {
- return z > lyr.zmax();
- } else {
- return z < lyr.zmin();
- }
- }
-
- private double msanglesq(double p, double radlength) {
- // Theta = (0.0136 GeV)*(z/p)*(sqrt(radLength))*(1+0.038*log(radLength))
- return radlength * Math.pow(0.0136*(1.0 + 0.038 * Math.log(radlength))/p,2);
- }
lcsim/src/org/lcsim/contrib/seedtracker
diff -N SmearMCHits.java
--- SmearMCHits.java 11 Aug 2007 00:17:32 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,51 +0,0 @@
-/*
- * SmearMCHits.java
- *
- * Created on July 12, 2006, 10:25 AM
- *
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
- */
-
-package org.lcsim.contrib.seedtracker;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.lcsim.contrib.tracking.TrackerHitCheater;
-import org.lcsim.event.EventHeader;
-import org.lcsim.event.SimTrackerHit;
-import org.lcsim.event.TrackerHit;
-import org.lcsim.util.Driver;
-
-/**
- * Create cheated and smeared TrackerHits from all collections of SimTrackerHits
- * @author partridge
- */
-public class SmearMCHits extends Driver{
-
- TrackerHitCheater cheater = new TrackerHitCheater();
-
- /** Creates a new instance of SmearMCHits */
- public SmearMCHits() {
- }
-
- /**
- * Process the current event
- * @param event EventHeader for this event
- */
- public void process(EventHeader event) {
-
- // Initialize the TrackerHit list
- List<TrackerHit> allhits = new ArrayList<TrackerHit>();
- // Get the SimTrackerHit collections
- List<List<SimTrackerHit>> allgenhits = event.get(SimTrackerHit.class);
- // Loop over the various hit collections
- for (List<SimTrackerHit> genhitcol : allgenhits) {
- List<TrackerHit> hits = cheater.makeTrackerHits(genhitcol);
- allhits.addAll(hits);
- }
- // Put the list of TrackerHits into the event
- event.put("TrackerHit",allhits,TrackerHit.class,0);
- }
-}