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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.jlab.jnp.hipo4.data.Event;
import org.jlab.jnp.hipo4.data.SchemaFactory;
import org.jlab.jnp.hipo4.io.HipoWriterSorted;
import org.jlab.jnp.utils.file.FileUtils;
import org.jlab.utils.CLASResources;
import org.json.JSONObject;

/**
Expand All @@ -28,17 +28,15 @@ public class Clas12Writer extends HipoToHipoWriter {
SerialHoncho serial;
Bank runConfig;
ConstantsManager conman;
SchemaFactory fullSchema;
SchemaFactory fullSchema = CLASResources.getFullSchema();
HipoWriterSorted paraWriter;
long paraCount;
long paraTriggerMask;
int paraTriggerPrescale;

private void init(JSONObject opts) {
occupancer = new Occupancer(opts.optLong("occTriggerMask",(long)1<<39),opts.optInt("occEvents",100));
fullSchema = new SchemaFactory();
fullSchema.initFromDirectory(FileUtils.getEnvironmentPath("CLAS12DIR","etc/bankdefs/hipo4"));
serial = new SerialHoncho(fullSchema);
serial = new SerialHoncho();
runConfig = new Bank(fullSchema.getSchema("RUN::config"));
conman = new ConstantsManager();
conman.init("/runcontrol/hwp","/runcontrol/helicity");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.jlab.jnp.hipo4.data.Schema;
import org.jlab.jnp.hipo4.data.SchemaFactory;
import org.jlab.jnp.hipo4.io.HipoWriterSorted;
import org.jlab.utils.CLASResources;

/**
*
Expand All @@ -27,7 +28,7 @@
public class SerialHoncho {

static final String[] TAG1BANKS = {"RUN::scaler","HEL::scaler","RAW::scaler","RAW::epics","HEL::flip","COAT::config"};
SchemaFactory schema;
static final SchemaFactory SCHEMA = CLASResources.getFullSchema();
Schema[] tag1banks;
Schema runConfig;
Schema recEvent;
Expand All @@ -40,20 +41,19 @@ public class SerialHoncho {
volatile DaqScalersSequence scalers;
int run = 0;

public SerialHoncho(SchemaFactory schema) {
this.schema = schema;
public SerialHoncho() {
conman = new ConstantsManager();
conman.init("/runcontrol/hwp","/runcontrol/helicity");
runConfig = schema.getSchema("RUN::config");
recEvent = schema.getSchema("REC::Event");
helicityAdc = schema.getSchema("HEL::adc");
helScaler = schema.getSchema("HEL::scaler");
scalers = new DaqScalersSequence(schema);
runConfig = SCHEMA.getSchema("RUN::config");
recEvent = SCHEMA.getSchema("REC::Event");
helicityAdc = SCHEMA.getSchema("HEL::adc");
helScaler = SCHEMA.getSchema("HEL::scaler");
scalers = new DaqScalersSequence(SCHEMA);
helicities = new TreeSet<>();
eventUnix = new TreeMap<>();
tag1banks = new Schema[TAG1BANKS.length];
for (int i=0; i<tag1banks.length; ++i)
tag1banks[i] = schema.getSchema(TAG1BANKS[i]);
tag1banks[i] = SCHEMA.getSchema(TAG1BANKS[i]);
}

/**
Expand Down Expand Up @@ -125,7 +125,7 @@ public ConstantsManager getConstantsManager() {
}

public SchemaFactory getSchemaFactory() {
return schema;
return SCHEMA;
}

/**
Expand Down Expand Up @@ -183,7 +183,7 @@ void prune() {
* @return
*/
Event getUnixEvent(Bank config) {
Bank unix = new Bank(schema.getSchema("RUN::unix"), eventUnix.size());
Bank unix = new Bank(SCHEMA.getSchema("RUN::unix"), eventUnix.size());
int row = 0;
for (int evno : eventUnix.keySet()) {
unix.putInt("event", row, evno);
Expand Down
Loading