ATLAS Offline Software
ZdcMonitorAlgorithm.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 
10 ZdcMonitorAlgorithm::ZdcMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
11 :AthMonitorAlgorithm(name,pSvcLocator){
12  ATH_MSG_DEBUG("calling the constructor of ZdcMonitorAlgorithm");
13 }
14 
15 
17 
18 
19 void ZdcMonitorAlgorithm::calculate_log_bin_edges(float min_value, float max_value, int num_bins, std::vector<float>& bin_edges) {
20  // Clear the vector to ensure it's empty
21  bin_edges.clear();
22 
23  // Calculate the logarithmic bin edges
24  float log_min = std::log10(min_value);
25  float log_max = std::log10(max_value);
26 
27  // Linear space between log_min and log_max with num_bins+1 points
28  float step = (log_max - log_min) / num_bins;
29 
30  // Populate the vector with the bin edges
31  for (int i = 0; i <= num_bins; ++i) {
32  float edge = log_min + i * step;
33  bin_edges.push_back(std::pow(10, edge));
34  }
35 }
36 
37 
38 float ZdcMonitorAlgorithm::calculate_inverse_bin_width(float event_value, std::string variable_name, const std::vector<float>& bin_edges) const {
39  // Check if the event_value is out of range
40  if (event_value < bin_edges.front() || event_value > bin_edges.back()) { // changed output level to debug: this is not uncommon
41  ATH_MSG_DEBUG("In calculation of inverse-bin-width event weight for the variable " << variable_name << ", the current event value " << event_value << " is out of the bin range.");
42  ATH_MSG_DEBUG("Assign zero weight for the current event (event not filled).");
43  return 0.0; // event weight is zero
44  }
45 
46  // Find the bin in which event_value falls
47  for (size_t i = 0; i < bin_edges.size() - 1; ++i) {
48  if (event_value >= bin_edges[i] && event_value < bin_edges[i + 1]) {
49  float bin_width = bin_edges[i + 1] - bin_edges[i];
50  if (bin_width != 0) {
51  return 1.0f / bin_width; // Return the inverse of bin width
52  } else {
53  ATH_MSG_WARNING("Warning: in calculation of inverse-bin-width event weight for the variable " << variable_name << ", bin width containing the event value " << event_value << " is zero.");
54  ATH_MSG_WARNING("Assign zero weight for the current event (event not filled).");
55  return 0.0; // event weight is zero
56  }
57  }
58  }
59 
60  // Handle edge case where event_value == bin_edges.back()
61  if (event_value == bin_edges.back()) {
62  size_t last_bin_index = bin_edges.size() - 2;
63  float bin_width = bin_edges[last_bin_index + 1] - bin_edges[last_bin_index];
64  return 1.0 / bin_width;
65  }
66 
67  // If no bin is found (should not reach here)
68  ATH_MSG_WARNING("Warning: in calculation of inverse-bin-width event weight for the variable " << variable_name << ", no valid bin found for the event value " << event_value << ".");
69  ATH_MSG_WARNING("Assign zero weight for the current event (event not filled).");
70  return 0.0; // event weight is zero
71 }
72 
73 
75 
76  ATH_MSG_DEBUG("initializing for the monitoring algorithm");
77  ATH_MSG_DEBUG("Is online? " << m_isOnline);
78  ATH_MSG_DEBUG("Is calorimeter info turned on? " << m_CalInfoOn);
79  ATH_MSG_DEBUG("Is trigger info turned on? " << m_enableTrigger);
80  ATH_MSG_DEBUG("Is injected pulse? " << m_isInjectedPulse);
81  ATH_MSG_DEBUG("Is Standalone? " << m_isStandalone);
82  ATH_MSG_DEBUG("Enable ZDC? " << m_enableZDC);
83  ATH_MSG_DEBUG("Enable ZDC Physics? " << m_enableZDCPhysics);
84  ATH_MSG_DEBUG("Enable RPD Amp? " << m_enableRPDAmp);
85  ATH_MSG_DEBUG("Enable Centroid? " << m_enableCentroid);
86 
87  using namespace Monitored;
88  ATH_CHECK( m_ZdcSumContainerKey.initialize() );
89  ATH_CHECK( m_ZdcModuleContainerKey.initialize() );
91 
92  ATH_CHECK( m_eventTypeKey.initialize() );
93  // ATH_CHECK( m_ZdcBCIDKey.initialize() );
94  ATH_CHECK( m_DAQModeKey.initialize() );
95 
100 
109 
114 
122 
131 
132  // calculate log binnings
135 
136  // read json file for LB-to-injector-pulse-amplitude mapping and fill the mapping vector
137  m_zdcInjPulserAmpMap = std::make_shared<ZdcInjPulserAmpMap>();
138  ATH_MSG_DEBUG( "Using JSON file for injector-pulse voltage at path " << m_zdcInjPulserAmpMap->getFilePath() );
139  ATH_MSG_DEBUG("CALIBPATH: " << std::getenv("CALIBPATH"));
140 
141  // create monitoring tools and map the strings to the tools
142  std::vector<std::string> sides = {"C","A"};
143  std::vector<std::string> modules = {"0","1","2","3"};
144  std::vector<std::string> channels = {"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"};
145  m_ZDCModuleToolIndices = buildToolMap<std::map<std::string,int>>(m_tools,"ZdcModuleMonitor",sides,modules);
146  if (m_enableZDCPhysics || m_enableRPDAmp || m_enableCentroid){ // none is true for injector pulse --> no Per-side monitoring tool
147  m_ZDCSideToolIndices = buildToolMap<int>(m_tools,"ZdcSideMonitor",sides);
148  }
149  if (m_enableRPDAmp){
150  m_RPDChannelToolIndices = buildToolMap<std::map<std::string,int>>(m_tools,"RpdChannelMonitor",sides,channels);
151  }
152 
153  //---------------------------------------------------
154  // initialize superclass
155 
157  //---------------------------------------------------
158 
159 }
160 
161 
163  ATH_MSG_DEBUG("calling the fillPhysicsDataHistograms function");
164 
165 // ______________________________________________________________________________
166  // EVENT-level flags for whether ZDC, RPD and RPDCentroid data is available
167  // needed for events with LUCROD decoding error - will have missing aux data
168  bool cur_event_ZDC_available = true;
169  bool cur_event_RPD_available = true;
170  bool cur_event_RPDCentroid_available = true;
171 
172 // ______________________________________________________________________________
173 
174 // ______________________________________________________________________________
175  // declaring & obtaining event-level information of interest
176 // ______________________________________________________________________________
178  // already checked in fillHistograms that eventInfo is valid
179  auto lumiBlock = Monitored::Scalar<uint32_t>("lumiBlock", eventInfo->lumiBlock());
180  auto bcid = Monitored::Scalar<unsigned int>("bcid", eventInfo->bcid());
181 
182 // ______________________________________________________________________________
183  // check for decoding errors
184 // ______________________________________________________________________________
187  std::array<float, m_nDecodingErrorBits> decodingErrorBitsArr = {0, 0, 0};
188 
189  cur_event_ZDC_available &= !zdcDecodingError;
190  cur_event_RPD_available &= !rpdDecodingError;
191 
192  if (!zdcDecodingError && !rpdDecodingError){
193  decodingErrorBitsArr[0] += 1;
194  } else if (zdcDecodingError){
195  ATH_MSG_WARNING("ZDC Decoding error!");
196  decodingErrorBitsArr[1] += 1;
197  } else { // RPD decoding error
198  ATH_MSG_WARNING("RPD Decoding error!");
199  decodingErrorBitsArr[2] += 1;
200  }
201 
202  auto zdcTool = getGroup("genZdcMonTool"); // get the tool for easier group filling
203 
204  auto decodingErrorBits = Monitored::Collection("decodingErrorBits", decodingErrorBitsArr);
205  fill(zdcTool, decodingErrorBits, lumiBlock);
206 
207 // ______________________________________________________________________________
208  // does event pass trigger selection?
209 // ______________________________________________________________________________
210 
211  auto passTrigSideA = Monitored::Scalar<bool>("passTrigSideA",false); // if trigger isn't enabled (e.g, MC) the with-trigger histograms are never filled (cut mask never satisfied)
212  auto passTrigSideC = Monitored::Scalar<bool>("passTrigSideC",false);
213 
214  if(m_enableTrigger && m_enableZDCPhysics){ // if not enable trigger, the pass-trigger booleans will still be defined but with value always set to false
215  const auto &trigDecTool = getTrigDecisionTool();
216  passTrigSideA = trigDecTool->isPassed(m_triggerSideA, TrigDefs::Physics);
217  passTrigSideC = trigDecTool->isPassed(m_triggerSideC, TrigDefs::Physics);
218  if (passTrigSideA) ATH_MSG_DEBUG("passing trig on side A!");
219  if (passTrigSideC) ATH_MSG_DEBUG("passing trig on side C!");
220  }
221 
222 
223 // ______________________________________________________________________________
224  // declaring & obtaining variables of interest for the ZDC sums
225  // including the RPD x,y positions, reaction plane and status
226 // ______________________________________________________________________________
228 
229  auto zdcEnergySumA = Monitored::Scalar<float>("zdcEnergySumA",-1000.0);
230  auto zdcEnergySumC = Monitored::Scalar<float>("zdcEnergySumC",-1000.0);
231  auto zdcUncalibSumA = Monitored::Scalar<float>("zdcUncalibSumA",-1000.0);
232  auto zdcUncalibSumC = Monitored::Scalar<float>("zdcUncalibSumC",-1000.0);
233  auto rpdCosDeltaReactionPlaneAngle = Monitored::Scalar<float>("rpdCosDeltaReactionPlaneAngle",-1000.0);
234  auto bothReactionPlaneAngleValid = Monitored::Scalar<bool>("bothReactionPlaneAngleValid",true);
235  auto bothHasCentroid = Monitored::Scalar<bool>("bothHasCentroid",true); // the looser requirement that both centroids were calculated (ignore valid)
236 
237  std::array<bool, 2> centroidSideValidArr;
238  std::array<bool, 2> rpdSideValidArr = {false, false};
239  std::array<std::vector<float>,2> rpdSubAmpVecs;
240  auto rpdSubAmpSumCurSide = Monitored::Scalar<float>("rpdSubAmpSum",-1000.0);
241  auto rpdXCentroidCurSide = Monitored::Scalar<float>("xCentroid",-1000.0);
242  auto rpdYCentroidCurSide = Monitored::Scalar<float>("yCentroid",-1000.0);
243  auto rpdReactionPlaneAngleCurSide = Monitored::Scalar<float>("ReactionPlaneAngle",-1000.0);
244  auto centroidValid = Monitored::Scalar<bool>("centroidValid",false);
245  auto centroidValidBitFloat = Monitored::Scalar<float>("centroidValidBitFloat", -1000.0); // 0.5 if valid, 1.5 if invalid --> needed for DQ
246  auto passMinZDCEnergyCutForCentroidValidEvaluation = Monitored::Scalar<bool>("passMinZDCEnergyCutForCentroidValidEvaluation",false);
247 
248  // need to recognize same-side correlation among the following observables
249  // since they are filled differently, it is helpful to store each of their values in the 2-dimension array first
250  // and fill the side monitoring tool in the same "monitoring group"
251  std::array<float, 2> zdcEMModuleEnergyArr = {-1000.,-1000.};
252  std::array<float, 2> zdcEnergySumArr = {-1000,-1000.};
253  std::array<float, 2> zdcUncalibSumArr = {-1000.,-1000.};
254  std::array<float, 2> zdcAvgTimeArr = {-1000.,-1000.};
255  std::array<bool, 2> zdcModuleMaskArr = {false, false};
256  std::array<bool, 2> passTrigOppSideArr = {false, false};
257  std::array<float, 2> rpdAmplitudeCalibSum = {-1000.,-1000.};
258  std::array<float, 2> rpdMaxADCSum = {-1000.,-1000.};
259 
260  std::array<float, m_nRpdCentroidStatusBits> centroidStatusBitsCountCurSide;
261 
262  if (! zdcSums.isValid() ) {
263  ATH_MSG_WARNING("evtStore() does not contain Collection with name "<< m_ZdcSumContainerKey);
264  return StatusCode::SUCCESS;
265  }
266 
271 
272  // write ZDC per-arm information to arrays
273  if (m_enableZDCPhysics){ // write down energy sum, uncalib sum, average time, and module mask if we enable ZDC physics
274  cur_event_ZDC_available &= ZdcSumCalibEnergyHandle.isAvailable();
275  if (cur_event_ZDC_available){
276  for (const auto& zdcSum : *zdcSums) { // side -1: C; side 1: A
277  if (zdcSum->zdcSide() != 0){
278  int iside = (zdcSum->zdcSide() > 0)? 1 : 0;
279 
280  zdcEnergySumArr[iside] = ZdcSumCalibEnergyHandle(*zdcSum);
281  zdcUncalibSumArr[iside] = ZdcSumUncalibSumHandle(*zdcSum);
282  zdcAvgTimeArr[iside] = ZdcSumAverageTimeHandle(*zdcSum);
283  zdcModuleMaskArr[iside] = ZdcSumModuleMaskHandle(*zdcSum);
284 
285  passTrigOppSideArr[iside] = (iside == 0)? passTrigSideA : passTrigSideC;
286 
287  if (zdcSum->zdcSide() == 1){
288  zdcEnergySumA = ZdcSumCalibEnergyHandle(*zdcSum);
289  zdcUncalibSumA = ZdcSumUncalibSumHandle(*zdcSum);
290  }
291  else {
292  zdcEnergySumC = ZdcSumCalibEnergyHandle(*zdcSum);
293  zdcUncalibSumC = ZdcSumUncalibSumHandle(*zdcSum);
294  }
295  }
296  } // having filled both sides
297  }
298  } else if (m_enableZDC){ // enable ZDC but not physics - for now, the only case is injector pulse --> no energy, only record uncalib sum
299  cur_event_ZDC_available &= ZdcSumUncalibSumHandle.isAvailable();
300  if (cur_event_ZDC_available){
301  for (const auto& zdcSum : *zdcSums) { // side -1: C; side 1: A
302  if (zdcSum->zdcSide() != 0){
303  int iside = (zdcSum->zdcSide() > 0)? 1 : 0;
304  zdcUncalibSumArr[iside] = ZdcSumUncalibSumHandle(*zdcSum);
305  }
306  }
307  }
308  }
309 
310  // write RPD per-arm status to arrays
311  if (m_enableRPDAmp){
313  cur_event_RPD_available &= RPDsideStatusHandle.isAvailable();
314  if (cur_event_RPD_available){
315  for (const auto& zdcSum : *zdcSums) { // side -1: C; side 1: A
316  if (zdcSum->zdcSide() != 0){ // contains the RPD Cos Delta reaction plane
317  int iside = (zdcSum->zdcSide() > 0)? 1 : 0;
318  unsigned int rpdStatusCurSide = RPDsideStatusHandle(*zdcSum);
319  rpdSideValidArr.at(iside) = rpdStatusCurSide & 1 << ZDC::RPDDataAnalyzer::ValidBit;
320  }
321  }
322  }
323  }
324 
325  // fill RPD centroid information to monitoring tools
326  if (m_enableCentroid){
334 
335  cur_event_RPDCentroid_available &= RPDcentroidStatusHandle.isAvailable();
336  if (cur_event_RPDCentroid_available){
337  for (const auto& zdcSum : *zdcSums) { // side -1: C; side 1: A
338 
339  if (zdcSum->zdcSide() == 0){ // contains the RPD Cos Delta reaction plane
340  rpdCosDeltaReactionPlaneAngle = RPDcosDeltaReactionPlaneAngleHandle(*zdcSum);
341  }else{
342  int iside = (zdcSum->zdcSide() > 0)? 1 : 0; // already exclude the possibility of global sum
343  std::string side_str = (iside == 0)? "C" : "A";
344 
345  rpdSubAmpVecs[iside] = RPDsubAmpHandle(*zdcSum);
346  rpdSubAmpSumCurSide = RPDsubAmpSumHandle(*zdcSum);
347  rpdXCentroidCurSide = RPDxCentroidHandle(*zdcSum);
348  rpdYCentroidCurSide = RPDyCentroidHandle(*zdcSum);
349  rpdReactionPlaneAngleCurSide = RPDreactionPlaneAngleHandle(*zdcSum);
350 
351  unsigned int rpdCentroidStatusCurSide = RPDcentroidStatusHandle(*zdcSum);
352 
353  // Remarks - Oct 2024
354  // HasCentroidBit is false if RPD on the current side is invalid
355  // The centroid ValidBit, compared with Has HasCentroidBit, also checks that ZDC is valid
356  // and has the infrastruture to require (1) ZDC total energy to be in given range
357  // (2) EM-module energy to be in given range
358  // (3) pile up fraction is below a threshold
359  // but these are currently NOT implemented
360  // for online, we only monitor the ones requiring valid bit
361  // for offline, we plot both sets, with the expectation that they are the same for now
362  centroidValid = (rpdCentroidStatusCurSide & 1 << ZDC::RpdSubtractCentroidTool::ValidBit);
363 
364  centroidValidBitFloat = (centroidValid)? 0.5 : 1.5;
365 
366  centroidSideValidArr.at(iside) = rpdCentroidStatusCurSide & 1 << ZDC::RpdSubtractCentroidTool::ValidBit;
367  bool curSideHasCentroid = (rpdCentroidStatusCurSide & 1 << ZDC::RpdSubtractCentroidTool::HasCentroidBit);
368 
369  bothReactionPlaneAngleValid &= centroidValid;
370  bothHasCentroid &= curSideHasCentroid;
371 
372  for (int bit = 0; bit < m_nRpdCentroidStatusBits; bit++) centroidStatusBitsCountCurSide[bit] = 0; // reset
373  for (int bit = 0; bit < m_nRpdCentroidStatusBits; bit++){
374  if (rpdCentroidStatusCurSide & 1 << bit){
375  centroidStatusBitsCountCurSide[bit] += 1;
376  }
377  }
378  auto centroidStatusBits = Monitored::Collection("centroidStatusBits", centroidStatusBitsCountCurSide);
379 
380  if (curSideHasCentroid){ // only impose the looser requirement that this side has centroid; have a set of histograms for the more stringent centroid-valid requirement
381  if (m_enableZDCPhysics){ // if not enable ZDC physics, no ZDC energy --> the boolean requiring minimum ZDC energy will always be set to false
382  passMinZDCEnergyCutForCentroidValidEvaluation = (zdcEnergySumArr[iside] > m_ZDCEnergyCutForCentroidValidBitMonitor);
383  }
384  fill(m_tools[m_ZDCSideToolIndices.at(side_str)], rpdSubAmpSumCurSide, centroidValid, passMinZDCEnergyCutForCentroidValidEvaluation, centroidValidBitFloat, rpdXCentroidCurSide, rpdYCentroidCurSide, rpdReactionPlaneAngleCurSide, centroidStatusBits, lumiBlock, bcid);
385  }else{
386  fill(m_tools[m_ZDCSideToolIndices.at(side_str)], rpdSubAmpSumCurSide, centroidStatusBits, lumiBlock, bcid);
387  }
388  }
389  } // having filled both sides
390  }
391  }
392 
393 // ______________________________________________________________________________
394  // declaring & obtaining variables of interest for the ZDC modules & RPD channels
395  // filling arrays of monitoring tools (module/channel-level)
396  // updating status bits
397 // ______________________________________________________________________________
398 
400 
409 
414 
415  auto zdcModuleAmp = Monitored::Scalar<float>("zdcModuleAmp", -1000.0);
416  auto zdcModuleMaxADC = Monitored::Scalar<float>("zdcModuleMaxADC", -1000.0);
417  auto zdcModuleAmpToMaxADCRatio = Monitored::Scalar<float>("zdcModuleAmpToMaxADCRatio", -1000.0);
418  auto zdcModuleFract = Monitored::Scalar<float>("zdcModuleFract", -1000.0);
419  auto zdcUncalibSumCurrentSide = Monitored::Scalar<float>("zdcUncalibSumCurrentSide", -1000.0);
420  auto zdcEnergySumCurrentSide = Monitored::Scalar<float>("zdcEnergySumCurrentSide", -1000.0);
421  auto zdcAbove20NCurrentSide = Monitored::Scalar<bool>("zdcAbove20NCurrentSide", false);
422  auto zdcEnergyAboveModuleFractCut = Monitored::Scalar<bool>("zdcEnergyAboveModuleFractCut", false);
423  auto zdcModuleTime = Monitored::Scalar<float>("zdcModuleTime", -1000.0);
424  auto zdcModuleFitT0 = Monitored::Scalar<float>("zdcModuleFitT0", -1000.0);
425  auto zdcModuleChisq = Monitored::Scalar<float>("zdcModuleChisq", -1000.0);
426  auto zdcModuleChisqEventWeight = Monitored::Scalar<float>("zdcModuleChisqEventWeight", -1000.0);
427  auto zdcModuleChisqOverAmp = Monitored::Scalar<float>("zdcModuleChisqOverAmp", -1000.0);
428  auto zdcModuleChisqOverAmpEventWeight = Monitored::Scalar<float>("zdcModuleChisqOverAmpEventWeight", -1000.0);
429  auto zdcModuleCalibAmp = Monitored::Scalar<float>("zdcModuleCalibAmp", -1000.0);
430  auto zdcModuleCalibTime = Monitored::Scalar<float>("zdcModuleCalibTime", -1000.0);
431  auto zdcModuleLG = Monitored::Scalar<bool>("zdcModuleLG", false);
432  auto zdcModuleHG = Monitored::Scalar<bool>("zdcModuleHG", false);
433  auto zdcModuleHGValid = Monitored::Scalar<bool>("zdcModuleHGValid", false);
434  auto injectedPulseInputVoltage = Monitored::Scalar<float>("injectedPulseInputVoltage", -1000.0);
435 
436  auto zdcModuleAmpLGRefit = Monitored::Scalar<float>("zdcModuleAmpLGRefit", -1000.0);
437  auto zdcModuleT0LGRefit = Monitored::Scalar<float>("zdcModuleT0LGRefit", -1000.0);
438  auto zdcModuleT0SubLGRefit = Monitored::Scalar<float>("zdcModuleT0SubLGRefit", -1000.0);
439  auto zdcModuleChisqLGRefit = Monitored::Scalar<float>("zdcModuleChisqLGRefit", -1000.0);
440 
441  auto zdcModuleHGtoLGAmpRatio = Monitored::Scalar<float>("zdcModuleHGtoLGAmpRatio", -1000.0);
442  auto zdcModuleHGtoLGT0Diff = Monitored::Scalar<float>("zdcModuleHGtoLGT0Diff", -1000.0);
443 
444  auto rpdChannelSubAmp = Monitored::Scalar<float>("RPDChannelSubAmp", -1000.0);
445  auto rpdChannelAmplitude = Monitored::Scalar<float>("RPDChannelAmplitude", -1000.0);
446  auto rpdChannelMaxADC = Monitored::Scalar<float>("RPDChannelMaxADC", -1000.0);
447  auto rpdChannelMaxSample = Monitored::Scalar<unsigned int>("RPDChannelMaxSample", 1000);
448  auto rpdChannelAmplitudeCalib = Monitored::Scalar<float>("RPDChannelAmplitudeCalib", -1000.0);
449  auto rpdChannelStatus = Monitored::Scalar<unsigned int>("RPDChannelStatus", 1000);
450  auto rpdChannelPileupFitSlope = Monitored::Scalar<float>("RPDChannelPileupFitSlope", -1000);
451  auto absRpdChannelAmplitude = Monitored::Scalar<float>("absRPDChannelAmplitude", -1000.); // EM module energy on the same side (assuming filled already)
452  auto rpdChannelValid = Monitored::Scalar<bool>("RPDChannelValid", false);
453  auto rpdChannelValidBitFloat = Monitored::Scalar<float>("RPDChannelValidBitFloat", -1000.0); // 0.5 if valid, 1.5 if invalid --> needed for DQ
454  auto rpdChannelCentroidValid = Monitored::Scalar<bool>("RPDChannelCentroidValid", false);
455  auto rpdChannelPileupFrac = Monitored::Scalar<float>("RPDChannelPileupFrac", -1000.);
456  auto zdcEMModuleEnergySameSide = Monitored::Scalar<float>("zdcEMModuleEnergySameSide", -1000.); // EM module energy on the same side (assuming filled already)
457  auto zdcEnergySumSameSide = Monitored::Scalar<float>("zdcEnergySumSameSide", -1000.); // EM module energy on the same side (assuming filled already)
458 
459  std::array<float, m_nZdcStatusBits> zdcStatusBitsCount;
460  std::array<float, m_nRpdStatusBits> rpdStatusBitsCount;
461 
462  if (! zdcModules.isValid() ) {
463  ATH_MSG_WARNING("evtStore() does not contain Collection with name "<< m_ZdcModuleContainerKey);
464  return StatusCode::SUCCESS;
465  }
466 
467  if (m_isInjectedPulse){
468  if (m_isStandalone){
469  injectedPulseInputVoltage = zdcModuleAmp * 1. / 25000.; // for filling dummy histograms - delete this line when LB-dependent function is in place
470  }else{
471  injectedPulseInputVoltage = m_zdcInjPulserAmpMap->getPulserAmplitude(lumiBlock);
472  if (injectedPulseInputVoltage > 0){ // LB > startLB
473  ATH_MSG_DEBUG("Lumi block: " << lumiBlock << "; pulser amplitude: " << injectedPulseInputVoltage);
474  }
475  }
476  }
477 
478  // first loop over zdcModules - read ZDC-module information & fill in ZDC histograms
479  // separate ZDC and RPD variable retrieval into two for loops to make sure
480  // essential ZDC information (e.g, the EM module energy and total energy sum on both sides) is properly filled
481  // before they are required in RPD channel monitoring
482  if (m_enableZDC){
483  cur_event_ZDC_available &= zdcModuleStatusHandle.isAvailable();
484  if (cur_event_ZDC_available){
485  for (const auto zdcMod : *zdcModules){
486  int iside = (zdcMod->zdcSide() > 0)? 1 : 0;
487  std::string side_str = (iside == 0)? "C" : "A";
488 
489  if (zdcMod->zdcType() == 0){
490  int imod = zdcMod->zdcModule();
491  std::string module_str = std::to_string(imod);
492 
493  int status = zdcModuleStatusHandle(*zdcMod);
494 
495  for (int bit = 0; bit < m_nZdcStatusBits; bit++) zdcStatusBitsCount[bit] = 0; // reset
496  for (int bit = 0; bit < m_nZdcStatusBits; bit++){
497  if (status & 1 << bit){
498  zdcStatusBitsCount[bit] += 1;
499  }
500  }
501 
502  auto zdcStatusBits = Monitored::Collection("zdcStatusBits", zdcStatusBitsCount);
503  fill(m_tools[m_ZDCModuleToolIndices.at(side_str).at(module_str)], zdcStatusBits, lumiBlock, bcid);
504 
505  if ((status & 1 << ZDCPulseAnalyzer::PulseBit) != 0){ // has pulse
506  zdcModuleAmp = zdcModuleAmplitudeHandle(*zdcMod);
507  zdcModuleMaxADC = zdcModuleMaxADCHandle(*zdcMod);
508  zdcModuleAmpToMaxADCRatio = (zdcModuleMaxADC == 0)? -1000. : zdcModuleAmp / zdcModuleMaxADC;
509  zdcModuleTime = zdcModuleTimeHandle(*zdcMod);
510  zdcModuleFitT0 = zdcModuleFitT0Handle(*zdcMod);
511  zdcModuleChisq = zdcModuleChisqHandle(*zdcMod);
512  zdcModuleCalibAmp = zdcModuleCalibEnergyHandle(*zdcMod);
513  zdcModuleCalibTime = zdcModuleCalibTimeHandle(*zdcMod);
514  zdcUncalibSumCurrentSide = zdcUncalibSumArr[iside];
515  zdcEnergySumCurrentSide = zdcEnergySumArr[iside];
516  zdcAbove20NCurrentSide = (zdcUncalibSumCurrentSide > 20 * m_expected1N);
517  zdcEnergyAboveModuleFractCut = (zdcEnergySumCurrentSide > m_energyCutForModuleFractMonitor);
518 
519  if (m_enableZDCPhysics){
520  zdcModuleFract = (zdcEnergySumCurrentSide == 0)? -1000. : zdcModuleCalibAmp / zdcEnergySumCurrentSide; // use calibrated amplitudes + energy sum
521  }else{
522  zdcModuleFract = (zdcUncalibSumCurrentSide == 0)? -1000. : zdcModuleAmp / zdcUncalibSumCurrentSide; // use uncalibrated amplitudes + amplitude sum
523  }
524  zdcModuleChisqOverAmp = (zdcModuleAmp == 0)? -1000. : zdcModuleChisq / zdcModuleAmp;
525  zdcModuleLG = (status & 1 << ZDCPulseAnalyzer::LowGainBit);
526  zdcModuleHG = !(zdcModuleLG);
527  zdcModuleHGValid = !(status & 1 << ZDCPulseAnalyzer::HGOverflowBit) && !(status & 1 << ZDCPulseAnalyzer::HGUnderflowBit); // HG neither overflow nor underflow
528 
529  zdcModuleAmpLGRefit = zdcModuleAmpLGRefitHandle(*zdcMod);
530  zdcModuleT0LGRefit = zdcModuleT0LGRefitHandle(*zdcMod);
531  zdcModuleT0SubLGRefit = zdcModuleT0SubLGRefitHandle(*zdcMod);
532  zdcModuleChisqLGRefit = zdcModuleChisqLGRefitHandle(*zdcMod);
533 
534  zdcModuleHGtoLGAmpRatio = (!zdcModuleHGValid || zdcModuleAmpLGRefit == 0)? -1000. : zdcModuleAmp * 1. / zdcModuleAmpLGRefit; // HG/LG ratio if HG is valid and LG-refit amplitude is nonzero (shouldn't be)
535  zdcModuleHGtoLGT0Diff = (!zdcModuleHGValid)? -1000. : zdcModuleFitT0 - zdcModuleT0LGRefit;
536 
537  zdcModuleChisqEventWeight = calculate_inverse_bin_width(zdcModuleChisq, "module chisq", m_ZdcModuleChisqBinEdges);
538  zdcModuleChisqOverAmpEventWeight = calculate_inverse_bin_width(zdcModuleChisqOverAmp, "module chisq over amplitude", m_ZdcModuleChisqOverAmpBinEdges);
539 
540  if (imod == 0) zdcEMModuleEnergyArr[iside] = zdcModuleCalibAmp;
541 
542  if (m_isInjectedPulse){
543  fill(m_tools[m_ZDCModuleToolIndices.at(side_str).at(module_str)], zdcModuleAmp, zdcModuleMaxADC, zdcModuleAmpToMaxADCRatio, zdcModuleFract, zdcUncalibSumCurrentSide, zdcEnergySumCurrentSide, zdcModuleTime, zdcModuleFitT0, zdcModuleChisq, zdcModuleChisqOverAmp, zdcModuleChisqEventWeight, zdcModuleChisqOverAmpEventWeight, zdcModuleCalibAmp, zdcModuleCalibTime, zdcModuleLG, zdcModuleHG, zdcModuleHGValid, zdcModuleAmpLGRefit, zdcModuleT0LGRefit, zdcModuleT0SubLGRefit, zdcModuleChisqLGRefit, zdcModuleHGtoLGAmpRatio, zdcModuleHGtoLGT0Diff, injectedPulseInputVoltage, lumiBlock, bcid);
544  }else{
545  fill(m_tools[m_ZDCModuleToolIndices.at(side_str).at(module_str)], zdcModuleAmp, zdcModuleMaxADC, zdcModuleAmpToMaxADCRatio, zdcModuleFract, zdcUncalibSumCurrentSide, zdcEnergySumCurrentSide, zdcAbove20NCurrentSide, zdcEnergyAboveModuleFractCut, zdcModuleTime, zdcModuleFitT0, zdcModuleChisq, zdcModuleChisqOverAmp, zdcModuleChisqEventWeight, zdcModuleChisqOverAmpEventWeight, zdcModuleCalibAmp, zdcModuleCalibTime, zdcModuleLG, zdcModuleHG, zdcModuleHGValid, zdcModuleAmpLGRefit, zdcModuleT0LGRefit, zdcModuleT0SubLGRefit, zdcModuleChisqLGRefit, zdcModuleHGtoLGAmpRatio, zdcModuleHGtoLGT0Diff, lumiBlock, bcid);
546  }
547  }
548  }
549  }
550  }
551  }
552 
553 
554  // second loop over zdcModules - read RPD-channel information & fill in RPD histograms
555  // only run if NOT injector pulse
556  if (m_enableRPDAmp){
564 
565  cur_event_RPD_available &= RPDChannelStatusHandle.isAvailable();
566  if (cur_event_RPD_available){
567  for (const auto zdcMod : *zdcModules){
568  int iside = (zdcMod->zdcSide() > 0)? 1 : 0;
569  std::string side_str = (iside == 0)? "C" : "A";
570 
571  if (zdcMod->zdcType() == 1) {
572  // this is the RPD
573 
574  int ichannel = zdcMod->zdcChannel(); // zero-based
575  std::string channel_str = std::to_string(ichannel);
576 
577  int status = RPDChannelStatusHandle(*zdcMod);
578 
579  for (int bit = 0; bit < m_nRpdStatusBits; bit++) rpdStatusBitsCount[bit] = 0; // reset
580  for (int bit = 0; bit < m_nRpdStatusBits; bit++){
581  if (status & 1 << bit){
582  rpdStatusBitsCount[bit] += 1;
583  }
584  }
585 
586  auto rpdStatusBits = Monitored::Collection("RPDStatusBits", rpdStatusBitsCount);
587 
588  rpdChannelSubAmp = rpdSubAmpVecs[iside][ichannel];
589  rpdChannelAmplitude = RPDChannelAmplitudeHandle(*zdcMod);
590  rpdChannelMaxADC = RPDChannelMaxADCHandle(*zdcMod);
591  rpdChannelMaxSample = RPDChannelMaxSampleHandle(*zdcMod);
592  rpdChannelAmplitudeCalib = RPDChannelAmplitudeCalibHandle(*zdcMod);
593  std::vector<float> rpdChannelPileupFitParams = RPDChannelPileupExpFitParamsHandle(*zdcMod);
594  rpdChannelPileupFitSlope = rpdChannelPileupFitParams[1];
595  rpdChannelPileupFrac = RPDChannelPileupFracHandle(*zdcMod);
596 
597  absRpdChannelAmplitude = abs(rpdChannelAmplitude);
598  zdcEMModuleEnergySameSide = zdcEMModuleEnergyArr[iside];
599  zdcEnergySumSameSide = zdcEnergySumArr[iside];
600  bool curRpdChannelValid = status & 1 << ZDC::RPDDataAnalyzer::ValidBit;
601  rpdChannelValid = curRpdChannelValid;
602  rpdChannelValidBitFloat = (curRpdChannelValid)? 0.5 : 1.5;
603  rpdChannelCentroidValid = centroidSideValidArr.at(iside);
604 
605  rpdAmplitudeCalibSum[iside] += rpdChannelAmplitudeCalib;
606  rpdMaxADCSum[iside] += rpdChannelMaxADC;
607 
608  fill(m_tools[m_RPDChannelToolIndices.at(side_str).at(channel_str)], rpdChannelSubAmp, rpdChannelAmplitude, rpdChannelAmplitudeCalib, rpdChannelMaxADC, rpdChannelMaxSample, rpdStatusBits, rpdChannelPileupFitSlope, absRpdChannelAmplitude, rpdChannelPileupFrac, zdcEMModuleEnergySameSide, zdcEnergySumSameSide, rpdChannelValid, rpdChannelValidBitFloat, rpdChannelCentroidValid, lumiBlock, bcid);
609  }
610  }
611  }
612  }
613 
614 
615 // ______________________________________________________________________________
616  // obtaining fCalEt on A,C side
617 // ______________________________________________________________________________
618 
619  auto fcalEtA = Monitored::Scalar<float>("fcalEtA", -1000.0);
620  auto fcalEtC = Monitored::Scalar<float>("fcalEtC", -1000.0);
621  std::array<float,2> fcalEtArr = {0.,0.};
624  if (! eventShapes.isValid()) {
625  ATH_MSG_WARNING("evtStore() does not contain Collection with name "<< m_HIEventShapeContainerKey);
626  }
627  else{
628  ATH_MSG_DEBUG("Able to retrieve container "<< m_HIEventShapeContainerKey);
629  ATH_MSG_DEBUG("Used to obtain fCalEtA, fCalEtC");
630 
631  for (const auto eventShape : *eventShapes){
632  int layer = eventShape->layer();
633  float eta = eventShape->etaMin();
634  float et = eventShape->et();
635  if (layer == 21 || layer == 22 || layer == 23){
636  if (eta > 0){
637  fcalEtA += et;
638  fcalEtArr[1] += et;
639  }
640  if (eta < 0){
641  fcalEtC += et;
642  fcalEtArr[0] += et;
643  }
644  }
645  }
646  }
647  }
648 
649 // ______________________________________________________________________________
650  // give warning if there is missing aux data but no decoding error
651 // ______________________________________________________________________________
652  if (!cur_event_ZDC_available && !zdcDecodingError){
653  ATH_MSG_WARNING("Current event has no ZDC decoding error but ZDC aux data is not available!");
654  }
655  if (!cur_event_RPD_available && !rpdDecodingError){
656  ATH_MSG_WARNING("Current event has no RPD decoding error but RPD aux data is not available!");
657  }
658 // ______________________________________________________________________________
659  // give warning and return if neither ZDC nor RPD are available
660 // ______________________________________________________________________________
661  if (!cur_event_ZDC_available && !cur_event_RPD_available){
662  ATH_MSG_WARNING("For current event, neither ZDC nor RPD data are available!");
663  return StatusCode::SUCCESS;
664  }
665 
666 // ______________________________________________________________________________
667  // filling generic ZDC monitoring tool for A-C side correlations & cos(reaction plane angle)
668 // ______________________________________________________________________________
669 
670  if ((m_enableZDCPhysics && cur_event_ZDC_available) || (m_enableCentroid && cur_event_RPD_available)){
671 
672  if (m_enableZDCPhysics && cur_event_ZDC_available){
673  if (m_CalInfoOn){ // calorimeter information is turned on
674  fill(zdcTool, lumiBlock, bcid, passTrigSideA, passTrigSideC, zdcEnergySumA, zdcEnergySumC, zdcUncalibSumA, zdcUncalibSumC, fcalEtA, fcalEtC);
675  } else{
676  fill(zdcTool, lumiBlock, bcid, passTrigSideA, passTrigSideC, zdcEnergySumA, zdcEnergySumC, zdcUncalibSumA, zdcUncalibSumC);
677  }
678  }
679 
680  if (m_enableCentroid && cur_event_RPD_available){
681  fill(zdcTool, rpdCosDeltaReactionPlaneAngle, bothReactionPlaneAngleValid, bothHasCentroid);
682  }
683  }
684 
685 // ______________________________________________________________________________
686  // filling per-side tools
687 // ______________________________________________________________________________
688 
689 
690  if (m_enableZDCPhysics && cur_event_ZDC_available && m_enableRPDAmp && cur_event_RPD_available){
691  for (int iside = 0; iside < m_nSides; iside++){
692  std::string side_str = (iside == 0)? "C" : "A";
693 
694  auto passTrigOppSide = Monitored::Scalar<bool>("passTrigOppSide",passTrigOppSideArr[iside]); // this is duplicate information as A,C but convenient for filling per-side histograms
695  auto zdcEnergySumCurSide = Monitored::Scalar<float>("zdcEnergySum",zdcEnergySumArr[iside]); // this is duplicate information as A,C but convenient for filling per-side histograms
696  auto zdcUncalibSumCurSide = Monitored::Scalar<float>("zdcUncalibSum",zdcUncalibSumArr[iside]); // this is duplicate information as A,C but convenient for filling per-side histograms
697  auto zdcEMModuleEnergyCurSide = Monitored::Scalar<float>("zdcEMModuleEnergy",zdcEMModuleEnergyArr[iside]);
698  auto zdcAvgTimeCurSide = Monitored::Scalar<float>("zdcAvgTime",zdcAvgTimeArr[iside]);
699  auto zdcModuleMaskCurSide = Monitored::Scalar<bool>("zdcModuleMask",zdcModuleMaskArr[iside]);
700 
701  auto fcalEtCurSide = Monitored::Scalar<float>("fCalEt",fcalEtArr[iside]);
702 
703  auto rpdAmplitudeCalibSumCurSide = Monitored::Scalar<float>("rpdAmplitudeCalibSum",rpdAmplitudeCalibSum[iside]);
704  auto rpdMaxADCSumCurSide = Monitored::Scalar<float>("rpdMaxADCSum",rpdMaxADCSum[iside]);
705  auto rpdCurSideValid = Monitored::Scalar<bool>("RPDSideValid",rpdSideValidArr[iside]);
706 
707  fill(m_tools[m_ZDCSideToolIndices.at(side_str)], passTrigOppSide, zdcEnergySumCurSide, zdcUncalibSumCurSide, zdcEMModuleEnergyCurSide, zdcAvgTimeCurSide, zdcModuleMaskCurSide, rpdAmplitudeCalibSumCurSide, rpdMaxADCSumCurSide, rpdCurSideValid, fcalEtCurSide, lumiBlock, bcid);
708  }
709  }else if (m_enableZDCPhysics && cur_event_ZDC_available){
710  for (int iside = 0; iside < m_nSides; iside++){
711  std::string side_str = (iside == 0)? "C" : "A";
712 
713  auto passTrigOppSide = Monitored::Scalar<bool>("passTrigOppSide",passTrigOppSideArr[iside]); // this is duplicate information as A,C but convenient for filling per-side histograms
714  auto zdcEnergySumCurSide = Monitored::Scalar<float>("zdcEnergySum",zdcEnergySumArr[iside]); // this is duplicate information as A,C but convenient for filling per-side histograms
715  auto zdcUncalibSumCurSide = Monitored::Scalar<float>("zdcUncalibSum",zdcUncalibSumArr[iside]); // this is duplicate information as A,C but convenient for filling per-side histograms
716  auto zdcEMModuleEnergyCurSide = Monitored::Scalar<float>("zdcEMModuleEnergy",zdcEMModuleEnergyArr[iside]);
717  auto zdcAvgTimeCurSide = Monitored::Scalar<float>("zdcAvgTime",zdcAvgTimeArr[iside]);
718  auto zdcModuleMaskCurSide = Monitored::Scalar<bool>("zdcModuleMask",zdcModuleMaskArr[iside]);
719  auto fcalEtCurSide = Monitored::Scalar<float>("fCalEt",fcalEtArr[iside]);
720 
721  fill(m_tools[m_ZDCSideToolIndices.at(side_str)], passTrigOppSide, zdcEnergySumCurSide, zdcUncalibSumCurSide, zdcEMModuleEnergyCurSide, zdcAvgTimeCurSide, zdcModuleMaskCurSide, fcalEtCurSide, lumiBlock, bcid);
722  }
723  }else if (m_enableRPDAmp && cur_event_RPD_available){
724  for (int iside = 0; iside < m_nSides; iside++){
725  std::string side_str = (iside == 0)? "C" : "A";
726 
727  auto rpdAmplitudeCalibSumCurSide = Monitored::Scalar<float>("rpdAmplitudeCalibSum",rpdAmplitudeCalibSum[iside]);
728  auto rpdMaxADCSumCurSide = Monitored::Scalar<float>("rpdMaxADCSum",rpdMaxADCSum[iside]);
729  auto rpdCurSideValid = Monitored::Scalar<bool>("RPDSideValid",rpdSideValidArr[iside]);
730 
731  fill(m_tools[m_ZDCSideToolIndices.at(side_str)], rpdAmplitudeCalibSumCurSide, rpdMaxADCSumCurSide, rpdCurSideValid, lumiBlock, bcid);
732  }
733  }
734 
735  return StatusCode::SUCCESS;
736 }
737 
738 
739 StatusCode ZdcMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const {
740 
741  ATH_MSG_DEBUG("calling the fillHistograms function");
742 
744  if (! eventInfo.isValid() ) {
745  ATH_MSG_WARNING("cannot retrieve event info from evtStore()!");
746  return StatusCode::SUCCESS;
747  }
748 
749  unsigned int eventType = ZdcEventInfo::ZdcEventUnknown;
750  unsigned int DAQMode = ZdcEventInfo::DAQModeUndef;
751 
754 
756 
757  if (! zdcSums.isValid() ) {
758  ATH_MSG_WARNING("evtStore() does not contain Collection with name "<< m_ZdcSumContainerKey);
759  return StatusCode::SUCCESS;
760  }
761  for (const auto& zdcSum : *zdcSums) {
762  if (zdcSum->zdcSide() == 0){
763  if (!eventTypeHandle.isAvailable()){
764  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!");
765  return StatusCode::SUCCESS;
766  }
767 
768  if (!DAQModeHandle.isAvailable()){
769  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!");
770  return StatusCode::SUCCESS;
771  }
772 
773  eventType = eventTypeHandle(*zdcSum);
774  DAQMode = DAQModeHandle(*zdcSum);
775  }
776  }
777 
778  ATH_MSG_DEBUG("The event type is: " << eventType);
779 
781  ATH_MSG_WARNING("The zdc sum container can be retrieved from the evtStore() but");
782  ATH_MSG_WARNING("Either the event type or the DAQ mode is the default unknown value");
783  ATH_MSG_WARNING("Most likely, there is no global sum (side == 0) entry in the zdc sum container");
784  return StatusCode::SUCCESS;
785  }
786 
787  if (eventType == ZdcEventInfo::ZdcEventPhysics || eventType == ZdcEventInfo::ZdcSimulation){
788  return fillPhysicsDataHistograms(ctx);
789  }
790 
791  ATH_MSG_WARNING("Event type should be PhysicsData/Simulation but it is NOT");
792  return StatusCode::SUCCESS;
793 }
794 
ZdcMonitorAlgorithm::fillPhysicsDataHistograms
StatusCode fillPhysicsDataHistograms(const EventContext &ctx) const
Definition: ZdcMonitorAlgorithm.cxx:162
ZdcEventInfo::ZdcEventPhysics
@ ZdcEventPhysics
Definition: ZdcEventInfo.h:16
ZdcMonitorAlgorithm::m_ZdcSumAverageTimeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumAverageTimeKey
Definition: ZdcMonitorAlgorithm.h:108
et
Extra patterns decribing particle interation process.
ZdcMonitorAlgorithm::m_ZdcModuleChisqKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleChisqKey
Definition: ZdcMonitorAlgorithm.h:117
ZdcMonitorAlgorithm::m_ZDCEnergyCutForCentroidValidBitMonitor
Gaudi::Property< float > m_ZDCEnergyCutForCentroidValidBitMonitor
Definition: ZdcMonitorAlgorithm.h:48
ZdcMonitorAlgorithm::m_moduleChisqHistMaxvalue
Gaudi::Property< float > m_moduleChisqHistMaxvalue
Definition: ZdcMonitorAlgorithm.h:51
ZDCPulseAnalyzer::HGUnderflowBit
@ HGUnderflowBit
Definition: ZDCPulseAnalyzer.h:31
ZdcMonitorAlgorithm::m_RPDChannelToolIndices
std::map< std::string, std::map< std::string, int > > m_RPDChannelToolIndices
Definition: ZdcMonitorAlgorithm.h:73
ZdcMonitorAlgorithm::m_nRpdStatusBits
static const int m_nRpdStatusBits
Definition: ZdcMonitorAlgorithm.h:67
ZdcMonitorAlgorithm::m_RPDSideStatusKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDSideStatusKey
Definition: ZdcMonitorAlgorithm.h:164
ZdcMonitorAlgorithm::m_ZdcSumUncalibSumKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumUncalibSumKey
Definition: ZdcMonitorAlgorithm.h:109
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
ZdcMonitorAlgorithm::m_ZdcModuleT0SubLGRefitKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleT0SubLGRefitKey
Definition: ZdcMonitorAlgorithm.h:125
ZdcMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: ZdcMonitorAlgorithm.cxx:739
ZdcMonitorAlgorithm::m_RPDChannelPileupFracKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelPileupFracKey
Definition: ZdcMonitorAlgorithm.h:139
ZDCPulseAnalyzer.h
RPDUtils::sides
constexpr std::initializer_list< unsigned int > sides
Definition: RPDUtils.h:17
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
CheckAppliedSFs.bin_width
bin_width
Definition: CheckAppliedSFs.py:242
ZdcMonitorAlgorithm::m_RPDyCentroidKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDyCentroidKey
Definition: ZdcMonitorAlgorithm.h:151
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
ZdcMonitorAlgorithm.h
AthMonitorAlgorithm::m_EventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Key for retrieving EventInfo from StoreGate.
Definition: AthMonitorAlgorithm.h:362
ZdcMonitorAlgorithm::m_RPDChannelAmplitudeCalibKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelAmplitudeCalibKey
Definition: ZdcMonitorAlgorithm.h:130
AthMonitorAlgorithm::getTrigDecisionTool
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
Definition: AthMonitorAlgorithm.cxx:189
ZdcMonitorAlgorithm::m_ZdcModuleContainerKey
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleContainerKey
Definition: ZdcMonitorAlgorithm.h:99
ZdcMonitorAlgorithm::m_ZdcModuleFitT0Key
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleFitT0Key
Definition: ZdcMonitorAlgorithm.h:116
ZdcEventInfo::ZdcEventUnknown
@ ZdcEventUnknown
Definition: ZdcEventInfo.h:16
ZdcMonitorAlgorithm::m_isOnline
Gaudi::Property< bool > m_isOnline
Definition: ZdcMonitorAlgorithm.h:84
ZdcMonitorAlgorithm::m_ZdcModuleChisqLGRefitKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleChisqLGRefitKey
Definition: ZdcMonitorAlgorithm.h:126
ZDC::RPDDataAnalyzer::ValidBit
@ ValidBit
Definition: RPDDataAnalyzer.h:40
ZdcMonitorAlgorithm::m_moduleChisqHistMinValue
Gaudi::Property< float > m_moduleChisqHistMinValue
Definition: ZdcMonitorAlgorithm.h:50
ZdcEventInfo::DAQMode
DAQMode
Definition: ZdcEventInfo.h:17
ZDCPulseAnalyzer::PulseBit
@ PulseBit
Definition: ZDCPulseAnalyzer.h:26
ZdcMonitorAlgorithm::m_ZdcModuleAmpLGRefitKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleAmpLGRefitKey
Definition: ZdcMonitorAlgorithm.h:123
ZdcMonitorAlgorithm::m_nSides
static const int m_nSides
Definition: ZdcMonitorAlgorithm.h:62
ZdcMonitorAlgorithm::m_enableCentroid
Gaudi::Property< bool > m_enableCentroid
Definition: ZdcMonitorAlgorithm.h:94
ZdcMonitorAlgorithm::calculate_inverse_bin_width
float calculate_inverse_bin_width(float event_value, std::string variable_name, const std::vector< float > &bin_edges) const
Definition: ZdcMonitorAlgorithm.cxx:38
dq_defect_copy_defect_database.channels
def channels
Definition: dq_defect_copy_defect_database.py:56
ZdcMonitorAlgorithm::m_ZdcModuleChisqOverAmpBinEdges
std::vector< float > m_ZdcModuleChisqOverAmpBinEdges
Definition: ZdcMonitorAlgorithm.h:76
ZDCPulseAnalyzer::HGOverflowBit
@ HGOverflowBit
Definition: ZDCPulseAnalyzer.h:29
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
ZdcMonitorAlgorithm::m_triggerSideA
Gaudi::Property< std::string > m_triggerSideA
Definition: ZdcMonitorAlgorithm.h:58
ZdcMonitorAlgorithm::m_RPDChannelMaxADCKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelMaxADCKey
Definition: ZdcMonitorAlgorithm.h:131
ZdcMonitorAlgorithm::m_ZdcModuleCalibTimeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleCalibTimeKey
Definition: ZdcMonitorAlgorithm.h:119
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
ZdcMonitorAlgorithm::m_triggerSideC
Gaudi::Property< std::string > m_triggerSideC
Definition: ZdcMonitorAlgorithm.h:59
ZdcMonitorAlgorithm::m_zdcInjPulserAmpMap
std::shared_ptr< ZdcInjPulserAmpMap > m_zdcInjPulserAmpMap
Definition: ZdcMonitorAlgorithm.h:78
ZdcMonitorAlgorithm::m_expected1N
Gaudi::Property< float > m_expected1N
Definition: ZdcMonitorAlgorithm.h:45
ZdcMonitorAlgorithm::m_HIEventShapeContainerKey
SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_HIEventShapeContainerKey
Definition: ZdcMonitorAlgorithm.h:100
ZdcMonitorAlgorithm::m_moduleChisqOverAmpHistMaxvalue
Gaudi::Property< float > m_moduleChisqOverAmpHistMaxvalue
Definition: ZdcMonitorAlgorithm.h:54
ZdcMonitorAlgorithm::m_RPDSubtrAmpSumKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDSubtrAmpSumKey
Definition: ZdcMonitorAlgorithm.h:145
ZdcMonitorAlgorithm::m_ZdcModuleStatusKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleStatusKey
Definition: ZdcMonitorAlgorithm.h:113
ZdcMonitorAlgorithm::m_RPDxCentroidKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDxCentroidKey
Definition: ZdcMonitorAlgorithm.h:148
ZdcMonitorAlgorithm::m_DAQModeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_DAQModeKey
Definition: ZdcMonitorAlgorithm.h:104
ZdcMonitorAlgorithm::m_ZdcSumModuleMaskKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumModuleMaskKey
Definition: ZdcMonitorAlgorithm.h:110
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
ZdcEventInfo::ZDCDECODINGERROR
@ ZDCDECODINGERROR
Definition: ZdcEventInfo.h:19
ZdcMonitorAlgorithm::m_CalInfoOn
Gaudi::Property< bool > m_CalInfoOn
Definition: ZdcMonitorAlgorithm.h:85
ZdcMonitorAlgorithm::m_RPDChannelStatusKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelStatusKey
Definition: ZdcMonitorAlgorithm.h:133
lumiFormat.i
int i
Definition: lumiFormat.py:85
Monitored
Generic monitoring tool for athena components.
Definition: GenericMonitoringTool.h:30
ZdcMonitorAlgorithm::m_RPDChannelSubtrAmpKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelSubtrAmpKey
Definition: ZdcMonitorAlgorithm.h:142
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ZdcMonitorAlgorithm::m_RPDChannelMaxSampleKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelMaxSampleKey
Definition: ZdcMonitorAlgorithm.h:132
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
ZdcEventInfo::ZdcSimulation
@ ZdcSimulation
Definition: ZdcEventInfo.h:16
ZdcMonitorAlgorithm::m_enableZDC
Gaudi::Property< bool > m_enableZDC
Definition: ZdcMonitorAlgorithm.h:90
ZdcMonitorAlgorithm::~ZdcMonitorAlgorithm
virtual ~ZdcMonitorAlgorithm()
Definition: ZdcMonitorAlgorithm.cxx:16
ZdcMonitorAlgorithm::m_RPDChannelAmplitudeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelAmplitudeKey
Definition: ZdcMonitorAlgorithm.h:129
ZDC::RpdSubtractCentroidTool::ValidBit
@ ValidBit
Definition: RpdSubtractCentroidTool.h:29
ZDCPulseAnalyzer::LowGainBit
@ LowGainBit
Definition: ZDCPulseAnalyzer.h:27
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ZdcMonitorAlgorithm::m_isStandalone
Gaudi::Property< bool > m_isStandalone
Definition: ZdcMonitorAlgorithm.h:89
ZdcMonitorAlgorithm::m_ZdcModuleCalibEnergyKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleCalibEnergyKey
Definition: ZdcMonitorAlgorithm.h:118
AthMonitorAlgorithm::fill
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
ZdcMonitorAlgorithm::m_RPDChannelPileupExpFitParamsKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelPileupExpFitParamsKey
Definition: ZdcMonitorAlgorithm.h:136
ZdcMonitorAlgorithm::m_ZdcSumContainerKey
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumContainerKey
Definition: ZdcMonitorAlgorithm.h:98
ZdcMonitorAlgorithm::m_nRpdCentroidStatusBits
static const int m_nRpdCentroidStatusBits
Definition: ZdcMonitorAlgorithm.h:68
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
xAOD::EventInfo_v1::ForwardDet
@ ForwardDet
The forward detectors.
Definition: EventInfo_v1.h:338
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ZdcMonitorAlgorithm::m_enableRPDAmp
Gaudi::Property< bool > m_enableRPDAmp
Definition: ZdcMonitorAlgorithm.h:93
AthMonitorAlgorithm::m_tools
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
Definition: AthMonitorAlgorithm.h:338
ZdcMonitorAlgorithm::m_ZDCSideToolIndices
std::map< std::string, int > m_ZDCSideToolIndices
Definition: ZdcMonitorAlgorithm.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
ZdcMonitorAlgorithm::m_ZDCModuleToolIndices
std::map< std::string, std::map< std::string, int > > m_ZDCModuleToolIndices
Definition: ZdcMonitorAlgorithm.h:72
RPDDataAnalyzer.h
ZdcMonitorAlgorithm::m_ZdcModuleT0LGRefitKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleT0LGRefitKey
Definition: ZdcMonitorAlgorithm.h:124
ZdcMonitorAlgorithm::m_eventTypeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_eventTypeKey
Definition: ZdcMonitorAlgorithm.h:102
ZdcMonitorAlgorithm::m_ZdcModuleTimeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleTimeKey
Definition: ZdcMonitorAlgorithm.h:115
ZdcEventInfo::DAQModeUndef
@ DAQModeUndef
Definition: ZdcEventInfo.h:17
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
ZdcMonitorAlgorithm::m_ZdcModuleMaxADCKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleMaxADCKey
Definition: ZdcMonitorAlgorithm.h:120
ZdcMonitorAlgorithm::ZdcMonitorAlgorithm
ZdcMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: ZdcMonitorAlgorithm.cxx:10
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
ZdcMonitorAlgorithm::m_ZdcModuleAmplitudeKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcModuleAmplitudeKey
Definition: ZdcMonitorAlgorithm.h:114
ZdcMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: ZdcMonitorAlgorithm.cxx:74
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ZdcMonitorAlgorithm::m_moduleChisqHistNumBins
Gaudi::Property< float > m_moduleChisqHistNumBins
Definition: ZdcMonitorAlgorithm.h:52
ZdcMonitorAlgorithm::m_moduleChisqOverAmpHistMinValue
Gaudi::Property< float > m_moduleChisqOverAmpHistMinValue
Definition: ZdcMonitorAlgorithm.h:53
ZdcMonitorAlgorithm::m_moduleChisqOverAmpHistNumBins
Gaudi::Property< float > m_moduleChisqOverAmpHistNumBins
Definition: ZdcMonitorAlgorithm.h:55
ZdcMonitorAlgorithm::m_ZdcModuleChisqBinEdges
std::vector< float > m_ZdcModuleChisqBinEdges
Definition: ZdcMonitorAlgorithm.h:75
ZdcMonitorAlgorithm::m_RPDreactionPlaneAngleKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDreactionPlaneAngleKey
Definition: ZdcMonitorAlgorithm.h:155
ZdcMonitorAlgorithm::m_isInjectedPulse
Gaudi::Property< bool > m_isInjectedPulse
Definition: ZdcMonitorAlgorithm.h:88
LArCellBinning.step
step
Definition: LArCellBinning.py:158
xAOD::EventInfo_v1::isEventFlagBitSet
bool isEventFlagBitSet(EventFlagSubDet subDet, size_t bit) const
Check one particular bit of one particular sub-detector.
Definition: EventInfo_v1.cxx:703
merge.status
status
Definition: merge.py:17
ZdcMonitorAlgorithm::calculate_log_bin_edges
void calculate_log_bin_edges(float min_value, float max_value, int num_bins, std::vector< float > &bin_edges)
Definition: ZdcMonitorAlgorithm.cxx:19
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
xAOD::lumiBlock
setTeId lumiBlock
Definition: L2StandAloneMuon_v1.cxx:327
ZDC::RpdSubtractCentroidTool::HasCentroidBit
@ HasCentroidBit
Definition: RpdSubtractCentroidTool.h:30
SG::ReadDecorHandle::isAvailable
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
RpdSubtractCentroidTool.h
ZdcMonitorAlgorithm::m_RPDcosDeltaReactionPlaneAngleKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDcosDeltaReactionPlaneAngleKey
Definition: ZdcMonitorAlgorithm.h:158
ZdcMonitorAlgorithm::m_ZdcSumCalibEnergyKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_ZdcSumCalibEnergyKey
Definition: ZdcMonitorAlgorithm.h:107
ZdcMonitorAlgorithm::m_enableTrigger
Gaudi::Property< bool > m_enableTrigger
Definition: ZdcMonitorAlgorithm.h:86
AthMonitorAlgorithm::getGroup
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
Definition: AthMonitorAlgorithm.cxx:164
ZdcMonitorAlgorithm::m_enableZDCPhysics
Gaudi::Property< bool > m_enableZDCPhysics
Definition: ZdcMonitorAlgorithm.h:91
ZdcEventInfo::RPDDECODINGERROR
@ RPDDECODINGERROR
Definition: ZdcEventInfo.h:19
ZdcMonitorAlgorithm::m_RPDcentroidStatusKey
SG::ReadDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDcentroidStatusKey
Definition: ZdcMonitorAlgorithm.h:161
ZdcMonitorAlgorithm::m_nZdcStatusBits
static const int m_nZdcStatusBits
Definition: ZdcMonitorAlgorithm.h:66
ZdcMonitorAlgorithm::m_energyCutForModuleFractMonitor
Gaudi::Property< float > m_energyCutForModuleFractMonitor
Definition: ZdcMonitorAlgorithm.h:47