Commit in hps-java/src/main/java/org/lcsim/hps on MAIN | |||
event/HPSTransformations.java | +27 | -16 | 1.2 -> 1.3 |
recon/tracking/HPSTrack.java | +8 | -9 | 1.8 -> 1.9 |
/HelicalTrackHitDriver.java | +5 | -7 | 1.6 -> 1.7 |
/MaterialSupervisor.java | +6 | -7 | 1.2 -> 1.3 |
/MultipleScattering.java | +5 | -6 | 1.5 -> 1.6 |
/TrackUtils.java | +3 | -4 | 1.30 -> 1.31 |
/TrackerHitUtils.java | +4 | -5 | 1.3 -> 1.4 |
/TrackerReconDriver.java | +1 | -2 | 1.35 -> 1.36 |
recon/tracking/gbl/GBLOutput.java | +3 | -4 | 1.14 -> 1.15 |
/TruthResiduals.java | +5 | -6 | 1.8 -> 1.9 |
recon/tracking/kalman/KalmanGeom.java | +4 | -6 | 1.5 -> 1.6 |
recon/vertexing/SimpleVertexer.java | -3 | 1.1 -> 1.2 | |
/TwoParticleVertexer.java | +4 | -1 | 1.1 -> 1.2 |
/TwoTrackVertexer.java | +2 | -1 | 1.7 -> 1.8 |
users/mgraham/SingleSensorHelicalTrackHitDriver.java | +3 | -4 | 1.1 -> 1.2 |
/SingleSensorTrackerReconDriver.java | +1 | -2 | 1.1 -> 1.2 |
users/mgraham/alignment/AlignmentParameters.java | +1 | -3 | 1.2 -> 1.3 |
users/phansson/MPAlignmentInputCalculator.java | +2 | -4 | 1.2 -> 1.3 |
+84 | -90 |
Make transformation class static.
diff -u -r1.2 -r1.3 --- HPSTransformations.java 16 Nov 2011 18:00:04 -0000 1.2 +++ HPSTransformations.java 15 Oct 2013 00:33:53 -0000 1.3 @@ -13,42 +13,53 @@
/** * Class that contains the transformations between the JLAB and lcsim tracking coordinate systems
- * @author mgraham
+ * @author mgraham, phansson
* created 6/27/2011
+ * made static 10/14/2013 + *
*/ public class HPSTransformations {
- private Transform3D _detToTrk; - private Hep3Matrix _rotation; - public HPSTransformations() { - BasicHep3Matrix tmp = new BasicHep3Matrix();
+ private static final Transform3D _detToTrk = HPSTransformations.initialize(); + + /** + * Private constructor to prevent initialization + */ + private HPSTransformations() { + } + + /** + * Static private initialization of transform + * @return transform + */ + private static Transform3D initialize() { + BasicHep3Matrix tmp = new BasicHep3Matrix();
tmp.setElement(0, 2, 1); tmp.setElement(1, 0, 1); tmp.setElement(2, 1, 1);
- _rotation=tmp; -// _detToTrk.setRotationMatrix(tmp); - _detToTrk = new Transform3D(new Rotation3D(tmp));
+ return new Transform3D(new Rotation3D(tmp));
}
- - public Hep3Vector transformVectorToTracking(Hep3Vector vec) {
+ + public static Hep3Vector transformVectorToTracking(Hep3Vector vec) {
return _detToTrk.transformed(vec); }
- public SymmetricMatrix transformCovarianceToTracking(SymmetricMatrix cov) {
+ public static SymmetricMatrix transformCovarianceToTracking(SymmetricMatrix cov) {
return _detToTrk.transformed(cov); }
- public Hep3Vector transformVectorToDetector(Hep3Vector vec) {
+ public static Hep3Vector transformVectorToDetector(Hep3Vector vec) {
return (_detToTrk.inverse()).transformed(vec); }
- public SymmetricMatrix transformCovarianceToDetector(SymmetricMatrix cov) {
+ public static SymmetricMatrix transformCovarianceToDetector(SymmetricMatrix cov) {
return (_detToTrk.inverse()).transformed(cov); }
- public Transform3D getTransform(){
+ public static Transform3D getTransform(){
return _detToTrk; }
- public Hep3Matrix getMatrix(){ - return _rotation;
+ public static Hep3Matrix getMatrix(){ + return _detToTrk.getRotation().getRotationMatrix();
}
+
}
diff -u -r1.8 -r1.9 --- HPSTrack.java 22 May 2013 18:45:33 -0000 1.8 +++ HPSTrack.java 15 Oct 2013 00:33:53 -0000 1.9 @@ -45,7 +45,6 @@
//the position & momentum of the track at DOCA to the beam axis (z) private Hep3Vector _pDocaZ; private Hep3Vector _posDocaZ;
- private HPSTransformations _detToTrk = new HPSTransformations();
private double bField = 0.491; // make this set-able private boolean _debug = false; private boolean _debugForward = false;
@@ -144,8 +143,8 @@
List<Double> paths = HelixUtils.PathToXPlane(this, 0.0, 100.0, 1); Hep3Vector posTargetTrkSystem = HelixUtils.PointOnHelix(this, paths.get(0)); Hep3Vector dirTargetTrkSystem = HelixUtils.Direction(this, paths.get(0));
- _posTarget = _detToTrk.transformVectorToDetector(posTargetTrkSystem); - _pTarget = VecOp.mult(pTot, _detToTrk.transformVectorToDetector(dirTargetTrkSystem));
+ _posTarget = HPSTransformations.transformVectorToDetector(posTargetTrkSystem); + _pTarget = VecOp.mult(pTot, HPSTransformations.transformVectorToDetector(dirTargetTrkSystem));
}
@@ -153,8 +152,8 @@
double pTot = this.p(bField); Hep3Vector posDocaYTrkSystem = HelixUtils.PointOnHelix(this, 0); Hep3Vector dirDocaYTrkSystem = HelixUtils.Direction(this, 0);
- _posDocaY = _detToTrk.transformVectorToDetector(posDocaYTrkSystem); - _pDocaY = VecOp.mult(pTot, _detToTrk.transformVectorToDetector(dirDocaYTrkSystem));
+ _posDocaY = HPSTransformations.transformVectorToDetector(posDocaYTrkSystem); + _pDocaY = VecOp.mult(pTot, HPSTransformations.transformVectorToDetector(dirDocaYTrkSystem));
}
@@ -163,8 +162,8 @@
double sAtDocaZ = findPathToDocaZ(); Hep3Vector posDocaZTrkSystem = HelixUtils.PointOnHelix(this, sAtDocaZ); Hep3Vector dirDocaZTrkSystem = HelixUtils.Direction(this, sAtDocaZ);
- _posDocaZ = _detToTrk.transformVectorToDetector(posDocaZTrkSystem); - _pDocaZ = VecOp.mult(pTot, _detToTrk.transformVectorToDetector(dirDocaZTrkSystem));
+ _posDocaZ = HPSTransformations.transformVectorToDetector(posDocaZTrkSystem); + _pDocaZ = VecOp.mult(pTot, HPSTransformations.transformVectorToDetector(dirDocaZTrkSystem));
} // public Hep3Vector getPositionAtZ(double xFinal, double fringeHalfWidth, double step) {
@@ -292,7 +291,7 @@
// pointInTrking = new BasicHep3Vector(xFinal, ytmp, ztmp); pointInTrking = new BasicHep3Vector(rTmp.x(), rTmp.y(), rTmp.z()); }
- return _detToTrk.transformVectorToDetector(pointInTrking);
+ return HPSTransformations.transformVectorToDetector(pointInTrking);
} /**
@@ -434,7 +433,7 @@
if (_debugForward) { System.out.println("Position xfinal (tracking) : x = " + xFinal + "; y = " + pointInTrking.y() + "; z = " + pointInTrking.z()); }
- Hep3Vector[] out = {_detToTrk.transformVectorToDetector(pointInTrking), _detToTrk.transformVectorToDetector(pTmp)};
+ Hep3Vector[] out = {HPSTransformations.transformVectorToDetector(pointInTrking), HPSTransformations.transformVectorToDetector(pTmp)};
return out; }
diff -u -r1.6 -r1.7 --- HelicalTrackHitDriver.java 10 Oct 2013 01:21:32 -0000 1.6 +++ HelicalTrackHitDriver.java 15 Oct 2013 00:33:53 -0000 1.7 @@ -36,7 +36,7 @@
* @author Mathew Graham <[log in to unmask]> * @author Per Hansson <[log in to unmask]> * @author Omar Moreno <[log in to unmask]>
- * @version $Id: HelicalTrackHitDriver.java,v 1.6 2013/10/10 01:21:32 meeg Exp $
+ * @version $Id: HelicalTrackHitDriver.java,v 1.7 2013/10/15 00:33:53 phansson Exp $
*/ public class HelicalTrackHitDriver extends org.lcsim.fit.helicaltrack.HelicalTrackHitDriver {
@@ -48,9 +48,7 @@
private Map<String, String> _stereomap = new HashMap<String, String>(); private List<String> _colnames = new ArrayList<String>();
- private boolean _doTransformToTracking = true; - private HPSTransformations _detToTrk = new HPSTransformations(); - private SimpleDetector _det;
+ private boolean _doTransformToTracking = true; private SimpleDetector _det;
public enum LayerGeometryType { Split, Common
@@ -631,9 +629,9 @@
String detname = strip.detector(); int layer = strip.layer(); BarrelEndcapFlag bec = strip.BarrelEndcapFlag();
- Hep3Vector neworigin = _detToTrk.transformVectorToTracking(origin); - Hep3Vector newu = _detToTrk.transformVectorToTracking(u); - Hep3Vector newv = _detToTrk.transformVectorToTracking(v);
+ Hep3Vector neworigin = HPSTransformations.transformVectorToTracking(origin); + Hep3Vector newu = HPSTransformations.transformVectorToTracking(u); + Hep3Vector newv = HPSTransformations.transformVectorToTracking(v);
HelicalTrackStrip newstrip = new HelicalTrackStrip(neworigin, newu, newv, umeas, du, vmin, vmax, dedx, time, rthList, detname, layer, bec); for (MCParticle p : strip.MCParticles()) { newstrip.addMCParticle(p);
diff -u -r1.2 -r1.3 --- MaterialSupervisor.java 12 Sep 2013 17:56:34 -0000 1.2 +++ MaterialSupervisor.java 15 Oct 2013 00:33:53 -0000 1.3 @@ -38,8 +38,7 @@
public class MaterialSupervisor extends MaterialManager { private List<ScatteringDetectorVolume> _detectorVolumes = new ArrayList<ScatteringDetectorVolume>();
- private HPSTransformations _detToTrk = new HPSTransformations(); -
+
public MaterialSupervisor() { super();
@@ -233,7 +232,7 @@
private void setOrigin() { // Use origin of p-side surface
- Hep3Vector origin = VecOp.mult(_detToTrk.getMatrix(),_sensor.getGeometry().getPosition());
+ Hep3Vector origin = VecOp.mult(HPSTransformations.getMatrix(),_sensor.getGeometry().getPosition());
//transform to p-side Polygon3D psidePlane = this.getPsidePlane(); Translation3D transformToPside = new Translation3D(VecOp.mult(-1*psidePlane.getDistance(), psidePlane.getNormal()));
@@ -245,7 +244,7 @@
if(_w==null) { _w = this.getPsidePlane().getNormal(); System.out.printf("setting normal from pside normal %s\n",_w.toString());
- _w = VecOp.mult(VecOp.mult(_detToTrk.getMatrix(),getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal().getRotation().getRotationMatrix()), _w);
+ _w = VecOp.mult(VecOp.mult(HPSTransformations.getMatrix(),getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal().getRotation().getRotationMatrix()), _w);
System.out.printf("normal after local to global to tracking rotation %s\n",_w.toString()); } return this._w;
@@ -253,7 +252,7 @@
private void setNormal() { _w = this.getPsidePlane().getNormal();
- _w = VecOp.mult(VecOp.mult(_detToTrk.getMatrix(),getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal().getRotation().getRotationMatrix()), _w);
+ _w = VecOp.mult(VecOp.mult(HPSTransformations.getMatrix(),getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal().getRotation().getRotationMatrix()), _w);
} public void setNormal(Hep3Vector w) {
@@ -307,7 +306,7 @@
// p-side unit vector ITransform3D electrodes_to_global = getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal(); Hep3Vector measuredCoordinate = getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getMeasuredCoordinate(0);
- measuredCoordinate = VecOp.mult(VecOp.mult(_detToTrk.getMatrix(),electrodes_to_global.getRotation().getRotationMatrix()), measuredCoordinate);
+ measuredCoordinate = VecOp.mult(VecOp.mult(HPSTransformations.getMatrix(),electrodes_to_global.getRotation().getRotationMatrix()), measuredCoordinate);
_u = measuredCoordinate; }
@@ -316,7 +315,7 @@
// p-side unit vector ITransform3D electrodes_to_global = getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal(); Hep3Vector unmeasuredCoordinate = getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getUnmeasuredCoordinate(0);
- unmeasuredCoordinate = VecOp.mult(VecOp.mult(_detToTrk.getMatrix(),electrodes_to_global.getRotation().getRotationMatrix()), unmeasuredCoordinate);
+ unmeasuredCoordinate = VecOp.mult(VecOp.mult(HPSTransformations.getMatrix(),electrodes_to_global.getRotation().getRotationMatrix()), unmeasuredCoordinate);
_v = unmeasuredCoordinate; }
diff -u -r1.5 -r1.6 --- MultipleScattering.java 31 Jul 2013 17:21:49 -0000 1.5 +++ MultipleScattering.java 15 Oct 2013 00:33:53 -0000 1.6 @@ -27,7 +27,6 @@
*/ public class MultipleScattering extends org.lcsim.recon.tracking.seedtracker.MultipleScattering {
- private HPSTransformations _detToTrk = new HPSTransformations();
//public MultipleScattering(MaterialSupervisor materialmanager) {
@@ -194,8 +193,8 @@
// Transformation from tracking to detector frame
- Hep3Vector pos_det = VecOp.mult(VecOp.inverse(_detToTrk.getMatrix()),pos); - Hep3Vector direction_det = VecOp.mult(VecOp.inverse(_detToTrk.getMatrix()),direction);
+ Hep3Vector pos_det = VecOp.mult(VecOp.inverse(HPSTransformations.getMatrix()),pos); + Hep3Vector direction_det = VecOp.mult(VecOp.inverse(HPSTransformations.getMatrix()),direction);
if(this._debug) System.out.printf("%s: position in det frame %s and direction %s\n",
@@ -218,7 +217,7 @@
Hep3Vector pos_int = VecOp.add(pos_sensor, VecOp.mult(delta_w, direction_sensor)); Hep3Vector pos_int_det = plane.getSensor().getReadoutElectrodes(ChargeCarrier.HOLE).getLocalToGlobal().transformed(pos_int); // find the intercept in the tracking frame
- Hep3Vector pos_int_trk = VecOp.mult(_detToTrk.getMatrix(),pos_int_det);
+ Hep3Vector pos_int_trk = VecOp.mult(HPSTransformations.getMatrix(),pos_int_det);
if(this._debug) System.out.printf("%s: take step %f to get intercept position in sensor frame %s (det: %s trk: %s)\n",
@@ -314,8 +313,8 @@
// find position in sensor frame
- pos_int_det = VecOp.mult(VecOp.inverse(_detToTrk.getMatrix()), pos); - Hep3Vector pos_int_sensor = plane.getSensor().getGeometry().getGlobalToLocal().transformed(VecOp.mult(VecOp.inverse(_detToTrk.getMatrix()), pos));
+ pos_int_det = VecOp.mult(VecOp.inverse(HPSTransformations.getMatrix()), pos); + Hep3Vector pos_int_sensor = plane.getSensor().getGeometry().getGlobalToLocal().transformed(VecOp.mult(VecOp.inverse(HPSTransformations.getMatrix()), pos));
if(this._debug) System.out.printf("%s: found iterative helix intercept in sensor coordinates at %s\n", this.getClass().getSimpleName(),pos_int_sensor.toString());
diff -u -r1.30 -r1.31 --- TrackUtils.java 14 Oct 2013 23:50:39 -0000 1.30 +++ TrackUtils.java 15 Oct 2013 00:33:53 -0000 1.31 @@ -40,7 +40,7 @@
* Re-use as much of HelixUtils as possible. * * @author Omar Moreno <[log in to unmask]>
- * @version $Id: TrackUtils.java,v 1.30 2013/10/14 23:50:39 phansson Exp $
+ * @version $Id: TrackUtils.java,v 1.31 2013/10/15 00:33:53 phansson Exp $
* TODO: Switch to tracking/LCsim coordinates for the extrapolation output! */
@@ -658,9 +658,8 @@
* @return helix object based on the MC particle */ public static HelicalTrackFit getHTF(MCParticle mcp, double Bz) {
- HPSTransformations hpstrans = new HPSTransformations(); - Hep3Vector org = hpstrans.transformVectorToTracking(mcp.getOrigin()); - Hep3Vector p = hpstrans.transformVectorToTracking(mcp.getMomentum());
+ Hep3Vector org = HPSTransformations.transformVectorToTracking(mcp.getOrigin()); + Hep3Vector p = HPSTransformations.transformVectorToTracking(mcp.getMomentum());
// Move to x=0 if needed double targetX = BeamlineConstants.DIPOLE_EDGELOW; if(org.x() < targetX) {
diff -u -r1.3 -r1.4 --- TrackerHitUtils.java 22 Oct 2012 21:17:26 -0000 1.3 +++ TrackerHitUtils.java 15 Oct 2013 00:33:53 -0000 1.4 @@ -25,12 +25,11 @@
/** * * @author Per Hansson <[log in to unmask]>
- * @version $Id: TrackerHitUtils.java,v 1.3 2012/10/22 21:17:26 omoreno Exp $
+ * @version $Id: TrackerHitUtils.java,v 1.4 2013/10/15 00:33:53 phansson Exp $
*/ public class TrackerHitUtils { private boolean _DEBUG = false;
- private HPSTransformations _detToTrk = new HPSTransformations();
public TrackerHitUtils() { }
@@ -45,7 +44,7 @@
public Hep3Matrix detToTrackRotationMatrix() {
- return (BasicHep3Matrix) _detToTrk.getMatrix();
+ return (BasicHep3Matrix) HPSTransformations.getMatrix();
} public ITransform3D GetGlobalToLocal(HelicalTrackStrip strip) {
@@ -65,7 +64,7 @@
//Get rotation matrix Hep3Matrix detToStripMatrix = (BasicHep3Matrix) detToStrip.getRotation().getRotationMatrix(); //Transformation between the JLAB and tracking coordinate systems
- Hep3Matrix detToTrackMatrix = (BasicHep3Matrix) _detToTrk.getMatrix();
+ Hep3Matrix detToTrackMatrix = (BasicHep3Matrix) HPSTransformations.getMatrix();
if (_DEBUG) { System.out.println("gblToLoc translation:");
@@ -105,7 +104,7 @@
public Hep3Vector getClusterPosition(HelicalTrackStrip strip, boolean stripInTrackingFrame) { if(_DEBUG) System.out.println(this.getClass().getSimpleName() + " getClusterPosition--");
- Hep3Vector origin = stripInTrackingFrame ? strip.origin() : VecOp.mult(_detToTrk.getMatrix(),strip.origin());
+ Hep3Vector origin = stripInTrackingFrame ? strip.origin() : VecOp.mult(HPSTransformations.getMatrix(),strip.origin());
if(_DEBUG) System.out.println(this.getClass().getSimpleName() + " origin " + origin.toString()); Hep3Vector hit_vec_LOCAL = new BasicHep3Vector(strip.umeas(),0,0); if(_DEBUG) System.out.println(this.getClass().getSimpleName() + " hit_vec_LOCAL " + hit_vec_LOCAL.toString());
diff -u -r1.35 -r1.36 --- TrackerReconDriver.java 12 Jul 2013 20:55:49 -0000 1.35 +++ TrackerReconDriver.java 15 Oct 2013 00:33:53 -0000 1.36 @@ -143,8 +143,7 @@
stFinal.setUseDefaultXPlane(false); stFinal.setDebug(this.debug); stFinal.setIterativeConfirmed(_iterativeConfirmed);
- HPSTransformations hpstrans = new HPSTransformations(); - stFinal.setMaterialManagerTransform(hpstrans.getTransform());
+ stFinal.setMaterialManagerTransform(HPSTransformations.getTransform());
stFinal.setInputCollectionName(stInputCollectionName); stFinal.setTrkCollectionName(trackCollectionName); stFinal.setBField(bfield);
diff -u -r1.14 -r1.15 --- GBLOutput.java 11 Oct 2013 23:14:28 -0000 1.14 +++ GBLOutput.java 15 Oct 2013 00:33:53 -0000 1.15 @@ -56,7 +56,6 @@
private TrackerHitUtils _trackerHitUtils = new TrackerHitUtils(); private MaterialSupervisor _materialmanager; private MultipleScattering _scattering;
- private HPSTransformations _hpstrans = new HPSTransformations();
private double _beamEnergy = 2.2; //GeV private boolean AprimeEvent = false; private boolean hasXPlanes = false;
@@ -72,7 +71,7 @@
//B = VecOp.mult(0.3, new BasicHep3Vector(0.,0.,Bz)); _materialmanager = new MaterialSupervisor(); _scattering = new MultipleScattering(_materialmanager);
- _B = _hpstrans.transformVectorToTracking(bfield);
+ _B = HPSTransformations.transformVectorToTracking(bfield);
System.out.printf("%s: B field %s\n",this.getClass().getSimpleName(),_B.toString()); _scattering.setBField(Math.abs(_B.z())); // only absolute of B is needed as it's used for momentum calculation only }
@@ -258,7 +257,7 @@
if(_debug>0) { double s_truthSimHit = HelixUtils.PathToXPlane(htfTruth, simHit.getPositionVec().z(), 0, 0).get(0); Hep3Vector trkposTruthSimHit = HelixUtils.PointOnHelix(htfTruth, s_truthSimHit);
- Hep3Vector resTruthSimHit = VecOp.sub(this._hpstrans.transformVectorToTracking(simHit.getPositionVec()),trkposTruthSimHit);
+ Hep3Vector resTruthSimHit = VecOp.sub(HPSTransformations.transformVectorToTracking(simHit.getPositionVec()),trkposTruthSimHit);
System.out.printf("TruthSimHit residual %s for layer %d\n",resTruthSimHit.toString(),strip.layer()); }
@@ -311,7 +310,7 @@
// sim hit residual if(simHit!=null) {
- Hep3Vector simHitPos = this._hpstrans.transformVectorToTracking(simHit.getPositionVec());
+ Hep3Vector simHitPos = HPSTransformations.transformVectorToTracking(simHit.getPositionVec());
if(_debug>0) System.out.printf("simHitPos %s\n",simHitPos.toString()); Hep3Vector vdiffSimHit = VecOp.sub(simHitPos, trkpos); Hep3Vector simHitPos_meas = VecOp.mult(trkToStripRot, vdiffSimHit);
diff -u -r1.8 -r1.9 --- TruthResiduals.java 14 Oct 2013 22:58:03 -0000 1.8 +++ TruthResiduals.java 15 Oct 2013 00:33:53 -0000 1.9 @@ -34,7 +34,6 @@
private int _debug; private boolean _hideFrame = true; private Hep3Vector _B;
- private HPSTransformations _hpstrans = new HPSTransformations();
private AIDA aida = AIDA.defaultInstance(); private IAnalysisFactory af = aida.analysisFactory(); private Map<Integer, List<IHistogram1D> > res_truthsimhit = null;
@@ -53,7 +52,7 @@
* Bz in Tesla */ public TruthResiduals(Hep3Vector bfield) {
- _B = _hpstrans.transformVectorToTracking(bfield);
+ _B = HPSTransformations.transformVectorToTracking(bfield);
System.out.printf("%s: B field %s\n",this.getClass().getSimpleName(),_B.toString()); } public void setDebug(int debug) {
@@ -73,7 +72,7 @@
Map<Integer, List<SimTrackerHit>> simHitsLayerMap = new HashMap<Integer, List<SimTrackerHit> >(); Map<MCParticle, List<SimTrackerHit> > mcPartSimHitsMap = new HashMap<MCParticle, List<SimTrackerHit > >(); for(SimTrackerHit sh : simTrackerHits) {
- Hep3Vector shpos = this._hpstrans.transformVectorToTracking(sh.getPositionVec());
+ Hep3Vector shpos = HPSTransformations.transformVectorToTracking(sh.getPositionVec());
if(Math.abs(shpos.x()) < 50.0) { System.out.printf("%s: Weird hit at %s (%s) in layer %d for MC part %d org %s p %s\n", this.getClass().getSimpleName(),sh.getPositionVec().toString(),shpos.toString(),sh.getIdentifierFieldValue("layer"),
@@ -119,7 +118,7 @@
if(mcp.getMomentum().magnitude()<0.5) continue; // Position in tracking coord
- Hep3Vector simHitPosTracking = this._hpstrans.transformVectorToTracking(simHit.getPositionVec());
+ Hep3Vector simHitPosTracking = HPSTransformations.transformVectorToTracking(simHit.getPositionVec());
if(_debug>0) { System.out.printf("%s: simHit for layer %d at %s (%s) from MC part %d org %s p %s\n",
@@ -139,7 +138,7 @@
Hep3Vector trkposExtraPolator = TrackUtils.extrapolateTrack(htfTruth,simHitPosTracking.x()); //System.out.printf("trkposextrapol (det) %s\n",trkposExtraPolator.toString());
- trkposExtraPolator = this._hpstrans.transformVectorToTracking(trkposExtraPolator);
+ trkposExtraPolator = HPSTransformations.transformVectorToTracking(trkposExtraPolator);
// Calculate residuals Hep3Vector res = VecOp.sub(simHitPosTracking, trkposExtraPolator);
@@ -175,7 +174,7 @@
double xpos = mcp.getOriginZ(); while(xpos< 100.) { xpos += dx;
- trkposExtraPolator = this._hpstrans.transformVectorToTracking(TrackUtils.extrapolateTrack(htfTruth,xpos));
+ trkposExtraPolator = HPSTransformations.transformVectorToTracking(TrackUtils.extrapolateTrack(htfTruth,xpos));
double ypos = trkposExtraPolator.y(); trkpos_y_vs_x.fill(xpos,ypos); }
diff -u -r1.5 -r1.6 --- KalmanGeom.java 26 Nov 2012 18:12:01 -0000 1.5 +++ KalmanGeom.java 15 Oct 2013 00:33:54 -0000 1.6 @@ -49,9 +49,9 @@
* * *@author $Author: phansson $
- *@version $Id: KalmanGeom.java,v 1.5 2012/11/26 18:12:01 phansson Exp $
+ *@version $Id: KalmanGeom.java,v 1.6 2013/10/15 00:33:54 phansson Exp $
*
- * Date $Date: 2012/11/26 18:12:01 $
+ * Date $Date: 2013/10/15 00:33:54 $
* */ /* To make the Kalman filter work for any detector, the type of hit that is
@@ -115,14 +115,12 @@
ILogicalVolume logical; ShapeDispatcher shapeDispatcher = new ShapeDispatcher(); Detector detector = null;
- private HPSTransformations _detToTrk;
public KalmanGeom(Detector det) { detector = det; System.out.println("New detector: " + detector.getName()); logical = detector.getTrackingVolume().getLogicalVolume();
- _detToTrk = new HPSTransformations();
// Extract information from the run time configuration system. // try{
@@ -681,7 +679,7 @@
//Get rotation matrix Hep3Matrix stripToDetMatrix = (BasicHep3Matrix) stripToDet.getRotation().getRotationMatrix(); //Transformation between JLab and tracking coordinates
- Hep3Matrix detToTrackMatrix = (BasicHep3Matrix) _detToTrk.getMatrix();
+ Hep3Matrix detToTrackMatrix = (BasicHep3Matrix) HPSTransformations.getMatrix();
if (true) { System.out.println("Getting the rotation to go from strip (u,v,w) to track coordinates");
@@ -715,7 +713,7 @@
//Get rotation matrix Hep3Matrix detToStripMatrix = (BasicHep3Matrix) detToStrip.getRotation().getRotationMatrix(); //Transformation between the JLAB and tracking coordinate systems
- Hep3Matrix detToTrackMatrix = (BasicHep3Matrix) _detToTrk.getMatrix();
+ Hep3Matrix detToTrackMatrix = (BasicHep3Matrix) HPSTransformations.getMatrix();
if (true) { System.out.println("Getting the rotation to go from track to strip (u,v,w)");
diff -u -r1.1 -r1.2 --- SimpleVertexer.java 22 Dec 2012 20:42:51 -0000 1.1 +++ SimpleVertexer.java 15 Oct 2013 00:33:54 -0000 1.2 @@ -5,7 +5,6 @@
package org.lcsim.hps.recon.vertexing; import hep.physics.vec.Hep3Vector;
-import org.lcsim.hps.event.HPSTransformations;
/** *
@@ -13,8 +12,6 @@
*/ public interface SimpleVertexer {
- static final HPSTransformations _detToTrk = new HPSTransformations(); -
public Hep3Vector getVertex();
diff -u -r1.1 -r1.2 --- TwoParticleVertexer.java 22 Dec 2012 20:42:51 -0000 1.1 +++ TwoParticleVertexer.java 15 Oct 2013 00:33:54 -0000 1.2 @@ -4,10 +4,13 @@
*/ package org.lcsim.hps.recon.vertexing;
+import org.lcsim.hps.event.HPSTransformations;
import org.lcsim.hps.recon.vertexing.TwoLineVertexer;
+
import hep.physics.vec.BasicHep3Vector; import hep.physics.vec.Hep3Vector; import hep.physics.vec.VecOp;
+
import org.lcsim.event.MCParticle; /**
@@ -40,7 +43,7 @@
double dz = 20.0; Hep3Vector A2 = this.propAlongLine(A1, p1, dz); Hep3Vector B2 = this.propAlongLine(B1, p2, dz);
- return getVertexPosition(VecOp.mult(_detToTrk.getMatrix(), A1), VecOp.mult(_detToTrk.getMatrix(), A2), VecOp.mult(_detToTrk.getMatrix(), B1), VecOp.mult(_detToTrk.getMatrix(), B2));
+ return getVertexPosition(VecOp.mult(HPSTransformations.getMatrix(), A1), VecOp.mult(HPSTransformations.getMatrix(), A2), VecOp.mult(HPSTransformations.getMatrix(), B1), VecOp.mult(HPSTransformations.getMatrix(), B2));
}
diff -u -r1.7 -r1.8 --- TwoTrackVertexer.java 14 Oct 2013 22:58:03 -0000 1.7 +++ TwoTrackVertexer.java 15 Oct 2013 00:33:54 -0000 1.8 @@ -15,6 +15,7 @@
import org.lcsim.fit.helicaltrack.HelicalTrackFit; import org.lcsim.fit.helicaltrack.HelixUtils; import org.lcsim.hps.event.BeamlineConstants;
+import org.lcsim.hps.event.HPSTransformations;
import org.lcsim.hps.recon.tracking.HPSTrack; import org.lcsim.hps.recon.tracking.TrackUtils; import org.lcsim.recon.tracking.seedtracker.SeedTrack;
@@ -57,7 +58,7 @@
Hep3Vector A2 = this.getPosition(trk1, BeamlineConstants.HARP_POSITION); Hep3Vector B1 = this.getPosition(trk2, 0); Hep3Vector B2 = this.getPosition(trk2, BeamlineConstants.HARP_POSITION);
- return getVertexPosition(VecOp.mult(_detToTrk.getMatrix(), A1), VecOp.mult(_detToTrk.getMatrix(), A2), VecOp.mult(_detToTrk.getMatrix(), B1), VecOp.mult(_detToTrk.getMatrix(), B2));
+ return getVertexPosition(VecOp.mult(HPSTransformations.getMatrix(), A1), VecOp.mult(HPSTransformations.getMatrix(), A2), VecOp.mult(HPSTransformations.getMatrix(), B1), VecOp.mult(HPSTransformations.getMatrix(), B2));
} public Hep3Vector getVertexWithFringe() {
diff -u -r1.1 -r1.2 --- SingleSensorHelicalTrackHitDriver.java 13 Mar 2013 02:07:40 -0000 1.1 +++ SingleSensorHelicalTrackHitDriver.java 15 Oct 2013 00:33:54 -0000 1.2 @@ -39,7 +39,6 @@
private Map<String,String> _stereomap = new HashMap<String,String>(); private List<String> _colnames = new ArrayList<String>(); private boolean _doTransformToTracking = true;
- private HPSTransformations _detToTrk = new HPSTransformations();
public enum LayerGeometryType { /* * Each Layer in the geometry is a separate sensor
@@ -355,9 +354,9 @@
String detname = strip.detector(); int layer = strip.layer(); BarrelEndcapFlag bec = strip.BarrelEndcapFlag();
- Hep3Vector neworigin = _detToTrk.transformVectorToTracking(origin); - Hep3Vector newu = _detToTrk.transformVectorToTracking(u); - Hep3Vector newv = _detToTrk.transformVectorToTracking(v);
+ Hep3Vector neworigin = HPSTransformations.transformVectorToTracking(origin); + Hep3Vector newu = HPSTransformations.transformVectorToTracking(u); + Hep3Vector newv = HPSTransformations.transformVectorToTracking(v);
HelicalTrackStrip newstrip = new HelicalTrackStrip(neworigin, newu, newv, umeas, du, vmin, vmax, dedx, time, rthList, detname, layer, bec); for (MCParticle p : strip.MCParticles()) { newstrip.addMCParticle(p);
diff -u -r1.1 -r1.2 --- SingleSensorTrackerReconDriver.java 13 Mar 2013 02:07:40 -0000 1.1 +++ SingleSensorTrackerReconDriver.java 15 Oct 2013 00:33:54 -0000 1.2 @@ -113,8 +113,7 @@
} List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(this.getClass().getResourceAsStream(strategyResource)); SeedTracker stFinal = new SeedTracker(sFinallist,this.includeMS);
- HPSTransformations hpstrans = new HPSTransformations(); - stFinal.setMaterialManagerTransform(hpstrans.getTransform());
+ stFinal.setMaterialManagerTransform(HPSTransformations.getTransform());
stFinal.setInputCollectionName(stInputCollectionName); stFinal.setTrkCollectionName(trackCollectionName); stFinal.setBField(bfield);
diff -u -r1.2 -r1.3 --- AlignmentParameters.java 16 Nov 2011 18:00:03 -0000 1.2 +++ AlignmentParameters.java 15 Oct 2013 00:33:54 -0000 1.3 @@ -66,12 +66,10 @@
FileWriter fWriter; PrintWriter pWriter; Set<SiSensor> _process_sensors = new HashSet<SiSensor>();
- private HPSTransformations _detToTrk;
boolean _DEBUG = false; double smax = 1e3; public AlignmentParameters(String outfile) {
- _detToTrk = new HPSTransformations();
try { //open things up fWriter = new FileWriter(outfile);
@@ -320,7 +318,7 @@
private Hep3Matrix getTrackToStripRotation(HelicalTrackStrip strip) { ITransform3D detToStrip = GetGlobalToLocal(strip); Hep3Matrix detToStripMatrix = (BasicHep3Matrix) detToStrip.getRotation().getRotationMatrix();
- Hep3Matrix detToTrackMatrix = (BasicHep3Matrix) _detToTrk.getMatrix();
+ Hep3Matrix detToTrackMatrix = (BasicHep3Matrix) HPSTransformations.getMatrix();
if (_DEBUG) { System.out.println("gblToLoc translation:");
diff -u -r1.2 -r1.3 --- MPAlignmentInputCalculator.java 27 Nov 2012 02:17:29 -0000 1.2 +++ MPAlignmentInputCalculator.java 15 Oct 2013 00:33:54 -0000 1.3 @@ -8,6 +8,7 @@
import hep.physics.matrix.BasicMatrix; import hep.physics.vec.BasicHep3Vector; import hep.physics.vec.Hep3Vector;
+
import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter;
@@ -15,10 +16,9 @@
import java.util.List; import java.util.logging.Level; import java.util.logging.Logger;
+
import org.lcsim.event.Track; import org.lcsim.fit.helicaltrack.HelicalTrackFit;
-import org.lcsim.hps.event.HPSTransformations; -import org.lcsim.hps.recon.tracking.TrackUtils;
import org.lcsim.hps.recon.tracking.TrackerHitUtils; import org.lcsim.hps.users.mgraham.alignment.RunAlignment; import org.lcsim.util.aida.AIDA;
@@ -37,7 +37,6 @@
protected String _type = "LOCAL"; protected Hep3Vector _bfield; protected ResLimit _resLimits;
- protected HPSTransformations _detToTrk;
protected AlignmentUtils _alignUtils; protected AlignmentUtils.OldAlignmentUtils _oldAlignUtils; protected AlignmentUtils.NumDerivatives _numDerivatives;
@@ -56,7 +55,6 @@
public MPAlignmentInputCalculator(String outfile,String type) { _glp = new ArrayList<GlobalParameter>(); _resLimits = new ResLimit();
- _detToTrk = new HPSTransformations();
_alignUtils = new AlignmentUtils(_DEBUG); _oldAlignUtils = new AlignmentUtils(_DEBUG).new OldAlignmentUtils(); _numDerivatives = new AlignmentUtils(_DEBUG).new NumDerivatives();
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