LHAupLesHouches

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 48 49 50
#include <algorithm>
#include <iostream>
#include <iterator>
#include <sstream>
#include <string>
#include <memory>
#include <cassert>

#include "HepMC/GenEvent.h"
#include "HepMC/GenParticle.h"

#include "Pythia8/Pythia.h"
#include "Pythia8/LesHouches.h"
//#include "Pythia8Plugins/HepMC2.h"

#include "SimDataFormats/GeneratorProducts/interface/LesHouches.h"
#include "GeneratorInterface/LHEInterface/interface/LHERunInfo.h"
#include "GeneratorInterface/LHEInterface/interface/LHEEvent.h"

class LHAupLesHouches : public Pythia8::LHAup {
public:
  LHAupLesHouches() : setScalesFromLHEF_(false), fEvAttributes(nullptr) { ; }

  //void loadRunInfo(const std::shared_ptr<lhef::LHERunInfo> &runInfo)
  void loadRunInfo(lhef::LHERunInfo* runInfo) { this->runInfo = runInfo; }

  //void loadEvent(const std::shared_ptr<lhef::LHEEvent> &event)
  void loadEvent(lhef::LHEEvent* event) { this->event = event; }

  void setScalesFromLHEF(bool b) { setScalesFromLHEF_ = b; }

  ~LHAupLesHouches() override {
    if (fEvAttributes)
      delete fEvAttributes;
  }

private:
  bool setInit() override;
  bool setEvent(int idProcIn) override;

  //std::shared_ptr<lhef::LHERunInfo> runInfo;
  lhef::LHERunInfo* runInfo;
  //std::shared_ptr<lhef::LHEEvent>	event;
  lhef::LHEEvent* event;

  // Flag to set particle production scales or not.
  bool setScalesFromLHEF_;

  std::map<std::string, std::string>* fEvAttributes;
};