Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SiStripMonitorClient_SiStripOfflineDQM_h
0002 #define SiStripMonitorClient_SiStripOfflineDQM_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     SiStripMonitorClient
0006 // Class  :     SiStripOfflineDQM
0007 //
0008 /**\class SiStripOfflineDQM SiStripOfflineDQM.h
0009    DQM/SiStripMonitorCluster/interface/SiStripOfflineDQM.h
0010 
0011    Description:
0012    DQM class to perform Summary creation Quality Test on a merged Root file
0013    after CAF processing
0014    Usage:
0015    <usage>
0016 
0017 */
0018 //
0019 // Original Author:  Samvel Khalatyan (ksamdev at gmail dot com)
0020 //         Created:  Wed Oct 5 16:47:14 CET 2006
0021 //
0022 
0023 #include <string>
0024 
0025 #include "DQM/SiStripMonitorClient/interface/SiStripActionExecutor.h"
0026 #include "FWCore/Framework/interface/one/EDProducer.h"
0027 #include "FWCore/Framework/interface/ESHandle.h"
0028 #include "FWCore/Framework/interface/EventSetup.h"
0029 #include "FWCore/Framework/interface/LuminosityBlock.h"
0030 #include "FWCore/Framework/interface/Run.h"
0031 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0032 #include "DQMServices/Core/interface/DQMStore.h"
0033 
0034 // Cabling
0035 #include "CalibTracker/Records/interface/SiStripDetCablingRcd.h"
0036 #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h"
0037 #include "CondFormats/DataRecord/interface/RunSummaryRcd.h"
0038 
0039 #include <iostream>
0040 #include <fstream>
0041 #include <string>
0042 #include <vector>
0043 #include <map>
0044 #include <TTree.h>
0045 
0046 class SiStripDetCabling;
0047 class RunInfo;
0048 
0049 class SiStripOfflineDQM : public edm::one::EDProducer<edm::one::WatchLuminosityBlocks,
0050                                                       edm::one::WatchRuns,
0051                                                       edm::EndRunProducer,
0052                                                       edm::EndLuminosityBlockProducer,
0053                                                       edm::one::SharedResources> {
0054 public:
0055   typedef dqm::harvesting::MonitorElement MonitorElement;
0056   typedef dqm::harvesting::DQMStore DQMStore;
0057 
0058   SiStripOfflineDQM(edm::ParameterSet const& ps);
0059 
0060 private:
0061   void beginJob() override;
0062   void beginRun(edm::Run const& run, edm::EventSetup const& eSetup) override;
0063   void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& iSetup) override{};
0064   void produce(edm::Event& e, edm::EventSetup const& eSetup) override;
0065   void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& iSetup) override;
0066   void endLuminosityBlockProduce(edm::LuminosityBlock&, edm::EventSetup const&) override{};
0067   void endRun(edm::Run const& run, edm::EventSetup const& eSetup) override;
0068   void endRunProduce(edm::Run&, edm::EventSetup const&) override{};
0069   void endJob() override;
0070 
0071   void checkTrackerFEDs(edm::Event const& e);
0072   bool openInputFile(DQMStore& dqm_store);
0073 
0074   SiStripActionExecutor actionExecutor_;
0075 
0076   bool usedWithEDMtoMEConverter_;
0077   bool createSummary_;
0078   bool const createTkMap_, createTkInfoFile_;
0079   std::string const inputFileName_;
0080   std::string const outputFileName_;
0081   int globalStatusFilling_;
0082   bool trackerFEDsFound_;
0083   bool printFaultyModuleList_;
0084   TTree* tkinfoTree_{nullptr};
0085   edm::ESGetToken<SiStripDetCabling, SiStripDetCablingRcd> detCablingToken_;
0086   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0087   edm::ESGetToken<TkDetMap, TrackerTopologyRcd> tkDetMapToken_;
0088   edm::ESGetToken<GeometricDet, IdealGeometryRecord> geomDetToken_;
0089   edm::ESGetToken<RunInfo, RunInfoRcd> runInfoToken_;
0090 
0091   struct MapOptions {
0092     std::string type;
0093     edm::ParameterSet pset;
0094     bool useSSQ;
0095     edm::ESGetToken<SiStripQuality, SiStripQualityRcd> token;
0096 
0097     MapOptions(const std::string type_,
0098                edm::ParameterSet&& pset_,
0099                bool useSSQ_,
0100                edm::ESGetToken<SiStripQuality, SiStripQualityRcd>&& token_)
0101         : type(type_), pset(std::move(pset_)), useSSQ(useSSQ_), token(std::move(token_)) {}
0102   };
0103   std::vector<MapOptions> tkMapOptions_;
0104 };
0105 #endif