Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:15

0001 #ifndef GeneratorInterface_LHEInterface_LH5Source_h
0002 #define GeneratorInterface_LHEInterface_LH5Source_h
0003 
0004 #include <memory>
0005 
0006 #include <deque>
0007 
0008 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
0009 #include "GeneratorInterface/LHEInterface/plugins/LHEProvenanceHelper.h"
0010 #include "FWCore/Sources/interface/ProducerSourceFromFiles.h"
0011 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0012 
0013 #include "SimDataFormats/GeneratorProducts/interface/LesHouches.h"
0014 
0015 namespace lhef {
0016   class LHERunInfo;
0017   class LHEEvent;
0018   class LH5Reader;
0019 }  // namespace lhef
0020 
0021 namespace edm {
0022   class EventPrincipal;
0023   class LuminosityBlockAuxiliary;
0024   class LuminosityBlockPrincipal;
0025   class ParameterSet;
0026   class Run;
0027   class RunAuxiliary;
0028   class RunPrincipal;
0029 }  // namespace edm
0030 
0031 class LHERunInfoProduct;
0032 
0033 class LH5Source : public edm::ProducerSourceFromFiles {
0034 public:
0035   explicit LH5Source(const edm::ParameterSet& params, const edm::InputSourceDescription& desc);
0036   ~LH5Source() override;
0037 
0038   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0039 
0040 private:
0041   void endJob() override;
0042   bool setRunAndEventInfo(edm::EventID&, edm::TimeValue_t&, edm::EventAuxiliary::ExperimentType&) override;
0043   void readRun_(edm::RunPrincipal& runPrincipal) override;
0044   void readLuminosityBlock_(edm::LuminosityBlockPrincipal& lumiPrincipal) override;
0045   void readEvent_(edm::EventPrincipal& eventPrincipal) override;
0046   void produce(edm::Event&) override {}
0047   std::shared_ptr<edm::RunAuxiliary> readRunAuxiliary_() override;
0048   std::shared_ptr<edm::LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_() override;
0049 
0050   void nextEvent();
0051 
0052   void putRunInfoProduct(edm::RunPrincipal&);
0053   void fillRunInfoProduct(lhef::LHERunInfo const&, LHERunInfoProduct&);
0054 
0055   std::unique_ptr<lhef::LH5Reader> reader_;
0056 
0057   std::shared_ptr<lhef::LHERunInfo> runInfoLast_;
0058   std::shared_ptr<lhef::LHEEvent> partonLevel_;
0059 
0060   std::unique_ptr<LHERunInfoProduct> runInfoProductLast_;
0061   edm::LHEProvenanceHelper lheProvenanceHelper_;
0062   edm::ProcessHistoryID phid_;
0063 };
0064 
0065 #endif  // GeneratorInterface_LHEInterface_LH5Source_h