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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 SiStripFEDCheckPlugin (const edm::ParameterSet &)
 
 ~SiStripFEDCheckPlugin ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, 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 updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void doUpdateIfNeeded ()
 
virtual void endRun (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 edm::EventSetup &eventSetup)
 
void updateHistograms ()
 

Private Attributes

const SiStripFedCablingcabling_
 
uint32_t cablingCacheId_
 
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_
 
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_
 
unsigned int updateFrequency_
 
bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

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

Definition at line 54 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_, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, printDebug_, rawDataTag_, rawDataToken_, siStripFedIdMax_, and siStripFedIdMin_.

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_ (NULL)
132  , nFEDinVsLS_ (NULL)
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))
145  , cablingCacheId_(0)
146 {
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 will be skipped: ";
151  if (checkChannelLengths_) ss << "Channel length check, ";
152  if (checkPacketCodes_) ss << "Channel packet code check, ";
153  if (checkChannelStatusBits_) ss << "Cabled channel status bits checks, ";
154  if (checkFELengths_) ss << "FE Unit legnth check";
155  edm::LogWarning("SiStripFEDCheck") << ss.str();
156  }
157 
160 
161  conf_ = iConfig;
162 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * nFEDinWdataVsLS_
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
#define NULL
Definition: scimark2.h:8
MonitorElement * fedNonFatalErrors_
std::vector< unsigned int > fedFatalErrorBinContents_
std::vector< unsigned int > fedsPresentBinContents_
MonitorElement * nFEDinVsLS_
MonitorElement * fedFatalErrors_
MonitorElement * fedsPresent_
std::vector< unsigned int > fedNonFatalErrorBinContents_
SiStripFEDCheckPlugin::~SiStripFEDCheckPlugin ( )

Definition at line 164 of file SiStripFEDDataCheck.cc.

165 {
166 }

Member Function Documentation

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

Definition at line 175 of file SiStripFEDDataCheck.cc.

References cabling_, checkChannelLengths_, checkChannelStatusBits_, checkFELengths_, checkPacketCodes_, gather_cfg::cout, FEDRawData::data(), doPayloadChecks_, doPLOTnFEDinVsLS_, doPLOTnFEDinWdataVsLS_, doUpdateIfNeeded(), FEDRawDataCollection::FEDData(), HcalObjRepresent::Fill(), fillFatalError(), fillNonFatalError(), fillPresent(), edm::EventSetup::get(), edm::Event::getByToken(), edm::EventBase::id(), edm::EventID::luminosityBlock(), nFEDinVsLS_, nFEDinWdataVsLS_, printDebug_, edm::ESHandle< T >::product(), rawDataToken_, siStripFedIdMax_, siStripFedIdMin_, FEDRawData::size(), updateCabling(), and verbose_.

176 {
177  //Retrieve tracker topology from geometry
178  edm::ESHandle<TrackerTopology> tTopoHandle;
179  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
180  const TrackerTopology* const tTopo = tTopoHandle.product();
181 
182  //update cabling
183  updateCabling(iSetup);
184 
185  //get raw data
186  edm::Handle<FEDRawDataCollection> rawDataCollectionHandle;
187  const bool gotData = iEvent.getByToken(rawDataToken_,rawDataCollectionHandle);
188  if (verbose_) std::cout << "[SiStripFEDCheckPlugin::analyze] gotData ? " << (gotData ? "YES" : "NOPE") << std::endl;
189  if (!gotData) {
190  //module is required to silently do nothing when data is not present
191  return;
192  }
193  const FEDRawDataCollection& rawDataCollection = *rawDataCollectionHandle;
194 
195  //FED errors
196  FEDErrors lFedErrors;
197 
198  //loop over siStrip FED IDs
199  size_t nFEDin = 0;
200  size_t nFEDinWdata = 0;
201  for (unsigned int fedId = siStripFedIdMin_; fedId <= siStripFedIdMax_; fedId++) {
202  const FEDRawData& fedData = rawDataCollection.FEDData(fedId);
203 
204  //create an object to fill all errors
205  //third param to false:save time by not initialising anything not used here
206  lFedErrors.initialiseFED(fedId,cabling_,tTopo,false);
207 
208  //check data exists
209  if (!fedData.size() || !fedData.data()) {
210  fillPresent(fedId,0);
211  continue;
212  }
213  if (verbose_) std::cout << "FED " << fedId;
214  if (verbose_) std::cout << " fedData.size(): " << fedData.size();
215  if (verbose_) std::cout << " fedData.data(): " << fedData.data() << std::endl;
216  if (fedData.size()) nFEDin++;
217  if (fedData.size() && fedData.data()) nFEDinWdata++;
218 
219  //fill buffer present histogram
220  fillPresent(fedId,1);
221 
222  //check for fatal errors
223  //no need for debug output
224  bool hasFatalErrors = false;
225  float rateNonFatal = 0;
226 
227  std::auto_ptr<const sistrip::FEDBuffer> buffer;
228 
229  if (!lFedErrors.fillFatalFEDErrors(fedData,0)) {
230  hasFatalErrors = true;
231  }
232  else {
233  //need to construct full object to go any further
235 
236  buffer.reset(new sistrip::FEDBuffer(fedData.data(),fedData.size(),true));
237  if (doPayloadChecks_) {
238 
239  bool channelLengthsOK = checkChannelLengths_ ? buffer->checkChannelLengthsMatchBufferLength() : true;
240  bool channelPacketCodesOK = checkPacketCodes_ ? buffer->checkChannelPacketCodes() : true;
241  bool feLengthsOK = checkFELengths_ ? buffer->checkFEUnitLengths() : true;
242  if ( !channelLengthsOK ||
243  !channelPacketCodesOK ||
244  !feLengthsOK ) {
245  hasFatalErrors = true;
246  }
247  }
248  if (checkChannelStatusBits_) rateNonFatal = lFedErrors.fillNonFatalFEDErrors(buffer.get(),cabling_);
249  }
250  }
251 
252  if (hasFatalErrors) {
253  fillFatalError(fedId,1);
254  if (printDebug_) {
255  if (!buffer.get()) buffer.reset(new sistrip::FEDBuffer(fedData.data(),fedData.size(),true));
256  edm::LogInfo("SiStripFEDCheck") << "Fatal error with FED ID " << fedId << ". Check summary: "
257  << std::endl << buffer->checkSummary() << std::endl;
258  std::stringstream ss;
259  buffer->dump(ss);
260  edm::LogInfo("SiStripFEDCheck") << ss.str();
261  }
262  }
263  else {
264  fillFatalError(fedId,0);
265  //fill non-fatal errors histogram if there were no fatal errors
266  fillNonFatalError(fedId,rateNonFatal);
267  if (printDebug_ && rateNonFatal > 0) {
268  if (!buffer.get()) buffer.reset(new sistrip::FEDBuffer(fedData.data(),fedData.size(),true));
269  edm::LogInfo("SiStripFEDCheck") << "Non-fatal error with FED ID " << fedId
270  << " for " << rateNonFatal << " of the channels. Check summary: "
271  << std::endl << buffer->checkSummary() << std::endl;
272  std::stringstream ss;
273  buffer->dump(ss);
274  edm::LogInfo("SiStripFEDCheck") << ss.str();
275  }
276 
277  }
278  }//loop over FED IDs
279  if (verbose_) std::cout << "nFEDin: " << nFEDin << " nFEDinWdata: " << nFEDinWdata << std::endl;
280  if (doPLOTnFEDinVsLS_) nFEDinVsLS_ -> Fill(static_cast<double>(iEvent.id().luminosityBlock()),nFEDin);
281  if (doPLOTnFEDinWdataVsLS_) nFEDinWdataVsLS_ -> Fill(static_cast<double>(iEvent.id().luminosityBlock()),nFEDinWdata);
282 
283  //update histograms if needed
285 }
MonitorElement * nFEDinWdataVsLS_
void fillFatalError(unsigned int fedId, bool fatalError)
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
const SiStripFedCabling * cabling_
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
const T & get() const
Definition: EventSetup.h:56
MonitorElement * nFEDinVsLS_
edm::EventID id() const
Definition: EventBase.h:58
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
void updateCabling(const edm::EventSetup &eventSetup)
void fillNonFatalError(unsigned int fedId, float nonFatalError)
T const * product() const
Definition: ESHandle.h:86
void fillPresent(unsigned int fedId, bool present)
void SiStripFEDCheckPlugin::bookHistograms ( DQMStore::IBooker ,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 288 of file SiStripFEDDataCheck.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::bookProfile(), conf_, dirName_, doPLOTfedFatalErrors_, doPLOTfedNonFatalErrors_, doPLOTfedsPresent_, doPLOTnFEDinVsLS_, doPLOTnFEDinWdataVsLS_, fedFatalErrors_, fedNonFatalErrors_, fedsPresent_, edm::ParameterSet::getParameter(), nFEDinVsLS_, nFEDinWdataVsLS_, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), siStripFedIdMax_, and siStripFedIdMin_.

289 {
290  size_t nFED = siStripFedIdMax_-siStripFedIdMin_+1;
291  double xFEDmin = siStripFedIdMin_-0.5;
292  double xFEDmax = siStripFedIdMax_+0.5;
293 
294  //get DQM store
295  ibooker.setCurrentFolder(dirName_);
296  //book histograms
297  if (doPLOTfedsPresent_) {
298  fedsPresent_ = ibooker.book1D("FEDEntries",
299  "Number of times FED buffer is present in data",
300  nFED, xFEDmin, xFEDmax);
301  fedsPresent_->setAxisTitle("FED-ID",1);
302  }
303 
304  if (doPLOTfedFatalErrors_) {
305  fedFatalErrors_ = ibooker.book1D("FEDFatal",
306  "Number of fatal errors in FED buffer",
307  nFED, xFEDmin, xFEDmax);
308  fedFatalErrors_->setAxisTitle("FED-ID",1);
309  }
310 
312  fedNonFatalErrors_ = ibooker.book1D("FEDNonFatal",
313  "Number of non fatal errors in FED buffer",
314  nFED, xFEDmin, xFEDmax);
315  fedNonFatalErrors_->setAxisTitle("FED-ID",1);
316  }
317 
318  int LSBin = conf_.getParameter<int> ("LSBin");
319  double LSMin = conf_.getParameter<double>("LSMin");
320  double LSMax = conf_.getParameter<double>("LSMax");
321 
322  if (doPLOTnFEDinVsLS_) {
323  nFEDinVsLS_ = ibooker.bookProfile("nFEDinVsLS",
324  "number of FED in Vs LS",
325  LSBin, LSMin, LSMax,
326  nFED, xFEDmin, xFEDmax);
327  nFEDinVsLS_->setAxisTitle("LS",1);
328  nFEDinVsLS_->setAxisTitle("FED-ID",2);
329  }
330 
332  nFEDinWdataVsLS_ = ibooker.bookProfile("nFEDinWdataVsLS",
333  "number of FED in (with data) Vs LS",
334  LSBin, LSMin, LSMax,
335  nFED, xFEDmin, xFEDmax);
337  nFEDinWdataVsLS_->setAxisTitle("FED-ID",2);
338  }
339 }
T getParameter(std::string const &) const
MonitorElement * nFEDinWdataVsLS_
MonitorElement * fedNonFatalErrors_
MonitorElement * nFEDinVsLS_
MonitorElement * fedFatalErrors_
MonitorElement * fedsPresent_
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 389 of file SiStripFEDDataCheck.cc.

References eventCount_, updateFrequency_, and updateHistograms().

Referenced by analyze().

390 {
391  eventCount_++;
394  }
395 }
void SiStripFEDCheckPlugin::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 343 of file SiStripFEDDataCheck.cc.

References updateHistograms().

344 {
346 }
void SiStripFEDCheckPlugin::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 420 of file SiStripFEDDataCheck.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addDefault(), edm::ParameterSetDescription::addUntracked(), DEFINE_FWK_MODULE, and AlCaHLTBitMon_QueryRunRegistry::string.

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

References doPLOTfedFatalErrors_, fedFatalErrorBinContents_, fedFatalErrors_, MonitorElement::Fill(), and updateFrequency_.

Referenced by analyze().

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

Definition at line 379 of file SiStripFEDDataCheck.cc.

References doPLOTfedNonFatalErrors_, fedNonFatalErrorBinContents_, fedNonFatalErrors_, MonitorElement::Fill(), and updateFrequency_.

Referenced by analyze().

380 {
381  if (updateFrequency_) {
382  if (nonFatalError>0) fedNonFatalErrorBinContents_[fedId]++;//nonFatalError;
383  } else {
384  if (nonFatalError>0)
386  }
387 }
MonitorElement * fedNonFatalErrors_
void Fill(long long x)
std::vector< unsigned int > fedNonFatalErrorBinContents_
void SiStripFEDCheckPlugin::fillPresent ( unsigned int  fedId,
bool  present 
)
inlineprivate

Definition at line 359 of file SiStripFEDDataCheck.cc.

References doPLOTfedsPresent_, fedsPresent_, fedsPresentBinContents_, MonitorElement::Fill(), and updateFrequency_.

Referenced by analyze().

360 {
361  if (present) {
363  else
364  if (doPLOTfedsPresent_) fedsPresent_->Fill(fedId);
365  }
366 }
void Fill(long long x)
std::vector< unsigned int > fedsPresentBinContents_
MonitorElement * fedsPresent_
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 edm::EventSetup eventSetup)
private

Definition at line 348 of file SiStripFEDDataCheck.cc.

References cabling_, cablingCacheId_, edm::EventSetup::get(), and edm::ESHandle< T >::product().

Referenced by analyze().

349 {
350  uint32_t currentCacheId = eventSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
351  if (cablingCacheId_ != currentCacheId) {
352  edm::ESHandle<SiStripFedCabling> cablingHandle;
353  eventSetup.get<SiStripFedCablingRcd>().get(cablingHandle);
354  cabling_ = cablingHandle.product();
355  cablingCacheId_ = currentCacheId;
356  }
357 }
const SiStripFedCabling * cabling_
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
void SiStripFEDCheckPlugin::updateHistograms ( )
private

Definition at line 397 of file SiStripFEDDataCheck.cc.

References stringResolutionProvider_cfi::bin, doPLOTfedFatalErrors_, doPLOTfedNonFatalErrors_, doPLOTfedsPresent_, fedFatalErrorBinContents_, fedFatalErrors_, fedNonFatalErrorBinContents_, fedNonFatalErrors_, fedsPresent_, fedsPresentBinContents_, MonitorElement::getTH1(), siStripFedIdMax_, siStripFedIdMin_, and updateFrequency_.

Referenced by doUpdateIfNeeded(), and endRun().

398 {
399  //if the cache is not being used then do nothing
400  if (!updateFrequency_) return;
401  unsigned int entriesFedsPresent = 0;
402  unsigned int entriesFatalErrors = 0;
403  unsigned int entriesNonFatalErrors = 0;
404  for (unsigned int fedId = siStripFedIdMin_, bin = 1; fedId < siStripFedIdMax_+1; fedId++, bin++) {
405  unsigned int fedsPresentBin = fedsPresentBinContents_[fedId];
406  if (doPLOTfedsPresent_) fedsPresent_->getTH1()->SetBinContent(bin,fedsPresentBin);
407  entriesFedsPresent += fedsPresentBin;
408  unsigned int fedFatalErrorsBin = fedFatalErrorBinContents_[fedId];
409  if (doPLOTfedFatalErrors_) fedFatalErrors_->getTH1()->SetBinContent(bin,fedFatalErrorsBin);
410  entriesFatalErrors += fedFatalErrorsBin;
411  unsigned int fedNonFatalErrorsBin = fedNonFatalErrorBinContents_[fedId];
412  if (doPLOTfedNonFatalErrors_) fedNonFatalErrors_->getTH1()->SetBinContent(bin,fedNonFatalErrorsBin);
413  entriesNonFatalErrors += fedNonFatalErrorsBin;
414  }
415  if (doPLOTfedsPresent_) fedsPresent_->getTH1()->SetEntries(entriesFedsPresent);
416  if (doPLOTfedFatalErrors_) fedFatalErrors_->getTH1()->SetEntries(entriesFatalErrors);
417  if (doPLOTfedNonFatalErrors_) fedNonFatalErrors_->getTH1()->SetEntries(entriesNonFatalErrors);
418 }
MonitorElement * fedNonFatalErrors_
TH1 * getTH1(void) const
bin
set the eta bin as selection string.
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 107 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and updateCabling().

uint32_t SiStripFEDCheckPlugin::cablingCacheId_
private

Definition at line 106 of file SiStripFEDDataCheck.cc.

Referenced by updateCabling().

bool SiStripFEDCheckPlugin::checkChannelLengths_
private

Definition at line 103 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

bool SiStripFEDCheckPlugin::checkChannelStatusBits_
private

Definition at line 103 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

bool SiStripFEDCheckPlugin::checkFELengths_
private

Definition at line 103 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

bool SiStripFEDCheckPlugin::checkPacketCodes_
private

Definition at line 103 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

edm::ParameterSet SiStripFEDCheckPlugin::conf_
private

Definition at line 112 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms(), and SiStripFEDCheckPlugin().

std::string SiStripFEDCheckPlugin::dirName_
private

Definition at line 81 of file SiStripFEDDataCheck.cc.

Referenced by bookHistograms().

bool SiStripFEDCheckPlugin::doPayloadChecks_
private

Definition at line 103 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

bool SiStripFEDCheckPlugin::doPLOTfedFatalErrors_
private

Definition at line 85 of file SiStripFEDDataCheck.cc.

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

bool SiStripFEDCheckPlugin::doPLOTfedNonFatalErrors_
private

Definition at line 85 of file SiStripFEDDataCheck.cc.

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

bool SiStripFEDCheckPlugin::doPLOTfedsPresent_
private

Definition at line 85 of file SiStripFEDDataCheck.cc.

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

bool SiStripFEDCheckPlugin::doPLOTnFEDinVsLS_
private

Definition at line 86 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

bool SiStripFEDCheckPlugin::doPLOTnFEDinWdataVsLS_
private

Definition at line 86 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

unsigned int SiStripFEDCheckPlugin::eventCount_
private

Definition at line 100 of file SiStripFEDDataCheck.cc.

Referenced by doUpdateIfNeeded().

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

Definition at line 98 of file SiStripFEDDataCheck.cc.

Referenced by fillFatalError(), and updateHistograms().

MonitorElement* SiStripFEDCheckPlugin::fedFatalErrors_
private

Definition at line 88 of file SiStripFEDDataCheck.cc.

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

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

Definition at line 99 of file SiStripFEDDataCheck.cc.

Referenced by fillNonFatalError(), and updateHistograms().

MonitorElement* SiStripFEDCheckPlugin::fedNonFatalErrors_
private

Definition at line 89 of file SiStripFEDDataCheck.cc.

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

MonitorElement* SiStripFEDCheckPlugin::fedsPresent_
private

Definition at line 87 of file SiStripFEDDataCheck.cc.

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

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

Definition at line 97 of file SiStripFEDDataCheck.cc.

Referenced by fillPresent(), and updateHistograms().

MonitorElement* SiStripFEDCheckPlugin::nFEDinVsLS_
private

Definition at line 91 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* SiStripFEDCheckPlugin::nFEDinWdataVsLS_
private

Definition at line 92 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and bookHistograms().

bool SiStripFEDCheckPlugin::printDebug_
private

Definition at line 82 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

edm::InputTag SiStripFEDCheckPlugin::rawDataTag_
private

Definition at line 79 of file SiStripFEDDataCheck.cc.

Referenced by SiStripFEDCheckPlugin().

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

Definition at line 80 of file SiStripFEDDataCheck.cc.

Referenced by analyze(), and SiStripFEDCheckPlugin().

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

Definition at line 103 of file SiStripFEDDataCheck.cc.

Referenced by analyze().