Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion bin/postprocess2
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export MALLOC_ARENA_MAX=1

java ${JAVA_OPTS-} -Xmx768m -Xms768m -XX:+UseSerialGC \
-cp ${COATJAVA_CLASSPATH:-''} \
org.jlab.analysis.postprocess.Processor \
org.jlab.detector.serial.PostProcessor \
$*
6 changes: 0 additions & 6 deletions common-tools/clara-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@
<version>14.2.0-SNAPSHOT</version>
</dependency>

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

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-utils</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import java.util.List;
import java.util.TreeMap;
import java.util.TreeSet;
import org.jlab.analysis.postprocess.Processor;
import org.jlab.clara.std.services.EventWriterException;
import org.jlab.detector.calib.utils.ConstantsManager;
import org.jlab.detector.decode.CLASDecoder4;
import org.jlab.detector.helicity.HelicitySequence;
import org.jlab.detector.helicity.HelicitySequenceDelayed;
import org.jlab.detector.helicity.HelicityState;
import org.jlab.detector.scalers.DaqScalersSequence;
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;
Expand Down Expand Up @@ -148,7 +148,7 @@ private void postprocess() {
int d = conman.getConstants(getRunNumber(), "/runcontrol/helicity").getIntValue("delay",0,0,0);
HelicitySequenceDelayed helicity = new HelicitySequenceDelayed(d);
helicity.addStream(helicities);
Processor p = new Processor(List.of(filename), fullSchema, helicity, scalers);
PostProcessor p = new PostProcessor(List.of(filename), fullSchema, helicity, scalers);
HipoReader r = new HipoReader();
r.open(filename);
Event e = new Event();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.jlab.detector.scalers.DaqScalers;
import org.jlab.detector.helicity.HelicitySequenceManager;
import org.jlab.detector.scalers.DaqScalersSequence;
import org.jlab.detector.serial.SerialUtil;
import org.jlab.jnp.hipo4.data.Bank;
import org.jlab.jnp.hipo4.data.Event;
import org.jlab.jnp.hipo4.io.HipoReader;
Expand Down Expand Up @@ -122,7 +123,7 @@ else if (seq != null) {
runScalerBank = ds.createRunBank(writer.getSchemaFactory());
helScalerBank = ds.createHelicityBank(writer.getSchemaFactory());

Util.assignScalerHelicity(event, helScalerBank, helSeq);
SerialUtil.assignScalerHelicity(event, helScalerBank, helSeq);

// put modified HEL/RUN::scaler back in the event:
event.write(runScalerBank);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jlab.analysis.postprocess;

import org.jlab.detector.serial.PostProcessor;
import java.util.TreeMap;
import java.util.logging.Logger;
import org.jlab.clas.reco.ReconstructionEngine;
Expand All @@ -13,6 +14,7 @@
import org.jlab.detector.scalers.DaqScalersSequence;
import org.jlab.detector.helicity.HelicityBit;
import org.jlab.detector.helicity.HelicitySequenceDelayed;
import org.jlab.detector.serial.SerialUtil;
import org.jlab.jnp.hipo4.data.SchemaFactory;
import org.jlab.utils.groups.IndexedTable;
import org.jlab.utils.options.OptionParser;
Expand Down Expand Up @@ -81,7 +83,7 @@ public static void main(String[] args) {
LOGGER.info("\n>>> Initializing helicity configuration from CCDB ...\n");
ConstantsManager conman = new ConstantsManager();
conman.init("/runcontrol/hwp","/runcontrol/helicity");
final int run = Util.getRunNumber(parser.getInputList().get(0));
final int run = SerialUtil.getRunNumber(parser.getInputList().get(0));
IndexedTable helTable = conman.getConstants(run, "/runcontrol/helicity");

// Initialize the scaler sequence from tag-1 events:
Expand All @@ -102,7 +104,7 @@ public static void main(String[] args) {
}

// Initialize the unix-event map:
TreeMap<Integer,Integer> eventUnix = Processor.getEventUnixMap(schema, parser.getInputList());
TreeMap<Integer,Integer> eventUnix = PostProcessor.getEventUnixMap(schema, parser.getInputList());

// Loop over the input HIPO files:
LOGGER.info("\n>>> Starting post-processing ...\n");
Expand Down Expand Up @@ -138,7 +140,7 @@ public static void main(String[] args) {
if (doHelicityDelay) {
recEventBank.putByte("helicity",0,hb.value());
recEventBank.putByte("helicityRaw",0,hbraw.value());
Util.assignScalerHelicity(runConfigBank.getLong("timestamp",0), helScalerBank, helSeq);
SerialUtil.assignScalerHelicity(runConfigBank.getLong("timestamp",0), helScalerBank, helSeq);
}

// Write beam charge to REC::Event:
Expand Down Expand Up @@ -169,7 +171,7 @@ public static void main(String[] args) {
writer.addEvent(event, event.getEventTag());

// Copy config banks to new, tag-1 events:
Util.createTag1Events(writer, event, configEvent, configBanks);
SerialUtil.createTag1Events(writer, event, configEvent, configBanks);
}

reader.close();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jlab.analysis.postprocess;
package org.jlab.detector.serial;

import java.util.List;
import java.util.TreeMap;
Expand All @@ -24,7 +24,7 @@
*
* @author baltzell
*/
public class Processor {
public class PostProcessor {

public static final String CCDB_TABLES[] = {"/runcontrol/fcup","/runcontrol/slm",
"/runcontrol/helicity","/daq/config/scalers/dsc1","/runcontrol/hwp"};
Expand All @@ -37,7 +37,7 @@ public class Processor {
private HelicitySequenceDelayed helicitySequence = null;
private TreeMap<Integer,Integer> eventUnix = null;

public Processor(List<String> files, boolean restream, boolean rebuild) {
public PostProcessor(List<String> files, boolean restream, boolean rebuild) {
HipoReader r = new HipoReader();
r.open(files.get(0));
schemaFactory = r.getSchemaFactory();
Expand All @@ -46,13 +46,13 @@ public Processor(List<String> files, boolean restream, boolean rebuild) {
recEvent = new Bank(schemaFactory.getSchema("REC::Event"));
conman = new ConstantsManager();
conman.init(CCDB_TABLES);
helicitySequence = Util.getHelicity(files, schemaFactory, restream, conman);
helicitySequence = SerialUtil.getHelicity(files, schemaFactory, restream, conman);
if (rebuild) chargeSequence = DaqScalersSequence.rebuildSequence(1, conman, files);
else chargeSequence = DaqScalersSequence.readSequence(files);
eventUnix = getEventUnixMap(schemaFactory, files);
}

public Processor(List<String> files, SchemaFactory schema, HelicitySequenceDelayed h, DaqScalersSequence s) {
public PostProcessor(List<String> files, SchemaFactory schema, HelicitySequenceDelayed h, DaqScalersSequence s) {
schemaFactory = schema;
helicitySequence = h;
chargeSequence = s;
Expand Down Expand Up @@ -102,7 +102,7 @@ private void processEventHelicity(DataEvent event, DataBank runcfg, DataBank rec
DataBank helScaler = event.getBank("HEL::scaler");
if (helScaler.rows()>0) {
event.removeBank("HEL::scaler");
Util.assignScalerHelicity(runcfg.getLong("timestamp",0), ((HipoDataBank)helScaler).getBank(), helicitySequence);
SerialUtil.assignScalerHelicity(runcfg.getLong("timestamp",0), ((HipoDataBank)helScaler).getBank(), helicitySequence);
event.appendBank(helScaler);
}
}
Expand All @@ -122,7 +122,7 @@ private void processEventHelicity(Event event, Bank runcfg, Bank recevt) {
event.read(helScaler);
if (helScaler.getRows()>0) {
event.remove(schemaFactory.getSchema("HEL::scaler"));
Util.assignScalerHelicity(runcfg.getLong("timestamp",0), helScaler, helicitySequence);
SerialUtil.assignScalerHelicity(runcfg.getLong("timestamp",0), helScaler, helicitySequence);
event.write(helScaler);
}
}
Expand Down Expand Up @@ -247,7 +247,7 @@ public static void main(String args[]) {
boolean restream = !o.getOption("-f").isDefault();
boolean rebuild = !o.getOption("-c").isDefault();

Processor post = new Processor(o.getInputList(), restream, rebuild);
PostProcessor post = new PostProcessor(o.getInputList(), restream, rebuild);

HipoWriterSorted writer = null;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jlab.analysis.postprocess;
package org.jlab.detector.serial;

import java.sql.Time;
import java.util.Arrays;
Expand Down Expand Up @@ -26,9 +26,9 @@
* Static utility methods for postprocessing.
* @author baltzell
*/
class Util {
public class SerialUtil {

static final Logger logger = Logger.getLogger(Util.class.getName());
static final Logger logger = Logger.getLogger(SerialUtil.class.getName());

/**
* Assign the delay-corrected helicity to the HEL::scaler bank's rows
Expand Down
Loading