Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:11:54

0001 // -*- C++ -*-
0002 //
0003 // Package:    DQM/SiStripMonitorHardware
0004 // Class:      CMHistograms
0005 //
0006 /**\class CMHistograms DQM/SiStripMonitorHardware/interface/CMHistograms.hh
0007 
0008  Description: DQM source application to produce CM monitoring histograms for SiStrip data
0009 */
0010 //
0011 // Original Author:  Anne-Marie Magnan
0012 //         Created:  2009/07/22
0013 //
0014 
0015 #ifndef DQM_SiStripMonitorHardware_CMHistograms_HH
0016 #define DQM_SiStripMonitorHardware_CMHistograms_HH
0017 
0018 #include <sstream>
0019 
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 
0022 #include "DQM/SiStripCommon/interface/TkHistoMap.h"
0023 
0024 #include "DQMServices/Core/interface/DQMStore.h"
0025 
0026 #include "DQM/SiStripMonitorHardware/interface/HistogramBase.hh"
0027 
0028 class CMHistograms : public HistogramBase {
0029 public:
0030   struct CMvalues {
0031     unsigned int ChannelID;
0032     //bool IsShot;
0033     //uint16_t Length;
0034     std::pair<uint16_t, uint16_t> Medians;
0035     //std::pair<float,float> ShotMedians;
0036     std::pair<uint16_t, uint16_t> PreviousMedians;
0037   };
0038 
0039   CMHistograms();
0040 
0041   ~CMHistograms() override;
0042 
0043   //initialise histograms
0044   void initialise(const edm::ParameterSet& iConfig, std::ostringstream* pDebugStream) override;
0045 
0046   void fillHistograms(const std::vector<CMvalues>& aVec, float aTime, unsigned int aFedId);
0047 
0048   //book the top level histograms
0049   void bookTopLevelHistograms(DQMStore::IBooker&, const TkDetMap*);
0050 
0051   //book individual FED histograms or book all FED level histograms at once
0052   void bookFEDHistograms(DQMStore::IBooker&, unsigned int fedId);
0053   //void bookFEDHistograms(unsigned int fedId, unsigned int aCategory);
0054   void bookChannelsHistograms(DQMStore::IBooker&, unsigned int fedId);
0055 
0056   void bookAllFEDHistograms(DQMStore::IBooker&);
0057 
0058   bool tkHistoMapEnabled(unsigned int aIndex = 0) override;
0059 
0060   TkHistoMap* tkHistoMapPointer(unsigned int aIndex = 0) override;
0061 
0062 protected:
0063 private:
0064   //has individual FED histogram been booked? (index is FedId)
0065   std::vector<bool> histosBooked_;
0066 
0067   bool doFed_[500];
0068 
0069   HistogramConfig tkMapConfig_;
0070   std::unique_ptr<TkHistoMap> tkmapCM_[4];
0071 
0072   HistogramConfig medianAPV1vsAPV0_;
0073   HistogramConfig medianAPV0minusAPV1_;
0074 
0075   HistogramConfig meanCMPerFedvsFedId_;
0076   HistogramConfig meanCMPerFedvsTime_;
0077 
0078   //CM-previous value for all APVs
0079   HistogramConfig variationsPerFedvsFedId_;
0080   HistogramConfig variationsPerFedvsTime_;
0081 
0082   HistogramConfig medianAPV1vsAPV0perFED_;
0083   HistogramConfig medianAPV0minusAPV1perFED_;
0084   HistogramConfig medianperChannel_;
0085   HistogramConfig medianAPV0minusAPV1perChannel_;
0086 
0087   std::map<unsigned int, MonitorElement*> medianAPV1vsAPV0perFEDMap_;
0088   std::map<unsigned int, MonitorElement*> medianAPV0minusAPV1perFEDMap_;
0089   std::map<unsigned int, std::vector<MonitorElement*> > medianperChannelMap_;
0090   std::map<unsigned int, std::vector<MonitorElement*> > medianAPV0minusAPV1perChannelMap_;
0091 
0092 };  //class
0093 
0094 #endif  //DQM_SiStripMonitorHardware_CMHistograms_HH