H’mm, unfortunately it seems like this isn’t quite working. I built the library with your modifications and appended a simple check to the end of the script file: calling Print()
on the WCSimRootEvent
. This should scan over it’s contained triggers, digits, photons, tracks etc, and print out a summary. It ought to be a good first check everything is being read OK.
Unfortunately the script segmentation faults shortly into the print call:
$ root script.C
root [0]
Processing script.C...
Warning in <TClass::Init>: no dictionary for class WCSimRootEvent is available
Warning in <TClass::Init>: no dictionary for class WCSimRootTrigger is available
Warning in <TClass::Init>: no dictionary for class WCSimRootGeom is available
Warning in <TClass::Init>: no dictionary for class WCSimRootPMT is available
Warning in <TClass::Init>: no dictionary for class WCSimRootOptions is available
Warning in <TClass::Init>: no dictionary for class WCSimRootEventHeader is available
Warning in <TClass::Init>: no dictionary for class WCSimRootPi0 is available
Warning in <TClass::Init>: no dictionary for class WCSimRootCapture is available
Warning in <TClass::Init>: no dictionary for class WCSimRootTrack is available
Warning in <TClass::Init>: no dictionary for class WCSimRootCherenkovHit is available
Warning in <TClass::Init>: no dictionary for class WCSimRootCherenkovHitTime is available
Warning in <TClass::Init>: no dictionary for class WCSimRootCherenkovDigiHit is available
Info in <TBufferFile::ReadObjectAny>: Using Converter StreamerInfo from TObjArray to TObjArray_wrapper
Info in <TBufferFile::ReadObjectAny>: Using Converter StreamerInfo from TObjArray to TObjArray_wrapper
Info in <TBufferFile::ReadObjectAny>: Using Converter StreamerInfo from TObjArray to TObjArray_wrapper
This entry had 1 triggers
Trigger time : 0
Number Primary Vertices : 1
will loop over 1 primaries (fNvtxs=1), c.f. size(fVtxs)=2700
Primary vertex 0 was at (-1.58819e-23, -1.58819e-23, -1.58819e-23)
looping over 1935 digits
getting digihit 0
adding photon count
calling digihit->GetPhotonIds()
*** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x00007f5abbc89ffa in __GI___waitpid (pid=11719, stat_loc=stat_loc
entry=0x7ffc786d2160, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1 0x00007f5abbc110ab in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
#2 0x00007f5abccf9c54 in TUnixSystem::Exec (shellcmd=<optimized out>, this=<optimized out>) at /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/sauce/core/unix/src/TUnixSystem.cxx:2096
#3 TUnixSystem::StackTrace (this=0x224e4f0) at /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/sauce/core/unix/src/TUnixSystem.cxx:2324
#4 0x00007f5abccfbdcc in TUnixSystem::DispatchSignals (this=0x224e4f0, sig=kSigSegmentationViolation) at /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/sauce/core/unix/src/TUnixSystem.cxx:3562
#5 <signal handler called>
#6 0x0000000000000000 in ?? ()
#7 0x00007f5ab1cec481 in WCSimRootTrigger_v2::Print (this=0x4fa12d0, verbosity=10, maxprimariestoprint=10, maxtrackstoprint=10, maxdigitstoprint=10, maxphotonsperdigittoprint=10, maxphotonstoprint=10) at src/WCSimRootTrigger_v2.cc:264
#8 0x00007f5ab1cf70d5 in WCSimRootEvent_v2::Print (this=0x49a8080, verbosity=10, maxtriggerstoprint=10, maxprimariestoprint=10, maxtrackstoprint=10, maxdigitstoprint=10, maxphotonsperdigittoprint=10, maxphotonstoprint=10) at src/WCSimRootEvent_v2.cc:26
#9 0x00007f5abd4794e4 in __cling_Un1Qu30(void*) ()
#10 0x00007f5ab8ef5628 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) () from /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/build/lib/libCling.so
#11 0x00007f5ab8efb8fe in cling::Interpreter::EvaluateInternal(std::string const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) () from /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/build/lib/libCling.so
#12 0x00007f5ab8efbae5 in cling::Interpreter::process(std::string const&, cling::Value*, cling::Transaction**) () from /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/build/lib/libCling.so
#13 0x00007f5ab8f9a50b in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/build/lib/libCling.so
#14 0x00007f5ab8f9abe5 in cling::MetaProcessor::readInputFromFile(llvm::StringRef, cling::Value*, bool) () from /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/build/lib/libCling.so
#15 0x00007f5ab8e5e2bc in TCling::ProcessLine (this=0x22af0a0, line=<optimized out>, error=0x7ffc786d63fc) at /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/sauce/core/meta/src/TCling.cxx:1980
#16 0x00007f5ab8e52087 in TCling::ProcessLineSynch (this=0x22af0a0, line=0x325cba0 ".x /home/marc/LinuxSystemFiles/ToolAnalysis/ToolAnalysis/ToolDAQ/WCSimLib/./script.C", error=0x7ffc786d63fc) at /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/sauce/core/meta/src/TCling.cxx:2812
#17 0x00007f5abcbee8dd in TApplication::ExecuteFile (file=<optimized out>, error=0x7ffc786d63fc, keep=<optimized out>) at /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/sauce/core/base/src/TApplication.cxx:1129
#18 0x00007f5abcbef89e in TApplication::ProcessLine (this=0x229beb0, line=<optimized out>, sync=<optimized out>, err=0x7ffc786d63fc) at /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/sauce/core/base/src/TApplication.cxx:978
#19 0x00007f5abd048695 in TRint::ProcessLineNr (this=this
entry=0x229beb0, filestem=filestem
entry=0x7f5abd057133 "ROOT_cli_", line=line
entry=0x7ffc786d6400 ".x script.C", error=error
entry=0x7ffc786d63fc) at /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/sauce/core/rint/src/TRint.cxx:745
#20 0x00007f5abd049aa7 in TRint::Run (this=0x229beb0, retrn=<optimized out>) at /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/sauce/core/rint/src/TRint.cxx:420
#21 0x0000000000400f80 in main (argc=1, argv=0x7ffc786d8588) at /home/marc/LinuxSystemFiles/ROOT/root-6.06.08/sauce/main/src/rmain.cxx:30
===========================================================
Root >
Running with the normal dictionaries the output I would expect is:
root [4] ev->Print()
This entry had 1 triggers
Trigger time : 0
Trigger type : PromptTrigger
Number Primary Vertices : 1
Primary vertex 0 was at (0, 168.1, 168.1)
Num Tracks: 3
Num Digits: 1935
Num Photons: 1935
Track 0{ Flag: -1 | PDG: 11 | ParentPDG: 0 | sProc: | eProc: NuIntx }
Track 1{ Flag: -2 | PDG: 2212 | ParentPDG: 0 | sProc: | eProc: NuIntx }
Track 2{ Flag: 0 | PDG: 11 | ParentPDG: 0 | sProc: | eProc: Cerenkov }
digit 0 at time -0.417573ns has charge 1.49149 from 1 true photons
digit 0, photon 0 has truetime 6.05443
digit 1 at time 1.67687ns has charge 0.694754 from 1 true photons
digit 1, photon 0 has truetime 5.41446
digit 2 at time 2.0762ns has charge 1.27331 from 1 true photons
digit 2, photon 0 has truetime 5.39229
digit 3 at time 2.35291ns has charge 0.099146 from 1 true photons
digit 3, photon 0 has truetime 5.22537
digit 4 at time 3.14034ns has charge 0.767604 from 1 true photons
digit 4, photon 0 has truetime 5.27153
digit 5 at time 3.20434ns has charge 1.63413 from 1 true photons
digit 5, photon 0 has truetime 5.44086
digit 6 at time 3.57768ns has charge 1.11406 from 1 true photons
digit 6, photon 0 has truetime 5.40951
digit 7 at time 3.92938ns has charge 1.46568 from 1 true photons
digit 7, photon 0 has truetime 5.27193
digit 8 at time 4.32783ns has charge 1.11076 from 1 true photons
digit 8, photon 0 has truetime 5.3451
digit 9 at time 4.37274ns has charge 1.14471 from 1 true photons
digit 9, photon 0 has truetime 5.18689
So it seems that even those values printed before the segfault aren’t correct either.
Sorry!