Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SiStripMonitorClient_SiStripDaqInfo_h
0002 #define SiStripMonitorClient_SiStripDaqInfo_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     SiStripMonitorClient
0006 // Class  :     SiStripDaqInfo
0007 //
0008 /**\class SiStripDaqInfo SiStripDaqInfo.h
0009    DQM/SiStripMonitorCluster/interface/SiStripDaqInfo.h
0010 
0011    Description:
0012    Checks the # of SiStrip FEDs from DAQ
0013    Usage:
0014    <usage>
0015 
0016 */
0017 //
0018 //          Author:  Suchandra Dutta
0019 //         Created:  Thu Dec 11 17:50:00 CET 2008
0020 //
0021 
0022 #include <string>
0023 
0024 #include "FWCore/Framework/interface/EDAnalyzer.h"
0025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0026 #include "FWCore/Framework/interface/ESWatcher.h"
0027 #include "FWCore/Framework/interface/LuminosityBlock.h"
0028 #include "FWCore/Framework/interface/Run.h"
0029 #include "FWCore/Framework/interface/EventSetup.h"
0030 #include "DQMServices/Core/interface/DQMStore.h"
0031 
0032 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0033 #include "CondFormats/DataRecord/interface/SiStripCondDataRecords.h"
0034 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
0035 #include "CondFormats/DataRecord/interface/RunSummaryRcd.h"
0036 
0037 #include <iostream>
0038 #include <fstream>
0039 #include <string>
0040 #include <vector>
0041 #include <map>
0042 
0043 class SiStripFedCabling;
0044 class TrackerTopology;
0045 class RunInfo;
0046 
0047 class SiStripDaqInfo : public edm::EDAnalyzer {
0048 public:
0049   typedef dqm::harvesting::MonitorElement MonitorElement;
0050   typedef dqm::harvesting::DQMStore DQMStore;
0051 
0052   SiStripDaqInfo(edm::ParameterSet const& ps);
0053 
0054 private:
0055   void beginRun(edm::Run const& run, edm::EventSetup const& eSetup) override;
0056   void analyze(edm::Event const&, edm::EventSetup const&) override;
0057 
0058   void readFedIds(const SiStripFedCabling* fedcabling, edm::EventSetup const& iSetup);
0059   void readSubdetFedFractions(DQMStore& dqm_store, std::vector<int> const& fed_ids, edm::EventSetup const& iSetup);
0060   void bookStatus(DQMStore& dqm_store);
0061   void fillDummyStatus(DQMStore& dqm_store);
0062   void findExcludedModule(DQMStore& dqm_store, unsigned short fed_id, TrackerTopology const* tTopo);
0063 
0064   std::map<std::string, std::vector<unsigned short>> subDetFedMap_;
0065 
0066   MonitorElement* daqFraction_{nullptr};
0067 
0068   struct SubDetMEs {
0069     MonitorElement* daqFractionME;
0070     int connectedFeds;
0071   };
0072 
0073   std::map<std::string, SubDetMEs> subDetMEsMap_;
0074 
0075   int nFedTotal_{};
0076   bool bookedStatus_{false};
0077 
0078   const SiStripFedCabling* fedCabling_;
0079   edm::ESWatcher<SiStripFedCablingRcd> fedCablingWatcher_;
0080   edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> fedCablingToken_;
0081   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0082   edm::ESGetToken<RunInfo, RunInfoRcd> runInfoToken_;
0083 };
0084 #endif