44 for (
const auto& rosToRobPair :
data.costROSData().getROStoROBMap()) {
45 int binForROS =
data.costROSData().getBinForROS(rosToRobPair.first) + 1;
47 ATH_CHECK(
getVariable(
"NetworkROSRequests_perEvent").setBinLabel(binForROS, rosToRobPair.first));
48 ATH_CHECK(
getVariable(
"ROBRequestsPerROS_perEvent").setBinLabel(binForROS, rosToRobPair.first));
49 ATH_CHECK(
getVariable(
"ROBRequestsPerROSPerEvent_perEvent").setBinLabel(binForROS, rosToRobPair.first));
54 for (
const std::string& group :
data.seededChains()[
index].groups){
63 if (
data.seededChains()[
index].isPassRaw){
68 if (!
data.chainToAlgMap().count(
getName()))
return StatusCode::SUCCESS;
70 std::map<std::string, int> nRosPerEvent;
71 std::map<std::string, int> nNetworkRosPerEvent;
72 std::map<std::string, int> nRobsPerRosPerEvent;
73 for (
const size_t algIndex :
data.chainToAlgMap().at(
getName())){
75 const uint32_t slot = alg->getDetail<uint32_t>(
"slot");
76 if (slot !=
data.onlineSlot()) {
82 const uint64_t start = alg->getDetail<uint64_t>(
"start");
83 const uint64_t stop = alg->getDetail<uint64_t>(
"stop");
89 if (!
data.algToRequestMap().count(algIndex))
continue;
91 for (
size_t requestIdx :
data.algToRequestMap().at(algIndex)) {
93 const std::vector<uint32_t> robIdsPerRequest = request->
getDetail<std::vector<uint32_t>>(
"robs_id");
94 const std::vector<unsigned> robs_history = request->
getDetail<std::vector<unsigned>>(
"robs_history");
95 const std::vector<uint32_t> robs_size = request->
getDetail<std::vector<uint32_t>>(
"robs_size");
97 std::map<std::string, int> nRobsPerRosPerRequest;
99 bool networkRequestIncremented =
false;
100 std::set<std::string> requestedROSes;
101 std::set<std::string> requestedNetworkROSes;
102 for (
size_t i = 0; i < robs_size.size(); ++i) {
106 ATH_CHECK(
fill(
"NetworkROBSize_perEvent", robs_size[i] / 500., weight) );
107 networkRequestIncremented =
true;
111 ATH_CHECK(
fill(
"CachedROBSize_perEvent", robs_size[i] / 500., weight) );
114 uint32_t robId = robIdsPerRequest[i];
116 std::string rosForROB =
data.costROSData().getROSForROB(robId);
117 if (!rosForROB.empty()){
118 requestedROSes.insert(rosForROB);
119 nRobsPerRosPerRequest[rosForROB] += 1;
120 nRobsPerRosPerEvent[rosForROB] += 1;
123 requestedNetworkROSes.insert(std::move(rosForROB));
130 for (
const auto& robPerRosPair : nRobsPerRosPerRequest) {
131 ATH_CHECK(
fill(
"ROBRequestsPerROS_perEvent",
data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
135 for (
const std::string& rosName : requestedROSes){
136 nRosPerEvent[rosName] += 1;
139 for (
const std::string& rosName : requestedNetworkROSes){
140 nNetworkRosPerEvent[rosName] += 1;
145 if (networkRequestIncremented) {
155 for (
const auto& robPerRosPair : nRosPerEvent) {
156 ATH_CHECK(
fill(
"ROSRequests_perEvent",
data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
159 for (
const auto& robPerRosPair : nNetworkRosPerEvent) {
160 ATH_CHECK(
fill(
"NetworkROSRequests_perEvent",
data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
164 for (
const auto& robPerRosPair : nRobsPerRosPerEvent) {
165 ATH_CHECK(
fill(
"ROBRequestsPerROSPerEvent_perEvent",
data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
169 if (!
data.chainToUniqAlgMap().count(
getName()))
return StatusCode::SUCCESS;
171 for (
const size_t algIndex :
data.chainToUniqAlgMap().at(
getName())){
173 const uint32_t slot = alg->getDetail<uint32_t>(
"slot");
174 if (slot !=
data.onlineSlot()) {
177 const uint64_t start = alg->getDetail<uint64_t>(
"start");
178 const uint64_t stop = alg->getDetail<uint64_t>(
"stop");
184 return StatusCode::SUCCESS;
void regTProfile(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 TProfile for this Counter, to be filled in per-event monitoring.
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.