Author: [log in to unmask]
Date: Fri Dec 19 13:02:55 2014
New Revision: 3467
Log:
Further merging of the lcdd and java SurveyVolumes
Modified:
projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/JavaSurveyVolume.java
projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/LCDDSurveyVolume.java
projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/SurveyVolumeImpl.java
Modified: projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/JavaSurveyVolume.java
=============================================================================
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/JavaSurveyVolume.java (original)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/JavaSurveyVolume.java Fri Dec 19 13:02:55 2014
@@ -73,8 +73,8 @@
setComponentId(volumeId);
setMother(mother);
mother.addDaughter(this);
- buildBox(surveyVolume);
- buildVolume(surveyVolume);
+ buildBox();
+ buildVolume();
setPositionAndRotation(surveyVolume);
if(isDebug()) System.out.printf("%s: DONE JavaBaseGeometry %s\n", this.getClass().getSimpleName(),surveyVolume.getName());
}
@@ -89,16 +89,15 @@
JavaSurveyVolume physMother = getPhysMother();
setPhysVolume(new PhysicalVolume(new Transform3D(getPos(), getRot()), getName(), volume, physMother.getVolume(),getComponentId()));
}
- public void buildBox(SurveyVolume base) {
- Hep3Vector b = base.getBoxDim();
- b = VecOp.mult(0.5, b);
+
+ public void buildBox() {
+ Hep3Vector b = VecOp.mult(0.5,getBoxDim());
if(isDebug()) System.out.printf("%s: build box for %s with dimensions %s \n", this.getClass().getSimpleName(),getName(), b);
setBox(new Box(getName() + "Box", b.x(), b.y(), b.z()));
}
- public void buildVolume(SurveyVolume base) {
- if(isDebug()) System.out.printf("%s: build volume for %s with material %s\n", this.getClass().getSimpleName(),getName(),base.getMaterial());
- IMaterial material = MaterialStore.getInstance().get(base.getMaterial());
- setVolume(new LogicalVolume(getName() + "_volume", box, material));
+ public void buildVolume() {
+ if(isDebug()) System.out.printf("%s: build volume for %s with material %s\n", this.getClass().getSimpleName(),getName(), MaterialStore.getInstance().get(getMaterial()));
+ setVolume(new LogicalVolume(getName() + "_volume", box, MaterialStore.getInstance().get(getMaterial())));
}
public void setPositionAndRotation(SurveyVolume base) {
Modified: projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/LCDDSurveyVolume.java
=============================================================================
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/LCDDSurveyVolume.java (original)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/LCDDSurveyVolume.java Fri Dec 19 13:02:55 2014
@@ -70,8 +70,8 @@
this.lcdd = lcdd;
setMother(mother);
mother.addDaughter(this);
- buildBox(surveyVolume);
- buildVolume(surveyVolume);
+ buildBox();
+ buildVolume();
setPositionAndRotation(surveyVolume);
//buildPhysVolume(mother);
if(isDebug()) System.out.printf("%s: DONE constructing LCDD object %s\n", this.getClass().getSimpleName(),surveyVolume.getName());
@@ -86,14 +86,14 @@
//if(isDebug()) System.out.printf("%s: build phys volume for %s\n", this.getClass().getSimpleName(),getName());
//setPhysVolume(new PhysVol(volume, getMother().getVolume(), getPos(), getRot()));
}
- public void buildBox(SurveyVolume base) {
- if(isDebug()) System.out.printf("%s: build box for %s\n", this.getClass().getSimpleName(),getName());
- setBox(new Box(getName() + "Box", base.getBoxDim().x(), base.getBoxDim().y(), base.getBoxDim().z()));
- }
- public void buildVolume(SurveyVolume base) {
- if(isDebug()) System.out.printf("%s: build volume for %s with material %s\n", this.getClass().getSimpleName(),getName(),base.getMaterial());
+ public void buildBox() {
+ if(isDebug()) System.out.printf("%s: build box for %s\n", getClass().getSimpleName(),getName());
+ setBox(new Box(getName() + "Box", getBoxDim().x(), getBoxDim().y(), getBoxDim().z()));
+ }
+ public void buildVolume() {
+ if(isDebug()) System.out.printf("%s: build volume for %s with material %s\n", this.getClass().getSimpleName(),getName(),getMaterial());
try {
- Material mat = lcdd.getMaterial(base.getMaterial());
+ Material mat = lcdd.getMaterial(getMaterial());
setVolume(new Volume(getName() + "_volume", box, mat));
} catch (JDOMException e) {
e.printStackTrace();
Modified: projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/SurveyVolumeImpl.java
=============================================================================
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/SurveyVolumeImpl.java (original)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/SurveyVolumeImpl.java Fri Dec 19 13:02:55 2014
@@ -1,4 +1,6 @@
package org.lcsim.geometry.compact.converter;
+
+import hep.physics.vec.Hep3Vector;
public abstract class SurveyVolumeImpl extends SurveyVolumeVisualization {
@@ -12,14 +14,22 @@
public abstract void buildPhysVolume();
- public abstract void buildBox(SurveyVolume base);
+ public abstract void buildBox();
- public abstract void buildVolume(SurveyVolume base);
+ public abstract void buildVolume();
public abstract void setPositionAndRotation(SurveyVolume base);
public String getName() {
return surveyVolume.getName();
+ }
+
+ protected Hep3Vector getBoxDim() {
+ return surveyVolume.getBoxDim();
+ }
+
+ protected String getMaterial() {
+ return surveyVolume.getMaterial();
}
public boolean isDebug() {
########################################################################
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
|