Skip to content

Commit a184bc4

Browse files
merge development and update of yaml files and bank schemas
2 parents e336be1 + e643ec6 commit a184bc4

File tree

1,636 files changed

+32524
-194691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,636 files changed

+32524
-194691
lines changed

.github/workflows/maven.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
2+
3+
name: Coatjava-CI
4+
5+
on:
6+
push:
7+
branches: [ '**' ]
8+
pull_request:
9+
branches: [ '**' ]
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up JDK
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 11
22+
- name: build
23+
run: ./build-coatjava.sh --spotbugs --unittests --quiet
24+
- name: kpp-test
25+
run: cd validation/advanced-tests && ./run-advanced-tests.sh
26+
- name: eb-ep-test
27+
run: cd validation/advanced-tests && ./run-eb-tests.sh -100 electronproton
28+
- name: eb-eg-test
29+
run: cd validation/advanced-tests && ./run-eb-tests.sh -100 electrongamma
30+
- name: eb-epc-test
31+
run: cd validation/advanced-tests && ./run-eb-tests.sh -100 electronprotonC
32+
- name: eb-enc-test
33+
run: cd validation/advanced-tests && ./run-eb-tests.sh -100 electronneutronC
34+
- name: eb-eftpi-test
35+
run: cd validation/advanced-tests && ./run-eb-tests.sh -100 electronFTpion
36+

.travis.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# clas12-offline-software [![Build Status](https://travis-ci.org/JeffersonLab/clas12-offline-software.svg?branch=development)](https://travis-ci.org/JeffersonLab/clas12-offline-software) [![codecov](https://codecov.io/gh/JeffersonLab/clas12-offline-software/branch/development/graph/badge.svg?precision=2)](https://codecov.io/gh/JeffersonLab/clas12-offline-software/branch/development)
1+
# clas12-offline-software
2+
[![Build Status](https://github.com/jeffersonlab/clas12-offline-software/workflows/Coatjava-CI/badge.svg)](https://github.com/jeffersonlab/clas12-offline-software/actions)
3+
[![codecov](https://codecov.io/gh/JeffersonLab/clas12-offline-software/branch/development/graph/badge.svg?precision=2)](https://codecov.io/gh/JeffersonLab/clas12-offline-software/branch/development)
4+
5+
26
CLAS12 Offline Software
37

48
## Quick Start

bin/kpp-plots

Lines changed: 0 additions & 5 deletions
This file was deleted.

bin/mon12

Lines changed: 0 additions & 5 deletions
This file was deleted.

build-coatjava.sh

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,56 @@ do
2929
fi
3030
done
3131

32+
top="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
33+
3234
wget='wget'
33-
mvn='mvn'
35+
mvn="mvn --settings $top/maven-settings.xml"
3436
if [ "$quiet" == "yes" ]
3537
then
3638
wget='wget --progress=dot:mega'
37-
mvn='mvn -q -B'
39+
mvn="mvn -q -B --settings $top/maven-settings.xml"
3840
fi
3941

42+
command_exists () {
43+
type "$1" &> /dev/null
44+
}
45+
download () {
46+
ret=0
47+
if command_exists wget ; then
48+
# -N only redownloads if timestamp/filesize is newer/different
49+
$wget -N --no-check-certificate $1
50+
ret=$?
51+
elif command_exists curl ; then
52+
if ! [ -e ${1##*/} ]; then
53+
curl $1 -o ${1##*/}
54+
ret=$?
55+
fi
56+
else
57+
ret=1
58+
echo ERROR::::::::::: Could not find wget nor curl.
59+
fi
60+
return $ret
61+
}
62+
63+
4064
# download the default field maps, as defined in bin/env.sh:
4165
# (and duplicated in etc/services/reconstruction.yaml):
4266
source `dirname $0`/bin/env.sh
4367
if [ $downloadMaps == "yes" ]; then
4468
echo 'Retrieving field maps ...'
45-
webDir=http://clasweb.jlab.org/clas12offline/magfield
69+
webDir=https://clasweb.jlab.org/clas12offline/magfield
4670
locDir=etc/data/magfield
4771
mkdir -p $locDir
4872
cd $locDir
4973
for map in $COAT_MAGFIELD_SOLENOIDMAP $COAT_MAGFIELD_TORUSMAP $COAT_MAGFIELD_TORUSSECONDARYMAP
5074
do
51-
# -N only redownloads if timestamp/filesize is newer/different
52-
$wget -N --no-check-certificate $webDir/$map
75+
download $webDir/$map
76+
if [ $? -ne 0 ]; then
77+
echo ERROR::::::::::: Could not download field map:
78+
echo $webDir/$map
79+
echo One option is to download manually into etc/data/magfield and then run this build script with --nomaps
80+
exit
81+
fi
5382
done
5483
cd -
5584
fi
@@ -65,8 +94,6 @@ cp external-dependencies/JEventViewer-1.1.jar coatjava/lib/clas/
6594
cp external-dependencies/vecmath-1.3.1-2.jar coatjava/lib/clas/
6695
mkdir -p coatjava/lib/utils
6796
cp external-dependencies/jclara-4.3-SNAPSHOT.jar coatjava/lib/utils
68-
cp external-dependencies/clas12mon-3.1.jar coatjava/lib/utils
69-
cp external-dependencies/KPP-Plots-3.2.jar coatjava/lib/utils
7097
#cp external-dependencies/jaw-1.0.jar coatjava/lib/utils
7198
mkdir -p coatjava/lib/services
7299

@@ -98,20 +125,6 @@ if [ $? != 0 ] ; then echo "mvn package failure" ; exit 1 ; fi
98125
cd -
99126

100127
cp common-tools/coat-lib/target/coat-libs-*-SNAPSHOT.jar coatjava/lib/clas/
101-
cp reconstruction/dc/target/clas12detector-dc-*-SNAPSHOT.jar coatjava/lib/services/
102-
cp reconstruction/tof/target/clas12detector-tof-*-SNAPSHOT.jar coatjava/lib/services/
103-
cp reconstruction/cvt/target/clas12detector-cvt-*-SNAPSHOT.jar coatjava/lib/services/
104-
cp reconstruction/ft/target/clas12detector-ft-*-SNAPSHOT.jar coatjava/lib/services/
105-
cp reconstruction/ec/target/clas12detector-ec-*-SNAPSHOT.jar coatjava/lib/services/
106-
cp reconstruction/ltcc/target/clas12detector-ltcc-*-SNAPSHOT.jar coatjava/lib/services/
107-
cp reconstruction/htcc/target/clas12detector-htcc-*-SNAPSHOT.jar coatjava/lib/services/
108-
cp reconstruction/cnd/target/clas12detector-cnd-*-SNAPSHOT.jar coatjava/lib/services/
109-
cp reconstruction/rich/target/clas12detector-rich-*-SNAPSHOT.jar coatjava/lib/services/
110-
cp reconstruction/fvt/target/clas12detector-fmt-*-SNAPSHOT.jar coatjava/lib/services/
111-
cp reconstruction/eb/target/clas12detector-eb-*-SNAPSHOT.jar coatjava/lib/services/
112-
cp reconstruction/band/target/clas12detector-band-*-SNAPSHOT.jar coatjava/lib/services/
113-
cp reconstruction/rtpc/target/clas12detector-rtpc-*-SNAPSHOT.jar coatjava/lib/services/
114-
cp reconstruction/mlt/target/clas12detector-mlt-1.0-SNAPSHOT-jar-with-dependencies.jar coatjava/lib/services/
115-
cp reconstruction/mltn/target/clas12detector-mltn-1.0-SNAPSHOT-jar-with-dependencies.jar coatjava/lib/services/
128+
cp reconstruction/*/target/clas12detector-*-SNAPSHOT.jar coatjava/lib/services/
116129

117130
echo "COATJAVA SUCCESSFULLY BUILT !"

common-tools/clara-io/pom.xml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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+
<groupId>org.jlab.clas</groupId>
5+
<artifactId>clara-io</artifactId>
6+
<version>7.0.0-SNAPSHOT</version>
7+
<packaging>jar</packaging>
8+
9+
<parent>
10+
<groupId>org.jlab.clas</groupId>
11+
<artifactId>clas12rec</artifactId>
12+
<relativePath>../../parent/pom.xml</relativePath>
13+
<version>7.0.0-SNAPSHOT</version>
14+
</parent>
15+
16+
<build>
17+
<plugins>
18+
<plugin>
19+
<groupId>org.apache.maven.plugins</groupId>
20+
<artifactId>maven-compiler-plugin</artifactId>
21+
<configuration>
22+
<source>1.8</source>
23+
<target>1.8</target>
24+
</configuration>
25+
</plugin>
26+
</plugins>
27+
</build>
28+
29+
<dependencies>
30+
31+
<dependency>
32+
<groupId>org.jlab.coda</groupId>
33+
<artifactId>jclara</artifactId>
34+
<version>4.3-SNAPSHOT</version>
35+
</dependency>
36+
37+
<dependency>
38+
<groupId>org.jlab.coda</groupId>
39+
<artifactId>jevio</artifactId>
40+
<version>6.2-SNAPSHOT</version>
41+
<classifier>jar-with-dependencies</classifier>
42+
<exclusions>
43+
<exclusion>
44+
<groupId>net.jpountz.lz4</groupId>
45+
<artifactId>lz4-java</artifactId>
46+
</exclusion>
47+
<exclusion>
48+
<groupId>com.aha.compression</groupId>
49+
<artifactId> AHACompressionAPI </artifactId>
50+
</exclusion>
51+
<exclusion>
52+
<groupId>com.lmax</groupId>
53+
<artifactId>disruptor</artifactId>
54+
</exclusion>
55+
<exclusion>
56+
<groupId>proguard</groupId>
57+
<artifactId>proguard</artifactId>
58+
</exclusion>
59+
</exclusions>
60+
</dependency>
61+
62+
<dependency>
63+
<groupId>org.jlab.jnp</groupId>
64+
<artifactId>jnp-hipo</artifactId>
65+
<version>2.0-SNAPSHOT</version>
66+
</dependency>
67+
68+
<dependency>
69+
<groupId>org.jlab.jnp</groupId>
70+
<artifactId>jnp-hipo4</artifactId>
71+
<version>4.1-SNAPSHOT</version>
72+
</dependency>
73+
74+
</dependencies>
75+
76+
<properties>
77+
<maven.compiler.source>1.8</maven.compiler.source>
78+
<maven.compiler.target>1.8</maven.compiler.target>
79+
</properties>
80+
81+
</project>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package org.jlab.io.clara;
2+
3+
import org.jlab.clara.base.error.ClaraException;
4+
import org.jlab.clara.engine.ClaraSerializer;
5+
import org.jlab.clara.engine.EngineDataType;
6+
import org.jlab.jnp.hipo4.data.Event;
7+
8+
import java.nio.ByteBuffer;
9+
10+
// TODO: put this in a common CLAS package
11+
// TODO: should bytes be copied?
12+
public final class Clas12Types {
13+
14+
private Clas12Types() { }
15+
16+
private static class HipoSerializer implements ClaraSerializer {
17+
18+
@Override
19+
public ByteBuffer write(Object data) throws ClaraException {
20+
Event event = (Event) data;
21+
return ByteBuffer.wrap(event.getEventBuffer().array());
22+
}
23+
24+
@Override
25+
public Object read(ByteBuffer buffer) throws ClaraException {
26+
Event event = new Event(buffer.array().length);
27+
event.initFrom(buffer.array());
28+
return event;
29+
}
30+
}
31+
32+
public static final EngineDataType EVIO =
33+
new EngineDataType("binary/data-evio", EngineDataType.BYTES.serializer());
34+
35+
public static final EngineDataType HIPO =
36+
new EngineDataType("binary/data-hipo", new HipoSerializer());
37+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package org.jlab.io.clara;
2+
3+
import java.io.IOException;
4+
import java.nio.ByteOrder;
5+
import java.nio.file.Path;
6+
7+
import org.jlab.clara.engine.EngineDataType;
8+
import org.jlab.clara.std.services.AbstractEventReaderService;
9+
import org.jlab.clara.std.services.EventReaderException;
10+
import org.jlab.coda.jevio.EvioCompactReader;
11+
import org.jlab.coda.jevio.EvioException;
12+
import org.json.JSONObject;
13+
14+
/**
15+
* Converter service that converts EvIO persistent data to EvIO transient data
16+
* (i.e. Reads EvIO events from an input file)
17+
*/
18+
public class EvioToEvioReader extends AbstractEventReaderService<EvioCompactReader> {
19+
20+
@Override
21+
protected EvioCompactReader createReader(Path file, JSONObject opts)
22+
throws EventReaderException {
23+
try {
24+
return new EvioCompactReader(file.toFile());
25+
} catch (EvioException | IOException e) {
26+
throw new EventReaderException(e);
27+
}
28+
}
29+
30+
@Override
31+
protected void closeReader() {
32+
reader.close();
33+
}
34+
35+
@Override
36+
public int readEventCount() throws EventReaderException {
37+
return reader.getEventCount();
38+
}
39+
40+
@Override
41+
public ByteOrder readByteOrder() throws EventReaderException {
42+
return reader.getFileByteOrder();
43+
}
44+
45+
@Override
46+
public Object readEvent(int eventNumber) throws EventReaderException {
47+
try {
48+
return reader.getEventBuffer(++eventNumber, true);
49+
} catch (EvioException e) {
50+
throw new EventReaderException(e);
51+
}
52+
}
53+
54+
@Override
55+
protected EngineDataType getDataType() {
56+
return Clas12Types.EVIO;
57+
}
58+
}

0 commit comments

Comments
 (0)