Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions DataFormats/Detectors/FIT/common/src/DataFormatsFITLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
// TODO AM: Set this here when unused class warning is solved.
// #pragma link C++ class std::unordered_map < o2::dcs::DataPointIdentifier, o2::fit::DCSDPValues> + ;

#pragma link C++ class std::unordered_map < std::string, o2::fit::DCSDPValues> + ;

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class FITDCSDataReader
uint64_t processFlags(uint64_t flag, const char* pid);
void updateCcdbObjectInfo();

const std::unordered_map<DPID, DCSDPValues>& getDpData() const;
const std::unordered_map<std::string, DCSDPValues>& getDpData() const;
void resetDpData();
const std::string& getCcdbPath() const;
void setCcdbPath(const std::string& ccdbPath);
Expand All @@ -68,7 +68,7 @@ class FITDCSDataReader
void setVerboseMode(bool verboseMode = true);

private:
std::unordered_map<DPID, o2::fit::DCSDPValues> mDpData; // the object that will go to the CCDB
std::unordered_map<std::string, o2::fit::DCSDPValues> mDpData; // the object that will go to the CCDB
std::unordered_map<DPID, bool> mPids; // contains all PIDs for the processor, the bool
// will be true if the DP was processed at least once
std::unordered_map<DPID, DPVAL> mDpsMap; // this is the map that will hold the DPs
Expand Down
13 changes: 7 additions & 6 deletions Detectors/FIT/common/dcsmonitoring/src/FITDCSDataReader.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void FITDCSDataReader::init(const std::vector<DPID>& pids)
// Fill the array of sub-detector specific DPIDs that will be processed
for (const auto& it : pids) {
mPids[it] = false;
mDpData[it].makeEmpty();
mDpData[it.get_alias()].makeEmpty();
}
}

Expand Down Expand Up @@ -85,6 +85,7 @@ int FITDCSDataReader::processDP(const DPCOM& dpcom)
{
// Processing a single DP
const auto& dpid = dpcom.id;
const auto& dpAlias = dpid.get_alias();
const auto& type = dpid.get_type();
const auto& val = dpcom.data;

Expand All @@ -99,12 +100,12 @@ int FITDCSDataReader::processDP(const DPCOM& dpcom)
auto flags = val.get_flags();
if (processFlags(flags, dpid.get_alias()) == 0) {
// Store all DP values
if (mDpData[dpid].values.empty() || val.get_epoch_time() > mDpData[dpid].values.back().first) {
if (mDpData[dpAlias].values.empty() || val.get_epoch_time() > mDpData[dpAlias].values.back().first) {
dpValueConverter.raw_data = val.payload_pt1;
if (type == DPVAL_DOUBLE) {
mDpData[dpid].add(val.get_epoch_time(), lround(dpValueConverter.double_value * 1000)); // store as nA
mDpData[dpAlias].add(val.get_epoch_time(), lround(dpValueConverter.double_value * 1000)); // store as nA
} else if (type == DPVAL_UINT) {
mDpData[dpid].add(val.get_epoch_time(), dpValueConverter.uint_value);
mDpData[dpAlias].add(val.get_epoch_time(), dpValueConverter.uint_value);
}
}
}
Expand Down Expand Up @@ -176,7 +177,7 @@ void FITDCSDataReader::updateCcdbObjectInfo()
// if (dp.second.values.empty()) {
// continue;
// }
LOG(info) << "PID = " << dp.first.get_alias();
LOG(info) << "DP = " << dp.first;
dp.second.print();
}
}
Expand All @@ -187,7 +188,7 @@ void FITDCSDataReader::updateCcdbObjectInfo()
return;
}

const std::unordered_map<DPID, DCSDPValues>& FITDCSDataReader::getDpData() const { return mDpData; }
const std::unordered_map<std::string, DCSDPValues>& FITDCSDataReader::getDpData() const { return mDpData; }

void FITDCSDataReader::resetDpData()
{
Expand Down