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:

r3519 - /projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/detector/converter/compact/EcalCrystal.java

From:

[log in to unmask]

Reply-To:

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

Date:

Tue, 10 Feb 2015 03:09:53 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (226 lines)

Author: [log in to unmask]
Date: Mon Feb  9 19:09:48 2015
New Revision: 3519

Log:
Remove conditions information from ECAL geometry API.  HPSJAVA-419

Modified:
    projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/detector/converter/compact/EcalCrystal.java

Modified: projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/detector/converter/compact/EcalCrystal.java
 =============================================================================
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/detector/converter/compact/EcalCrystal.java	(original)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/detector/converter/compact/EcalCrystal.java	Mon Feb  9 19:09:48 2015
@@ -1,27 +1,25 @@
 package org.lcsim.detector.converter.compact;
+
+import hep.physics.vec.BasicHep3Vector;
+import hep.physics.vec.Hep3Vector;
+import hep.physics.vec.VecOp;
 
 import org.lcsim.detector.DetectorElement;
 import org.lcsim.detector.IDetectorElement;
+import org.lcsim.detector.IGeometryInfo;
 import org.lcsim.detector.identifier.IIdentifier;
+import org.lcsim.detector.solids.Trd;
 
 /**
  * This class implements behavior specific to the ECal crystals of the HPS experiment, 
  * which includes access to time dependent conditions as well as DAQ setup information.
  * @author Jeremy McCormick <[log in to unmask]>
  */
+// TODO: Add method for getting an EcalCrystal objects neighbors.
+// FIXME: Remove conditions.  These should come directly from conditions objects instead.
 public class EcalCrystal extends DetectorElement {
-
-    /** Electronics setup. */
-    int crate;
-    int slot;
-    int channel;
-
-    /** Time dependent conditions data. */
-    boolean badChannel = false;
-    double pedestal = Double.NaN;
-    double noise = Double.NaN;
-    double gain = Double.NaN;
-    double timeShift = Double.NaN;
+    
+    Hep3Vector positionFront;
 
     /**
      * Class constructor.
@@ -32,133 +30,6 @@
      */
     EcalCrystal(String name, IDetectorElement parent, String path, IIdentifier id) {
         super(name, parent, path, id);
-    }
-
-    /**
-     * Set the bad channel flag.    
-     * @param badChannel True if channel is bad; false if not.
-     */
-    public void setBadChannel(boolean badChannel) {
-        this.badChannel = badChannel;
-    }
-
-    /**
-     * Set the pedestal value.
-     * @param pedestal The pedestal value.
-     */
-    public void setPedestal(double pedestal) {
-        this.pedestal = pedestal;
-    }
-
-    /**
-     * Set the noise value.
-     * @param noise The noise value.
-     */
-    public void setNoise(double noise) {
-        this.noise = noise;
-    }
-
-    /**
-     * Set the gain value.
-     * @param gain The gain value.
-     */
-    public void setGain(double gain) {
-        this.gain = gain;
-    }
-    
-    /**
-     * Set the time shift value in nanoseconds.
-     */
-    public void setTimeShift(double timeShift) {
-        this.timeShift = timeShift;
-    }
-
-    /**
-     * Set the crate value.
-     * @param crate The crate value.
-     */
-    public void setCrate(int crate) {
-        this.crate = crate;
-    }
-
-    /**
-     * Set the slot value.
-     * @param slot The slot value.
-     */
-    public void setSlot(int slot) {
-        this.slot = slot;
-    }
-
-    /**
-     * Set the channel value.
-     * @param channel The channel value.
-     */
-    public void setChannel(int channel) {
-        this.channel = channel;
-    }
-
-    /**
-     * Get whether this is a bad channel or not.
-     * @return True if is bad channel; false if not.
-     */
-    public boolean isBadChannel() {
-        return badChannel;
-    }
-
-    /**
-     * Get the pedestal value.
-     * @return The pedestal value.
-     */
-    public double getPedestal() {
-        return pedestal;
-    }
-
-    /**
-     * Get the noise value.
-     * @return The noise value.
-     */
-    public double getNoise() {
-        return noise;
-    }
-
-    /**
-     * Get the gain value.
-     * @return The gain value.
-     */
-    public double getGain() {
-        return gain;
-    }
-    
-    /**
-     * Get the time shift in nanoseconds.
-     * @return the time shift
-     */
-    public double getTimeShift() {
-        return timeShift;
-    }
-
-    /**
-     * Get the crate number.
-     * @return The crate number.
-     */
-    public int getCrate() {
-        return crate;
-    }
-
-    /**
-     * Get the slot number.
-     * @return The slot number.
-     */
-    public int getSlot() {
-        return slot;
-    }
-    
-    /**
-     * Get the channel number.
-     * @return The channel number.
-     */
-    public int getChannel() {
-        return channel;
     }
     
     /**
@@ -176,16 +47,21 @@
     public int getY() {
         return getIdentifierHelper().getValue(getIdentifier(), "iy");
     }
+           
+    /**
+     * Get the global center position of the XY plane in the front of the crystal.
+     * This is used in the recon clustering algorithm for the "corrected"
+     * hit position, so it is best to cache it once used for performance purposes.
+     * @return The center position of the XY plane in the front of the crystal.
+     */
+    public Hep3Vector getPositionFront() {
+        if (positionFront == null) {
+            IGeometryInfo geom = getGeometry();
+            double[] p = geom.transformLocalToGlobal(VecOp.add(geom.transformGlobalToLocal(geom.getPosition()), 
+                            (Hep3Vector) new BasicHep3Vector(0, 0, -1 * ((Trd) geom.getLogicalVolume().getSolid()).getZHalfLength()))).v();
+            positionFront = new BasicHep3Vector(p[0], p[1], p[2]);
+        }
+        return positionFront;
+    }
     
-    /**
-     * Reset the time dependent conditions.  This will NOT reset
-     * hardware information as it is considered fixed once set.
-     */
-    public void resetConditions() {
-        badChannel = false;
-        pedestal = Double.NaN;
-        noise = Double.NaN;
-        gain = Double.NaN;
-        timeShift = Double.NaN;
-    }
 }

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