@@ -101,7 +101,7 @@ public class KalmanInterface {
101101 private int nBigEvents ;
102102 private int eventNumber ;
103103 private static double target_pos = -999.9 ;
104- private static boolean addTrackStateAtTarget = false ;
104+ private static boolean addTrackStateAtTarget = true ;
105105 private double [] beamPosition = null ;
106106
107107 private static final boolean debug = false ;
@@ -698,41 +698,10 @@ public BaseTrack createTrack(KalTrack kT, boolean storeTrackStates) {
698698 double BAtEcal = BfieldAtEcal .mag ();
699699 double alphaAtEcal = conFac / BAtEcal ;
700700
701- /*
702-
703- DMatrixRMaj ecalCov = new DMatrixRMaj(getCovarianceFromHelix(helixAtEcal));
704- double[] ecalParams = helixAtEcal.a.v.clone();
705- double[] ecalLCSimParams = getLCSimParams(ecalParams, alphaAtEcal);
706- double[] ecalLCSimCov = getLCSimCov(ecalCov, alphaAtEcal).asPackedArray(true);
707- double[] refAtEcal = localKalToHps(helixAtEcal.origin);
708- if(debug)System.out.println(this.getClass().getName()+":: reference to TrackState @ ecal = "+
709- +refAtEcal[0]+", "+refAtEcal[1]+","+ refAtEcal[2]);
710- TrackState ts_ecal_helix = new BaseTrackState(ecalLCSimParams,refAtEcal, ecalLCSimCov, TrackState.AtCalorimeter, BAtEcal);
711- if(debug)System.out.println(this.getClass().getName()+":: Uncorrected track state: curvature = "+ts_ecal_helix.getOmega()
712- +" bField = "+ts_ecal_helix.getBLocal()+" momentum z = "+ts_ecal_helix.getMomentum()[0]);
713- System.out.println("Helix at ECal from kT.getHelixAtPlane and by hand conversions ");
714- System.out.println(ts_ecal_helix.toString());
715- */
716- //newTrack.getTrackStates().add(ts_ecal_helix);
717-
718-
719- // this is how createTrackState (above) goes from measurement to TrackState
720- // from the measurements. It calls toHPShelix.
721- // the helix state here must already be propagated
722- // helix.toTrackState(alphaCenter, ms.m.p, loc);
723-
724701 TrackState ts_ecal =helixAtEcal .toTrackState (alphaAtEcal , ecalPlane , TrackState .AtCalorimeter , saveTrackStateAtIntercept );
725702 newTrack .getTrackStates ().add (ts_ecal );
726- //if(debug)System.out.println("Helix at ECal from helix.toTrackState");
727- // if(debug)System.out.println(ts_toTrackState.toString());
728- // System.out.println("Helix at ECal from helix.toTrackState");
729- // System.out.println(ts_toTrackState.toString());
730-
731- // Extrapolate to the ECAL and make a new trackState there.
732- //BaseTrackState ts_ecal = new BaseTrackState();
733- //ts_ecal = TrackUtils.getTrackExtrapAtEcalRK(newTrack, fM, runNumber);
734703
735- Vec targetFace =origin ;
704+ Vec targetFace =new Vec ( kPar . beamSpot [ 0 ], kPar . beamSpot [ 1 ], kPar . beamSpot [ 2 ]);
736705 Plane targetPlane = new Plane (targetFace , new Vec (0. , 1. , 0. ));
737706 HelixState helixAtTarget =kT .getHelixAtPlane (targetPlane ,saveTrackStateAtIntercept ); // this propagates (via RK) the helix to the plane
738707 Vec BfieldAtTarget = KalmanInterface .getField (helixAtTarget .origin , kT .SiteList .get (0 ).m .Bfield );
0 commit comments