11 ATH_MSG_DEBUG(
"calling the constructor of ZdcLEDMonitorAlgorithm");
38 std::vector<std::string>
sides = {
"C",
"A"};
39 std::vector<std::string> modules = {
"0",
"1",
"2",
"3"};
40 std::vector<std::string>
channels = {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15"};
72 std::array<float, m_nDecodingErrorBits> decodingErrorBitsArr = {0, 0, 0};
73 if (!zdcDecodingError && !rpdDecodingError){
74 decodingErrorBitsArr[0] += 1;
75 }
else if (zdcDecodingError){
77 decodingErrorBitsArr[1] += 1;
80 decodingErrorBitsArr[2] += 1;
84 fill(
"ZdcLEDAllEventsDiagnosis", decodingErrorBits,
lumiBlock);
87 ATH_MSG_WARNING(
"Neither ZDC nor RPD are enabled! Quit LED histogram filling!");
90 if (zdcDecodingError && rpdDecodingError){
91 ATH_MSG_WARNING(
"Both ZDC and RPD have decoding errors! Quit LED histogram filling!");
100 if (!robBCIDHandle.isValid())
return StatusCode::FAILURE;
105 for (
const auto zdcSum : *zdcSums) {
106 if (zdcSum->zdcSide() == 0){
107 moduleSumEventInfo_ptr = zdcSum;
111 const std::vector<uint16_t>& robBCIDvec = robBCIDHandle(*moduleSumEventInfo_ptr);
112 if (robBCIDHandle->size() == 0)
return StatusCode::FAILURE;
114 unsigned int checkBCID = robBCIDvec[0];
115 for (
unsigned int bcid : robBCIDvec) {
116 if (
bcid != checkBCID) {
117 ATH_MSG_ERROR(
"Inconsistent BCIDs in rob header, cannot continue in standalone mode");
118 return StatusCode::FAILURE;
129 unsigned int iLEDType = 1000;
130 std::string led_type_str;
134 return StatusCode::SUCCESS;
139 for (
const auto zdcSum : *zdcSums) {
140 if (zdcSum->zdcSide() == 0){
141 iLEDType = zdcLEDTypeHandle(*zdcSum);
146 if (iLEDType == 1000){
148 return StatusCode::SUCCESS;
151 ATH_MSG_WARNING(
"The retrieved LED type is incorrect (larger than 2)!");
152 return StatusCode::SUCCESS;
183 return StatusCode::SUCCESS;
188 return StatusCode::SUCCESS;
191 for (
const auto zdcMod : *zdcModules){
192 int iside = (zdcMod->zdcSide() > 0)? 1 : 0;
193 std::string side_str = (iside == 0)?
"C" :
"A";
195 if (zdcMod->zdcType() == 0){
196 int imod = zdcMod->zdcModule();
199 zdcLEDADCSum = LEDADCSumHandle(*zdcMod);
200 zdcLEDMaxADC = LEDMaxADCHandle(*zdcMod);
201 zdcLEDMaxSample = LEDMaxSampleHandle(*zdcMod);
202 zdcLEDAvgTime = LEDAvgTimeHandle(*zdcMod);
204 zdcLEDMaxADCtoADCSumRatio = (zdcLEDADCSum == 0)? -1000. : zdcLEDMaxADC * 1. / zdcLEDADCSum;
208 else if (zdcMod->zdcType() == 1) {
209 int ichannel = zdcMod->zdcChannel();
213 ATH_MSG_WARNING(
"The current channel number exceeds the zero-based limit (15): it is " << ichannel);
216 rpdLEDADCSum = LEDADCSumHandle(*zdcMod);
217 rpdLEDMaxADC = LEDMaxADCHandle(*zdcMod);
218 rpdLEDMaxSample = LEDMaxSampleHandle(*zdcMod);
219 rpdLEDAvgTime = LEDAvgTimeHandle(*zdcMod);
221 rpdLEDMaxADCtoADCSumRatio = (rpdLEDADCSum == 0)? -1000. : rpdLEDMaxADC * 1. / rpdLEDADCSum;
227 return StatusCode::SUCCESS;
238 return StatusCode::SUCCESS;
259 return StatusCode::SUCCESS;
261 for (
const auto zdcSum : *zdcSums) {
262 if (zdcSum->zdcSide() == 0){
264 ATH_MSG_WARNING(
"The global sum entry in zdc sum container can be retrieved; but it does NOT have the variable eventType written as a decoration!");
265 return StatusCode::SUCCESS;
269 ATH_MSG_WARNING(
"The global sum entry in zdc sum container can be retrieved; but it does NOT have the variable DAQMode written as a decoration!");
270 return StatusCode::SUCCESS;
273 eventType = eventTypeHandle(*zdcSum);
274 DAQMode = DAQModeHandle(*zdcSum);
281 ATH_MSG_WARNING(
"The zdc sum container can be retrieved from the evtStore() but");
282 ATH_MSG_WARNING(
"Either the event type or the DAQ mode is the default unknown value");
283 ATH_MSG_WARNING(
"Most likely, there is no global sum (side == 0) entry in the zdc sum container");
284 return StatusCode::SUCCESS;
292 return StatusCode::SUCCESS;