Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:48

0001 // -*- C++ -*-
0002 //
0003 // Package:    DQM/SiStripMonitorHardware
0004 // Class:      FEDHistograms
0005 //
0006 /**\class FEDHistograms DQM/SiStripMonitorHardware/interface/FEDHistograms.hh
0007 
0008  Description: DQM source application to produce data integrety histograms for SiStrip data
0009 */
0010 //
0011 // Original Author:  Nicholas Cripps in plugin file
0012 //         Created:  2008/09/16
0013 // Modified by    :  Anne-Marie Magnan, code copied from plugin to this class
0014 //
0015 
0016 #ifndef DQM_SiStripMonitorHardware_FEDHistograms_HH
0017 #define DQM_SiStripMonitorHardware_FEDHistograms_HH
0018 
0019 #include <sstream>
0020 
0021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0022 
0023 #include "DQM/SiStripCommon/interface/TkHistoMap.h"
0024 
0025 #include "DQMServices/Core/interface/DQMStore.h"
0026 
0027 #include "DQM/SiStripMonitorHardware/interface/HistogramBase.hh"
0028 #include "DQM/SiStripMonitorHardware/interface/FEDErrors.hh"
0029 
0030 class FEDHistograms : public HistogramBase {
0031 public:
0032   FEDHistograms();
0033 
0034   ~FEDHistograms() override;
0035 
0036   //initialise histograms
0037   void initialise(const edm::ParameterSet &iConfig, std::ostringstream *pDebugStream) override;
0038 
0039   void fillCountersHistograms(const FEDErrors::FEDCounters &aFedLevelCounters,
0040                               const FEDErrors::ChannelCounters &aChLevelCounters,
0041                               const unsigned int aMaxSize,
0042                               const double aTime);
0043 
0044   void fillFEDHistograms(FEDErrors &aFedError,
0045                          const unsigned int aEvtSize,
0046                          bool lFullDebug,
0047                          const double aLumiSection,
0048                          unsigned int &NumBadChannels_perFEDID);
0049 
0050   void fillFEHistograms(const unsigned int aFedId,
0051                         const FEDErrors::FELevelErrors &aFeLevelErrors,
0052                         const FEDErrors::EventProperties &aEventProp);
0053 
0054   void fillChannelsHistograms(const unsigned int aFedId, const FEDErrors::ChannelLevelErrors &aChErr, bool fullDebug);
0055 
0056   void fillAPVsHistograms(const unsigned int aFedId, const FEDErrors::APVLevelErrors &aAPVErr, bool fullDebug);
0057 
0058   void fillMajorityHistograms(const unsigned int aPart, const float aValue, const std::vector<unsigned int> &aFedIdVec);
0059 
0060   bool feMajHistosEnabled();
0061 
0062   void fillLumiHistograms(const std::vector<unsigned int> &nTotal, const std::vector<unsigned int> &nErrors);
0063 
0064   bool cmHistosEnabled();
0065 
0066   //book the top level histograms
0067   void bookTopLevelHistograms(DQMStore::IBooker &, const TkDetMap *, std::string topFolderName = "SiStrip");
0068 
0069   //book individual FED histograms or book all FED level histograms at once
0070   void bookFEDHistograms(DQMStore::IBooker &, unsigned int fedId, bool fullDebugMode = false);
0071 
0072   void bookAllFEDHistograms(DQMStore::IBooker &, bool);
0073 
0074   bool tkHistoMapEnabled(unsigned int aIndex = 0) override;
0075 
0076   TkHistoMap *tkHistoMapPointer(unsigned int aIndex = 0) override;
0077 
0078   MonitorElement *cmHistPointer(bool aApv1);
0079 
0080   MonitorElement *getFedvsAPVpointer();
0081 
0082 protected:
0083 private:
0084   //counting histograms (histogram of number of problems per event)
0085 
0086   HistogramConfig fedEventSize_;
0087   HistogramConfig fedMaxEventSizevsTime_;
0088 
0089   HistogramConfig nFEDErrors_, nFEDDAQProblems_, nFEDsWithFEProblems_, nFEDCorruptBuffers_, nBadChannelStatusBits_,
0090       nBadActiveChannelStatusBits_, nUnconnectedChannels_, nFEDsWithFEOverflows_, nFEDsWithFEBadMajorityAddresses_,
0091       nFEDsWithMissingFEs_;
0092 
0093   HistogramConfig nFEDErrorsvsTime_;
0094   HistogramConfig fedErrorsVsIdVsLumi_;
0095   HistogramConfig nFEDCorruptBuffersvsTime_;
0096   HistogramConfig nFEDsWithFEProblemsvsTime_;
0097 
0098   HistogramConfig nTotalBadChannels_;
0099   HistogramConfig nTotalBadActiveChannels_;
0100 
0101   HistogramConfig nTotalBadChannelsvsTime_;
0102   HistogramConfig nTotalBadActiveChannelsvsTime_;
0103 
0104   HistogramConfig nAPVStatusBit_;
0105   HistogramConfig nAPVError_;
0106   HistogramConfig nAPVAddressError_;
0107   HistogramConfig nUnlocked_;
0108   HistogramConfig nOutOfSync_;
0109 
0110   HistogramConfig nAPVStatusBitvsTime_;
0111   HistogramConfig nAPVErrorvsTime_;
0112   HistogramConfig nAPVAddressErrorvsTime_;
0113   HistogramConfig nUnlockedvsTime_;
0114   HistogramConfig nOutOfSyncvsTime_;
0115 
0116   //top level histograms
0117   HistogramConfig anyFEDErrors_, anyDAQProblems_, corruptBuffers_, invalidBuffers_, badIDs_, badChannelStatusBits_,
0118       badActiveChannelStatusBits_, badDAQCRCs_, badFEDCRCs_, badDAQPacket_, dataMissing_, dataPresent_, feOverflows_,
0119       badMajorityAddresses_, badMajorityInPartition_, feMissing_, anyFEProblems_, fedIdVsApvId_;
0120 
0121   HistogramConfig feTimeDiffTIB_, feTimeDiffTOB_, feTimeDiffTECB_, feTimeDiffTECF_;
0122 
0123   HistogramConfig feTimeDiffvsDBX_;
0124 
0125   HistogramConfig apveAddress_;
0126   HistogramConfig feMajAddress_;
0127 
0128   HistogramConfig feMajFracTIB_;
0129   HistogramConfig feMajFracTOB_;
0130   HistogramConfig feMajFracTECB_;
0131   HistogramConfig feMajFracTECF_;
0132 
0133   HistogramConfig medianAPV0_;
0134   HistogramConfig medianAPV1_;
0135 
0136   HistogramConfig feOverflowDetailed_, badMajorityAddressDetailed_, feMissingDetailed_;
0137 
0138   HistogramConfig badStatusBitsDetailed_, apvErrorDetailed_, apvAddressErrorDetailed_, unlockedDetailed_,
0139       outOfSyncDetailed_;
0140 
0141   //FED level histograms
0142   std::map<unsigned int, MonitorElement *> feOverflowDetailedMap_, badMajorityAddressDetailedMap_,
0143       feMissingDetailedMap_;
0144 
0145   std::map<unsigned int, MonitorElement *> badStatusBitsDetailedMap_, apvErrorDetailedMap_, apvAddressErrorDetailedMap_,
0146       unlockedDetailedMap_, outOfSyncDetailedMap_;
0147 
0148   HistogramConfig fedErrorsVsId_;
0149 
0150   //has individual FED histogram been booked? (index is FedId)
0151   std::vector<bool> histosBooked_, debugHistosBooked_;
0152 
0153   HistogramConfig tkMapConfig_;
0154   std::unique_ptr<TkHistoMap> tkmapFED_;
0155 
0156 };  //class
0157 
0158 #endif  //DQM_SiStripMonitorHardware_FEDHistograms_HH