CMS 3D CMS Logo

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.4 2008/11/06 19:40:01 nc302 Exp $
00014 //
00015 //
00016 
00017 
00018 #include "FWCore/Framework/interface/Frameworkfwd.h"
00019 #include "FWCore/Framework/interface/EDAnalyzer.h"
00020 #include "FWCore/Framework/interface/Event.h"
00021 #include "FWCore/Framework/interface/EventSetup.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023 #include "FWCore/ParameterSet/interface/InputTag.h"
00024 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00025 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
00026 #include "DataFormats/FEDRawData/interface/FEDRawData.h"
00027 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
00028 #include "FWCore/ServiceRegistry/interface/Service.h"
00029 #include "DQMServices/Core/interface/DQMStore.h"
00030 #include "DQMServices/Core/interface/MonitorElement.h"
00031 #include "EventFilter/SiStripRawToDigi/interface/SiStripFEDBuffer.h"
00032 #include "FWCore/Framework/interface/ESHandle.h"
00033 #include "CondFormats/DataRecord/interface/SiStripFedCablingRcd.h"
00034 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
00035 #include "FWCore/Utilities/interface/Exception.h"
00036 #include "DataFormats/SiStripCommon/interface/SiStripFedKey.h"
00037 #include <sstream>
00038 #include <memory>
00039 #include <list>
00040 #include <algorithm>
00041 
00042 //
00043 // Class decleration
00044 //
00045 
00046 class SiStripFEDMonitorPlugin : public edm::EDAnalyzer
00047 {
00048  public:
00049   explicit SiStripFEDMonitorPlugin(const edm::ParameterSet&);
00050   ~SiStripFEDMonitorPlugin();
00051  private:
00052   virtual void beginJob(const edm::EventSetup&);
00053   virtual void analyze(const edm::Event&, const edm::EventSetup&);
00054   virtual void endJob();
00055   
00056   //update the cabling if necessary
00057   void updateCabling(const edm::EventSetup& eventSetup);
00058   //fill a histogram if the pointer is not NULL (ie if it has been booked)
00059   void fillHistogram(MonitorElement* histogram, double value);
00060   //book the top level histograms
00061   void bookTopLevelHistograms();
00062   //book individual FED histograms or book all FED level histograms at once
00063   void bookFEDHistograms(unsigned int fedId, bool fullDebugMode = false);
00064   void bookAllFEDHistograms();
00065   //return true if there were no errors at the level they are analysing
00066   bool analyzeFED(const FEDRawData& rawData, unsigned int fedId);
00067   bool analyzeFEUnits(const sistrip::FEDBufferBase* buffer, unsigned int fedId);
00068   bool analyzeChannels(const sistrip::FEDBuffer* buffer, unsigned int fedId,
00069                        std::list<unsigned int>* badChannelList,
00070                        std::list<unsigned int>* activeBadChannelList);
00071   
00072   edm::InputTag rawDataTag_;
00073   std::string folderName_;
00074   bool printDebug_;
00075   bool writeDQMStore_;
00076   bool fillAllHistograms_;
00077   bool disableGlobalExpertHistograms_;
00078   bool disableFEDHistograms_;
00079   DQMStore* dqm_;
00080   uint32_t cablingCacheId_;
00081   const SiStripFedCabling* cabling_;
00082   //top level histograms
00083   MonitorElement *anyErrors_, *anyDaqProblems_, *corruptBuffers_, *invalidBuffers_, *badIDs_, *badChannelStatusBits_, *badActiveChannelStatusBits_,
00084                  *badDAQCRCs_, *badFEDCRCs_, *daqProblems_, *feOverflows_, *badMajorityAddresses_;
00085   //FED level histograms
00086   std::map<unsigned int,MonitorElement*> feOverflowDetailed_, badMajorityAddressDetailed_;
00087   std::map<unsigned int,MonitorElement*> badStatusBitsDetailed_, apvErrorDetailed_, apvAddressErrorDetailed_, unlockedDetailed_, outOfSyncDetailed_;
00088   //has individual FED histogram been booked? (index is FedId)
00089   std::vector<bool> histosBooked_, debugHistosBooked_;
00090   std::vector< std::vector<bool> > activeChannels_;
00091 };
00092 
00093 
00094 //
00095 // Constructors and destructor
00096 //
00097 
00098 SiStripFEDMonitorPlugin::SiStripFEDMonitorPlugin(const edm::ParameterSet& iConfig)
00099   : rawDataTag_(iConfig.getUntrackedParameter<edm::InputTag>("RawDataTag",edm::InputTag("source",""))),
00100     folderName_(iConfig.getUntrackedParameter<std::string>("FolderName","SiStrip/ReadoutView/FedMonitoringSummary")),
00101     printDebug_(iConfig.getUntrackedParameter<bool>("PrintDebugMessages",false)),
00102     writeDQMStore_(iConfig.getUntrackedParameter<bool>("WriteDQMStore",false)),
00103     fillAllHistograms_(iConfig.getUntrackedParameter<bool>("FillAllHistograms",true)),
00104     disableGlobalExpertHistograms_(iConfig.getUntrackedParameter<bool>("DisableGlobalExpertHistograms",true)),
00105     disableFEDHistograms_(iConfig.getUntrackedParameter<bool>("DisableFEDHistograms",true)),
00106     cablingCacheId_(0)
00107 {
00108 }
00109 
00110 SiStripFEDMonitorPlugin::~SiStripFEDMonitorPlugin()
00111 {
00112 }
00113 
00114 
00115 //
00116 // Member functions
00117 //
00118 
00119 // ------------ method called to for each event  ------------
00120 void
00121 SiStripFEDMonitorPlugin::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00122 {
00123   //update cabling
00124   updateCabling(iSetup);
00125   
00126   //get raw data
00127   edm::Handle<FEDRawDataCollection> rawDataCollectionHandle;
00128   iEvent.getByLabel(rawDataTag_,rawDataCollectionHandle);
00129   const FEDRawDataCollection& rawDataCollection = *rawDataCollectionHandle;
00130   
00131   //get FED IDs
00132   const FEDNumbering numbering;
00133   const unsigned int siStripFedIdMin = numbering.getSiStripFEDIds().first;
00134   const unsigned int siStripFedIdMax = numbering.getSiStripFEDIds().second;
00135   
00136   //loop over siStrip FED IDs
00137   for (unsigned int fedId = siStripFedIdMin; fedId <= siStripFedIdMax; fedId++) {
00138     const FEDRawData& fedData = rawDataCollection.FEDData(fedId);
00139     //check data exists
00140     if (!fedData.size() || !fedData.data()) continue;
00141     bool anyErrors = !analyzeFED(fedData,fedId);
00142     if (anyErrors) fillHistogram(anyErrors_,fedId);
00143   }//loop over FED IDs
00144 }
00145 
00146 // ------------ method called once each job just before starting event loop  ------------
00147 void 
00148 SiStripFEDMonitorPlugin::beginJob(const edm::EventSetup&)
00149 {
00150   //get DQM store
00151   dqm_ = &(*edm::Service<DQMStore>());
00152   dqm_->setCurrentFolder(folderName_);
00153   
00154   bookTopLevelHistograms();
00155   
00156   const FEDNumbering numbering;
00157   const unsigned int siStripFedIdMin = numbering.getSiStripFEDIds().first;
00158   const unsigned int siStripFedIdMax = numbering.getSiStripFEDIds().second;
00159   //book FED level histograms
00160   histosBooked_.resize(siStripFedIdMax+1,false);
00161   debugHistosBooked_.resize(siStripFedIdMax+1,false);
00162   if (fillAllHistograms_) bookAllFEDHistograms();
00163   //mark all channels as inactive until they have been 'locked' at least once
00164   activeChannels_.resize(siStripFedIdMax+1);
00165   for (unsigned int fedId = siStripFedIdMin; fedId <= siStripFedIdMax; fedId++) {
00166     activeChannels_[fedId].resize(sistrip::FEDCH_PER_FED,false);
00167   }
00168 }
00169 
00170 // ------------ method called once each job just after ending the event loop  ------------
00171 void 
00172 SiStripFEDMonitorPlugin::endJob()
00173 {
00174   if (writeDQMStore_) dqm_->save("DQMStore.root");
00175 }
00176 
00177 void SiStripFEDMonitorPlugin::updateCabling(const edm::EventSetup& eventSetup)
00178 {
00179   uint32_t currentCacheId = eventSetup.get<SiStripFedCablingRcd>().cacheIdentifier();
00180   if (cablingCacheId_ != currentCacheId) {
00181     edm::ESHandle<SiStripFedCabling> cablingHandle;
00182     eventSetup.get<SiStripFedCablingRcd>().get(cablingHandle);
00183     cabling_ = cablingHandle.product();
00184     cablingCacheId_ = currentCacheId;
00185   }
00186 }
00187 
00188 inline void SiStripFEDMonitorPlugin::fillHistogram(MonitorElement* histogram, double value)
00189 {
00190   if (histogram) histogram->Fill(value);
00191 }
00192 
00193 bool SiStripFEDMonitorPlugin::analyzeFED(const FEDRawData& rawData, unsigned int fedId)
00194 {
00195   //try to construct the basic buffer object (do not check payload)
00196   //if this fails then count it as an invalid buffer and stop checks since we can't understand things like buffer ordering
00197   std::auto_ptr<const sistrip::FEDBufferBase> bufferBase;
00198   try {
00199     bufferBase.reset(new sistrip::FEDBufferBase(rawData.data(),rawData.size()));
00200   } catch (const cms::Exception& e) {
00201     fillHistogram(invalidBuffers_,fedId);
00202     fillHistogram(anyDaqProblems_,fedId);
00203     //don't check anything else if the buffer is invalid
00204     return false;
00205   }
00206   //CRC checks
00207   //if CRC fails then don't continue as if the buffer has been corrupted in DAQ then anything else could be invalid
00208   if (!bufferBase->checkNoSlinkCRCError()) {
00209     fillHistogram(badFEDCRCs_,fedId);
00210     fillHistogram(anyDaqProblems_,fedId);
00211     return false;
00212   } else if (!bufferBase->checkCRC()) {
00213     fillHistogram(badDAQCRCs_,fedId);
00214     fillHistogram(anyDaqProblems_,fedId);
00215     return false;
00216   }
00217   //next check that it is a SiStrip buffer
00218   //if not then stop checks
00219   if (!bufferBase->checkSourceIDs() || !bufferBase->checkNoUnexpectedSourceID()) {
00220     fillHistogram(badIDs_,fedId);
00221     fillHistogram(anyDaqProblems_,fedId);
00222     return false;
00223   } 
00224   //if so then do DAQ header/trailer checks
00225   //if these fail then buffer may be incomplete and checking contents doesn't make sense
00226   else if (!bufferBase->doDAQHeaderAndTrailerChecks()) {
00227     fillHistogram(daqProblems_,fedId);
00228     fillHistogram(anyDaqProblems_,fedId);
00229     return false;
00230   }
00231   
00232   bool foundError = false;
00233   //now do checks on header
00234   //check that tracker special header is consistent
00235   if (!bufferBase->doTrackerSpecialHeaderChecks() && bufferBase->checkNoFEOverflows()) {
00236     fillHistogram(invalidBuffers_,fedId);
00237     fillHistogram(anyDaqProblems_,fedId);
00238     foundError = true;
00239   }
00240   //FE unit overflows
00241   if (!bufferBase->checkNoFEOverflows()) { 
00242     foundError = true;
00243   }
00244   //if FEs overflowed or tracker special header is invalid then don't bother to check payload
00245   bool checkPayload = !foundError;
00246   bool feUnitsGood = analyzeFEUnits(bufferBase.get(),fedId);
00247   if (!feUnitsGood) foundError = true;
00248   
00249   //payload checks
00250   std::auto_ptr<const sistrip::FEDBuffer> buffer;
00251   std::list<unsigned int> badChannels;
00252   std::list<unsigned int> activeBadChannels;
00253   //need to construct full object to go any further
00254   if (checkPayload) buffer.reset(new sistrip::FEDBuffer(rawData.data(),rawData.size(),true));
00255   if (checkPayload) {
00256     //corrupt buffer checks
00257     if (!buffer->doCorruptBufferChecks()) {
00258       fillHistogram(corruptBuffers_,fedId);
00259       foundError = true;
00260     }
00261     //channel checks
00262     analyzeChannels(buffer.get(),fedId,&badChannels,&activeBadChannels);
00263     if (badChannels.size()) {
00264       fillHistogram(badChannelStatusBits_,fedId);
00265     }
00266     if (activeBadChannels.size()) {
00267       foundError = true;
00268     }
00269   }
00270   
00271   if (foundError && printDebug_) {
00272     const sistrip::FEDBufferBase* debugBuffer = NULL;
00273     if (buffer.get()) debugBuffer = buffer.get();
00274     else if (bufferBase.get()) debugBuffer = bufferBase.get();
00275     if (debugBuffer) {
00276       std::ostringstream debugStream;
00277       if (badChannels.size()) {
00278         badChannels.sort();
00279         debugStream << "Cabled channels which had errors: ";
00280         for (std::list<unsigned int>::const_iterator iBadCh = badChannels.begin(); iBadCh != badChannels.end(); iBadCh++) {
00281           debugStream << *iBadCh << " ";
00282         }
00283         debugStream << std::endl;
00284       }
00285       if (activeBadChannels.size()) {
00286         activeBadChannels.sort();
00287         debugStream << "Active (have been unlocked in at least one event) cabled channels which had errors: ";
00288         for (std::list<unsigned int>::const_iterator iBadCh = activeBadChannels.begin(); iBadCh != activeBadChannels.end(); iBadCh++) {
00289           debugStream << *iBadCh << " ";
00290         }
00291         debugStream << std::endl;
00292       }
00293       debugStream << (*debugBuffer) << std::endl;
00294       debugBuffer->dump(debugStream);
00295       debugStream << std::endl;
00296       edm::LogInfo("SiStripMonitorHardware") << "Errors found in FED " << fedId;
00297       edm::LogVerbatim("SiStripMonitorHardware") << debugStream.str();
00298     }
00299   }
00300   
00301   return !foundError;
00302 }
00303 
00304 bool SiStripFEDMonitorPlugin::analyzeFEUnits(const sistrip::FEDBufferBase* buffer, unsigned int fedId)
00305 {
00306   bool foundOverflow = false;
00307   bool foundBadMajority = false;
00308   for (unsigned int iFE = 0; iFE < sistrip::FEUNITS_PER_FED; iFE++) {
00309     if (buffer->feOverflow(iFE)) {
00310       bookFEDHistograms(fedId);
00311       fillHistogram(feOverflowDetailed_[fedId],iFE);
00312       foundOverflow = true;
00313       //if FE overflowed then address isn't valid
00314       continue;
00315     }
00316     if (!buffer->feEnabled(iFE)) continue;
00317     if (buffer->majorityAddressErrorForFEUnit(iFE)) {
00318       bookFEDHistograms(fedId);
00319       fillHistogram(badMajorityAddressDetailed_[fedId],iFE);
00320       foundBadMajority = true;
00321     }
00322   }
00323   if (foundOverflow) {
00324     fillHistogram(feOverflows_,fedId);
00325   }
00326   if (foundBadMajority) {
00327     fillHistogram(badMajorityAddresses_,fedId);
00328   }
00329   bool foundError = foundOverflow || foundBadMajority;
00330   return !foundError;
00331 }
00332 
00333 bool SiStripFEDMonitorPlugin::analyzeChannels(const sistrip::FEDBuffer* buffer, unsigned int fedId,
00334                                               std::list<unsigned int>* badChannelList,
00335                                               std::list<unsigned int>* activeBadChannelList)
00336 {
00337   bool foundError = false;
00338   bool filledBadChannel = false;
00339   const sistrip::FEDFEHeader* header = buffer->feHeader();
00340   const sistrip::FEDFullDebugHeader* debugHeader = dynamic_cast<const sistrip::FEDFullDebugHeader*>(header);
00341   for (unsigned int iCh = 0; iCh < sistrip::FEDCH_PER_FED; iCh++) {
00342     if (!cabling_->connection(fedId,iCh).isConnected()) continue;
00343     if (debugHeader) {
00344       if (!debugHeader->unlocked(iCh)) activeChannels_[fedId][iCh] = true;
00345     }
00346     bool channelWasBad = false;
00347     for (unsigned int iAPV = 0; iAPV < 2; iAPV++) {
00348       if (!header->checkStatusBits(iCh,iAPV)) {
00349         bookFEDHistograms(fedId,debugHeader);
00350         fillHistogram(badStatusBitsDetailed_[fedId],iCh*2+iAPV);
00351         foundError = true;
00352         channelWasBad = true;
00353       }
00354     }
00355     //add channel to bad channel list
00356     if (channelWasBad && badChannelList) badChannelList->push_back(iCh);
00357     if (channelWasBad && activeChannels_[fedId][iCh] && activeBadChannelList) activeBadChannelList->push_back(iCh);
00358     //fill histogram for active channels
00359     if (channelWasBad && activeChannels_[fedId][iCh] && !filledBadChannel) {
00360       fillHistogram(badActiveChannelStatusBits_,fedId);
00361       filledBadChannel = true;
00362     }
00363   }
00364   if (debugHeader) {
00365     for (unsigned int iCh = 0; iCh < sistrip::FEDCH_PER_FED; iCh++) {
00366       for (unsigned int iAPV = 0; iAPV < 2; iAPV++) {
00367         if (debugHeader->apvError(iCh,iAPV)) {
00368           bookFEDHistograms(fedId,debugHeader);
00369           fillHistogram(apvErrorDetailed_[fedId],iCh*2+iAPV);
00370         }
00371         if (debugHeader->apvAddressError(iCh,iAPV)) {
00372           bookFEDHistograms(fedId,debugHeader);
00373           fillHistogram(apvAddressErrorDetailed_[fedId],iCh*2+iAPV);
00374         }
00375       }
00376       if (debugHeader->unlocked(iCh)) {
00377         bookFEDHistograms(fedId,debugHeader);
00378         fillHistogram(unlockedDetailed_[fedId],iCh);
00379       }
00380       if (debugHeader->outOfSync(iCh)) {
00381         bookFEDHistograms(fedId,debugHeader);
00382         fillHistogram(outOfSyncDetailed_[fedId],iCh);
00383       }
00384     }
00385   }
00386   return !foundError;
00387 }
00388 
00389 void SiStripFEDMonitorPlugin::bookFEDHistograms(unsigned int fedId, bool fullDebugMode)
00390 {
00391   if (disableFEDHistograms_ && !fillAllHistograms_) return;
00392   if (!histosBooked_[fedId]) {
00393     SiStripFedKey fedKey(fedId,0,0,0);
00394     dqm_->setCurrentFolder(fedKey.path());
00395     std::stringstream fedIdStream;
00396     fedIdStream << fedId;
00397     feOverflowDetailed_[fedId] = dqm_->book1D("FEOverflowsForFED"+fedIdStream.str(),
00398                                               "FE overflows per FE unit for FED ID "+fedIdStream.str(),
00399                                               sistrip::FEUNITS_PER_FED,0,sistrip::FEUNITS_PER_FED);
00400     feOverflowDetailed_[fedId]->setAxisTitle("FE-Index",1);
00401     badMajorityAddressDetailed_[fedId] = dqm_->book1D("BadMajorityAddressesForFED"+fedIdStream.str(),
00402                                                       "Bad majority APV addresses per FE unit for FED ID "+fedIdStream.str(),
00403                                                       sistrip::FEUNITS_PER_FED,0,sistrip::FEUNITS_PER_FED);
00404     badMajorityAddressDetailed_[fedId]->setAxisTitle("FE-Index",1);
00405     badStatusBitsDetailed_[fedId] = dqm_->book1D("BadAPVStatusBitsForFED"+fedIdStream.str(),
00406                                                  "Bad apv status bits for FED ID "+fedIdStream.str(),
00407                                                  sistrip::APVS_PER_FED,0,sistrip::APVS_PER_FED);
00408     badStatusBitsDetailed_[fedId]->setAxisTitle("APV-Index",1);
00409     histosBooked_[fedId] = true;
00410   }
00411   if (fullDebugMode && !debugHistosBooked_[fedId]) {
00412     SiStripFedKey fedKey(fedId,0,0,0);
00413     dqm_->setCurrentFolder(fedKey.path());
00414     std::stringstream fedIdStream;
00415     fedIdStream << fedId;
00416     apvErrorDetailed_[fedId] = dqm_->book1D("APVErrorBitsForFED"+fedIdStream.str(),
00417                                             "APV errors for FED ID "+fedIdStream.str(),
00418                                             sistrip::APVS_PER_FED,0,sistrip::APVS_PER_FED);
00419     apvErrorDetailed_[fedId]->setAxisTitle("APV-Index",1);
00420     apvAddressErrorDetailed_[fedId] = dqm_->book1D("APVAddressErrorBitsForFED"+fedIdStream.str(),
00421                                                    "Wrong APV address errors for FED ID "+fedIdStream.str(),
00422                                                    sistrip::APVS_PER_FED,0,sistrip::APVS_PER_FED);
00423     apvAddressErrorDetailed_[fedId]->setAxisTitle("APV-Index",1);
00424     unlockedDetailed_[fedId] = dqm_->book1D("UnlockedBitsForFED"+fedIdStream.str(),
00425                                             "Unlocked channels for FED ID "+fedIdStream.str(),
00426                                             sistrip::FEDCH_PER_FED,0,sistrip::FEDCH_PER_FED);
00427     unlockedDetailed_[fedId]->setAxisTitle("Channel-Index",1);
00428     outOfSyncDetailed_[fedId] = dqm_->book1D("OOSBitsForFED"+fedIdStream.str(),
00429                                              "Out of sync channels for FED ID "+fedIdStream.str(),
00430                                              sistrip::FEDCH_PER_FED,0,sistrip::FEDCH_PER_FED);
00431     outOfSyncDetailed_[fedId]->setAxisTitle("Channel-Index",1);
00432     debugHistosBooked_[fedId] = true;
00433   }
00434 }
00435 
00436 void SiStripFEDMonitorPlugin::bookAllFEDHistograms()
00437 {
00438   //get FED IDs
00439   const FEDNumbering numbering;
00440   const unsigned int siStripFedIdMin = numbering.getSiStripFEDIds().first;
00441   const unsigned int siStripFedIdMax = numbering.getSiStripFEDIds().second;
00442   //book them
00443   for (unsigned int iFed = siStripFedIdMin; iFed <= siStripFedIdMax; iFed++) {
00444     bookFEDHistograms(iFed,true);
00445   }
00446 }
00447 
00448 void SiStripFEDMonitorPlugin::bookTopLevelHistograms()
00449 {
00450   //get FED IDs
00451   const FEDNumbering numbering;
00452   const unsigned int siStripFedIdMin = numbering.getSiStripFEDIds().first;
00453   const unsigned int siStripFedIdMax = numbering.getSiStripFEDIds().second;
00454   //book histos
00455   anyErrors_ = dqm_->book1D("AnyErrors",
00456                             "Number of buffers with any error per FED",
00457                             siStripFedIdMax-siStripFedIdMin+1,
00458                             siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00459   anyErrors_->setAxisTitle("FED-ID",1);
00460   corruptBuffers_ = dqm_->book1D("CorruptBuffers",
00461                                  "Number of corrupt FED buffers per FED",
00462                                  siStripFedIdMax-siStripFedIdMin+1,
00463                                  siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00464   corruptBuffers_->setAxisTitle("FED-ID",1);
00465   invalidBuffers_ = dqm_->book1D("InvalidBuffers",
00466                                  "Number of invalid FED buffers per FED",
00467                                  siStripFedIdMax-siStripFedIdMin+1,
00468                                  siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00469   invalidBuffers_->setAxisTitle("FED-ID",1);
00470   anyDaqProblems_ = dqm_->book1D("AnyDAQProblems",
00471                                  "Number of buffers with any problems flagged in DAQ header (including CRC)",
00472                                  siStripFedIdMax-siStripFedIdMin+1,
00473                                  siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00474   anyDaqProblems_->setAxisTitle("FED-ID",1);
00475   badIDs_ = dqm_->book1D("BadIDs",
00476                          "Number of buffers with non-SiStrip source IDs in DAQ header",
00477                          siStripFedIdMax-siStripFedIdMin+1,
00478                          siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00479   badIDs_->setAxisTitle("FED-ID",1);
00480   badChannelStatusBits_ = dqm_->book1D("BadChannelStatusBits",
00481                                        "Number of buffers with one or more enabled channel with bad status bits",
00482                                        siStripFedIdMax-siStripFedIdMin+1,
00483                                        siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00484   badChannelStatusBits_->setAxisTitle("FED-ID",1);
00485   badActiveChannelStatusBits_ = dqm_->book1D("BadActiveChannelStatusBits",
00486                                              "Number of buffers with one or more active channel with bad status bits",
00487                                              siStripFedIdMax-siStripFedIdMin+1,
00488                                              siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00489   badActiveChannelStatusBits_->setAxisTitle("FED-ID",1);
00490   if (!disableGlobalExpertHistograms_ || fillAllHistograms_) {
00491     badDAQCRCs_ = dqm_->book1D("BadDAQCRCs",
00492                                "Number of buffers with bad CRCs from the DAQ",
00493                                siStripFedIdMax-siStripFedIdMin+1,
00494                                siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00495     badDAQCRCs_->setAxisTitle("FED-ID",1);
00496     badFEDCRCs_ = dqm_->book1D("BadFEDCRCs",
00497                                "Number of buffers with bad CRCs from the FED",
00498                                siStripFedIdMax-siStripFedIdMin+1,
00499                                siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00500     badFEDCRCs_->setAxisTitle("FED-ID",1);
00501     daqProblems_ = dqm_->book1D("DAQProblems",
00502                                 "Number of buffers with (non-CRC) problems flagged in DAQ header",
00503                                 siStripFedIdMax-siStripFedIdMin+1,
00504                                 siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00505     daqProblems_->setAxisTitle("FED-ID",1);
00506     feOverflows_ = dqm_->book1D("FEOverflows",
00507                                 "Number of buffers with one or more FE overflow",
00508                                 siStripFedIdMax-siStripFedIdMin+1,
00509                                 siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00510     feOverflows_->setAxisTitle("FED-ID",1);
00511     badMajorityAddresses_ = dqm_->book1D("BadMajorityAddresses",
00512                                          "Number of buffers with one or more FE with a bad majority APV address",
00513                                          siStripFedIdMax-siStripFedIdMin+1,
00514                                          siStripFedIdMin-0.5,siStripFedIdMax+0.5);
00515     badMajorityAddresses_->setAxisTitle("FED-ID",1);
00516   }
00517 }
00518 
00519 //
00520 // Define as a plug-in
00521 //
00522 
00523 #include "FWCore/Framework/interface/MakerMacros.h"
00524 DEFINE_FWK_MODULE(SiStripFEDMonitorPlugin);

Generated on Tue Jun 9 17:33:38 2009 for CMSSW by  doxygen 1.5.4