1 #include "art/Framework/Core/FileBlock.h"
2 #include "art/Framework/Core/InputSourceMacros.h"
3 #include "art/Framework/Core/ProductRegistryHelper.h"
4 #include "art/Framework/IO/Sources/Source.h"
5 #include "art/Framework/IO/Sources/SourceHelper.h"
6 #include "art/Framework/IO/Sources/SourceTraits.h"
7 #include "art/Framework/Services/Registry/ServiceHandle.h"
9 #if ART_HEX_VERSION < 0x30000
10 #include "art/Persistency/Provenance/MasterProductRegistry.h"
11 #include "art/Persistency/Provenance/ProductMetaData.h"
13 #if ART_HEX_VERSION >= 0x30200
14 #include "art_root_io/setup.h"
16 #include "art/Persistency/Provenance/ProcessHistoryRegistry.h"
18 #include "canvas/Persistency/Common/EDProduct.h"
19 #include "canvas/Persistency/Common/Wrapper.h"
20 #include "canvas/Persistency/Provenance/BranchDescription.h"
21 #include "canvas/Persistency/Provenance/BranchKey.h"
22 #include "canvas/Persistency/Provenance/History.h"
23 #include "canvas/Persistency/Provenance/ParentageRegistry.h"
24 #include "canvas/Persistency/Provenance/ProcessConfiguration.h"
25 #include "canvas/Persistency/Provenance/ProcessHistory.h"
26 #include "canvas/Persistency/Provenance/ProcessHistoryID.h"
27 #include "canvas/Persistency/Provenance/ProductList.h"
28 #include "canvas/Persistency/Provenance/ProductProvenance.h"
29 #include "canvas/Persistency/Provenance/ProductTables.h"
30 #include "canvas/Utilities/DebugMacros.h"
32 #include "fhiclcpp/ParameterSet.h"
33 #include "fhiclcpp/ParameterSetID.h"
34 #include "fhiclcpp/ParameterSetRegistry.h"
35 #include "fhiclcpp/make_ParameterSet.h"
37 #include <TBufferFile.h>
40 #include <TStreamerInfo.h>
42 #include "artdaq-core/Data/Fragment.hh"
43 #include "artdaq-core/Data/detail/ParentageMap.hh"
44 #include "artdaq-core/Utilities/ExceptionHandler.hh"
45 #include "artdaq/ArtModules/InputUtilities.hh"
46 #include "artdaq/DAQdata/Globals.hh"
47 #include "artdaq/DAQdata/NetMonHeader.hh"
58 #if ART_HEX_VERSION < 0x30000
62 #define HISTORY_PTR_T std::shared_ptr<art::History>
64 #define EVENT_ID eventID
65 #define SUBRUN_ID subRunID
67 #define HISTORY_PTR_T std::unique_ptr<art::History>
115 ArtdaqInput(
const fhicl::ParameterSet& ps, art::ProductRegistryHelper& helper, art::SourceHelper
const& pm);
126 void readFile(
const std::string&, art::FileBlock*& fb);
143 bool readNext(art::RunPrincipal*
const inR, art::SubRunPrincipal*
const inSR, art::RunPrincipal*& outR,
144 art::SubRunPrincipal*& outSR, art::EventPrincipal*& outE);
147 void readAndConstructPrincipal(std::unique_ptr<TBufferFile>&,
unsigned long, art::RunPrincipal*
const,
148 art::SubRunPrincipal*
const, art::RunPrincipal*&, art::SubRunPrincipal*&,
149 art::EventPrincipal*&);
152 void readDataProducts(std::unique_ptr<TBufferFile>&, T*&);
154 void putInPrincipal(RunPrincipal*&, std::unique_ptr<EDProduct>&&,
const BranchDescription&,
155 std::unique_ptr<const ProductProvenance>&&);
157 void putInPrincipal(SubRunPrincipal*&, std::unique_ptr<EDProduct>&&,
const BranchDescription&,
158 std::unique_ptr<const ProductProvenance>&&);
160 void putInPrincipal(EventPrincipal*&, std::unique_ptr<EDProduct>&&,
const BranchDescription&,
161 std::unique_ptr<const ProductProvenance>&&);
164 bool shutdownMsgReceived_;
165 bool outputFileCloseNeeded_;
166 art::SourceHelper
const& pm_;
167 U communicationWrapper_;
168 ProductList* productList_;
169 HISTORY_PTR_T history_to_use_;
174 art::SourceHelper
const& pm)
175 : shutdownMsgReceived_(false), outputFileCloseNeeded_(false), pm_(pm), communicationWrapper_(ps), productList_()
177 artdaq::configureMessageFacility(
"artdaqart");
179 #if ART_HEX_VERSION >= 0x30200
184 volatile bool loop =
true;
197 TLOG_ARB(5,
"ArtdaqInput") <<
"Begin: ArtdaqInput::ArtdaqInput("
198 <<
"const fhicl::ParameterSet& ps, "
199 <<
"art::ProductRegistryHelper& helper, "
200 <<
"const art::SourceHelper& pm)";
202 TLOG_ARB(5,
"ArtdaqInput") <<
"Going to receive init message";
203 artdaq::FragmentPtr initFrag = communicationWrapper_.receiveInitMessage();
204 TLOG_ARB(5,
"ArtdaqInput") <<
"Init message received";
208 throw art::Exception(art::errors::DataCorruption) <<
"ArtdaqInput: Could not receive init message!";
211 std::unique_ptr<TBufferFile> msg(
new TBufferFile(TBuffer::kRead, header->data_length, initFrag->dataBegin(), kFALSE, 0));
214 unsigned long dummy = 0;
215 msg->ReadULong(dummy);
218 TList* list = (TList*)msg->ReadObject(TList::Class());
222 TObjLink* lnk = list->FirstLink();
226 info = (TStreamerInfo*)lnk->GetObject();
227 TObject* element = info->GetElements()->UncheckedAt(0);
228 Bool_t isstl = element && strcmp(
"This", element->GetName()) == 0;
232 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: importing TStreamerInfo: " << info->GetName() <<
", version = " << info->GetClassVersion();
237 lnk = list->FirstLink();
240 info = (TStreamerInfo*)lnk->GetObject();
241 TObject* element = info->GetElements()->UncheckedAt(0);
242 Bool_t isstl = element && strcmp(
"This", element->GetName()) == 0;
246 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: importing TStreamerInfo: " << info->GetName() <<
", version = " << info->GetClassVersion();
255 unsigned long ps_cnt = 0;
256 msg->ReadULong(ps_cnt);
257 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: parameter set count: " << ps_cnt;
258 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: reading parameter sets ...";
259 for (
unsigned long I = 0; I < ps_cnt; ++I)
261 std::string pset_str =
"";
262 msg->ReadStdString(pset_str);
264 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: parameter set: " << pset_str;
266 fhicl::ParameterSet pset;
267 fhicl::make_ParameterSet(pset_str, pset);
270 fhicl::ParameterSetRegistry::put(pset);
272 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: finished reading parameter sets.";
277 productList_ = ReadObjectAny<art::ProductList>(
278 msg,
"std::map<art::BranchKey,art::BranchDescription>",
"ArtdaqInput::ArtdaqInput");
279 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: Product list sz=" << productList_->size();
282 for (
auto I = productList_->begin(), E = productList_->end(); I != E; ++I)
284 TLOG_ARB(50,
"ArtdaqInput") <<
"Branch key: class: '" << I->first.friendlyClassName_ <<
"' modlbl: '"
285 << I->first.moduleLabel_ <<
"' instnm: '" << I->first.productInstanceName_ <<
"' procnm: '"
286 << I->first.processName_ <<
"', branch description name: " << I->second.wrappedName()
287 <<
", TClass = " << (
void*)TClass::GetClass(I->second.wrappedName().c_str());
292 #if ART_HEX_VERSION < 0x30000
293 helper.productList(productList_);
295 helper.productList(std::unique_ptr<art::ProductList>(productList_));
297 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: got product list";
299 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: Reading ProcessHistory";
300 art::ProcessHistoryMap* phm = ReadObjectAny<art::ProcessHistoryMap>(
301 msg,
"std::map<const art::Hash<2>,art::ProcessHistory>",
"ArtdaqInput::ArtdaqInput");
304 ProcessHistoryRegistry::put(*phm);
305 printProcessMap(ProcessHistoryRegistry::get(),
"ArtdaqInput's ProcessHistoryRegistry");
310 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: Reading ParentageMap";
311 ParentageMap* parentageMap = ReadObjectAny<ParentageMap>(msg,
"art::ParentageMap",
"ArtdaqInput::ArtdaqInput");
312 ParentageRegistry::put(*parentageMap);
317 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: Reading History";
318 history_to_use_.reset(ReadObjectAny<History>(msg,
"art::History",
"ArtdaqInput::ArtdaqInput"));
319 if (!history_to_use_->processHistoryID().isValid())
321 TLOG_ARB(5,
"ArtdaqInput") <<
"ArtdaqInput: History from init message is INVALID!";
327 TLOG_ARB(5,
"ArtdaqInput") <<
"End: ArtdaqInput::ArtdaqInput("
328 <<
"const fhicl::ParameterSet& ps, "
329 <<
"art::ProductRegistryHelper& helper, "
330 <<
"const art::SourceHelper& pm)";
340 TLOG_ARB(6,
"ArtdaqInput") <<
"Begin/End: ArtdaqInput::closeCurrentFile()";
346 TLOG_ARB(7,
"ArtdaqInput") <<
"Begin: ArtdaqInput::"
347 "readFile(const std::string& name, art::FileBlock*& fb)";
348 fb =
new art::FileBlock(art::FileFormatVersion(1,
"ArtdaqInput2013"),
"nothing");
349 TLOG_ARB(7,
"ArtdaqInput") <<
"End: ArtdaqInput::"
350 "readFile(const std::string& name, art::FileBlock*& fb)";
356 TLOG_ARB(8,
"ArtdaqInput") <<
"Begin: ArtdaqInput::hasMoreData()";
357 if (shutdownMsgReceived_)
359 TLOG_ARB(8,
"ArtdaqInput") <<
"ArtdaqInput::hasMoreData(): "
360 "returning false on shutdownMsgReceived_.";
361 TLOG_ARB(8,
"ArtdaqInput") <<
"End: ArtdaqInput::hasMoreData()";
364 TLOG_ARB(8,
"ArtdaqInput") <<
"ArtdaqInput::hasMoreData(): "
365 "returning true on not shutdownMsgReceived_.";
366 TLOG_ARB(8,
"ArtdaqInput") <<
"End: ArtdaqInput::hasMoreData()";
372 art::RunPrincipal*
const inR, art::SubRunPrincipal*
const inSR,
373 art::RunPrincipal*& outR, art::SubRunPrincipal*& outSR,
374 art::EventPrincipal*& outE)
379 std::unique_ptr<art::RunAuxiliary> run_aux;
380 std::unique_ptr<art::SubRunAuxiliary> subrun_aux;
381 std::unique_ptr<art::EventAuxiliary> event_aux;
383 HISTORY_PTR_T history_from_event;
390 if (msg_type_code == 2)
393 TLOG_ARB(9,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
394 <<
"processing EndRun message ...";
396 run_aux.reset(ReadObjectAny<art::RunAuxiliary>(msg,
"art::RunAuxiliary",
"ArtdaqInput::readAndConstructPrincipal"));
399 TLOG_ARB(9,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
400 <<
"making flush RunPrincipal ...";
401 outR = pm_.makeRunPrincipal(RunID::flushRun(), run_aux->beginTime());
403 TLOG_ARB(9,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
404 <<
"making flush SubRunPrincipal ...";
405 outSR = pm_.makeSubRunPrincipal(SubRunID::flushSubRun(), run_aux->beginTime());
407 TLOG_ARB(9,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
408 <<
"making flush EventPrincipal ...";
409 outE = pm_.makeEventPrincipal(EventID::flushEvent(), run_aux->endTime(),
true, EventAuxiliary::Any);
411 TLOG_ARB(9,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
412 <<
"finished processing EndRun message.";
414 else if (msg_type_code == 3)
417 TLOG_ARB(10,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
418 <<
"processing EndSubRun message ...";
421 ReadObjectAny<art::SubRunAuxiliary>(msg,
"art::SubRunAuxiliary",
"ArtdaqInput::readAndConstructPrincipal"));
424 TLOG_ARB(10,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
425 <<
"making flush RunPrincipal ...";
426 outR = pm_.makeRunPrincipal(RunID::flushRun(), subrun_aux->beginTime());
443 art::Timestamp currentTime = time(0);
446 #if ART_HEX_VERSION < 0x30000
447 inR->setEndTime(currentTime);
449 inR->endTime(currentTime);
454 #if ART_HEX_VERSION < 0x30000
455 inSR->setEndTime(currentTime);
457 inSR->endTime(currentTime);
461 TLOG_ARB(10,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
462 <<
"making flush SubRunPrincipal ...";
463 outSR = pm_.makeSubRunPrincipal(SubRunID::flushSubRun(), subrun_aux->beginTime());
465 TLOG_ARB(10,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
466 <<
"making flush EventPrincipal ...";
467 outE = pm_.makeEventPrincipal(EventID::flushEvent(), subrun_aux->endTime(),
true, EventAuxiliary::Any);
469 TLOG_ARB(10,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
470 <<
"finished processing EndSubRun message.";
472 else if (msg_type_code == 4)
475 TLOG_ARB(11,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
476 <<
"processing Event message ...";
478 run_aux.reset(ReadObjectAny<art::RunAuxiliary>(msg,
"art::RunAuxiliary",
"ArtdaqInput::readAndConstructPrincipal"));
482 ReadObjectAny<art::SubRunAuxiliary>(msg,
"art::SubRunAuxiliary",
"ArtdaqInput::readAndConstructPrincipal"));
486 ReadObjectAny<art::EventAuxiliary>(msg,
"art::EventAuxiliary",
"ArtdaqInput::readAndConstructPrincipal"));
488 history_from_event.reset(ReadObjectAny<art::History>(msg,
"art::History",
"ArtdaqInput::readAndConstructPrincipal"));
492 if (!history_from_event->processHistoryID().isValid())
494 throw art::Exception(art::errors::Unknown)
495 <<
"readAndConstructPrincipal: processHistoryID of history in Event message is invalid!";
498 else if (!history_to_use_->processHistoryID().isValid())
500 history_to_use_.swap(history_from_event);
503 else if (!art::ProcessHistoryRegistry::get().count(history_to_use_->processHistoryID()) &&
504 art::ProcessHistoryRegistry::get().count(history_from_event->processHistoryID()))
506 history_to_use_.swap(history_from_event);
509 TLOG_ARB(11,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
510 <<
"inR: " << (
void*)inR <<
" run/expected "
511 << (inR ? std::to_string(inR->run()) :
"invalid") <<
"/" << event_aux->run();
512 TLOG_ARB(11,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
513 <<
"inSR: " << (
void*)inSR <<
" run/expected "
514 << (inSR ? std::to_string(inSR->run()) :
"invalid") <<
"/" << event_aux->run()
515 <<
", subrun/expected " << (inSR ? std::to_string(inSR->subRun()) :
"invalid") <<
"/"
516 << event_aux->subRun();
517 if ((inR ==
nullptr) || !inR->RUN_ID().isValid() || (inR->run() != event_aux->run()))
521 TLOG_ARB(11,
"ArtdaqInput") <<
"readAndConstructPrincipal: making RunPrincipal ...";
522 outR = pm_.makeRunPrincipal(*run_aux.get());
524 art::SubRunID subrun_check(event_aux->run(), event_aux->subRun());
525 if (inSR == 0 || subrun_check != inSR->SUBRUN_ID())
529 TLOG_ARB(11,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
530 <<
"making SubRunPrincipal ...";
531 outSR = pm_.makeSubRunPrincipal(*subrun_aux.get());
533 TLOG_ARB(11,
"ArtdaqInput") <<
"readAndConstructPrincipal: making EventPrincipal ...";
534 auto historyPtr = HISTORY_PTR_T(
new History(*(history_to_use_.get())));
535 if (!art::ProcessHistoryRegistry::get().count(history_to_use_->processHistoryID()))
537 TLOG_WARNING(
"ArtdaqInput") <<
"Stored history is not in ProcessHistoryRegistry, this event may have issues!";
539 outE = pm_.makeEventPrincipal(*event_aux.get(), std::move(historyPtr));
541 TLOG_ARB(11,
"ArtdaqInput") <<
"readAndConstructPrincipal: "
542 <<
"finished processing Event message.";
550 unsigned long prd_cnt = 0;
552 TLOG_ARB(12,
"ArtdaqInput") <<
"readDataProducts: reading data product count ...";
553 msg->ReadULong(prd_cnt);
554 TLOG_ARB(12,
"ArtdaqInput") <<
"readDataProducts: product count: " << prd_cnt;
559 for (
unsigned long I = 0; I < prd_cnt; ++I)
561 std::unique_ptr<BranchKey> bk;
563 TLOG_ARB(12,
"ArtdaqInput") <<
"readDataProducts: Reading branch key.";
564 bk.reset(ReadObjectAny<BranchKey>(msg,
"art::BranchKey",
"ArtdaqInput::readDataProducts"));
568 TLOG_ARB(13,
"ArtdaqInput") <<
"readDataProducts: got product class: '" << bk->friendlyClassName_ <<
"' modlbl: '"
569 << bk->moduleLabel_ <<
"' instnm: '" << bk->productInstanceName_ <<
"' procnm: '"
572 ProductList::const_iterator iter;
574 TLOG_ARB(12,
"ArtdaqInput") <<
"readDataProducts: looking up product ...";
575 iter = productList_->find(*bk);
576 if (iter == productList_->end())
578 throw art::Exception(art::errors::ProductNotFound)
579 <<
"No product is registered for\n"
580 <<
" process name: '" << bk->processName_ <<
"'\n"
581 <<
" module label: '" << bk->moduleLabel_ <<
"'\n"
582 <<
" product friendly class name: '" << bk->friendlyClassName_ <<
"'\n"
583 <<
" product instance name: '" << bk->productInstanceName_ <<
"'\n";
588 const BranchDescription& bd = iter->second;
589 std::unique_ptr<EDProduct> prd;
591 TLOG_ARB(12,
"ArtdaqInput") <<
"readDataProducts: Reading product with wrapped name: " << bd.wrappedName()
592 <<
", TClass = " << (
void*)TClass::GetClass(bd.wrappedName().c_str());
599 void* p = msg->ReadObjectAny(TClass::GetClass(bd.wrappedName().c_str()));
600 auto pp =
reinterpret_cast<EDProduct*
>(p);
602 TLOG_ARB(12,
"ArtdaqInput") <<
"readDataProducts: After ReadObjectAny(prd): p=" << p <<
", EDProduct::isPresent: " << pp->isPresent();
606 std::unique_ptr<const ProductProvenance> prdprov;
608 TLOG_ARB(12,
"ArtdaqInput") <<
"readDataProducts: Reading product provenance.";
609 prdprov.reset(ReadObjectAny<ProductProvenance>(msg,
"art::ProductProvenance",
"ArtdaqInput::readDataProducts"));
613 TLOG_ARB(12,
"ArtdaqInput") <<
"readDataProducts: inserting product: class: '" << bd.friendlyClassName()
614 <<
"' modlbl: '" << bd.moduleLabel() <<
"' instnm: '" << bd.productInstanceName()
615 <<
"' procnm: '" << bd.processName() <<
"' id: '" << bd.productID() <<
"'";
616 putInPrincipal(outPrincipal, std::move(prd), bd, std::move(prdprov));
623 const BranchDescription& bd,
624 std::unique_ptr<const ProductProvenance>&& prdprov)
626 #if ART_HEX_VERSION < 0x30000
627 rp->put(std::move(prd), bd, std::move(prdprov), RangeSet::forRun(rp->RUN_ID()));
629 rp->put(bd, std::move(prdprov), std::move(prd), std::make_unique<RangeSet>(RangeSet::forRun(rp->RUN_ID())));
635 const BranchDescription& bd,
636 std::unique_ptr<const ProductProvenance>&& prdprov)
638 #if ART_HEX_VERSION < 0x30000
639 srp->put(std::move(prd), bd, std::move(prdprov), RangeSet::forSubRun(srp->SUBRUN_ID()));
641 srp->put(bd, std::move(prdprov), std::move(prd), std::make_unique<RangeSet>(RangeSet::forSubRun(srp->SUBRUN_ID())));
647 const BranchDescription& bd,
648 std::unique_ptr<const ProductProvenance>&& prdprov)
650 TLOG_ARB(14,
"ArtdaqInput") <<
"EventPrincipal size before put: " << ep->size();
651 #if ART_HEX_VERSION < 0x30000
652 ep->put(std::move(prd), bd, std::move(prdprov));
654 ep->put(bd, std::move(prdprov), std::move(prd), std::make_unique<RangeSet>(RangeSet::invalid()));
656 TLOG_ARB(14,
"ArtdaqInput") <<
"EventPrincipal size after put: " << ep->size();
661 art::RunPrincipal*& outR, art::SubRunPrincipal*& outSR, art::EventPrincipal*& outE)
663 TLOG_ARB(15,
"ArtdaqInput") <<
"Begin: ArtdaqInput::readNext";
664 if (outputFileCloseNeeded_)
666 outputFileCloseNeeded_ =
false;
669 TLOG_ARB(15,
"ArtdaqInput") <<
"ArtdaqInput::readNext: "
670 <<
"returning false on outputFileCloseNeeded_";
671 TLOG_ARB(15,
"ArtdaqInput") <<
"End: ArtdaqInput::readNext";
675 artdaq::FragmentPtr dataFrag = communicationWrapper_.receiveMessage();
678 TLOG_ARB(15,
"ArtdaqInput") <<
"ArtdaqInput::readNext got an empty message";
679 shutdownMsgReceived_ =
true;
683 std::unique_ptr<TBufferFile> msg(
new TBufferFile(TBuffer::kRead, header->data_length, dataFrag->dataBegin(), kFALSE, 0));
688 unsigned long msg_type_code = 0;
690 TLOG_ARB(15,
"ArtdaqInput") <<
"ArtdaqInput::readNext: "
691 <<
"getting message type code ...";
692 msg->ReadULong(msg_type_code);
693 TLOG_ARB(15,
"ArtdaqInput") <<
"ArtdaqInput::readNext: "
694 <<
"message type: " << msg_type_code;
696 if (msg_type_code == 5)
699 shutdownMsgReceived_ =
true;
700 TLOG_ARB(16,
"ArtdaqInput") <<
"ArtdaqInput::readNext: "
701 <<
"returning false on Shutdown message.";
702 TLOG_ARB(16,
"ArtdaqInput") <<
"End: ArtdaqInput::readNext";
706 readAndConstructPrincipal(msg, msg_type_code, inR, inSR, outR, outSR, outE);
710 if (msg_type_code == 2)
714 readDataProducts(msg, outR);
716 TLOG_ARB(17,
"ArtdaqInput") <<
"ArtdaqInput::readNext: "
717 <<
"returning false on EndRun message.";
718 TLOG_ARB(17,
"ArtdaqInput") <<
"End: ArtdaqInput::readNext";
721 else if (msg_type_code == 3)
732 if (inR != 0 && inSR != 0 && outR != 0 && outSR != 0)
734 if (inR->RUN_ID().isFlush() && inSR->SUBRUN_ID().isFlush() && outR->RUN_ID().isFlush() &&
735 outSR->SUBRUN_ID().isFlush())
739 outputFileCloseNeeded_ =
true;
744 readDataProducts(msg, outSR);
747 outputFileCloseNeeded_ =
true;
748 TLOG_ARB(18,
"ArtdaqInput") <<
"readNext: returning true on EndSubRun message.";
749 TLOG_ARB(18,
"ArtdaqInput") <<
"End: ArtdaqInput::readNext";
752 else if (msg_type_code == 4)
755 readDataProducts(msg, outE);
756 TLOG_ARB(19,
"ArtdaqInput") <<
"readNext: returning true on Event message.";
757 TLOG_ARB(19,
"ArtdaqInput") <<
"End: ArtdaqInput::readNext";
762 TLOG_ARB(20,
"ArtdaqInput") <<
"readNext: returning false on unknown msg_type_code!";
763 TLOG_ARB(20,
"ArtdaqInput") <<
"End: ArtdaqInput::readNext";
void printProcessHistoryID(const std::string &label, const T &object)
Print the processHistoryID from the object.
void printProcessMap(const T &mappable, const std::string description)
Print data from a map-like class.