28 for (
int nn=n; nn>0; --nn)
42 m_hepr = std::make_shared<HEPRUPAttribute>();
57 std::make_shared<FloatAttribute>(
m_hepr->heprup.NPRUP));
62 std::vector<std::string> weightnames;
63 weightnames.push_back(
"0");
65 for (
int i = 0, N =
m_hepr->heprup.weightinfo.size(); i < N; ++i )
66 weightnames.push_back(
m_hepr->heprup.weightNameHepMC(i));
67 run_info()->set_weight_names(weightnames);
71 for (
int i = 0, N =
m_hepr->heprup.generators.size(); i < N; ++i )
91 std::shared_ptr<HEPEUPAttribute> hepe = std::make_shared<HEPEUPAttribute>();
101 std::make_shared<DoubleAttribute>(hepe->hepeup.AQCDUP));
103 std::make_shared<DoubleAttribute>(hepe->hepeup.AQEDUP));
105 std::make_shared<IntAttribute>(hepe->hepeup.NUP));
107 std::make_shared<LongAttribute>(hepe->hepeup.IDPRUP));
110 GenParticlePtr p1 = std::make_shared<GenParticle>(hepe->momentum(0),
111 hepe->hepeup.IDUP[0],
112 hepe->hepeup.ISTUP[0]);
113 GenParticlePtr p2 = std::make_shared<GenParticle>(hepe->momentum(1),
114 hepe->hepeup.IDUP[1],
115 hepe->hepeup.ISTUP[1]);
116 GenVertexPtr vx = std::make_shared<GenVertex>();
117 vx->add_particle_in(p1);
118 vx->add_particle_in(p2);
120 for (
int i = 2; i < hepe->hepeup.NUP; ++i )
121 vx->add_particle_out(std::make_shared<GenParticle>
123 hepe->hepeup.IDUP[i],
124 hepe->hepeup.ISTUP[i]));
127 std::vector<double> wts;
128 for (
int i = 0, N = hepe->hepeup.weights.size(); i < N; ++i )
129 wts.push_back(hepe->hepeup.weights[i].first);
Definition of class ReaderLHEF.
Stores event-related information.
void add_vertex(GenVertexPtr v)
Add vertex.
void set_event_number(const int &num)
Set event number.
void add_attribute(const std::string &name, const std::shared_ptr< Attribute > &att, const int &id=0)
Add event attribute to event.
const std::vector< double > & weights() const
Get event weight values as a vector.
void clear()
Remove contents of this event.
bool failed() override
State.
LHEF::Reader * m_reader
The actual reader.
bool read_event(GenEvent &ev) override
Reading event.
bool skip(const int) override
skip events
std::shared_ptr< HEPRUPAttribute > m_hepr
Holder of attributes.
void close() override
Close.
bool m_failed
State of reader.
ReaderLHEF(std::istream &)
The ctor to read from stream.
std::shared_ptr< GenRunInfo > run_info() const
Get the global GenRunInfo object.
void set_run_info(std::shared_ptr< GenRunInfo > run)
Set the global GenRunInfo object.
static std::vector< XMLTag * > findXMLTags(std::string str, std::string *leftover=0)