Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
23 return StatusCode::FAILURE;
29 return StatusCode::FAILURE;
44 for (
unsigned bec : {0,1}) {
46 for (
unsigned iside=0;iside<2;++iside) {
47 for (
unsigned iphi=0; iphi!=
m_MAXphi; ++iphi) {
52 return StatusCode::SUCCESS;
63 ATH_MSG_ERROR(
"Key list is empty! No containers to process!" );
64 return StatusCode::FAILURE;
69 unsigned nSaturation=0;
72 if (
evtStore()->contains<LArFebErrorSummary>(
"LArFebErrorSummary")) {
75 ATH_MSG_ERROR(
"Failed to retrieve FebErrorSummary object!" );
81 ATH_MSG_WARNING(
"No FebErrorSummaryObject found! Feb errors not checked!" );
86 ATH_MSG_ERROR(
"Do not have cabling object LArOnOffIdMapping");
87 return StatusCode::FAILURE;
103 sc =
evtStore()->retrieve(larAccumulatedCalibDigitContainer,
key);
105 ATH_MSG_WARNING(
"Cannot read LArAccumulatedCalibDigitContainer from StoreGate! key=" <<
key );
116 if(larAccumulatedCalibDigitContainer->
empty()) {
117 ATH_MSG_DEBUG(
"LArAccumulatedCalibDigitContainer with key = " <<
key <<
" is empty " );
121 ATH_MSG_DEBUG(
"Processing LArAccumulatedCalibDigitContainer with key = " <<
key
122 <<
". Size: " << larAccumulatedCalibDigitContainer->
size() );
132 for (
int bec : {0,1}) {
134 for (
unsigned iphi=0;iphi!=
m_MAXphi;++iphi) {
135 for (
unsigned iside=0;iside<2;++iside) {
147 if (!
cabling->isOnlineConnected(chid))
continue;
157 if (febid!=lastFailedFEB) {
160 <<
" reports error(s):" << febErrSum->
error_to_string(febErrs) <<
". Data ignored." );
174 return StatusCode::FAILURE;
182 const std::vector<uint64_t>& samples=dig->sampleSum();
183 const size_t& nS=samples.size();
185 for (
size_t i=0;
i<nS;++
i) {
189 <<
", <ADC> = " << samples[
i]/dig->nTriggers()
190 <<
", DAC = " << dig->DAC()
191 <<
") for channel 0x" << MSG::hex << chid.
get_compact() << MSG::dec
223 neighbours[0].
dist=-2;
224 neighbours[1].
dist=-1;
225 neighbours[2].
dist=1;
226 neighbours[3].
dist=2;
228 for (
unsigned bec : {0,1}) {
229 for (
unsigned iside=0; iside<2; iside++) {
231 for (
unsigned iphi=0; iphi<
m_MAXphi; iphi++) {
232 const unsigned iphi2=iphi+
m_MAXphi*iside;
234 if (currDig==
nullptr || currDig==&febErrorDummy)
continue;
241 << iphi2 <<
") should not be touched accoring to jobConfig");
245 const unsigned NtotSamples = currDig->
nsamples();
246 const unsigned NbTriggers = currDig->
nTriggers();
250 for (
unsigned i=0;
i<4;
i++) {
252 neighbours[
i].
dig=
nullptr;
253 neighbours[
i].
ped=0.;
254 const int neigbEtaItx=neighbours[
i].
dist+(
int)ieta;
257 ATH_MSG_DEBUG(
"Neighbour " << neighbours[
i].dist <<
" , ieta=" << neigbEtaItx
259 neighbours[
i].
dig=&inexistingDummy;
267 if (
msgLvl(MSG::WARNING)) {
269 ATH_MSG_DEBUG(
"FEB missing for neighbour " << neighbours[
i].dist <<
" to be added to strip 0x"
273 ATH_MSG_WARNING(
"Cannot find neighbour " << neighbours[
i].dist <<
" to be added to strip 0x"
279 if (neighDig==&febErrorDummy) {
281 <<
" (Eta = " << ieta <<
", Phi = " << iphi <<
"), has a FEB error. Ignored.");
288 <<
" (Eta = " << ieta <<
", Phi = " << iphi <<
", " <<
printMaxSample(neighDig)
289 <<
") is pulsed. Not used for correction." );
296 <<
" (Eta = " << ieta <<
", Phi = " << iphi
297 <<
") is flagged by the LArBadChannelMaskingTool. Not used for correction.");
304 ATH_MSG_ERROR(
"No pedestal are available for neighbour " << neighbours[
i].dist <<
" of strip "
309 neighbours[
i].
dig=neighDig;
310 neighbours[
i].
ped=pedestal;
315 const int nnEta=ieta+2*neighbours[
i].
dist;
318 if (nnDig!=
nullptr) {
322 <<
" has another pulsed cell in the neighborhood. Setting weight to 0.5");
331 std::vector<double> SampleSums(NtotSamples);
332 for (std::size_t SampleIndex=0;SampleIndex<NtotSamples; ++SampleIndex ) {
334 ATH_MSG_VERBOSE(
"SampleSum " << SampleIndex <<
" (" << SampleSums[SampleIndex] <<
" ADC counts / " << NbTriggers <<
" Ntriggers)");
337 for (
unsigned i=0;
i<4;
i++) {
338 if (neighbours[
i].dig==&inexistingDummy) {
340 <<
" (Eta = " << ieta <<
", Phi = " << iphi <<
") does not exist.");
345 if (neighbours[
i].dig) {
348 <<
" (Eta = " << ieta <<
", Phi = " << iphi <<
") is used for correction");
353 <<
" cannot be used. Taking mirrored neighbour " << neighbours[j].
dist <<
" instead." );
354 if (neighbours[j].dig!=
nullptr && neighbours[j].dig!=&inexistingDummy){
357 <<
" (Eta = " << ieta <<
", Phi = " << iphi <<
") is used for correction");
361 <<
" cannot be used too. No correction applied" );
367 std::vector<uint64_t> SampleSumInt(NtotSamples);
368 bool unresonable=
false;
370 for (std::size_t SampleIndex=0;SampleIndex<NtotSamples; ++SampleIndex ) {
371 const double& thisSampleSum=SampleSums[SampleIndex];
373 if (thisSampleSum<0) {
376 <<
" (Eta = " << ieta <<
", Phi = " << iphi <<
") Resulting ADC sample " << SampleIndex <<
" negative! "
377 << thisSampleSum <<
" instead of " << oldVal <<
" Not corrected." );
381 if (SampleIndex==iPeak) {
382 const float dev=(thisSampleSum-oldVal)/oldVal;
387 <<
") DAC=" << currDig->
DAC() <<
": Resulting ADC sample " << SampleIndex <<
" looks unreasonable: "
388 << thisSampleSum <<
" instead of " << oldVal <<
" (off by " << dev*100 <<
"%)"
389 <<
" (=" << thisSampleSum/NbTriggers <<
" -> " << oldVal/NbTriggers <<
", ped="
390 << larPedestal->
pedestal(chid,t_gain)
391 <<
" Not Corrected.");
395 SampleSumInt[SampleIndex] = (
uint64_t)(thisSampleSum);
405 << currDig->
sampleSum()[2] <<
"->" << SampleSumInt[2]);
417 ATH_MSG_INFO(
"Found " << nSaturation <<
" saturating digits in this event." );
419 return StatusCode::SUCCESS;
433 for (;
it!=it_e;++
it) {
442 return StatusCode::SUCCESS;
448 const std::vector<uint64_t>&
ss=thisDig->
sampleSum();
449 std::vector<uint64_t>::const_iterator
imax=std::max_element(
ss.begin(),
ss.end());
450 std::ostringstream
output;
459 for (
unsigned bec : {0,1}) {
469 return StatusCode::FAILURE;
474 ATH_MSG_ERROR(
"Do not have cabling object LArOnOffIdMapping");
475 return StatusCode::FAILURE;
479 for (
const auto&
entry : bfCont->fullCont()) {
485 LArBadChannelDBTools::BadFebVec::const_iterator
it=
mf.begin();
486 LArBadChannelDBTools::BadFebVec::const_iterator it_e=
mf.end();
487 for (;
it!=it_e;++
it) {
495 for (
int c=0;
c<nChan;++
c) {
504 return StatusCode::FAILURE;
512 ATH_MSG_INFO(
"Number of known missing strip cells: "<< nMissing );
514 return StatusCode::SUCCESS;
520 m_binwidth(upperLimit/
nBins),
537 if (
nBins==0)
return;
538 out << lvl <<
"Cross Talk Correction Summary:" <<
endmsg;
545 out << lvl <<
"Data points with the highes correction:" <<
endmsg;
546 std::vector<maxlistitem>::const_iterator
it=
m_maxlist.begin();
547 std::vector<maxlistitem>::const_iterator it_e=
m_maxlist.end();
549 out << lvl <<
" " << onlId->
channel_name(
it->chid) <<
" DAC=" <<
it->dac <<
" Delay=" <<
it->delay <<
" Deviation:" <<
it->reldiff <<
endmsg;
virtual float pedestal(const HWIdentifier &id, int gain) const =0
size_t getPhiIndex(const Identifier) const
Data class for calibration ADC samples preprocessed by the DSP.
Gaudi::Property< std::vector< std::string > > m_dontUseForCorr
static constexpr auto m_MAXeta
#define maxValue(current, test)
size_t getEtaIndex(const Identifier) const
static std::string printMaxSample(const LArAccumulatedCalibDigit *thisDig)
LArBadChannelMask m_dontCorrMask
Gaudi::Property< float > m_acceptableDifference
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
size_t nsamples() const
return number of samples
bool deadReadout() const
FEB is not sending readout data, but the L1 trigger path is working.
Gaudi::Property< std::vector< std::string > > m_dontCorr
StatusCode buildBitMask(const std::vector< std::string > &problemsToMask, MsgStream &msg)
uint16_t m_fatalFebErrorPattern
value_type get_compact() const
Get the compact id.
unsigned int m_event_counter
Gaudi::Property< std::vector< std::string > > m_keylist
bool msgLvl(const MSG::Level lvl) const
const std::vector< uint64_t > & sampleSum() const
return a reference to a stl vector containing the sample-sums
int sampling(const Identifier id) const
return sampling according to :
static std::string error_to_string(uint16_t error)
interpret the error in string
std::vector< unsigned > m_diffs
const unsigned int m_MAXphi
#define ATH_MSG_VERBOSE(x)
SG::ReadCondHandleKey< LArBadChannelCont > m_BCKey
CaloGain::CaloGain gain() const
return gain value
bool cellShouldBeMasked(const LArBadChannelCont *bcCont, const HWIdentifier &hardwareId) const
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
std::vector< BadFebEntry > BadFebVec
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
std::array< std::vector< std::vector< const LArAccumulatedCalibDigit * > >, 2 > m_stripsLookUp
uint16_t feb_error(HWIdentifier febid) const
get error for feb
setScaleOne setStatusOne saturated
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
std::array< std::vector< std::bitset< 128 > >, 2 > m_knownMissingFebs
SG::ReadCondHandleKey< LArBadFebCont > m_BFKey
void print(MsgStream &stream, const LArOnlineID *onlId, MSG::Level lvl=MSG::INFO)
const LArOnlineID * m_onlineHelper
bool isEMECchannel(const HWIdentifier id) const override final
StatusCode initKnownMissingFebs()
std::pair< HWIdentifier, LArBadFeb > BadFebEntry
int channelInSlotMax(const HWIdentifier Id) const
Return the Maximum channel number of a given feb slot.
void correctSamples(std::vector< double > &dest, const neighbour_t &neighbor) const
::StatusCode StatusCode
StatusCode definition for legacy code.
std::set< HWIdentifier > m_uncorrectedIds
bool deadAll() const
FEB is completely missing, e.g. powered off.
void add(const LArAccumulatedCalibDigit *dig, const float reldiff)
unsigned nTriggers() const
return the number of triggers
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
XtalkCorrHisto(const unsigned nBins, const float maxbin)
virtual StatusCode finalize() override final
virtual StatusCode initialize() override final
static constexpr auto m_MINeta
const HWIdentifier & hardwareID() const
Return HWIdentifier.
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
const LArAccumulatedCalibDigit * dig
SG::ReadCondHandleKey< ILArPedestal > m_pedKey
StatusCode initialize(bool used=true)
bool isEMBchannel(const HWIdentifier id) const
int delay() const
return the setting of the delay
bool deactivatedInOKS() const
Deactivated in OKS.
std::string stringStatus(const LArBadChannel &bc) const
LArBadChannelMask m_dontUseForCorrMask
#define ATH_MSG_WARNING(x)
Holds information from the FEB Error Summary.
bool isPulsed() const
Tell if this channel was pulsed.
virtual StatusCode execute() override final
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
Container class for LArAccumulatedCalibDigit.
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
std::vector< maxlistitem > m_maxlist
int DAC() const
return the number of samples
XtalkCorrHisto m_differences
Gaudi::Property< unsigned int > m_ADCsatur