00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "PSXtcInput/XtcIndexInputModule.h"
00017
00018
00019
00020
00021 #include <boost/make_shared.hpp>
00022 #include <boost/pointer_cast.hpp>
00023
00024
00025
00026
00027 #include "PSXtcInput/DgramSourceIndex.h"
00028 #include "MsgLogger/MsgLogger.h"
00029
00030
00031
00032
00033
00034 using namespace PSXtcInput;
00035 PSANA_INPUT_MODULE_FACTORY(XtcIndexInputModule)
00036
00037
00038
00039
00040
00041
00042 namespace {
00043 const char* logger = "PSXtcInput::XtcIndexInputModule";
00044 }
00045
00046 namespace PSXtcInput {
00047
00048
00049
00050
00051 XtcIndexInputModule::XtcIndexInputModule (const std::string& name)
00052 : XtcInputModuleBase(name, boost::make_shared<DgramSourceIndex>())
00053 , _idx(name,_queue)
00054 {
00055
00056
00057 boost::shared_ptr<DgramSourceIndex> dgSourceIndex = boost::dynamic_pointer_cast<DgramSourceIndex>(m_dgsource);
00058 dgSourceIndex->setQueue(_queue);
00059
00060
00061 if (skipEvents()!=0) {
00062 MsgLog(logger, warning, "Skip-events option not supported by indexing input module");
00063 skipEvents(0);
00064 }
00065 if (maxEvents()!=0) {
00066 MsgLog(logger, warning, "Max-events option not supported by indexing input module");
00067 maxEvents(0);
00068 }
00069 if (skipEpics()) skipEpics(false);
00070 if (l3tAcceptOnly()) l3tAcceptOnly(false);
00071 ConfigSvc::ConfigSvc cfg = configSvc();
00072 bool allowCorruptEpics = cfg.get("psana", "allow-corrupt-epics", false);
00073 if (allowCorruptEpics) _idx.allowCorruptEpics();
00074 }
00075
00076
00077
00078
00079 XtcIndexInputModule::~XtcIndexInputModule ()
00080 {
00081 }
00082
00083 void
00084 XtcIndexInputModule::beginJob(Event& evt, Env& env)
00085 {
00086
00087
00088
00089
00090
00091
00092 int runbegin = _idx.runs()[0];
00093 _idx.setrun(runbegin);
00094
00095
00096 XtcInputModuleBase::beginJob(evt, env);
00097 }
00098
00099 }