CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LHEEvent.h
Go to the documentation of this file.
1 #ifndef GeneratorInterface_LHEInterface_LHEEvent_h
2 #define GeneratorInterface_LHEInterface_LHEEvent_h
3 
4 #include <iostream>
5 #include <utility>
6 #include <memory>
7 #include <vector>
8 #include <string>
9 
10 #include <boost/shared_ptr.hpp>
11 
12 #include <HepMC/GenEvent.h>
13 #include <HepMC/GenVertex.h>
14 #include <HepMC/PdfInfo.h>
15 
17 
20 
22 
23 namespace lhef {
24 
25 class LHEEvent {
26  public:
27  LHEEvent(const boost::shared_ptr<LHERunInfo> &runInfo,
28  std::istream &in);
29  LHEEvent(const boost::shared_ptr<LHERunInfo> &runInfo,
30  const HEPEUP &hepeup);
31  LHEEvent(const boost::shared_ptr<LHERunInfo> &runInfo,
32  const HEPEUP &hepeup,
34  const std::vector<std::string> &comments);
35  LHEEvent(const boost::shared_ptr<LHERunInfo> &runInfo,
36  const LHEEventProduct &product);
37  ~LHEEvent();
38 
40 
41  const boost::shared_ptr<LHERunInfo> &getRunInfo() const { return runInfo; }
42  const HEPEUP *getHEPEUP() const { return &hepeup; }
43  const HEPRUP *getHEPRUP() const { return runInfo->getHEPRUP(); }
44  const PDF *getPDF() const { return pdf.get(); }
45  const std::vector<std::string> &getComments() const { return comments; }
46  const int getReadAttempts() { return readAttemptCounter; }
47 
48  void setPDF(std::auto_ptr<PDF> pdf) { this->pdf = pdf; }
49 
50  void addComment(const std::string &line) { comments.push_back(line); }
51 
52  static void removeParticle(lhef::HEPEUP &hepeup, int index);
53  void removeResonances(const std::vector<int> &ids);
54 
56  double weight = 1.0, double matchWeight = 1.0);
57 
58  void attempted() { readAttemptCounter++; return; }
59 
60  void fillPdfInfo(HepMC::PdfInfo *info) const;
61  void fillEventInfo(HepMC::GenEvent *hepmc) const;
62 
63  std::auto_ptr<HepMC::GenEvent> asHepMCEvent() const;
64 
65  static const HepMC::GenVertex *findSignalVertex(
66  const HepMC::GenEvent *event, bool status3 = true);
67 
68  static void fixHepMCEventTimeOrdering(HepMC::GenEvent *event);
69 
70  private:
71  static bool checkHepMCTree(const HepMC::GenEvent *event);
72  HepMC::GenParticle *makeHepMCParticle(unsigned int i) const;
73 
74  const boost::shared_ptr<LHERunInfo> runInfo;
75 
77  std::auto_ptr<PDF> pdf;
78  std::vector<std::string> comments;
79  bool counted;
81 };
82 
83 } // namespace lhef
84 
85 #endif // GeneratorEvent_LHEInterface_LHEEvent_h
const PDF * getPDF() const
Definition: LHEEvent.h:44
int i
Definition: DBlmapReader.cc:9
HEPEUP hepeup
Definition: LHEEvent.h:76
std::vector< std::string > comments
Definition: LHEEvent.h:78
const HEPRUP * getHEPRUP() const
Definition: LHEEvent.h:43
void fillEventInfo(HepMC::GenEvent *hepmc) const
Definition: LHEEvent.cc:248
static void fixHepMCEventTimeOrdering(HepMC::GenEvent *event)
Definition: LHEEvent.cc:511
void removeResonances(const std::vector< int > &ids)
Definition: LHEEvent.cc:195
void count(LHERunInfo::CountMode count, double weight=1.0, double matchWeight=1.0)
Definition: LHEEvent.cc:206
const int getReadAttempts()
Definition: LHEEvent.h:46
const HEPEUP * getHEPEUP() const
Definition: LHEEvent.h:42
std::auto_ptr< PDF > pdf
Definition: LHEEvent.h:77
void attempted()
Definition: LHEEvent.h:58
LHEEvent(const boost::shared_ptr< LHERunInfo > &runInfo, std::istream &in)
Definition: LHEEvent.cc:36
int readAttemptCounter
Definition: LHEEvent.h:80
void addComment(const std::string &line)
Definition: LHEEvent.h:50
const std::vector< std::string > & getComments() const
Definition: LHEEvent.h:45
const boost::shared_ptr< LHERunInfo > runInfo
Definition: LHEEvent.h:74
HepMC::GenParticle * makeHepMCParticle(unsigned int i) const
Definition: LHEEvent.cc:386
static void removeParticle(lhef::HEPEUP &hepeup, int index)
Definition: LHEEvent.cc:155
void fillPdfInfo(HepMC::PdfInfo *info) const
Definition: LHEEvent.cc:220
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
LHEEventProduct::PDF PDF
Definition: LHEEvent.h:39
const boost::shared_ptr< LHERunInfo > & getRunInfo() const
Definition: LHEEvent.h:41
static const HepMC::GenVertex * findSignalVertex(const HepMC::GenEvent *event, bool status3=true)
Definition: LHEEvent.cc:447
void setPDF(std::auto_ptr< PDF > pdf)
Definition: LHEEvent.h:48
bool counted
Definition: LHEEvent.h:79
static bool checkHepMCTree(const HepMC::GenEvent *event)
Definition: LHEEvent.cc:403
std::auto_ptr< HepMC::GenEvent > asHepMCEvent() const
Definition: LHEEvent.cc:256
int weight
Definition: histoStyle.py:50