6 modified files
lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/crux
diff -u -r1.3 -r1.4
--- CruxConfig.java 18 Feb 2009 03:29:06 -0000 1.3
+++ CruxConfig.java 19 Feb 2009 20:46:07 -0000 1.4
@@ -22,7 +22,6 @@
import org.lcsim.contrib.onoprien.crux.geom.CalGeometryConfig;
import org.lcsim.contrib.onoprien.crux.geom.CalLayer;
import org.lcsim.contrib.onoprien.crux.geom.CalModule;
-import org.lcsim.contrib.onoprien.crux.infrastructure.*;
import static org.lcsim.contrib.onoprien.crux.geom.CalModule.Attribute.*;
@@ -45,13 +44,13 @@
* </ul>
*
* @author D. Onoprienko
- * @version $Id: CruxConfig.java,v 1.3 2009/02/18 03:29:06 onoprien Exp $
+ * @version $Id: CruxConfig.java,v 1.4 2009/02/19 20:46:07 onoprien Exp $
*/
public class CruxConfig implements JobEventListener, CalGeometryConfig {
// -- Constructors : ----------------------------------------------------------
- public CruxConfig() {
+ private CruxConfig() {
JobManager.defaultInstance().addListener(this);
@@ -59,6 +58,10 @@
moduleConstruct();
}
+
+ static public CruxConfig defaultInstance() {
+ return (_def == null) ? _def = new CruxConfig() : _def ;
+ }
// -- Initialization : --------------------------------------------------------
@@ -86,7 +89,7 @@
}
protected void moduleInit(JobEvent jEvent) {
-
+
// create modules
CalModule eBar = new CalModule("ECAL_BARREL", EnumSet.of(ECAL, BARREL, ENTRY), "EMBarrel");
@@ -228,5 +231,6 @@
protected ArrayList<List<CalModule>> _nextModules;
// -- Private parts : ---------------------------------------------------------
-
+
+ static private CruxConfig _def;
}
lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/crux
diff -u -r1.2 -r1.3
--- CruxManager.java 18 Feb 2009 03:29:06 -0000 1.2
+++ CruxManager.java 19 Feb 2009 20:46:07 -0000 1.3
@@ -20,14 +20,14 @@
*
*
* @author D. Onoprienko
- * @version $Id: CruxManager.java,v 1.2 2009/02/18 03:29:06 onoprien Exp $
+ * @version $Id: CruxManager.java,v 1.3 2009/02/19 20:46:07 onoprien Exp $
*/
public class CruxManager extends Driver {
// -- Constructors and initialization : ---------------------------------------
private CruxManager() {
- _config = new CruxConfig();
+ _config = CruxConfig.defaultInstance();
JobManager.defaultInstance().put(this, CruxManager.class);
log("Created CruxManager", Level.SEVERE);
}
lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/crux/geom
diff -u -r1.2 -r1.3
--- CalGeometry.java 18 Feb 2009 03:29:06 -0000 1.2
+++ CalGeometry.java 19 Feb 2009 20:46:08 -0000 1.3
@@ -5,6 +5,7 @@
import hep.physics.vec.Hep3Vector;
import org.lcsim.event.CalorimeterHit;
import org.lcsim.geometry.Detector;
+import org.lcsim.geometry.IDDecoder;
import org.lcsim.contrib.onoprien.util.job.JobEvent;
import org.lcsim.contrib.onoprien.util.job.JobEventListener;
@@ -17,7 +18,7 @@
* calling <tt>JobManager.defaultInstance().get(CalGeometry.class)</tt>.
*
* @author D. Onoprienko
- * @version $Id: CalGeometry.java,v 1.2 2009/02/18 03:29:06 onoprien Exp $
+ * @version $Id: CalGeometry.java,v 1.3 2009/02/19 20:46:08 onoprien Exp $
*/
public class CalGeometry implements JobEventListener {
@@ -62,9 +63,11 @@
}
public CalLayer getLayer(CalorimeterHit hit) {
- int iLayer = hit.getIDDecoder().getLayer();
+ IDDecoder dec = hit.getIDDecoder();
+ dec.setID(hit.getCellID());
+ int iLayer = dec.getLayer();
CalModule module = getModule(hit);
- return module.getLayerByNumber(iLayer);
+ return module.getLayerByDecoded(iLayer);
}
/** Returns <tt>true</tt> id the given hit belongs to EM calorimeter. */
lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/crux/geom
diff -u -r1.1.1.1 -r1.2
--- CalLayer.java 10 Dec 2008 22:03:06 -0000 1.1.1.1
+++ CalLayer.java 19 Feb 2009 20:46:08 -0000 1.2
@@ -9,7 +9,7 @@
* Class that represents a layer inside a calorimeter module.
*
* @author D. Onoprienko
- * @version $Id: CalLayer.java,v 1.1.1.1 2008/12/10 22:03:06 jeremy Exp $
+ * @version $Id: CalLayer.java,v 1.2 2009/02/19 20:46:08 onoprien Exp $
*/
public class CalLayer implements Comparable<CalLayer> {
@@ -39,7 +39,7 @@
* Returns layer number as reported by {@link IDDecoder} for hits in this layer.
* Note that layers in a module are not necessarily numbered starting from zero.
*/
- public int getLayerNumber() {
+ public int getLayerDecoded() {
return _layer;
}
lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/crux/geom
diff -u -r1.2 -r1.3
--- CalModule.java 18 Feb 2009 03:29:06 -0000 1.2
+++ CalModule.java 19 Feb 2009 20:46:08 -0000 1.3
@@ -8,7 +8,7 @@
* Class to represent a part of the calorimeter.
*
* @author D. Onoprienko
- * @version $Id: CalModule.java,v 1.2 2009/02/18 03:29:06 onoprien Exp $
+ * @version $Id: CalModule.java,v 1.3 2009/02/19 20:46:08 onoprien Exp $
*/
public class CalModule {
@@ -109,8 +109,8 @@
* Throws <tt>IndexOutOfBoundsException</tt> if there is no layer with the specified
* number in this module.
*/
- public CalLayer getLayerByNumber(int layerNumber) {
- int ordinal = layerNumber - _layers.get(0).getLayerNumber();
+ public CalLayer getLayerByDecoded(int layerNumber) {
+ int ordinal = layerNumber - _layers.get(0).getLayerDecoded();
return getLayerByOrdinal(ordinal);
}
lcsim-contrib/src/main/java/org/lcsim/contrib/onoprien/crux/infrastructure
diff -u -r1.2 -r1.3
--- CruxHitMap.java 22 Jan 2009 21:01:56 -0000 1.2
+++ CruxHitMap.java 19 Feb 2009 20:46:08 -0000 1.3
@@ -24,7 +24,7 @@
* copy of each hit is held, no matter how many times it is added to this collection.
*
* @author D. Onoprienko
- * @version $Id: CruxHitMap.java,v 1.2 2009/01/22 21:01:56 onoprien Exp $
+ * @version $Id: CruxHitMap.java,v 1.3 2009/02/19 20:46:08 onoprien Exp $
*/
final public class CruxHitMap implements List<CalorimeterHit> {
@@ -254,7 +254,7 @@
* The returned list is not backed by this <tt>CruxHitMap</tt> and can be modified independently.
*/
public ArrayList<CalorimeterHit> toList(CalLayer layer) {
- return toList(layer.getModule(), layer.getLayerNumber());
+ return toList(layer.getModule(), layer.getLayerDecoded());
}
/**
CVSspam 0.2.8