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

#include <LArRampValidationAlg.h>

Inheritance diagram for LArRampValidationAlg:
Collaboration diagram for LArRampValidationAlg:

Classes

class  DataPerRegion

Public Member Functions

 LArRampValidationAlg (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 LArRampComplete::ConstConditionsMapIterator CONTIT
typedef LArRampComplete::LArCondObj LArCondObj
typedef LArRampComplete::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 ILArRampm_reference
 Pointer to container with reference values.
const LArRampCompletem_validation
 Pointer to container to be validated.
LArRampCompletem_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< ILArRampm_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 ramps 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 deviateFromAvg (const LArCondObj &val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
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_contKey
 To store Gain Keys for Raw Ramps (job-Property)
float m_rawrampTimeTolerance
 Raw Ramp time tolerance (in ns) (job-Property)
float m_rawrampTimeADC
 Raw Ramp ADC (job-Property)
std::vector< std::string > m_toleranceInit
 Ramp tolerance as init string for CellGroupObject (job-Property)
CaloCellGroupList m_tolerance
 Ramp tolerance as CaloCellGroup object.
std::vector< std::string > m_toleranceInitFEB
 Ramp tolerance (FEB average) as CaloCellGroup object (job-Property)
CaloCellGroupList m_toleranceFEB
 Ramp tolerance (FEB average) as initializer string CaloCellGroup object.
bool m_hasRawRampContainer
 To check if Raw Ramps are found.
std::unordered_map< HWIdentifier, DataPerRegionm_vDataPerFEB
std::unordered_map< Identifier, DataPerRegionm_vDataPerSector
LArRawRampContainerm_rawRampContainer
double m_rampGlobalVal
double m_rmsGlobalVal
double m_rampGlobalRef
double m_rmsGlobalRef
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 40 of file LArRampValidationAlg.h.

Member Typedef Documentation

◆ CBANDCHANANDGAIN_t

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

Definition at line 145 of file LArCalibValidationAlg.h.

◆ CHECKEDID_t

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

Definition at line 135 of file LArCalibValidationAlg.h.

◆ LArCondObj

typedef LArRampComplete::LArCondObj LArCalibValidationAlg< LArRampComplete, ILArRamp >::LArCondObj
protectedinherited

Definition at line 80 of file LArCalibValidationAlg.h.

◆ MULTICHANCOLL

Definition at line 81 of file LArCalibValidationAlg.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArRampValidationAlg()

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

Regular algorithm constructor.

Definition at line 8 of file LArRampValidationAlg.cxx.

8 :
9 LArRampValidationBase(name,pSvcLocator),
17{
18 declareProperty("KeyList", m_contKey);
19 declareProperty("RawRampTimeMinADC",m_rawrampTimeADC=100,
20 "Minimal ADC, where the RampTime is computed");
21 declareProperty("RampTolerance",m_toleranceInit,
22 "Allowed deviation of ramp (%)");
23 declareProperty("RampToleranceFEB",m_toleranceInitFEB,
24 "Allowed deviation of ramp (average over one FEB,");
25 declareProperty("RawRampTimeTolerance",m_rawrampTimeTolerance=1.,
26 "Allowed deviation of the reconstructed time (ns)");
27}
LArCalibValidationAlg< LArRampComplete, ILArRamp > LArRampValidationBase
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
float m_rawrampTimeADC
Raw Ramp ADC (job-Property)
float m_rawrampTimeTolerance
Raw Ramp time tolerance (in ns) (job-Property)
bool m_hasRawRampContainer
To check if Raw Ramps are found.
std::vector< std::string > m_contKey
To store Gain Keys for Raw Ramps (job-Property)
std::vector< std::string > m_toleranceInitFEB
Ramp tolerance (FEB average) as CaloCellGroup object (job-Property)
std::vector< std::string > m_toleranceInit
Ramp tolerance as init string for CellGroupObject (job-Property)
LArRawRampContainer * m_rawRampContainer

Member Function Documentation

◆ channelDescription()

const std::string LArCalibValidationAlg< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::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.

◆ deviateFromAvg()

bool LArRampValidationAlg::deviateFromAvg ( const LArCondObj & val,
const HWIdentifier chid,
const int gain,
const LArOnOffIdMapping * cabling,
const LArBadChannelCont * bcCont )
private

Definition at line 220 of file LArRampValidationAlg.cxx.

220 {
221
222 Identifier offlineID = cabling->cnvToIdentifier(chid);
223 const Identifier regId=m_caloId->region_id(offlineID);
224 const int eta = m_caloId->eta(offlineID);
225 const Identifier sectorId=m_caloId->cell_id(regId,eta,gain);
226
227 const auto& dataPerSector=m_vDataPerSector[sectorId];
228 if (dataPerSector.rampVal == 0 ){
229 ATH_MSG_ERROR ( "Found Sector with Ramp Average equals to zero" ) ;
230 ATH_MSG_ERROR ( "Sector : pos_neg " << m_caloId->side(regId) << " region " << m_caloId->region(regId)
231 << " layer " << m_caloId->sampling(regId) << " eta " << eta << " gain " << gain);
232 return false;
233 }else{
234 float ratio = val.m_vRamp[1]/dataPerSector.rampVal;
235 if ( ratio > 2.){
236 msg() << m_myMsgLvl << "!!! Deviating Sector channel = " <<channelDescription(chid,cabling,bcCont,gain) << "Ramp: " << val.m_vRamp[1] << " (Average Sector Ramp: " << dataPerSector.rampRef << ")" << endmsg;
237 return false;
238 }
239 }
240 return true;
241}
Scalar eta() const
pseudorapidity method
#define endmsg
#define ATH_MSG_ERROR(x)
const std::string channelDescription(const HWIdentifier &chid, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont, const unsigned gain=99, bool isFeb=false) const
std::unordered_map< Identifier, DataPerRegion > m_vDataPerSector

◆ 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< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::febOutput ( const HWIdentifier & febid,
const unsigned gain,
const unsigned nGood,
const unsigned nBad )
privateinherited

◆ febSummary()

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

Method to compare FEB averages.

Definition at line 163 of file LArRampValidationAlg.cxx.

163 {
164
165 // FEBs
166 unsigned nBadFebs=0;
167 for(auto& dataPerFebPair : m_vDataPerFEB) {
168 DataPerRegion& dataPerFeb=dataPerFebPair.second;
169 const HWIdentifier febAndGainId=dataPerFebPair.first;
170 const int gain=m_onlineHelper->channel(febAndGainId);
171 const HWIdentifier febId=m_onlineHelper->feb_Id(febAndGainId);
172 dataPerFeb.rampVal/=dataPerFeb.nEntries;
173 dataPerFeb.rampRef/=dataPerFeb.nEntries;
174
175 ATH_MSG_DEBUG ( " nb of channels = " << dataPerFeb.nEntries
176 << " for FEB " << channelDescription(febId,cabling,bcCont) ) ;
177
178 //Get offline identifier of channel 0 of this FEB, should be good enough ...
179 const Identifier id=cabling->cnvToIdentifier(febId);
180 const float& tolerance=m_toleranceFEB.valuesForCell(id)[gain];
181
182 if (fabs(dataPerFeb.rampVal-dataPerFeb.rampRef)/dataPerFeb.rampRef > tolerance){
183 msg().precision(3);
184 msg().setf(std::ios::fixed,std::ios::floatfield);
185 msg() << m_myMsgLvl << "Deviating! " << channelDescription(febId,cabling,bcCont,gain,true) << "Average Ramp: "
186 << dataPerFeb.rampVal << " (reference: " << dataPerFeb.rampRef << ")" << endmsg;
187 ATH_MSG_DEBUG ( "Ramp FEB average tolerance: " << tolerance ) ;
188 ++nBadFebs;
189 }
190 }
191
192 if (nBadFebs) {
193 ATH_MSG_ERROR ( "Found " << nBadFebs << " out of " << m_vDataPerFEB.size()
194 << " FEBs deviating from reference" ) ;
195 return false;
196 } else {
197 ATH_MSG_INFO ( "All " << m_vDataPerFEB.size()
198 << " FEBs withing given tolerance." ) ;
199 return true;
200 }
201 /*
202 // Sectors
203 std::vector<DataPerSector>::iterator it2=m_vDataPerSector.begin();
204 std::vector<DataPerSector>::iterator it2_e=m_vDataPerSector.end();
205 for (;it2!=it2_e;++it2) {
206 DataPerSector& dataPerSector=*it2;
207 dataPerSector.rampVal/=dataPerSector.nEntries;
208 //dataPerSector.rampRef/=dataPerSector.nEntries;
209
210 (*m_log) << MSG::DEBUG << " nb of channels = " << dataPerSector.nEntries
211 << " for Sector : gain " << dataPerSector.gain
212 << " pos_neg " << dataPerSector.pos_neg
213 << " region " << dataPerSector.region
214 << " layer " << dataPerSector.layer
215 << " eta " << dataPerSector.eta << endmsg;
216 }
217 */
218}
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
CaloCellGroupList m_toleranceFEB
Ramp tolerance (FEB average) as initializer string CaloCellGroup object.
std::unordered_map< HWIdentifier, DataPerRegion > m_vDataPerFEB
constexpr double tolerance

◆ finalize()

StatusCode LArCalibValidationAlg< LArRampComplete, ILArRamp >::finalize ( )
inlineinherited

Definition at line 76 of file LArCalibValidationAlg.h.

76{return StatusCode::SUCCESS;}

◆ findFailedPatterns()

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

◆ getRefObj()

LArRampValidationAlg::LArCondObj LArRampValidationAlg::getRefObj ( const HWIdentifier chid,
const int gain ) const
finaloverrideprivatevirtual

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

Implements LArCalibValidationAlg< LArRampComplete, ILArRamp >.

Definition at line 265 of file LArRampValidationAlg.cxx.

265 {
266 auto ramp=m_reference->ADC2DAC(chid,gain);
267 return LArCondObj(std::vector<float>(ramp.begin(),ramp.end()));
268}

◆ initialize()

StatusCode LArCalibValidationAlg< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::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 LArRampValidationAlg::preLoop ( )
overrideprivatevirtual

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

Reimplemented from LArCalibValidationAlg< LArRampComplete, ILArRamp >.

Definition at line 30 of file LArRampValidationAlg.cxx.

30 {
31
32 //Initialize CellGroup object storing the threhsolds:
33 if (m_tolerance.setDefinition(m_caloId,m_toleranceInit,msg())==false) {
34 ATH_MSG_ERROR ( "Failed to initialize CaloCellGroup of thresholds!" ) ;
35 return StatusCode::FAILURE;
36 }
37
38 if (m_tolerance.getDefaults().size()!=3) {
39 ATH_MSG_ERROR ( "Expected three values in CaloCellGroup of thresholds for three gains!" ) ;
40 return StatusCode::FAILURE;
41 }
42 if (this->msgLvl(MSG::DEBUG)) m_tolerance.printDef();//for debugging....
43
44
45 //Initialize CellGroup object storing the threhsolds:
46 if (m_toleranceFEB.setDefinition(m_caloId,m_toleranceInitFEB,msg())==false) {
47 ATH_MSG_ERROR ( "Failed to initialize CaloCellGroup of thresholds!" ) ;
48 return StatusCode::FAILURE;
49 }
50
51 if (m_toleranceFEB.getDefaults().size()!=3) {
52 ATH_MSG_ERROR ( "Expected three values in CaloCellGroup of thresholds for three gains!" ) ;
53 return StatusCode::FAILURE;
54 }
55 if (this->msgLvl(MSG::DEBUG)) m_toleranceFEB.printDef();//for debugging....
56
57
62
63 // Retrieve Raw Ramps Container
65 for (const std::string& key_it : m_contKey) {
66 StatusCode sc=detStore()->retrieve(m_rawRampContainer,key_it);
67 if (sc!=StatusCode::SUCCESS || !m_rawRampContainer) {
68 ATH_MSG_WARNING ( "Unable to retrieve LArRawRampContainer with key " << key_it ) ;
69 }
70 else {
71 ATH_MSG_DEBUG ( "Got LArRawRampContainer with key " << key_it ) ;
73 }
74 }
76 ATH_MSG_WARNING ( "No LArRawRampContainer found. Only fitted ramp will be tested " ) ;
77
78 // Check Raw Ramps
80
83 for (;cont_it!=cont_it_e;++cont_it) {
84 const std::vector<LArRawRamp::RAMPPOINT_t>& singleRamp=(*cont_it)->theRamp();
85 for (unsigned int DACIndex=0; DACIndex<singleRamp.size(); DACIndex++) {
86
87 ATH_MSG_DEBUG ( "DAC Index:" << DACIndex
88 << " DAC value : " << singleRamp[DACIndex].DAC
89 << " ADC value : " << singleRamp[DACIndex].ADC
90 << " Time " << singleRamp[DACIndex].TimeMax ) ;
91
92 // Check point with DAC > m_rawrampTimeDAC where DeltaT is meaningful
93 if(singleRamp[DACIndex].ADC > m_rawrampTimeADC){
94 if (fabs(singleRamp[DACIndex].TimeMax) > m_rawrampTimeTolerance){
95 msg().setf(std::ios::fixed,std::ios::floatfield);
96 msg().precision(2);
97 msg() << m_myMsgLvl << "Deviating! chan= " << (*cont_it)->channelID()<< " gain= "<<(*cont_it)->gain() << " DeltaT=" << singleRamp[DACIndex].TimeMax << " DAC = " << singleRamp[DACIndex].DAC << endmsg;
98 }
99 break; //Stop loop after testing the m_rawrampTimeDAC DAC point
100 }
101
102 } //end DAC points loop
103 } // end channels loop
104 }
105 return StatusCode::SUCCESS;
106}
#define ATH_MSG_WARNING(x)
static Double_t sc
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
CaloCellGroupList m_tolerance
Ramp tolerance as CaloCellGroup object.
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ 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()

StatusCode LArCalibValidationAlg< LArRampComplete, ILArRamp >::stop ( )
inherited

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

◆ summary()

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

Summary method executed after the loop over all channels.

Reimplemented from LArCalibValidationAlg< LArRampComplete, ILArRamp >.

Definition at line 243 of file LArRampValidationAlg.cxx.

243 {
244 StatusCode sc=StatusCode::SUCCESS;
245 //1nd step: Check the FEB-averages:
246 if (m_doFebAverages && !febSummary(cabling, bcCont))
247 sc=StatusCode::RECOVERABLE;
248 //2nd step: Call the summary method from base-class (single-channel summary)
249 if (!LArRampValidationBase::summary(cabling, bcCont).isSuccess())
250 sc=StatusCode::RECOVERABLE;
251 //3rd step: Check the gobal averages:
252 if (m_nEntriesGlobal) {
257 }
258 ATH_MSG_INFO ( "Gobal ramp average: " << m_rampGlobalVal << " Reference: " << m_rampGlobalRef
259 << " Deviation: " << m_rampGlobalVal-m_rampGlobalRef ) ;
260
261 return sc;
262}
virtual StatusCode summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
bool febSummary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
Method to compare FEB averages.

◆ 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}
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 LArRampValidationAlg::validateChannel ( const LArCondObj & ref,
const LArCondObj & val,
const HWIdentifier chid,
const int gain,
const LArOnOffIdMapping * cabling,
const LArBadChannelCont * bcCont )
finaloverrideprivatevirtual

Method to validate the ramps single readout channels.

Implements LArCalibValidationAlg< LArRampComplete, ILArRamp >.

Definition at line 108 of file LArRampValidationAlg.cxx.

108 {
109
110
111 HWIdentifier febid=m_onlineHelper->feb_Id(chid);
112 Identifier offlineID = cabling->cnvToIdentifier(chid);
113
115
116 // Store average Ramp value per FEB
117 DataPerRegion& dataPerFEB=m_vDataPerFEB[febid];
118 dataPerFEB.rampVal+=val.m_vRamp[1];
119 dataPerFEB.rampRef+=ref.m_vRamp[1];
120 ++(dataPerFEB.nEntries);
121
122 m_rampGlobalVal+=val.m_vRamp[1];
123 m_rampGlobalRef+=ref.m_vRamp[1];
124
125 const Identifier region=m_caloId->region_id(offlineID);
126 int eta = m_caloId->eta(offlineID);
127 //Build fake-identifier with phi=0 to identify sector:
128 //Identifier cell_id (const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule,const int region_or_dummy,const int eta, const int phi ) const;
129 //mis-used phi for gain:
130 const Identifier sectorId=m_caloId->cell_id(region,eta,gain);
131
132 // Store avg Ramp value per sector : pos_neg/region/layer/eta (average over phi)
133 DataPerRegion& dataPerSector=m_vDataPerSector[sectorId];
134 dataPerSector.rampVal+=val.m_vRamp[1];
135 ++(dataPerSector.nEntries);
136
137 // Check individual channel for Ramp deviation
138 const float& tolerance=m_tolerance.valuesForCell(offlineID)[gain];
139
140
141 if (fabs(val.m_vRamp[1]-ref.m_vRamp[1])/ref.m_vRamp[1] > tolerance){
143 std::stringstream devMsg;
144 devMsg.setf(std::ios::fixed,std::ios::floatfield);
145 devMsg.precision(3);
146 devMsg << "Deviating! " << channelDescription(chid,cabling,bcCont,gain) << " Ramp: " << val.m_vRamp[1] << " (" << ref.m_vRamp[1] << ", ";
147 devMsg.precision(2);
148 devMsg << 100*(val.m_vRamp[1]-ref.m_vRamp[1])/ref.m_vRamp[1] << "%)";
149 msg() << this->m_myMsgLvl << devMsg.str() << endmsg;
150 ATH_MSG_DEBUG ( "Ramp Tolerance: " << tolerance ) ;
151 }
153 msg() << this->m_myMsgLvl << "Channel deviation message has already been printed " << m_maxmessages << " times. Now silent..." << endmsg;
154
155 return false;
156 }
157 else
158 return true;
159
160
161}
const boost::regex ref(r_ef)

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

const CaloCell_Base_ID* LArCalibValidationAlg< LArRampComplete, ILArRamp >::m_caloId
protectedinherited

Definition at line 178 of file LArCalibValidationAlg.h.

◆ m_chanFile

std::ofstream LArCalibValidationAlg< LArRampComplete, ILArRamp >::m_chanFile
protectedinherited

File name to store list of deviating channels.

Definition at line 240 of file LArCalibValidationAlg.h.

◆ m_chanFileName

std::string LArCalibValidationAlg< LArRampComplete, ILArRamp >::m_chanFileName
protectedinherited

File name to store list of deviating channels.

Definition at line 237 of file LArCalibValidationAlg.h.

◆ m_checkCompleteness

bool LArCalibValidationAlg< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::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_contKey

std::vector<std::string> LArRampValidationAlg::m_contKey
private

To store Gain Keys for Raw Ramps (job-Property)

Definition at line 62 of file LArRampValidationAlg.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< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::m_gainMap
privateinherited

Definition at line 159 of file LArCalibValidationAlg.h.

◆ m_hasRawRampContainer

bool LArRampValidationAlg::m_hasRawRampContainer
private

To check if Raw Ramps are found.

Definition at line 81 of file LArRampValidationAlg.h.

◆ m_isSC

BooleanProperty LArCalibValidationAlg< LArRampComplete, ILArRamp >::m_isSC
protectedinherited

Definition at line 173 of file LArCalibValidationAlg.h.

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

◆ m_maxmessages

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

Message level for reporting deviations.

Definition at line 163 of file LArCalibValidationAlg.h.

◆ m_myMsgLvlProp

int LArCalibValidationAlg< LArRampComplete, ILArRamp >::m_myMsgLvlProp
protectedinherited

Definition at line 164 of file LArCalibValidationAlg.h.

◆ m_nBad

unsigned LArCalibValidationAlg< LArRampComplete, ILArRamp >::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

LArRampComplete* LArCalibValidationAlg< LArRampComplete, ILArRamp >::m_nc_validation
protectedinherited

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

Definition at line 188 of file LArCalibValidationAlg.h.

◆ m_nChecked

unsigned LArCalibValidationAlg< LArRampComplete, ILArRamp >::m_nChecked
protectedinherited

Number of channels that where checked (grand-total)

Definition at line 218 of file LArCalibValidationAlg.h.

◆ m_nEntriesGlobal

unsigned LArRampValidationAlg::m_nEntriesGlobal
private

Definition at line 108 of file LArRampValidationAlg.h.

◆ m_nFailedValidation

unsigned LArCalibValidationAlg< LArRampComplete, ILArRamp >::m_nFailedValidation
protectedinherited

Number of channels for which vaildateChannel returned false.

Definition at line 221 of file LArCalibValidationAlg.h.

◆ m_nNoReference

unsigned LArCalibValidationAlg< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::m_onlineHelper
protectedinherited

Definition at line 177 of file LArCalibValidationAlg.h.

◆ m_patchCBs

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

wether missing FEBS (incomplete COOL channels) should be patched

Definition at line 204 of file LArCalibValidationAlg.h.

◆ m_printFailedPattern

bool LArCalibValidationAlg< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::m_problemsToMask
protectedinherited

Definition at line 171 of file LArCalibValidationAlg.h.

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

◆ m_rampGlobalRef

double LArRampValidationAlg::m_rampGlobalRef
private

Definition at line 107 of file LArRampValidationAlg.h.

◆ m_rampGlobalVal

double LArRampValidationAlg::m_rampGlobalVal
private

Definition at line 106 of file LArRampValidationAlg.h.

◆ m_rawRampContainer

LArRawRampContainer* LArRampValidationAlg::m_rawRampContainer
private

Definition at line 103 of file LArRampValidationAlg.h.

◆ m_rawrampTimeADC

float LArRampValidationAlg::m_rawrampTimeADC
private

Raw Ramp ADC (job-Property)

Definition at line 66 of file LArRampValidationAlg.h.

◆ m_rawrampTimeTolerance

float LArRampValidationAlg::m_rawrampTimeTolerance
private

Raw Ramp time tolerance (in ns) (job-Property)

Definition at line 64 of file LArRampValidationAlg.h.

◆ m_reference

const ILArRamp* LArCalibValidationAlg< LArRampComplete, ILArRamp >::m_reference
protectedinherited

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_rmsGlobalRef

double LArRampValidationAlg::m_rmsGlobalRef
private

Definition at line 107 of file LArRampValidationAlg.h.

◆ m_rmsGlobalVal

double LArRampValidationAlg::m_rmsGlobalVal
private

Definition at line 106 of file LArRampValidationAlg.h.

◆ m_tolerance

CaloCellGroupList LArRampValidationAlg::m_tolerance
private

Ramp tolerance as CaloCellGroup object.

Definition at line 72 of file LArRampValidationAlg.h.

◆ m_toleranceFEB

CaloCellGroupList LArRampValidationAlg::m_toleranceFEB
private

Ramp tolerance (FEB average) as initializer string CaloCellGroup object.

Definition at line 78 of file LArRampValidationAlg.h.

◆ m_toleranceInit

std::vector<std::string> LArRampValidationAlg::m_toleranceInit
private

Ramp tolerance as init string for CellGroupObject (job-Property)

Definition at line 69 of file LArRampValidationAlg.h.

◆ m_toleranceInitFEB

std::vector<std::string> LArRampValidationAlg::m_toleranceInitFEB
private

Ramp tolerance (FEB average) as CaloCellGroup object (job-Property)

Definition at line 75 of file LArRampValidationAlg.h.

◆ m_useBCInfo

bool LArCalibValidationAlg< LArRampComplete, ILArRamp >::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< LArRampComplete, ILArRamp >::m_useCorrChannel
protectedinherited

Definition at line 248 of file LArCalibValidationAlg.h.

◆ m_validation

const LArRampComplete* LArCalibValidationAlg< LArRampComplete, ILArRamp >::m_validation
protectedinherited

Pointer to container to be validated.

Definition at line 185 of file LArCalibValidationAlg.h.

◆ m_validationKey

std::string LArCalibValidationAlg< LArRampComplete, ILArRamp >::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::unordered_map<HWIdentifier,DataPerRegion> LArRampValidationAlg::m_vDataPerFEB
private

Definition at line 100 of file LArRampValidationAlg.h.

◆ m_vDataPerSector

std::unordered_map<Identifier,DataPerRegion> LArRampValidationAlg::m_vDataPerSector
private

Definition at line 101 of file LArRampValidationAlg.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: