CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiStripFEDCheckPlugin Class Reference
Inheritance diagram for SiStripFEDCheckPlugin:
DQMOneEDAnalyzer<> edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SiStripFEDCheckPlugin (const edm::ParameterSet &)
 
 ~SiStripFEDCheckPlugin () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer<>
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void doUpdateIfNeeded ()
 
void dqmEndRun (edm::Run const &, edm::EventSetup const &) override
 
void fillFatalError (unsigned int fedId, bool fatalError)
 
void fillNonFatalError (unsigned int fedId, float nonFatalError)
 
void fillPresent (unsigned int fedId, bool present)
 
bool hasFatalError (const FEDRawData &fedData, unsigned int fedId) const
 
bool hasNonFatalError (const FEDRawData &fedData, unsigned int fedId) const
 
void updateCabling (const SiStripFedCablingRcd &cablingRcd)
 
void updateHistograms ()
 

Private Attributes

const SiStripFedCablingcabling_
 
bool checkChannelLengths_
 
bool checkChannelStatusBits_
 
bool checkFELengths_
 
bool checkPacketCodes_
 
edm::ParameterSet conf_
 
std::string dirName_
 
bool doPayloadChecks_
 
bool doPLOTfedFatalErrors_
 
bool doPLOTfedNonFatalErrors_
 
bool doPLOTfedsPresent_
 
bool doPLOTnFEDinVsLS_
 
bool doPLOTnFEDinWdataVsLS_
 
unsigned int eventCount_
 
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcdfedCablingToken_
 
edm::ESWatcher< SiStripFedCablingRcdfedCablingWatcher_
 
std::vector< unsigned int > fedFatalErrorBinContents_
 
MonitorElementfedFatalErrors_
 
std::vector< unsigned int > fedNonFatalErrorBinContents_
 
MonitorElementfedNonFatalErrors_
 
MonitorElementfedsPresent_
 
std::vector< unsigned int > fedsPresentBinContents_
 
MonitorElementnFEDinVsLS_
 
MonitorElementnFEDinWdataVsLS_
 
bool printDebug_
 
edm::InputTag rawDataTag_
 
edm::EDGetTokenT< FEDRawDataCollectionrawDataToken_
 
unsigned int siStripFedIdMax_
 
unsigned int siStripFedIdMin_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken_
 
unsigned int updateFrequency_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer<>
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from DQMOneEDAnalyzer<>
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMOneEDAnalyzer<>
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Description: DQM source application to produce data integrety histograms for SiStrip data for use in HLT and Prompt reco

Definition at line 52 of file SiStripFEDDataCheck.cc.

Constructor & Destructor Documentation

◆ SiStripFEDCheckPlugin()

SiStripFEDCheckPlugin::SiStripFEDCheckPlugin ( const edm::ParameterSet iConfig)
explicit

Definition at line 119 of file SiStripFEDDataCheck.cc.

References checkChannelLengths_, checkChannelStatusBits_, checkFELengths_, checkPacketCodes_, conf_, doPayloadChecks_, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, printDebug_, rawDataTag_, rawDataToken_, siStripFedIdMax_, siStripFedIdMin_, and contentValuesCheck::ss.

120  : rawDataTag_(iConfig.getParameter<edm::InputTag>("RawDataTag")),
121  dirName_(iConfig.getUntrackedParameter<std::string>("DirName", "SiStrip/FEDIntegrity/")),
122  printDebug_(iConfig.getUntrackedParameter<bool>("PrintDebugMessages", false)),
123  doPLOTfedsPresent_(iConfig.getParameter<bool>("doPLOTfedsPresent")),
124  doPLOTfedFatalErrors_(iConfig.getParameter<bool>("doPLOTfedFatalErrors")),
125  doPLOTfedNonFatalErrors_(iConfig.getParameter<bool>("doPLOTfedNonFatalErrors")),
126  doPLOTnFEDinVsLS_(iConfig.getParameter<bool>("doPLOTnFEDinVsLS")),
127  doPLOTnFEDinWdataVsLS_(iConfig.getParameter<bool>("doPLOTnFEDinWdataVsLS")),
128  fedsPresent_(nullptr),
129  fedFatalErrors_(nullptr),
130  fedNonFatalErrors_(nullptr),
131  nFEDinVsLS_(nullptr),
132  nFEDinWdataVsLS_(nullptr),
133  updateFrequency_(iConfig.getUntrackedParameter<unsigned int>("HistogramUpdateFrequency", 0)),
137  eventCount_(0),
138  doPayloadChecks_(iConfig.getUntrackedParameter<bool>("DoPayloadChecks", true)),
139  checkChannelLengths_(iConfig.getUntrackedParameter<bool>("CheckChannelLengths", true)),
140  checkPacketCodes_(iConfig.getUntrackedParameter<bool>("CheckChannelPacketCodes", true)),
141  checkFELengths_(iConfig.getUntrackedParameter<bool>("CheckFELengths", true)),
142  checkChannelStatusBits_(iConfig.getUntrackedParameter<bool>("CheckChannelStatus", true)),
143  verbose_(iConfig.getUntrackedParameter<bool>("verbose", false)),
145  fedCablingToken_(esConsumes<>()),
146  tTopoToken_(esConsumes<>()) {
147  rawDataToken_ = consumes<FEDRawDataCollection>(rawDataTag_);
149  std::stringstream ss;
150  ss << "Payload checks are disabled but individual payload checks have been enabled. The following payload checks "
151  "will be skipped: ";
153  ss << "Channel length check, ";
154  if (checkPacketCodes_)
155  ss << "Channel packet code check, ";
157  ss << "Cabled channel status bits checks, ";
158  if (checkFELengths_)
159  ss << "FE Unit legnth check";
160  edm::LogWarning("SiStripFEDCheck") << ss.str();
161  }
162 
165 
166  conf_ = iConfig;
167 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * nFEDinWdataVsLS_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
MonitorElement * fedNonFatalErrors_
T getUntrackedParameter(std::string const &, T const &) const
edm::ESWatcher< SiStripFedCablingRcd > fedCablingWatcher_
void updateCabling(const SiStripFedCablingRcd &cablingRcd)
std::vector< unsigned int > fedFatalErrorBinContents_
std::vector< unsigned int > fedsPresentBinContents_
MonitorElement * nFEDinVsLS_
MonitorElement * fedFatalErrors_
Log< level::Warning, false > LogWarning
MonitorElement * fedsPresent_
std::vector< unsigned int > fedNonFatalErrorBinContents_

◆ ~SiStripFEDCheckPlugin()

SiStripFEDCheckPlugin::~SiStripFEDCheckPlugin ( )
override

Definition at line 169 of file SiStripFEDDataCheck.cc.

169 {}

Member Function Documentation

◆ analyze()

void SiStripFEDCheckPlugin::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 176 of file SiStripFEDDataCheck.cc.

References edmScanValgrind::buffer, cabling_, edm::ESWatcher< T >::check(), checkChannelLengths_, checkChannelStatusBits_, checkFELengths_, checkPacketCodes_, gather_cfg::cout, FEDRawData::data(), doPayloadChecks_, doPLOTnFEDinVsLS_, doPLOTnFEDinWdataVsLS_, doUpdateIfNeeded(), Exception, fedCablingWatcher_, FEDRawDataCollection::FEDData(), l1tstage2_dqm_sourceclient-live_cfg::fedId, dqm::impl::MonitorElement::Fill(), fillFatalError(), fillNonFatalError(), fillPresent(), edm::EventSetup::getData(), iEvent, eostools::move(), nFEDinVsLS_, nFEDinWdataVsLS_, sistrip::preconstructCheckFEDBuffer(), printDebug_, rawDataToken_, siStripFedIdMax_, siStripFedIdMin_, FEDRawData::size(), contentValuesCheck::ss, sistrip::SUCCESS, tTopoToken_, and verbose_.

176  {
177  const auto tTopo = &iSetup.getData(tTopoToken_);
178  fedCablingWatcher_.check(iSetup);
179 
180  //get raw data
181  edm::Handle<FEDRawDataCollection> rawDataCollectionHandle;
182  const bool gotData = iEvent.getByToken(rawDataToken_, rawDataCollectionHandle);
183  if (verbose_)
184  std::cout << "[SiStripFEDCheckPlugin::analyze] gotData ? " << (gotData ? "YES" : "NOPE") << std::endl;
185  if (!gotData) {
186  //module is required to silently do nothing when data is not present
187  return;
188  }
189  const FEDRawDataCollection& rawDataCollection = *rawDataCollectionHandle;
190 
191  //FED errors
192  FEDErrors lFedErrors;
193 
194  //loop over siStrip FED IDs
195  size_t nFEDin = 0;
196  size_t nFEDinWdata = 0;
197  for (unsigned int fedId = siStripFedIdMin_; fedId <= siStripFedIdMax_; fedId++) {
198  const FEDRawData& fedData = rawDataCollection.FEDData(fedId);
199 
200  //create an object to fill all errors
201  //third param to false:save time by not initialising anything not used here
202  lFedErrors.initialiseFED(fedId, cabling_, tTopo, false);
203 
204  //check data exists
205  if (!fedData.size() || !fedData.data()) {
206  fillPresent(fedId, false);
207  continue;
208  }
209  if (verbose_)
210  std::cout << "FED " << fedId;
211  if (verbose_)
212  std::cout << " fedData.size(): " << fedData.size();
213  if (verbose_)
214  std::cout << " fedData.data(): " << fedData.data() << std::endl;
215  if (fedData.size())
216  nFEDin++;
217  if (fedData.size() && fedData.data())
218  nFEDinWdata++;
219 
220  //fill buffer present histogram
221  fillPresent(fedId, true);
222 
223  //check for fatal errors
224  //no need for debug output
225  bool hasFatalErrors = false;
226  float rateNonFatal = 0;
227 
228  std::unique_ptr<const sistrip::FEDBuffer> buffer;
229 
230  if (!lFedErrors.fillFatalFEDErrors(fedData, 0)) {
231  hasFatalErrors = true;
232  } else {
233  //need to construct full object to go any further
235  const auto st_buffer = sistrip::preconstructCheckFEDBuffer(fedData, true);
236  if (sistrip::FEDBufferStatusCode::SUCCESS != st_buffer) {
237  throw cms::Exception("FEDBuffer") << st_buffer << " (check debug output for more details)";
238  }
239  auto tmp_buffer = std::make_unique<sistrip::FEDBuffer>(fedData, true);
240  tmp_buffer->findChannels();
241  buffer = std::move(tmp_buffer); // const now
242  if (doPayloadChecks_) {
243  bool channelLengthsOK = checkChannelLengths_ ? buffer->checkChannelLengthsMatchBufferLength() : true;
244  bool channelPacketCodesOK = checkPacketCodes_ ? buffer->checkChannelPacketCodes() : true;
245  bool feLengthsOK = checkFELengths_ ? buffer->checkFEUnitLengths() : true;
246  if (!channelLengthsOK || !channelPacketCodesOK || !feLengthsOK) {
247  hasFatalErrors = true;
248  }
249  }
251  rateNonFatal = lFedErrors.fillNonFatalFEDErrors(buffer.get(), cabling_);
252  }
253  }
254 
255  if (hasFatalErrors) {
256  fillFatalError(fedId, true);
257  if (printDebug_) {
258  if (!buffer.get()) {
259  const auto st_buffer = sistrip::preconstructCheckFEDBuffer(fedData, true);
260  if (sistrip::FEDBufferStatusCode::SUCCESS != st_buffer) {
261  throw cms::Exception("FEDBuffer") << st_buffer << " (check debug output for more details)";
262  }
263  auto tmp_buffer = std::make_unique<sistrip::FEDBuffer>(fedData, true);
264  tmp_buffer->findChannels();
265  buffer = std::move(tmp_buffer); // const now
266  }
267  edm::LogInfo("SiStripFEDCheck") << "Fatal error with FED ID " << fedId << ". Check summary: " << std::endl
268  << buffer->checkSummary() << std::endl;
269  std::stringstream ss;
270  buffer->dump(ss);
271  edm::LogInfo("SiStripFEDCheck") << ss.str();
272  }
273  } else {
274  fillFatalError(fedId, false);
275  //fill non-fatal errors histogram if there were no fatal errors
276  fillNonFatalError(fedId, rateNonFatal);
277  if (printDebug_ && rateNonFatal > 0) {
278  if (!buffer.get()) {
279  const auto st_buffer = sistrip::preconstructCheckFEDBuffer(fedData, true);
280  if (sistrip::FEDBufferStatusCode::SUCCESS != st_buffer) {
281  throw cms::Exception("FEDBuffer") << st_buffer << " (check debug output for more details)";
282  }
283  auto tmp_buffer = std::make_unique<sistrip::FEDBuffer>(fedData, true);
284  tmp_buffer->findChannels();
285  buffer = std::move(tmp_buffer); // const now
286  }
287  edm::LogInfo("SiStripFEDCheck") << "Non-fatal error with FED ID " << fedId << " for " << rateNonFatal
288  << " of the channels. Check summary: " << std::endl
289  << buffer->checkSummary() << std::endl;
290  std::stringstream ss;
291  buffer->dump(ss);
292  edm::LogInfo("SiStripFEDCheck") << ss.str();
293  }
294  }
295  } //loop over FED IDs
296  if (verbose_)
297  std::cout << "nFEDin: " << nFEDin << " nFEDinWdata: " << nFEDinWdata << std::endl;
298  if (doPLOTnFEDinVsLS_)
299  nFEDinVsLS_->Fill(static_cast<double>(iEvent.id().luminosityBlock()), nFEDin);
301  nFEDinWdataVsLS_->Fill(static_cast<double>(iEvent.id().luminosityBlock()), nFEDinWdata);
302 
303  //update histograms if needed
305 }
MonitorElement * nFEDinWdataVsLS_
void fillFatalError(unsigned int fedId, bool fatalError)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
const SiStripFedCabling * cabling_
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
edm::ESWatcher< SiStripFedCablingRcd > fedCablingWatcher_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Log< level::Info, false > LogInfo
MonitorElement * nFEDinVsLS_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
FEDBufferStatusCode preconstructCheckFEDBuffer(const FEDRawData &fedBuffer, bool allowBadBuffer=false)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
void fillNonFatalError(unsigned int fedId, float nonFatalError)
def move(src, dest)
Definition: eostools.py:511
void fillPresent(unsigned int fedId, bool present)

◆ bookHistograms()

void SiStripFEDCheckPlugin::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Implements DQMOneEDAnalyzer<>.

Definition at line 308 of file SiStripFEDDataCheck.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::bookProfile(), conf_, dirName_, doPLOTfedFatalErrors_, doPLOTfedNonFatalErrors_, doPLOTfedsPresent_, doPLOTnFEDinVsLS_, doPLOTnFEDinWdataVsLS_, fedFatalErrors_, fedNonFatalErrors_, fedsPresent_, edm::ParameterSet::getParameter(), siStripFEDCheck_cfi::LSBin, siStripFEDCheck_cfi::LSMax, siStripFEDCheck_cfi::LSMin, nFEDinVsLS_, nFEDinWdataVsLS_, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), siStripFedIdMax_, and siStripFedIdMin_.

310  {
311  size_t nFED = siStripFedIdMax_ - siStripFedIdMin_ + 1;
312  double xFEDmin = siStripFedIdMin_ - 0.5;
313  double xFEDmax = siStripFedIdMax_ + 0.5;
314 
315  //get DQM store
316  ibooker.setCurrentFolder(dirName_);
317  //book histograms
318  if (doPLOTfedsPresent_) {
319  fedsPresent_ =
320  ibooker.book1D("FEDEntries", "Number of times FED buffer is present in data", nFED, xFEDmin, xFEDmax);
321  fedsPresent_->setAxisTitle("FED-ID", 1);
322  }
323 
324  if (doPLOTfedFatalErrors_) {
325  fedFatalErrors_ = ibooker.book1D("FEDFatal", "Number of fatal errors in FED buffer", nFED, xFEDmin, xFEDmax);
326  fedFatalErrors_->setAxisTitle("FED-ID", 1);
327  }
328 
331  ibooker.book1D("FEDNonFatal", "Number of non fatal errors in FED buffer", nFED, xFEDmin, xFEDmax);
332  fedNonFatalErrors_->setAxisTitle("FED-ID", 1);
333  }
334 
335  int LSBin = conf_.getParameter<int>("LSBin");
336  double LSMin = conf_.getParameter<double>("LSMin");
337  double LSMax = conf_.getParameter<double>("LSMax");
338 
339  if (doPLOTnFEDinVsLS_) {
340  nFEDinVsLS_ =
341  ibooker.bookProfile("nFEDinVsLS", "number of FED in Vs LS", LSBin, LSMin, LSMax, nFED, xFEDmin, xFEDmax);
342  nFEDinVsLS_->setAxisTitle("LS", 1);
343  nFEDinVsLS_->setAxisTitle("FED-ID", 2);
344  }
345 
347  nFEDinWdataVsLS_ = ibooker.bookProfile(
348  "nFEDinWdataVsLS", "number of FED in (with data) Vs LS", LSBin, LSMin, LSMax, nFED, xFEDmin, xFEDmax);
349  nFEDinWdataVsLS_->setAxisTitle("LS", 1);
350  nFEDinWdataVsLS_->setAxisTitle("FED-ID", 2);
351  }
352 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * nFEDinWdataVsLS_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * fedNonFatalErrors_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
MonitorElement * nFEDinVsLS_
MonitorElement * fedFatalErrors_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * fedsPresent_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ doUpdateIfNeeded()

void SiStripFEDCheckPlugin::doUpdateIfNeeded ( )
private

Definition at line 393 of file SiStripFEDDataCheck.cc.

References eventCount_, updateFrequency_, and updateHistograms().

Referenced by analyze().

393  {
394  eventCount_++;
397  }
398 }

◆ dqmEndRun()

void SiStripFEDCheckPlugin::dqmEndRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 355 of file SiStripFEDDataCheck.cc.

References updateHistograms().

◆ fillDescriptions()

void SiStripFEDCheckPlugin::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 428 of file SiStripFEDDataCheck.cc.

References edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, HLT_2022v12_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

428  {
430 
431  // Directory to book histograms in
432  desc.addUntracked<std::string>("DirName", "SiStrip/FEDIntegrity/");
433  // Raw data collection
434  desc.add<edm::InputTag>("RawDataTag", edm::InputTag("source"));
435  // Number of events to cache info before updating histograms
436  // (set to zero to disable cache)
437  // HistogramUpdateFrequency = cms.untracked.uint32(0),
438  desc.addUntracked<unsigned int>("HistogramUpdateFrequency", 1000);
439  // Print info about errors buffer dumps to LogInfo(SiStripFEDCheck)
440  desc.addUntracked<bool>("PrintDebugMessages", false);
441  desc.add<bool>("doPLOTfedsPresent", true);
442  desc.add<bool>("doPLOTfedFatalErrors", true);
443  desc.add<bool>("doPLOTfedNonFatalErrors", true);
444  desc.add<bool>("doPLOTnFEDinVsLS", false);
445  desc.add<bool>("doPLOTnFEDinWdataVsLS", false);
446  // Write the DQM store to a file (DQMStore.root) at the end of the run
447  desc.addUntracked<bool>("WriteDQMStore", false);
448  // Use to disable all payload (non-fatal) checks
449  desc.addUntracked<bool>("DoPayloadChecks", true);
450  // Use to disable check on channel lengths
451  desc.addUntracked<bool>("CheckChannelLengths", true);
452  // Use to disable check on channel packet codes
453  desc.addUntracked<bool>("CheckChannelPacketCodes", true);
454  // Use to disable check on FE unit lengths in full debug header
455  desc.addUntracked<bool>("CheckFELengths", true);
456  // Use to disable check on channel status bits
457  desc.addUntracked<bool>("CheckChannelStatus", true);
458  desc.add<int>("LSBin", 5000);
459  desc.add<double>("LSMin", 0.5);
460  desc.add<double>("LSMax", 5000.5);
461 
462  descriptions.addDefault(desc);
463 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ fillFatalError()

void SiStripFEDCheckPlugin::fillFatalError ( unsigned int  fedId,
bool  fatalError 
)
inlineprivate

Definition at line 370 of file SiStripFEDDataCheck.cc.

References doPLOTfedFatalErrors_, fedFatalErrorBinContents_, fedFatalErrors_, l1tstage2_dqm_sourceclient-live_cfg::fedId, dqm::impl::MonitorElement::Fill(), and updateFrequency_.

Referenced by analyze().

370  {
371  if (updateFrequency_) {
372  if (fatalError)
374  } else {
375  //fedFatalErrors_->Fill( fatalError ? 1 : 0 );
376  if (fatalError)
379  }
380 }
void Fill(long long x)
std::vector< unsigned int > fedFatalErrorBinContents_
MonitorElement * fedFatalErrors_

◆ fillNonFatalError()

void SiStripFEDCheckPlugin::fillNonFatalError ( unsigned int  fedId,
float  nonFatalError 
)
inlineprivate

Definition at line 382 of file SiStripFEDDataCheck.cc.

References doPLOTfedNonFatalErrors_, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedNonFatalErrorBinContents_, fedNonFatalErrors_, dqm::impl::MonitorElement::Fill(), and updateFrequency_.

Referenced by analyze().

382  {
383  if (updateFrequency_) {
384  if (nonFatalError > 0)
385  fedNonFatalErrorBinContents_[fedId]++; //nonFatalError;
386  } else {
387  if (nonFatalError > 0)
390  }
391 }
MonitorElement * fedNonFatalErrors_
void Fill(long long x)
std::vector< unsigned int > fedNonFatalErrorBinContents_

◆ fillPresent()

void SiStripFEDCheckPlugin::fillPresent ( unsigned int  fedId,
bool  present 
)
inlineprivate

◆ hasFatalError()

bool SiStripFEDCheckPlugin::hasFatalError ( const FEDRawData fedData,
unsigned int  fedId 
) const
private

◆ hasNonFatalError()

bool SiStripFEDCheckPlugin::hasNonFatalError ( const FEDRawData fedData,
unsigned int  fedId 
) const
private

◆ updateCabling()

void SiStripFEDCheckPlugin::updateCabling ( const SiStripFedCablingRcd cablingRcd)
private

Definition at line 357 of file SiStripFEDDataCheck.cc.

References cabling_, fedCablingToken_, and edm::eventsetup::EventSetupRecordImplementation< T >::get().

357  {
358  cabling_ = &cablingRcd.get(fedCablingToken_);
359 }
const SiStripFedCabling * cabling_
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const

◆ updateHistograms()

void SiStripFEDCheckPlugin::updateHistograms ( )
private

Definition at line 400 of file SiStripFEDDataCheck.cc.

References newFWLiteAna::bin, doPLOTfedFatalErrors_, doPLOTfedNonFatalErrors_, doPLOTfedsPresent_, fedFatalErrorBinContents_, fedFatalErrors_, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedNonFatalErrorBinContents_, fedNonFatalErrors_, fedsPresent_, fedsPresentBinContents_, dqm::impl::MonitorElement::getTH1(), siStripFedIdMax_, siStripFedIdMin_, and updateFrequency_.

Referenced by doUpdateIfNeeded(), and dqmEndRun().

400  {
401  //if the cache is not being used then do nothing
402  if (!updateFrequency_)
403  return;
404  unsigned int entriesFedsPresent = 0;
405  unsigned int entriesFatalErrors = 0;
406  unsigned int entriesNonFatalErrors = 0;
407  for (unsigned int fedId = siStripFedIdMin_, bin = 1; fedId < siStripFedIdMax_ + 1; fedId++, bin++) {
408  unsigned int fedsPresentBin = fedsPresentBinContents_[fedId];
409  if (doPLOTfedsPresent_)
410  fedsPresent_->getTH1()->SetBinContent(bin, fedsPresentBin);
411  entriesFedsPresent += fedsPresentBin;
412  unsigned int fedFatalErrorsBin = fedFatalErrorBinContents_[fedId];
414  fedFatalErrors_->getTH1()->SetBinContent(bin, fedFatalErrorsBin);
415  entriesFatalErrors += fedFatalErrorsBin;
416  unsigned int fedNonFatalErrorsBin = fedNonFatalErrorBinContents_[fedId];
418  fedNonFatalErrors_->getTH1()->SetBinContent(bin, fedNonFatalErrorsBin);
419  entriesNonFatalErrors += fedNonFatalErrorsBin;
420  }
421  if (doPLOTfedsPresent_)
422  fedsPresent_->getTH1()->SetEntries(entriesFedsPresent);
424  fedFatalErrors_->getTH1()->SetEntries(entriesFatalErrors);
426  fedNonFatalErrors_->getTH1()->SetEntries(entriesNonFatalErrors);
427 }
MonitorElement * fedNonFatalErrors_
std::vector< unsigned int > fedFatalErrorBinContents_
std::vector< unsigned int > fedsPresentBinContents_
MonitorElement * fedFatalErrors_
MonitorElement * fedsPresent_
std::vector< unsigned int > fedNonFatalErrorBinContents_

Member Data Documentation

◆ cabling_

const SiStripFedCabling* SiStripFEDCheckPlugin::cabling_
private

Definition at line 103 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and updateCabling().

◆ checkChannelLengths_

bool SiStripFEDCheckPlugin::checkChannelLengths_
private

Definition at line 100 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

◆ checkChannelStatusBits_

bool SiStripFEDCheckPlugin::checkChannelStatusBits_
private

Definition at line 100 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

◆ checkFELengths_

bool SiStripFEDCheckPlugin::checkFELengths_
private

Definition at line 100 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

◆ checkPacketCodes_

bool SiStripFEDCheckPlugin::checkPacketCodes_
private

Definition at line 100 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

◆ conf_

edm::ParameterSet SiStripFEDCheckPlugin::conf_
private

Definition at line 112 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms(), and SiStripFEDCheckPlugin().

◆ dirName_

std::string SiStripFEDCheckPlugin::dirName_
private

Definition at line 77 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms().

◆ doPayloadChecks_

bool SiStripFEDCheckPlugin::doPayloadChecks_
private

Definition at line 100 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

◆ doPLOTfedFatalErrors_

bool SiStripFEDCheckPlugin::doPLOTfedFatalErrors_
private

Definition at line 81 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms(), fillFatalError(), and updateHistograms().

◆ doPLOTfedNonFatalErrors_

bool SiStripFEDCheckPlugin::doPLOTfedNonFatalErrors_
private

Definition at line 81 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms(), fillNonFatalError(), and updateHistograms().

◆ doPLOTfedsPresent_

bool SiStripFEDCheckPlugin::doPLOTfedsPresent_
private

Definition at line 81 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms(), fillPresent(), and updateHistograms().

◆ doPLOTnFEDinVsLS_

bool SiStripFEDCheckPlugin::doPLOTnFEDinVsLS_
private

Definition at line 82 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

◆ doPLOTnFEDinWdataVsLS_

bool SiStripFEDCheckPlugin::doPLOTnFEDinWdataVsLS_
private

Definition at line 82 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

◆ eventCount_

unsigned int SiStripFEDCheckPlugin::eventCount_
private

Definition at line 97 of file SiStripFEDDataCheck.cc.

Referenced by doUpdateIfNeeded().

◆ fedCablingToken_

edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> SiStripFEDCheckPlugin::fedCablingToken_
private

Definition at line 106 of file SiStripFEDDataCheck.cc.

Referenced by updateCabling().

◆ fedCablingWatcher_

edm::ESWatcher<SiStripFedCablingRcd> SiStripFEDCheckPlugin::fedCablingWatcher_
private

Definition at line 105 of file SiStripFEDDataCheck.cc.

Referenced by analyze().

◆ fedFatalErrorBinContents_

std::vector<unsigned int> SiStripFEDCheckPlugin::fedFatalErrorBinContents_
private

Definition at line 95 of file SiStripFEDDataCheck.cc.

Referenced by fillFatalError(), and updateHistograms().

◆ fedFatalErrors_

MonitorElement* SiStripFEDCheckPlugin::fedFatalErrors_
private

Definition at line 84 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms(), fillFatalError(), and updateHistograms().

◆ fedNonFatalErrorBinContents_

std::vector<unsigned int> SiStripFEDCheckPlugin::fedNonFatalErrorBinContents_
private

Definition at line 96 of file SiStripFEDDataCheck.cc.

Referenced by fillNonFatalError(), and updateHistograms().

◆ fedNonFatalErrors_

MonitorElement* SiStripFEDCheckPlugin::fedNonFatalErrors_
private

Definition at line 85 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms(), fillNonFatalError(), and updateHistograms().

◆ fedsPresent_

MonitorElement* SiStripFEDCheckPlugin::fedsPresent_
private

Definition at line 83 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms(), fillPresent(), and updateHistograms().

◆ fedsPresentBinContents_

std::vector<unsigned int> SiStripFEDCheckPlugin::fedsPresentBinContents_
private

Definition at line 94 of file SiStripFEDDataCheck.cc.

Referenced by fillPresent(), and updateHistograms().

◆ nFEDinVsLS_

MonitorElement* SiStripFEDCheckPlugin::nFEDinVsLS_
private

Definition at line 87 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

◆ nFEDinWdataVsLS_

MonitorElement* SiStripFEDCheckPlugin::nFEDinWdataVsLS_
private

Definition at line 88 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

◆ printDebug_

bool SiStripFEDCheckPlugin::printDebug_
private

Definition at line 78 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

◆ rawDataTag_

edm::InputTag SiStripFEDCheckPlugin::rawDataTag_
private

Definition at line 75 of file SiStripFEDDataCheck.cc.

Referenced by SiStripFEDCheckPlugin().

◆ rawDataToken_

edm::EDGetTokenT<FEDRawDataCollection> SiStripFEDCheckPlugin::rawDataToken_
private

Definition at line 76 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

◆ siStripFedIdMax_

unsigned int SiStripFEDCheckPlugin::siStripFedIdMax_
private

◆ siStripFedIdMin_

unsigned int SiStripFEDCheckPlugin::siStripFedIdMin_
private

◆ tTopoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripFEDCheckPlugin::tTopoToken_
private

Definition at line 107 of file SiStripFEDDataCheck.cc.

Referenced by analyze().

◆ updateFrequency_

unsigned int SiStripFEDCheckPlugin::updateFrequency_
private

◆ verbose_

bool SiStripFEDCheckPlugin::verbose_
private

Definition at line 100 of file SiStripFEDDataCheck.cc.

Referenced by analyze().