23using DPMAP2 = std::unordered_map<std::string, std::map<uint64_t, double>>;
32 converter.raw_data =
v.payload_pt1;
33 return converter.value;
43 for (
const auto& [dpId, dpsHV] : dpMap) {
44 std::string alias = dpId.get_alias();
47 auto& dps2 = dpsMapPerAlias[alias];
50 dps2.emplace(timeMargin,
dpConverter(dpsHV.front()));
52 for (
const auto&
value : dpsHV) {
57 dps2.emplace(std::numeric_limits<uint64_t>::max() - timeMargin,
dpConverter(dpsHV.back()));
61 return dpsMapPerAlias;
70 mBadHVTimeRanges.clear();
79 for (
const auto& [alias, dpsHV] : dpsMapPerAlias) {
83 std::vector<TimeRange> hvIssuesList{};
86 bool ongoingIssue =
false;
88 for (
auto [timestamp, valueHV] : dpsHV) {
89 if (valueHV < chamberThreshold) {
100 if (tStop - tStart > minDuration) {
101 hvIssuesList.emplace_back(tStart - timeMargin, tStop + timeMargin);
103 ongoingIssue =
false;
109 if (ongoingIssue && tStop - tStart > minDuration) {
110 hvIssuesList.emplace_back(tStart - timeMargin, tStop + timeMargin);
114 if (!hvIssuesList.empty()) {
115 mBadHVTimeRanges.emplace(alias, hvIssuesList);
123 std::set<std::string> currentBadHVs{};
124 for (
const auto& [alias, timeRanges] : mBadHVTimeRanges) {
125 auto it = std::find_if(timeRanges.begin(), timeRanges.end(),
126 [timestamp](
const TimeRange&
r) { return r.contains(timestamp); });
127 if (it != timeRanges.end()) {
128 currentBadHVs.emplace(alias);
133 if (currentBadHVs != mCurrentBadHVs) {
134 mCurrentBadHVs.swap(currentBadHVs);
143 for (
const auto& alias : mCurrentBadHVs) {
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
double dpConverter(o2::dcs::DataPointValue v)
Converts DCS data point value to double HV value.
DPMAP2 decodeDPMAP(const o2::mch::HVStatusCreator::DPMAP &dpMap)
Decode the DCS DPMAP to be processed for HV issues.
static const StatusMapCreatorParam & Instance()
void findBadHVs(const DPMAP &dpMap)
std::unordered_map< DPID, std::vector< DPVAL > > DPMAP
bool findCurrentBadHVs(uint64_t timestamp)
void updateStatusMap(StatusMap &statusMap) const
void addDS(DsIndex badDS, uint32_t mask)
void addDE(uint16_t badDE, uint32_t mask)
GLsizei const GLfloat * value
std::set< DsIndex > aliasToDsIndices(std::string_view alias)
int toInt(Chamber chamber)
Chamber aliasToChamber(std::string_view alias)
std::optional< int > aliasToDetElemId(std::string_view dcsAlias)
bool isValid(std::string_view dcsAlias)
std::map< std::string, std::map< uint64_t, double > > DPMAP2
Internal structure to define a time range.