Concrete implimentation.
Monitores chain at specified index. Expected to match this instances name().
39 {
40
42
44
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));
51 }
52
53
55 for (
const std::string& group :
data.seededChains()[index].groups){
59 }
60
62 }
63
64 if (
data.seededChains()[index].isPassRaw){
66 }
67
68
69 if (!
data.chainToAlgMap().count(
getName()))
return StatusCode::SUCCESS;
70
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())){
80 if (slot !=
data.onlineSlot()) {
81 continue;
82 }
83
85
91
92
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);
102
103 std::map<std::string, int> nRobsPerRosPerRequest;
104
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) {
109
111
112 ATH_CHECK(
fill(
"NetworkROBSize_perEvent", robs_size[i] / 500., weight) );
113 networkRequestIncremented = true;
114 }
115
117 ATH_CHECK(
fill(
"CachedROBSize_perEvent", robs_size[i] / 500., weight) );
118 }
119
122 std::string rosForROB =
data.costROSData().getROSForROB(robId);
123 if (!rosForROB.empty()){
124 requestedROSes.insert(rosForROB);
125 nRobsPerRosPerRequest[rosForROB] += 1;
126 nRobsPerRosPerEvent[rosForROB] += 1;
127
129 requestedNetworkROSes.insert(std::move(rosForROB));
130 }
131 }
132 }
133 }
134
135
136 for (const auto& robPerRosPair : nRobsPerRosPerRequest) {
137 ATH_CHECK(
fill(
"ROBRequestsPerROS_perEvent",
data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
138 }
139
140
141 for (const std::string& rosName : requestedROSes){
142 nRosPerEvent[rosName] += 1;
143 }
144
145 for (const std::string& rosName : requestedNetworkROSes){
146 nNetworkRosPerEvent[rosName] += 1;
147 }
148
150
151 if (networkRequestIncremented) {
153 }
154
157 }
158 }
159
160
161 for (const auto& robPerRosPair : nRosPerEvent) {
162 ATH_CHECK(
fill(
"ROSRequests_perEvent",
data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
163 }
164
165 for (const auto& robPerRosPair : nNetworkRosPerEvent) {
166 ATH_CHECK(
fill(
"NetworkROSRequests_perEvent",
data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
167 }
168
169
170 for (const auto& robPerRosPair : nRobsPerRosPerEvent) {
171 ATH_CHECK(
fill(
"ROBRequestsPerROSPerEvent_perEvent",
data.costROSData().getBinForROS(robPerRosPair.first), robPerRosPair.second, weight) );
172 }
173
174
175 if (!
data.chainToUniqAlgMap().count(
getName()))
return StatusCode::SUCCESS;
176
177 for (
const size_t algIndex :
data.chainToUniqAlgMap().at(
getName())){
180 if (slot !=
data.onlineSlot()) {
181 continue;
182 }
186
188 }
189
190 return StatusCode::SUCCESS;
191}
float timeToMilliSec(const uint64_t start, const uint64_t stop) const
Helper function.
StatusCode increment(std::string_view name, float weight=1.0)
Convenience function.
bool variableExists(const std::string &name) const
Check if a variable of a given name exists.
Variable & getVariable(std::string_view name)
Returns a mutable reference to a named Variable.
bool getDetail(const std::string &name, TYPE &value) const
Get an TYPE detail from the object.
TrigComposite_v1 TrigComposite
Declare the latest version of the class.