CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/DQM/SiStripMonitorHardware/plugins/SiStripFEDMonitor.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    DQM/SiStripMonitorHardware
00004 // Class:      SiStripFEDMonitorPlugin
00005 // 
00010 //
00011 // Original Author:  Nicholas Cripps
00012 //         Created:  2008/09/16
00013 // $Id: SiStripFEDMonitor.cc,v 1.44 2012/06/27 16:33:59 threus Exp $
00014 //
00015 //Modified        :  Anne-Marie Magnan
00016 //   ---- 2009/04/21 : histogram management put in separate class
00017 //                     struct helper to simplify arguments of functions
00018 //   ---- 2009/04/22 : add TkHistoMap with % of bad channels per module
00019 //   ---- 2009/04/27 : create FEDErrors class 
00020 
00021 #include <sstream>
00022 #include <memory>
00023 #include <list>
00024 #include <algorithm>
00025 #include <cassert>
00026 
00027 #include "FWCore/Framework/interface/Frameworkfwd.h"
00028 #include "FWCore/Framework/interface/EDAnalyzer.h"
00029 #include "FWCore/Framework/interface/Event.h"
00030 #include "FWCore/Framework/interface/EventSetup.h"
00031 #include "FWCore/Framework/interface/ESHandle.h"
00032 #include "FWCore/Framework/interface/LuminosityBlock.h"
00033 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00034 #include "FWCore/Utilities/interface/InputTag.h"
00035 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00036 #include "FWCore/ServiceRegistry/interface/Service.h"
00037 #include "FWCore/Utilities/interface/Exception.h"
00038 
00039 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
00040 #include "DataFormats/FEDRawData/interface/FEDRawData.h"
00041 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
00042 #include "DataFormats/SiStripCommon/interface/SiStripFedKey.h"
00043 
00044 #include "CondFormats/DataRecord/interface/SiStripFedCablingRcd.h"
00045 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
00046 
00047 #include "DQMServices/Core/interface/DQMStore.h"
00048 
00049 #include "DQM/SiStripMonitorHardware/interface/FEDHistograms.hh"
00050 #include "DQM/SiStripMonitorHardware/interface/FEDErrors.hh"
00051 
00052 #include "DPGAnalysis/SiStripTools/interface/EventWithHistory.h"
00053 
00054 
00055 //
00056 // Class declaration
00057 //
00058 
00059 class SiStripFEDMonitorPlugin : public edm::EDAnalyzer
00060 {
00061  public:
00062   explicit SiStripFEDMonitorPlugin(const edm::ParameterSet&);
00063   ~SiStripFEDMonitorPlugin();
00064  private:
00065   virtual void beginJob();
00066   virtual void analyze(const edm::Event&, const edm::EventSetup&);
00067   virtual void endJob();
00068   virtual void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, 
00069                                     const edm::EventSetup& context);
00070   virtual void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, 
00071                                   const edm::EventSetup& context);
00072 
00073   //update the cabling if necessary
00074   void updateCabling(const edm::EventSetup& eventSetup);
00075 
00076   static bool pairComparison(const std::pair<unsigned int, unsigned int> & pair1,
00077                              const std::pair<unsigned int, unsigned int> & pair2);
00078 
00079   void getMajority(const std::vector<std::pair<unsigned int,unsigned int> > & aFeMajVec,
00080                    unsigned int & aMajorityCounter,
00081                    std::vector<unsigned int> & afedIds);
00082 
00083   //tag of FEDRawData collection
00084   edm::InputTag rawDataTag_;
00085   //histogram helper class
00086   FEDHistograms fedHists_;
00087   //folder name for histograms in DQMStore
00088   std::string folderName_;
00089   //book detailed histograms even if they will be empty (for merging)
00090   bool fillAllDetailedHistograms_;
00091   //do histos vs time with time=event number. Default time = orbit number (s)
00092   bool fillWithEvtNum_;
00093   //print debug messages when problems are found: 1=error debug, 2=light debug, 3=full debug
00094   unsigned int printDebug_;
00095   //bool printDebug_;
00096   //write the DQMStore to a root file at the end of the job
00097   bool writeDQMStore_;
00098   std::string dqmStoreFileName_;
00099   //the DQMStore
00100   DQMStore* dqm_;
00101   //FED cabling
00102   uint32_t cablingCacheId_;
00103   const SiStripFedCabling* cabling_;
00104 
00105   //add parameter to save computing time if TkHistoMap/Median/FeMajCheck are not enabled
00106   bool doTkHistoMap_;
00107   bool doMedHists_;
00108   bool doFEMajorityCheck_;
00109 
00110   unsigned int nEvt_;
00111 
00112   //FED errors
00113   //need class member for lumi histograms
00114   FEDErrors fedErrors_;
00115   unsigned int maxFedBufferSize_;
00116 };
00117 
00118 
00119 //
00120 // Constructors and destructor
00121 //
00122 
00123 SiStripFEDMonitorPlugin::SiStripFEDMonitorPlugin(const edm::ParameterSet& iConfig)
00124   : rawDataTag_(iConfig.getUntrackedParameter<edm::InputTag>("RawDataTag",edm::InputTag("source",""))),
00125     folderName_(iConfig.getUntrackedParameter<std::string>("HistogramFolderName","SiStrip/ReadoutView/FedSummary")),
00126     fillAllDetailedHistograms_(iConfig.getUntrackedParameter<bool>("FillAllDetailedHistograms",false)),
00127     fillWithEvtNum_(iConfig.getUntrackedParameter<bool>("FillWithEventNumber",false)),
00128     printDebug_(iConfig.getUntrackedParameter<unsigned int>("PrintDebugMessages",1)),
00129     //printDebug_(iConfig.getUntrackedParameter<bool>("PrintDebugMessages",false)),
00130     writeDQMStore_(iConfig.getUntrackedParameter<bool>("WriteDQMStore",false)),
00131     dqmStoreFileName_(iConfig.getUntrackedParameter<std::string>("DQMStoreFileName","DQMStore.root")),
00132     dqm_(0),
00133     cablingCacheId_(0),
00134     maxFedBufferSize_(0)
00135 {
00136   //print config to debug log
00137   std::ostringstream debugStream;
00138   if (printDebug_>1) {
00139     debugStream << "[SiStripFEDMonitorPlugin]Configuration for SiStripFEDMonitorPlugin: " << std::endl
00140                 << "[SiStripFEDMonitorPlugin]\tRawDataTag: " << rawDataTag_ << std::endl
00141                 << "[SiStripFEDMonitorPlugin]\tHistogramFolderName: " << folderName_ << std::endl
00142                 << "[SiStripFEDMonitorPlugin]\tFillAllDetailedHistograms? " << (fillAllDetailedHistograms_ ? "yes" : "no") << std::endl
00143                 << "[SiStripFEDMonitorPlugin]\tFillWithEventNumber?" << (fillWithEvtNum_ ? "yes" : "no") << std::endl
00144                 << "[SiStripFEDMonitorPlugin]\tPrintDebugMessages? " << (printDebug_ ? "yes" : "no") << std::endl
00145                 << "[SiStripFEDMonitorPlugin]\tWriteDQMStore? " << (writeDQMStore_ ? "yes" : "no") << std::endl;
00146     if (writeDQMStore_) debugStream << "[SiStripFEDMonitorPlugin]\tDQMStoreFileName: " << dqmStoreFileName_ << std::endl;
00147   }
00148   
00149   //don;t generate debug mesages if debug is disabled
00150   std::ostringstream* pDebugStream = (printDebug_>1 ? &debugStream : NULL);
00151   
00152   fedHists_.initialise(iConfig,pDebugStream);
00153 
00154   doTkHistoMap_ = fedHists_.tkHistoMapEnabled();
00155 
00156   doMedHists_ = fedHists_.cmHistosEnabled();
00157 
00158   doFEMajorityCheck_ = fedHists_.feMajHistosEnabled();
00159 
00160   if (printDebug_) {
00161     LogTrace("SiStripMonitorHardware") << debugStream.str();
00162 
00163     //debugStream.str("");
00164 
00165     //debugStream << " -- Quelle est la difference entre un canard ? " << std::endl 
00166     //  << " -- Reponse: c'est qu'il a les deux pattes de la meme longueur, surtout la gauche." << std::endl;
00167 
00168     //edm::LogError("SiStripMonitorHardware") << debugStream.str();
00169   }
00170 
00171   nEvt_ = 0;
00172 
00173 }
00174 
00175 SiStripFEDMonitorPlugin::~SiStripFEDMonitorPlugin()
00176 {
00177 }
00178 
00179 
00180 //
00181 // Member functions
00182 //
00183 
00184 // ------------ method called to for each event  ------------
00185 void
00186 SiStripFEDMonitorPlugin::analyze(const edm::Event& iEvent, 
00187                                  const edm::EventSetup& iSetup)
00188 {
00189   //update cabling
00190   updateCabling(iSetup);
00191   
00192   //get raw data
00193   edm::Handle<FEDRawDataCollection> rawDataCollectionHandle;
00194   iEvent.getByLabel(rawDataTag_,rawDataCollectionHandle);
00195   const FEDRawDataCollection& rawDataCollection = *rawDataCollectionHandle;
00196   
00197   fedErrors_.initialiseEvent();
00198 
00199   //add the deltaBX value if the product exist
00200 
00201   edm::Handle<EventWithHistory> he;
00202   iEvent.getByLabel("consecutiveHEs",he);
00203 
00204   if(he.isValid() && !he.failedToGet()) {
00205     fedErrors_.fillEventProperties(he->deltaBX());
00206   }
00207 
00208   //initialise map of fedId/bad channel number
00209   std::map<unsigned int,std::pair<unsigned short,unsigned short> > badChannelFraction;
00210 
00211   unsigned int lNFEDMonitoring = 0;
00212   unsigned int lNFEDUnpacker = 0;
00213   unsigned int lNChannelMonitoring = 0;
00214   unsigned int lNChannelUnpacker = 0;
00215 
00216   unsigned int lNTotBadFeds = 0;
00217   unsigned int lNTotBadChannels = 0;
00218   unsigned int lNTotBadActiveChannels = 0;
00219 
00220   std::vector<std::vector<std::pair<unsigned int,unsigned int> > > lFeMajFrac;
00221   const unsigned int nParts = 4;
00222   if (doFEMajorityCheck_){
00223     lFeMajFrac.resize(nParts);
00224     //max nFE per partition
00225     lFeMajFrac[0].reserve(912);
00226     lFeMajFrac[1].reserve(1080);
00227     lFeMajFrac[2].reserve(768);
00228     lFeMajFrac[3].reserve(760);
00229   }
00230 
00231   maxFedBufferSize_ = 0;
00232 
00233   //loop over siStrip FED IDs
00234   for (unsigned int fedId = FEDNumbering::MINSiStripFEDID; 
00235        fedId <= FEDNumbering::MAXSiStripFEDID; 
00236        fedId++) {//loop over FED IDs
00237     const FEDRawData& fedData = rawDataCollection.FEDData(fedId);
00238 
00239     //create an object to fill all errors
00240     fedErrors_.initialiseFED(fedId,cabling_);
00241     bool lFullDebug = false;
00242  
00243     //Do detailed check
00244     //first check if data exists
00245     bool lDataExist = fedErrors_.checkDataPresent(fedData);
00246     if (!lDataExist) {
00247       fedHists_.fillFEDHistograms(fedErrors_,0,lFullDebug);
00248       continue;
00249     }
00250 
00251 
00252  
00253     //check for problems and fill detailed histograms
00254     fedErrors_.fillFEDErrors(fedData,
00255                              lFullDebug,
00256                              printDebug_,
00257                              lNChannelMonitoring,
00258                              lNChannelUnpacker,
00259                              doMedHists_,
00260                              fedHists_.cmHistPointer(false),
00261                              fedHists_.cmHistPointer(true),
00262                              doFEMajorityCheck_,
00263                              lFeMajFrac
00264                              );
00265 
00266     //check filled in previous method.
00267     bool lFailUnpackerFEDcheck = fedErrors_.failUnpackerFEDCheck();
00268 
00269     fedErrors_.incrementFEDCounters();
00270     unsigned int lSize = fedData.size();
00271     if (lSize > maxFedBufferSize_){
00272       maxFedBufferSize_ = lSize;
00273     }
00274     //std::cout << " -- " << fedId << " " << lSize << std::endl;
00275 
00276     fedHists_.fillFEDHistograms(fedErrors_,lSize,lFullDebug);
00277 
00278     bool lFailMonitoringFEDcheck = fedErrors_.failMonitoringFEDCheck();
00279     if (lFailMonitoringFEDcheck) lNTotBadFeds++;
00280 
00281 
00282     //sanity check: if something changed in the unpacking code 
00283     //but wasn't propagated here
00284     //print only the summary, and more info if printDebug>1
00285     if (lFailMonitoringFEDcheck != lFailUnpackerFEDcheck) {
00286       if (printDebug_>1) {
00287         std::ostringstream debugStream;
00288         debugStream << " --- WARNING: FED " << fedId << std::endl 
00289                     << " ------ Monitoring FED check " ;
00290         if (lFailMonitoringFEDcheck) debugStream << "failed." << std::endl;
00291         else debugStream << "passed." << std::endl ;
00292         debugStream << " ------ Unpacker FED check " ;
00293         if (lFailUnpackerFEDcheck) debugStream << "failed." << std::endl;
00294         else debugStream << "passed." << std::endl ;
00295         edm::LogError("SiStripMonitorHardware") << debugStream.str();
00296       }
00297 
00298       if (lFailMonitoringFEDcheck) lNFEDMonitoring++;
00299       else if (lFailUnpackerFEDcheck) lNFEDUnpacker++;
00300     }
00301 
00302 
00303     //Fill TkHistoMap:
00304     //add an entry for all channels (good = 0), 
00305     //so that tkHistoMap knows which channels should be there.
00306     if (doTkHistoMap_ && !fedHists_.tkHistoMapPointer()) {
00307       edm::LogWarning("SiStripMonitorHardware") << " -- Fedid " << fedId
00308                                                 << ", TkHistoMap enabled but pointer is null." << std::endl;
00309     }
00310 
00311     fedErrors_.fillBadChannelList(doTkHistoMap_,
00312                                   fedHists_.tkHistoMapPointer(),
00313                                   fedHists_.getFedvsAPVpointer(),
00314                                   lNTotBadChannels,
00315                                   lNTotBadActiveChannels);
00316   }//loop over FED IDs
00317 
00318 
00319   if (doFEMajorityCheck_){
00320     for (unsigned int iP(0); iP<nParts; ++iP){
00321       //std::cout << " -- Partition " << iP << std::endl;
00322       //std::cout << " --- Number of elements in vec = " << lFeMajFrac[iP].size() << std::endl;
00323       if (lFeMajFrac[iP].size()==0) continue;
00324       std::sort(lFeMajFrac[iP].begin(),lFeMajFrac[iP].end(),SiStripFEDMonitorPlugin::pairComparison);
00325 
00326       unsigned int lMajorityCounter = 0;
00327       std::vector<unsigned int> lfedIds;
00328 
00329       getMajority(lFeMajFrac[iP],lMajorityCounter,lfedIds);
00330       //std::cout << " -- Found " << lfedIds.size() << " unique elements not matching the majority." << std::endl;
00331       fedHists_.fillMajorityHistograms(iP,static_cast<float>(lMajorityCounter)/lFeMajFrac[iP].size(),lfedIds);
00332     }
00333   }
00334 
00335   if ((lNTotBadFeds> 0 || lNTotBadChannels>0) && printDebug_>1) {
00336     std::ostringstream debugStream;
00337     debugStream << "[SiStripFEDMonitorPlugin] --- Total number of bad feds = " 
00338                 << lNTotBadFeds << std::endl
00339                 << "[SiStripFEDMonitorPlugin] --- Total number of bad channels = " 
00340                 << lNTotBadChannels << std::endl
00341                 << "[SiStripFEDMonitorPlugin] --- Total number of bad active channels = " 
00342                 << lNTotBadActiveChannels << std::endl;
00343     edm::LogInfo("SiStripMonitorHardware") << debugStream.str();
00344   }
00345 
00346   if ((lNFEDMonitoring > 0 || lNFEDUnpacker > 0 || lNChannelMonitoring > 0 || lNChannelUnpacker > 0) && printDebug_) {
00347     std::ostringstream debugStream;
00348     debugStream
00349       << "[SiStripFEDMonitorPlugin]-------------------------------------------------------------------------" << std::endl 
00350       << "[SiStripFEDMonitorPlugin]-------------------------------------------------------------------------" << std::endl 
00351       << "[SiStripFEDMonitorPlugin]-- Summary of differences between unpacker and monitoring at FED level : " << std::endl 
00352       << "[SiStripFEDMonitorPlugin] ---- Number of times monitoring fails but not unpacking = " << lNFEDMonitoring << std::endl 
00353       << "[SiStripFEDMonitorPlugin] ---- Number of times unpacking fails but not monitoring = " << lNFEDUnpacker << std::endl
00354       << "[SiStripFEDMonitorPlugin]-------------------------------------------------------------------------" << std::endl 
00355       << "[SiStripFEDMonitorPlugin]-- Summary of differences between unpacker and monitoring at Channel level : " << std::endl 
00356       << "[SiStripFEDMonitorPlugin] ---- Number of times monitoring fails but not unpacking = " << lNChannelMonitoring << std::endl 
00357       << "[SiStripFEDMonitorPlugin] ---- Number of times unpacking fails but not monitoring = " << lNChannelUnpacker << std::endl
00358       << "[SiStripFEDMonitorPlugin]-------------------------------------------------------------------------" << std::endl 
00359       << "[SiStripFEDMonitorPlugin]-------------------------------------------------------------------------" << std::endl ;
00360     edm::LogError("SiStripMonitorHardware") << debugStream.str();
00361 
00362   }
00363 
00364   FEDErrors::getFEDErrorsCounters().nTotalBadChannels = lNTotBadChannels;
00365   FEDErrors::getFEDErrorsCounters().nTotalBadActiveChannels = lNTotBadActiveChannels;
00366 
00367   //fedHists_.fillCountersHistograms(FEDErrors::getFEDErrorsCounters(), nEvt_);
00368   //time in seconds since beginning of the run or event number
00369   if (fillWithEvtNum_) fedHists_.fillCountersHistograms(FEDErrors::getFEDErrorsCounters(),FEDErrors::getChannelErrorsCounters(),maxFedBufferSize_,iEvent.id().event());
00370   else fedHists_.fillCountersHistograms(FEDErrors::getFEDErrorsCounters(),FEDErrors::getChannelErrorsCounters(),maxFedBufferSize_,iEvent.orbitNumber()/11223.);
00371 
00372   nEvt_++;
00373 
00374 }//analyze method
00375 
00376 
00377 bool SiStripFEDMonitorPlugin::pairComparison(const std::pair<unsigned int, unsigned int> & pair1,
00378                                              const std::pair<unsigned int, unsigned int> & pair2){
00379   return (pair1.second < pair2.second) ;
00380 }
00381 
00382 void SiStripFEDMonitorPlugin::getMajority(const std::vector<std::pair<unsigned int,unsigned int> > & aFeMajVec,
00383                                           unsigned int & aMajorityCounter,
00384                                           std::vector<unsigned int> & afedIds) {
00385   
00386   
00387   unsigned int lMajAddress = 0;
00388   std::vector<std::pair<unsigned int,unsigned int> >::const_iterator lIter = aFeMajVec.begin();
00389   unsigned int lMajAddr = (*lIter).second;
00390   unsigned int lCounter = 0;
00391   
00392   //std::cout << " --- First element: addr = " << lMajAddr << " counter = " << lCounter << std::endl;
00393   unsigned int iele=0;
00394   //bool foundMaj = false;
00395   for ( ; lIter != aFeMajVec.end(); ++lIter,++iele) {
00396     //std::cout << " ---- Ele " << iele << " " << (*lIter).first << " " << (*lIter).second << " ref " << lMajAddr << std::endl;
00397     if ((*lIter).second == lMajAddr) {
00398       ++lCounter;
00399       //std::cout << " ----- =ref: Counter = " << lCounter << std::endl;
00400     }
00401     else {
00402       //std::cout << " ----- !=ref: Counter = " << lCounter << " Majority = " << aMajorityCounter << std::endl;
00403       if (lCounter > aMajorityCounter) {
00404         //std::cout << " ------ >Majority: " << std::endl;
00405         aMajorityCounter = lCounter;
00406         // AV bug here??
00407         lMajAddress = lMajAddr;
00408         //      lMajAddress = (*lIter).second;
00409         //foundMaj=true;
00410       }
00411       lCounter = 0;
00412       lMajAddr = (*lIter).second;
00413       --lIter;
00414       --iele;
00415     }
00416   }
00417   // AV Bug here? The check has to be done regardless foundMaj == false or true 
00418   //  if (!foundMaj) {
00419     if (lCounter > aMajorityCounter) {
00420       //std::cout << " ------ >Majority: " << std::endl;
00421       aMajorityCounter = lCounter;
00422       lMajAddress = lMajAddr;
00423     }
00424     //  }
00425   //std::cout << " -- found majority value for " << aMajorityCounter << " elements out of " << aFeMajVec.size() << "." << std::endl;
00426   //get list of feds with address different from majority in partition:      
00427   lIter = aFeMajVec.begin();
00428   afedIds.reserve(135);
00429   for ( ; lIter != aFeMajVec.end(); ++lIter ) {
00430     if((*lIter).second != lMajAddress) {
00431       afedIds.push_back((*lIter).first);
00432     }
00433     else {
00434       lIter += aMajorityCounter-1;
00435       if(lIter >= aFeMajVec.end()) {
00436         std::cout << "Here it is a bug: " << aMajorityCounter << " " << aFeMajVec.size() << " " << lIter - aFeMajVec.end() << std::endl;
00437       }
00438     }
00439   }
00440   //std::cout << " -- Found " << lfedIds.size() << " elements not matching the majority." << std::endl;
00441   if (afedIds.size()>0) {
00442     std::sort(afedIds.begin(),afedIds.end());
00443     std::vector<unsigned int>::iterator lIt = std::unique(afedIds.begin(),afedIds.end());
00444     afedIds.erase(lIt,afedIds.end());
00445   }
00446 
00447 }
00448 
00449 // ------------ method called once each job just before starting event loop  ------------
00450 void 
00451 SiStripFEDMonitorPlugin::beginJob()
00452 {
00453   //get DQM store
00454   dqm_ = &(*edm::Service<DQMStore>());
00455   dqm_->setCurrentFolder(folderName_);
00456   
00457   //this propagates dqm_ to the histoclass, must be called !
00458   fedHists_.bookTopLevelHistograms(dqm_);
00459   
00460   if (fillAllDetailedHistograms_) fedHists_.bookAllFEDHistograms();
00461 
00462   nEvt_ = 0;
00463 
00464   //const unsigned int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
00465   //const unsigned int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
00466 
00467   //mark all channels as inactive until they have been 'locked' at least once
00468   //   activeChannels_.resize(siStripFedIdMax+1);
00469   //   for (unsigned int fedId = siStripFedIdMin; 
00470   //        fedId <= siStripFedIdMax; 
00471   //        fedId++) {
00472   //     activeChannels_[fedId].resize(sistrip::FEDCH_PER_FED,false);
00473   //   }
00474   
00475 
00476 
00477 
00478 }
00479 
00480 // ------------ method called once each job just after ending the event loop  ------------
00481 void 
00482 SiStripFEDMonitorPlugin::endJob()
00483 {
00484   if (writeDQMStore_) dqm_->save(dqmStoreFileName_);
00485 }
00486 
00487 
00488 
00489 void 
00490 SiStripFEDMonitorPlugin::beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg, 
00491                                               const edm::EventSetup& context)
00492 {
00493 
00494   fedErrors_.initialiseLumiBlock();
00495 
00496 }
00497 
00498 
00499 void 
00500 SiStripFEDMonitorPlugin::endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, 
00501                                             const edm::EventSetup& context)
00502 {
00503   fedHists_.fillLumiHistograms(fedErrors_.getLumiErrors());
00504 }
00505 
00506 
00507 
00508 
00509 void SiStripFEDMonitorPlugin::updateCabling(const edm::EventSetup& eventSetup)
00510 {
00511   uint32_t currentCacheId = eventSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
00512   if (cablingCacheId_ != currentCacheId) {
00513     edm::ESHandle<SiStripFedCabling> cablingHandle;
00514     eventSetup.get<SiStripFedCablingRcd>().get(cablingHandle);
00515     cabling_ = cablingHandle.product();
00516     cablingCacheId_ = currentCacheId;
00517   }
00518 }
00519 
00520 
00521 //
00522 // Define as a plug-in
00523 //
00524 
00525 #include "FWCore/Framework/interface/MakerMacros.h"
00526 DEFINE_FWK_MODULE(SiStripFEDMonitorPlugin);