CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
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)
 
 ~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,
SiStripFedCablingRcd
fedCablingToken_
 
edm::ESWatcher
< SiStripFedCablingRcd
fedCablingWatcher_
 
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
< FEDRawDataCollection
rawDataToken_
 
unsigned int siStripFedIdMax_
 
unsigned int siStripFedIdMin_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken_
 
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
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< B > consumes (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 () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
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 53 of file SiStripFEDDataCheck.cc.

Constructor & Destructor Documentation

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

Definition at line 120 of file SiStripFEDDataCheck.cc.

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

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

Definition at line 170 of file SiStripFEDDataCheck.cc.

170 {}

Member Function Documentation

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

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 177 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::Event::getByToken(), edm::EventSetup::getData(), edm::EventBase::id(), edm::EventID::luminosityBlock(), eostools::move(), nFEDinVsLS_, nFEDinWdataVsLS_, sistrip::preconstructCheckFEDBuffer(), printDebug_, rawDataToken_, siStripFedIdMax_, siStripFedIdMin_, FEDRawData::size(), contentValuesCheck::ss, sistrip::SUCCESS, tTopoToken_, and verbose_.

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

Implements DQMOneEDAnalyzer<>.

Definition at line 309 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(), nFEDinVsLS_, nFEDinWdataVsLS_, dqm::impl::MonitorElement::setAxisTitle(), dqm::implementation::NavigatorBase::setCurrentFolder(), siStripFedIdMax_, and siStripFedIdMin_.

311  {
312  size_t nFED = siStripFedIdMax_ - siStripFedIdMin_ + 1;
313  double xFEDmin = siStripFedIdMin_ - 0.5;
314  double xFEDmax = siStripFedIdMax_ + 0.5;
315 
316  //get DQM store
317  ibooker.setCurrentFolder(dirName_);
318  //book histograms
319  if (doPLOTfedsPresent_) {
320  fedsPresent_ =
321  ibooker.book1D("FEDEntries", "Number of times FED buffer is present in data", nFED, xFEDmin, xFEDmax);
322  fedsPresent_->setAxisTitle("FED-ID", 1);
323  }
324 
325  if (doPLOTfedFatalErrors_) {
326  fedFatalErrors_ = ibooker.book1D("FEDFatal", "Number of fatal errors in FED buffer", nFED, xFEDmin, xFEDmax);
327  fedFatalErrors_->setAxisTitle("FED-ID", 1);
328  }
329 
332  ibooker.book1D("FEDNonFatal", "Number of non fatal errors in FED buffer", nFED, xFEDmin, xFEDmax);
333  fedNonFatalErrors_->setAxisTitle("FED-ID", 1);
334  }
335 
336  int LSBin = conf_.getParameter<int>("LSBin");
337  double LSMin = conf_.getParameter<double>("LSMin");
338  double LSMax = conf_.getParameter<double>("LSMax");
339 
340  if (doPLOTnFEDinVsLS_) {
341  nFEDinVsLS_ =
342  ibooker.bookProfile("nFEDinVsLS", "number of FED in Vs LS", LSBin, LSMin, LSMax, nFED, xFEDmin, xFEDmax);
343  nFEDinVsLS_->setAxisTitle("LS", 1);
344  nFEDinVsLS_->setAxisTitle("FED-ID", 2);
345  }
346 
348  nFEDinWdataVsLS_ = ibooker.bookProfile(
349  "nFEDinWdataVsLS", "number of FED in (with data) Vs LS", LSBin, LSMin, LSMax, nFED, xFEDmin, xFEDmax);
350  nFEDinWdataVsLS_->setAxisTitle("LS", 1);
351  nFEDinWdataVsLS_->setAxisTitle("FED-ID", 2);
352  }
353 }
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:322
MonitorElement * nFEDinVsLS_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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)
void SiStripFEDCheckPlugin::doUpdateIfNeeded ( )
private

Definition at line 394 of file SiStripFEDDataCheck.cc.

References eventCount_, updateFrequency_, and updateHistograms().

Referenced by analyze().

394  {
395  eventCount_++;
398  }
399 }
void SiStripFEDCheckPlugin::dqmEndRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from DQMOneEDAnalyzer<>.

Definition at line 356 of file SiStripFEDDataCheck.cc.

References updateHistograms().

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

Definition at line 429 of file SiStripFEDDataCheck.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 371 of file SiStripFEDDataCheck.cc.

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

Referenced by analyze().

371  {
372  if (updateFrequency_) {
373  if (fatalError)
375  } else {
376  //fedFatalErrors_->Fill( fatalError ? 1 : 0 );
377  if (fatalError)
380  }
381 }
void Fill(long long x)
std::vector< unsigned int > fedFatalErrorBinContents_
MonitorElement * fedFatalErrors_
void SiStripFEDCheckPlugin::fillNonFatalError ( unsigned int  fedId,
float  nonFatalError 
)
inlineprivate

Definition at line 383 of file SiStripFEDDataCheck.cc.

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

Referenced by analyze().

383  {
384  if (updateFrequency_) {
385  if (nonFatalError > 0)
386  fedNonFatalErrorBinContents_[fedId]++; //nonFatalError;
387  } else {
388  if (nonFatalError > 0)
391  }
392 }
MonitorElement * fedNonFatalErrors_
void Fill(long long x)
std::vector< unsigned int > fedNonFatalErrorBinContents_
void SiStripFEDCheckPlugin::fillPresent ( unsigned int  fedId,
bool  present 
)
inlineprivate
bool SiStripFEDCheckPlugin::hasFatalError ( const FEDRawData fedData,
unsigned int  fedId 
) const
private
bool SiStripFEDCheckPlugin::hasNonFatalError ( const FEDRawData fedData,
unsigned int  fedId 
) const
private
void SiStripFEDCheckPlugin::updateCabling ( const SiStripFedCablingRcd cablingRcd)
private

Definition at line 358 of file SiStripFEDDataCheck.cc.

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

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

Definition at line 401 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().

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

Member Data Documentation

const SiStripFedCabling* SiStripFEDCheckPlugin::cabling_
private

Definition at line 104 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and updateCabling().

bool SiStripFEDCheckPlugin::checkChannelLengths_
private

Definition at line 101 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

bool SiStripFEDCheckPlugin::checkChannelStatusBits_
private

Definition at line 101 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

bool SiStripFEDCheckPlugin::checkFELengths_
private

Definition at line 101 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

bool SiStripFEDCheckPlugin::checkPacketCodes_
private

Definition at line 101 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

edm::ParameterSet SiStripFEDCheckPlugin::conf_
private

Definition at line 113 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms(), and SiStripFEDCheckPlugin().

std::string SiStripFEDCheckPlugin::dirName_
private

Definition at line 78 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms().

bool SiStripFEDCheckPlugin::doPayloadChecks_
private

Definition at line 101 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

bool SiStripFEDCheckPlugin::doPLOTfedFatalErrors_
private

Definition at line 82 of file SiStripFEDDataCheck.cc.

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

bool SiStripFEDCheckPlugin::doPLOTfedNonFatalErrors_
private

Definition at line 82 of file SiStripFEDDataCheck.cc.

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

bool SiStripFEDCheckPlugin::doPLOTfedsPresent_
private

Definition at line 82 of file SiStripFEDDataCheck.cc.

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

bool SiStripFEDCheckPlugin::doPLOTnFEDinVsLS_
private

Definition at line 83 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

bool SiStripFEDCheckPlugin::doPLOTnFEDinWdataVsLS_
private

Definition at line 83 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

unsigned int SiStripFEDCheckPlugin::eventCount_
private

Definition at line 98 of file SiStripFEDDataCheck.cc.

Referenced by doUpdateIfNeeded().

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

Definition at line 107 of file SiStripFEDDataCheck.cc.

Referenced by updateCabling().

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

Definition at line 106 of file SiStripFEDDataCheck.cc.

Referenced by analyze().

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

Definition at line 96 of file SiStripFEDDataCheck.cc.

Referenced by fillFatalError(), and updateHistograms().

MonitorElement* SiStripFEDCheckPlugin::fedFatalErrors_
private

Definition at line 85 of file SiStripFEDDataCheck.cc.

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

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

Definition at line 97 of file SiStripFEDDataCheck.cc.

Referenced by fillNonFatalError(), and updateHistograms().

MonitorElement* SiStripFEDCheckPlugin::fedNonFatalErrors_
private

Definition at line 86 of file SiStripFEDDataCheck.cc.

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

MonitorElement* SiStripFEDCheckPlugin::fedsPresent_
private

Definition at line 84 of file SiStripFEDDataCheck.cc.

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

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

Definition at line 95 of file SiStripFEDDataCheck.cc.

Referenced by fillPresent(), and updateHistograms().

MonitorElement* SiStripFEDCheckPlugin::nFEDinVsLS_
private

Definition at line 88 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiStripFEDCheckPlugin::nFEDinWdataVsLS_
private

Definition at line 89 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

bool SiStripFEDCheckPlugin::printDebug_
private

Definition at line 79 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

edm::InputTag SiStripFEDCheckPlugin::rawDataTag_
private

Definition at line 76 of file SiStripFEDDataCheck.cc.

Referenced by SiStripFEDCheckPlugin().

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

Definition at line 77 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

unsigned int SiStripFEDCheckPlugin::siStripFedIdMax_
private
unsigned int SiStripFEDCheckPlugin::siStripFedIdMin_
private
edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripFEDCheckPlugin::tTopoToken_
private

Definition at line 108 of file SiStripFEDDataCheck.cc.

Referenced by analyze().

unsigned int SiStripFEDCheckPlugin::updateFrequency_
private
bool SiStripFEDCheckPlugin::verbose_
private

Definition at line 101 of file SiStripFEDDataCheck.cc.

Referenced by analyze().