FairRoot/PandaRoot
Public Member Functions | Private Attributes | Friends | List of all members
PndMQTopix4ProcessorTask Class Reference

#include <PndMQTopix4ProcessorTask.h>

Inheritance diagram for PndMQTopix4ProcessorTask:

Public Member Functions

 PndMQTopix4ProcessorTask ()
 
virtual ~PndMQTopix4ProcessorTask ()
 
virtual InitStatus Init ()
 
virtual void Exec (Option_t *opt="0")
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

std::vector< PndSdsDigiTopix4fPndSdsDigiTopix4Vector
 
bool fHasBoostSerialization
 
PndMvdReadInToPix4TBData fTopixDataReader
 

Friends

class boost::serialization::access
 

Detailed Description

PndMQTopix4Sink.h

Since
2014-10-10
Author
A. Rybalchenko

Definition at line 26 of file PndMQTopix4ProcessorTask.h.

Constructor & Destructor Documentation

PndMQTopix4ProcessorTask::PndMQTopix4ProcessorTask ( )

Definition at line 30 of file PndMQTopix4ProcessorTask.cxx.

References fHasBoostSerialization.

30  : fHasBoostSerialization(false)
31 {
32  using namespace baseMQ::tools::resolve;
33  bool checkOutputClass = false;
34 
35  if (is_same<boost::archive::binary_oarchive, boost::archive::binary_oarchive>::value)
36  {
37  if (has_BoostSerialization<PndSdsDigiTopix4, void(boost::archive::binary_oarchive&, const unsigned int)>::value == 1)
38  {
39  checkOutputClass = true;
41  }
42  }
43  LOG(INFO) << "HasBoostSerialization: " << fHasBoostSerialization;
44 }
Data class to store the digi output of a pixel module.
PndMQTopix4ProcessorTask::~PndMQTopix4ProcessorTask ( )
virtual

Definition at line 77 of file PndMQTopix4ProcessorTask.cxx.

78 {
79 }

Member Function Documentation

void PndMQTopix4ProcessorTask::Exec ( Option_t *  opt = "0")
virtual

Definition at line 47 of file PndMQTopix4ProcessorTask.cxx.

References PndMvdReadInToPix4TBData::AnalyzeData(), fPndSdsDigiTopix4Vector, fTopixDataReader, PndTopix4::GetRawData(), TMrfData_8b::regdata, and TMrfData_8b::setNumWords().

48 {
49  TMrfData_8b* message = new TMrfData_8b();
50  message->setNumWords(fPayload->GetSize());
51  memcpy(reinterpret_cast<u_int8_t*>(&message->regdata[0]),fPayload->GetData(), fPayload->GetSize());
52 // LOG(INFO) << "Received message: \""
53 // << message->getNumWords() << " " << message->getNumBits()
54 // << "\"";
55  std::vector<ULong64_t> rawArray;
56  PndTopix4 topix;
57  rawArray = topix.GetRawData(message);
58  std::vector<std::vector<PndSdsDigiTopix4> > frames = fTopixDataReader.AnalyzeData(rawArray, 50);
59 
60  LOG(INFO) << "Frames.size " << frames.size();
61  if (frames.size() > 0)
62  LOG(INFO) << "Frames.front().size() " << frames.front().size();
63  if (frames.size() > 0){
64  ostringstream obuffer;
65  boost::archive::binary_oarchive OutputArchive(obuffer);
66  fPndSdsDigiTopix4Vector = frames.front();
67  OutputArchive << fPndSdsDigiTopix4Vector;
68  int outputSize = obuffer.str().length();
69  fPayload->Rebuild(outputSize);
70  memcpy(fPayload->GetData(), obuffer.str().c_str(), outputSize);
71  //unique_ptr<FairMQMessage> msg2(fTransportFactory->CreateMessage(const_cast<char*>(obuffer.str().c_str()), outputSize, CustomCleanup, &obuffer));
72  //fChannels.at("data-out").at(0).Send(msg);
73  LOG(INFO) << "Data: " << frames.front().size();
74  }
75 }
void setNumWords(const UInt_t &length)
Sets the length of the register to lengths words.
std::vector< std::vector< PndSdsDigiTopix4 > > AnalyzeData(std::vector< ULong64_t > &rawData, Double_t clockFrequency)
std::vector< ULong64_t > GetRawData(TMrfData_8b *data)
Definition: PndTopix4.cxx:25
Base interface class for data storage and manipulation. Compatible with IO classes from MRF Suite...
std::vector< UChar_t > regdata
Internal storage for data structure.
std::vector< PndSdsDigiTopix4 > fPndSdsDigiTopix4Vector
PndMvdReadInToPix4TBData fTopixDataReader
virtual InitStatus PndMQTopix4ProcessorTask::Init ( )
inlinevirtual

Definition at line 32 of file PndMQTopix4ProcessorTask.h.

32 { return kSUCCESS; };
template<class Archive >
void PndMQTopix4ProcessorTask::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

Definition at line 37 of file PndMQTopix4ProcessorTask.h.

References fPndSdsDigiTopix4Vector.

38  {
40  }
std::vector< PndSdsDigiTopix4 > fPndSdsDigiTopix4Vector

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 44 of file PndMQTopix4ProcessorTask.h.

Member Data Documentation

bool PndMQTopix4ProcessorTask::fHasBoostSerialization
private

Definition at line 48 of file PndMQTopix4ProcessorTask.h.

Referenced by PndMQTopix4ProcessorTask().

std::vector<PndSdsDigiTopix4> PndMQTopix4ProcessorTask::fPndSdsDigiTopix4Vector
private

Definition at line 46 of file PndMQTopix4ProcessorTask.h.

Referenced by Exec(), and serialize().

PndMvdReadInToPix4TBData PndMQTopix4ProcessorTask::fTopixDataReader
private

Definition at line 50 of file PndMQTopix4ProcessorTask.h.

Referenced by Exec().


The documentation for this class was generated from the following files: