1 #include "artdaq/ArtModules/RootNetOutput.hh"
3 #include "art/Framework/Core/ModuleMacros.h"
4 #include "art/Framework/Services/Registry/ServiceHandle.h"
5 #if ART_HEX_VERSION < 0x20900
6 #include "art/Persistency/Provenance/BranchIDListRegistry.h"
7 #include "canvas/Persistency/Provenance/BranchIDList.h"
9 #include "art/Persistency/Provenance/ProcessHistoryRegistry.h"
10 #include "art/Persistency/Provenance/ProductMetaData.h"
12 #include "canvas/Persistency/Provenance/BranchDescription.h"
13 #include "canvas/Persistency/Provenance/BranchKey.h"
14 #include "canvas/Persistency/Provenance/History.h"
15 #include "canvas/Persistency/Provenance/ParentageRegistry.h"
16 #include "canvas/Persistency/Provenance/ProcessConfiguration.h"
17 #include "canvas/Persistency/Provenance/ProcessConfigurationID.h"
18 #include "canvas/Persistency/Provenance/ProcessHistoryID.h"
19 #include "canvas/Persistency/Provenance/ProductList.h"
20 #include "canvas/Persistency/Provenance/ProductProvenance.h"
21 #include "canvas/Persistency/Provenance/RunAuxiliary.h"
22 #include "canvas/Persistency/Provenance/SubRunAuxiliary.h"
23 #include "canvas/Utilities/DebugMacros.h"
24 #include "canvas/Utilities/Exception.h"
25 #include "cetlib/column_width.h"
26 #include "cetlib/lpad.h"
27 #include "cetlib/rpad.h"
30 #include "fhiclcpp/ParameterSet.h"
31 #include "fhiclcpp/ParameterSetID.h"
32 #include "fhiclcpp/ParameterSetRegistry.h"
34 #define TRACE_NAME "RootNetOutput"
36 #define TLVL_OPENFILE 5
37 #define TLVL_CLOSEFILE 6
38 #define TLVL_RESPONDTOCLOSEINPUTFILE 7
39 #define TLVL_RESPONDTOCLOSEOUTPUTFILE 8
41 #define TLVL_SENDINIT 10
42 #define TLVL_SENDINIT_VERBOSE1 32
43 #define TLVL_SENDINIT_VERBOSE2 33
44 #define TLVL_WRITEDATAPRODUCTS 11
45 #define TLVL_WRITEDATAPRODUCTS_VERBOSE 34
47 #define TLVL_WRITERUN 13
48 #define TLVL_WRITESUBRUN 14
49 #define TLVL_WRITESUBRUN_VERBOSE 35
52 #include "artdaq/DAQdata/Globals.hh"
53 #include "artdaq/ArtModules/NetMonTransportService.h"
54 #include "artdaq-core/Data/detail/ParentageMap.hh"
55 #include "artdaq/DAQdata/NetMonHeader.hh"
67 #include <TBufferFile.h>
74 TLOG(TLVL_DEBUG) <<
"Begin: RootNetOutput::RootNetOutput(ParameterSet const& ps)";
75 ServiceHandle<NetMonTransportService> transport;
77 TLOG(TLVL_DEBUG) <<
"End: RootNetOutput::RootNetOutput(ParameterSet const& ps)";
83 TLOG(TLVL_DEBUG) <<
"Begin: RootNetOutput::~RootNetOutput()";
84 ServiceHandle<NetMonTransportService> transport;
85 transport->disconnect();
86 TLOG(TLVL_DEBUG) <<
"End: RootNetOutput::~RootNetOutput()";
91 openFile(FileBlock
const&)
93 TLOG(TLVL_OPENFILE) <<
"Begin/End: RootNetOutput::openFile(const FileBlock&)";
100 TLOG(TLVL_CLOSEFILE) <<
"Begin/End: RootNetOutput::closeFile()";
105 respondToCloseInputFile(FileBlock
const&)
107 TLOG(TLVL_RESPONDTOCLOSEINPUTFILE) <<
"Begin/End: RootNetOutput::"
108 "respondToCloseOutputFiles(FileBlock const&)";
113 respondToCloseOutputFiles(FileBlock
const&)
115 TLOG(TLVL_RESPONDTOCLOSEOUTPUTFILE) <<
"Begin/End: RootNetOutput::"
116 "respondToCloseOutputFiles(FileBlock const&)";
121 send_shutdown_message()
133 TLOG(TLVL_ENDJOB) <<
"Begin: RootNetOutput::endJob()";
134 send_shutdown_message();
135 TLOG(TLVL_ENDJOB) <<
"End: RootNetOutput::endJob()";
144 TLOG(TLVL_SENDINIT) <<
"Begin: RootNetOutput static send_init_message()";
154 static TClass* product_list_class = TClass::GetClass(
155 "std::map<art::BranchKey,art::BranchDescription>");
156 if (product_list_class ==
nullptr)
158 throw art::Exception(art::errors::DictionaryNotFound) <<
159 "RootNetOutput static send_init_message(): "
160 "Could not get TClass for "
161 "map<art::BranchKey,art::BranchDescription>!";
167 static TClass* process_history_map_class = TClass::GetClass(
168 "std::map<const art::Hash<2>,art::ProcessHistory>");
169 if (process_history_map_class ==
nullptr)
171 throw art::Exception(art::errors::DictionaryNotFound) <<
172 "RootNetOutput static send_init_message(): "
173 "Could not get class for "
174 "std::map<const art::Hash<2>,art::ProcessHistory>!";
179 static TClass* parentage_map_class = TClass::GetClass(
"art::ParentageMap");
180 if (parentage_map_class ==
nullptr)
182 throw art::Exception(art::errors::DictionaryNotFound) <<
183 "RootNetOutput static send_init_message(): "
184 "Could not get class for ParentageMap.";
186 TLOG(TLVL_SENDINIT) <<
"parentage_map_class: " << (
void*)parentage_map_class;
191 TBufferFile msg(TBuffer::kWrite);
196 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): Streaming message type code ...";
198 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): Finished streaming message type code.";
203 unsigned long ps_cnt = fhicl::ParameterSetRegistry::size();
204 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): parameter set count: " + std::to_string(ps_cnt);
205 msg.WriteULong(ps_cnt);
206 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): Streaming parameter sets ...";
208 auto I = std::begin(fhicl::ParameterSetRegistry::get()),
209 E = std::end(fhicl::ParameterSetRegistry::get());
212 std::string pset_str = I->second.to_string();
214 msg.WriteStdString(pset_str);
216 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): Finished streaming parameter sets.";
221 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): Streaming MasterProductRegistry ...";
222 art::ProductList productList(
223 art::ProductMetaData::instance().productList());
224 msg.WriteObjectAny(&productList, product_list_class);
225 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): Finished streaming MasterProductRegistry.";
227 #if ART_HEX_VERSION < 0x20900
231 art::BranchIDLists
const * bilr =
232 &art::BranchIDListRegistry::instance().data();
233 TLOG(TLVL_SENDINIT_VERBOSE1) <<
"RootNetOutput static send_init_message(): Content of BranchIDLists";
234 int max_bli = bilr->size();
235 TLOG(TLVL_SENDINIT_VERBOSE1) <<
"RootNetOutput static send_init_message(): max_bli: " << max_bli;
236 for (
int i = 0; i < max_bli; ++i)
238 int max_prdidx = (*bilr)[i].size();
239 TLOG(TLVL_SENDINIT_VERBOSE1) <<
"RootNetOutput static send_init_message(): max_prdidx: " << max_prdidx;
240 for (
int j = 0; j < max_prdidx; ++j)
242 TLOG(TLVL_SENDINIT_VERBOSE1) <<
"RootNetOutput static send_init_message(): bli: " << i <<
" prdidx: " << j <<
" bid: 0x" << std::hex << static_cast<unsigned long>((*bilr)[i][j]) << std::dec;
247 art::ProcessHistoryMap phr;
248 for (
auto const& pr : art::ProcessHistoryRegistry::get())
255 TLOG(TLVL_SENDINIT_VERBOSE2) <<
"RootNetOutput static send_init_message(): Dumping ProcessHistoryRegistry ...";
258 TLOG(TLVL_SENDINIT_VERBOSE2) <<
"RootNetOutput static send_init_message(): phr: size: " << std::to_string(phr.size());
259 for (
auto I = phr.begin(), E = phr.end(); I != E; ++I)
261 std::ostringstream OS;
263 TLOG(TLVL_SENDINIT_VERBOSE2) <<
"RootNetOutput static send_init_message(): phr: id: '" << OS.str() <<
"'";
268 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): Streaming ProcessHistoryRegistry ...";
271 const art::ProcessHistoryMap& phm = phr;
272 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): phm: size: " << std::to_string(phm.size());
273 msg.WriteObjectAny(&phm, process_history_map_class);
274 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): Finished streaming ProcessHistoryRegistry.";
279 TLOG(TLVL_SENDINIT) <<
"static send_init_message(): Streaming ParentageRegistry ..."
280 << (
void*)parentage_map_class;
281 art::ParentageMap parentageMap{};
282 for (
auto const& pr : art::ParentageRegistry::get())
284 parentageMap.emplace(pr.first, pr.second);
287 msg.WriteObjectAny(&parentageMap, parentage_map_class);
289 TLOG(TLVL_SENDINIT) <<
"static send_init_message(): Finished streaming ParentageRegistry.";
295 art::ServiceHandle<NetMonTransportService> transport;
296 if (!transport.get())
298 TLOG(TLVL_ERROR) <<
"Could not get handle to NetMonTransportService!";
301 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): Sending the init message to " << std::to_string(transport->dataReceiverCount()) <<
" data receivers ...";
302 for (
size_t idx = 0; idx < transport->dataReceiverCount(); ++idx)
304 transport->sendMessage(idx, artdaq::Fragment::InitFragmentType, msg);
306 TLOG(TLVL_SENDINIT) <<
"RootNetOutput static send_init_message(): Init message(s) sent.";
308 TLOG(TLVL_SENDINIT) <<
"End: RootNetOutput static send_init_message()";
315 writeDataProducts(TBufferFile& msg,
const Principal& principal,
316 std::vector<BranchKey*>& bkv)
318 TLOG(TLVL_WRITEDATAPRODUCTS) <<
"Begin: RootNetOutput::writeDataProducts(...)";
323 static TClass* branch_key_class = TClass::GetClass(
"art::BranchKey");
324 if (branch_key_class ==
nullptr)
326 throw art::Exception(art::errors::DictionaryNotFound) <<
327 "RootNetOutput::writeDataProducts(...): "
328 "Could not get TClass for art::BranchKey!";
330 static TClass* prdprov_class = TClass::GetClass(
"art::ProductProvenance");
331 if (prdprov_class ==
nullptr)
333 throw art::Exception(art::errors::DictionaryNotFound) <<
334 "RootNetOutput::writeDataProducts(...): "
335 "Could not get TClass for art::ProductProvenance!";
341 unsigned long prd_cnt = 0;
343 for (
auto I = principal.begin(), E = principal.end(); I != E; ++I)
345 #if ART_HEX_VERSION > 0x20800
346 auto const& productDescription = I->second->productDescription();
347 auto const& refs = keptProducts()[productDescription.branchType()];
349 for (
auto const& ref : refs)
351 if (*ref == productDescription)
357 if (I->second->productUnavailable() || !found)
362 if (I->second->productUnavailable() || !selected(I->second->productDescription()))
373 TLOG(TLVL_WRITEDATAPRODUCTS) <<
"RootNetOutput::writeDataProducts(...): Streaming product count: " + std::to_string(prd_cnt);
374 msg.WriteULong(prd_cnt);
375 TLOG(TLVL_WRITEDATAPRODUCTS) <<
"RootNetOutput::writeDataProducts(...): Finished streaming product count.";
387 bkv.reserve(prd_cnt);
389 for (
auto I = principal.begin(), E = principal.end(); I != E; ++I)
391 #if ART_HEX_VERSION > 0x20800
392 auto const& productDescription = I->second->productDescription();
393 auto const& refs = keptProducts()[productDescription.branchType()];
395 for (
auto const& ref : refs)
397 if (*ref == productDescription)
403 if (I->second->productUnavailable() || !found)
408 if (I->second->productUnavailable() || !selected(I->second->productDescription()))
414 const BranchDescription& bd(I->second->productDescription());
415 bkv.push_back(
new BranchKey(bd));
416 TLOG(TLVL_WRITEDATAPRODUCTS_VERBOSE) <<
"RootNetOutput::writeDataProducts(...): Dumping branch key of class: '"
417 << bkv.back()->friendlyClassName_
419 << bkv.back()->moduleLabel_
421 << bkv.back()->productInstanceName_
423 << bkv.back()->processName_
425 TLOG(TLVL_WRITEDATAPRODUCTS) <<
"RootNetOutput::writeDataProducts(...): "
426 "Streaming branch key of class: '"
427 << bd.producedClassName()
431 << bd.productInstanceName()
435 msg.WriteObjectAny(bkv.back(), branch_key_class);
436 TLOG(TLVL_WRITEDATAPRODUCTS) <<
"RootNetOutput::writeDataProducts(...): "
437 "Streaming product of class: '"
438 << bd.producedClassName()
442 << bd.productInstanceName()
446 #if ART_HEX_VERSION > 0x20800
447 OutputHandle oh = principal.getForOutput(bd.productID(),
true);
449 OutputHandle oh = principal.getForOutput(bd.branchID(),
true);
451 const EDProduct* prd = oh.wrapper();
452 TLOG(TLVL_WRITEDATAPRODUCTS) <<
"Class for branch " << bd.wrappedName() <<
" is " << (
void*)TClass::GetClass(bd.wrappedName().c_str());
453 msg.WriteObjectAny(prd, TClass::GetClass(bd.wrappedName().c_str()));
454 TLOG(TLVL_WRITEDATAPRODUCTS) <<
"RootNetOutput::writeDataProducts(...): "
455 "Streaming product provenance of class: '"
456 << bd.producedClassName()
460 << bd.productInstanceName()
464 const ProductProvenance* prdprov = I->second->productProvenancePtr().get();
465 msg.WriteObjectAny(prdprov, prdprov_class);
467 TLOG(TLVL_WRITEDATAPRODUCTS) <<
"End: RootNetOutput::writeDataProducts(...)";
472 write(EventPrincipal& ep)
477 TLOG(TLVL_WRITE) <<
"Begin: RootNetOutput::write(const EventPrincipal& ep)";
486 static TClass* run_aux_class = TClass::GetClass(
"art::RunAuxiliary");
487 if (run_aux_class ==
nullptr)
489 throw art::Exception(art::errors::DictionaryNotFound) <<
490 "RootNetOutput::write(const EventPrincipal& ep): "
491 "Could not get TClass for art::RunAuxiliary!";
493 static TClass* subrun_aux_class = TClass::GetClass(
"art::SubRunAuxiliary");
494 if (subrun_aux_class ==
nullptr)
496 throw art::Exception(art::errors::DictionaryNotFound) <<
497 "RootNetOutput::write(const EventPrincipal& ep): "
498 "Could not get TClass for art::SubRunAuxiliary!";
500 static TClass* event_aux_class = TClass::GetClass(
"art::EventAuxiliary");
501 if (event_aux_class ==
nullptr)
503 throw art::Exception(art::errors::DictionaryNotFound) <<
504 "RootNetOutput::write(const EventPrincipal& ep): "
505 "Could not get TClass for art::EventAuxiliary!";
507 static TClass* history_class = TClass::GetClass(
"art::History");
508 if (history_class ==
nullptr)
510 throw art::Exception(art::errors::DictionaryNotFound) <<
511 "RootNetOutput::write(const EventPrincipal& ep): "
512 "Could not get TClass for art::History!";
517 TBufferFile msg(TBuffer::kWrite);
522 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Streaming message type code ...";
524 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Finished streaming message type code.";
529 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Streaming RunAuxiliary ...";
530 msg.WriteObjectAny(&ep.subRunPrincipal().runPrincipal().aux(),
532 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Finished streaming RunAuxiliary.";
537 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Streaming SubRunAuxiliary ...";
538 msg.WriteObjectAny(&ep.subRunPrincipal().aux(),
540 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Finished streaming SubRunAuxiliary.";
546 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Streaming EventAuxiliary ...";
547 msg.WriteObjectAny(&ep.aux(), event_aux_class);
548 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Finished streaming EventAuxiliary.";
554 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Streaming History ...";
555 msg.WriteObjectAny(&ep.history(), history_class);
556 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Finished streaming History.";
561 std::vector<BranchKey*> bkv;
562 writeDataProducts(msg, ep, bkv);
567 ServiceHandle<NetMonTransportService> transport;
568 if (!transport.get())
570 TLOG(TLVL_ERROR) <<
"Could not get handle to NetMonTransportService!";
573 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Sending a message ...";
574 transport->sendMessage(ep.id().event(), artdaq::Fragment::DataFragmentType, msg);
575 TLOG(TLVL_WRITE) <<
"RootNetOutput::write(const EventPrincipal& ep): Message sent.";
580 for (
auto I = bkv.begin(), E = bkv.end(); I != E; ++I)
585 TLOG(TLVL_WRITE) <<
"End: RootNetOutput::write(const EventPrincipal& ep)";
590 writeRun(RunPrincipal& rp)
595 TLOG(TLVL_WRITERUN) <<
"Begin: RootNetOutput::writeRun(const RunPrincipal& rp)";
607 static TClass* run_aux_class = TClass::GetClass(
"art::RunAuxiliary");
608 assert(run_aux_class !=
nullptr &&
"writeRun: Could not get TClass for art::RunAuxiliary!");
612 TBufferFile msg(TBuffer::kWrite);
618 TLOG(TLVL_WRITERUN) <<
"writeRun: streaming message type code ...";
620 TLOG(TLVL_WRITERUN) <<
"writeRun: finished streaming message type code.";
626 TLOG(TLVL_WRITERUN) <<
"writeRun: streaming RunAuxiliary ...";
627 TLOG(TLVL_WRITERUN_VERBOSE) <<
"writeRun: dumping ProcessHistoryRegistry ...";
630 art::ProcessHistoryMap
const& phr =
631 art::ProcessHistoryRegistry::get();
632 TLOG(TLVL_WRITERUN_VERBOSE) <<
"writeRun: phr: size: " << phr.size();
633 for (
auto I = phr.begin(), E = phr.end(); I != E; ++I)
635 std::ostringstream OS;
637 TLOG(TLVL_WRITERUN_VERBOSE) <<
"writeRun: phr: id: '" << OS.str() <<
"'";
639 TLOG(TLVL_WRITERUN_VERBOSE) <<
"writeRun: phr: data.size(): " << I->second.data().size();
640 if (I->second.data().size())
642 I->second.data().back().id().print(OS);
643 TLOG(TLVL_WRITERUN_VERBOSE) <<
"writeRun: phr: data.back().id(): '" << OS.str() <<
"'";
646 if (!rp.aux().processHistoryID().isValid())
648 TLOG(TLVL_WRITERUN_VERBOSE) <<
"writeRun: ProcessHistoryID: 'INVALID'";
652 std::ostringstream OS;
653 rp.aux().processHistoryID().print(OS);
654 TLOG(TLVL_WRITERUN_VERBOSE) <<
"writeRun: ProcessHistoryID: '" << OS.str() <<
"'";
656 const ProcessHistory& processHistory =
657 ProcessHistoryRegistry::get(rp.aux().processHistoryID());
658 if (processHistory.data().size())
661 processHistory.data().back().id().print(OS);
662 TLOG(TLVL_WRITERUN_VERBOSE) <<
"writeRun: ProcessConfigurationID: '" << OS.str() <<
"'";
664 TLOG(TLVL_WRITERUN_VERBOSE) <<
"writeRun: ProcessConfiguration: '" << processHistory.data().back();
667 msg.WriteObjectAny(&rp.aux(), run_aux_class);
668 TLOG(TLVL_WRITERUN) <<
"writeRun: streamed RunAuxiliary.";
673 std::vector<BranchKey*> bkv;
674 writeDataProducts(msg, rp, bkv);
679 ServiceHandle<NetMonTransportService> transport;
680 if (!transport.get())
682 TLOG(TLVL_ERROR) <<
"Could not get handle to NetMonTransportService!";
685 TLOG(TLVL_WRITERUN) <<
"writeRun: sending a message ...";
686 transport->sendMessage(0, artdaq::Fragment::EndOfRunFragmentType, msg);
687 TLOG(TLVL_WRITERUN) <<
"writeRun: message sent.";
692 for (
auto I = bkv.begin(), E = bkv.end(); I != E; ++I)
698 TLOG(TLVL_WRITERUN) <<
"End: RootNetOutput::writeRun(const RunPrincipal& rp)";
702 art::RootNetOutput::writeSubRun(SubRunPrincipal& srp)
707 TLOG(TLVL_WRITESUBRUN) <<
"Begin: RootNetOutput::writeSubRun(const SubRunPrincipal& srp)";
717 static TClass* subrun_aux_class = TClass::GetClass(
"art::SubRunAuxiliary");
718 if (subrun_aux_class ==
nullptr)
720 throw art::Exception(art::errors::DictionaryNotFound) <<
721 "RootNetOutput::writeSubRun: "
722 "Could not get TClass for art::SubRunAuxiliary!";
727 TBufferFile msg(TBuffer::kWrite);
733 TLOG(TLVL_WRITESUBRUN) <<
"RootNetOutput::writeSubRun: streaming message type code ...";
735 TLOG(TLVL_WRITESUBRUN) <<
"RootNetOutput::writeSubRun: finished streaming message type code.";
741 TLOG(TLVL_WRITESUBRUN) <<
"RootNetOutput::writeSubRun: streaming SubRunAuxiliary ...";
743 TLOG(TLVL_WRITESUBRUN_VERBOSE) <<
"RootNetOutput::writeSubRun: dumping ProcessHistoryRegistry ...";
746 for (
auto I = std::begin(art::ProcessHistoryRegistry::get())
747 , E = std::end(art::ProcessHistoryRegistry::get()); I != E; ++I)
749 std::ostringstream OS;
751 TLOG(TLVL_WRITESUBRUN_VERBOSE) <<
"RootNetOutput::writeSubRun: phr: id: '" << OS.str() <<
"'";
753 TLOG(TLVL_WRITESUBRUN_VERBOSE) <<
"RootNetOutput::writeSubRun: phr: data.size(): " << std::to_string(I->second.data().size());
754 if (I->second.data().size())
756 I->second.data().back().id().print(OS);
757 TLOG(TLVL_WRITESUBRUN_VERBOSE) <<
"RootNetOutput::writeSubRun: phr: data.back().id(): '" << OS.str() <<
"'";
760 if (!srp.aux().processHistoryID().isValid())
762 TLOG(TLVL_WRITESUBRUN_VERBOSE) <<
"RootNetOutput::writeSubRun: ProcessHistoryID: 'INVALID'";
766 std::ostringstream OS;
767 srp.aux().processHistoryID().print(OS);
768 TLOG(TLVL_WRITESUBRUN_VERBOSE) <<
"RootNetOutput::writeSubRun: ProcessHistoryID: '" << OS.str() <<
"'";
770 ProcessHistory processHistory;
771 ProcessHistoryRegistry::get(srp.aux().processHistoryID(), processHistory);
772 if (processHistory.data().size())
775 processHistory.data().back().id().print(OS);
776 TLOG(TLVL_WRITESUBRUN_VERBOSE) <<
"RootNetOutput::writeSubRun: ProcessConfigurationID: '" << OS.str() <<
"'";
778 OS << processHistory.data().back();
779 TLOG(TLVL_WRITESUBRUN_VERBOSE) <<
"RootNetOutput::writeSubRun: ProcessConfiguration: '" << OS.str();
782 msg.WriteObjectAny(&srp.aux(), subrun_aux_class);
783 TLOG(TLVL_WRITESUBRUN) <<
"RootNetOutput::writeSubRun: streamed SubRunAuxiliary.";
788 std::vector<BranchKey*> bkv;
789 writeDataProducts(msg, srp, bkv);
793 ServiceHandle<NetMonTransportService> transport;
794 if (!transport.get())
796 TLOG(TLVL_ERROR) <<
"Could not get handle to NetMonTransportService!";
799 TLOG(TLVL_WRITESUBRUN) <<
"RootNetOutput::writeSubRun: Sending the EndOfSubrun message to " << std::to_string(transport->dataReceiverCount()) <<
" data receivers ...";
800 for (
size_t idx = 0; idx < transport->dataReceiverCount(); ++idx)
802 transport->sendMessage(idx, artdaq::Fragment::EndOfSubrunFragmentType, msg);
804 TLOG(TLVL_WRITESUBRUN) <<
"RootNetOutput::writeSubRun: EndOfSubrun message(s) sent.";
813 for (
auto I = bkv.begin(), E = bkv.end(); I != E; ++I)
818 TLOG(TLVL_WRITESUBRUN) <<
"End: RootNetOutput::writeSubRun(const SubRunPrincipal& srp)";
~RootNetOutput()
RootNetOutput Destructor.
An art::OutputModule which sends events using DataSenderManager. This module is designed for transpor...
RootNetOutput(fhicl::ParameterSet const &ps)
RootNetOutput Constructor.