LISTSERV mailing list manager LISTSERV 16.5

Help for LCDET-SVN Archives


LCDET-SVN Archives

LCDET-SVN Archives


LCDET-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

LCDET-SVN Home

LCDET-SVN Home

LCDET-SVN  February 2015

LCDET-SVN February 2015

Subject:

r3545 - /projects/lcsim/trunk/event-model/src/main/java/org/lcsim/event/base/BaseHit.java

From:

[log in to unmask]

Reply-To:

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

Date:

Sat, 14 Feb 2015 01:34:04 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (54 lines)

Author: [log in to unmask]
Date: Fri Feb 13 17:33:59 2015
New Revision: 3545

Log:
Fix bug where some hit positions were not written to LCIO output.  HPSJAVA-420

Modified:
    projects/lcsim/trunk/event-model/src/main/java/org/lcsim/event/base/BaseHit.java

Modified: projects/lcsim/trunk/event-model/src/main/java/org/lcsim/event/base/BaseHit.java
 =============================================================================
--- projects/lcsim/trunk/event-model/src/main/java/org/lcsim/event/base/BaseHit.java	(original)
+++ projects/lcsim/trunk/event-model/src/main/java/org/lcsim/event/base/BaseHit.java	Fri Feb 13 17:33:59 2015
@@ -177,17 +177,24 @@
     }       
     
     /**
-     * Calculate the position of the hit, depending on what variables are available on the object.
-     */
-    protected void calculatePosition() { 
-        // Was there no position information provided explicitly? 
-        if (positionVec == null) {                 
+     * Calculate the position of the hit, depending on what information is available on the object.
+     */
+    protected void calculatePosition() {
+        // Is the position not set already?
+        if (positionVec == null) {
+            
+            // Is the detector object not set yet?
+            if (detectorElement == null) {
+                // Try to find a detector object to link to this hit.
+                detectorElement = findDetectorElement(getIdentifier());
+            }
+            
             // Does the hit ID match the DetectorElement exactly?
-            if (this.detectorElement != null && detectorElement.getIdentifier().equals(getIdentifier())) {
+            if (detectorElement != null && detectorElement.getIdentifier().equals(getIdentifier())) {
                 // Set the position from the DetectorElement.
-                this.positionVec = detectorElement.getGeometry().getPosition();
+                this.positionVec = detectorElement.getGeometry().getPosition();                
             } else {
-                // This is what should happen for IDs with virtual cell values.
+                // This is what should happen for IDs with virtual segmentation values.
                 // The IDDecoder needs to be used here if it is set on the hit.
                 if (this.metaData != null) {
                     IDDecoder decoder = this.getIDDecoder();

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1

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

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