Commit in GeomConverter on MAIN | |||
src/org/lcsim/geometry/compact/converter/lcdd/LCDDDetector.java | +13 | -4 | 1.28 -> 1.29 |
src/org/lcsim/geometry/compact/converter/lcdd/util/OpticalCalorimeter.java | +13 | added 1.1 | |
/Calorimeter.java | +19 | -21 | 1.4 -> 1.5 |
testResources/org/lcsim/geometry/subdetector/OpticalCalorimeterTest.xml | +15 | -2 | 1.1 -> 1.2 |
+60 | -27 |
add support for optical calorimeter output to LCDD
diff -u -r1.28 -r1.29 --- LCDDDetector.java 24 Apr 2013 02:00:35 -0000 1.28 +++ LCDDDetector.java 24 Apr 2013 20:07:40 -0000 1.29 @@ -32,6 +32,7 @@
import org.lcsim.geometry.compact.converter.lcdd.util.LCDDMaterialHelper; import org.lcsim.geometry.compact.converter.lcdd.util.Limit; import org.lcsim.geometry.compact.converter.lcdd.util.LimitSet;
+import org.lcsim.geometry.compact.converter.lcdd.util.OpticalCalorimeter;
import org.lcsim.geometry.compact.converter.lcdd.util.Position; import org.lcsim.geometry.compact.converter.lcdd.util.Region; import org.lcsim.geometry.compact.converter.lcdd.util.Rotation;
@@ -153,13 +154,21 @@
if (sub.isTracker()) { sens = new Tracker(sub.getName()); } else if (sub.isCalorimeter()) {
- // Standard segmented calorimeter. - if (readout.getSegmentation() != null && readout.getSegmentation().useForHitPosition()) {
+ boolean isOptical = false; + // Check for flag that indicates optical calorimeter class. + if (sub.getNode().getAttribute("optical") != null) { + isOptical = sub.getNode().getAttribute("optical").getBooleanValue(); + } + if (isOptical) { + // Use optical calorimeter LCDD binding. + sens = new OpticalCalorimeter(sub.getName()); + } else if (readout.getSegmentation() != null && readout.getSegmentation().useForHitPosition()) { + // Standard segmented calorimeter.
sens = new Calorimeter(sub.getName()); }
- // Unsegmented calorimeter for detailed readout studies. - // May still have Segmentation but not used for hit positions.
else {
+ // Unsegmented calorimeter for detailed readout studies. + // May still have Segmentation but it is not used for the hit positions.
sens = new UnsegmentedCalorimeter(sub.getName()); } }
diff -N OpticalCalorimeter.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ OpticalCalorimeter.java 24 Apr 2013 20:07:40 -0000 1.1 @@ -0,0 +1,13 @@
+package org.lcsim.geometry.compact.converter.lcdd.util; + + +/** + * @author Jeremy McCormick <[log in to unmask]> + * @version $Id: OpticalCalorimeter.java,v 1.1 2013/04/24 20:07:40 jeremy Exp $ + */ +public class OpticalCalorimeter extends Calorimeter { + + public OpticalCalorimeter(String name) { + super("optical_calorimeter", name); + } +}
diff -u -r1.4 -r1.5 --- Calorimeter.java 8 Dec 2010 23:07:23 -0000 1.4 +++ Calorimeter.java 24 Apr 2013 20:07:40 -0000 1.5 @@ -4,25 +4,23 @@
* * @author tonyj */
-public class Calorimeter extends SensitiveDetector -{ - public Calorimeter(String name) - { - super("calorimeter",name); - } - - /** - * Constructor for subclasses with a different XML element name. - * @param elementName The name of the element. - * @param name The unique name of the calorimeter. - */ - public Calorimeter(String elementName, String name) - { - super(elementName, name); - } - - public void setSegmentation(Segmentation segmentation) - { - addContent(segmentation); - }
+public class Calorimeter extends SensitiveDetector { + + public Calorimeter(String name) { + super("calorimeter", name); + } + + /** + * Constructor for subclasses with a different XML element name. + * + * @param elementName The name of the element. + * @param name The unique name of the calorimeter. + */ + protected Calorimeter(String elementName, String name) { + super(elementName, name); + } + + public void setSegmentation(Segmentation segmentation) { + addContent(segmentation); + }
}
diff -u -r1.1 -r1.2 --- OpticalCalorimeterTest.xml 24 Apr 2013 02:00:36 -0000 1.1 +++ OpticalCalorimeterTest.xml 24 Apr 2013 20:07:40 -0000 1.2 @@ -60,7 +60,14 @@
</limitset> </limits> <detectors>
- <detector id="7" name="HcalBarrel" type="PolyhedraBarrelCalorimeter2" readout="HcalBarrelHits" calorimeterType="HAD_BARREL" gap="0.*cm" material="BGO">
+ <detector id="7" + name="HcalBarrel" + type="PolyhedraBarrelCalorimeter2" + readout="HcalBarrelHits" + calorimeterType="HAD_BARREL" + gap="0.*cm" + material="BGO" + optical="true">
<comment>Hadron Calorimeter Barrel</comment> <dimensions numsides="12" rmin="146*cm" z="370.2*cm * 2"/> <staves />
@@ -68,7 +75,13 @@
<slice material="BGO" thickness="5.0*cm" sensitive="yes" /> </layer> </detector>
- <detector id="8" name="HcalEndcap" type="PolyhedraEndcapCalorimeter3" readout="HcalEndcapHits" reflect="true" calorimeterType="HAD_ENDCAP">
+ <detector id="8" + name="HcalEndcap" + type="PolyhedraEndcapCalorimeter3" + readout="HcalEndcapHits" + reflect="true" + calorimeterType="HAD_ENDCAP" + optical="true">
<comment>Hadron Calorimeter Endcaps</comment> <dimensions numsides="12" zmin="220.2*cm" rmin="39.0*cm" rmax="146.0*cm" angle="6.*deg" /> <layer repeat="30">
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1