Go to the documentation of this file.00001 #ifndef GeneratorInterface_LHEInterface_LHEEvent_h
00002 #define GeneratorInterface_LHEInterface_LHEEvent_h
00003
00004 #include <iostream>
00005 #include <utility>
00006 #include <memory>
00007 #include <vector>
00008 #include <string>
00009
00010 #include <boost/shared_ptr.hpp>
00011
00012 #include <HepMC/GenEvent.h>
00013 #include <HepMC/GenVertex.h>
00014 #include <HepMC/PdfInfo.h>
00015
00016 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00017
00018 #include "SimDataFormats/GeneratorProducts/interface/LesHouches.h"
00019 #include "SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h"
00020
00021 #include "GeneratorInterface/LHEInterface/interface/LHERunInfo.h"
00022
00023 namespace lhef {
00024
00025 class LHEEvent {
00026 public:
00027 LHEEvent(const boost::shared_ptr<LHERunInfo> &runInfo,
00028 std::istream &in);
00029 LHEEvent(const boost::shared_ptr<LHERunInfo> &runInfo,
00030 const HEPEUP &hepeup);
00031 LHEEvent(const boost::shared_ptr<LHERunInfo> &runInfo,
00032 const HEPEUP &hepeup,
00033 const LHEEventProduct::PDF *pdf,
00034 const std::vector<std::string> &comments);
00035 LHEEvent(const boost::shared_ptr<LHERunInfo> &runInfo,
00036 const LHEEventProduct &product);
00037 ~LHEEvent();
00038
00039 typedef LHEEventProduct::PDF PDF;
00040
00041 const boost::shared_ptr<LHERunInfo> &getRunInfo() const { return runInfo; }
00042 const HEPEUP *getHEPEUP() const { return &hepeup; }
00043 const HEPRUP *getHEPRUP() const { return runInfo->getHEPRUP(); }
00044 const PDF *getPDF() const { return pdf.get(); }
00045 const std::vector<std::string> &getComments() const { return comments; }
00046
00047 void setPDF(std::auto_ptr<PDF> pdf) { this->pdf = pdf; }
00048
00049 void addComment(const std::string &line) { comments.push_back(line); }
00050
00051 static void removeParticle(lhef::HEPEUP &hepeup, int index);
00052 void removeResonances(const std::vector<int> &ids);
00053
00054 void count(LHERunInfo::CountMode count,
00055 double weight = 1.0, double matchWeight = 1.0);
00056
00057 void fillPdfInfo(HepMC::PdfInfo *info) const;
00058 void fillEventInfo(HepMC::GenEvent *hepmc) const;
00059
00060 std::auto_ptr<HepMC::GenEvent> asHepMCEvent() const;
00061
00062 static const HepMC::GenVertex *findSignalVertex(
00063 const HepMC::GenEvent *event, bool status3 = true);
00064
00065 static void fixHepMCEventTimeOrdering(HepMC::GenEvent *event);
00066
00067 private:
00068 static bool checkHepMCTree(const HepMC::GenEvent *event);
00069 HepMC::GenParticle *makeHepMCParticle(unsigned int i) const;
00070
00071 const boost::shared_ptr<LHERunInfo> runInfo;
00072
00073 HEPEUP hepeup;
00074 std::auto_ptr<PDF> pdf;
00075 std::vector<std::string> comments;
00076 bool counted;
00077 };
00078
00079 }
00080
00081 #endif // GeneratorEvent_LHEInterface_LHEEvent_h