Bug #1048
Problem getting EMR data structure working
0%
Description
By email from Leila Haegel:
I am going on implementing the EMR in MAUS and I have some problem with
the
EMRSD. When it is coded to save into CPP files, MAUS works fine and ROOT
files display data for all the detectors but the EMR (as expected as there
is no conversion from CPP to ROOT).
The strange thing is that when I code the EMRSD in order to save into JSON
files, not only the ROOT file produced doesn't display any histogram for
the EMR, but neither for the Tracker (SciFiSD) which I used as an example.
I got the following error :
Traceback (most recent call last):
File "/home/common/opt/maus/src/**common_py/ErrorHandler.py", line
159, in
HandleCppException
raise(CppError(error_message))
ErrorHandler.CppError: St9exception
at the moment when I add the line :
_hits["emr_hits"].append(Json:**:Value());
The EMR is present in MAUSDataStructure, HitProcessor, MCEventProcessor
and
there are files for EMRChannelIdProcessor, EMREventProcessor and
EMRSpillDataProcessor in the JsonCppProcessor folder.
I guess there is an argument related to the generation of Json files which
is missing somewhere, but I don't know where. Any idea ?
The file I was writting you about is :
src/common_cpp/DetModel/EMR/EMRSD.cc
The line :
_hits["emr_hits"].append(Json::Value());
causes the error.
Files
Updated by Rogers, Chris almost 11 years ago
Is this lp:~maus-emr/maus/devel/
It fails to link for me with an error like
src/common_cpp/DetModel/EMR/EMRSD.os: In function `EMRSD::Initialize(G4HCofThisEvent*)': EMRSD.cc:(.text+0x0): multiple definition of `EMRSD::Initialize(G4HCofThisEvent*)' src/legacy/DetModel/EMR/EMRSD.os:EMRSD.cc:(.text+0x0): first defined here src/common_cpp/DetModel/EMR/EMRSD.os: In function `EMRSD::EndOfEvent(G4HCofThisEvent*)': EMRSD.cc:(.text+0x10): multiple definition of `EMRSD::EndOfEvent(G4HCofThisEvent*)' src/legacy/DetModel/EMR/EMRSD.os:EMRSD.cc:(.text+0x10): first defined here src/common_cpp/DetModel/EMR/EMRSD.os: In function `EMRSD::ProcessHits(G4Step*, G4TouchableHistory*)': EMRSD.cc:(.text+0x20): multiple definition of `EMRSD::ProcessHits(G4Step*, G4TouchableHistory*)' src/legacy/DetModel/EMR/EMRSD.os:EMRSD.cc:(.text+0x90): first defined here src/common_cpp/DetModel/EMR/EMRSD.os: In function `EMRSD::EMRSD(MiceModule*)': EMRSD.cc:(.text+0x100): multiple definition of `EMRSD::EMRSD(MiceModule*)' src/legacy/DetModel/EMR/EMRSD.os:EMRSD.cc:(.text+0xa20): first defined here src/common_cpp/DetModel/EMR/EMRSD.os: In function `EMRSD::EMRSD(MiceModule*)': EMRSD.cc:(.text+0x100): multiple definition of `EMRSD::EMRSD(MiceModule*)' src/legacy/DetModel/EMR/EMRSD.os:EMRSD.cc:(.text+0xa20): first defined here collect2: ld returned 1 exit status
Full text attached in scons.log
Updated by Rogers, Chris almost 11 years ago
- Assignee changed from Rogers, Chris to Haegel, Leila
Updated by Rogers, Chris almost 11 years ago
Is there any folder called 'EMR' in src/legacy/DetModel ? This folder is
now present in src/common_cpp/DetModel. Having both creates exactly the
errors you had.I have removed them on my branch and I have tried to removed them while
pushing the branch as well but this was a little tricky, so maybe this
change was not taken into account.
Updated by Rogers, Chris almost 11 years ago
at the moment when I add the line : _hits["emr_hits"].append(Json::Value());
Where are you adding this line? Directory, file, line number please?
Updated by Rogers, Chris almost 11 years ago
I ran default simulation like
./bin/simulate_mice.pyand get output like this:
Stack trace:/home/cr67/MAUS/maus_emr/build/libMausCpp.so(_ZN4MAUS15ObjectProcessorINS_3HitINS_12EMRChannelIdEEEE9JsonToCppERKN4Json5ValueE+0x227) [0x7f95d77e0fc7] /home/cr67/MAUS/maus_emr/build/libMausCpp.so(_ZN4MAUS19ValueArrayProcessorINS_3HitINS_12EMRChannelIdEEEE9JsonToCppERKN4Json5ValueE+0x22f) [0x7f95d77ce67f] /home/cr67/MAUS/maus_emr/build/libMausCpp.so(_ZN4MAUS11PointerItemINS_7MCEventESt6vectorINS_3HitINS_12EMRChannelIdEEESaIS5_EEE11SetCppChildERKN4Json5ValueERS1_+0x153) [0x7f95d77cb5c3] /home/cr67/MAUS/maus_emr/build/libMausCpp.so(_ZN4MAUS15ObjectProcessorINS_7MCEventEE9JsonToCppERKN4Json5ValueE+0x60) [0x7f95d77cec70] /home/cr67/MAUS/maus_emr/build/libMausCpp.so(_ZN4MAUS21PointerArrayProcessorINS_7MCEventEE9JsonToCppERKN4Json5ValueE+0x176) [0x7f95d77f6746] /home/cr67/MAUS/maus_emr/build/libMausCpp.so(_ZN4MAUS11PointerItemINS_5SpillESt6vectorIPNS_7MCEventESaIS4_EEE11SetCppChildERKN4Json5ValueERS1_+0x153) [0x7f95d77f5603] /home/cr67/MAUS/maus_emr/build/libMausCpp.so(_ZN4MAUS15ObjectProcessorINS_5SpillEE9JsonToCppERKN4Json5ValueE+0x60) [0x7f95d77f6c20] /home/cr67/MAUS/maus_emr/build/libMausCpp.so(_ZN4MAUS16JsonCppConverterclERKN4Json5ValueE+0x21) [0x7f95d782c351] /home/cr67/MAUS/maus_emr/build/_OutputCppRoot.so(_ZN4MAUS13OutputCppRoot4saveESs+0xa0) [0x7f95bd90d400] /home/cr67/MAUS/maus_emr/build/_OutputCppRoot.so(+0xa4dd) [0x7f95bd9124dd] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x52be) [0x7f95dfdd5f0e] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x855) [0x7f95dfdd7ce5] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5245) [0x7f95dfdd5e95] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x629a) [0x7f95dfdd6eea] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x855) [0x7f95dfdd7ce5] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(+0x745ec) [0x7f95dfd5b5ec] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyObject_Call+0x53) [0x7f95dfd337f3] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(+0x59f4f) [0x7f95dfd40f4f] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyObject_Call+0x53) [0x7f95dfd337f3] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x47) [0x7f95dfdd0667] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyInstance_New+0x7b) [0x7f95dfd44fcb] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyObject_Call+0x53) [0x7f95dfd337f3] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x3e7d) [0x7f95dfdd4acd] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x629a) [0x7f95dfdd6eea] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x855) [0x7f95dfdd7ce5] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x32) [0x7f95dfdd7e22] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyRun_FileExFlags+0xb0) [0x7f95dfdfa3f0] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(PyRun_SimpleFileExFlags+0xdf) [0x7f95dfdfae8f] /home/cr67/MAUS/maus_merge/third_party/install/lib/libpython2.7.so.1.0(Py_Main+0xb85) [0x7f95dfe0dde5] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f95df74a30d] python() [0x400661] Traceback (most recent call last): File "/home/cr67/MAUS/maus_emr/src/common_py/ErrorHandler.py", line 159, in HandleCppException raise(CppError(error_message)) ErrorHandler.CppError: In branch mc_events In branch emr_hits Attempt to pass a json nullValue type as an object at ObjectProcessor<ObjectType>::JsonToCpp
There is a funny problem that might make error messages come through screwy, as detailed in issue #950 ... I'm afraid I still haven't resolved it, I spent a day on it and it looks rather tricky. But the data structure stuff is by default strict, so you must make the data you write in JSON reflect the data structure you want to import into C++/ROOT. Otherwise you will get errors.
Updated by Rogers, Chris over 10 years ago
- Status changed from Open to Rejected
Assume this is resolved, complain if this is still an open issue