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  August 2015

HPS-SVN August 2015

Subject:

r3463 - /java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java

From:

[log in to unmask]

Reply-To:

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

Date:

Sat, 29 Aug 2015 19:37:39 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (317 lines)

Author: [log in to unmask]
Date: Sat Aug 29 12:37:36 2015
New Revision: 3463

Log:
Vertex e-e- tracks and make Moller candidates. Set the charge of the vertexed particles.  This driver needs to be extensively cleaned up and the documentation needs to be changed so it makes sense.

Modified:
    java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java

Modified: java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java
 =============================================================================
--- java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java	(original)
+++ java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java	Sat Aug 29 12:37:36 2015
@@ -9,12 +9,13 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.lcsim.event.EventHeader;
 import org.lcsim.event.ReconstructedParticle;
 import org.lcsim.event.Track;
+import org.lcsim.event.Vertex;
 import org.lcsim.event.base.BaseReconstructedParticle;
 import org.lcsim.fit.helicaltrack.HelicalTrackFit;
 import org.lcsim.recon.tracking.seedtracker.SeedTrack;
-
 import org.hps.recon.tracking.CoordinateTransformations;
 import org.hps.recon.vertexing.BilliorTrack;
 import org.hps.recon.vertexing.BilliorVertex;
@@ -25,9 +26,72 @@
  * V0 candidates and does vertex fits.
  * 
  * @author Omar Moreno <[log in to unmask]>
- * @version $Id$
  */
 public class HpsReconParticleDriver extends ReconParticleDriver {
+  
+    /**
+     * LCIO collection name for Moller candidate particles generated without
+     * constraints.
+     */
+    protected String unconstrainedMollerCandidatesColName = "UnconstrainedMollerCandidates";
+    /**
+     * LCIO collection name for Moller candidate particles generated with beam spot
+     * constraints.
+     */
+    protected String beamConMollerCandidatesColName = "BeamspotConstrainedMollerCandidates"; ;
+    /**
+     * LCIO collection name for Moller candidate particles generated with target
+     * constraints.
+     */
+    protected String targetConMollerCandidatesColName = "TargetConstrainedMollerCandidates";
+    /**
+     * LCIO collection name for Moller candidate vertices generated without
+     * constraints.
+     */
+    protected String unconstrainedMollerVerticesColName = "UnconstrainedMollerVertices";
+    /**
+     * LCIO collection name for Moller candidate vertices generated with beam spot
+     * constraints.
+     */
+    protected String beamConMollerVerticesColName = "BeamspotConstrainedMollerVertices";
+    /**
+     * LCIO collection name for Moller candidate vertices generated with target
+     * constraints.
+     */
+    protected String targetConMollerVerticesColName = "TargetConstrainedMollerVertices";
+   
+    /**
+     * Stores reconstructed Moller candidate particles generated without
+     * constraints.
+     */
+    protected List<ReconstructedParticle> unconstrainedMollerCandidates;
+    /**
+     * Stores reconstructed Moller candidate particles generated with beam spot
+     * constraints.
+     */
+    protected List<ReconstructedParticle> beamConMollerCandidates;
+    /**
+     * Stores reconstructed Moller candidate particles generated with target
+     * constraints.
+     */
+    protected List<ReconstructedParticle> targetConMollerCandidates;
+    /**
+     * Stores reconstructed Moller candidate vertices generated without constraints.
+     */
+    protected List<Vertex> unconstrainedMollerVertices;
+    /**
+     * Stores reconstructed Moller candidate vertices generated with beam spot
+     * constraints.
+     */
+    protected List<Vertex> beamConMollerVertices;
+    /**
+     * Stores reconstructed Moller candidate vertices generated with target
+     * constraints.
+     */
+    protected List<Vertex> targetConMollerVertices;
+
+    
+    
     /**
      * Represents a type of constraint for vertex fitting.
      * 
@@ -41,7 +105,35 @@
         /** Represents a fit with target constraints. */
         TARGET_CONSTRAINED
     }
-    
+
+    
+    /**
+     * Processes the track and cluster collections in the event into
+     * reconstructed particles and V0 candidate particles and vertices. These
+     * reconstructed particles are then stored in the event.
+     *
+     * @param event - The event to process.
+     */
+    @Override
+    protected void process(EventHeader event) {
+        
+        unconstrainedMollerCandidates = new ArrayList<ReconstructedParticle>();
+        beamConMollerCandidates = new ArrayList<ReconstructedParticle>();
+        targetConMollerCandidates = new ArrayList<ReconstructedParticle>();
+        unconstrainedMollerVertices = new ArrayList<Vertex>();
+        beamConMollerVertices = new ArrayList<Vertex>();
+        targetConMollerVertices = new ArrayList<Vertex>();
+        
+        super.process(event);
+        
+        event.put(unconstrainedMollerCandidatesColName, unconstrainedMollerCandidates, ReconstructedParticle.class, 0);
+        event.put(beamConMollerCandidatesColName, beamConMollerCandidates, ReconstructedParticle.class, 0);
+        event.put(targetConMollerCandidatesColName, targetConMollerCandidates, ReconstructedParticle.class, 0);
+        event.put(unconstrainedMollerVerticesColName, unconstrainedMollerVertices, Vertex.class, 0);
+        event.put(beamConMollerVerticesColName, beamConMollerVertices, Vertex.class, 0);
+        event.put(targetConMollerVerticesColName, targetConMollerVertices, Vertex.class, 0);
+    }
+        
     /**
      * Creates reconstructed V0 candidate particles and vertices for
      * electron positron pairs using no constraints, beam constraints,
@@ -52,47 +144,37 @@
      */
     @Override
     protected void findVertices(List<ReconstructedParticle> electrons, List<ReconstructedParticle> positrons) {
+        
         // Iterate over the positrons and electrons to perform vertexing
         // on the pairs.
         for(ReconstructedParticle positron : positrons) {
             for(ReconstructedParticle electron : electrons) {
                
                 // Only vertex particles that are of the same type. This is
-                // only needed when using multiple track collections.  
+                // only needed when using multiple track collections and 
+                // should be removed once all strategies are combined into one.
                 if (positron.getType() != electron.getType()) continue;
                 
-                // Get the tracks associated with the electron and
-                // the positron.
-                Track electronTrack = electron.getTracks().get(0); 
-                Track positronTrack = positron.getTracks().get(0); 
-                
-                // Covert the tracks to BilliorTracks.
-                BilliorTrack electronBTrack = toBilliorTrack(electronTrack); 
-                BilliorTrack positronBTrack = toBilliorTrack(positronTrack);
-                
-                // Create candidate particles for each constraint.
-                for(Constraint constraint : Constraint.values()) {
-                    // Generate a candidate vertex and particle.
-                    BilliorVertex vtxFit = fitVertex(constraint, electronBTrack, positronBTrack);
-                    ReconstructedParticle candidate = makeReconstructedParticle(electron, positron, vtxFit); 
-                    
-                    // Add the candidate vertex and particle to the
-                    // appropriate LCIO collection.
-                    switch(constraint){
-                        case UNCONSTRAINED: 
-                            unconstrainedV0Vertices.add(vtxFit);
-                            unconstrainedV0Candidates.add(candidate); 
-                            break;
-                        case BS_CONSTRAINED:
-                            beamConV0Vertices.add(vtxFit);
-                            beamConV0Candidates.add(candidate);
-                            break;
-                        case TARGET_CONSTRAINED:
-                            targetConV0Vertices.add(vtxFit);
-                            targetConV0Candidates.add(candidate);
-                            break;
-                    }
-                }
+                // Make V0 candidates
+                this.makeV0Candidates(electron, positron);
+            }
+        }
+        
+        // Iterate over the collection of electrons and create e-e- pairs 
+        for (int firstElectronN = 0; firstElectronN < electrons.size(); firstElectronN++) { 
+            for (int secondElectronN = firstElectronN + 1; secondElectronN < electrons.size(); secondElectronN++) {
+               
+                // Only vertex particles that are of the same type. This is
+                // only needed when using multiple track collections and 
+                // should be removed once all strategies are combined into one.
+                if (electrons.get(firstElectronN).getType() != electrons.get(secondElectronN).getType()) continue;
+            
+                // Don't vertex the same particles.  This is needed when making
+                // Moller candidates.
+                if (electrons.get(firstElectronN) == electrons.get(secondElectronN)) continue;
+           
+                // Make Moller candidates
+                this.makeMollerCandidates(electrons.get(firstElectronN), electrons.get(secondElectronN));
             }
         }
     }
@@ -107,7 +189,7 @@
         // them to the default names.
         if(unconstrainedV0CandidatesColName == null) { unconstrainedV0CandidatesColName = "UnconstrainedV0Candidates"; }
         if(beamConV0CandidatesColName == null) { beamConV0CandidatesColName = "BeamspotConstrainedV0Candidates"; }
-        if(targetConV0CandidatesColName == null) { targetConV0CandidatesColName = "TargetConstrainedV0Candidates";     }
+        if(targetConV0CandidatesColName == null) { targetConV0CandidatesColName = "TargetConstrainedV0Candidates"; }
         if(unconstrainedV0VerticesColName == null) { unconstrainedV0VerticesColName = "UnconstrainedV0Vertices"; }
         if(beamConV0VerticesColName == null) { beamConV0VerticesColName = "BeamspotConstrainedV0Vertices"; }
         if(targetConV0VerticesColName == null) { targetConV0VerticesColName = "TargetConstrainedV0Vertices"; }
@@ -149,6 +231,84 @@
         
         // Find and return a vertex based on the tracks.
         return vtxFitter.fitVertex(billiorTracks);
+    }
+    
+    /**
+     * 
+     */
+    private void makeV0Candidates(ReconstructedParticle electron, ReconstructedParticle positron) { 
+
+        // Covert the tracks to BilliorTracks.
+        BilliorTrack electronBTrack = toBilliorTrack(electron.getTracks().get(0)); 
+        BilliorTrack positronBTrack = toBilliorTrack(positron.getTracks().get(0));
+
+        // Create candidate particles for each constraint.
+        for(Constraint constraint : Constraint.values()) {
+            
+            // Generate a candidate vertex and particle.
+            BilliorVertex vtxFit = fitVertex(constraint, electronBTrack, positronBTrack);
+            ReconstructedParticle candidate = this.makeReconstructedParticle(electron, positron, vtxFit); 
+            
+            // Add the candidate vertex and particle to the
+            // appropriate LCIO collection.
+            switch(constraint){
+            
+                case UNCONSTRAINED: 
+                    unconstrainedV0Vertices.add(vtxFit);
+                    unconstrainedV0Candidates.add(candidate); 
+                    break;
+                
+                case BS_CONSTRAINED:
+                    beamConV0Vertices.add(vtxFit);
+                    beamConV0Candidates.add(candidate);
+                    break;
+                
+                case TARGET_CONSTRAINED:
+                    targetConV0Vertices.add(vtxFit);
+                    targetConV0Candidates.add(candidate);
+                    break;
+                
+            }
+        }
+    }
+    
+    /**
+     * 
+     */
+    private void makeMollerCandidates(ReconstructedParticle firstElectron, ReconstructedParticle secondElectron) { 
+
+        // Covert the tracks to BilliorTracks.
+        BilliorTrack firstElectronBTrack = toBilliorTrack(firstElectron.getTracks().get(0)); 
+        BilliorTrack secondElectronBTrack = toBilliorTrack(secondElectron.getTracks().get(0));
+
+        // Create candidate particles for each constraint.
+        for(Constraint constraint : Constraint.values()) {
+            
+            // Generate a candidate vertex and particle.
+            BilliorVertex vtxFit = fitVertex(constraint, firstElectronBTrack, secondElectronBTrack);
+            ReconstructedParticle candidate = this.makeReconstructedParticle(firstElectron, secondElectron, vtxFit); 
+            
+            // Add the candidate vertex and particle to the
+            // appropriate LCIO collection.
+            switch(constraint){
+            
+                case UNCONSTRAINED: 
+                    unconstrainedMollerVertices.add(vtxFit);
+                    unconstrainedMollerCandidates.add(candidate); 
+                    break;
+                
+                case BS_CONSTRAINED:
+                    beamConMollerVertices.add(vtxFit);
+                    beamConMollerCandidates.add(candidate);
+                    break;
+                
+                case TARGET_CONSTRAINED:
+                    targetConMollerVertices.add(vtxFit);
+                    targetConMollerCandidates.add(candidate);
+                    break;
+                
+            }
+        }
     }
     
     /**
@@ -197,6 +357,10 @@
         //((BasicHepLorentzVector) fourVector).setV3(fourVector.t(), fittedMomentum);
         ((BaseReconstructedParticle) candidate).set4Vector(fourVector);
         
+        // Set the charge of the particle
+        double particleCharge = electron.getCharge() + positron.getCharge();
+       ((BaseReconstructedParticle) candidate).setCharge(particleCharge);
+        
         // VERBOSE :: Output the fitted momentum data.
         printDebug("Fitted momentum in tracking frame: " + fittedMomentum.toString());
         printDebug("Fitted momentum in detector frame: " + fittedMomentum.toString());

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