45 for (
const auto& rosToRobPair : data.costROSData().getROStoROBMap()) {
46 int binForROS = data.costROSData().getBinForROS(rosToRobPair.first) + 1;
48 ATH_CHECK(
getVariable(
"NetworkROSRequests_perEvent").setBinLabel(binForROS, rosToRobPair.first));
49 ATH_CHECK(
getVariable(
"ROBRequestsPerROS_perEvent").setBinLabel(binForROS, rosToRobPair.first));
50 ATH_CHECK(
getVariable(
"ROBRequestsPerROSPerEvent_perEvent").setBinLabel(binForROS, rosToRobPair.first));
55 for (
const std::string& group : data.seededChains()[
index].groups){
64 if (data.seededChains()[
index].isPassRaw){
69 if (!data.chainToAlgMap().count(
getName()))
return StatusCode::SUCCESS;
71 std::map<std::string, int> nRosPerEvent;
72 std::map<std::string, int> nNetworkRosPerEvent;
73 std::map<std::string, int> nRobsPerRosPerEvent;
74 const std::string slotStr{
"slot"};
75 const std::string startStr{
"start"};
76 const std::string stopStr{
"stop"};
77 for (
const size_t algIndex : data.chainToAlgMap().at(
getName())){
79 const uint32_t slot = alg->getDetail<uint32_t>(slotStr);
80 if (slot != data.onlineSlot()) {
86 const uint64_t start = alg->getDetail<uint64_t>(startStr);
87 const uint64_t stop = alg->getDetail<uint64_t>(stopStr);
93 if (!data.algToRequestMap().count(algIndex))
continue;
94 static const std::string idStr{
"robs_id"};
95 static const std::string historyStr{
"robs_history"};
96 static const std::string sizeStr{
"robs_size"};
97 for (
size_t requestIdx : data.algToRequestMap().at(algIndex)) {
99 const std::vector<uint32_t> robIdsPerRequest = request->
getDetail<std::vector<uint32_t>>(idStr);
100 const std::vector<unsigned> robs_history = request->
getDetail<std::vector<unsigned>>(historyStr);
101 const std::vector<uint32_t> robs_size = request->
getDetail<std::vector<uint32_t>>(sizeStr);
103 std::map<std::string, int> nRobsPerRosPerRequest;
105 bool networkRequestIncremented =
false;
106 std::set<std::string> requestedROSes;
107 std::set<std::string> requestedNetworkROSes;
108 for (
size_t i = 0; i < robs_size.size(); ++i) {
112 ATH_CHECK(
fill(
"NetworkROBSize_perEvent", robs_size[i] / 500., weight) );
113 networkRequestIncremented =
true;
117 ATH_CHECK(
fill(
"CachedROBSize_perEvent", robs_size[i] / 500., weight) );
120 uint32_t robId = robIdsPerRequest[i];
122 std::string rosForROB = data.costROSData().getROSForROB(robId);
123 if (!rosForROB.empty()){
124 requestedROSes.insert(rosForROB);
125 nRobsPerRosPerRequest[rosForROB] += 1;
126 nRobsPerRosPerEvent[rosForROB] += 1;
129 requestedNetworkROSes.insert(std::move(rosForROB));
136 for (
const auto& robPerRosPair : nRobsPerRosPerRequest) {
137 ATH_CHECK(
fill(
"ROBRequestsPerROS_perEvent", data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
141 for (
const std::string& rosName : requestedROSes){
142 nRosPerEvent[rosName] += 1;
145 for (
const std::string& rosName : requestedNetworkROSes){
146 nNetworkRosPerEvent[rosName] += 1;
151 if (networkRequestIncremented) {
161 for (
const auto& robPerRosPair : nRosPerEvent) {
162 ATH_CHECK(
fill(
"ROSRequests_perEvent", data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
165 for (
const auto& robPerRosPair : nNetworkRosPerEvent) {
166 ATH_CHECK(
fill(
"NetworkROSRequests_perEvent", data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
170 for (
const auto& robPerRosPair : nRobsPerRosPerEvent) {
171 ATH_CHECK(
fill(
"ROBRequestsPerROSPerEvent_perEvent", data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
175 if (!data.chainToUniqAlgMap().count(
getName()))
return StatusCode::SUCCESS;
177 for (
const size_t algIndex : data.chainToUniqAlgMap().at(
getName())){
179 const uint32_t slot = alg->getDetail<uint32_t>(slotStr);
180 if (slot != data.onlineSlot()) {
183 const uint64_t start = alg->getDetail<uint64_t>(startStr);
184 const uint64_t stop = alg->getDetail<uint64_t>(stopStr);
190 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.