|
1 | 1 | package org.jlab.analysis.postprocess; |
2 | 2 |
|
| 3 | +import java.util.TreeMap; |
3 | 4 | import java.util.logging.Logger; |
4 | 5 | import org.jlab.clas.reco.ReconstructionEngine; |
5 | 6 | import org.jlab.detector.calib.utils.ConstantsManager; |
@@ -100,6 +101,9 @@ public static void main(String[] args) { |
100 | 101 | helSeq.initialize(parser.getInputList()); |
101 | 102 | } |
102 | 103 |
|
| 104 | + // Initialize the unix-event map: |
| 105 | + TreeMap<Integer,Integer> eventUnix = Processor.getEventUnixMap(schema, parser.getInputList()); |
| 106 | + |
103 | 107 | // Loop over the input HIPO files: |
104 | 108 | LOGGER.info("\n>>> Starting post-processing ...\n"); |
105 | 109 | for (String filename : parser.getInputList()) { |
@@ -147,6 +151,17 @@ public static void main(String[] args) { |
147 | 151 | event.write(recEventBank); |
148 | 152 | event.write(helScalerBank); |
149 | 153 |
|
| 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 | + |
150 | 165 | // Write out the original event: |
151 | 166 | writer.addEvent(event, event.getEventTag()); |
152 | 167 |
|
|
0 commit comments