LHEReader

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
#ifndef GeneratorInterface_LHEInterface_LHEReader_h
#define GeneratorInterface_LHEInterface_LHEReader_h

#include <string>
#include <vector>
#include <memory>

#include "FWCore/ParameterSet/interface/ParameterSet.h"

namespace lhef {

  class XMLDocument;
  class LHERunInfo;
  class LHEEvent;

  class LHEReader {
  public:
    LHEReader(const edm::ParameterSet &params);
    LHEReader(const std::vector<std::string> &fileNames, unsigned int skip = 0);
    LHEReader(const std::string &inputs, unsigned int skip = 0);
    ~LHEReader();

    std::shared_ptr<LHEEvent> next(bool *newFileOpened = nullptr);

  private:
    class Source;
    class FileSource;
    class StringSource;
    class XMLHandler;

    const std::vector<std::string> fileURLs;
    const std::string strName;
    unsigned int firstEvent;
    int maxEvents;
    unsigned int curIndex;
    std::vector<std::string> weightsinconfig;

    std::unique_ptr<Source> curSource;
    std::unique_ptr<XMLDocument> curDoc;
    std::shared_ptr<LHERunInfo> curRunInfo;
    std::unique_ptr<XMLHandler> handler;
    std::shared_ptr<void> platform;
  };

}  // namespace lhef

#endif  // GeneratorInterface_LHEInterface_LHEReader_h