|
|
Go to the documentation of this file.
123 : spyScopeRawDigisTag_(iConfig.getUntrackedParameter<
edm::
InputTag>(
124 "SpyScopeRawDigisTag",
edm::
InputTag(
"SiStripSpyUnpacker",
"ScopeRawDigis"))),
125 spyPedSubtrDigisTag_(
126 iConfig.getUntrackedParameter<
edm::
InputTag>(
"SpyPedSubtrDigisTag",
edm::
InputTag(
"SiStripFEDEmulator",
""))),
127 spyL1Tag_(iConfig.getUntrackedParameter<
edm::
InputTag>(
"SpyL1Tag",
128 edm::
InputTag(
"SiStripSpyDigiConverter",
"L1ACount"))),
129 spyTotCountTag_(iConfig.getUntrackedParameter<
edm::
InputTag>(
130 "SpyTotalEventCountTag",
edm::
InputTag(
"SiStripSpyDigiConverter",
"TotalEventCount"))),
131 spyAPVeTag_(iConfig.getUntrackedParameter<
edm::
InputTag>(
"SpyAPVeTag",
132 edm::
InputTag(
"SiStripSpyDigiConverter",
"APVAddress"))),
133 folderName_(iConfig.getUntrackedParameter<
std::
string>(
"HistogramFolderName",
134 "SiStrip/ReadoutView/SpyMonitoringSummary")),
135 fillAllDetailedHistograms_(iConfig.getUntrackedParameter<
bool>(
"FillAllDetailedHistograms",
false)),
136 fillWithEvtNum_(iConfig.getUntrackedParameter<
bool>(
"FillWithEventNumber",
false)),
137 fillWithLocalEvtNum_(iConfig.getUntrackedParameter<
bool>(
"FillWithLocalEventNumber",
false)),
140 outfileNames_(iConfig.getUntrackedParameter<
std::vector<
std::
string> >(
"OutputErrors")),
141 writeCabling_(iConfig.getUntrackedParameter<
bool>(
"WriteCabling",
false)) {
150 std::ostringstream pDebugStream;
154 for (
unsigned int i(0);
i <
nFiles;
i++) {
155 std::ostringstream
lName;
172 for (
unsigned int i(0);
i <
nFiles;
i++) {
191 LogInfo(
"SiStripSpyMonitorModule") <<
" Histograms will be written in " <<
folderName_
192 <<
". Current folder is : " << ibooker.
pwd() << std::endl;
215 std::ofstream lOutCabling;
216 lOutCabling.open(
"trackerDetId_FEDIdChNum_list.txt",
std::ios::out);
222 uint32_t lDetId = lConnection.
detId();
223 lOutCabling <<
"FED ID = " << lFedId <<
", Channel = " << lFedChannel
239 LogError(
"SiStripSpyMonitorModule") <<
e.what();
244 const std::vector<uint32_t>& lSpyAPVeVec = *lSpyAPVeHandle;
251 LogError(
"SiStripSpyMonitorModule") <<
e.what();
261 LogError(
"SiStripSpyMonitorModule") <<
e.what();
294 for (
unsigned int i(0);
i <
nFiles;
i++) {
295 outfile_[
i] <<
"**** evt " <<
iEvent.id().event() <<
" ****" << std::endl;
310 lFEDErrors.
hasOOS =
false;
318 uint32_t lAPVAddrRef = lSpyAPVeVec.at(lFedId);
329 uint32_t lDetId = lConnection.
detId();
339 if (lDigis == lInputDigis->
end()) {
340 LogDebug(
"SiStripSpyMonitorModule") <<
" -- digis not found in ScopeRawDigis map for FEDID " << lFedId
341 <<
" and FED channel " << lFedChannel << std::endl;
371 outfile_[
outfileMap_[
"NoData"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
372 }
else if (lFrame.
digitalLow == 0 && lRange > 0) {
377 outfile_[
outfileMap_[
"MinZero"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
383 outfile_[
outfileMap_[
"MaxSat"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
389 outfile_[
outfileMap_[
"LowRange"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
395 outfile_[
outfileMap_[
"HighRange"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
401 outfile_[
outfileMap_[
"LowPb"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
407 outfile_[
outfileMap_[
"HighPb"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
422 outfile_[
outfileMap_[
"OOS"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
428 outfile_[
outfileMap_[
"OtherPbs"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
453 if (lFrame.
apvAddress.second != lAPVAddrRef) {
459 outfile_[
outfileMap_[
"APVAddressError"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
470 outfile_[
outfileMap_[
"NegPeds"]] << lFedId <<
" " << lFedChannel <<
" " << lDetId << std::endl;
490 lTime = static_cast<double>(
evt_);
494 lTime = static_cast<double>(
iEvent.id().event());
510 for (; iDigi != endChannelDigis; ++iDigi) {
511 const uint16_t
val = iDigi->adc();
513 if (
val == 0 && lPair == aPair)
526 uint16_t nTrailers = 0;
543 LogDebug(
"SiStripSpyMonitorModule") <<
" -- Found " << nTrailers <<
" trailers every 70 clock cycles for channel "
544 << channelDigis.
detId() <<
", evt " <<
evt_ << std::endl;
546 return (nTrailers > 1) || (nTrailers == 1 && lastPos < 280);
554 bool foundTrailer =
false;
556 uint8_t aboveThreshold = 0;
558 for (; lStart != endChannelDigis; ++lStart) {
564 if (aboveThreshold == 2) {
575 return endChannelDigis;
T const * product() const
edm::EDGetTokenT< std::vector< uint32_t > > spyTotCountToken_
edm::DetSetVector< SiStripRawDigi >::detset::const_iterator findTwoConsecutive(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, const uint16_t threshold, uint16_t &aCounter)
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_
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
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)
Constants and enumerated types for FED/FEC systems.
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses,...
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()
static const Frame extractFrameInfo(const edm::DetSetVector< SiStripRawDigi >::detset &channelDigis, bool aPrintDebug=false)
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
static const uint16_t range(const Frame &aFrame)
edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > spyScopeRawDigisToken_
collection_type::const_iterator const_iterator
static const uint16_t STRIPS_PER_FEDCH
iterator find(det_id_type id)
edm::InputTag spyTotCountTag_
static const uint16_t threshold(const Frame &aFrame)
edm::InputTag spyAPVeTag_
det_id_type detId() const
edm::InputTag spyPedSubtrDigisTag_
static const uint16_t FED_ID_MAX
const SiStripFedCabling * getCabling(const edm::EventSetup &)
Updates the cabling object from the DB.
~SiStripSpyMonitorModule() override
std::ofstream outfile_[20]
static void getMajorityHeader(const edm::DetSetVector< SiStripRawDigi > *aInputDigis, uint16_t &firstHeaderBit, bool printResult=true)
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
void initialise(const edm::ParameterSet &iConfig, std::ostringstream *pDebugStream) override
edm::EDGetTokenT< std::vector< uint32_t > > spyL1Token_
edm::InputTag spyScopeRawDigisTag_
uint16_t firstTrailerBit_
sistrip::SpyUtilities utility_
collection_type::const_iterator const_iterator