alcap-org / AlcapDAQ

Alcap DAQ
alcap-org.github.io
8 stars 0 forks source link

Can't get coarse time offsets when no_time_shift option is false #224

Closed AndrewEdmonds11 closed 10 years ago

AndrewEdmonds11 commented 10 years ago

When I set the no_time_offset option to false in production.cfg, there is a map::at std::out_of_range exception thrown. I don't understand why because it looks like the no_time_offset option is stripped out of the source.

Here's the backtrace:

Catchpoint 1 (exception thrown), __cxxabiv1::__cxa_throw (obj=0x100a3f0, tinfo=0x2aaaaeb1dd80, dest=0x2aaaae88ef20 <std::out_of_range::~out_of_range()>)
    at ../../../../gcc-4.7-source/gcc-4.7-20130202/libstdc++-v3/libsupc++/eh_throw.cc:70
70      ../../../../gcc-4.7-source/gcc-4.7-20130202/libstdc++-v3/libsupc++/eh_throw.cc: No such file or directory.
        in ../../../../gcc-4.7-source/gcc-4.7-20130202/libstdc++-v3/libsupc++/eh_throw.cc
(gdb) bt
#0  __cxxabiv1::__cxa_throw (obj=0x100a3f0, tinfo=0x2aaaaeb1dd80, dest=0x2aaaae88ef20 <std::out_of_range::~out_of_range()>)
    at ../../../../gcc-4.7-source/gcc-4.7-20130202/libstdc++-v3/libsupc++/eh_throw.cc:70
#1  0x00002aaab040f565 in std::__throw_out_of_range (__s=0x4ccae8 "map::at") at ../../../../../gcc-4.7-source/gcc-4.7-20130202/libstdc++-v3/src/c++11/functexcept.cc:82
#2  0x000000000044529c in at (this=0x10eef80, opts=0x1052be0)
    at /unix/muons/comet/mars/1512/gcc-4.7/gcc-4.7/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/bits/stl_map.h:491
#3  GetCoarseTimeOffset (this=0x10eef80, opts=0x1052be0) at src/framework/SetupNavigator.h:36
#4  FirstCompleteAPGenerator::FirstCompleteAPGenerator (this=0x10eef80, opts=0x1052be0) at src/TAP_generators/FirstCompleteAPGenerator.cpp:26
#5  0x00000000004459e9 in RegistryProxyMaker<FirstCompleteAPGenerator, TVAnalysedPulseGenerator, TAPGeneratorOptions> (opts=0x1052be0) at src/framework/TemplateFactory.h:73
#6  0x0000000000441a04 in TemplateFactory<TVAnalysedPulseGenerator, TAPGeneratorOptions>::createModule (this=0xab85a0, name="FirstComplete", opts=0x1052be0) at src/framework/TemplateFactory.tpl:32
#7  0x000000000044b7ae in MakeAnalysedPulses::AddGenerator (this=0x1114090, detector="muSc", generatorType="FirstComplete", opts=0x1052be0) at src/TAP_generators/MakeAnalysedPulses.cpp:206
#8  0x000000000044bd73 in MakeAnalysedPulses::ParseGeneratorList (this=0x1114090, detector="muSc", generatorList=std::vector of length 1, capacity 1 = {...})
    at src/TAP_generators/MakeAnalysedPulses.cpp:177
#9  0x000000000044cc11 in MakeAnalysedPulses::BeforeFirstEntry (this=0x1114090, gData=Unhandled dwarf expression opcode 0xf3
) at src/TAP_generators/MakeAnalysedPulses.cpp:76
#10 0x000000000048814f in BaseModule::Preprocess (this=0x1114090, gData=0xf69290, gSetup=0xdb0850) at src/framework/BaseModule.cpp:60
#11 0x000000000048dd02 in LoopSequence::Preprocess (this=0xfa1e60) at src/framework/LoopSequence.cpp:84
#12 0x000000000048e34b in LoopSequence::Run (this=0xfa1e60) at src/framework/LoopSequence.cpp:138
#13 0x0000000000439cec in Main_event_loop (dataTree=Unhandled dwarf expression opcode 0xf3
) at src/main.cpp:193
#14 0x000000000043b044 in main (argc=Unhandled dwarf expression opcode 0xf3
) at src/main.cpp:146

and this is frame 3:

(gdb) frame 3
#3  GetCoarseTimeOffset (this=0x10eef80, opts=0x1052be0) at src/framework/SetupNavigator.h:36
36        double GetCoarseTimeOffset(const IDs::source& src) { return fCoarseTimeOffset.at(src); }

Any ideas?

jrquirk commented 10 years ago

It's stripped out in the SetCoarseTimeOffset function, not the getter. I didn't experience this issue because I just left it as a default value instead of actually putting no_time_shift=false into the config file.

So you can either strip it:

return fCoarseTimeOffset.at(IDs::source(StrupFunction(src.str())));

or remove it from the modules file. Either of these are temporary fixes.

AndrewEdmonds11 commented 10 years ago

remove it from the modules file

I was just about to say that this works.

One other problem is that there is no coarse time offset in the calibration DB for muSc which is also causing a crash. What should I do?

jrquirk commented 10 years ago

Put in zeros. For now just have a branch in the getter like if is muSc, then return 0, else return .... I'll put in the zeros later.

AndrewEdmonds11 commented 10 years ago

Cheers, John. That worked.