13 "CaloCellGroup of allowed deviation of cov[i]");
15 "CaloCellGroup of allowed deviation of cov[i] (average over one FEB,");
18 "Number of samples (covr elements) to check");
35 ATH_MSG_INFO (
"Initialize covariance tolerances (CaloCellGroup)" ) ;
38 ATH_MSG_ERROR (
"Failed to initialize CaloCellGroup of covariance tolerances!" ) ;
39 return StatusCode::FAILURE;
42 ATH_MSG_ERROR (
"Configuration error: Expected three covariance tolerance values (one per gain), got "
44 return StatusCode::FAILURE;
50 ATH_MSG_INFO (
"Initialize covariance FEB tolerances (CaloCellGroup)" ) ;
53 ATH_MSG_ERROR (
"Failed to initialize CaloCellGroup of covariance tolerances!" ) ;
54 return StatusCode::FAILURE;
57 ATH_MSG_ERROR (
"Configuration error: Expected three covariance tolerance values (one per gain), got "
59 return StatusCode::FAILURE;
64 return StatusCode::SUCCESS;
70if (gain<0 || gain>2) {
75 if (val.m_vAutoCorr.size()==0) {
79 if (
ref.m_vAutoCorr.size()==0) {
84 const float covVal=val.m_vAutoCorr[0];
85 const float covRef=
ref.m_vAutoCorr[0];
87 const Identifier id=cabling->cnvToIdentifier(chid);
94 if (!dataPerFEB || dataPerFEB->
febid!=febid) {
98 dataPerFEB->
covVal+=covVal;
99 dataPerFEB->
covRef+=covRef;
106 const size_t s=val.m_vAutoCorr.size();
107 const size_t sr=
ref.m_vAutoCorr.size();
108 for (
size_t i=0;i<s;++i) {
109 const float covVal_i=val.m_vAutoCorr[i];
110 if (fabs(covVal_i)>1.0) {
112 << std::setprecision(4) << covVal_i <<
endmsg;
120 const float covRef_i=
ref.m_vAutoCorr[i];
121 if (fabs(covVal_i-covRef_i)> covTolerance){
123 std::stringstream devMsg;
124 devMsg.setf(std::ios::fixed,std::ios::floatfield);
125 devMsg <<
"Deviating! " <<
channelDescription(chid, cabling, bcCont,gain) <<
" AutoCorr[" << i <<
"]: " << std::setprecision(4) << covVal_i
126 <<
" (" << covRef_i <<
", " << std::setprecision(2) << ((covVal_i-covRef_i)/covRef_i)*100 <<
"%)";
143 msg().setf(std::ios::fixed,std::ios::floatfield);
145 dataPerFeb.covVal/=dataPerFeb.nEntries;
146 dataPerFeb.covRef/=dataPerFeb.nEntries;
148 const Identifier id=cabling->cnvToIdentifier(dataPerFeb.chid);
149 const float& covToleranceFEB=
m_covToleranceFEB.valuesForCell(
id)[dataPerFeb.gain];
151 if (fabs(dataPerFeb.covVal-dataPerFeb.covRef)>covToleranceFEB){
153 << dataPerFeb.covVal <<
" (" << dataPerFeb.covRef <<
")" <<
endmsg;
168 StatusCode
sc=StatusCode::SUCCESS;
171 sc=StatusCode::RECOVERABLE;
174 sc=StatusCode::RECOVERABLE;
const boost::regex ref(r_ef)
#define ATH_MSG_WARNING(x)
LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete > LArAutoCorrValidationBase
@LArAutoCorrValidatonAlg.h
LArBadXCont< LArBadChannel > LArBadChannelCont
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool msgLvl(const MSG::Level lvl) const
virtual StatusCode preLoop() override
Executed before the loop over all channels to reset global sums.
CaloCellGroupList m_covToleranceFEB
unsigned m_nSamplesToCheck
Number of elements of the Covariance vector that should be checked.
std::vector< DataPerFEB > m_vDataPerFEB
bool validateChannel(const LArCondObj &ref, const LArCondObj &val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) override final
Method to validate readout channels.
CaloCellGroupList m_covTolerance
std::vector< std::string > m_covToleranceInit
Covariance tolerance (job-Property)
LArAutoCorrValidationAlg(const std::string &name, ISvcLocator *pSvcLocator)
Regular algorithm constructor.
bool febSummary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
Method to compare FEB averages.
virtual StatusCode summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) override
Summary method executed after the loop over all channels.
unsigned m_nEntriesGlobal
std::vector< std::string > m_covToleranceFEBInit
Covariace tolerance of one FEB (job-Property)
LArAutoCorrComplete::LArCondObj LArCondObj
const LArOnlineID_Base * m_onlineHelper
const CaloCell_Base_ID * m_caloId
virtual StatusCode summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
const std::string channelDescription(const HWIdentifier &chid, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont, const unsigned gain=99, bool isFeb=false) const
unsigned m_nFailedValidation