Skip to content

Commit 2669557

Browse files
committed
refactor: move javafx-dependent CVT code to new module common-tools/clas-qcddat
1 parent c0a5521 commit 2669557

8 files changed

Lines changed: 56 additions & 39 deletions

File tree

bin/run_cvt_viewer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ if [ ! -f "$INPUT_ABS" ]; then
2828
fi
2929

3030
mvn -f "$POM_FILE" -q exec:java \
31-
-Dexec.mainClass="org.jlab.rec.cvt.ml.qcddat.Browser" \
31+
-Dexec.mainClass="org.jlab.qcddat.CVTBrowser" \
3232
-Dexec.args="$INPUT_ABS"
3333

common-tools/clas-qcddat/pom.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>org.jlab.clas</groupId>
6+
<artifactId>clas-qcddat</artifactId>
7+
<version>14.1.2-SNAPSHOT</version>
8+
<packaging>jar</packaging>
9+
10+
<parent>
11+
<groupId>org.jlab.clas</groupId>
12+
<artifactId>common-tools</artifactId>
13+
<version>14.1.2-SNAPSHOT</version>
14+
</parent>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>org.jlab.clas</groupId>
19+
<artifactId>clas-io</artifactId>
20+
<version>14.1.2-SNAPSHOT</version>
21+
</dependency>
22+
<dependency>
23+
<groupId>org.openjfx</groupId>
24+
<artifactId>javafx-base</artifactId>
25+
<classifier>linux</classifier>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.openjfx</groupId>
29+
<artifactId>javafx-graphics</artifactId>
30+
<classifier>linux</classifier>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.openjfx</groupId>
34+
<artifactId>javafx-controls</artifactId>
35+
<classifier>linux</classifier>
36+
</dependency>
37+
</dependencies>
38+
39+
</project>

reconstruction/cvt/src/main/java/org/jlab/rec/cvt/ml/qcddat/Browser.java renamed to common-tools/clas-qcddat/src/main/java/org/jlab/qcddat/CVTBrowser.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
/*
2-
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
3-
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
4-
*/
5-
package org.jlab.rec.cvt.ml.qcddat;
1+
package org.jlab.qcddat;
62

73
import javafx.application.Application;
84
/**
95
*
106
* @author veronique
117
*/
12-
public class Browser {
8+
public class CVTBrowser {
139

1410
public static void main(String[] args) {
1511
if (args.length < 1) {
@@ -20,7 +16,7 @@ public static void main(String[] args) {
2016

2117
String inputFile = args[0];
2218

23-
Viewer.configure(inputFile);
24-
Application.launch(Viewer.class);
19+
CVTViewer.configure(inputFile);
20+
Application.launch(CVTViewer.class);
2521
}
26-
}
22+
}

reconstruction/cvt/src/main/java/org/jlab/rec/cvt/ml/qcddat/Viewer.java renamed to common-tools/clas-qcddat/src/main/java/org/jlab/qcddat/CVTViewer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.jlab.rec.cvt.ml.qcddat;
1+
package org.jlab.qcddat;
22

33
import javafx.application.Application;
44
import javafx.geometry.Insets;
@@ -30,7 +30,7 @@
3030
* @author veronique
3131
*/
3232

33-
public class Viewer extends Application {
33+
public class CVTViewer extends Application {
3434

3535
// ---------- config ----------
3636
private static String inputFile;
@@ -43,7 +43,7 @@ public static void configure(String input) {
4343

4444
public static void main(String[] args) {
4545
if (args.length < 1) {
46-
System.err.println("Usage: java org.jlab.rec.cvt.ml.qcddat.Viewer <input.hipo>");
46+
System.err.println("Usage: java org.jlab.qcddat.CVTViewer <input.hipo>");
4747
System.exit(1);
4848
}
4949
configure(args[0]);
@@ -125,7 +125,7 @@ private static class HitPoint {
125125
@Override
126126
public void start(Stage stage) {
127127
if (inputFile == null || bankName == null) {
128-
throw new IllegalStateException("Viewer.configure(inputFile) must be called before launch.");
128+
throw new IllegalStateException("CVTViewer.configure(inputFile) must be called before launch.");
129129
}
130130

131131
initializeFile(inputFile);
@@ -607,4 +607,4 @@ private Color colorFor(DetectorKind kind) {
607607
case UNKNOWN -> Color.WHITE;
608608
};
609609
}
610-
}
610+
}

common-tools/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<module>clara-io</module>
3030
<module>clas-tracking</module>
3131
<module>clas-decay-tools</module>
32+
<module>clas-qcddat</module>
3233
<module>coat-libs</module>
3334
</modules>
3435

etc/services/mc-qcddat.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ io-services:
88
services:
99
- class: org.jlab.clas.swimtools.MagFieldsEngine
1010
name: MAGFIELDS
11-
- class: org.jlab.rec.cvt.ml.qcddat.SampleMaker
11+
- class: org.jlab.rec.cvt.ml.QCDDATSampleMaker
1212
name: CVTFP
1313
configuration:
1414
global:

reconstruction/cvt/pom.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -95,28 +95,10 @@
9595
<groupId>junit</groupId>
9696
<artifactId>junit</artifactId>
9797
</dependency>
98-
<!-- FIXME(CD): only the new code in `src/main/java/org/jlab/rec/cvt/ml` needs this dependency;
99-
should we move this `ml/qcddat` directory to a new module? -->
10098
<dependency>
10199
<groupId>org.jlab.jnp</groupId>
102100
<artifactId>jnp-hipo4</artifactId>
103101
</dependency>
104-
<!-- FIXME(CD): within this `ml/` directory, the `qcddat` subdirectory additionally needs these `javafx` dependencies -->
105-
<dependency>
106-
<groupId>org.openjfx</groupId>
107-
<artifactId>javafx-base</artifactId>
108-
<classifier>linux</classifier>
109-
</dependency>
110-
<dependency>
111-
<groupId>org.openjfx</groupId>
112-
<artifactId>javafx-graphics</artifactId>
113-
<classifier>linux</classifier>
114-
</dependency>
115-
<dependency>
116-
<groupId>org.openjfx</groupId>
117-
<artifactId>javafx-controls</artifactId>
118-
<classifier>linux</classifier>
119-
</dependency>
120102
</dependencies>
121103

122104
</project>

reconstruction/cvt/src/main/java/org/jlab/rec/cvt/ml/qcddat/SampleMaker.java renamed to reconstruction/cvt/src/main/java/org/jlab/rec/cvt/ml/QCDDATSampleMaker.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
package org.jlab.rec.cvt.ml.qcddat;
1+
package org.jlab.rec.cvt.ml;
22

3-
import org.jlab.rec.cvt.ml.*;
43
import java.util.ArrayList;
54
import java.util.Arrays;
65
import java.util.List;
@@ -27,15 +26,15 @@
2726
* @author ziegler
2827
*
2928
*/
30-
public class SampleMaker extends ReconstructionEngine {
29+
public class QCDDATSampleMaker extends ReconstructionEngine {
3130

3231
private String svtHitBank;
3332

34-
public SampleMaker(String name) {
33+
public QCDDATSampleMaker(String name) {
3534
super(name, "ziegler", "6.0");
3635
}
3736

38-
public SampleMaker() {
37+
public QCDDATSampleMaker() {
3938
super("CVTQCDDATEngine", "ziegler", "6.0");
4039
}
4140

0 commit comments

Comments
 (0)