16 #include "FairMQLogger.h"
17 #include "FairParGenericSet.h"
19 #include "FairMQProgOptions.h"
21 #include "FairRunAna.h"
25 #include <boost/archive/binary_iarchive.hpp>
26 #include <boost/serialization/vector.hpp>
33 using std::runtime_error::runtime_error;
44 , fTrdGasPar {
nullptr} {}
51 fMaxEvents = fConfig->GetValue<uint64_t>(
"max-events");
63 for (
auto const& entry : fChannels) {
64 LOG(info) <<
"Channel name: " << entry.first;
65 if (entry.first.compare(
"StsPoint"))
66 LOG(info) <<
"Connect Channel " << entry.first
67 <<
"with data type StsPoint";
75 LOG(ERROR) << e.what();
81 Bool_t initOK {kTRUE};
83 fRunId = fConfig->GetValue<
string>(
"run-id");
84 fvmcworkdir = fConfig->GetValue<
string>(
"vmcworkdir");
85 fMaxEvents = fConfig->GetValue<uint64_t>(
"max-events");
87 LOG(INFO) <<
"Init parameter containers for CbmDeviceStsHitProducerIdeal.";
92 for (
int iparC = 0; iparC < fParCList->GetEntries(); iparC++) {
93 FairParGenericSet* tempObj = (FairParGenericSet*) (fParCList->At(iparC));
94 fParCList->Remove(tempObj);
95 std::string paramName {tempObj->GetName()};
101 std::string message = paramName +
",111";
102 LOG(info) <<
"Requesting parameter container " << paramName
103 <<
", sending message: " << message;
105 FairMQMessagePtr req(NewSimpleMessage(message));
106 FairMQMessagePtr rep(NewMessage());
108 FairParGenericSet* newObj =
nullptr;
110 if (Send(req,
"parameters") > 0) {
111 if (Receive(rep,
"parameters") >= 0) {
112 if (rep->GetSize() != 0) {
115 static_cast<FairParGenericSet*
>(tmsg.ReadObject(tmsg.GetClass()));
116 LOG(info) <<
"Received unpack parameter from the server:";
119 LOG(error) <<
"Received empty reply. Parameter not available";
123 fParCList->AddAt(newObj, iparC);
147 std::string msgStr(
static_cast<char*
>(msg->GetData()), msg->GetSize());
148 std::istringstream iss(msgStr);
149 boost::archive::binary_iarchive inputArchive(iss);
151 std::vector<CbmStsPoint>
points;
159 LOG(info) <<
"Out of " <<
points.size() <<
" StsPoints, " <<
hits.size()
164 LOG(INFO) <<
"Processed " <<
fNumMessages <<
" time slices";