Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:33:17

0001 #ifndef TauDQMFileLoader_h
0002 #define TauDQMFileLoader_h
0003 
0004 /** \class TauDQMFileLoader
0005  *  
0006  *  Class to load DQM monitoring elements from ROOT files into DQMStore --> hanged name to avoid conflict with TauAnalysis package
0007  *
0008  *  \author Christian Veelken, UC Davis
0009  */
0010 
0011 // framework & common header files
0012 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "FWCore/Framework/interface/EventSetup.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018 
0019 #include <TH1.h>
0020 
0021 #include <vector>
0022 #include <string>
0023 
0024 class TauDQMFileLoader : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns> {
0025   typedef dqm::legacy::DQMStore DQMStore;
0026   typedef dqm::legacy::MonitorElement MonitorElement;
0027 
0028   typedef std::vector<std::string> vstring;
0029   typedef std::set<std::string> sstring;
0030 
0031   struct cfgEntryFileSet {
0032     cfgEntryFileSet(const std::string&, const edm::ParameterSet&);
0033     void print() const;
0034     std::string name_;
0035     vstring inputFileNames_;
0036     double scaleFactor_;
0037     std::string dqmDirectory_store_;
0038   };
0039 
0040 public:
0041   explicit TauDQMFileLoader(const edm::ParameterSet&);
0042   ~TauDQMFileLoader() override;
0043   void analyze(const edm::Event&, const edm::EventSetup&) override;
0044   void beginRun(const edm::Run& r, const edm::EventSetup& c) override {}
0045   void endRun(const edm::Run& r, const edm::EventSetup& c) override;
0046 
0047 private:
0048   std::map<std::string, cfgEntryFileSet> fileSets_;
0049   std::map<std::string, sstring> subDirectoryMap_;
0050   int cfgError_;
0051 };
0052 
0053 #endif