Bug #1351
Data structure issue in V1724
Status:
Closed
Priority:
Normal
Assignee:
Category:
RealData
Target version:
Start date:
04 October 2013
Due date:
% Done:
100%
Estimated time:
Workflow:
New Issue
Description
We had a DataStructure error in the control room running today. Looks like tofcalib reducer was failing with log file as attached. I believe the error is in file src/input/InputCppDAQData/UnpackEventLib.cc
function int V1724DataProcessor::Process(MDdataContainer* aPartEventPtr)
int V1724DataProcessor::Process(MDdataContainer* aPartEventPtr) { // Cast the argument to structure it points to. // This process should be called only with MDfragmentV1724 argument. if ( typeid(*aPartEventPtr) != typeid(MDpartEventV1724) ) return CastError; MDpartEventV1724* xV1724Evnt = static_cast<MDpartEventV1724*>(aPartEventPtr); Json::Value pBoardDoc; Json::Value xfAdcHit; int xLdc, xGeo, xEquip, xPartEv; string xDetector = "unknown"; if ( !xV1724Evnt->IsValid() ) return GenericError; // Put static data into the Json pBoardDoc["ldc_id"] = xLdc = this->GetLdcId(); pBoardDoc["equip_type"] = xEquip = this->GetEquipmentType(); pBoardDoc["time_stamp"] = this->GetTimeStamp(); pBoardDoc["phys_event_number"] = this->GetPhysEventNumber(); pBoardDoc["part_event_number"] = xPartEv = this->GetPartEventNumber(); pBoardDoc["geo"] = xGeo = xV1724Evnt->GetGeo(); pBoardDoc["trigger_time_tag"] = xV1724Evnt->GetTriggerTimeTag(); // Loop over all the channels for (unsigned int xCh = 0; xCh < V1724_NCHANNELS; xCh++) { unsigned int xSamples = ( xV1724Evnt->GetLength(xCh) )*V1724_SAMPLES_PER_WORD; for (unsigned int j = 0; j < xSamples; j++) { int sample = xV1724Evnt->GetSampleData(xCh, // Channel ID j); // Sample ID _data.push_back(sample); } xfAdcHit = pBoardDoc; this->set_pedestal(); int charge_mm = this->get_charge(ceaMinMax); if ( !_zero_suppression || (_zero_suppression && charge_mm > _zs_threshold) ) { xfAdcHit["charge_mm"] = charge_mm; xfAdcHit["charge_pm"] = this->get_charge(ceaPedMax); xfAdcHit["position_max"] = this->get_max_position(); xfAdcHit["pedestal"] = this->get_pedestal(); DAQChannelKey* xKey = _chMap->find(xLdc, xGeo, xCh, xEquip); if (xKey) { xDetector = xKey->detector(); xfAdcHit["channel_key"] = xKey->str(); xfAdcHit["detector"] = xDetector; } else { xfAdcHit["detector"] = xDetector = "unknown"; } xfAdcHit["channel"] = xCh; ( *_docSpill )[xDetector][ xPartEv ][_equipment].append(xfAdcHit); } _data.resize(0); } return OK; }
When the "detector" is "unknown", "channel_key" is not set and I believe this is causing the problem. I notice this is also a problem in some of the other DataProcessors. Propose to fix that we make an empty branch "channel_key" = "" when detector is unknown.
Files
Related issues