10 #include <FairMQDevice.h>
11 #include <FairMQParts.h>
31 fNumMsgs = fConfig->GetValue<
int>(
"num-msgs");
32 fOutput =
new TClonesArray(
"MyHit");
40 while (!NewStatePending()) {
43 if (Receive(partsIn,
"data1") > 0) {
45 Deserialize<SerializerEx2>(*(partsIn.At(0)), header);
46 Deserialize<RootSerializer>(*(partsIn.At(1)), fInput);
50 Exec(fInput, fOutput);
53 partsOut.AddPart(std::move(partsIn.At(0)));
54 partsOut.AddPart(NewMessage());
56 Serialize<BoostSerializer<Ex2Header>>(*(partsOut.At(0)), *header);
57 Serialize<BoostSerializer<MyHit>>(*(partsOut.At(1)), fOutput);
58 Send(partsOut,
"data2");
62 if (receivedMsgs == fNumMsgs) {
68 LOG(info) <<
"Received " << receivedMsgs <<
" and sent " << sentMsgs <<
" messages!";
72 void Exec(TClonesArray* digis, TClonesArray* hits)
75 for (
int idigi(0); idigi < digis->GetEntriesFast(); idigi++) {
84 dpos.SetXYZ(1 / TMath::Sqrt(12), 1 / TMath::Sqrt(12), 1 / TMath::Sqrt(12));
85 MyHit* hit =
new ((*hits)[idigi])
MyHit(fDetID, fMCIndex, pos, dpos);
93 TClonesArray* fOutput;
void SetXYZ(Int_t x, Int_t y, Int_t z)
Ex2Processor & operator=(const Ex2Processor &)
Double_t GetTimeStampError() const
Double_t GetTimeStamp() const
void Exec(TClonesArray *digis, TClonesArray *hits)
void SetTimeStamp(Double_t t)
void SetTimeStampError(Double_t t)