#include <iomanip>
using namespace HepMC3;
int main(
int ,
char ** ) {
std::shared_ptr<HEPRUPAttribute> hepr = std::make_shared<HEPRUPAttribute>();
std::shared_ptr<GenRunInfo> runinfo = std::make_shared<GenRunInfo>();
runinfo->add_attribute("HEPRUP", hepr);
runinfo->add_attribute("NPRUP",
std::make_shared<FloatAttribute>(hepr->heprup.NPRUP));
std::vector<std::string> weightnames;
weightnames.push_back("0");
for ( int i = 0, N = hepr->heprup.weightinfo.size(); i < N; ++i )
weightnames.push_back(hepr->heprup.weightNameHepMC(i));
runinfo->set_weight_names(weightnames);
for ( int i = 0, N = hepr->heprup.generators.size(); i < N; ++i ) {
tool.
name = hepr->heprup.generators[i].name;
tool.
version = hepr->heprup.generators[i].version;
tool.
description = hepr->heprup.generators[i].contents;
runinfo->tools().push_back(tool);
}
int neve = 0;
++neve;
std::shared_ptr<HEPEUPAttribute> hepe = std::make_shared<HEPEUPAttribute>();
GenEvent ev(runinfo, Units::GEV, Units::MM);
std:: make_shared<DoubleAttribute>(hepe->hepeup.AQCDUP));
std::make_shared<DoubleAttribute>(hepe->hepeup.AQEDUP));
std::make_shared<IntAttribute>(hepe->hepeup.NUP));
std::make_shared<LongAttribute>(hepe->hepeup.IDPRUP));
std::vector<GenParticlePtr> particles;
std::map< std::pair<int,int>, GenVertexPtr> vertices;
for ( int i = 0; i < hepe->hepeup.NUP; ++i )
{
particles.push_back(std::make_shared<GenParticle>(hepe->momentum(i),hepe->hepeup.IDUP[i],hepe->hepeup.ISTUP[i]));
if (i<2) continue;
std::pair<int,int> vertex_index(hepe->hepeup.MOTHUP[i].first,hepe->hepeup.MOTHUP[i].second);
if (vertices.find(vertex_index)==vertices.end())vertices[vertex_index]=std::make_shared<GenVertex>();
vertices[vertex_index]->add_particle_out(particles.back());
}
for ( auto v: vertices )
{
std::pair<int,int> vertex_index=v.first;
GenVertexPtr vertex=v.second;
for (int i=vertex_index.first-1; i<vertex_index.second; i++) if (i>=0&&i<particles.size()) vertex->add_particle_in(particles[i]);
}
std::vector<double> wts;
for ( int i = 0, N = hepe->hepeup.weights.size(); i < N; ++i )
wts.push_back(hepe->hepeup.weights[i].first);
std::make_shared<AssociatedParticle>(particles[1]), particles[0]->id());
}
hepr = std::shared_ptr<HEPRUPAttribute>();
while ( true ) {
std::shared_ptr<AssociatedParticle> assoc =
if ( !assoc || !assoc->associated() ||
assoc->associated() != ev.
particles()[1] )
return 3;
if ( input.
run_info()->weight_names() != weightnames )
return 2;
if ( !hepr ) {
for ( int i = 0, N = hepr->tags.size(); i < N; ++i )
if ( hepr->tags[i]->name != "init" )
hepr->heprup.NPRUP =
attribute<FloatAttribute>("NPRUP")->value());
}
}
std::shared_ptr<HEPEUPAttribute> hepe =
for ( int i = 0, N = hepe->tags.size(); i < N; ++i )
if ( hepe->tags[i]->name != "event" &&
hepe->tags[i]->name != "eventgroup" )
hepe->hepeup.AQCDUP =
hepe->hepeup.AQEDUP =
hepe->hepeup.NUP =
hepe->hepeup.IDPRUP =
}
}