Skip to content

Commit cd49dd6

Browse files
authored
Merge branch 'development' into eb-nab
2 parents a676b60 + 4b21dac commit cd49dd6

4 files changed

Lines changed: 105 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
runs-on: macos-latest
6161
steps:
6262
- uses: actions/checkout@v7
63-
- uses: actions/setup-java@v5.5.0
63+
- uses: actions/setup-java@v5.6.0
6464
with:
6565
java-version: ${{ env.JAVA_VERSION }}
6666
distribution: ${{ env.java_distribution }}
@@ -90,7 +90,7 @@ jobs:
9090
runs-on: ubuntu-latest
9191
steps:
9292
- uses: actions/checkout@v7
93-
- uses: actions/setup-java@v5.5.0
93+
- uses: actions/setup-java@v5.6.0
9494
with:
9595
java-version: ${{ env.JAVA_VERSION }}
9696
distribution: ${{ env.java_distribution }}
@@ -136,7 +136,7 @@ jobs:
136136
runs-on: ubuntu-latest
137137
steps:
138138
- uses: actions/checkout@v7
139-
- uses: actions/setup-java@v5.5.0
139+
- uses: actions/setup-java@v5.6.0
140140
with:
141141
java-version: ${{ matrix.JAVA_VERSION }}
142142
distribution: ${{ env.java_distribution }}
@@ -160,7 +160,7 @@ jobs:
160160
steps:
161161
- uses: actions/checkout@v7
162162
- name: Set up JDK
163-
uses: actions/setup-java@v5.5.0
163+
uses: actions/setup-java@v5.6.0
164164
with:
165165
java-version: ${{ env.JAVA_VERSION }}
166166
distribution: ${{ env.java_distribution }}
@@ -179,7 +179,7 @@ jobs:
179179
steps:
180180
- uses: actions/checkout@v7
181181
- name: Set up JDK
182-
uses: actions/setup-java@v5.5.0
182+
uses: actions/setup-java@v5.6.0
183183
with:
184184
java-version: ${{ env.JAVA_VERSION }}
185185
distribution: ${{ env.java_distribution }}
@@ -208,7 +208,7 @@ jobs:
208208
steps:
209209
- uses: actions/checkout@v7
210210
- name: Set up JDK
211-
uses: actions/setup-java@v5.5.0
211+
uses: actions/setup-java@v5.6.0
212212
with:
213213
java-version: ${{ env.JAVA_VERSION }}
214214
distribution: ${{ env.java_distribution }}
@@ -266,7 +266,7 @@ jobs:
266266
steps:
267267
- uses: actions/checkout@v7
268268
- name: Set up JDK
269-
uses: actions/setup-java@v5.5.0
269+
uses: actions/setup-java@v5.6.0
270270
with:
271271
java-version: ${{ env.JAVA_VERSION }}
272272
distribution: ${{ env.java_distribution }}
@@ -294,7 +294,7 @@ jobs:
294294
steps:
295295
- uses: actions/checkout@v7
296296
- name: Set up JDK
297-
uses: actions/setup-java@v5.5.0
297+
uses: actions/setup-java@v5.6.0
298298
with:
299299
java-version: ${{ env.JAVA_VERSION }}
300300
distribution: ${{ env.java_distribution }}
@@ -319,7 +319,7 @@ jobs:
319319
steps:
320320
- uses: actions/checkout@v7
321321
- name: Set up JDK
322-
uses: actions/setup-java@v5.5.0
322+
uses: actions/setup-java@v5.6.0
323323
with:
324324
java-version: ${{ env.JAVA_VERSION }}
325325
distribution: ${{ env.java_distribution }}
@@ -342,7 +342,7 @@ jobs:
342342
steps:
343343
- uses: actions/checkout@v7
344344
- name: Set up JDK
345-
uses: actions/setup-java@v5.5.0
345+
uses: actions/setup-java@v5.6.0
346346
with:
347347
java-version: ${{ env.JAVA_VERSION }}
348348
distribution: ${{ env.java_distribution }}
@@ -381,7 +381,7 @@ jobs:
381381
path: pages/jacoco
382382
### javadoc
383383
- name: set up JDK
384-
uses: actions/setup-java@v5.5.0
384+
uses: actions/setup-java@v5.6.0
385385
with:
386386
java-version: ${{ env.JAVA_VERSION }}
387387
distribution: ${{ env.java_distribution }}

common-tools/clas-jcsg/src/main/java/org/jlab/detector/geant4/v2/MUCALGeant4Factory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import java.util.ArrayList;
55
import org.jlab.detector.volume.Geant4Basic;
66
import org.jlab.detector.units.SystemOfUnits.Length;
7-
import org.jlab.detector.volume.G4Pgon;
7+
import org.jlab.detector.volume.G4Pcone;
88
import org.jlab.detector.volume.G4Trd;
99
import org.jlab.detector.volume.G4World;
1010
import org.jlab.geom.base.ConstantProvider;
@@ -24,7 +24,7 @@ public MUCALGeant4Factory(ConstantProvider provider) {
2424
double[] mucal_iradius = {301.0*Length.mm, 72.8*Length.mm, 81.5*Length.mm, 98.7*Length.mm};
2525
double[] mucal_oradius = {301.1*Length.mm, 360.6*Length.mm, 401.0*Length.mm, 98.8*Length.mm};
2626
double[] mucal_zpos_root = {520.0*Length.mm, 625.0*Length.mm, 696.0*Length.mm, 836.0*Length.mm};
27-
G4Pgon mucalVolume = new G4Pgon("mucalVolume", phiStart, phiTotal, nplanes, nplanes, mucal_zpos_root, mucal_iradius, mucal_oradius);
27+
G4Pcone mucalVolume = new G4Pcone("mucalVolume", phiStart, phiTotal, nplanes, mucal_zpos_root, mucal_iradius, mucal_oradius);
2828
mucalVolume.setMother(motherVolume);
2929
for (int sector = 1; sector <= 2; sector++) {
3030
List<G4Trd> layerVolume = createPanel(provider, sector, 1);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package org.jlab.detector.volume;
2+
3+
import org.jlab.geometry.prim.Pcone;
4+
import org.jlab.detector.units.Measurement;
5+
import org.jlab.detector.units.SystemOfUnits.Angle;
6+
import org.jlab.detector.units.SystemOfUnits.Length;
7+
8+
/**
9+
* @author pdavies/devita
10+
*/
11+
// FIXME: currently support only polyheadra defintion to gemc geometry
12+
public class G4Pcone extends Geant4Basic {
13+
14+
public G4Pcone(String name, double phiStart, double phiTotal, int numZPlanes,
15+
double[] zPlane, double[] rInner, double[] rOuter ) {
16+
17+
super( new Pcone(phiStart, phiTotal, numZPlanes, zPlane, rInner, rOuter));
18+
setName( name );
19+
setType("Polycone");
20+
21+
Measurement[] dimensions = new Measurement[3+3*numZPlanes];
22+
dimensions[0] = Angle.value(phiStart);
23+
dimensions[1] = Angle.value(phiTotal);
24+
dimensions[2] = new Measurement(numZPlanes,"counts");
25+
for(int i=0; i<numZPlanes; i++) dimensions[3+0*numZPlanes+i] = Length.value(rInner[i]);
26+
for(int i=0; i<numZPlanes; i++) dimensions[3+1*numZPlanes+i] = Length.value(rOuter[i]);
27+
for(int i=0; i<numZPlanes; i++) dimensions[3+2*numZPlanes+i] = Length.value(zPlane[i]);
28+
setDimensions(dimensions);
29+
}
30+
31+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package org.jlab.geometry.prim;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
import eu.mihosoft.vrl.v3d.Polygon;
6+
import eu.mihosoft.vrl.v3d.Primitive;
7+
import eu.mihosoft.vrl.v3d.PropertyStorage;
8+
9+
/**
10+
* @author pdavies/devita
11+
*/
12+
13+
// FIXME: currently support only polyheadra defintion to gemc geometry
14+
public class Pcone implements Primitive {
15+
16+
private final PropertyStorage properties = new PropertyStorage();
17+
private int numZPlanes;
18+
private double phiStart, phiTotal;
19+
double[] zPlane;
20+
double[] rInner;
21+
double[] rOuter;
22+
23+
public Pcone(double phiStart,
24+
double phiTotal,
25+
int numZPlanes,
26+
double[] zPlane,
27+
double[] rInner,
28+
double[] rOuter)
29+
{
30+
if( numZPlanes < 0 || phiStart < 0 || phiTotal <= 0 ) {
31+
throw new IllegalArgumentException("Illegal arguments for Polyhedra Primitive!");
32+
}
33+
if( zPlane.length<2 || rInner.length<2 || rOuter.length<2) {
34+
throw new IllegalArgumentException("Illegal arguments for Polyhedra Primitive!");
35+
}
36+
if( zPlane.length!=rInner.length || zPlane.length!=rOuter.length) {
37+
throw new IllegalArgumentException("Illegal arguments for Polyhedra Primitive!");
38+
}
39+
40+
this.phiStart = phiStart;
41+
this.phiTotal = phiTotal;
42+
this.zPlane = zPlane;
43+
this.rInner = rInner;
44+
this.rOuter = rOuter;
45+
}
46+
47+
@Override
48+
public List<Polygon> toPolygons()
49+
{
50+
List<Polygon> polygons = new ArrayList<>();
51+
// just returns something to not cause a NullPointerException
52+
return polygons;
53+
}
54+
55+
@Override
56+
public PropertyStorage getProperties()
57+
{
58+
return null;
59+
}
60+
61+
}

0 commit comments

Comments
 (0)