Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 
0002 #ifndef DQM_SiStripCommissioningClients_SiStripCommissioningOfflineClient_H
0003 #define DQM_SiStripCommissioningClients_SiStripCommissioningOfflineClient_H
0004 
0005 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0006 #include "DQM/SiStripCommissioningClients/interface/SiStripTFile.h"
0007 #include "DQM/SiStripCommissioningClients/interface/SummaryPlotXmlParser.h"
0008 #include "DQM/SiStripCommissioningSummary/interface/SummaryPlot.h"
0009 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0010 #include "FWCore/Framework/interface/EventSetup.h"
0011 #include "FWCore/Framework/interface/Event.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "DQMServices/Core/interface/DQMStore.h"
0014 #include <string>
0015 #include <vector>
0016 #include <map>
0017 
0018 class CommissioningHistograms;
0019 class TH1;
0020 
0021 /**
0022    @class SiStripCommissioningOfflineClient 
0023    @author M.Wingham, R.Bainbridge
0024    
0025    @brief Class which reads a root file containing "commissioning
0026    histograms", analyzes the histograms to extract "monitorables", and
0027    creates summary histograms.
0028 */
0029 class SiStripCommissioningOfflineClient : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns> {
0030 public:
0031   typedef dqm::harvesting::MonitorElement MonitorElement;
0032   typedef dqm::harvesting::DQMStore DQMStore;
0033 
0034   SiStripCommissioningOfflineClient(const edm::ParameterSet&);
0035   ~SiStripCommissioningOfflineClient() override;
0036 
0037   void beginRun(const edm::Run&, const edm::EventSetup&) override;
0038   void endRun(const edm::Run&, const edm::EventSetup&) override {}
0039   void analyze(const edm::Event&, const edm::EventSetup&) override;
0040   void endJob() override;
0041 
0042 protected:
0043   virtual void createHistos(const edm::ParameterSet&, const edm::EventSetup&);
0044   virtual void uploadToConfigDb() { ; }
0045   virtual void setInputFiles(std::vector<std::string>&, const std::string, const std::string, uint32_t, bool);
0046 
0047 protected:
0048   /** DQMStore object. */
0049   DQMStore* bei_;
0050 
0051   /** Action "executor" */
0052   CommissioningHistograms* histos_;
0053 
0054   /** Input .root file. */
0055   std::vector<std::string> inputFiles_;
0056 
0057   /** Output .root file. */
0058   std::string outputFileName_;
0059 
0060   /** */
0061   bool collateHistos_;
0062 
0063   /** */
0064   bool analyzeHistos_;
0065 
0066   /** Input .xml file. */
0067   std::string xmlFile_;
0068 
0069   /** Flag. */
0070   bool createSummaryPlots_;
0071 
0072   /** */
0073   bool clientHistos_;
0074 
0075   /** */
0076   bool uploadToDb_;
0077 
0078   /** Commissioning runType. */
0079   sistrip::RunType runType_;
0080 
0081   /** Run number. */
0082   uint32_t runNumber_;
0083 
0084   /** Partition Name */
0085   std::string partitionName_;
0086 
0087   /** */
0088   typedef std::vector<TH1*> Histos;
0089 
0090   /** */
0091   typedef std::map<uint32_t, Histos> HistosMap;
0092 
0093   /** Map containing commissioning histograms. */
0094   HistosMap map_;
0095 
0096   /** SummaryPlot objects. */
0097   std::vector<SummaryPlot> plots_;
0098 
0099   /** */
0100   edm::ParameterSet parameters_;
0101 };
0102 
0103 #endif  // DQM_SiStripCommissioningClients_SiStripCommissioningOfflineClient_H