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
72 #ifdef _WIN32 // Platform: Windows MS Visual C++
76 extern "C" HEPCOM_DEF HEPCOM;
85 #define hepcom hepcom_
89 #endif // HEPMC_EPOS_COMMON_H
92 #ifndef HEPMC_EPOS_WRAPPER_H
93 #define HEPMC_EPOS_WRAPPER_H
147 static int status(
int index );
148 static int id(
int index );
155 static double px(
int index );
156 static double py(
int index );
157 static double pz(
int index );
158 static double e(
int index );
159 static double m(
int index );
160 static double x(
int index );
161 static double y(
int index );
162 static double z(
int index );
163 static double t(
int index );
174 static void set_status(
int index,
int status );
176 static void set_id(
int index,
int id );
178 static void set_parents(
int index,
int firstparent,
int lastparent );
180 static void set_children(
int index,
int firstchild,
int lastchild );
182 static void set_momentum(
int index,
double px,
double py,
183 double pz,
double e );
187 static void set_position(
int index,
double x,
double y,
double z,
230 if ( size !=
sizeof(
short int) && size !=
sizeof(
long int) && size !=
sizeof(
int) ) {
231 std::cerr <<
"HepMC is not able to handle integers "
232 <<
" of size other than 2 or 4."
233 <<
" You requested: " << size << std::endl;
239 if ( size !=
sizeof(
float) && size !=
sizeof(
double) ) {
240 std::cerr <<
"HepMC is not able to handle floating point numbers"
241 <<
" of size other than 4 or 8."
242 <<
" You requested: " << size << std::endl;
253 <<
"EPOS_Wrapper: requested hepcom data exceeds allocation"
256 float* myfloat = (
float*)&
hepcom.data[b];
257 return (
double)(*myfloat);
259 double* mydouble = (
double*)&
hepcom.data[b];
263 <<
"EPOS_Wrapper: illegal floating point number length."
271 <<
"EPOS_Wrapper: requested hepcom data exceeds allocation"
274 short int* myshortint = (
short int*)&
hepcom.data[b];
275 return (
int)(*myshortint);
277 long int* mylongint = (
long int*)&
hepcom.data[b];
281 int* myint = (
int*)&
hepcom.data[b];
285 <<
"EPOS_Wrapper: illegal integer number length."
293 <<
"EPOS_Wrapper: requested hepcom data exceeds allocation"
296 float* myfloat = (
float*)&
hepcom.data[b];
297 (*myfloat) = (float)in;
299 double* mydouble = (
double*)&
hepcom.data[b];
300 (*mydouble) = (double)in;
303 <<
"EPOS_Wrapper: illegal floating point number length."
310 <<
"EPOS_Wrapper: requested hepcom data exceeds allocation"
313 short int* myshortint = (
short int*)&
hepcom.data[b];
314 (*myshortint) = (
short int)in;
316 long int* mylongint = (
long int*)&
hepcom.data[b];
317 (*mylongint) = (int)in;
320 int* myint = (
int*)&
hepcom.data[b];
324 <<
"EPOS_Wrapper: illegal integer number length."
375 ? parent : firstparent;
380 return ( firstparent>0 ) ?
407 ? child : firstchild;
413 return ( firstchild>0 ) ?
515 double py,
double pz,
double e )
570 ostr <<
"________________________________________"
571 <<
"________________________________________" << std::endl;
572 ostr <<
"***** HEPEVT Common Event#: "
577 <<
sizeof_real() <<
"-byte floating point numbers, "
581 ostr <<
"________________________________________"
582 <<
"________________________________________" << std::endl;
586 ostr <<
"________________________________________"
587 <<
"________________________________________" << std::endl;
594 "%4d %+4d %4d %4d (%9.3g, %9.3g, %9.3g, %9.3g, %9.3g)"
597 ostr << outline <<
"\n";
598 sprintf( outline,
"%+9d %4d %4d (%9.3g, %9.3g, %9.3g, %9.3g)",
601 x(i),
y(i),
z(i),
t(i) );
602 ostr << outline << std::endl;
608 sprintf( outline,
"%4s %4s %4s %5s %10s, %9s, %9s, %9s, %10s",
609 "Indx",
"Stat",
"Par-",
"chil-",
610 "( P_x",
"P_y",
"P_z",
"Energy",
"M ) ");
611 ostr << outline << std::endl;
612 sprintf( outline,
"%9s %4s %4s %10s, %9s, %9s, %9s) %9s",
614 "Prod ( X",
"Y",
"Z",
"cT",
"[mm]");
615 ostr << outline << std::endl;
620 #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
return(e1-e2)*(e1-e2)+dp *dp
const unsigned int epos_bytes_allocation
static void print_legend(std::ostream &ostr=std::cout)
print output legend
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