36 const std::vector<uint32_t> robIdsPerRequest =
tc->getDetail<std::vector<uint32_t>>(
"robs_id");
37 const std::vector<uint32_t> robs_size =
tc->getDetail<std::vector<uint32_t>>(
"robs_size");
38 const std::vector<unsigned> robs_history =
tc->getDetail<std::vector<unsigned>>(
"robs_history");
39 const std::vector<unsigned short> robs_status =
tc->getDetail<std::vector<unsigned short>>(
"robs_status");
54 unsigned robCounter = 0;
55 for (uint32_t robId :
data.costROSData().getROBForROS(
getName())) {
56 std::string robName =
data.costROSData().getROBName(robId);
67 bool networkRequestIncremented =
false;
68 int nRequestedRobs = 0;
69 for (
size_t i = 0; i < robIdsPerRequest.size(); ++i) {
72 if (
data.costROSData().getROSForROB(robIdsPerRequest[i]) !=
getName() )
continue;
77 if (robs_status[i] ==
false ) {
85 ATH_CHECK(
fill(
"NetworkROBSize_perEvent", robs_size[i] / 500., weight) );
86 networkRequestIncremented =
true;
89 ATH_CHECK(
fill(
"CachedROBSize_perEvent", robs_size[i] / 500., weight) );
100 ATH_CHECK(
fill(
"NROBsPerRequest_perCall", nRequestedRobs, weight) );
104 if (networkRequestIncremented) {
108 const float rosTime =
timeToMilliSec(
tc->getDetail<uint64_t>(
"start"),
tc->getDetail<uint64_t>(
"stop"));
111 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
char data[hepevt_bytes_allocation_ATLAS]
@ kPerEvent
Variable should buffer fill calls in an accumulator and fill the underlying histogram once at the end...
@ kPerCall
Variable should fill underlying histogram on each fill.
@ kLinear
Linear x-binning.
Caches and propagates event data to be used by monitoring algorithms.
StatusCode fill(const std::string &name, float value, float weight=1.0)
Fill (for per-Call) or accumulate in a buffer (for per-Event) a quantity histogrammed by a named Vari...
float timeToMilliSec(const uint64_t start, const uint64_t stop) const
Helper function.
CounterBase()=delete
Forbid default constructor.
void regHistogram(const std::string &name, const std::string &title, const VariableType type=VariableType::kPerCall, const LogType xaxis=kLog, const float min=0.1, const float max=1000000., const size_t bins=70)
Book a histogram for this Counter, to be filled in per-event monitoring.
const std::string & getName() const
Getter for Counter's name.
bool variableExists(const std::string &name) const
Check if a variable of a given name exists.
Variable & getVariable(const std::string &name)
Returns a mutable reference to a named Variable.
StatusCode increment(const std::string &name, float weight=1.0)
Convenience function.
int getROBHistoryBin(const unsigned history)
Get histogram bin for ROBHistory enum values.
CounterROS()=delete
Forbid default constructor.
virtual StatusCode newEvent(const CostData &data, size_t index, const float weight=1.) override
Concrete implementation.
std::map< uint32_t, unsigned > m_robIdToBin
Cached mapping of rob id to bin in ROBsPerRequest_perEvent histogram.
TrigComposite_v1 TrigComposite
Declare the latest version of the class.