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:

r3570 - in /java/trunk: recon/src/main/java/org/hps/recon/particle/ steering-files/src/main/resources/org/hps/steering/recon/ tracking/src/main/java/org/hps/recon/tracking/

From:

[log in to unmask]

Reply-To:

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

Date:

Wed, 9 Sep 2015 22:49:40 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (226 lines)

Author: [log in to unmask]
Date: Wed Sep  9 15:49:35 2015
New Revision: 3570

Log:
identify and split out partial tracks

Modified:
    java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java
    java/trunk/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullReconMC_Pass2.lcsim
    java/trunk/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_Pass2.lcsim
    java/trunk/tracking/src/main/java/org/hps/recon/tracking/MergeTrackCollections.java

Modified: java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java
 =============================================================================
--- java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java	(original)
+++ java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java	Wed Sep  9 15:49:35 2015
@@ -36,6 +36,8 @@
     /** Utility used to determine if a track and cluster are matched */
     TrackClusterMatcher matcher = new TrackClusterMatcher(); 
     
+    String[] trackCollectionNames = null;
+    
     /**
      * Sets the name of the LCIO collection for beam spot constrained V0
      * candidate particles.
@@ -152,6 +154,15 @@
      */
     public void setUnconstrainedV0VerticesColName(String unconstrainedV0VerticesColName) {
         this.unconstrainedV0VerticesColName = unconstrainedV0VerticesColName;
+    }
+
+    /**
+     * Set the names of the LCIO track collections used as input.
+     *
+     * @param trackCollectionNames Array of collection names. If not set, use all Track collections in the event.
+     */
+    public void setTrackCollectionNames(String[] trackCollectionNames) {
+        this.trackCollectionNames = trackCollectionNames;
     }
 
     /**
@@ -365,12 +376,19 @@
         // collection and add it to the list of collections.  This is 
         // needed in order to create final state particles from the the 
         // Ecal clusters in the event.
-        List<List<Track>> trackCollections;
-        if (event.hasCollection(Track.class)) {
-            trackCollections = event.get(Track.class);
+        List<List<Track>> trackCollections = new ArrayList<List<Track>>();
+        if (trackCollectionNames != null) {
+            for (String collectionName : trackCollectionNames) {
+                if (event.hasCollection(Track.class, collectionName)) {
+                    trackCollections.add(event.get(Track.class, collectionName));
+                }
+            }
         } else {
-            trackCollections = new ArrayList<List<Track>>(0);
-            trackCollections.add(new ArrayList<Track>(0));
+            if (event.hasCollection(Track.class)) {
+                trackCollections = event.get(Track.class);
+            } else {
+                trackCollections.add(new ArrayList<Track>(0));
+            }
         }
 
         // Instantiate new lists to store reconstructed particles and

Modified: java/trunk/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullReconMC_Pass2.lcsim
 =============================================================================
--- java/trunk/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullReconMC_Pass2.lcsim	(original)
+++ java/trunk/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullReconMC_Pass2.lcsim	Wed Sep  9 15:49:35 2015
@@ -123,32 +123,12 @@
         <driver name="GBLRefitterDriver" type="org.hps.recon.tracking.gbl.HpsGblRefitter"/>
         <driver name="EcalRawConverter" type="org.hps.recon.ecal.EcalRawConverterDriver">
             <ecalCollectionName>EcalCalHits</ecalCollectionName>
-            <use2014Gain>false</use2014Gain>
-            <useTimestamps>false</useTimestamps>
-            <useTruthTime>false</useTruthTime>
-            <useRunningPedestal>false</useRunningPedestal>
-            <useTimeWalkCorrection>false</useTimeWalkCorrection>
-            <emulateFirmware>true</emulateFirmware>
-            <emulateMode7>true</emulateMode7>
-            <leadingEdgeThreshold>12</leadingEdgeThreshold>
-            <nsa>100</nsa>
-            <nsb>20</nsb>
-            <nPeak>3</nPeak>
-            <useFit>true</useFit>
             <fixShapeParameter>true</fixShapeParameter>
             <globalFixedPulseWidth>2.4</globalFixedPulseWidth>
-            <!--<debug>true</debug>-->
         </driver>       
         <driver name="ReconClusterer" type="org.hps.recon.ecal.cluster.ReconClusterDriver">
             <logLevel>WARNING</logLevel>
             <outputClusterCollectionName>EcalClusters</outputClusterCollectionName>
-            <hitEnergyThreshold>0.0075</hitEnergyThreshold>
-            <seedEnergyThreshold>0.050</seedEnergyThreshold> 
-            <clusterEnergyThreshold>0.100</clusterEnergyThreshold>
-            <minTime>0.0</minTime>
-            <timeWindow>25.0</timeWindow>
-            <useTimeCut>true</useTimeCut>
-            <writeRejectedHitCollection>false</writeRejectedHitCollection>
         </driver>
         <driver name="GTPOnlineClusterer" type="org.hps.recon.ecal.cluster.ClusterDriver">
             <logLevel>WARNING</logLevel>
@@ -160,10 +140,10 @@
         <driver name="CopyCluster" type="org.hps.recon.ecal.cluster.CopyClusterCollectionDriver">
             <inputCollectionName>EcalClusters</inputCollectionName>
             <outputCollectionName>EcalClustersCorr</outputCollectionName>
-            <storeHits>true</storeHits>
         </driver>       
         <driver name="ReconParticle" type="org.hps.recon.particle.HpsReconParticleDriver"> 
             <ecalClusterCollectionName>EcalClustersCorr</ecalClusterCollectionName>         
+            <trackCollectionNames>MatchedTracks GBLTracks</trackCollectionNames>
         </driver>
         <driver name="TrackDataDriver" type="org.hps.recon.tracking.TrackDataDriver" />
         <driver name="LCIOWriter" type="org.lcsim.util.loop.LCIODriver">

Modified: java/trunk/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_Pass2.lcsim
 =============================================================================
--- java/trunk/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_Pass2.lcsim	(original)
+++ java/trunk/steering-files/src/main/resources/org/hps/steering/recon/EngineeringRun2015FullRecon_Pass2.lcsim	Wed Sep  9 15:49:35 2015
@@ -132,6 +132,7 @@
         <driver name="TrackDataDriver" type="org.hps.recon.tracking.TrackDataDriver" />
         <driver name="ReconParticleDriver" type="org.hps.recon.particle.HpsReconParticleDriver" > 
             <ecalClusterCollectionName>EcalClustersCorr</ecalClusterCollectionName>        
+            <trackCollectionNames>MatchedTracks GBLTracks</trackCollectionNames>
         </driver>  
         <driver name="GBLOutputDriver" type="org.hps.recon.tracking.gbl.GBLOutputDriver"/>      
         <driver name="GBLRefitterDriver" type="org.hps.recon.tracking.gbl.HpsGblRefitter"/>

Modified: java/trunk/tracking/src/main/java/org/hps/recon/tracking/MergeTrackCollections.java
 =============================================================================
--- java/trunk/tracking/src/main/java/org/hps/recon/tracking/MergeTrackCollections.java	(original)
+++ java/trunk/tracking/src/main/java/org/hps/recon/tracking/MergeTrackCollections.java	Wed Sep  9 15:49:35 2015
@@ -25,14 +25,45 @@
 public class MergeTrackCollections extends Driver {
 
     private String outputCollectionName = "MatchedTracks";
+    private String partialTrackCollectionName = "PartialTracks";
     private boolean removeCollections = true;
+    private double badHitChisq = 10.0;
 
+    /**
+     * Name of the LCIO collection containing all good tracks.
+     *
+     * @param outputCollectionName Defaults to MatchedTracks.
+     */
     public void setOutputCollectionName(String outputCollectionName) {
         this.outputCollectionName = outputCollectionName;
     }
 
+    /**
+     * Name of the LCIO collection containing partial tracks (tracks whose hit
+     * content is a strict subset of another track).
+     *
+     * @param partialTrackCollectionName Defaults to PartialTracks.
+     */
+    public void setPartialTrackCollectionName(String partialTrackCollectionName) {
+        this.partialTrackCollectionName = partialTrackCollectionName;
+    }
+
+    /**
+     * Remove existing track collections after merging them.
+     *
+     * @param removeCollections Default to true.
+     */
     public void setRemoveCollections(boolean removeCollections) {
         this.removeCollections = removeCollections;
+    }
+
+    /**
+     * Set chisq threshold for partial tracks.
+     *
+     * @param badHitChisq Chisq threshold, default 10.
+     */
+    public void setBadHitChisq(double badHitChisq) {
+        this.badHitChisq = badHitChisq;
     }
 
     @Override
@@ -57,9 +88,11 @@
         }
 
         List<Track> deduplicatedTracks = new ArrayList<Track>();
+        Map<Track, Set<TrackerHit>> trackToHitsMap = new HashMap<Track, Set<TrackerHit>>();
 
-        for (List<Track> matchingTracks : hitsToTracksMap.values()) {
-            Track trk = matchingTracks.get(0);// pick lowest-chisq track (this probably doesn't matter)
+        for (Map.Entry<Set<TrackerHit>, List<Track>> mapEntry : hitsToTracksMap.entrySet()) {
+            List<Track> matchingTracks = mapEntry.getValue();
+            Track trk = matchingTracks.get(0);// pick lowest-chisq track
             for (Track matchingTrack : matchingTracks) {
                 if (matchingTrack.getChi2() < trk.getChi2()) {
                     trk = matchingTrack;
@@ -83,7 +116,22 @@
 
             ((SeedTrack) trk).setTrackType(trackType);
             deduplicatedTracks.add(trk);
+            trackToHitsMap.put(trk, mapEntry.getKey());
         }
+
+        List<Track> partialTracks = new ArrayList<Track>();
+        for (Track track : deduplicatedTracks) {
+            Set<TrackerHit> trackHits = trackToHitsMap.get(track);
+            for (Track otherTrack : deduplicatedTracks) {
+                Set<TrackerHit> otherTrackHits = trackToHitsMap.get(otherTrack);
+                if (otherTrackHits.size() > trackHits.size() && otherTrackHits.containsAll(trackHits) && otherTrack.getChi2() < track.getChi2() + badHitChisq) {
+//                    System.out.format("%f %d %f %d\n", track.getChi2(), trackHits.size(), otherTrack.getChi2(), otherTrackHits.size());
+                    partialTracks.add(track);
+                    break;
+                }
+            }
+        }
+        deduplicatedTracks.removeAll(partialTracks);
 
         if (removeCollections) {
             for (List<Track> tracklist : trackCollections) {
@@ -93,5 +141,6 @@
 
         int flag = 1 << LCIOConstants.TRBIT_HITS;
         event.put(outputCollectionName, deduplicatedTracks, Track.class, flag);
+        event.put(partialTrackCollectionName, partialTracks, Track.class, flag);
     }
 }

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