JeffersonLab / hps-java

HPS reconstruction and analysis framework in Java
2 stars 10 forks source link

No TiTimeOffset condition exists for runs >= 9000 #466

Closed andrea-celentano closed 5 years ago

andrea-celentano commented 5 years ago

When launching hps-java on a evio file taken with ECAL-Only DAQ, run number 9004, the following error is reported. I tried both using as detector:

HPS-PhysicsRun2016-Pass2

and

HPS-ECalCommissioning
Exception in thread "main" java.lang.RuntimeException: No TiTimeOffset condition exists for run 9004
    at org.hps.conditions.trigger.TiTimeOffsetConverter.getData(TiTimeOffsetConverter.java:24)
    at org.hps.conditions.trigger.TiTimeOffsetConverter.getData(TiTimeOffsetConverter.java:11)
    at org.lcsim.conditions.CachedConditionsImplementation.getCachedData(CachedConditionsImplementation.java:20)
    at org.hps.evio.LCSimEngRunEventBuilder.conditionsChanged(LCSimEngRunEventBuilder.java:104)
    at org.lcsim.conditions.ConditionsManagerImplementation.fireConditionsChanged(ConditionsManagerImplementation.java:122)
    at org.lcsim.conditions.ConditionsManagerImplementation.setConditionsReader(ConditionsManagerImplementation.java:69)
    at org.lcsim.conditions.ConditionsManagerImplementation.setDetector(ConditionsManagerImplementation.java:53)
    at org.hps.conditions.database.DatabaseConditionsManager.setDetector(DatabaseConditionsManager.java:801)
    at org.hps.evio.EvioToLcio.checkConditions(EvioToLcio.java:229)
    at org.hps.evio.EvioToLcio.bufferEvents(EvioToLcio.java:202)
    at org.hps.evio.EvioToLcio.run(EvioToLcio.java:514)
    at org.hps.evio.EvioToLcio.main(EvioToLcio.java:92)

Sample data: /work/hallb/hps/data/led/evio/

The command to replicate the error:

java -cp hps-distribution-4.4-SNAPSHOT-bin.jar org.hps.evio.EvioToLcio -d HPS-ECalCommissioning -r -x /org/hps/steering/monitoring/EcalLedSequenceStandalone.lcsim hpsecal_009004.evio.00000 -b -DoutputFile=led_test
JeremyMcCormick commented 5 years ago

I propose patching LCSimEngRunEventBuilder at line 102:

// Set TI time offset from run database.
DatabaseConditionsManager mgr = (DatabaseConditionsManager) conditionsEvent.getConditionsManager();
if (mgr.hasConditionsRecord("ti_time_offsets")) {
    TiTimeOffset t = mgr.getCachedConditions(TiTimeOffset.class, "ti_time_offsets").getCachedData();
    currentTiTimeOffset = t.getValue();            
}

I need the command line to run

JeremyMcCormick commented 5 years ago

With the patch, this command seems to work:

java -cp ./distribution/target/hps-distribution-4.4-SNAPSHOT-bin.jar org.hps.evio.EvioToLcio -d HPS-ECalCommissioning -R 9000 -r -x /org/hps/steering/monitoring/EcalLedSequenceStandalone.lcsim /work/slac/data/hps_ecal_calib_000081_1000evts.evio.0 -b -DoutputFile=led_test

I still get all the errors about converting trigger data but that's a separate issue.

JeremyMcCormick commented 5 years ago

This should be resolved by PR #470.