Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:06:58

0001 /*
0002  * =====================================================================================
0003  *
0004  *       Filename:  CSCMonitorModule.h
0005  *
0006  *    Description:  Updated CSC Monitor module
0007  *
0008  *        Version:  1.0
0009  *        Created:  11/13/2008 01:36:45 PM
0010  *       Revision:  none
0011  *       Compiler:  gcc
0012  *
0013  *         Author:  Valdas Rapsevicius (VR), valdas.rapsevicius@cern.ch
0014  *        Company:  CERN, CH
0015  *
0016  * =====================================================================================
0017  */
0018 
0019 #ifndef CSCMonitorModule_H
0020 #define CSCMonitorModule_H
0021 
0022 /// Global stuff
0023 #include <iostream>
0024 #include <cstring>
0025 #include <vector>
0026 #include <map>
0027 #include <set>
0028 
0029 /// DQM Framework stuff
0030 #include <FWCore/ParameterSet/interface/ParameterSet.h>
0031 
0032 #include <DQMServices/Core/interface/DQMOneEDAnalyzer.h>
0033 
0034 #include <FWCore/ServiceRegistry/interface/Service.h>
0035 #include <FWCore/Framework/interface/ESHandle.h>
0036 #include <FWCore/Framework/interface/EventSetup.h>
0037 
0038 #ifdef DQMGLOBAL
0039 #include <FWCore/Utilities/interface/InputTag.h>
0040 #include <FWCore/Framework/interface/ConsumesCollector.h>
0041 #endif
0042 
0043 /// CSC Framework stuff
0044 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0045 #include "CondFormats/CSCObjects/interface/CSCCrateMap.h"
0046 #include "CondFormats/DataRecord/interface/CSCCrateMapRcd.h"
0047 #include "DataFormats/Scalers/interface/DcsStatus.h"
0048 
0049 /// CSCDQM Framework stuff
0050 #include "CSCDQM_Logger.h"
0051 #include "CSCDQM_Configuration.h"
0052 #include "CSCDQM_Dispatcher.h"
0053 
0054 /// Local stuff
0055 #include "CSCMonitorObject.h"
0056 
0057 /// Local Constants
0058 static const char INPUT_TAG_LABEL[] = "source";
0059 static const char DIR_EVENTINFO[] = "CSC/EventInfo/";
0060 static const char DIR_DCSINFO[] = "CSC/EventInfo/DCSContents/";
0061 static const char DIR_DAQINFO[] = "CSC/EventInfo/DAQContents/";
0062 static const char DIR_CRTINFO[] = "CSC/EventInfo/CertificationContents/";
0063 
0064 static const unsigned int MIN_CRATE_ID = 1;
0065 static const unsigned int MAX_CRATE_ID = 60;
0066 static const unsigned int MIN_DMB_SLOT = 1;
0067 static const unsigned int MAX_DMB_SLOT = 10;
0068 
0069 /**
0070  * @class CSCMonitorModule
0071  * @brief Common CSC DQM Module that uses CSCDQM Framework  
0072  */
0073 class CSCMonitorModule : public DQMOneEDAnalyzer<>, public cscdqm::MonitorObjectProvider {
0074   /**
0075    * Global stuff
0076    */
0077 
0078 public:
0079   CSCMonitorModule(const edm::ParameterSet& ps);
0080   ~CSCMonitorModule() override;
0081 
0082 private:
0083   cscdqm::Configuration config;
0084   cscdqm::Dispatcher* dispatcher;
0085   // DQMStore                 *dbe;
0086   DQMStore::IBooker* ibooker;
0087   edm::InputTag inputTag;
0088   bool prebookEffParams;
0089   bool processDcsScalers;
0090 
0091   const edm::ESGetToken<CSCCrateMap, CSCCrateMapRcd> hcrateToken_;
0092 
0093   /** Pointer to crate mapping from database **/
0094   const CSCCrateMap* pcrate;
0095 
0096   std::vector<std::string> maskedHW;
0097 
0098 #ifdef DQMGLOBAL
0099   edm::EDGetTokenT<DcsStatusCollection> dcstoken;
0100 #endif
0101 
0102   /**
0103    * MonitorObjectProvider Implementation
0104    */
0105 
0106 public:
0107   bool getCSCDetId(const unsigned int crateId, const unsigned int dmbId, CSCDetId& detId) const override {
0108     // Check parameter values
0109     if (crateId < MIN_CRATE_ID || crateId > MAX_CRATE_ID || dmbId < MIN_DMB_SLOT || dmbId > MAX_DMB_SLOT) {
0110       return false;
0111     }
0112     detId = pcrate->detId(crateId, dmbId, 0, 0);
0113     return (detId.rawId() != 0);
0114   }
0115 
0116   cscdqm::MonitorObject* bookMonitorObject(const cscdqm::HistoBookRequest& p_req) override;
0117 
0118   /** 
0119    * EDAnalyzer Implementation
0120    */
0121 
0122 protected:
0123   void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0124   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0125 };
0126 
0127 #endif