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  December 2014

LCDET-SVN December 2014

Subject:

r3459 - /projects/lcsim/trunk/event-model/src/main/java/org/lcsim/event/CalorimeterHit.java

From:

[log in to unmask]

Reply-To:

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

Date:

Wed, 17 Dec 2014 02:19:45 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (150 lines)

Author: [log in to unmask]
Date: Tue Dec 16 18:19:40 2014
New Revision: 3459

Log:
Add Comparators for time and raw energy.  Improve the javadoc.

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

Modified: projects/lcsim/trunk/event-model/src/main/java/org/lcsim/event/CalorimeterHit.java
 =============================================================================
--- projects/lcsim/trunk/event-model/src/main/java/org/lcsim/event/CalorimeterHit.java	(original)
+++ projects/lcsim/trunk/event-model/src/main/java/org/lcsim/event/CalorimeterHit.java	Tue Dec 16 18:19:40 2014
@@ -3,67 +3,107 @@
 import java.util.Comparator;
 
 /**
- * A hit in a calorimeter.
+ * <p>
+ * This class represents a hit in a calorimeter detector which has an energy 
+ * deposition in GeV, a time in nanoseconds, and an ID identifying its cell
+ * or channel in the detector.
+ * <p>
  * The super-interface gives access to subdetector, identifiers, iddecoder, etc.
  * @see org.lcsim.event.Hit
- * @author tonyj
+ * 
+ * @author Tony Johnson <[log in to unmask]>
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: CalorimeterHit.java,v 1.14 2013/02/01 01:55:51 jeremy Exp $
  */
-public interface CalorimeterHit
-extends HitWithPosition
-{
+public interface CalorimeterHit extends HitWithPosition {
+    
    /**
-    * Raw energy deposited in calorimeter cell.
+    * Get the raw energy deposition in GeV.
+    * @return The raw energy deposition.
     */
    public double getRawEnergy();
    
    /**
-    * Corrected energy deposited in calorimeter cell.
+    * Get the corrected energy deposition in GeV.
+    * @return The corrected energy deposition
     */
    public double getCorrectedEnergy();
    
    /**
-    * The energy error.
+    * Get the energy error.  (Units???)
+    * @return The energy error.
     */
    public double getEnergyError();
    
    /**
-    * The ID of the cell. This can be converted to a physical
-    * position using a IDDecoder object obtained from the hit
+    * Get the ID of the cell or channel. 
+    * This can be converted to a physical position using a IDDecoder object obtained from the hit
     * or from the collection's MetaData object.
+    * @return The cell or channel ID of the hit.
     */
    public long getCellID();
    
    /**
-    * Returns time of the earliest energy contrib time in ns.
-    * @return Hit time in ns.
+    * Get the time of the <b>earliest</b> energy contribution to this hit in nanoseconds.
+    * @return The hit time in nanoseconds.
     */
    public double getTime();
 
    /**
-    * The position of the hit. If the hit position is stored in the source
-    * LCIO file this will be returned. Otherwise the IDDecoder is used to get 
-    * the hit position from the hit ID.
+    * Get the position of the hit in millimeters with the global coordinate system. 
+    * If the hit position is stored in the LCIO data, this will be returned directly. 
+    * Otherwise the IDDecoder is used to get the hit position from the hit ID.
+    * @return The position in millimeters as a double array of length 3.
     */
    public double[] getPosition();
 
    /**
-    * The type of the hit.
+    * Get the type of the hit.
     * Mapping of integer types to type names through collection parameters
     * "CalorimeterHitTypeNames" and "CalorimeterHitTypeValues".
-    * @return
+    * @return The type of the hit.
     */
    public int getType();
    
    /**
-    * Perform comparison between corrected energy of calorimeter hits.
+    * CalorimeterHit corrected energy comparator.
     */
-   public static class CalorimeterHitEnergyComparator implements Comparator<CalorimeterHit> {
-
+   public static class CorrectedEnergyComparator implements Comparator<CalorimeterHit> {
+       /**
+        * Compare the corrected energy of the hits using the <code>Double.compare</code> method.
+        * @return -1 if o1's energy is less than o2's, 1 if o1's is greater than o2's, and 0 if equal.
+        */
        @Override
        public int compare(CalorimeterHit o1, CalorimeterHit o2) {
            return Double.compare(o1.getCorrectedEnergy(), o2.getCorrectedEnergy());
        }
    }   
+   
+   /**
+    * CalorimeterHit raw energy comparator.
+    */
+   public static class RawEnergyComparator implements Comparator<CalorimeterHit> {
+       /**
+        * Compare the raw energy of the hits using the <code>Double.compare</code> method.
+        * @return -1 if o1's energy is less than o2's, 1 if o1's is greater than o2's, and 0 if equal.
+        */
+       @Override
+       public int compare(CalorimeterHit o1, CalorimeterHit o2) {
+           return Double.compare(o1.getRawEnergy(), o2.getRawEnergy());
+       }
+   }   
+   
+   /**
+    * CalorimeterHit time comparator.
+    */
+   static class TimeComparator implements Comparator<CalorimeterHit> {
+       /**
+        * Compare the time of the hits using the <code>Double.compare</code> method.
+        * @return -1 if o1's time is less than o2's, 1 if o1's is greater than o2's, and 0 if equal.
+        */
+       @Override
+       public int compare(CalorimeterHit o1, CalorimeterHit o2) {
+           return Double.compare(o1.getTime(), o2.getTime());
+       }
+   }
+   
 }

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