lcsim/src/org/lcsim/recon/cluster/util
diff -u -r1.5 -r1.6
--- ClusterFirstLayerDecision.java 15 May 2007 01:52:03 -0000 1.5
+++ ClusterFirstLayerDecision.java 8 Mar 2010 19:37:34 -0000 1.6
@@ -1,13 +1,12 @@
package org.lcsim.recon.cluster.util;
-import hep.physics.vec.*;
import org.lcsim.event.Cluster;
import org.lcsim.event.CalorimeterHit;
import org.lcsim.util.decision.*;
-import org.lcsim.geometry.subdetector.CylindricalCalorimeter;
-import org.lcsim.geometry.Detector;
import org.lcsim.event.EventHeader;
+import org.lcsim.geometry.Calorimeter.CalorimeterType;
+import org.lcsim.recon.util.CalorimeterInformation;
/**
* Accept clusters if their innermost hit is in the first n layers
@@ -21,7 +20,7 @@
* check for these and reject corner hits if a particle
* would have to pass through > n layers to reach them.
*
- * @version $Id: ClusterFirstLayerDecision.java,v 1.5 2007/05/15 01:52:03 mcharles Exp $
+ * @version $Id: ClusterFirstLayerDecision.java,v 1.6 2010/03/08 19:37:34 cassell Exp $
*/
public class ClusterFirstLayerDecision implements DecisionMakerSingle<Cluster>
@@ -65,6 +64,25 @@
continue;
}
}
+ org.lcsim.geometry.IDDecoder id = hit.getIDDecoder();
+ id.setID(hit.getCellID());
+ int layer = id.getVLayer();
+ if(layer >= m_layerCut)continue;
+ if(!m_ignoreCorners)return true;
+ if(id.getSystemID() == m_ECAL_barrel_sysid)
+ {
+ int xl = (int) ((Math.abs(hit.getPosition()[2]) - m_ECAL_endcap_zmin)/m_ECAL_endcap_zstep);
+ if(layer+xl >= m_layerCut)continue;
+ return true;
+ }
+ else if(id.getSystemID() == m_HCAL_barrel_sysid)
+ {
+ int xl = (int) ((Math.abs(hit.getPosition()[2]) - m_HCAL_endcap_zmin)/m_HCAL_endcap_zstep);
+ if(layer+xl >= m_layerCut)continue;
+ return true;
+ }
+ return true;
+ /*
if (m_ignoreCorners) {
if (!m_initGeom) { throw new AssertionError("Geometry information not passed to "+this.getClass().getName()); }
org.lcsim.geometry.Subdetector subdet = hit.getSubdetector();
@@ -82,29 +100,48 @@
throw new AssertionError("Unrecognised event component: '"+subdet.getName()+"'");
}
}
- org.lcsim.geometry.IDDecoder id = hit.getIDDecoder();
- id.setID(hit.getCellID());
- int layer = id.getLayer();
if (innermostHit == null || layer < firstLayer ) {
firstLayer = layer;
innermostHit = hit;
}
+ */
}
+ /*
if (innermostHit==null) {
// No valid hits
return false;
} else {
return (firstLayer < m_layerCut);
}
+ */
+ return false;
}
protected boolean m_initGeom = false;
+ protected double m_ECAL_endcap_zmin;
+ protected double m_HCAL_endcap_zmin;
+ protected double m_ECAL_endcap_zstep;
+ protected double m_HCAL_endcap_zstep;
+ protected int m_ECAL_barrel_sysid;
+ protected int m_HCAL_barrel_sysid;
+ /*
protected double m_ECAL_barrel_layerN_r;
protected double m_ECAL_endcap_layerN_z;
protected double m_HCAL_barrel_layerN_r;
protected double m_HCAL_endcap_layerN_z;
+ */
public void initGeometry(EventHeader event) {
m_initGeom = true;
+ CalorimeterInformation ci = CalorimeterInformation.instance();
+ m_ECAL_barrel_sysid = ci.getSystemID(CalorimeterType.EM_BARREL);
+ m_HCAL_barrel_sysid = ci.getSystemID(CalorimeterType.HAD_BARREL);
+ m_ECAL_endcap_zmin = ci.getZMin(CalorimeterType.EM_ENDCAP);
+ m_HCAL_endcap_zmin = ci.getZMin(CalorimeterType.HAD_ENDCAP);
+ m_ECAL_endcap_zstep = ci.getSubdetector(CalorimeterType.EM_ENDCAP).getLayering().getDistanceToLayerSensorMid(1) -
+ ci.getSubdetector(CalorimeterType.EM_ENDCAP).getLayering().getDistanceToLayerSensorMid(0);
+ m_HCAL_endcap_zstep = ci.getSubdetector(CalorimeterType.HAD_ENDCAP).getLayering().getDistanceToLayerSensorMid(1) -
+ ci.getSubdetector(CalorimeterType.HAD_ENDCAP).getLayering().getDistanceToLayerSensorMid(0);
+ /*
Detector det = event.getDetector();
CylindricalCalorimeter ecal_barrel = ((CylindricalCalorimeter) det.getSubdetectors().get("EMBarrel"));
CylindricalCalorimeter ecal_endcap = ((CylindricalCalorimeter) det.getSubdetectors().get("EMEndcap"));
@@ -114,5 +151,6 @@
m_ECAL_endcap_layerN_z = ecal_endcap.getLayering().getDistanceToLayerSensorMid(m_layerCut);
m_HCAL_barrel_layerN_r = hcal_barrel.getLayering().getDistanceToLayerSensorMid(m_layerCut);
m_HCAL_endcap_layerN_z = hcal_endcap.getLayering().getDistanceToLayerSensorMid(m_layerCut);
+ */
}
}
lcsim/src/org/lcsim/recon/cluster/util
diff -u -r1.3 -r1.4
--- HitNearBarrelEndcapBoundaryDecision.java 4 Feb 2010 17:45:32 -0000 1.3
+++ HitNearBarrelEndcapBoundaryDecision.java 8 Mar 2010 19:37:34 -0000 1.4
@@ -10,7 +10,7 @@
/**
* Determine whether a hit is in the boundary region near the barrel/endcap interface.
*
- * @version $Id: HitNearBarrelEndcapBoundaryDecision.java,v 1.3 2010/02/04 17:45:32 cassell Exp $
+ * @version $Id: HitNearBarrelEndcapBoundaryDecision.java,v 1.4 2010/03/08 19:37:34 cassell Exp $
* @author Mat Charles
*/
@@ -147,22 +147,36 @@
// This is a bit different because we're now dealing with a longitudinal
// segmentation (rather than transverse). So just check whether we're in the
// innermost layer.
- int layer = getLayer(hit);
+ int layer = getVLayer(hit);
boolean inBorderRegionR = (layer < m_barrelLayerRange);
- double hitR = Math.sqrt(hitPos[0]*hitPos[0] + hitPos[1]*hitPos[1]);
return (inBorderRegionZ && inBorderRegionR);
} else {
// Endcap: Check how far we are from the edge (in r)
double hitR = Math.sqrt(hitPos[0]*hitPos[0] + hitPos[1]*hitPos[1]);
- double distanceFromEdge = rMax - hitR;
+ // Calculate rMax at this phi
+ double arMax = rMax;
+ int ns = 0;
+ if(isECAL)ns = ci.getNSides(CalorimeterType.EM_ENDCAP);
+ else ns = ci.getNSides(CalorimeterType.HAD_ENDCAP);
+ if(ns > 1)
+ {
+ double phi = Math.atan2(hitPos[1],hitPos[0]);
+ if(phi < 0.)phi += 2.*Math.PI;
+ double sw = 2.*Math.PI/ns;
+ int nsw = (int) (phi/sw);
+ double phip = phi - nsw*sw;
+ if(phip > Math.PI/ns)phip -= 2.*Math.PI/ns;
+ arMax /= Math.cos(phip);
+ }
+ double distanceFromEdge = arMax - hitR;
return (distanceFromEdge <= cutOff);
}
}
- protected int getLayer(CalorimeterHit hit) {
+ protected int getVLayer(CalorimeterHit hit) {
org.lcsim.geometry.IDDecoder id = hit.getIDDecoder();
id.setID(hit.getCellID());
- int layer = id.getLayer();
+ int layer = id.getVLayer();
return layer;
}
}
lcsim/src/org/lcsim/recon/cluster/util
diff -u -r1.1 -r1.2
--- ClusterLayerSeparationDecision.java 11 Aug 2006 23:29:55 -0000 1.1
+++ ClusterLayerSeparationDecision.java 8 Mar 2010 19:37:34 -0000 1.2
@@ -10,7 +10,7 @@
* of each other. This assumes that the clusters come from
* the same subdetector.
*
- * @version $Id: ClusterLayerSeparationDecision.java,v 1.1 2006/08/11 23:29:55 mcharles Exp $
+ * @version $Id: ClusterLayerSeparationDecision.java,v 1.2 2010/03/08 19:37:34 cassell Exp $
*/
public class ClusterLayerSeparationDecision implements DecisionMakerPair<Cluster,Cluster>
@@ -32,12 +32,12 @@
for (CalorimeterHit hit : hits1) {
org.lcsim.geometry.IDDecoder id = hit.getIDDecoder();
id.setID(hit.getCellID());
- layers1.add(id.getLayer());
+ layers1.add(id.getVLayer());
}
for (CalorimeterHit hit : hits2) {
org.lcsim.geometry.IDDecoder id = hit.getIDDecoder();
id.setID(hit.getCellID());
- layers2.add(id.getLayer());
+ layers2.add(id.getVLayer());
}
for (Integer i : layers1) {
for (Integer j : layers2) {