FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
PndMQTopix4OnlineHisto Class Reference

#include <PndMQTopix4OnlineHisto.h>

Inheritance diagram for PndMQTopix4OnlineHisto:

Public Member Functions

 PndMQTopix4OnlineHisto ()
 
virtual ~PndMQTopix4OnlineHisto ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Member Functions

virtual void Run ()
 

Protected Attributes

bool fHasBoostSerialization
 
std::vector< PndSdsDigiTopix4fTopixData
 
PndMvdReadInToPix4TBData fTopixDataReader
 

Friends

class boost::serialization::access
 

Detailed Description

PndMQTopix4OnlineHisto.h

Since
2014-10-10
Author
A. Rybalchenko

Definition at line 28 of file PndMQTopix4OnlineHisto.h.

Constructor & Destructor Documentation

PndMQTopix4OnlineHisto::PndMQTopix4OnlineHisto ( )

Definition at line 33 of file PndMQTopix4OnlineHisto.cxx.

References fHasBoostSerialization.

33  : fHasBoostSerialization(false)
34 {
35  gSystem->ResetSignal(kSigInterrupt);
36  gSystem->ResetSignal(kSigTermination);
37 
38  using namespace baseMQ::tools::resolve;
39  // coverity[pointless_expression]: suppress coverity warnings on apparant if(const).
40  if (has_BoostSerialization<PndSdsDigiTopix4, void(boost::archive::binary_iarchive&, const unsigned int)>::value == 1)
42 }
Data class to store the digi output of a pixel module.
PndMQTopix4OnlineHisto::~PndMQTopix4OnlineHisto ( )
virtual

Definition at line 105 of file PndMQTopix4OnlineHisto.cxx.

106 {
107 }

Member Function Documentation

void PndMQTopix4OnlineHisto::Run ( )
protectedvirtual

Definition at line 49 of file PndMQTopix4OnlineHisto.cxx.

References c1, fHasBoostSerialization, fTopixData, and h2.

Referenced by main().

50 {
51  LOG(INFO) << "Boost Serialization "<< fHasBoostSerialization;
53  FairMQChannel& dataInChannel = fChannels.at("data-in").at(0);
54  int receivedMsgs = 0;
55 
56  TH2* h2 = new TH2D("h2","h2", 21, -0.5, 20.5, 33, -0.5, 32.5);
57  TCanvas *c1 = new TCanvas("c1", "Dynamic Filling Example", 500, 100, 700, 500);
58  c1->Show();
59  while (CheckCurrentState(RUNNING))
60  {
61  FairMQMessage* msg = fTransportFactory->CreateMessage();
62 
63  if (dataInChannel.Receive(msg) > 0)
64  {
65  LOG(INFO) << "Received Message: ";
66  LOG(INFO) << receivedMsgs++;
67  LOG(INFO) << msg->GetSize();
68 
69  string msgStr(static_cast<char*>(msg->GetData()), msg->GetSize());
70  istringstream ibuffer(msgStr);
71 
72  boost::archive::binary_iarchive InputArchive(ibuffer);
73 
74  try {
75  InputArchive >> fTopixData;
76  }
77  catch (boost::archive::archive_exception& e)
78  {
79  LOG(ERROR) << e.what();
80  }
81 
82  LOG(INFO) << "TopixData: " << fTopixData.size();
83 
84  if (fTopixData.size() > 0){
85  for (auto itr : fTopixData){
86  h2->Fill(itr.GetPixelColumn(), itr.GetPixelRow());
87  }
88  }
89  delete(msg);
90 
91  const int kUPDATE = 100;
92  if (receivedMsgs){
93  if (receivedMsgs == kUPDATE) h2->Draw("colz");
94  c1->Modified();
95  c1->Update();
96  }
97 
98  if (fTopixData.size() > 0)
99  fTopixData.clear();
100  }
101  }
102  }
103 }
c1
Definition: plot_dirc.C:35
std::vector< PndSdsDigiTopix4 > fTopixData
template<class Archive >
void PndMQTopix4OnlineHisto::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

Definition at line 37 of file PndMQTopix4OnlineHisto.h.

References fTopixData.

38  {
39  ar& fTopixData;
40  }
std::vector< PndSdsDigiTopix4 > fTopixData

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 46 of file PndMQTopix4OnlineHisto.h.

Member Data Documentation

bool PndMQTopix4OnlineHisto::fHasBoostSerialization
protected

Definition at line 47 of file PndMQTopix4OnlineHisto.h.

Referenced by PndMQTopix4OnlineHisto(), and Run().

std::vector<PndSdsDigiTopix4> PndMQTopix4OnlineHisto::fTopixData
protected

Definition at line 50 of file PndMQTopix4OnlineHisto.h.

Referenced by Run(), and serialize().

PndMvdReadInToPix4TBData PndMQTopix4OnlineHisto::fTopixDataReader
protected

Definition at line 52 of file PndMQTopix4OnlineHisto.h.


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