GeomConverter/src/org/lcsim/detector
diff -u -r1.1 -r1.2
--- DetectorIdHelper.java 6 Sep 2007 18:14:45 -0000 1.1
+++ DetectorIdHelper.java 8 Sep 2007 00:47:53 -0000 1.2
@@ -9,9 +9,6 @@
import org.lcsim.detector.identifier.IdentifierHelper;
import org.lcsim.detector.identifier.IIdentifierDictionary.FieldNotFoundException;
import org.lcsim.detector.identifier.IIdentifierDictionary.InvalidIndexException;
-import org.lcsim.geometry.Detector;
-import org.lcsim.geometry.compact.Subdetector;
-import org.lcsim.geometry.subdetector.PolyconeSupport;
/**
* <p>
@@ -29,8 +26,8 @@
* </p>
*
* <p>
- * The system numbers can be set from a {@see SysteMap} which is simply a map of
- * strings to integer values for system. These could be read from a compact description.
+ * The system numbers can be set from a {@see SysteMap} which is a map of strings
+ * to integer values for system. These could be read from a compact description.
* </p>
*
* <p>
@@ -62,7 +59,8 @@
int layerIndex=invalidIndex;
// Barrel or endcap flag.
- // These values are fixed according to an established LCSim convention.
+ // These values are fixed constants that follow the LCSim convention
+ // so can be static.
private final static int barrelValue=0;
private final static int endcapPositiveValue=1;
private final static int endcapNegativeValue=2;
@@ -71,22 +69,22 @@
// These are set via a SystemMap, to allow the values to be read
// from a compact detector description. The default SystemMap is
// created if none is supplied.
- private static int invalidSystemValue = -1;
- private static int unknownValue = invalidSystemValue;
- private static int vtxBarrelValue = invalidSystemValue;
- private static int vtxEndcapValue = invalidSystemValue;
- private static int sitBarrelValue = invalidSystemValue;
- private static int sitEndcapValue = invalidSystemValue;
- private static int sitForwardValue = invalidSystemValue;
- private static int tpcValue = invalidSystemValue;
- private static int ecalBarrelValue = invalidSystemValue;
- private static int ecalEndcapValue = invalidSystemValue;
- private static int hcalBarrelValue = invalidSystemValue;
- private static int hcalEndcapValue = invalidSystemValue;
- private static int muonBarrelValue = invalidSystemValue;
- private static int muonEndcapValue = invalidSystemValue;
- private static int ecalForwardValue = invalidSystemValue;
- private static int lumiValue = invalidSystemValue;
+ private int invalidSystemValue = -1;
+ private int unknownValue = invalidSystemValue;
+ private int vtxBarrelValue = invalidSystemValue;
+ private int vtxEndcapValue = invalidSystemValue;
+ private int sitBarrelValue = invalidSystemValue;
+ private int sitEndcapValue = invalidSystemValue;
+ private int sitForwardValue = invalidSystemValue;
+ private int tpcValue = invalidSystemValue;
+ private int ecalBarrelValue = invalidSystemValue;
+ private int ecalEndcapValue = invalidSystemValue;
+ private int hcalBarrelValue = invalidSystemValue;
+ private int hcalEndcapValue = invalidSystemValue;
+ private int muonBarrelValue = invalidSystemValue;
+ private int muonEndcapValue = invalidSystemValue;
+ private int ecalForwardValue = invalidSystemValue;
+ private int lumiValue = invalidSystemValue;
// Barrel or endcap ids.
IIdentifier barrelId;
@@ -109,13 +107,7 @@
IIdentifier sitForwardId;
IIdentifier sitForwardEndcapPositiveId;
IIdentifier sitForwardEndcapNegativeId;
-
- // NOTE
- // LDC si tracking...
- // inner = sit
- // outer = set
- // ftc = forward tracking chamber
-
+
// TPC id.
IIdentifier tpcId;
@@ -147,6 +139,11 @@
IIdentifier lumiEndcapPositiveId;
IIdentifier lumiEndcapNegativeId;
+ // LDC si tracking...
+ // inner = sit
+ // outer = set
+ // ftc = forward tracking chamber
+
// FIXME: Add an hcalForward subsystem.
public static class SystemMap
@@ -156,7 +153,7 @@
{
if (containsKey(key))
{
- System.err.println("The field " + key + " was already set to " + value + " ! Ignored.");
+ System.err.println("The field " + key + " was already set to <" + value + ">. Ignored!");
return -1;
}
else {
@@ -165,7 +162,7 @@
}
}
- private static SystemMap defaultSystemMap;
+ private SystemMap defaultSystemMap;
private SystemMap makeDefaultSystemMap()
{
@@ -297,12 +294,6 @@
lumiEndcapPositiveId = makeSubsysId(lumiValue,endcapPositiveValue);
lumiEndcapNegativeId = makeSubsysId(lumiValue,endcapNegativeValue);
}
-
- // For subclasses only.
- //protected DetectorIdHelper(IIdentifierDictionary dict)
- //{
- // super(dict);
- //}
// Public ctor.
public DetectorIdHelper(IIdentifierDictionary dict, SystemMap systemMap) throws FieldNotFoundException, InvalidIndexException
@@ -329,6 +320,7 @@
IIdentifier id = pack(expid);
return id;
}
+
private IIdentifier makeBarrelId(int barrel) throws InvalidIndexException
{
IExpandedIdentifier expid =
@@ -373,6 +365,7 @@
{
return vtxBarrelValue;
}
+
public int getVtxEndcapValue()
{
return vtxEndcapValue;