Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
c2007e3
separate functionality
baltzell Sep 4, 2026
2c569d3
fix method name
baltzell Sep 4, 2026
e2ff578
add accessor
baltzell Sep 4, 2026
e566858
add serial class
baltzell Sep 4, 2026
2988f8a
separate "serial" functionality for reusability
baltzell Sep 4, 2026
d8b8802
relocate serial/postprocessing utilities to clas-detector
baltzell Sep 4, 2026
6522196
default to zero for easier event counting
baltzell Sep 4, 2026
b1f3a22
add support for io-services
baltzell Sep 4, 2026
c21f1f6
add ReconMutil
baltzell Sep 4, 2026
ea4cc85
add recon-mutil
baltzell Sep 4, 2026
152295a
fix
baltzell Sep 4, 2026
dad364d
only printout if interval is positive
baltzell Sep 4, 2026
60ce0df
update ci for recon-mutil
baltzell Sep 4, 2026
919f999
bugfix
baltzell Sep 4, 2026
d8eb345
quiet tarball extraction
baltzell Sep 4, 2026
12472a2
prep pp
baltzell Sep 5, 2026
1a852a7
add another queue, to prime for postprocessing
baltzell Sep 5, 2026
b6b715d
cleanup
baltzell Sep 5, 2026
2afd58d
cleanup
baltzell Sep 5, 2026
0fe93f8
Merge branch 'development' into recon-mutil
baltzell Sep 8, 2026
67cce53
null yaml bugfix
baltzell Sep 9, 2026
870d275
remove throwers and catchers
baltzell Sep 10, 2026
6574f29
add postproc to serial
baltzell Sep 10, 2026
252abb0
replace duplicate serial.read w/ read+process
baltzell Sep 10, 2026
d0c451f
remove post-processing from Clas12Writer
baltzell Sep 10, 2026
e17fcd6
convert to HelicitySequence, oopts
baltzell Sep 10, 2026
7d62e4d
prime the serial buffer
baltzell Sep 10, 2026
a9e1a2a
set read queue limit at 100k events, 2 GB
baltzell Sep 10, 2026
5d4b587
cleanup
baltzell Sep 11, 2026
e7100b4
add pausing
baltzell Sep 11, 2026
37f0766
cleanup
baltzell Sep 11, 2026
b5cbe3b
working state (with yaml)
baltzell Sep 11, 2026
5fc6715
fix oops
baltzell Sep 12, 2026
dceb40e
cleanup, add volatiles
baltzell Sep 13, 2026
bde0253
fix
baltzell Sep 14, 2026
d29de07
fix
baltzell Sep 14, 2026
0d85d1c
debug
baltzell Sep 14, 2026
d692c40
debug
baltzell Sep 15, 2026
15e154b
fix thread safety
baltzell Sep 15, 2026
267c3df
add comments
baltzell Sep 15, 2026
ff3c101
Merge branch 'development' into recon-mutil
baltzell Sep 15, 2026
e13e40d
make it if the user did not
baltzell Sep 15, 2026
817c766
cleanup
baltzell Sep 15, 2026
5139d2b
restore scaling test
baltzell Sep 15, 2026
93ab9ed
lower locks, only engine-process tag-0
baltzell Sep 16, 2026
4a90681
fix initialization
baltzell Sep 16, 2026
97c5c2c
restore test
baltzell Sep 16, 2026
c80b620
cleanup
baltzell Sep 16, 2026
76237fc
remove unecssary volatiles
baltzell Sep 16, 2026
bf8e90f
rename
baltzell Sep 16, 2026
aac53a6
Merge branch 'development' into recon-mutil
baltzell Sep 16, 2026
a148f73
update test
baltzell Sep 16, 2026
5be7019
reenable
baltzell Sep 16, 2026
fd9605a
reenable
baltzell Sep 16, 2026
23b403d
add abstract attempt
baltzell Sep 16, 2026
b9e54cc
undebugging
baltzell Sep 17, 2026
2a9f36b
let constructor be public
baltzell Sep 17, 2026
27f3298
switch to local instance
baltzell Sep 17, 2026
4e46732
new benchmark instead of reset
baltzell Sep 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,12 @@ jobs:
tar xzf clara.tar.gz
tar xzf coatjava.tar.gz
- run: ls
- name: run test
run: ./bin/run-clara -y ./etc/services/rgd-clarode.yml -t 4 -n 500 -c ./clara -o ./tmp ./clas_018779.evio.00001
- name: run clara
run: ./coatjava/bin/run-clara -y ./etc/services/rgd-clarode.yml -t 4 -n 100 -c ./clara -o ./tmp ./clas_018779.evio.00001
- name: run mutil
run: ./coatjava/bin/recon-mutil -y ./etc/services/rgd-clarode.yml -t 1,2,3,4 -o rec.hipo ./clas_018779.evio.00001
- name: ls tmp
run: ls -lhtr tmp
- name: rename
run: mv -v tmp/rec_clas_018779.evio.00001.hipo rec.hipo
run: ls -lhtr . tmp
- uses: actions/upload-artifact@v7
with:
name: test_clara_result
Expand Down
8 changes: 8 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ clara:
- run-clara -v -c $CLARA_HOME -t 4 -y ./etc/services/rgd-clarode.yml -n 30 -o out $EVIOFILE
- mv out/rec_$EVIOFILE.hipo claroded.hipo

recon-mutil:
stage: test
needs: [build,download]
dependencies: [build,download]
script:
- tar -xzf coatjava.tar.gz
- recon-mutil -t 4 -y ./etc/services/rgd-clarode.yml -n 30 -o rec_$EVIOFILE.hipo $EVIOFILE

profile:
extends: .clon
allow_failure: true
Expand Down
12 changes: 12 additions & 0 deletions bin/recon-mutil
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

. `dirname $0`/../libexec/env.sh

split_cli $@

export MALLOC_ARENA_MAX=1

java ${JAVA_OPTS-} -Xms10240m -XX:+UseParallelGC ${jvm_options[@]} \
-cp ${COATJAVA_CLASSPATH:-''} \
org.jlab.clas.reco.ReconMutil \
${class_options[@]}
8 changes: 1 addition & 7 deletions common-tools/clara-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
<artifactId>jnp-hipo4</artifactId>
</dependency>

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-io</artifactId>
<version>14.2.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-detector</artifactId>
Expand All @@ -50,7 +44,7 @@

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-utils</artifactId>
<artifactId>clas-io</artifactId>
<version>14.2.0-SNAPSHOT</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
package org.jlab.io.clara;

import java.io.File;
import java.nio.file.Path;
import java.util.List;
import java.util.TreeMap;
import java.util.TreeSet;
import org.jlab.clara.std.services.EventWriterException;
import org.jlab.detector.calib.utils.ConstantsManager;
import org.jlab.detector.helicity.HelicitySequenceDelayed;
import org.jlab.detector.serial.SerialHoncho;
import org.jlab.detector.serial.PostProcessor;
import org.jlab.jnp.hipo4.data.Bank;
import org.jlab.jnp.hipo4.data.Event;
import org.jlab.jnp.hipo4.data.SchemaFactory;
import org.jlab.jnp.hipo4.io.HipoReader;
import org.jlab.jnp.hipo4.io.HipoWriterSorted;
import org.jlab.jnp.utils.file.FileUtils;
import org.json.JSONObject;
Expand All @@ -23,27 +15,22 @@
* 1. Copies certain banks on-the-fly to new tag-1 events
* 2. Caches helicity states, scaler readouts, and unix time
* 3. Writes HEL::flip, RUN/HEL::scaler, and RUN::unix to new tag-1 events
* 4. Runs post-processing, writing tag-1 information to all events
* 5. Adds .hipo to the output filename, if necessary
*
* @author baltzell
*/
public class Clas12Writer extends HipoToHipoWriter {

SerialHoncho serial;
Bank runConfig;
ConstantsManager conman;
SchemaFactory fullSchema;
boolean postprocess;

private void init(JSONObject opts) {
fullSchema = new SchemaFactory();
fullSchema.initFromDirectory(FileUtils.getEnvironmentPath("CLAS12DIR","etc/bankdefs/hipo4"));
serial = new SerialHoncho(fullSchema);
runConfig = new Bank(fullSchema.getSchema("RUN::config"));
conman = new ConstantsManager();
conman.init("/runcontrol/hwp","/runcontrol/helicity");
postprocess = opts.optBoolean("postprocess", false);
if (opts.has("variation")) conman.setVariation(opts.getString("variation"));
if (opts.has("timestamp")) conman.setTimeStamp(opts.getString("timestamp"));
}
Expand All @@ -70,49 +57,9 @@ protected void writeEvent(Object event) throws EventWriterException {

@Override
protected void closeWriter() {
serial.finish(writer);
serial.closure(writer);
super.closeWriter();
if (postprocess) postprocess();
serial.clear();
}

/**
* Get the first valid run number from a RUN::config bank.
* @return run
*/
private int getRunNumber() {
Event e = new Event();
HipoReader r = new HipoReader();
r.open(filename);
while (r.hasNext()) {
r.nextEvent(e);
e.read(runConfig);
if (runConfig.getRows()>0 && runConfig.getInt("run",0)>0)
return runConfig.getInt("run",0);
}
return 0;
}

/**
* Copy helicity/charge tag-1 information to all events.
*/
private void postprocess() {
int d = conman.getConstants(getRunNumber(), "/runcontrol/helicity").getIntValue("delay",0,0,0);
HelicitySequenceDelayed helicity = new HelicitySequenceDelayed(d);
helicity.addStream(serial.getHelicities());
PostProcessor p = new PostProcessor(List.of(filename), fullSchema, helicity, serial.getScalers());
HipoReader r = new HipoReader();
r.open(filename);
Event e = new Event();
writer.open("pp_"+filename);
while (r.hasNext()) {
r.nextEvent(e);
p.processEvent(e);
HipoToHipoWriter.writeEvent(writer, e, schemaBankList);
}
writer.close();
new File(filename).delete();
new File("pp_"+filename).renameTo(new File(filename));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ public Event getDecodedEvent(EvioDataEvent rawEvent) {
return getDecodedEvent(rawEvent, -1, -1, null, null);
}

public HipoDataEvent getDecodedDataEvenet(EvioDataEvent rawEvent) {
public HipoDataEvent getDecodedDataEvent(EvioDataEvent rawEvent) {
return new HipoDataEvent(getDecodedEvent(rawEvent), schemaFactory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public CLASDecoderPool(int size, String variation, String timestamp) {
}
}

public CLASDecoder take() throws InterruptedException {
public CLASDecoder take() {
return pool.poll();
}

public void put(CLASDecoder decoder) throws InterruptedException {
public void put(CLASDecoder decoder) {
pool.offer(decoder);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,22 @@ public void processEvent(Event event) {
}
}

public void processFile(String input, String output) {
Event event = new Event();
HipoReader r = new HipoReader();
r.open(input);
HipoWriterSorted w = new HipoWriterSorted();
w.getSchemaFactory().initFromDirectory(ClasUtilsFile.getResourceDir("CLAS12DIR", "etc/bankdefs/hipo4"));
w.setCompressionType(2);
w.open(output);
while (r.hasNext()) {
r.nextEvent(event);
processEvent(event);
if (w != null) w.addEvent(event);
}
r.close();
}

/**
* The "postprocess" program.
* @param args
Expand Down
Loading
Loading