LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  September 2015

HPS-SVN September 2015

Subject:

r3514 - /java/trunk/tracking/src/main/java/org/hps/recon/tracking/TrackDataDriver.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Thu, 3 Sep 2015 21:41:26 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (162 lines)

Author: [log in to unmask]
Date: Thu Sep  3 14:41:20 2015
New Revision: 3514

Log:
Add a track state to a track containing the track paramters and position of the track at the Ecal face.  The distance to the Ecal face is taken from the compact description. 

Modified:
    java/trunk/tracking/src/main/java/org/hps/recon/tracking/TrackDataDriver.java

Modified: java/trunk/tracking/src/main/java/org/hps/recon/tracking/TrackDataDriver.java
 =============================================================================
--- java/trunk/tracking/src/main/java/org/hps/recon/tracking/TrackDataDriver.java	(original)
+++ java/trunk/tracking/src/main/java/org/hps/recon/tracking/TrackDataDriver.java	Thu Sep  3 14:41:20 2015
@@ -10,6 +10,7 @@
 import org.lcsim.event.LCRelation;
 import org.lcsim.event.RawTrackerHit;
 import org.lcsim.event.Track;
+import org.lcsim.event.TrackState;
 import org.lcsim.event.TrackerHit;
 import org.lcsim.event.base.BaseLCRelation;
 import org.lcsim.event.RelationalTable;
@@ -17,25 +18,87 @@
 import org.lcsim.fit.helicaltrack.HelicalTrackCross;
 import org.lcsim.fit.helicaltrack.HelicalTrackHit;
 import org.lcsim.fit.helicaltrack.HelicalTrackStrip;
+import org.lcsim.geometry.Detector;
+import org.lcsim.geometry.FieldMap;
 import org.lcsim.recon.tracking.seedtracker.SeedTrack;
 import org.lcsim.util.Driver;
 
 /**
- * Driver used to persist additional {@link Track} information via a {@link GenericObject}.
+ * Driver used to persist additional {@link Track} information via a
+ * {@link GenericObject}.
  *
  * @author <a href="mailto:[log in to unmask]">Omar Moreno</a>
  * @author <a href="[log in to unmask]">Sho Uemura</a>
  */
 public final class TrackDataDriver extends Driver {
 
+    /** The B field map */
+    FieldMap bFieldMap = null;
+    
     /** Collection Names */
-    private String trackResidualsCollectionName = "TrackResiduals";
-    private String rotatedHthRelationsColName = "RotatedHelicalTrackHitRelations";
-    private String rotatedHthCollectionName = "RotatedHelicalTrackHits";
-    private String trackResidualsRelationsColName = "TrackResidualsRelations";
-
+    
+    /** Collection name of TrackResidualData objects */
+    private static final String TRK_RESIDUALS_COL_NAME = "TrackResiduals";
+    
+    /** 
+     * Collection name of LCRelations between a Track and Rotated 
+     * HelicalTrackHits 
+     */
+    private static final String ROTATED_HTH_REL_COL_NAME = "RotatedHelicalTrackHitRelations";
+    
+    /** Collection name of Rotated HelicalTrackHits */
+    private static final String ROTATED_HTH_COL_NAME = "RotatedHelicalTrackHits";
+    
+    /** 
+     * Collection name of LCRelations between a Track and  TrackResidualsData
+     * objects.
+     */
+    private static final String TRK_RESIDUALS_REL_COL_NAME = "TrackResidualsRelations";
+
+    /** 
+     * Name of the constant denoting the position of the Ecal face in the 
+     * compact description.
+     */
+    private static final String ECAL_POSITION_CONSTANT_NAME = "ecal_dface";
+   
+    /** Position of the Ecal face */
+    private double ecalPosition = 0; // mm
+   
+    /** Z position to start extrapolation from */
+    double extStartPos = 700; // mm
+   
+    /** The extrapolation step size */ 
+    double stepSize = 5.0; // mm
+    
     /** Default constructor */
     public TrackDataDriver() {
+    }
+   
+    /**
+     * Set the position along Z where the extrapolation of a track should
+     * begin.
+     * 
+     * @param extStartPoint Position along Z where the extrapolation should 
+     *                      begin
+     */
+    void setExtrapolationStartPosition(double extStartPos) { 
+        this.extStartPos = extStartPos; 
+    }
+    
+    /**
+     * Method called by the framework when a new {@link Detector} geometry is
+     * loaded. This method is called at the beginning of every run and 
+     * provides access to the {@link Detector} object itself.
+     * 
+     * @param detector LCSim {@link Detector} geometry 
+     */     
+    protected void detectorChanged(Detector detector) { 
+       
+        // Get the field map from the detector object
+        bFieldMap = detector.getFieldMap(); 
+        
+        // Get the position of the Ecal from the compact description
+        ecalPosition = detector.getConstants().get(ECAL_POSITION_CONSTANT_NAME).getValue();
     }
    
     /**
@@ -57,7 +120,7 @@
 
         // Get the collection of LCRelations relating RotatedHelicalTrackHits to
         // HelicalTrackHits
-        List<LCRelation> rotatedHthToHthRelations = event.get(LCRelation.class, rotatedHthRelationsColName);
+        List<LCRelation> rotatedHthToHthRelations = event.get(LCRelation.class, ROTATED_HTH_REL_COL_NAME);
         BaseRelationalTable hthToRotatedHth = new BaseRelationalTable(RelationalTable.Mode.ONE_TO_ONE,
                         RelationalTable.Weighting.UNWEIGHTED);
         hthToRotatedHth.addRelations(rotatedHthToHthRelations);
@@ -65,7 +128,7 @@
         RelationalTable hitToStrips = TrackUtils.getHitToStripsTable(event);
         RelationalTable hitToRotated = TrackUtils.getHitToRotatedTable(event);
 
-        List<HelicalTrackHit> rotatedHths = event.get(HelicalTrackHit.class, rotatedHthCollectionName);
+        List<HelicalTrackHit> rotatedHths = event.get(HelicalTrackHit.class, ROTATED_HTH_COL_NAME);
 
         // Create a container that will be used to store all TrackData objects.
         List<TrackData> trackDataCollection = new ArrayList<TrackData>();
@@ -190,6 +253,16 @@
                     }
                 }
 
+                //
+                // Add a track state that contains the extrapolated track position and 
+                // parameters at the face of the Ecal.
+                //
+                
+                // Extrapolate the track to the face of the Ecal and get the TrackState
+                TrackState state 
+                    = TrackUtils.extrapolateTrackUsingFieldMap(track, extStartPos, ecalPosition, stepSize, bFieldMap, false);
+                track.getTrackStates().add(state);
+                
                 // The track time is the mean t0 of hits on a track
                 trackTime = totalT0 / totalHits;
              
@@ -217,7 +290,7 @@
         // Add all collections to the event
         event.put(TrackData.TRACK_DATA_COLLECTION, trackDataCollection, TrackTimeData.class, 0);
         event.put(TrackData.TRACK_DATA_RELATION_COLLECTION, trackDataRelations, LCRelation.class, 0);
-        event.put(trackResidualsCollectionName, trackResidualsCollection, TrackResidualsData.class, 0);
-        event.put(trackResidualsRelationsColName, trackToTrackResidualsRelations, LCRelation.class, 0);
+        event.put(TRK_RESIDUALS_COL_NAME, trackResidualsCollection, TrackResidualsData.class, 0);
+        event.put(TRK_RESIDUALS_REL_COL_NAME, trackToTrackResidualsRelations, LCRelation.class, 0);
     }
 }

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use