RivetHepMC.hh
Go to the documentation of this file.00001
00002 #ifndef RIVET_RivetHepMC_HH
00003 #define RIVET_RivetHepMC_HH
00004
00005 #include "HepMC/GenEvent.h"
00006 #include "HepMC/GenParticle.h"
00007 #include "HepMC/GenVertex.h"
00008
00009 #include <vector>
00010
00011 namespace Rivet {
00012
00013
00014 using HepMC::GenEvent;
00015 using HepMC::GenParticle;
00016 using HepMC::GenVertex;
00017
00018
00019 inline vector<GenParticle*> particles(const GenEvent& ge) {
00020 vector<GenParticle*> rtn;
00021 for (GenEvent::particle_const_iterator pi = ge.particles_begin(); pi != ge.particles_end(); ++pi) {
00022 rtn.push_back(*pi);
00023 }
00024 return rtn;
00025 }
00026 inline vector<GenParticle*> particles(const GenEvent* ge) {
00027 assert(ge);
00028 return particles(*ge);
00029 }
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 inline vector<GenVertex*> vertices(const GenEvent& ge) {
00040 vector<GenVertex*> rtn;
00041 for (GenEvent::vertex_const_iterator vi = ge.vertices_begin(); vi != ge.vertices_end(); ++vi) {
00042 rtn.push_back(*vi);
00043 }
00044 return rtn;
00045 }
00046 inline vector<GenVertex*> vertices(const GenEvent* ge) {
00047 assert(ge);
00048 return vertices(*ge);
00049 }
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 inline const std::pair<GenVertex::particles_in_const_iterator, GenVertex::particles_in_const_iterator> particles_in(const GenVertex* gv) {
00060 return make_pair(gv->particles_in_const_begin(), gv->particles_in_const_end());
00061 }
00062
00063
00064 inline const std::pair<GenVertex::particles_out_const_iterator, GenVertex::particles_out_const_iterator> particles_out(const GenVertex* gv) {
00065 return make_pair(gv->particles_out_const_begin(), gv->particles_out_const_end());
00066 }
00067
00068
00069 inline vector<GenParticle*> particles(GenVertex* gv, HepMC::IteratorRange range=HepMC::relatives) {
00070 vector<GenParticle*> rtn;
00071 for (GenVertex::particle_iterator pi = gv->particles_begin(range); pi != gv->particles_end(range); ++pi) {
00072 rtn.push_back(*pi);
00073 }
00074 return rtn;
00075 }
00076
00077
00078
00079
00080
00081 }
00082
00083 #endif