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;
unsigned int nAPVAddressError
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
std::pair< uint8_t, uint8_t > apvAddress
static const uint16_t FED_ID_MIN
iterator find(det_id_type id)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
bool fillAllDetailedHistograms_
edm::DetSetVector< SiStripRawDigi >::detset::const_iterator findTwoConsecutive(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold, uint16_t &aCounter)
void updateFedCabling(const SiStripFedCablingRcd &rcd)
virtual void setCurrentFolder(std::string const &fullpath)
void analyze(const edm::Event &, const edm::EventSetup &) override
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
void initialise(const edm::ParameterSet &iConfig, std::ostringstream *pDebugStream) override
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
virtual std::string pwd()
T const * product() const
SiStripSpyMonitorModule(const edm::ParameterSet &)
unsigned long long EventNumber_t
void bookTopLevelHistograms(DQMStore::IBooker &, const TkDetMap *)
bool identifyTickmarks(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold)
static const uint16_t SPY_SAMPLES_PER_CHANNEL
const Frame extractFrameInfo(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, bool aPrintDebug=false)
std::map< std::string, unsigned int > outfileMap_
Log< level::Error, false > LogError
void bookAllFEDHistograms(DQMStore::IBooker &)
bool hasNegativePedSubtr(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, uint16_t aPair)
det_id_type detId() const
edm::EDGetTokenT< std::vector< uint32_t > > spyAPVeToken_
void fillCountersHistograms(const ErrorCounters &aCounter, const double aTime)
const uint16_t threshold(const Frame &aFrame)
const uint16_t range(const Frame &aFrame)
T getUntrackedParameter(std::string const &, T const &) const
SPYHistograms histManager_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > spyPedSubtrDigisToken_
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
std::pair< bool, bool > apvErrorBit
Class containning control, module, detector and connection information, at the level of a FED channel...
void getMajorityHeader(const edm::DetSetVector< SiStripRawDigi > *aInputDigis, uint16_t &firstHeaderBit, bool printResult=true)
sistrip::SpyUtilities::FrameQuality frameQuality_
std::vector< std::string > outfileNames_
#define DEFINE_FWK_MODULE(type)
edm::ESWatcher< SiStripFedCablingRcd > cablingWatcher_
void bookFEDHistograms(DQMStore::IBooker &, const unsigned int fedId, const Errors &aErr, bool doAll=false)
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > spyScopeRawDigisToken_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
iterator end()
Return the off-the-end iterator.
const uint32_t & detId() const
edm::InputTag spyTotCountTag_
Log< level::Info, false > LogInfo
edm::InputTag spyAPVeTag_
static const uint16_t STRIPS_PER_FEDCH
edm::InputTag spyPedSubtrDigisTag_
Constants and enumerated types for FED/FEC systems.
void fillFEDHistograms(const Errors &aErr, const unsigned int aFedId)
uint16_t apvPairNumber() const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
bool check(const edm::EventSetup &iSetup)
std::ofstream outfile_[20]
~SiStripSpyMonitorModule() override
bool fillWithLocalEvtNum_
static const uint16_t FEDCH_PER_FED
void fillDetailedHistograms(const Errors &aErr, const sistrip::SpyUtilities::Frame &aFrame, const unsigned int aFedId, const unsigned int aFedChannel)
edm::InputTag spyScopeRawDigisTag_
static const uint16_t FED_ID_MAX
edm::EDGetTokenT< std::vector< uint32_t > > spyL1Token_
Log< level::Warning, false > LogWarning
collection_type::const_iterator const_iterator
collection_type::const_iterator const_iterator
const SiStripFedCabling * fedCabling_
uint16_t firstTrailerBit_
edm::EDGetTokenT< std::vector< uint32_t > > spyTotCountToken_