4 #ifndef EPOS_EntriesAllocation 5 #define EPOS_EntriesAllocation 99900 6 #endif // EPOS_EntriesAllocation 9 #ifndef HEPMC_EPOS_COMMON_H 10 #define HEPMC_EPOS_COMMON_H 70 #ifdef _WIN32 // Platform: Windows MS Visual C++ 74 extern "C" HEPCOM_DEF HEPCOM;
83 #define hepcom hepcom_ 87 #endif // HEPMC_EPOS_COMMON_H 90 #ifndef HEPMC_EPOS_WRAPPER_H 91 #define HEPMC_EPOS_WRAPPER_H 154 static double e(
int index);
155 static double m(
int index);
156 static double x(
int index);
157 static double y(
int index);
158 static double z(
int index);
159 static double t(
int index);
221 if (size !=
sizeof(
short int) && size !=
sizeof(
long int) && size !=
sizeof(
int)) {
222 std::cerr <<
"HepMC is not able to handle integers " 223 <<
" of size other than 2 or 4." 224 <<
" You requested: " << size << std::endl;
230 if (size !=
sizeof(
float) && size !=
sizeof(
double)) {
231 std::cerr <<
"HepMC is not able to handle floating point numbers" 232 <<
" of size other than 4 or 8." 233 <<
" You requested: " << size << std::endl;
242 std::cerr <<
"EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
244 float* myfloat = (
float*)&
hepcom.data[
b];
245 return (
double)(*myfloat);
247 double* mydouble = (
double*)&
hepcom.data[
b];
257 std::cerr <<
"EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
259 short int* myshortint = (
short int*)&
hepcom.data[
b];
260 return (
int)(*myshortint);
262 long int* mylongint = (
long int*)&
hepcom.data[
b];
266 int* myint = (
int*)&
hepcom.data[
b];
276 std::cerr <<
"EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
278 float* myfloat = (
float*)&
hepcom.data[
b];
281 double* mydouble = (
double*)&
hepcom.data[
b];
282 (*mydouble) = (double)
in;
290 std::cerr <<
"EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
292 short int* myshortint = (
short int*)&
hepcom.data[
b];
293 (*myshortint) = (
short int)
in;
295 long int* mylongint = (
long int*)&
hepcom.data[
b];
296 (*mylongint) = (
int)
in;
299 int* myint = (
int*)&
hepcom.data[
b];
490 ostr <<
"________________________________________" 491 <<
"________________________________________" << std::endl;
497 ostr <<
"________________________________________" 498 <<
"________________________________________" << std::endl;
502 ostr <<
"________________________________________" 503 <<
"________________________________________" << std::endl;
509 "%4d %+4d %4d %4d (%9.3g, %9.3g, %9.3g, %9.3g, %9.3g)",
519 ostr << outline <<
"\n";
521 "%+9d %4d %4d (%9.3g, %9.3g, %9.3g, %9.3g)",
530 ostr << outline << std::endl;
536 "%4s %4s %4s %5s %10s, %9s, %9s, %9s, %10s",
546 ostr << outline << std::endl;
548 outline,
"%9s %4s %4s %10s, %9s, %9s, %9s) %9s",
"ID ",
"ents",
"dren",
"Prod ( X",
"Y",
"Z",
"cT",
"[mm]");
549 ostr << outline << std::endl;
554 #endif // HEPMC_EPOS_WRAPPER_H
static void zero_everything()
set all entries in EPOS to zero
static void set_children(int index, int firstchild, int lastchild)
define children of a particle
static void set_mass(int index, double mass)
set particle mass
static double m(int index)
generated mass
static void set_status(int index, int status)
set particle status
static void set_sizeof_real(unsigned int)
define size of real
static void print_hepcom(std::ostream &ostr=std::cout)
write information from EPOS common block
static void set_id(int index, int id)
set particle ID
static void write_byte_num(double, unsigned int)
pretend common block is an array of bytes
static double e(int index)
Energy.
static double t(int index)
production time
static void set_number_entries(int noentries)
set number of entries in EPOS
static int number_parents(int index)
number of parents
static void set_event_number(int evtno)
set event number
#define EPOS_EntriesAllocation
static void set_momentum(int index, double px, double py, double pz, double e)
set particle momentum
static int first_child(int index)
index of 1st daughter
static int first_parent(int index)
index of 1st mother
static double y(int index)
Y Production vertex.
static double py(int index)
Y momentum.
static unsigned int sizeof_int()
size of integer in bytes
static int event_number()
event number
static void set_max_number_entries(unsigned int)
define size of common block
Generic Wrapper for the fortran EPOS common block.
static int status(int index)
status code
static void set_position(int index, double x, double y, double z, double t)
set particle production vertex
static int number_entries()
num entries in current evt
static unsigned int s_max_number_entries
static double byte_num_to_double(unsigned int)
navigate a byte array
static double pz(int index)
Z momentum.
static void print_hepcom_particle(int index, std::ostream &ostr=std::cout)
write particle information to ostr
static double z(int index)
Z Production vertex.
static int number_children(int index)
number of children
static int byte_num_to_int(unsigned int)
navigate a byte array
static int id(int index)
PDG particle id.
static int max_number_entries()
size of common block
static unsigned int s_sizeof_real
const unsigned int epos_bytes_allocation
static void print_legend(std::ostream &ostr=std::cout)
print output legend
char data[epos_bytes_allocation]
static int last_child(int index)
index of last daughter
static unsigned int sizeof_real()
size of real in bytes
static int last_parent(int index)
index of last mother
static double x(int index)
X Production vertex.
static double px(int index)
X momentum.
static void set_parents(int index, int firstparent, int lastparent)
define parents of a particle
static void set_sizeof_int(unsigned int)
define size of integer
static unsigned int s_sizeof_int