11#ifndef PYTHIA6_PYTHIA6TOHEPMC3_CC
12#define PYTHIA6_PYTHIA6TOHEPMC3_CC
13#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32)) && !defined(__CYGWIN__)
14#define hepmc3_delete_writer_ HEPMC3_DELETE_WRITER
15#define hepmc3_convert_event_ HEPMC3_CONVERT_EVENT
16#define hepmc3_clear_event_ HEPMC3_CLEAR_EVENT
17#define hepmc3_write_event_ HEPMC3_WRITE_EVENT
18#define hepmc3_set_cross_section_ HEPMC3_SET_CROSS_SECTION
19#define hepmc3_set_pdf_info_ HEPMC3_SET_PDF_INFO
20#define hepmc3_set_event_number_ HEPMC3_SET_EVENT_NUMBER
21#define hepmc3_set_hepevt_address_ HEPMC3_SET_HEPEVT_ADDRESS
22#define hepmc3_set_attribute_int_ HEPMC3_SET_ATTRIBUTE_INT
23#define hepmc3_set_attribute_double_ HEPMC3_SET_ATTRIBUTE_DOUBLE
24#define hepmc3_new_writer_ HEPMC3_NEW_WRITER
25#define hepmc3_new_weight_ HEPMC3_NEW_WEIGHT
26#define hepmc3_set_weight_by_index_ HEPMC3_SET_WEIGHT_BY_INDEX
27#define hepmc3_set_weight_by_name_ HEPMC3_SET_WEIGHT_BY_NAME
29#ifdef DUMMYPYTHIA6TOHEPMC3
36 int hepmc3_convert_event_(
const int & position)
40 int hepmc3_write_event_(
const int & position)
44 int hepmc3_clear_event_(
const int & position)
48 int hepmc3_set_cross_section_(
const int & position,
const double& x,
const double& xe,
const int& n1,
const int& n2)
53 int hepmc3_set_pdf_info_(
const int & position,
const int& parton_id1,
const int& parton_id2,
const double& x1,
const double& x2,
54 const double& scale_in,
const double& xf1,
const double& xf2,
55 const int& pdf_id1,
const int& pdf_id2)
59 int hepmc3_set_hepevt_address_(
int* a)
63 int hepmc3_set_attribute_int_(
const int & position,
const int & attval,
const char* attname,
size_t)
67 int hepmc3_set_attribute_double_(
const int & position,
const double & attval,
const char* attname,
size_t)
71 int hepmc3_new_writer_(
const int & position,
const int & mode,
const char* ffilename,
size_t)
75 int hepmc3_new_weight_(
const int & position,
const char* name,
size_t)
79 int hepmc3_set_weight_by_index_(
const int & position,
const double& val,
const int & pos,
size_t)
83 int hepmc3_set_weight_by_name_(
const int & position,
const double& val,
const char* name,
size_t)
102#ifndef PYTHIA6HEPEVTSIZE
103#define PYTHIA6HEPEVTSIZE 10000
115 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
126 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
134 int hepmc3_convert_event_(
const int & position)
137 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
142 printf(
"Error in %s: HEPEVT block does not exist\n", __FUNCTION__);
157 int hepmc3_write_event_(
const int & position)
160 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
166 int hepmc3_clear_event_(
const int & position)
169 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
175 int hepmc3_set_cross_section_(
const int & position,
const double& x,
const double& xe,
const int& n1,
const int& n2)
178 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
181 GenCrossSectionPtr cs = std::make_shared< GenCrossSection>();
182 cs->set_cross_section(x, xe, n1, n2);
187 int hepmc3_set_pdf_info_(
const int & position,
const int& parton_id1,
const int& parton_id2,
const double& x1,
const double& x2,
188 const double& scale_in,
const double& xf1,
const double& xf2,
189 const int& pdf_id1,
const int& pdf_id2)
192 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
195 GenPdfInfoPtr pdf=std::make_shared< GenPdfInfo>();
196 pdf->set(parton_id1, parton_id2, x1, x2, scale_in, xf1, xf2, pdf_id1, pdf_id2);
200 int hepmc3_set_hepevt_address_(
int* a)
202 printf(
"Info in %s: setting /hepevt/ block adress\n", __FUNCTION__);
206 int hepmc3_set_attribute_int_(
const int & position,
const int & attval,
const char* attname,
size_t)
209 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
212 hepmc3_gWriters[position].second->add_attribute(attname, std::make_shared<IntAttribute>(attval));
215 int hepmc3_set_attribute_double_(
const int & position,
const double & attval,
const char* attname,
size_t)
218 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
221 hepmc3_gWriters[position].second->add_attribute(attname, std::make_shared<DoubleAttribute>(attval));
225 int hepmc3_new_writer_(
const int & position,
const int & mode,
const char* ffilename,
size_t)
227 std::string libHepMC3rootIO=
"libHepMC3rootIO.so";
229 libHepMC3rootIO=
"libHepMC3rootIO.dylib";
232 libHepMC3rootIO=
"HepMC3rootIO.dll";
234 std::string filename(ffilename);
235 int r_position=position;
242 printf(
"Error in %s: Writer at position %i already exists\n", __FUNCTION__, r_position);
246 printf(
"Warning in %s: RunInfo at position %i already exists\n", __FUNCTION__, r_position);
271 printf(
"Error in %s:Output format %d is unknown or not supported.\n", __FUNCTION__, mode);
277 int hepmc3_new_weight_(
const int & position,
const char* name,
size_t)
280 printf(
"Warning in %s: RunInfo at position %i does not exist\n", __FUNCTION__, position);
285 weight_names.emplace_back(name);
290 int hepmc3_set_weight_by_index_(
const int & position,
const double& val,
const int & index)
293 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
296 if (
hepmc3_gWriters[position].second->weights().size() < (
unsigned long int)index) {
297 printf(
"Warning in %s: Event has no weight with index %i\n", __FUNCTION__, index);
303 int hepmc3_set_weight_by_name_(
const int & position,
const double& val,
const char* name,
size_t)
306 printf(
"Warning in %s: Writer at position %i does not exist\n", __FUNCTION__, position);
309 hepmc3_new_weight_(position, name, strlen(name));
Definition of class Attribute, class IntAttribute and class StringAttribute.
Definition of class GenEvent.
Definition of class GenRunInfo.
Definition of class HEPEVT_Wrapper_Template.
Definition of static class Print.
GenEvent * hepmc3_gWriters_get_event(const int &position)
std::map< int, std::pair< std::shared_ptr< Writer >, GenEvent * > > hepmc3_gWriters
std::map< int, std::shared_ptr< GenRunInfo > > hepmc3_gGenRunInfos
int hepmc3_delete_writer_(const int &position)
HEPEVT_Wrapper_Template< PYTHIA6HEPEVTSIZE > hepmc3_gInterface
Definition of class WriterAsciiHepMC2.
Definition of class WriterAscii.
Definition of class WriterHEPEVT.
Definition of class WriterPlugin.
Definition of interface Writer.
Stores event-related information.
An interface to HEPEVT common block implemented as template class.