00001 #include "art/Framework/Core/FileBlock.h"
00002 #include "art/Framework/Core/InputSourceMacros.h"
00003 #include "art/Framework/Core/ProductRegistryHelper.h"
00004 #include "art/Framework/IO/Sources/Source.h"
00005 #include "art/Framework/IO/Sources/SourceHelper.h"
00006 #include "art/Framework/IO/Sources/SourceTraits.h"
00007 #include "art/Framework/Services/Registry/ServiceHandle.h"
00008
00009 #include "art/Persistency/Provenance/MasterProductRegistry.h"
00010 #include "art/Persistency/Provenance/ProcessHistoryRegistry.h"
00011 #include "art/Persistency/Provenance/ProductMetaData.h"
00012
00013 #include "canvas/Persistency/Common/EDProduct.h"
00014 #include "canvas/Persistency/Common/Wrapper.h"
00015 #include "canvas/Persistency/Provenance/BranchDescription.h"
00016 #include "canvas/Persistency/Provenance/BranchKey.h"
00017 #include "canvas/Persistency/Provenance/History.h"
00018 #include "canvas/Persistency/Provenance/ParentageRegistry.h"
00019 #include "canvas/Persistency/Provenance/ProcessConfiguration.h"
00020 #include "canvas/Persistency/Provenance/ProcessHistory.h"
00021 #include "canvas/Persistency/Provenance/ProcessHistoryID.h"
00022 #include "canvas/Persistency/Provenance/ProductList.h"
00023 #include "canvas/Persistency/Provenance/ProductProvenance.h"
00024 #include "canvas/Utilities/DebugMacros.h"
00025
00026 #include "fhiclcpp/make_ParameterSet.h"
00027 #include "fhiclcpp/ParameterSet.h"
00028 #include "fhiclcpp/ParameterSetID.h"
00029 #include "fhiclcpp/ParameterSetRegistry.h"
00030
00031 #include <TClass.h>
00032 #include <TMessage.h>
00033 #include <TBufferFile.h>
00034
00035 #include "artdaq/DAQdata/Globals.hh"
00036 #include "artdaq/ArtModules/InputUtilities.hh"
00037 #include "artdaq-core/Data/detail/ParentageMap.hh"
00038 #include "artdaq-core/Utilities/ExceptionHandler.hh"
00039
00040 #include <cstdio>
00041 #include <iomanip>
00042 #include <memory>
00043 #include <sstream>
00044 #include <string>
00045 #include <vector>
00046 #include <sys/time.h>
00047 #include <iostream>
00048
00049 namespace art
00050 {
00051 template <typename U>
00052 class ArtdaqInput;
00053 }
00054
00069 template <typename U>
00070 class art::ArtdaqInput
00071 {
00072 public:
00076 ArtdaqInput(const ArtdaqInput&) = delete;
00077
00082 ArtdaqInput& operator=(const ArtdaqInput&) = delete;
00083
00087 ~ArtdaqInput();
00088
00095 ArtdaqInput(const fhicl::ParameterSet& ps, art::ProductRegistryHelper& helper,
00096 art::SourceHelper const& pm);
00097
00101 void closeCurrentFile();
00102
00107 void readFile(const std::string&, art::FileBlock*& fb);
00108
00113 bool hasMoreData() const;
00114
00124 bool readNext(art::RunPrincipal* const inR,
00125 art::SubRunPrincipal* const inSR, art::RunPrincipal*& outR,
00126 art::SubRunPrincipal*& outSR, art::EventPrincipal*& outE);
00127
00128 private:
00129 void
00130 readAndConstructPrincipal(std::unique_ptr<TBufferFile>&,
00131 unsigned long,
00132 art::RunPrincipal* const,
00133 art::SubRunPrincipal* const,
00134 art::RunPrincipal*&,
00135 art::SubRunPrincipal*&,
00136 art::EventPrincipal*&);
00137
00138 template <class T>
00139 void readDataProducts(std::unique_ptr<TBufferFile>&, T*&);
00140
00141 void putInPrincipal(RunPrincipal*&, std::unique_ptr<EDProduct>&&, const BranchDescription&, std::unique_ptr<const ProductProvenance>&&);
00142
00143 void putInPrincipal(SubRunPrincipal*&, std::unique_ptr<EDProduct>&&, const BranchDescription&, std::unique_ptr<const ProductProvenance>&&);
00144
00145 void putInPrincipal(EventPrincipal*&, std::unique_ptr<EDProduct>&&, const BranchDescription&, std::unique_ptr<const ProductProvenance>&&);
00146
00147
00148 private:
00149 bool shutdownMsgReceived_;
00150 bool outputFileCloseNeeded_;
00151 art::SourceHelper const& pm_;
00152 U communicationWrapper_;
00153 };
00154
00155 template <typename U>
00156 art::ArtdaqInput<U>::
00157 ArtdaqInput(const fhicl::ParameterSet& ps,
00158 art::ProductRegistryHelper& helper,
00159 art::SourceHelper const& pm)
00160 : shutdownMsgReceived_(false)
00161 , outputFileCloseNeeded_(false)
00162 , pm_(pm)
00163 , communicationWrapper_(ps)
00164 {
00165 artdaq::configureMessageFacility("artdaqart");
00166
00167
00168
00169
00170
00171
00172
00173 TLOG_ARB(5, "ArtdaqInput") << "Begin: ArtdaqInput::ArtdaqInput(" <<
00174 "const fhicl::ParameterSet& ps, " <<
00175 "art::ProductRegistryHelper& helper, " <<
00176 "const art::SourceHelper& pm)";
00177 (void)helper;
00178
00179 TLOG_ARB(5, "ArtdaqInput") << "Going to receive init message";
00180 std::unique_ptr<TBufferFile> msg(nullptr);
00181 communicationWrapper_.receiveInitMessage(msg);
00182 TLOG_ARB(5, "ArtdaqInput") << "Init message received";
00183
00184 if (!msg)
00185 {
00186 throw art::Exception(art::errors::DataCorruption) <<
00187 "ArtdaqInput: Could not receive init message!";
00188 }
00189
00190
00191 unsigned long dummy = 0;
00192 msg->ReadULong(dummy);
00193
00194
00195
00196
00197 unsigned long ps_cnt = 0;
00198 msg->ReadULong(ps_cnt);
00199 TLOG_ARB(5, "ArtdaqInput") << "ArtdaqInput: parameter set count: " << ps_cnt;
00200 TLOG_ARB(5, "ArtdaqInput") << "ArtdaqInput: reading parameter sets ...";
00201 for (unsigned long I = 0; I < ps_cnt; ++I)
00202 {
00203 std::string pset_str = "";
00204 msg->ReadStdString(pset_str);
00205
00206 TLOG_ARB(5, "ArtdaqInput") << "ArtdaqInput: parameter set: " << pset_str;
00207
00208 fhicl::ParameterSet pset;
00209 fhicl::make_ParameterSet(pset_str, pset);
00210
00211 pset.id();
00212 fhicl::ParameterSetRegistry::put(pset);
00213 }
00214 TLOG_ARB(5, "ArtdaqInput") << "ArtdaqInput: finished reading parameter sets.";
00215
00216
00217
00218
00219 art::ProductList* productlist = ReadObjectAny<art::ProductList>(msg, "std::map<art::BranchKey,art::BranchDescription>", "ArtdaqInput::ArtdaqInput");
00220 helper.productList(productlist);
00221 TLOG_ARB(5, "ArtdaqInput") << "ArtdaqInput: got product list";
00222
00223 TLOG_ARB(5, "ArtdaqInput") << "ArtdaqInput: Reading ProcessHistory";
00224 art::ProcessHistoryMap* phm = ReadObjectAny<art::ProcessHistoryMap>(msg, "std::map<const art::Hash<2>,art::ProcessHistory>", "ArtdaqInput::ArtdaqInput");
00225 printProcessMap(*phm, "ArtdaqInput's ProcessHistoryMap");
00226
00227 ProcessHistoryRegistry::put(*phm);
00228 printProcessMap(ProcessHistoryRegistry::get(), "ArtdaqInput's ProcessHistoryRegistry");
00229
00230
00231
00232
00233 TLOG_ARB(5, "ArtdaqInput") << "ArtdaqInput: Reading ParentageMap";
00234 ParentageMap* parentageMap = ReadObjectAny<ParentageMap>(msg, "art::ParentageMap", "ArtdaqInput::ArtdaqInput");
00235 ParentageRegistry::put(*parentageMap);
00236
00237
00238
00239
00240 TLOG_ARB(5, "ArtdaqInput") << "End: ArtdaqInput::ArtdaqInput(" << "const fhicl::ParameterSet& ps, " << "art::ProductRegistryHelper& helper, " << "const art::SourceHelper& pm)";
00241 }
00242
00243 template <typename U>
00244 art::ArtdaqInput<U>::
00245 ~ArtdaqInput() {}
00246
00247 template <typename U>
00248 void
00249 art::ArtdaqInput<U>::
00250 closeCurrentFile()
00251 {
00252 TLOG_ARB(6, "ArtdaqInput") << "Begin/End: ArtdaqInput::closeCurrentFile()";
00253 }
00254
00255 template <typename U>
00256 void
00257 art::ArtdaqInput<U>::
00258 readFile(const std::string&, art::FileBlock*& fb)
00259 {
00260 TLOG_ARB(7, "ArtdaqInput") << "Begin: ArtdaqInput::"
00261 "readFile(const std::string& name, art::FileBlock*& fb)";
00262 fb = new art::FileBlock(art::FileFormatVersion(1, "ArtdaqInput2013"),
00263 "nothing");
00264 TLOG_ARB(7, "ArtdaqInput") << "End: ArtdaqInput::"
00265 "readFile(const std::string& name, art::FileBlock*& fb)";
00266 }
00267
00268 template <typename U>
00269 bool
00270 art::ArtdaqInput<U>::
00271 hasMoreData() const
00272 {
00273 TLOG_ARB(8, "ArtdaqInput") << "Begin: ArtdaqInput::hasMoreData()";
00274 if (shutdownMsgReceived_)
00275 {
00276 TLOG_ARB(8, "ArtdaqInput") << "ArtdaqInput::hasMoreData(): "
00277 "returning false on shutdownMsgReceived_.";
00278 TLOG_ARB(8, "ArtdaqInput") << "End: ArtdaqInput::hasMoreData()";
00279 return false;
00280 }
00281 TLOG_ARB(8, "ArtdaqInput") << "ArtdaqInput::hasMoreData(): "
00282 "returning true on not shutdownMsgReceived_.";
00283 TLOG_ARB(8, "ArtdaqInput") << "End: ArtdaqInput::hasMoreData()";
00284 return true;
00285 }
00286
00287 template <typename U>
00288 void
00289 art::ArtdaqInput<U>::
00290 readAndConstructPrincipal(std::unique_ptr<TBufferFile>& msg,
00291 unsigned long msg_type_code,
00292 art::RunPrincipal* const inR,
00293 art::SubRunPrincipal* const inSR,
00294 art::RunPrincipal*& outR,
00295 art::SubRunPrincipal*& outSR,
00296 art::EventPrincipal*& outE)
00297 {
00298
00299
00300
00301 std::unique_ptr<art::RunAuxiliary> run_aux;
00302 std::unique_ptr<art::SubRunAuxiliary> subrun_aux;
00303 std::unique_ptr<art::EventAuxiliary> event_aux;
00304 std::shared_ptr<History> history;
00305
00306 if (msg_type_code == 2)
00307 {
00308
00309 TLOG_ARB(9, "ArtdaqInput") << "readAndConstructPrincipal: " << "processing EndRun message ...";
00310
00311 run_aux.reset(ReadObjectAny<art::RunAuxiliary>(msg, "art::RunAuxiliary", "ArtdaqInput::readAndConstructPrincipal"));
00312 printProcessHistoryID("readAndConstructPrincipal", run_aux.get());
00313
00314 TLOG_ARB(9, "ArtdaqInput") << "readAndConstructPrincipal: " << "making flush RunPrincipal ...";
00315 outR = pm_.makeRunPrincipal(RunID::flushRun(), run_aux->beginTime());
00316
00317 TLOG_ARB(9, "ArtdaqInput") << "readAndConstructPrincipal: " << "making flush SubRunPrincipal ...";
00318 outSR = pm_.makeSubRunPrincipal(SubRunID::flushSubRun(), run_aux->beginTime());
00319
00320 TLOG_ARB(9, "ArtdaqInput") << "readAndConstructPrincipal: " << "making flush EventPrincipal ...";
00321 outE = pm_.makeEventPrincipal(EventID::flushEvent(), run_aux->endTime(), true, EventAuxiliary::Any);
00322
00323 TLOG_ARB(9, "ArtdaqInput") << "readAndConstructPrincipal: " <<
00324 "finished processing EndRun message.";
00325 }
00326 else if (msg_type_code == 3)
00327 {
00328
00329 TLOG_ARB(10, "ArtdaqInput") << "readAndConstructPrincipal: " << "processing EndSubRun message ...";
00330
00331 subrun_aux.reset(ReadObjectAny<art::SubRunAuxiliary>(msg, "art::SubRunAuxiliary", "ArtdaqInput::readAndConstructPrincipal"));
00332 printProcessHistoryID("readAndConstructPrincipal", subrun_aux.get());
00333
00334 TLOG_ARB(10, "ArtdaqInput") << "readAndConstructPrincipal: " << "making flush RunPrincipal ...";
00335 outR = pm_.makeRunPrincipal(RunID::flushRun(), subrun_aux->beginTime());
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352 art::Timestamp currentTime = time(0);
00353 if (inR != nullptr) { inR->setEndTime(currentTime); }
00354 if (inSR != nullptr) { inSR->setEndTime(currentTime); }
00355
00356 TLOG_ARB(10, "ArtdaqInput") << "readAndConstructPrincipal: " << "making flush SubRunPrincipal ...";
00357 outSR = pm_.makeSubRunPrincipal(SubRunID::flushSubRun(), subrun_aux->beginTime());
00358
00359 TLOG_ARB(10, "ArtdaqInput") << "readAndConstructPrincipal: " << "making flush EventPrincipal ...";
00360 outE = pm_.makeEventPrincipal(EventID::flushEvent(), subrun_aux->endTime(), true, EventAuxiliary::Any);
00361
00362 TLOG_ARB(10, "ArtdaqInput") << "readAndConstructPrincipal: " << "finished processing EndSubRun message.";
00363 }
00364 else if (msg_type_code == 4)
00365 {
00366
00367 TLOG_ARB(11, "ArtdaqInput") << "readAndConstructPrincipal: " << "processing Event message ...";
00368
00369 run_aux.reset(ReadObjectAny<art::RunAuxiliary>(msg, "art::RunAuxiliary", "ArtdaqInput::readAndConstructPrincipal"));
00370 printProcessHistoryID("readAndConstructPrincipal", run_aux.get());
00371
00372 subrun_aux.reset(ReadObjectAny<art::SubRunAuxiliary>(msg, "art::SubRunAuxiliary", "ArtdaqInput::readAndConstructPrincipal"));
00373 printProcessHistoryID("readAndConstructPrincipal", subrun_aux.get());
00374
00375 event_aux.reset(ReadObjectAny<art::EventAuxiliary>(msg, "art::EventAuxiliary", "ArtdaqInput::readAndConstructPrincipal"));
00376
00377 history.reset(ReadObjectAny<art::History>(msg, "art::History", "ArtdaqInput::readAndConstructPrincipal"));
00378 printProcessHistoryID("readAndConstructPrincipal", history.get());
00379
00380
00381 if (!history->processHistoryID().isValid())
00382 {
00383 throw art::Exception(art::errors::Unknown) << "readAndConstructPrincipal: processHistoryID of history in Event message is invalid!";
00384 }
00385
00386 if ((inR == nullptr) || !inR->id().isValid() || (inR->run() != event_aux->run()))
00387 {
00388
00389
00390 TLOG_ARB(11, "ArtdaqInput") << "readAndConstructPrincipal: making RunPrincipal ...";
00391 outR = pm_.makeRunPrincipal(*run_aux.get());
00392 }
00393 if ((inSR == nullptr) || !inSR->id().isValid() || (inSR->subRun() != event_aux->subRun()))
00394 {
00395
00396
00397 TLOG_ARB(11, "ArtdaqInput") << "readAndConstructPrincipal: " << "making SubRunPrincipal ...";
00398 outSR = pm_.makeSubRunPrincipal(*subrun_aux.get());
00399 }
00400 TLOG_ARB(11, "ArtdaqInput") << "readAndConstructPrincipal: making EventPrincipal ...";
00401 outE = pm_.makeEventPrincipal(*event_aux.get(), std::move(history));
00402
00403 TLOG_ARB(11, "ArtdaqInput") << "readAndConstructPrincipal: " << "finished processing Event message.";
00404 }
00405 }
00406
00407 template <typename U>
00408 template <class T>
00409 void
00410 art::ArtdaqInput<U>::
00411 readDataProducts(std::unique_ptr<TBufferFile>& msg, T*& outPrincipal)
00412 {
00413 unsigned long prd_cnt = 0;
00414 {
00415 TLOG_ARB(12, "ArtdaqInput") << "readDataProducts: reading data product count ...";
00416 msg->ReadULong(prd_cnt);
00417 TLOG_ARB(12, "ArtdaqInput") << "readDataProducts: product count: " << prd_cnt;
00418 }
00419
00420
00421
00422 const ProductList& productList = ProductMetaData::instance().productList();
00423
00424 for (unsigned long I = 0; I < prd_cnt; ++I)
00425 {
00426 std::unique_ptr<BranchKey> bk;
00427
00428 {
00429 TLOG_ARB(12, "ArtdaqInput") << "readDataProducts: Reading branch key.";
00430 bk.reset(ReadObjectAny<BranchKey>(msg, "art::BranchKey", "ArtdaqInput::readDataProducts"));
00431 }
00432
00433 if (art::debugit() >= 1)
00434 {
00435 TLOG_ARB(13, "ArtdaqInput") << "readDataProducts: got product class: '"
00436 << bk->friendlyClassName_
00437 << "' modlbl: '"
00438 << bk->moduleLabel_
00439 << "' instnm: '"
00440 << bk->productInstanceName_
00441 << "' procnm: '"
00442 << bk->processName_;
00443 }
00444 ProductList::const_iterator iter;
00445 {
00446 TLOG_ARB(12, "ArtdaqInput") << "readDataProducts: looking up product ...";
00447 iter = productList.find(*bk);
00448 if (iter == productList.end())
00449 {
00450 throw art::Exception(art::errors::ProductNotFound)
00451 << "No product is registered for\n"
00452 << " process name: '"
00453 << bk->processName_ << "'\n"
00454 << " module label: '"
00455 << bk->moduleLabel_ << "'\n"
00456 << " product friendly class name: '"
00457 << bk->friendlyClassName_ << "'\n"
00458 << " product instance name: '"
00459 << bk->productInstanceName_ << "'\n";
00460 }
00461 }
00462
00463
00464 const BranchDescription& bd = iter->second;
00465 std::unique_ptr<EDProduct> prd;
00466 {
00467 TLOG_ARB(12, "ArtdaqInput") << "readDataProducts: Reading product with wrapped name: " << bd.wrappedName()
00468 << ", TClass = " << (void*)TClass::GetClass(bd.wrappedName().c_str());
00469
00470
00471
00472
00473
00474
00475 void* p = msg->ReadObjectAny(TClass::GetClass(bd.wrappedName().c_str()));
00476 auto pp = reinterpret_cast<EDProduct*>(p);
00477
00478 TLOG_ARB(12, "ArtdaqInput") << "readDataProducts: After ReadObjectAny(prd): p=" << p
00479 << ", EDProduct::isPresent: " << pp->isPresent();
00480 prd.reset(pp);
00481 p = nullptr;
00482 }
00483 std::unique_ptr<const ProductProvenance> prdprov;
00484 {
00485 TLOG_ARB(12, "ArtdaqInput") << "readDataProducts: Reading product provenance.";
00486 prdprov.reset(ReadObjectAny<ProductProvenance>(msg, "art::ProductProvenance", "ArtdaqInput::readDataProducts"));
00487 }
00488 {
00489 TLOG_ARB(12, "ArtdaqInput") << "readDataProducts: inserting product: class: '"
00490 << bd.friendlyClassName()
00491 << "' modlbl: '"
00492 << bd.moduleLabel()
00493 << "' instnm: '"
00494 << bd.productInstanceName()
00495 << "' procnm: '"
00496 << bd.processName();
00497 putInPrincipal(outPrincipal, std::move(prd), bd, std::move(prdprov));
00498
00499 }
00500 }
00501 }
00502
00503 template <typename U>
00504 void
00505 art::ArtdaqInput<U>::
00506 putInPrincipal(RunPrincipal*& rp, std::unique_ptr<EDProduct>&& prd, const BranchDescription& bd, std::unique_ptr<const ProductProvenance>&& prdprov)
00507 {
00508 rp->put(std::move(prd), bd, std::move(prdprov), RangeSet::forRun(rp->id()));
00509 }
00510
00511 template <typename U>
00512 void
00513 art::ArtdaqInput<U>::
00514 putInPrincipal(SubRunPrincipal*& srp, std::unique_ptr<EDProduct>&& prd, const BranchDescription& bd, std::unique_ptr<const ProductProvenance>&& prdprov)
00515 {
00516 srp->put(std::move(prd), bd, std::move(prdprov), RangeSet::forSubRun(srp->id()));
00517 }
00518
00519 template <typename U>
00520 void
00521 art::ArtdaqInput<U>::
00522 putInPrincipal(EventPrincipal*& ep, std::unique_ptr<EDProduct>&& prd, const BranchDescription& bd, std::unique_ptr<const ProductProvenance>&& prdprov)
00523 {
00524 TLOG_ARB(14, "ArtdaqInput") << "EventPrincipal size before put: " << ep->size();
00525 ep->put(std::move(prd), bd, std::move(prdprov));
00526 TLOG_ARB(14, "ArtdaqInput") << "EventPrincipal size after put: " << ep->size();
00527 }
00528
00529
00530 template <typename U>
00531 bool
00532 art::ArtdaqInput<U>::
00533 readNext(art::RunPrincipal* const inR, art::SubRunPrincipal* const inSR,
00534 art::RunPrincipal*& outR, art::SubRunPrincipal*& outSR,
00535 art::EventPrincipal*& outE)
00536 {
00537 TLOG_ARB(15, "ArtdaqInput") << "Begin: ArtdaqInput::readNext";
00538 if (outputFileCloseNeeded_)
00539 {
00540 outputFileCloseNeeded_ = false;
00541
00542
00543 TLOG_ARB(15, "ArtdaqInput") << "ArtdaqInput::readNext: " << "returning false on outputFileCloseNeeded_";
00544 TLOG_ARB(15, "ArtdaqInput") << "End: ArtdaqInput::readNext";
00545 return false;
00546 }
00547
00548 std::unique_ptr<TBufferFile> msg;
00549 communicationWrapper_.receiveMessage(msg);
00550
00551 if (!msg)
00552 {
00553 TLOG_ARB(15, "ArtdaqInput") << "ArtdaqInput::readNext got an empty message";
00554 shutdownMsgReceived_ = true;
00555 return false;
00556 }
00557
00558
00559
00560
00561 unsigned long msg_type_code = 0;
00562 {
00563 TLOG_ARB(15, "ArtdaqInput") << "ArtdaqInput::readNext: " << "getting message type code ...";
00564 msg->ReadULong(msg_type_code);
00565 TLOG_ARB(15, "ArtdaqInput") << "ArtdaqInput::readNext: " << "message type: " << msg_type_code;
00566 }
00567 if (msg_type_code == 5)
00568 {
00569
00570 shutdownMsgReceived_ = true;
00571 TLOG_ARB(16, "ArtdaqInput") << "ArtdaqInput::readNext: " << "returning false on Shutdown message.";
00572 TLOG_ARB(16, "ArtdaqInput") << "End: ArtdaqInput::readNext";
00573 return false;
00574 }
00575
00576 readAndConstructPrincipal(msg, msg_type_code, inR, inSR, outR,
00577 outSR, outE);
00578
00579
00580
00581 if (msg_type_code == 2)
00582 {
00583
00584
00585 readDataProducts(msg, outR);
00586
00587 TLOG_ARB(17, "ArtdaqInput") << "ArtdaqInput::readNext: " << "returning false on EndRun message.";
00588 TLOG_ARB(17, "ArtdaqInput") << "End: ArtdaqInput::readNext";
00589 return false;
00590 }
00591 else if (msg_type_code == 3)
00592 {
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602 if (inR != 0 && inSR != 0 && outR != 0 && outSR != 0)
00603 {
00604 if (inR->id().isFlush() && inSR->id().isFlush() &&
00605 outR->id().isFlush() && outSR->id().isFlush())
00606 {
00607 outR = 0;
00608 outSR = 0;
00609 outputFileCloseNeeded_ = true;
00610 return true;
00611 }
00612 }
00613
00614 readDataProducts(msg, outSR);
00615
00616
00617 outputFileCloseNeeded_ = true;
00618 TLOG_ARB(18, "ArtdaqInput") << "readNext: returning true on EndSubRun message.";
00619 TLOG_ARB(18, "ArtdaqInput") << "End: ArtdaqInput::readNext";
00620 return true;
00621 }
00622 else if (msg_type_code == 4)
00623 {
00624
00625 readDataProducts(msg, outE);
00626 TLOG_ARB(19, "ArtdaqInput") << "readNext: returning true on Event message.";
00627 TLOG_ARB(19, "ArtdaqInput") << "End: ArtdaqInput::readNext";
00628 return true;
00629 }
00630
00631
00632 TLOG_ARB(20, "ArtdaqInput") << "readNext: returning false on unknown msg_type_code!";
00633 TLOG_ARB(20, "ArtdaqInput") << "End: ArtdaqInput::readNext";
00634 return false;
00635 }