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

#include <LArCaliWaveValidationAlg.h>

Inheritance diagram for LArCaliWaveValidationAlg:
Collaboration diagram for LArCaliWaveValidationAlg:

Classes

class  DataPerFEB

Public Member Functions

 LArCaliWaveValidationAlg (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 LArCaliWaveContainer::ConstConditionsMapIterator CONTIT
typedef LArCaliWaveContainer::LArCondObj LArCondObj
typedef LArCaliWaveContainer::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 LArCaliWaveContainerm_reference
 Pointer to container with reference values.
const LArCaliWaveContainerm_validation
 Pointer to container to be validated.
LArCaliWaveContainerm_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< LArCaliWaveContainerm_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 the pedestal single 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_ampToleranceInit
 Amplitude tolerance (in permills) (job-Property)
CaloCellGroupList m_ampTolerance
std::vector< std::string > m_ampToleranceFEBInit
 Tolerance for the average amplitude of one FEB (in permills) (job-Property)
CaloCellGroupList m_ampToleranceFEB
std::vector< std::string > m_fwhmToleranceInit
 FWHM tolerance (in permills) (job-Property)
CaloCellGroupList m_fwhmTolerance
std::vector< std::string > m_fwhmToleranceFEBInit
 Tolerance for the average FWHM of one FEB (in permills) (job-Property)
CaloCellGroupList m_fwhmToleranceFEB
bool m_timeShift
std::vector< DataPerFEBm_vDataPerFEB
double m_ampGlobalVal =0
double m_fwhmGlobalVal =0
double m_ampGlobalRef =0
double m_fwhmGlobalRef =0
unsigned m_nEntriesGlobal =0
LArWaveHelper m_waveHelper
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 36 of file LArCaliWaveValidationAlg.h.

Member Typedef Documentation

◆ CBANDCHANANDGAIN_t

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

Definition at line 145 of file LArCalibValidationAlg.h.

◆ CHECKEDID_t

typedef std::vector<std::pair<HWIdentifier, bool > > LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::FEBANDGAIN_t
privateinherited

Definition at line 135 of file LArCalibValidationAlg.h.

◆ LArCondObj

◆ MULTICHANCOLL

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArCaliWaveValidationAlg()

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

Regular algorithm constructor.

Definition at line 8 of file LArCaliWaveValidationAlg.cxx.

8 :
9 LArCaliWaveValidationBase(name,pSvcLocator) {
10
11 declareProperty("TimeShiftDetection",m_timeShift=false,
12 "Enable detection of Pulse timeShift");
13 declareProperty("AmplitudeTolerance",m_ampToleranceInit,
14 "CaloCellGroup of allowed deviation of the amplitude (in permills)");
15 declareProperty("CaliWaveFWHMTolerance",m_fwhmToleranceInit,
16 "CaloCellGroup of llowed deviation of the FWHM (in permills)");
17 declareProperty("AmplitudeToleranceFEB",m_ampToleranceFEBInit,
18 "CaloCellGroup of llowed deviation of the amplitude (average over one FEB, in permills)");
19 declareProperty("CaliWaveFWHMToleranceFEB",m_fwhmToleranceFEBInit,
20 "CaloCellGroup of allowed deviation of the FWHM (average over one FEB, in permills)");
21}
LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer > LArCaliWaveValidationBase
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< std::string > m_ampToleranceFEBInit
Tolerance for the average amplitude of one FEB (in permills) (job-Property)
std::vector< std::string > m_ampToleranceInit
Amplitude tolerance (in permills) (job-Property)
std::vector< std::string > m_fwhmToleranceFEBInit
Tolerance for the average FWHM of one FEB (in permills) (job-Property)
std::vector< std::string > m_fwhmToleranceInit
FWHM tolerance (in permills) (job-Property)

Member Function Documentation

◆ channelDescription()

const std::string LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::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 }
Algorithm to validate LAr Autocorr;.

◆ 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< LArCaliWaveContainer, LArCaliWaveContainer >::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;}

◆ 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 69 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 }
58}

◆ febOutput()

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

◆ febSummary()

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

Method to compare FEB averages.

Definition at line 181 of file LArCaliWaveValidationAlg.cxx.

181 {
182
183 unsigned nBadFebs=0;
184
185 msg().precision(3);
186 msg().setf(std::ios::fixed,std::ios::floatfield);
187
188 for (DataPerFEB& dataPerFeb : m_vDataPerFEB) {
189 dataPerFeb.ampVal/=dataPerFeb.nEntries;
190 dataPerFeb.ampRef/=dataPerFeb.nEntries;
191 dataPerFeb.fwhmVal/=dataPerFeb.nEntries;
192 dataPerFeb.fwhmRef/=dataPerFeb.nEntries;
193
194 const Identifier id=cabling->cnvToIdentifier(dataPerFeb.chid);
195 const float& ampToleranceFEB=m_ampToleranceFEB.valuesForCell(id)[dataPerFeb.gain];
196 const float& fwhmToleranceFEB=m_fwhmToleranceFEB.valuesForCell(id)[dataPerFeb.gain];
197
198 if (fabs(dataPerFeb.ampVal-dataPerFeb.ampRef)/dataPerFeb.ampRef*1000>ampToleranceFEB ||
199 fabs(dataPerFeb.fwhmVal-dataPerFeb.fwhmRef)/dataPerFeb.fwhmRef*1000>fwhmToleranceFEB) {
200 msg() << m_myMsgLvl << "Deviating! " <<channelDescription(dataPerFeb.febid,cabling,bcCont,dataPerFeb.gain,true)<< "Average Amp: " << dataPerFeb.ampVal << " (" << dataPerFeb.ampRef << ")"
201 << " FWHM: " << dataPerFeb.fwhmVal << " (" << dataPerFeb.fwhmRef << ")" << endmsg;
202 ++nBadFebs;
203 ATH_MSG_DEBUG ( "Amplitude FEB tolerance: " << ampToleranceFEB << ", FWHM FEB tolerance: " << fwhmToleranceFEB ) ;
204 }
205 }
206
207 if (nBadFebs) {
208 ATH_MSG_ERROR ( "Found " << nBadFebs << " out of " << m_vDataPerFEB.size() << " FEBs deviating from reference" ) ;
209 return false;
210 }
211 else {
212 ATH_MSG_INFO ( "All " << m_vDataPerFEB.size() << " FEBs withing given tolerance." ) ;
213 return true;
214 }
215}
#define endmsg
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(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< LArCaliWaveContainer, LArCaliWaveContainer >::finalize ( )
inlineinherited

Definition at line 76 of file LArCalibValidationAlg.h.

76{return StatusCode::SUCCESS;}

◆ findFailedPatterns()

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

◆ getRefObj()

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

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

Implements LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >.

Definition at line 49 of file LArCaliWaveValidationAlg.h.

49 {
50 return m_reference->get(chid,gain);
51 }

◆ initialize()

StatusCode LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::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 LArCaliWaveValidationAlg::preLoop ( )
overrideprivatevirtual

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

Reimplemented from LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >.

Definition at line 24 of file LArCaliWaveValidationAlg.cxx.

24 {
30 bool stat;
31
32 //Initialize CaloCellGroups:
33
34 ATH_MSG_INFO ( "Initialize Amplitude Tolerances (CaloCellGroup)" ) ;
36 if (!stat) {
37 ATH_MSG_ERROR ( "Failed to initialize CaloCellGroup of amplitude tolerances!" ) ;
38 return StatusCode::FAILURE;
39 }
40 if (m_ampTolerance.getDefaults().size()!=3) {
41 ATH_MSG_ERROR ( "Configuration error: Expected three amplitude tolerance values (one per gain), got "
42 << m_ampTolerance.getDefaults().size() ) ;
43 return StatusCode::FAILURE;
44 }
45 if (this->msgLvl(MSG::DEBUG)) m_ampTolerance.printDef();//for debugging....
46
47
48
49 ATH_MSG_INFO ( "Initialize FWHM Tolerances (CaloCellGroup)" ) ;
51 if (!stat) {
52 ATH_MSG_ERROR ( "Failed to initialize CaloCellGroup of FWHM tolerances!" ) ;
53 return StatusCode::FAILURE;
54 }
55 if (m_fwhmTolerance.getDefaults().size()!=3) {
56 ATH_MSG_ERROR ( "Configuration error: Expected three FWHM tolerance values (one per gain), got "
57 << m_fwhmTolerance.getDefaults().size() ) ;
58 return StatusCode::FAILURE;
59 }
60 if (this->msgLvl(MSG::DEBUG)) m_fwhmTolerance.printDef();//for debugging....
61
62
63
64 ATH_MSG_INFO ( "Initialize FEB Amplitude Tolerances (CaloCellGroup)" ) ;
66 if (!stat) {
67 ATH_MSG_ERROR ( "Failed to initialize CaloCellGroup of FEB amplitude tolerances!" ) ;
68 return StatusCode::FAILURE;
69 }
70 if (m_ampToleranceFEB.getDefaults().size()!=3) {
71 ATH_MSG_ERROR ( "Configuration error: Expected three FEB amplitude tolerance values (one per gain), got "
72 << m_ampToleranceFEB.getDefaults().size() ) ;
73 return StatusCode::FAILURE;
74 }
75 if (this->msgLvl(MSG::DEBUG)) m_ampToleranceFEB.printDef();//for debugging....
76
77
78
79 ATH_MSG_INFO ( "Initialize FEB FWHM Tolerances (CaloCellGroup)" ) ;
81 if (!stat) {
82 ATH_MSG_ERROR ( "Failed to initialize CaloCellGroup of FEB FWHM tolerances!" ) ;
83 return StatusCode::FAILURE;
84 }
85 if (m_fwhmToleranceFEB.getDefaults().size()!=3) {
86 ATH_MSG_ERROR ( "Configuration error: Expected three FEB FWHM tolerance values (one per gain), got "
87 << m_fwhmToleranceFEB.getDefaults().size() ) ;
88 return StatusCode::FAILURE;
89 }
90 if (this->msgLvl(MSG::DEBUG)) m_fwhmToleranceFEB.printDef();//for debugging....
91
92 return StatusCode::SUCCESS;
93}

◆ 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 LArCaliWaveValidationAlg::summary ( const LArOnOffIdMapping * cabling,
const LArBadChannelCont * bcCont )
overrideprivatevirtual

Summary method executed after the loop over all channels.

Reimplemented from LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >.

Definition at line 216 of file LArCaliWaveValidationAlg.cxx.

216 {
217 StatusCode sc=StatusCode::SUCCESS;
218 //1nd step: Check the FEB-averages:
219 if (m_doFebAverages && !febSummary(cabling, bcCont))
220 sc=StatusCode::RECOVERABLE;
221 //2st step: Call the summary method from base-class (single-channel summary)
222 if (!LArCaliWaveValidationBase::summary(cabling, bcCont).isSuccess())
223 sc=StatusCode::RECOVERABLE;
224 //3rd step: Check the gobal averages:
225 if (m_nEntriesGlobal) {
230 }
231 ATH_MSG_INFO ( "Global amplitude average: " << m_ampGlobalVal << " Reference:" << m_ampGlobalRef
232 << " Deviation:" << (m_ampGlobalVal-m_ampGlobalRef)/m_ampGlobalRef*1000 <<" permille" ) ;
233 ATH_MSG_INFO ( "Gobal FWHM average: " << m_fwhmGlobalVal << " Reference:" << m_fwhmGlobalRef
234 << " Deviation:" << (m_fwhmGlobalVal-m_fwhmGlobalRef)/m_fwhmGlobalRef*1000 <<" permille" ) ;
235 return sc;
236}
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

Definition at line 61 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");
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
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 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 }

◆ validateChannel()

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

Method to validate the pedestal single readout channels.

Implements LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >.

Definition at line 95 of file LArCaliWaveValidationAlg.cxx.

95 {
96
97 if (gain<0 || gain>2) {
98 ATH_MSG_ERROR ( "Unexpected gain value " << gain ) ;
99 return false;
100 }
101
102 double ampVal=0;
103 double ampRef=0;
104
105 float fwhmVal=0;
106 float fwhmRef=0;
107
108 float TmaxVal=0;
109 float TmaxRef=0;
110
111 float TMaxshift=5.;
112
113
114 const Identifier id=cabling->cnvToIdentifier(chid);
115
116 const float ampTolerance=m_ampTolerance.valuesForCell(id)[gain];
117 const float fwhmTolerance=m_fwhmTolerance.valuesForCell(id)[gain];
118
119 if (val.size()>0 && ref.size()>0){
120
121 //We assume that the caliwavevec has only one entry.
122 const LArWave& wave=val[0];
123 const LArWave& waver=ref[0];
124 TmaxVal=m_waveHelper.getMax(wave);
125 TmaxRef=m_waveHelper.getMax(waver);
126 ampVal=m_waveHelper.getMaxAmp(wave);
127 ampRef=m_waveHelper.getMaxAmp(waver);
128 fwhmVal=wave.getDt()*m_waveHelper.getWidth(wave);
129 fwhmRef=waver.getDt()*m_waveHelper.getWidth(waver);
130 }
131
132 const HWIdentifier febid=m_onlineHelper->feb_Id(chid);
133
134
135 DataPerFEB* dataPerFEB = m_vDataPerFEB.empty() ? nullptr : &(m_vDataPerFEB.back());
136 if (!dataPerFEB || dataPerFEB->febid!=febid) {//Got to new FEB
137 m_vDataPerFEB.push_back(DataPerFEB(chid,febid,gain));
138 dataPerFEB=&(m_vDataPerFEB.back());
139 }
140
141 dataPerFEB->ampVal+=ampVal;
142 dataPerFEB->ampRef+=ampRef;
143 dataPerFEB->fwhmVal+=fwhmVal;
144 dataPerFEB->fwhmRef+=fwhmRef;
145 ++(dataPerFEB->nEntries);
146
147
148 m_ampGlobalVal+=ampVal;
149 m_fwhmGlobalVal+=fwhmVal;
150 m_ampGlobalRef+=ampRef;
151 m_fwhmGlobalRef+=fwhmRef;
153
154 bool retval=true;
155 if (fabs(TmaxVal-TmaxRef)> TMaxshift && m_timeShift==true) {
156 retval=false;
158 msg() << m_myMsgLvl << "Shifted! " << channelDescription(chid,cabling,bcCont,gain) << " Tmax: " << TmaxVal << " ( " << TmaxRef << " ) " << endmsg;
159
160 }
161
162
163 if (ampRef!=0 && fwhmRef!=0 && (1000*fabs(ampVal-ampRef)/ampRef > ampTolerance || 1000*fabs(fwhmVal-fwhmRef)/fwhmRef > fwhmTolerance)) {
164 retval=false;
166 msg().precision(2);
167 msg().setf(std::ios::fixed,std::ios::floatfield);
168 msg() << this->m_myMsgLvl << "Deviating! " << channelDescription(chid,cabling,bcCont,gain) << " Amp: " << ampVal << "( " << ampRef
169 << ", " << 100.*(ampVal-ampRef)/ampRef << " %)"
170 << " FWHM: " << fwhmVal << " ( " << fwhmRef << ", " << 100*(fwhmVal-fwhmRef)/fwhmVal << " %)" << endmsg;
171 ATH_MSG_DEBUG ( "Amplitude FEB tolerance: " << ampTolerance << ", FWHM FEB tolerance: " << fwhmTolerance ) ;
172 }
173 }
174 if (!retval && m_nFailedValidation==m_maxmessages)
175 msg() << this->m_myMsgLvl << "Channel deviation message has already been printed " << m_maxmessages << " times. Now silent..." << endmsg;
176
177 return retval;
178}
const boost::regex ref(r_ef)
const double & getDt() const
delta time
Definition LArWave.h:50

Member Data Documentation

◆ m_ampGlobalRef

double LArCaliWaveValidationAlg::m_ampGlobalRef =0
private

Definition at line 104 of file LArCaliWaveValidationAlg.h.

◆ m_ampGlobalVal

double LArCaliWaveValidationAlg::m_ampGlobalVal =0
private

Definition at line 102 of file LArCaliWaveValidationAlg.h.

◆ m_ampTolerance

CaloCellGroupList LArCaliWaveValidationAlg::m_ampTolerance
private

Definition at line 63 of file LArCaliWaveValidationAlg.h.

◆ m_ampToleranceFEB

CaloCellGroupList LArCaliWaveValidationAlg::m_ampToleranceFEB
private

Definition at line 67 of file LArCaliWaveValidationAlg.h.

◆ m_ampToleranceFEBInit

std::vector<std::string> LArCaliWaveValidationAlg::m_ampToleranceFEBInit
private

Tolerance for the average amplitude of one FEB (in permills) (job-Property)

Definition at line 66 of file LArCaliWaveValidationAlg.h.

◆ m_ampToleranceInit

std::vector<std::string> LArCaliWaveValidationAlg::m_ampToleranceInit
private

Amplitude tolerance (in permills) (job-Property)

Definition at line 62 of file LArCaliWaveValidationAlg.h.

◆ m_BCKey

Definition at line 168 of file LArCalibValidationAlg.h.

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

◆ m_bcMask

◆ 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< LArCaliWaveContainer, LArCaliWaveContainer >::m_chanFile
protectedinherited

File name to store list of deviating channels.

Definition at line 240 of file LArCalibValidationAlg.h.

◆ m_chanFileName

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

File name to store list of deviating channels.

Definition at line 237 of file LArCalibValidationAlg.h.

◆ m_checkCompleteness

bool LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::m_checkedIds
protectedinherited

Definition at line 234 of file LArCalibValidationAlg.h.

◆ m_CLKey

Definition at line 169 of file LArCalibValidationAlg.h.

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

◆ 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< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::m_febFileName
protectedinherited

File name to store list of FEBs with deviating channels.

Definition at line 243 of file LArCalibValidationAlg.h.

◆ m_fwhmGlobalRef

double LArCaliWaveValidationAlg::m_fwhmGlobalRef =0
private

Definition at line 105 of file LArCaliWaveValidationAlg.h.

◆ m_fwhmGlobalVal

double LArCaliWaveValidationAlg::m_fwhmGlobalVal =0
private

Definition at line 103 of file LArCaliWaveValidationAlg.h.

◆ m_fwhmTolerance

CaloCellGroupList LArCaliWaveValidationAlg::m_fwhmTolerance
private

Definition at line 71 of file LArCaliWaveValidationAlg.h.

◆ m_fwhmToleranceFEB

CaloCellGroupList LArCaliWaveValidationAlg::m_fwhmToleranceFEB
private

Definition at line 75 of file LArCaliWaveValidationAlg.h.

◆ m_fwhmToleranceFEBInit

std::vector<std::string> LArCaliWaveValidationAlg::m_fwhmToleranceFEBInit
private

Tolerance for the average FWHM of one FEB (in permills) (job-Property)

Definition at line 74 of file LArCaliWaveValidationAlg.h.

◆ m_fwhmToleranceInit

std::vector<std::string> LArCaliWaveValidationAlg::m_fwhmToleranceInit
private

FWHM tolerance (in permills) (job-Property)

Definition at line 70 of file LArCaliWaveValidationAlg.h.

◆ m_gainMap

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

Definition at line 159 of file LArCalibValidationAlg.h.

◆ m_isSC

BooleanProperty LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::m_isSC
protectedinherited

Definition at line 173 of file LArCalibValidationAlg.h.

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

◆ m_maxmessages

unsigned LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::m_myMsgLvl
protectedinherited

Message level for reporting deviations.

Definition at line 163 of file LArCalibValidationAlg.h.

◆ m_myMsgLvlProp

int LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::m_myMsgLvlProp
protectedinherited

Definition at line 164 of file LArCalibValidationAlg.h.

◆ m_nBad

unsigned LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::m_nChecked
protectedinherited

Number of channels that where checked (grand-total)

Definition at line 218 of file LArCalibValidationAlg.h.

◆ m_nEntriesGlobal

unsigned LArCaliWaveValidationAlg::m_nEntriesGlobal =0
private

Definition at line 106 of file LArCaliWaveValidationAlg.h.

◆ m_nFailedValidation

unsigned LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::m_nFailedValidation
protectedinherited

Number of channels for which vaildateChannel returned false.

Definition at line 221 of file LArCalibValidationAlg.h.

◆ m_nNoReference

unsigned LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::m_nNoReference
protectedinherited

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

Definition at line 230 of file LArCalibValidationAlg.h.

◆ m_nValidated

unsigned LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::m_nValidated
protectedinherited

Number of channels for which vaildateChannel returned true.

Definition at line 224 of file LArCalibValidationAlg.h.

◆ m_onlineHelper

Definition at line 177 of file LArCalibValidationAlg.h.

◆ m_patchCBs

Gaudi::Property<std::vector<unsigned int> > LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::m_patchMissingFEBs
protectedinherited

wether missing FEBS (incomplete COOL channels) should be patched

Definition at line 204 of file LArCalibValidationAlg.h.

◆ m_printFailedPattern

bool LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::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_timeShift

bool LArCaliWaveValidationAlg::m_timeShift
private

Definition at line 77 of file LArCaliWaveValidationAlg.h.

◆ m_useBCInfo

bool LArCalibValidationAlg< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::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< LArCaliWaveContainer, LArCaliWaveContainer >::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> LArCaliWaveValidationAlg::m_vDataPerFEB
private

Definition at line 99 of file LArCaliWaveValidationAlg.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_waveHelper

LArWaveHelper LArCaliWaveValidationAlg::m_waveHelper
private

Definition at line 108 of file LArCaliWaveValidationAlg.h.


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