Hi,
Lots of users like the midas::odb interface for reading from the ODB in manalyzers. It currently doesn't
work offline however without a few manual lines to tell midas::odb to read from the ODB copy in the run
header. The code also gets a bit messy to work out the current filename and get midas::odb to reopen the
file currently being processed. This would be much cleaner if manalyzer set this up automatically, and then
user code could be written that is completely ignorant of whether it is running online or offline.
The change I suggest is in the `set_offline_odb` branch, commit 4ffbda6, which is simply:
diff --git a/manalyzer.cxx b/manalyzer.cxx
index 371f135..725e1d2 100644
--- a/manalyzer.cxx
+++ b/manalyzer.cxx
@@ -15,6 +15,7 @@
#include "manalyzer.h"
#include "midasio.h"
+#include "odbxx.h"
//////////////////////////////////////////////////////////
@@ -2075,6 +2076,8 @@ static int ProcessMidasFiles(const std::vector<std::string>& files, const std::v
if (!run.fRunInfo) {
run.CreateRun(runno, filename.c_str());
run.fRunInfo->fOdb = MakeFileDumpOdb(event->GetEventData(), event->data_size);
+ // Also set the source for midas::odb in case people prefer that interface
+ midas::odb::set_odb_source(midas::odb::STRING, std::string(event->GetEventData(), event-
>data_size));
run.BeginRun();
}
It happens at the point where the ODB record is already available and requires no effort from the user to
be able to read the ODB offline.
Thanks,
Mark. |