RatesAnalysis: Handle keys change in unprescaling online rates
For given lumiblocks range, the script will read all possible combinations of HLT and L1 prescale sets keys. Then it will iterate through possible ranges, load the prescales sets and query data for the keys ranges based on timestamp.
To implement this case, a new helper class was added RateEntry
that for every chain/item/group will store the sum of all rates (new pair of rates can be added to the sum by appendRate
function) and the counter to calculate the average value in the end.
Additional validation was added: checking if the rate if > 0 for a disabled item, checking if the retrieved data is really in the requested region , and limiting the keys combination range only to the requested lumiblocks range.
The script will also use the RunLumi
objects to read the data from COOL for a given lumiblock and run number.
Also, if the average rate retrieved from TRP is 0, it won't be included in total average (the average rate value won't be the same as in grafana dashboard).
Tagging @tamartin