Skip to content

Commit ad08ce0

Browse files
committed
propagate to old post-processor
1 parent 1e3bcc1 commit ad08ce0

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

  • common-tools/clas-analysis/src/main/java/org/jlab/analysis/postprocess

common-tools/clas-analysis/src/main/java/org/jlab/analysis/postprocess/Tag1ToEvent.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jlab.analysis.postprocess;
22

3+
import java.util.TreeMap;
34
import java.util.logging.Logger;
45
import org.jlab.clas.reco.ReconstructionEngine;
56
import org.jlab.detector.calib.utils.ConstantsManager;
@@ -100,6 +101,9 @@ public static void main(String[] args) {
100101
helSeq.initialize(parser.getInputList());
101102
}
102103

104+
// Initialize the unix-event map:
105+
TreeMap<Integer,Integer> eventUnix = Processor.getEventUnixMap(schema, parser.getInputList());
106+
103107
// Loop over the input HIPO files:
104108
LOGGER.info("\n>>> Starting post-processing ...\n");
105109
for (String filename : parser.getInputList()) {
@@ -147,6 +151,17 @@ public static void main(String[] args) {
147151
event.write(recEventBank);
148152
event.write(helScalerBank);
149153

154+
// Update RUN::config.unixtime:
155+
if (runConfigBank.getRows() > 0) {
156+
int evno = runConfigBank.getByte("event", 0);
157+
Integer unix = eventUnix.get(eventUnix.floorKey(evno));
158+
if (unix != null) {
159+
event.remove(runConfigBank.getSchema());
160+
runConfigBank.putInt("unixtime", 0, unix);
161+
event.write(runConfigBank);
162+
}
163+
}
164+
150165
// Write out the original event:
151166
writer.addEvent(event, event.getEventTag());
152167

0 commit comments

Comments
 (0)