10 #include "PndMQGapEventBuilder.h"
13 #include "PndMapSorter.h"
28 delete (std::string*)hint;
40 while (CheckCurrentState(RUNNING))
43 std::unique_ptr<FairMQMessage> msg(fTransportFactory->CreateMessage());
44 if (Receive(msg,
"data-in") >= 0)
47 string msgStr(static_cast<char*>(msg->GetData()), msg->GetSize());
48 istringstream ibuffer(msgStr);
50 LOG(INFO) <<
"IBUFFER IS BAD!";
51 boost::archive::text_iarchive InputArchive(ibuffer);
67 LOG(INFO) <<
"Conversion Method: " << *
fDigiPar;
68 LOG(INFO) <<
"Tot Info: " << *
fTotPar;
69 if (pixelMapping == 0){
75 if (fBurstData.fData.size() < 1)
continue;
76 LOG(INFO) <<
"BurstData size: " << fBurstData.fData[0].size();
77 for (
auto dataItr : fBurstData.fData[0])
78 LOG(INFO) << dataItr->GetTimeStamp();
81 std::vector<FairTimeStamp*> sortedData = mapSorter.
GetOutputData();
86 std::vector<std::vector<FairTimeStamp*> > gapData = eventBuilder.
GetSeparatedData();
87 if (fBurstData.fHeader.fBranchName ==
"MVDPixelDigis"){
88 for (
auto gapIter : gapData){
89 std::vector<PndSdsDigiPixel*> digiPixel;
90 if (gapIter.size() > 1){
91 LOG(INFO) <<
"GapSize > 1 " << gapIter.size();
92 for (
auto dataIter : gapIter){
96 std::vector<std::vector< Int_t> > clusterInts = clusterFinder.
GetClusters(digiPixel);
97 for (
auto clusterIter : clusterInts)
99 LOG(INFO) <<
"ClusterSize: " << clusterIter.size();
100 std::vector<PndSdsDigiPixel*> digiInCluster;
101 for (
auto digiInClusterItr : clusterIter){
102 int pos = digiInClusterItr;
103 digiInCluster.push_back(digiPixel[pos]);
105 if (digiInCluster.size() > 0){
107 digiInCluster.clear();
108 LOG(INFO) <<
"Hit: " <<
hit;
120 if (pixelMapping != 0)
128 LOG(ERROR) <<
" Boost Serialization not ok";
133 for (
int iparC = 0 ; iparC <
fParCList->GetEntries() ; iparC++ ) {
134 FairParGenericSet* tempObj = (FairParGenericSet*)(
fParCList->At(iparC));
141 std::string paramName = thisPar->GetName();
143 std::string* reqStr =
new std::string(paramName +
"," + std::to_string(
fCurrentRunId));
144 LOG(WARN) <<
"Requesting parameter \"" << paramName <<
"\" for Run ID " <<
fCurrentRunId <<
" (" << thisPar <<
")";
145 std::unique_ptr<FairMQMessage> req(NewMessage(const_cast<char*>(reqStr->c_str()), reqStr->length(),
CustomCleanup, reqStr));
146 std::unique_ptr<FairMQMessage> rep(NewMessage());
148 if (Send(req,
"param") > 0)
150 if (Receive(rep,
"param") > 0)
152 TMessage2 tm(rep->GetData(), rep->GetSize());
153 thisPar = (FairParGenericSet*)tm.ReadObject(tm.GetClass());
154 LOG(WARN) <<
"Received parameter"<< paramName <<
" from the server (" << thisPar <<
")" << tm.GetClass()->GetName() <<
" DataSize: " << rep->GetSize();
void FillData(std::vector< PndSdsDigiTopix4 > data)
PndSdsTotDigiPar * fTotPar
Charge Digitization Parameter Class for SDS.
PndSdsHit GetCluster(std::vector< PndSdsDigiPixel * > &pixelArray)
Main function of class to calculate the PndSdsHit out of the given PndSdsDigis.
TMessage2(void *buf, Int_t len)
PndSensorNamePar * fSensorPar
Class to access the naming information of the MVD.
PndSdsPixelDigiPar * fDigiPar
bool fHasBoostSerialization
std::vector< std::vector< Int_t > > GetClusters(std::vector< PndSdsDigiPixel * > &hits)
PndSdsChargedWeightedPixelMapping: Gets a vector of DigiHits and calculates the cluster center weight...
std::vector< std::vector< PndSdsDigiTopix4 > > GetSeparatedData()
virtual void AddElements(std::vector< FairTimeStamp * > dataArray)
static void CustomCleanup(void *data, void *hint)
virtual void WriteOutAll()
virtual std::vector< FairTimeStamp * > GetOutputData()
Data class to store the digi output of a pixel module.
FairParGenericSet * UpdateParameter(FairParGenericSet *thisPar)
Unique match between SensorID and path in TGeoManager.
Digitization Parameter Class for SDS-Pixel part.