|
|
Go to the documentation of this file.
128 : spyScopeRawDigisTag_(iConfig.getUntrackedParameter<
edm::
InputTag>(
129 "SpyScopeRawDigisTag",
edm::
InputTag(
"SiStripSpyUnpacker",
"ScopeRawDigis"))),
130 spyPedSubtrDigisTag_(
131 iConfig.getUntrackedParameter<
edm::
InputTag>(
"SpyPedSubtrDigisTag",
edm::
InputTag(
"SiStripFEDEmulator",
""))),
132 spyL1Tag_(iConfig.getUntrackedParameter<
edm::
InputTag>(
"SpyL1Tag",
133 edm::
InputTag(
"SiStripSpyDigiConverter",
"L1ACount"))),
134 spyTotCountTag_(iConfig.getUntrackedParameter<
edm::
InputTag>(
135 "SpyTotalEventCountTag",
edm::
InputTag(
"SiStripSpyDigiConverter",
"TotalEventCount"))),
136 spyAPVeTag_(iConfig.getUntrackedParameter<
edm::
InputTag>(
"SpyAPVeTag",
137 edm::
InputTag(
"SiStripSpyDigiConverter",
"APVAddress"))),
138 folderName_(iConfig.getUntrackedParameter<
std::
string>(
"HistogramFolderName",
139 "SiStrip/ReadoutView/SpyMonitoringSummary")),
140 fillAllDetailedHistograms_(iConfig.getUntrackedParameter<
bool>(
"FillAllDetailedHistograms",
false)),
141 fillWithEvtNum_(iConfig.getUntrackedParameter<
bool>(
"FillWithEventNumber",
false)),
142 fillWithLocalEvtNum_(iConfig.getUntrackedParameter<
bool>(
"FillWithLocalEventNumber",
false)),
145 outfileNames_(iConfig.getUntrackedParameter<
std::
vector<
std::
string> >(
"OutputErrors")),
146 writeCabling_(iConfig.getUntrackedParameter<
bool>(
"WriteCabling",
false)),
158 std::ostringstream pDebugStream;
162 for (
unsigned int i(0);
i <
nFiles;
i++) {
163 std::ostringstream
lName;
180 for (
unsigned int i(0);
i <
nFiles;
i++) {
203 LogInfo(
"SiStripSpyMonitorModule") <<
" Histograms will be written in " <<
folderName_
204 <<
". Current folder is : " << ibooker.
pwd() << std::endl;
224 std::ofstream lOutCabling;
225 lOutCabling.open(
"trackerDetId_FEDIdChNum_list.txt",
std::ios::out);
231 uint32_t lDetId = lConnection.
detId();
232 lOutCabling <<
"FED ID = " << lFedId <<
", Channel = " << lFedChannel
248 LogError(
"SiStripSpyMonitorModule") <<
e.what();
253 const std::vector<uint32_t>& lSpyAPVeVec = *lSpyAPVeHandle;
260 LogError(
"SiStripSpyMonitorModule") <<
e.what();
270 LogError(
"SiStripSpyMonitorModule") <<
e.what();
303 for (
unsigned int i(0);
i <
nFiles;
i++) {
304 outfile_[
i] <<
"**** evt " <<
iEvent.id().event() <<
" ****" << std::endl;
319 lFEDErrors.
hasOOS =
false;
327 uint32_t lAPVAddrRef = lSpyAPVeVec.at(lFedId);
338 uint32_t lDetId = lConnection.
detId();
348 if (lDigis == lInputDigis->
end()) {
349 LogDebug(
"SiStripSpyMonitorModule") <<
" -- digis not found in ScopeRawDigis map for FEDID " << lFedId
350 <<
" and FED channel " << lFedChannel << std::endl;
380 outfile_[
outfileMap_[
"NoData"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
381 }
else if (lFrame.
digitalLow == 0 && lRange > 0) {
386 outfile_[
outfileMap_[
"MinZero"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
392 outfile_[
outfileMap_[
"MaxSat"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
398 outfile_[
outfileMap_[
"LowRange"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
404 outfile_[
outfileMap_[
"HighRange"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
410 outfile_[
outfileMap_[
"LowPb"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
416 outfile_[
outfileMap_[
"HighPb"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
431 outfile_[
outfileMap_[
"OOS"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
437 outfile_[
outfileMap_[
"OtherPbs"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
462 if (lFrame.
apvAddress.second != lAPVAddrRef) {
468 outfile_[
outfileMap_[
"APVAddressError"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
479 outfile_[
outfileMap_[
"NegPeds"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
499 lTime = static_cast<double>(
evt_);
503 lTime = static_cast<double>(
iEvent.id().event());
519 for (; iDigi != endChannelDigis; ++iDigi) {
520 const uint16_t
val = iDigi->adc();
522 if (
val == 0 && lPair == aPair)
535 uint16_t nTrailers = 0;
552 LogDebug(
"SiStripSpyMonitorModule") <<
" -- Found " << nTrailers <<
" trailers every 70 clock cycles for channel "
553 << channelDigis.
detId() <<
", evt " <<
evt_ << std::endl;
555 return (nTrailers > 1) || (nTrailers == 1 && lastPos < 280);
563 bool foundTrailer =
false;
565 uint8_t aboveThreshold = 0;
567 for (; lStart != endChannelDigis; ++lStart) {
573 if (aboveThreshold == 2) {
584 return endChannelDigis;
bool check(const edm::EventSetup &iSetup)
edm::EDGetTokenT< std::vector< uint32_t > > spyTotCountToken_
const Frame extractFrameInfo(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, bool aPrintDebug=false)
edm::DetSetVector< SiStripRawDigi >::detset::const_iterator findTwoConsecutive(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold, uint16_t &aCounter)
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
T const * product() const
iterator end()
Return the off-the-end iterator.
void analyze(const edm::Event &, const edm::EventSetup &) override
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
bool fillAllDetailedHistograms_
void updateFedCabling(const SiStripFedCablingRcd &rcd)
SiStripSpyMonitorModule(const edm::ParameterSet &)
virtual void setCurrentFolder(std::string const &fullpath)
bool identifyTickmarks(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold)
std::pair< uint8_t, uint8_t > apvAddress
void getMajorityHeader(const edm::DetSetVector< SiStripRawDigi > *aInputDigis, uint16_t &firstHeaderBit, bool printResult=true)
unsigned int nAPVAddressError
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
T getUntrackedParameter(std::string const &, T const &) const
static const uint16_t FED_ID_MIN
void fillCountersHistograms(const ErrorCounters &aCounter, const double aTime)
Log< level::Info, false > LogInfo
Constants and enumerated types for FED/FEC systems.
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses,...
Log< level::Warning, false > LogWarning
void bookTopLevelHistograms(DQMStore::IBooker &, const TkDetMap *)
std::map< std::string, unsigned int > outfileMap_
edm::EDGetTokenT< std::vector< uint32_t > > spyAPVeToken_
bool hasNegativePedSubtr(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, uint16_t aPair)
#define DEFINE_FWK_MODULE(type)
static const uint16_t SPY_SAMPLES_PER_CHANNEL
void bookAllFEDHistograms(DQMStore::IBooker &)
SPYHistograms histManager_
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > spyPedSubtrDigisToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
unsigned long long EventNumber_t
virtual std::string pwd()
std::vector< std::string > outfileNames_
sistrip::SpyUtilities::FrameQuality frameQuality_
Class containning control, module, detector and connection information, at the level of a FED channel...
void fillDetailedHistograms(const Errors &aErr, const sistrip::SpyUtilities::Frame &aFrame, const unsigned int aFedId, const unsigned int aFedChannel)
const uint32_t & detId() const
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > spyScopeRawDigisToken_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
collection_type::const_iterator const_iterator
static const uint16_t STRIPS_PER_FEDCH
edm::ESWatcher< SiStripFedCablingRcd > cablingWatcher_
iterator find(det_id_type id)
edm::InputTag spyTotCountTag_
edm::InputTag spyAPVeTag_
det_id_type detId() const
Log< level::Error, false > LogError
edm::InputTag spyPedSubtrDigisTag_
static const uint16_t FED_ID_MAX
bool getData(T &iHolder) const
~SiStripSpyMonitorModule() override
std::ofstream outfile_[20]
const uint16_t threshold(const Frame &aFrame)
void fillFEDHistograms(const Errors &aErr, const unsigned int aFedId)
std::pair< bool, bool > apvErrorBit
bool fillWithLocalEvtNum_
void bookFEDHistograms(DQMStore::IBooker &, const unsigned int fedId, const Errors &aErr, bool doAll=false)
static const uint16_t FEDCH_PER_FED
uint16_t apvPairNumber() const
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
void initialise(const edm::ParameterSet &iConfig, std::ostringstream *pDebugStream) override
edm::EDGetTokenT< std::vector< uint32_t > > spyL1Token_
edm::InputTag spyScopeRawDigisTag_
const SiStripFedCabling * fedCabling_
uint16_t firstTrailerBit_
const uint16_t range(const Frame &aFrame)
collection_type::const_iterator const_iterator