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;
81 #define hepcom hepcom_
85 #endif // HEPMC_EPOS_COMMON_H
88 #ifndef HEPMC_EPOS_WRAPPER_H
89 #define HEPMC_EPOS_WRAPPER_H
141 static int status(
int index);
142 static int id(
int index);
149 static double px(
int index);
150 static double py(
int index);
151 static double pz(
int index);
152 static double e(
int index);
153 static double m(
int index);
154 static double x(
int index);
155 static double y(
int index);
156 static double z(
int index);
157 static double t(
int index);
168 static void set_status(
int index,
int status);
170 static void set_id(
int index,
int id);
172 static void set_parents(
int index,
int firstparent,
int lastparent);
174 static void set_children(
int index,
int firstchild,
int lastchild);
176 static void set_momentum(
int index,
double px,
double py,
double pz,
double e);
180 static void set_position(
int index,
double x,
double y,
double z,
double t);
219 if (size !=
sizeof(
short int) && size !=
sizeof(
long int) && size !=
sizeof(
int)) {
220 std::cerr <<
"HepMC is not able to handle integers "
221 <<
" of size other than 2 or 4."
222 <<
" You requested: " << size << std::endl;
228 if (size !=
sizeof(
float) && size !=
sizeof(
double)) {
229 std::cerr <<
"HepMC is not able to handle floating point numbers"
230 <<
" of size other than 4 or 8."
231 <<
" You requested: " << size << std::endl;
240 std::cerr <<
"EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
242 float* myfloat = (
float*)&
hepcom.data[b];
243 return (
double)(*myfloat);
245 double* mydouble = (
double*)&
hepcom.data[b];
255 std::cerr <<
"EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
257 short int* myshortint = (
short int*)&
hepcom.data[b];
258 return (
int)(*myshortint);
260 long int* mylongint = (
long int*)&
hepcom.data[b];
264 int* myint = (
int*)&
hepcom.data[b];
274 std::cerr <<
"EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
276 float* myfloat = (
float*)&
hepcom.data[b];
277 (*myfloat) = (float)in;
279 double* mydouble = (
double*)&
hepcom.data[b];
280 (*mydouble) = (double)in;
288 std::cerr <<
"EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
290 short int* myshortint = (
short int*)&
hepcom.data[b];
291 (*myshortint) = (
short int)in;
293 long int* mylongint = (
long int*)&
hepcom.data[b];
294 (*mylongint) = (int)in;
297 int* myint = (
int*)&
hepcom.data[b];
338 return (parent > firstparent && parent <=
number_entries()) ? parent : firstparent;
343 return (firstparent > 0) ? (1 +
last_parent(index) - firstparent) : 0;
363 return (child > firstchild && child <=
number_entries()) ? child : firstchild;
368 return (firstchild > 0) ? (1 +
last_child(index) - firstchild) : 0;
488 ostr <<
"________________________________________"
489 <<
"________________________________________" << std::endl;
495 ostr <<
"________________________________________"
496 <<
"________________________________________" << std::endl;
500 ostr <<
"________________________________________"
501 <<
"________________________________________" << std::endl;
507 "%4d %+4d %4d %4d (%9.3g, %9.3g, %9.3g, %9.3g, %9.3g)",
517 ostr << outline <<
"\n";
519 "%+9d %4d %4d (%9.3g, %9.3g, %9.3g, %9.3g)",
528 ostr << outline << std::endl;
534 "%4s %4s %4s %5s %10s, %9s, %9s, %9s, %10s",
544 ostr << outline << std::endl;
546 outline,
"%9s %4s %4s %10s, %9s, %9s, %9s) %9s",
"ID ",
"ents",
"dren",
"Prod ( X",
"Y",
"Z",
"cT",
"[mm]");
547 ostr << outline << std::endl;
552 #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
tuple size
Write out results.
static void set_sizeof_int(unsigned int)
define size of integer
static unsigned int s_sizeof_int