From ff75d1a25e4b186ccf1e3ac9f641cd7bda0db100 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Fri, 23 Mar 2018 03:34:16 +0100
Subject: [PATCH] LArRecUtils: Don't complain in LArADC2MeVCondAlg if low gain
 data are missing.

In one configuration, observed errors from LArADC2MeVCondAlg because
low gain data were missing.  With LArADC2MeVTool, this would not be
an error.  Update LArADC2MeVCondAlg so that this is not an error.
---
 LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.cxx | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.cxx
index ff68d9decd8..53e534e9cbb 100644
--- a/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.cxx
+++ b/LArCalorimeter/LArRecUtils/src/LArADC2MeVCondAlg.cxx
@@ -14,6 +14,7 @@
 #include "LArElecCalib/ILArHVScaleCorr.h"
 #include "LArIdentifier/LArOnlineID.h"
 #include "LArIdentifier/LArOnline_SuperCellID.h"
+#include "CaloIdentifier/CaloGain.h"
 
 #include "LArElecCalib/ILArFEBConfigReader.h"
 
@@ -271,8 +272,14 @@ StatusCode LArADC2MeVCondAlg::execute() {
 	// ADC2DAC is a vector (polynomial fit of ramps)
 	const ILArRamp::RampRef_t adc2dac = larRamp->ADC2DAC(chid,igain);
 	if (adc2dac.size()<2) {
-	  msg(MSG::ERROR) << "No Ramp found for channel " << larOnlineID->channel_name(chid) << ", gain " << igain << endmsg;
-	  ++nNoRamp;
+          // Low gain can sometimes be missing: not an error.
+          if (igain == CaloGain::LARLOWGAIN) {
+            msg(MSG::VERBOSE) << "No Ramp found for channel " << larOnlineID->channel_name(chid) << ", gain " << igain << endmsg;
+          }
+          else {
+            msg(MSG::ERROR) << "No Ramp found for channel " << larOnlineID->channel_name(chid) << ", gain " << igain << endmsg;
+            ++nNoRamp;
+          }
 	  continue;
 	}
 
-- 
GitLab