#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-01-16/ChannelInfo/BadChanList.h"
Public Member Functions | |
BadChanList (fhicl::ParameterSet const &pset, art::ActivityRegistry ®) | |
~BadChanList () | |
void | preBeginRun (art::Run const &run) |
void | postBeginSubRun (art::SubRun const &subrun) |
void | preBeginEvent (art::Event const &evt) |
int | Apply (art::PtrVector< rawdata::RawDigit > &rd) |
int | Apply (std::vector< art::Ptr< rawdata::RawDigit > > &rd) |
int | Apply (std::vector< const rawdata::RawDigit * > &) |
bool | IsBad (int plane, int cell) |
bool | IsLowEfficiency (int plane, int cell) |
void | reconfigure (fhicl::ParameterSet p) |
void | LoadNewData () |
int | NBadInSubRun (int i) |
Private Member Functions | |
bool | IsBadUncached (int plane, int cell) |
bool | InDroppedDCM (int plane, int cell) |
void | SetRandomBadChannels () |
void | LoadCosmicEff (int newrun, int newsubrun) |
template<class T > | |
void | CountDCMHits (const std::vector< T > &digitcol) |
Private Attributes | |
int | fApplyBadChan |
Option to activate the bad channels. More... | |
int | fMCRunNumber |
Run number for the MC. More... | |
int | fMCSubrunNumber |
Subrun number for the MC. More... | |
int | fNBadSR |
int | fVldRunGrouping |
int | fPedestalThresholdLow |
int | fPedestalThresholdHigh |
bool | fAbortIfNoneFound |
Option to throw an exception if no channel rate state rows are returned from dB. More... | |
bool | fNeedNewData |
bool | fIsPerfect |
bool | fAbortOnSmallRunNum |
bool | fAbortIfNoSubrun |
std::unordered_set< geo::OfflineChan > | fLowEfficiency |
set of low eff channels More... | |
std::unordered_set< geo::OfflineChan > | fRandomBCMap |
random bad channel map More... | |
std::string | fBadChanCSVFile |
bool | fEventCheck |
do we check each event for dropped DCMs? More... | |
std::string | fRawDigitLabel |
what is the name of the raw digits ART object More... | |
std::string | fCellHitLabel |
bool | fNewCosmicEffTable |
Use new-style table? More... | |
float | fRandomBadChannelFraction |
If >0, ignore DB and set this fraction bad at random. More... | |
std::vector< std::unordered_set< geo::OfflineChan > > | fBadChans |
Vector index is the subrun number, set contains all the bad channels. More... | |
std::vector< std::unordered_set< int > > | fDropOuts |
[subrun][tchan] More... | |
int | fRun |
int | fSubRun |
time_t | fMinVldTime |
Minimum time used in database request. More... | |
time_t | fMaxVldTime |
Maximum time used in database request. More... | |
std::string | fValidityTagNearDet |
std::string | fValidityTagFarDet |
std::string | fFEBDropoutTag |
bool | fApplyFEBDropout |
std::unique_ptr< CLHEP::RandFlat > | fFlatRand |
int | fDCMHits [12][14] |
count hits in each DCM each event to look for dropped DCMs More... | |
std::vector< std::string > | fKBCList |
std::vector< geo::OfflineChan > | fKnownBadChannels |
std::bitset< FD_NUM_PLANES *FD_NUM_CELLS > | fIsBadCache |
bool | fIsBadCacheValid |
Interface to the run-by-run list of bad channels
Definition at line 39 of file BadChanList.h.
chaninfo::BadChanList::BadChanList | ( | fhicl::ParameterSet const & | pset, |
art::ActivityRegistry & | reg | ||
) |
Definition at line 43 of file BadChanList_service.cc.
References fDCMHits, fFlatRand, fIsBadCache, fIsBadCacheValid, fIsPerfect, fMCRunNumber, fMCSubrunNumber, fNBadSR, fNeedNewData, fRandomBCMap, fValidityTagFarDet, fValidityTagNearDet, sim::GetRandomNumberSeed(), MECModelEnuComparisons::i, calib::j, postBeginSubRun(), preBeginEvent(), preBeginRun(), reconfigure(), art::ActivityRegistry::sPostBeginSubRun, art::ActivityRegistry::sPreBeginRun, and art::ActivityRegistry::sPreProcessEvent.
chaninfo::BadChanList::~BadChanList | ( | ) |
Definition at line 76 of file BadChanList_service.cc.
int chaninfo::BadChanList::Apply | ( | art::PtrVector< rawdata::RawDigit > & | rd | ) |
Definition at line 692 of file BadChanList_service.cc.
References getBrightness::cell, visualisationForPaperMasterPlot::cmap, cmap::dataprov::CMap::GetCell(), cmap::dataprov::CMap::GetPlane(), update_sam_good_runs_metadata::good, MECModelEnuComparisons::i, IsBad(), NDAPDHVSetting::plane, art::PtrVector< T >::push_back(), art::PtrVector< T >::size(), and art::PtrVector< T >::swap().
Referenced by comi::Leana::analyze(), evd::RawDataDrawer::GetRawDigits(), evd::RawDataDrawer::GetRawDigitsMulti(), evtsum::EventSummary::MakeOutput(), and comi::Cana::produce().
int chaninfo::BadChanList::Apply | ( | std::vector< art::Ptr< rawdata::RawDigit > > & | rd | ) |
Definition at line 675 of file BadChanList_service.cc.
References getBrightness::cell, visualisationForPaperMasterPlot::cmap, cmap::dataprov::CMap::GetCell(), cmap::dataprov::CMap::GetPlane(), update_sam_good_runs_metadata::good, MECModelEnuComparisons::i, IsBad(), and NDAPDHVSetting::plane.
int chaninfo::BadChanList::Apply | ( | std::vector< const rawdata::RawDigit * > & | rd | ) |
Definition at line 709 of file BadChanList_service.cc.
References getBrightness::cell, visualisationForPaperMasterPlot::cmap, chaninfo::DEFINE_ART_SERVICE(), cmap::dataprov::CMap::GetCell(), cmap::dataprov::CMap::GetPlane(), update_sam_good_runs_metadata::good, MECModelEnuComparisons::i, IsBad(), and NDAPDHVSetting::plane.
|
private |
Definition at line 139 of file BadChanList_service.cc.
References febshutoff_auto::dcm, geo::GeometryBase::DetId(), fDCMHits, geom(), daqchannelmap::DAQChannelMap::getDCM(), daqchannelmap::DAQChannelMap::getDiBlock(), daqchannelmap::DAQChannelMap::getInstance(), MECModelEnuComparisons::i, calib::j, and T.
Referenced by preBeginEvent().
Definition at line 560 of file BadChanList_service.cc.
References getBrightness::cell, geo::GeometryBase::DetId(), daqchannelmap::DAQChannelMap::encodeDChan(), daqchannelmap::DAQChannelMap::encodeLChan(), fDCMHits, fEventCheck, geom(), daqchannelmap::DAQChannelMap::getDCM(), daqchannelmap::DAQChannelMap::getDiBlock(), daqchannelmap::DAQChannelMap::getInstance(), LOG_DEBUG, and NDAPDHVSetting::plane.
Referenced by IsBad(), and IsBadUncached().
Definition at line 552 of file BadChanList_service.cc.
References getBrightness::cell, chaninfo::FD_NUM_CELLS, fIsBadCache, and InDroppedDCM().
Referenced by calib::PEResponse::analyze(), Apply(), chaninfo::BadChanValidate::BadChansFromDB(), trk::KalmanTrack::CheckTrack(), trk::KalmanGeoHelper::CountMissedCellsOnLine(), dt::ViewMerger::CountUnexplainedOnLine(), evd::GeometryDrawer::DrawCells2D(), chaninfo::CosmicEff::endJob(), rsim::RecordNoiseSpectrumFile::endSubRun(), LightLevels::endSubRun(), trk::KalmanTrack::FilterTracker(), geo::LiveGeometry::GetBCInfo(), calib::HasXYAdjacents(), dt::DiscreteTracker::HighActivity(), NBadInSubRun(), trk::KalmanTrack::produce(), calhit::RemoveBadChannels::produce(), calhit::CalHit::produce(), hough::MultiHoughT::Scrub(), earms::ElasticArmsHS::Scrub(), vdt::VertexDT::Scrub(), fuzz::FuzzyKVertex::Scrub(), and dt::View::View().
Definition at line 577 of file BadChanList_service.cc.
References ana::assert(), getBrightness::cell, febshutoff_auto::chan, confusionMatrixTree::count, febshutoff_auto::dcm, geo::GeometryBase::DetId(), daqchannelmap::DAQChannelMap::encodeDChan(), daqchannelmap::DAQChannelMap::encodeLChan(), fApplyBadChan, fApplyFEBDropout, fBadChanCSVFile, fBadChans, fDropOuts, APDHVSetting::feb, fIsPerfect, fKnownBadChannels, fMaxVldTime, fMinVldTime, fNeedNewData, fPedestalThresholdHigh, fPedestalThresholdLow, fRandomBadChannelFraction, fRandomBCMap, fRun, fSubRun, geom(), daqchannelmap::DAQChannelMap::getDCM(), daqchannelmap::DAQChannelMap::getDiBlock(), daqchannelmap::DAQChannelMap::getFEB(), daqchannelmap::DAQChannelMap::getInstance(), nova::dbi::RunHistory::GetPedestal(), nova::dbi::RunHistory::HasAPD(), InDroppedDCM(), novadaq::cnv::kFARDET, novadaq::cnv::kNEARDET, LoadNewData(), LOG_DEBUG, LOG_WARNING, nova::dbi::RunHistory::NSubruns(), NDAPDHVSetting::plane, rh, SetRandomBadChannels(), and sr.
Referenced by preBeginEvent().
Definition at line 665 of file BadChanList_service.cc.
References febshutoff_auto::chan, fApplyBadChan, and fLowEfficiency.
Referenced by trk::KalmanTrack::CheckTrack(), trk::KalmanGeoHelper::CountMissedCellsOnLine(), dt::ViewMerger::CountUnexplainedOnLine(), trk::KalmanTrack::FilterTracker(), and dt::View::View().
Definition at line 291 of file BadChanList_service.cc.
References getBrightness::cell, febshutoff_auto::chan, nova::dbi::Row::Col(), allTimeWatchdog::endl, fLowEfficiency, fNewCosmicEffTable, genie::utils::style::Format(), nova::dbi::Column::Get(), nova::dbi::Table::GetColIndex(), nova::dbi::Table::GetRow(), update_sam_good_runs_metadata::good, MECModelEnuComparisons::i, nova::dbi::Table::Load(), LOG_DEBUG, nova::dbi::Table::NRow(), NDAPDHVSetting::plane, nova::dbi::Table::SetValidityRange(), nova::dbi::Table::SetValiditySQL(), and nova::dbi::Table::SetVerbosity().
void chaninfo::BadChanList::LoadNewData | ( | ) |
Definition at line 379 of file BadChanList_service.cc.
References getBrightness::cell, febshutoff_auto::chan, visualisationForPaperMasterPlot::cmap, nova::dbi::Row::Col(), febshutoff_auto::db, febshutoff_auto::dcm, geo::GeometryBase::DetId(), runNovaSAM::detId, daqchannelmap::DAQChannelMap::encodeDChan(), daqchannelmap::DAQChannelMap::encodeLChan(), fAbortIfNoneFound, fApplyFEBDropout, fBadChanCSVFile, fBadChans, fDropOuts, APDHVSetting::feb, fFEBDropoutTag, nova::dbi::Table::FillChanRowMap(), fIsPerfect, fKBCList, fKnownBadChannels, fMaxVldTime, fMCRunNumber, fMinVldTime, fNeedNewData, fRun, fValidityTagFarDet, fValidityTagNearDet, fVldRunGrouping, geom(), nova::dbi::Column::Get(), daqchannelmap::DAQChannelMap::getCell(), nova::dbi::Table::GetColIndex(), daqchannelmap::DAQChannelMap::getDCM(), daqchannelmap::DAQChannelMap::getDiBlock(), daqchannelmap::DAQChannelMap::getFEB(), daqchannelmap::DAQChannelMap::getInstance(), daqchannelmap::DAQChannelMap::getPlane(), nova::dbi::Table::GetVldRow(), makeTrainCVSamples::int, nova::dbi::kDataOnly, novadaq::cnv::kFARDET, nova::dbi::kMCOnly, novadaq::cnv::kNEARDET, nova::dbi::Table::Load(), nova::dbi::Table::LoadFromCSV(), LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, cmap::dataprov::CMap::Map(), updateRunHistoryTables::minrun, geo::PlaneGeo::Ncells(), geo::GeometryBase::NPlanes(), nova::dbi::Table::NRow(), nova::dbi::RunHistory::NSubruns(), geo::GeometryBase::Plane(), NDAPDHVSetting::plane, rh, check_grl::row, nova::dbi::RunHistory::RunNumber(), nova::dbi::Table::SetDataTypeMask(), nova::dbi::Table::SetDetector(), nova::dbi::Table::SetMaxTSVld(), nova::dbi::Table::SetMinTSVld(), nova::dbi::Table::SetTag(), nova::dbi::Table::SetVerbosity(), sr, makeDatasetsPage::state, getGoodRuns4SAM::subrun, and geo::OfflineChan::ToDBValidityChan().
Referenced by IsBadUncached(), and NBadInSubRun().
Definition at line 206 of file BadChanList_service.cc.
References getBrightness::cell, nova::dbi::RunHistory::DiBlock::dcm, geo::GeometryBase::DetId(), runNovaSAM::detId, daqchannelmap::DAQChannelMap::encodeDChan(), daqchannelmap::DAQChannelMap::encodeLChan(), fEventCheck, fNBadSR, fNeedNewData, fRun, fSubRun, geom(), daqchannelmap::DAQChannelMap::getCell(), nova::dbi::RunHistory::GetDiBlock(), daqchannelmap::DAQChannelMap::getInstance(), daqchannelmap::DAQChannelMap::getPlane(), IsBad(), nova::dbi::RunHistory::IsGoodDiBlock(), LoadNewData(), nova::dbi::RunHistory::NDiBlocks(), nova::dbi::RunHistory::NSubruns(), nova::dbi::RunHistory::DiBlock::num, NDAPDHVSetting::plane, rh, and nova::dbi::RunHistory::RunNumber().
Referenced by chaninfo::PedestalThresholdValidation::analyze(), and caf::CAFMaker::produce().
void chaninfo::BadChanList::postBeginSubRun | ( | art::SubRun const & | subrun | ) |
Definition at line 111 of file BadChanList_service.cc.
References fAbortIfNoSubrun, fIsBadCacheValid, fMCRunNumber, fMCSubrunNumber, fNBadSR, fSubRun, LOG_DEBUG, nova::dbi::RunHistory::NSubruns(), rh, sr, and art::SubRun::subRun().
Referenced by BadChanList().
void chaninfo::BadChanList::preBeginEvent | ( | art::Event const & | evt | ) |
Definition at line 158 of file BadChanList_service.cc.
References plot_validation_datamc::c, CountDCMHits(), art::Handle< T >::failedToGet(), fCellHitLabel, chaninfo::FD_NUM_CELLS, chaninfo::FD_NUM_PLANES, fEventCheck, fIsBadCache, fIsBadCacheValid, fRawDigitLabel, geom(), IsBadUncached(), LOG_ERROR, LOG_INFO, geo::PlaneGeo::Ncells(), geo::GeometryBase::NPlanes(), and geo::GeometryBase::Plane().
Referenced by BadChanList().
Definition at line 81 of file BadChanList_service.cc.
References fAbortOnSmallRunNum, fIsPerfect, fMCRunNumber, fNBadSR, fNeedNewData, fRun, LOG_DEBUG, and art::Run::run().
Referenced by BadChanList().
void chaninfo::BadChanList::reconfigure | ( | fhicl::ParameterSet | p | ) |
Definition at line 332 of file BadChanList_service.cc.
References fAbortIfNoneFound, fAbortIfNoSubrun, fAbortOnSmallRunNum, fApplyBadChan, fApplyFEBDropout, fBadChanCSVFile, fCellHitLabel, fEventCheck, fFEBDropoutTag, fKBCList, fMCRunNumber, fMCSubrunNumber, fNewCosmicEffTable, fPedestalThresholdHigh, fPedestalThresholdLow, fRandomBadChannelFraction, fRawDigitLabel, fValidityTagFarDet, fValidityTagNearDet, fVldRunGrouping, fhicl::ParameterSet::get(), LOG_ERROR, and string.
Referenced by BadChanList().
|
private |
Definition at line 268 of file BadChanList_service.cc.
References getBrightness::cell, febshutoff_auto::chan, fFlatRand, fLowEfficiency, fRandomBadChannelFraction, fRandomBCMap, geom(), geo::GeometryBase::GetPlanesByView(), LOG_ERROR, geo::PlaneGeo::Ncells(), geo::GeometryBase::Plane(), and NDAPDHVSetting::plane.
Referenced by IsBadUncached().
|
private |
Option to throw an exception if no channel rate state rows are returned from dB.
Definition at line 90 of file BadChanList.h.
Referenced by LoadNewData(), and reconfigure().
|
private |
Definition at line 98 of file BadChanList.h.
Referenced by postBeginSubRun(), and reconfigure().
|
private |
Definition at line 96 of file BadChanList.h.
Referenced by preBeginRun(), and reconfigure().
|
private |
Option to activate the bad channels.
Definition at line 79 of file BadChanList.h.
Referenced by IsBadUncached(), IsLowEfficiency(), and reconfigure().
|
private |
Definition at line 131 of file BadChanList.h.
Referenced by IsBadUncached(), LoadNewData(), and reconfigure().
|
private |
Definition at line 103 of file BadChanList.h.
Referenced by IsBadUncached(), LoadNewData(), and reconfigure().
|
private |
Vector index is the subrun number, set contains all the bad channels.
Definition at line 115 of file BadChanList.h.
Referenced by IsBadUncached(), and LoadNewData().
|
private |
Definition at line 108 of file BadChanList.h.
Referenced by preBeginEvent(), and reconfigure().
|
private |
count hits in each DCM each event to look for dropped DCMs
Definition at line 135 of file BadChanList.h.
Referenced by BadChanList(), CountDCMHits(), and InDroppedDCM().
|
private |
[subrun][tchan]
Definition at line 116 of file BadChanList.h.
Referenced by IsBadUncached(), and LoadNewData().
|
private |
do we check each event for dropped DCMs?
Definition at line 105 of file BadChanList.h.
Referenced by InDroppedDCM(), NBadInSubRun(), preBeginEvent(), and reconfigure().
|
private |
Definition at line 129 of file BadChanList.h.
Referenced by LoadNewData(), and reconfigure().
|
private |
Definition at line 133 of file BadChanList.h.
Referenced by BadChanList(), and SetRandomBadChannels().
|
private |
Definition at line 145 of file BadChanList.h.
Referenced by BadChanList(), IsBad(), and preBeginEvent().
|
private |
Definition at line 146 of file BadChanList.h.
Referenced by BadChanList(), postBeginSubRun(), and preBeginEvent().
|
private |
Definition at line 94 of file BadChanList.h.
Referenced by BadChanList(), IsBadUncached(), LoadNewData(), and preBeginRun().
|
private |
Definition at line 137 of file BadChanList.h.
Referenced by LoadNewData(), and reconfigure().
|
private |
Definition at line 138 of file BadChanList.h.
Referenced by IsBadUncached(), and LoadNewData().
|
private |
set of low eff channels
Definition at line 100 of file BadChanList.h.
Referenced by IsLowEfficiency(), LoadCosmicEff(), and SetRandomBadChannels().
|
private |
Maximum time used in database request.
Definition at line 123 of file BadChanList.h.
Referenced by IsBadUncached(), and LoadNewData().
|
private |
Run number for the MC.
Definition at line 80 of file BadChanList.h.
Referenced by BadChanList(), LoadNewData(), postBeginSubRun(), preBeginRun(), and reconfigure().
|
private |
Subrun number for the MC.
Definition at line 81 of file BadChanList.h.
Referenced by BadChanList(), postBeginSubRun(), and reconfigure().
|
private |
Minimum time used in database request.
Definition at line 121 of file BadChanList.h.
Referenced by IsBadUncached(), and LoadNewData().
|
private |
Definition at line 83 of file BadChanList.h.
Referenced by BadChanList(), NBadInSubRun(), postBeginSubRun(), and preBeginRun().
|
private |
Definition at line 92 of file BadChanList.h.
Referenced by BadChanList(), IsBadUncached(), LoadNewData(), NBadInSubRun(), and preBeginRun().
|
private |
Use new-style table?
Definition at line 110 of file BadChanList.h.
Referenced by LoadCosmicEff(), and reconfigure().
|
private |
Definition at line 88 of file BadChanList.h.
Referenced by IsBadUncached(), and reconfigure().
|
private |
Definition at line 87 of file BadChanList.h.
Referenced by IsBadUncached(), and reconfigure().
|
private |
If >0, ignore DB and set this fraction bad at random.
Definition at line 112 of file BadChanList.h.
Referenced by IsBadUncached(), reconfigure(), and SetRandomBadChannels().
|
private |
random bad channel map
Definition at line 101 of file BadChanList.h.
Referenced by BadChanList(), IsBadUncached(), and SetRandomBadChannels().
|
private |
what is the name of the raw digits ART object
Definition at line 107 of file BadChanList.h.
Referenced by preBeginEvent(), and reconfigure().
|
private |
Definition at line 118 of file BadChanList.h.
Referenced by IsBadUncached(), LoadNewData(), NBadInSubRun(), and preBeginRun().
|
private |
Definition at line 119 of file BadChanList.h.
Referenced by IsBadUncached(), NBadInSubRun(), and postBeginSubRun().
|
private |
Definition at line 128 of file BadChanList.h.
Referenced by BadChanList(), LoadNewData(), and reconfigure().
|
private |
Definition at line 127 of file BadChanList.h.
Referenced by BadChanList(), LoadNewData(), and reconfigure().
|
private |
Definition at line 85 of file BadChanList.h.
Referenced by LoadNewData(), and reconfigure().