ATLAS Offline Software
Loading...
Searching...
No Matches
LArAutoCorrValidationAlg Class Reference

#include <LArAutoCorrValidationAlg.h>

Inheritance diagram for LArAutoCorrValidationAlg:
Collaboration diagram for LArAutoCorrValidationAlg:

Classes

class  DataPerFEB

Public Member Functions

 LArAutoCorrValidationAlg (const std::string &name, ISvcLocator *pSvcLocator)
 Regular algorithm constructor.
StatusCode initialize ()
 Standard initialization method.
StatusCode execute ()
 Standard execute method This method has to be emtpy since all the job is done in stop()
StatusCode stop ()
 Standard finalize method Loops over all channels and all gains and calls the validateChannel method.
StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Types

typedef LArAutoCorrComplete::ConstConditionsMapIterator CONTIT
typedef LArAutoCorrComplete::LArCondObj LArCondObj
typedef LArAutoCorrComplete::MultChanCollection MULTICHANCOLL
typedef std::vector< std::pair< HWIdentifier, bool > > CHECKEDID_t
 Keeping track of channels failing the validation criteria (per gain)

Protected Member Functions

const std::string channelDescription (const HWIdentifier &chid, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont, const unsigned gain=99, bool isFeb=false) const
 Textual representation of gain and location of a certain cell or FEB.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

MSG::Level m_myMsgLvl
 Message level for reporting deviations.
int m_myMsgLvlProp
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey
SG::ReadCondHandleKey< LArBadChannelContm_BCKey
SG::ReadCondHandleKey< LArCalibLineMappingm_CLKey
LArBadChannelMask m_bcMask
Gaudi::Property< std::vector< std::string > > m_problemsToMask
Gaudi::Property< std::vector< unsigned int > > m_patchCBs
BooleanProperty m_isSC
const LArOnlineID_Basem_onlineHelper
const CaloCell_Base_IDm_caloId
const LArAutoCorrCompletem_reference
 Pointer to container with reference values.
const LArAutoCorrCompletem_validation
 Pointer to container to be validated.
LArAutoCorrCompletem_nc_validation
 Non-const pointer to container to be validated (for FEB patching)
std::string m_validationKey
 SG key of the container to be validated (job-property)
SG::ReadCondHandleKey< LArAutoCorrCompletem_referenceKey
 SG key of the reference container (job-property)
bool m_useBCInfo
 Flag set to true in order to use bad-channel info for the channel description as well as to ingore some types of bad-channels via the masking tool.
bool m_checkCompleteness
 wether completeness shall be checked or not (job-property)
bool m_patchMissingFEBs
 wether missing FEBS (incomplete COOL channels) should be patched
bool m_printFailedPattern
 wether to check for FEBs and Calib-lines with many deviating channels
bool m_doFebAverages
 wether to compare feb-averages (used only by derived class)
unsigned m_maxmessages
 Limit for the number of messages about indiviual deviating channels (usd only by derived class)
unsigned m_nChecked
 Number of channels that where checked (grand-total)
unsigned m_nFailedValidation
 Number of channels for which vaildateChannel returned false.
unsigned m_nValidated
 Number of channels for which vaildateChannel returned true.
unsigned m_nBad
 Number of channels known to be bad according to the bad-channel tool.
unsigned m_nNoReference
 Number of channels for which not reference channel could be found.
std::vector< CHECKEDID_tm_checkedIds
std::string m_chanFileName
 File name to store list of deviating channels.
std::ofstream m_chanFile
 File name to store list of deviating channels.
std::string m_febFileName
 File name to store list of FEBs with deviating channels.
std::ofstream m_febFile
 File name to store list of FEBs with deviating channels.
bool m_useCorrChannel

Private Types

typedef std::vector< std::pair< HWIdentifier, unsigned > > FEBANDGAIN_t
typedef std::vector< std::pair< std::pair< HWIdentifier, unsigned >, unsigned > > CBANDCHANANDGAIN_t
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

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.
LArCondObj getRefObj (const HWIdentifier chid, const int gain) const override final
 Method implmented in derived class to get the reference object from ref-container.
virtual StatusCode summary (const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) override
 Summary method executed after the loop over all channels.
virtual StatusCode preLoop () override
 Executed before the loop over all channels to reset global sums.
bool febSummary (const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
 Method to compare FEB averages.
bool checkCoolChannelCompleteness (const LArOnOffIdMapping *cabling, const LArCalibLineMapping *clCont, const LArBadChannelCont *bcCont)
 Verify if all FEBs of each Cool-Channel is present.
bool patchMissingFEBs (const FEBANDGAIN_t &febAndGain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
 Fills channels of missing FEBs.
bool patchMissingCalibBoards (const CBANDCHANANDGAIN_t &CBAndGain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
 Fills channels of missing calib boards.
void febOutput (const HWIdentifier &febid, const unsigned gain, const unsigned nGood, const unsigned nBad)
void findFailedPatterns (const LArOnOffIdMapping *cabling, const LArCalibLineMapping *clCont, const LArBadChannelCont *bcCont)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::vector< std::string > m_covToleranceFEBInit
 Covariace tolerance of one FEB (job-Property)
CaloCellGroupList m_covToleranceFEB
std::vector< std::string > m_covToleranceInit
 Covariance tolerance (job-Property)
CaloCellGroupList m_covTolerance
unsigned m_nSamplesToCheck {}
 Number of elements of the Covariance vector that should be checked.
bool m_checkFifthSample {}
std::vector< DataPerFEBm_vDataPerFEB
double m_covGlobalVal {}
double m_covGlobalRef {}
unsigned m_nEntriesGlobal {}
std::vector< std::string > m_gainMap
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 31 of file LArAutoCorrValidationAlg.h.

Member Typedef Documentation

◆ CBANDCHANANDGAIN_t

typedef std::vector<std::pair<std::pair<HWIdentifier,unsigned>, unsigned > > LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::CBANDCHANANDGAIN_t
privateinherited

Definition at line 145 of file LArCalibValidationAlg.h.

◆ CHECKEDID_t

typedef std::vector<std::pair<HWIdentifier, bool > > LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::CHECKEDID_t
protectedinherited

Keeping track of channels failing the validation criteria (per gain)

Definition at line 233 of file LArCalibValidationAlg.h.

◆ CONTIT

◆ FEBANDGAIN_t

typedef std::vector<std::pair<HWIdentifier,unsigned> > LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::FEBANDGAIN_t
privateinherited

Definition at line 135 of file LArCalibValidationAlg.h.

◆ LArCondObj

Definition at line 80 of file LArCalibValidationAlg.h.

◆ MULTICHANCOLL

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArAutoCorrValidationAlg()

LArAutoCorrValidationAlg::LArAutoCorrValidationAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Regular algorithm constructor.

Definition at line 9 of file LArAutoCorrValidationAlg.cxx.

9 :
10 LArAutoCorrValidationBase(name,pSvcLocator) {
11
12 declareProperty("AutoCorrTolerance",m_covToleranceInit,
13 "CaloCellGroup of allowed deviation of cov[i]");
14 declareProperty("AutoCorrToleranceFEB",m_covToleranceFEBInit,
15 "CaloCellGroup of allowed deviation of cov[i] (average over one FEB,");
16
17 declareProperty("NSamplesToCheck",m_nSamplesToCheck=1,
18 "Number of samples (covr elements) to check");
19
20
21 declareProperty("CheckFifthSample",m_checkFifthSample=false);
25}
LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete > LArAutoCorrValidationBase
@LArAutoCorrValidatonAlg.h
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
unsigned m_nSamplesToCheck
Number of elements of the Covariance vector that should be checked.
std::vector< std::string > m_covToleranceInit
Covariance tolerance (job-Property)
std::vector< std::string > m_covToleranceFEBInit
Covariace tolerance of one FEB (job-Property)

Member Function Documentation

◆ channelDescription()

const std::string LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::channelDescription ( const HWIdentifier & chid,
const LArOnOffIdMapping * cabling,
const LArBadChannelCont * bcCont,
const unsigned gain = 99,
bool isFeb = false ) const
protectedinherited

Textual representation of gain and location of a certain cell or FEB.

Parameters
chidOnline identifier of the cell or FEB
gainGain in question, a value >2 won't be printed
iFebIf chid should be interpreted as FEB identifer
Returns
string Creates a string containing the Side, Barrel-EC, FT, Slot, FEB-Channel in human-readable form

◆ checkCoolChannelCompleteness()

bool LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::checkCoolChannelCompleteness ( const LArOnOffIdMapping * cabling,
const LArCalibLineMapping * clCont,
const LArBadChannelCont * bcCont )
privateinherited

Verify if all FEBs of each Cool-Channel is present.

Returns
False if at least one incomplete COOL channel is found, true otherwise Calls patchMissingFEBs if m_patchMissingFebs is true

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::execute ( )
inlineinherited

Standard execute method This method has to be emtpy since all the job is done in stop()

Definition at line 69 of file LArCalibValidationAlg.h.

69{return StatusCode::SUCCESS;}
Algorithm to validate LAr Autocorr;.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ febOutput()

void LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::febOutput ( const HWIdentifier & febid,
const unsigned gain,
const unsigned nGood,
const unsigned nBad )
privateinherited

◆ febSummary()

bool LArAutoCorrValidationAlg::febSummary ( const LArOnOffIdMapping * cabling,
const LArBadChannelCont * bcCont )
private

Method to compare FEB averages.

Definition at line 140 of file LArAutoCorrValidationAlg.cxx.

140 {
141 unsigned nBadFebs=0;
142 msg().precision(3);
143 msg().setf(std::ios::fixed,std::ios::floatfield);
144 for (DataPerFEB& dataPerFeb : m_vDataPerFEB) {
145 dataPerFeb.covVal/=dataPerFeb.nEntries;
146 dataPerFeb.covRef/=dataPerFeb.nEntries;
147
148 const Identifier id=cabling->cnvToIdentifier(dataPerFeb.chid);
149 const float& covToleranceFEB=m_covToleranceFEB.valuesForCell(id)[dataPerFeb.gain];
150
151 if (fabs(dataPerFeb.covVal-dataPerFeb.covRef)>covToleranceFEB){
152 msg() << m_myMsgLvl << "Deviating!" << channelDescription(dataPerFeb.febid, cabling, bcCont, dataPerFeb.gain,true) << "Average AutoCorr: "
153 << dataPerFeb.covVal << " (" << dataPerFeb.covRef << ")" << endmsg;
154 ++nBadFebs;
155 }
156 }
157
158 if (nBadFebs) {
159 msg() << m_myMsgLvl << "Found " << nBadFebs << " out of " << m_vDataPerFEB.size() << " FEBs deviating from reference" << endmsg;
160 return false;
161 }
162 else {
163 ATH_MSG_INFO ( "All" << m_vDataPerFEB.size() << " FEBs withing given tolerance." ) ;
164 return true;
165 }
166}
#define endmsg
#define ATH_MSG_INFO(x)
std::vector< DataPerFEB > m_vDataPerFEB
const std::string channelDescription(const HWIdentifier &chid, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont, const unsigned gain=99, bool isFeb=false) const

◆ finalize()

StatusCode LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::finalize ( )
inlineinherited

Definition at line 76 of file LArCalibValidationAlg.h.

76{return StatusCode::SUCCESS;}

◆ findFailedPatterns()

void LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::findFailedPatterns ( const LArOnOffIdMapping * cabling,
const LArCalibLineMapping * clCont,
const LArBadChannelCont * bcCont )
privateinherited

◆ getRefObj()

LArCondObj LArAutoCorrValidationAlg::getRefObj ( const HWIdentifier chid,
const int gain ) const
inlinefinaloverrideprivatevirtual

Method implmented in derived class to get the reference object from ref-container.

Implements LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >.

Definition at line 47 of file LArAutoCorrValidationAlg.h.

47 {
48 return m_reference->get(chid,gain);
49 }

◆ initialize()

StatusCode LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::initialize ( )
inherited

Standard initialization method.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ patchMissingCalibBoards()

bool LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::patchMissingCalibBoards ( const CBANDCHANANDGAIN_t & CBAndGain,
const LArOnOffIdMapping * cabling,
const LArBadChannelCont * bcCont )
privateinherited

Fills channels of missing calib boards.

Parameters
febAndGainA vector of (CalibId,gain) pairs
Returns
True on success, false otherwise Inserts the corresponding channel from the reference container as correction channel to the validation container

◆ patchMissingFEBs()

bool LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::patchMissingFEBs ( const FEBANDGAIN_t & febAndGain,
const LArOnOffIdMapping * cabling,
const LArBadChannelCont * bcCont )
privateinherited

Fills channels of missing FEBs.

Parameters
febAndGainA vector of (febId,gain) pairs
Returns
True on success, false otherwise Inserts the corresponding channel from the reference container as correction channel to the validation container

◆ preLoop()

StatusCode LArAutoCorrValidationAlg::preLoop ( )
overrideprivatevirtual

Executed before the loop over all channels to reset global sums.

Reimplemented from LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >.

Definition at line 28 of file LArAutoCorrValidationAlg.cxx.

28 {
32
33 bool stat;
34
35 ATH_MSG_INFO ( "Initialize covariance tolerances (CaloCellGroup)" ) ;
37 if (!stat) {
38 ATH_MSG_ERROR ( "Failed to initialize CaloCellGroup of covariance tolerances!" ) ;
39 return StatusCode::FAILURE;
40 }
41 if (m_covTolerance.getDefaults().size()!=3) {
42 ATH_MSG_ERROR ( "Configuration error: Expected three covariance tolerance values (one per gain), got "
43 << m_covTolerance.getDefaults().size() ) ;
44 return StatusCode::FAILURE;
45 }
46 if (this->msgLvl(MSG::DEBUG)) m_covTolerance.printDef();//for debugging....
47
48
49
50 ATH_MSG_INFO ( "Initialize covariance FEB tolerances (CaloCellGroup)" ) ;
52 if (!stat) {
53 ATH_MSG_ERROR ( "Failed to initialize CaloCellGroup of covariance tolerances!" ) ;
54 return StatusCode::FAILURE;
55 }
56 if (m_covToleranceFEB.getDefaults().size()!=3) {
57 ATH_MSG_ERROR ( "Configuration error: Expected three covariance tolerance values (one per gain), got "
58 << m_covToleranceFEB.getDefaults().size() ) ;
59 return StatusCode::FAILURE;
60 }
61 if (this->msgLvl(MSG::DEBUG)) m_covToleranceFEB.printDef();//for debugging....
62
63
64 return StatusCode::SUCCESS;
65
66}
#define ATH_MSG_ERROR(x)

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ stop()

Standard finalize method Loops over all channels and all gains and calls the validateChannel method.

◆ summary()

StatusCode LArAutoCorrValidationAlg::summary ( const LArOnOffIdMapping * cabling,
const LArBadChannelCont * bcCont )
overrideprivatevirtual

Summary method executed after the loop over all channels.

Reimplemented from LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >.

Definition at line 167 of file LArAutoCorrValidationAlg.cxx.

167 {
168 StatusCode sc=StatusCode::SUCCESS;
169 //1nd step: Check the FEB-averages:
170 if (m_doFebAverages && !febSummary(cabling, bcCont))
171 sc=StatusCode::RECOVERABLE;
172 //2nd step: Call the summary method from base-class (single-channel summary)
173 if (!LArAutoCorrValidationBase::summary(cabling, bcCont).isSuccess())
174 sc=StatusCode::RECOVERABLE;
175 //3rd step: Check the gobal averages:
176 if (m_nEntriesGlobal) {
179 }
180 ATH_MSG_INFO ( "Global autocorr average: " << m_covGlobalVal << " Referecence:" << m_covGlobalRef
181 << " Deviation:" << m_covGlobalVal-m_covGlobalRef ) ;
182 return sc;
183}
static Double_t sc
bool febSummary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
Method to compare FEB averages.
virtual StatusCode summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_WARNING(x)
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ validateChannel()

bool LArAutoCorrValidationAlg::validateChannel ( const LArCondObj & ref,
const LArCondObj & val,
const HWIdentifier chid,
const int gain,
const LArOnOffIdMapping * cabling,
const LArBadChannelCont * bcCont )
finaloverrideprivatevirtual

Method to validate readout channels.

Implements LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >.

Definition at line 68 of file LArAutoCorrValidationAlg.cxx.

68 {
69
70if (gain<0 || gain>2) {
71 ATH_MSG_ERROR ( "Unexpected gain value " << gain ) ;
72 return false;
73 }
74
75 if (val.m_vAutoCorr.size()==0) {
76 msg() << this->m_myMsgLvl << "Empty! No AC found for " << channelDescription(chid,cabling, bcCont, gain) << endmsg;
77 return false;
78 }
79 if (ref.m_vAutoCorr.size()==0) {
80 ATH_MSG_WARNING ( "No reference value found for " << channelDescription(chid,cabling, bcCont, gain) ) ;
81 return false;
82 }
83
84 const float covVal=val.m_vAutoCorr[0];
85 const float covRef=ref.m_vAutoCorr[0];
86
87 const Identifier id=cabling->cnvToIdentifier(chid);
88
89 const float covTolerance=m_covTolerance.valuesForCell(id)[gain];
90
91
92 HWIdentifier febid=m_onlineHelper->feb_Id(chid);
93 DataPerFEB* dataPerFEB = m_vDataPerFEB.empty() ? nullptr : &(m_vDataPerFEB.back());
94 if (!dataPerFEB || dataPerFEB->febid!=febid) {//Got to new FEB
95 m_vDataPerFEB.push_back(DataPerFEB(chid,febid,gain));
96 dataPerFEB=&(m_vDataPerFEB.back());
97 }
98 dataPerFEB->covVal+=covVal;
99 dataPerFEB->covRef+=covRef;
100 ++(dataPerFEB->nEntries);
101
102 m_covGlobalVal+=covVal;
103 m_covGlobalRef+=covRef;
105
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) {
111 msg() << this->m_myMsgLvl << "Unphysical! " << channelDescription(chid, cabling, bcCont, gain) << " AutoCorr[" << i << "]: "
112 << std::setprecision(4) << covVal_i << endmsg;
113 return false;
114 }
115 if (m_checkFifthSample and i==5 and fabs(covVal_i)>0.13) {
116 msg() << this->m_myMsgLvl << "LARGE Autocorr sample 5 " << channelDescription(chid, cabling, bcCont, gain) << " AutoCorr[" << i << "]: " << covVal_i << endmsg;
117 return false;
118 }
119 if (i<m_nSamplesToCheck && i<sr) {
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 << "%)";
127 msg() << this->m_myMsgLvl << devMsg.str() << endmsg;
128 ATH_MSG_DEBUG ( "Covariance Tolerance: " << covTolerance ) ;
129 }
131 msg() << this->m_myMsgLvl << "Channel deviation message has already been printed " << m_maxmessages << " times. Now silent..." << endmsg;
132 return false;
133 }//end if > tolerance
134 }//end if nSamplesToCheck
135 }// End loop over all samples
136 return true;
137}
const boost::regex ref(r_ef)
#define ATH_MSG_DEBUG(x)

Member Data Documentation

◆ m_BCKey

Definition at line 168 of file LArCalibValidationAlg.h.

168{this, "BadChanKey", "LArBadChannel", "SG bad channels key"};

◆ m_bcMask

Definition at line 170 of file LArCalibValidationAlg.h.

◆ m_cablingKey

Definition at line 167 of file LArCalibValidationAlg.h.

167{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_caloId

Definition at line 178 of file LArCalibValidationAlg.h.

◆ m_chanFile

std::ofstream LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_chanFile
protectedinherited

File name to store list of deviating channels.

Definition at line 240 of file LArCalibValidationAlg.h.

◆ m_chanFileName

std::string LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_chanFileName
protectedinherited

File name to store list of deviating channels.

Definition at line 237 of file LArCalibValidationAlg.h.

◆ m_checkCompleteness

bool LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_checkCompleteness
protectedinherited

wether completeness shall be checked or not (job-property)

Definition at line 201 of file LArCalibValidationAlg.h.

◆ m_checkedIds

std::vector<CHECKEDID_t> LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_checkedIds
protectedinherited

Definition at line 234 of file LArCalibValidationAlg.h.

◆ m_checkFifthSample

bool LArAutoCorrValidationAlg::m_checkFifthSample {}
private

Definition at line 72 of file LArAutoCorrValidationAlg.h.

72{};

◆ m_CLKey

Definition at line 169 of file LArCalibValidationAlg.h.

169{this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"};

◆ m_covGlobalRef

double LArAutoCorrValidationAlg::m_covGlobalRef {}
private

Definition at line 95 of file LArAutoCorrValidationAlg.h.

◆ m_covGlobalVal

double LArAutoCorrValidationAlg::m_covGlobalVal {}
private

Definition at line 95 of file LArAutoCorrValidationAlg.h.

◆ m_covTolerance

CaloCellGroupList LArAutoCorrValidationAlg::m_covTolerance
private

Definition at line 67 of file LArAutoCorrValidationAlg.h.

◆ m_covToleranceFEB

CaloCellGroupList LArAutoCorrValidationAlg::m_covToleranceFEB
private

Definition at line 62 of file LArAutoCorrValidationAlg.h.

◆ m_covToleranceFEBInit

std::vector<std::string> LArAutoCorrValidationAlg::m_covToleranceFEBInit
private

Covariace tolerance of one FEB (job-Property)

Definition at line 61 of file LArAutoCorrValidationAlg.h.

◆ m_covToleranceInit

std::vector<std::string> LArAutoCorrValidationAlg::m_covToleranceInit
private

Covariance tolerance (job-Property)

Definition at line 66 of file LArAutoCorrValidationAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doFebAverages

bool LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_doFebAverages
protectedinherited

wether to compare feb-averages (used only by derived class)

Definition at line 210 of file LArCalibValidationAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_febFile

std::ofstream LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_febFile
protectedinherited

File name to store list of FEBs with deviating channels.

Definition at line 246 of file LArCalibValidationAlg.h.

◆ m_febFileName

std::string LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_febFileName
protectedinherited

File name to store list of FEBs with deviating channels.

Definition at line 243 of file LArCalibValidationAlg.h.

◆ m_gainMap

std::vector<std::string> LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_gainMap
privateinherited

Definition at line 159 of file LArCalibValidationAlg.h.

◆ m_isSC

BooleanProperty LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_isSC
protectedinherited

Definition at line 173 of file LArCalibValidationAlg.h.

173{this, "SuperCells", false, "Working on SuperCells ?"};

◆ m_maxmessages

unsigned LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_maxmessages
protectedinherited

Limit for the number of messages about indiviual deviating channels (usd only by derived class)

Definition at line 213 of file LArCalibValidationAlg.h.

◆ m_myMsgLvl

MSG::Level LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_myMsgLvl
protectedinherited

Message level for reporting deviations.

Definition at line 163 of file LArCalibValidationAlg.h.

◆ m_myMsgLvlProp

int LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_myMsgLvlProp
protectedinherited

Definition at line 164 of file LArCalibValidationAlg.h.

◆ m_nBad

unsigned LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_nBad
protectedinherited

Number of channels known to be bad according to the bad-channel tool.

Definition at line 227 of file LArCalibValidationAlg.h.

◆ m_nc_validation

Non-const pointer to container to be validated (for FEB patching)

Definition at line 188 of file LArCalibValidationAlg.h.

◆ m_nChecked

unsigned LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_nChecked
protectedinherited

Number of channels that where checked (grand-total)

Definition at line 218 of file LArCalibValidationAlg.h.

◆ m_nEntriesGlobal

unsigned LArAutoCorrValidationAlg::m_nEntriesGlobal {}
private

Definition at line 96 of file LArAutoCorrValidationAlg.h.

96{};

◆ m_nFailedValidation

unsigned LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_nFailedValidation
protectedinherited

Number of channels for which vaildateChannel returned false.

Definition at line 221 of file LArCalibValidationAlg.h.

◆ m_nNoReference

unsigned LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_nNoReference
protectedinherited

Number of channels for which not reference channel could be found.

Definition at line 230 of file LArCalibValidationAlg.h.

◆ m_nSamplesToCheck

unsigned LArAutoCorrValidationAlg::m_nSamplesToCheck {}
private

Number of elements of the Covariance vector that should be checked.

Definition at line 70 of file LArAutoCorrValidationAlg.h.

70{};

◆ m_nValidated

unsigned LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_nValidated
protectedinherited

Number of channels for which vaildateChannel returned true.

Definition at line 224 of file LArCalibValidationAlg.h.

◆ m_onlineHelper

const LArOnlineID_Base* LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_onlineHelper
protectedinherited

Definition at line 177 of file LArCalibValidationAlg.h.

◆ m_patchCBs

Gaudi::Property<std::vector<unsigned int> > LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_patchCBs
protectedinherited

Definition at line 172 of file LArCalibValidationAlg.h.

172{this, "PatchCBs", {}, "List of missing CalibBoards to patch using values from reference container."};

◆ m_patchMissingFEBs

bool LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_patchMissingFEBs
protectedinherited

wether missing FEBS (incomplete COOL channels) should be patched

Definition at line 204 of file LArCalibValidationAlg.h.

◆ m_printFailedPattern

bool LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_printFailedPattern
protectedinherited

wether to check for FEBs and Calib-lines with many deviating channels

Definition at line 207 of file LArCalibValidationAlg.h.

◆ m_problemsToMask

Gaudi::Property<std::vector<std::string> > LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_problemsToMask
protectedinherited

Definition at line 171 of file LArCalibValidationAlg.h.

171{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"};

◆ m_reference

Pointer to container with reference values.

Definition at line 182 of file LArCalibValidationAlg.h.

◆ m_referenceKey

SG key of the reference container (job-property)

Definition at line 194 of file LArCalibValidationAlg.h.

194{this,"ReferenceKey","", "SG key of the LArConditionsContainer used as reference"};

◆ m_useBCInfo

bool LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_useBCInfo
protectedinherited

Flag set to true in order to use bad-channel info for the channel description as well as to ingore some types of bad-channels via the masking tool.

Definition at line 198 of file LArCalibValidationAlg.h.

◆ m_useCorrChannel

bool LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_useCorrChannel
protectedinherited

Definition at line 248 of file LArCalibValidationAlg.h.

◆ m_validation

Pointer to container to be validated.

Definition at line 185 of file LArCalibValidationAlg.h.

◆ m_validationKey

std::string LArCalibValidationAlg< LArAutoCorrComplete, LArAutoCorrComplete >::m_validationKey
protectedinherited

SG key of the container to be validated (job-property)

Definition at line 191 of file LArCalibValidationAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vDataPerFEB

std::vector<DataPerFEB> LArAutoCorrValidationAlg::m_vDataPerFEB
private

Definition at line 92 of file LArAutoCorrValidationAlg.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: