Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-19 00:58:37

0001 #include <algorithm>
0002 #include <iostream>
0003 #include <iterator>
0004 #include <sstream>
0005 #include <string>
0006 #include <memory>
0007 #include <cassert>
0008 
0009 #include "HepMC/GenEvent.h"
0010 #include "HepMC/GenParticle.h"
0011 
0012 #include "Pythia8/Pythia.h"
0013 #include "Pythia8/LesHouches.h"
0014 //#include "Pythia8Plugins/HepMC2.h"
0015 
0016 #include "SimDataFormats/GeneratorProducts/interface/LesHouches.h"
0017 #include "GeneratorInterface/LHEInterface/interface/LHERunInfo.h"
0018 #include "GeneratorInterface/LHEInterface/interface/LHEEvent.h"
0019 
0020 class LHAupLesHouches : public Pythia8::LHAup {
0021 public:
0022   LHAupLesHouches() : setScalesFromLHEF_(false), fEvAttributes(nullptr) { ; }
0023 
0024   //void loadRunInfo(const std::shared_ptr<lhef::LHERunInfo> &runInfo)
0025   void loadRunInfo(lhef::LHERunInfo* runInfo) { this->runInfo = runInfo; }
0026 
0027   //void loadEvent(const std::shared_ptr<lhef::LHEEvent> &event)
0028   void loadEvent(lhef::LHEEvent* event) { this->event = event; }
0029 
0030   void setScalesFromLHEF(bool b) { setScalesFromLHEF_ = b; }
0031 
0032   ~LHAupLesHouches() override {
0033     if (fEvAttributes)
0034       delete fEvAttributes;
0035   }
0036 
0037 private:
0038   bool setInit() override;
0039   bool setEvent(int idProcIn) override;
0040 
0041   //std::shared_ptr<lhef::LHERunInfo> runInfo;
0042   lhef::LHERunInfo* runInfo;
0043   //std::shared_ptr<lhef::LHEEvent> event;
0044   lhef::LHEEvent* event;
0045 
0046   // Flag to set particle production scales or not.
0047   bool setScalesFromLHEF_;
0048 
0049   std::map<std::string, std::string>* fEvAttributes;
0050 };