8 #ifndef CBMMCPOINTSOURCE_H_
9 #define CBMMCPOINTSOURCE_H_
11 #include "FairMQDevice.h"
15 #include "TClonesArray.h"
21 #include <boost/archive/binary_oarchive.hpp>
23 #include <boost/serialization/vector.hpp>
26 class FairRootManager;
58 Int_t entries = arr->GetEntriesFast();
60 T* point =
static_cast<T*
>(arr->At(0));
61 LOG(info) <<
"Entries in TCA for data type " << point->GetName() <<
": "
64 for (
int i = 0;
i < entries; ++
i) {
65 T* point =
static_cast<T*
>(arr->At(
i));
71 std::vector<T>
Convert(TClonesArray* arr) {
74 Int_t entries = arr->GetEntriesFast();
76 T* point =
static_cast<T*
>(arr->At(0));
77 LOG(info) <<
"Entries in TCA for data type " << point->GetName() <<
": "
80 for (
int i = 0;
i < entries; ++
i) {
81 T* point =
static_cast<T*
>(arr->At(
i));
82 vec.emplace_back(*point);
92 Int_t entries = arr->GetEntriesFast();
94 T* point =
static_cast<T*
>(arr->At(0));
95 LOG(info) <<
"Entries in TCA for data type " << point->GetName() <<
": "
98 for (
int iEntries = 0; iEntries < entries; ++iEntries) {
99 T* point =
static_cast<T*
>(arr->At(iEntries));
100 vec.emplace_back(*point);
104 std::stringstream oss;
105 boost::archive::binary_oarchive oa(oss);
107 std::string* strMsg =
new std::string(oss.str());
110 FairMQMessagePtr msg(NewMessage(
111 const_cast<char*
>(strMsg->c_str()),
113 [](
void* ,
void*
object) {
114 delete static_cast<std::string*>(object);
121 LOG(info) <<
"Need to copy FairMessage";
130 LOG(error) <<
"Problem sending data";
137 std::chrono::steady_clock::time_point
fTime {};