Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-25 23:59:50

0001 #ifndef HLTcore_HLTPrescaleRecorder_h
0002 #define HLTcore_HLTPrescaleRecorder_h
0003 
0004 /** \class HLTPrescaleRecorder
0005  *
0006  *  
0007  *  This class is an EDProducer making the HLTPrescaleTable object
0008  *
0009  *
0010  *  \author Martin Grunewald
0011  *
0012  */
0013 
0014 #include "FWCore/Framework/interface/Run.h"
0015 #include "FWCore/Framework/interface/LuminosityBlock.h"
0016 #include "FWCore/Framework/interface/Event.h"
0017 #include "FWCore/Framework/interface/EventSetup.h"
0018 #include "FWCore/Framework/interface/one/EDProducer.h"
0019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0020 
0021 #include "FWCore/ServiceRegistry/interface/Service.h"
0022 #include "FWCore/PrescaleService/interface/PrescaleService.h"
0023 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0024 
0025 #include "DataFormats/Common/interface/Handle.h"
0026 #include "FWCore/Framework/interface/ESHandle.h"
0027 
0028 #include "DataFormats/HLTReco/interface/HLTPrescaleTable.h"
0029 #include "CondFormats/HLTObjects/interface/HLTPrescaleTableCond.h"
0030 #include "CondFormats/DataRecord/interface/HLTPrescaleTableRcd.h"
0031 
0032 #include <map>
0033 #include <string>
0034 #include <vector>
0035 
0036 namespace edm {
0037   class ConfigurationDescriptions;
0038 }
0039 
0040 //
0041 // class declaration
0042 //
0043 
0044 class HLTPrescaleRecorder : public edm::one::EDProducer<edm::EndRunProducer,
0045                                                         edm::EndLuminosityBlockProducer,
0046                                                         edm::one::WatchRuns,
0047                                                         edm::one::WatchLuminosityBlocks> {
0048 public:
0049   explicit HLTPrescaleRecorder(const edm::ParameterSet&);
0050   ~HLTPrescaleRecorder() override;
0051   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0052   void beginRun(edm::Run const& iRun, const edm::EventSetup& iSetup) final;
0053   void endRun(edm::Run const& iRun, const edm::EventSetup& iSetup) final;
0054   void endRunProduce(edm::Run& iRun, const edm::EventSetup& iSetup) final;
0055   void beginLuminosityBlock(edm::LuminosityBlock const& iLumi, const edm::EventSetup& iSetup) final;
0056   void endLuminosityBlock(edm::LuminosityBlock const& iLumi, const edm::EventSetup& iSetup) final;
0057   void endLuminosityBlockProduce(edm::LuminosityBlock& iLumi, const edm::EventSetup& iSetup) final;
0058   void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) final;
0059 
0060 private:
0061   /// (Single) source: -1:PrescaleServicePSet 0:PrescaleService,
0062   /// 1:Run, 2:Lumi, 3:Event, 4:CondDB
0063   int src_;
0064 
0065   /// (Multiple) Destinations
0066   bool run_;
0067   bool lumi_;
0068   bool event_;
0069   bool condDB_;
0070 
0071   /// Source configs
0072   /// name of PrescaleServicePSet (src=-1)
0073   std::string psetName_;
0074   /// InputTag   of HLTPrescaleTable product (src=1,2,3)
0075   edm::InputTag hltInputTag_;
0076   /// InputToken of HLTPrescaleTable product (src=1,2,3)
0077   edm::EDGetTokenT<trigger::HLTPrescaleTable> hltInputToken_;
0078   /// Tag of DB entry (HLT Key Name) (src=4)
0079   std::string hltDBTag_;
0080   edm::ESGetToken<trigger::HLTPrescaleTableCond, HLTPrescaleTableRcd> const hltPrescaleTableCondToken_;
0081 
0082   /// Prescale service
0083   edm::service::PrescaleService* ps_;
0084   /// Pool DB service
0085   cond::service::PoolDBOutputService* db_;
0086 
0087   /// Handle and ESHandle for existing HLT object
0088   edm::Handle<trigger::HLTPrescaleTable> hltHandle_;
0089 
0090   /// payload HLT object
0091   trigger::HLTPrescaleTable hlt_;
0092 };
0093 #endif